From owner-svn-src-all@freebsd.org Sun May 19 04:56:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D9C15A2F6F; Sun, 19 May 2019 04:56:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 993DB76D0D; Sun, 19 May 2019 04:56:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C70B2241; Sun, 19 May 2019 04:56:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4J4u39K001642; Sun, 19 May 2019 04:56:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J4u38X001641; Sun, 19 May 2019 04:56:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905190456.x4J4u38X001641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 May 2019 04:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347965 - stable/12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 347965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 993DB76D0D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 04:56:04 -0000 Author: delphij Date: Sun May 19 04:56:02 2019 New Revision: 347965 URL: https://svnweb.freebsd.org/changeset/base/347965 Log: MFC r347488,347606: Update leap-seconds to leap-seconds.3676924800. Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/leap-seconds Sat May 18 21:20:38 2019 (r347964) +++ stable/12/usr.sbin/ntp/ntpd/leap-seconds Sun May 19 04:56:02 2019 (r347965) @@ -61,7 +61,12 @@ # or # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. +# July, 1991. +# reprinted in: +# Christine Hackman and Donald B Sullivan (eds.) +# Time and Frequency Measurement +# American Association of Physics Teachers (1996) +# , pp. 75-86 # # 4. The decision to insert a leap second into UTC is currently # the responsibility of the International Earth Rotation and @@ -199,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C53 -# File expires on: 28 December 2017 +# Updated through IERS Bulletin C57 +# File expires on: 28 December 2019 # -#@ 3723408000 +#@ 3786480000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -247,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d +#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a From owner-svn-src-all@freebsd.org Sun May 19 05:46:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7A315A3E0D; Sun, 19 May 2019 05:46:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3533B807FD; Sun, 19 May 2019 05:46:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B8002A99; Sun, 19 May 2019 05:46:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4J5kOPG027341; Sun, 19 May 2019 05:46:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J5kOkO027339; Sun, 19 May 2019 05:46:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905190546.x4J5kOkO027339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 19 May 2019 05:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347966 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 347966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3533B807FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 05:46:26 -0000 Author: imp Date: Sun May 19 05:46:24 2019 New Revision: 347966 URL: https://svnweb.freebsd.org/changeset/base/347966 Log: Add note about nvd / nda selection. Noticed by: cem@ Modified: head/share/man/man4/nvme.4 Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Sun May 19 04:56:02 2019 (r347965) +++ head/share/man/man4/nvme.4 Sun May 19 05:46:24 2019 (r347966) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2018 +.Dd May 18, 2019 .Dt NVME 4 .Os .Sh NAME @@ -119,6 +119,38 @@ hw.nvme.force_intx=1 .Ed .Pp Note that use of INTx implies disabling of per-CPU I/O queue pairs. +.Pp +The +.Xr nvd 4 +driver is used to provide a disk driver to the system by default. +The +.Xr nda 4 +driver can also be used instead. +The +.Xr nvd 4 +driver performs better with smaller transactions and few TRIM +commands. +It sends all commands directly the drive immediately. +The +.Xr nda 4 +driver performs better with larger transactions and also collapses +TRIM commands giving better performance. +It can queue commands to the drive; combine +.Dv BIO_DELETE +commands into a single trip; and +use the CAM I/O scheduler to bias one type of operation over another. +To select the +.Xr nda 4 +driver, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.nvme.use_nvd=0 +.Ed +.Pp +This value may also be set in the kernel config file with +.Bd -literal -offset indent +.Cd options NVME_USE_NVD=0 +.Ed .Sh SYSCTL VARIABLES The following controller-level sysctls are currently implemented: .Bl -tag -width indent From owner-svn-src-all@freebsd.org Sun May 19 06:01:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60EC015A4248; Sun, 19 May 2019 06:01:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01B1380D56; Sun, 19 May 2019 06:01:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D12BD2D76; Sun, 19 May 2019 06:01:11 +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 x4J61BBK035030; Sun, 19 May 2019 06:01:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J61Bdu035028; Sun, 19 May 2019 06:01:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905190601.x4J61Bdu035028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 19 May 2019 06:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347967 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 347967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01B1380D56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 06:01:12 -0000 Author: cem Date: Sun May 19 06:01:11 2019 New Revision: 347967 URL: https://svnweb.freebsd.org/changeset/base/347967 Log: nvd.4: Reference nda(4) Fix a totally minor typo in nvme.4 while here. Modified: head/share/man/man4/nvd.4 head/share/man/man4/nvme.4 Modified: head/share/man/man4/nvd.4 ============================================================================== --- head/share/man/man4/nvd.4 Sun May 19 05:46:24 2019 (r347966) +++ head/share/man/man4/nvd.4 Sun May 19 06:01:11 2019 (r347967) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2016 +.Dd May 18, 2019 .Dt NVD 4 .Os .Sh NAME @@ -86,6 +86,7 @@ hw.nvd.delete_max= .Ed .Sh SEE ALSO .Xr GEOM 4 , +.Xr nda 4 , .Xr nvme 4 , .Xr geom 8 , .Xr nvmecontrol 8 , Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Sun May 19 05:46:24 2019 (r347966) +++ head/share/man/man4/nvme.4 Sun May 19 06:01:11 2019 (r347967) @@ -130,7 +130,7 @@ The .Xr nvd 4 driver performs better with smaller transactions and few TRIM commands. -It sends all commands directly the drive immediately. +It sends all commands directly to the drive immediately. The .Xr nda 4 driver performs better with larger transactions and also collapses From owner-svn-src-all@freebsd.org Sun May 19 08:10:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14F1015A6579 for ; Sun, 19 May 2019 08:10:25 +0000 (UTC) (envelope-from hoangchan@gilimex.com) Received: from pmg.scmguard.vn (pmg.scmguard.vn [103.90.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 410A883A4F for ; Sun, 19 May 2019 08:10:24 +0000 (UTC) (envelope-from hoangchan@gilimex.com) Received: from pmg.scmguard.vn (localhost.localdomain [127.0.0.1]) by pmg.scmguard.vn (Proxmox) with ESMTP id BED1241887 for ; Sun, 19 May 2019 15:00:05 +0700 (+07) DKIM-Signature: v=1; a=rsa-sha256; d=gilimex.com; s=1553994678.gilimex; c=relaxed/relaxed; t=1558252796; h=from:subject:date:message-id:to:x-mailer:mime-version:content-type; bh=lrQTpefLvBuvb67U9kIRZcLuGYb68ssT9GQJkWX6ai8=; b=CMr3QXuonHjzDvApqHQrLr97ZVrEjPzeM2kVNQfvWbgKyAi8Kg7dXGe0+fnr/4yJzXtBZ26OSC0 72LIe2M70+KZAycqgihAWrOtgz7AeCIMD+d+HNZ90HUFxrXPp65gxVZba+5frdQGcEmTRPjv0HTNg oVBUlYuSVVf4VOvYQCE= Message-Id: X-Priority: 3 From: "OneDrive - Support" To: svn-src-all@freebsd.org Cc: Subject: =?UTF-8?B?Q2FzZSBJZDowOTgzODItSU5WT0lDRS54bHM=?= Date: Sun, 19 May 2019 14:59:55 +0700 X-Mailer: Kiwontech Mail 5.20.7053.42673 X-Rspamd-Queue-Id: 410A883A4F X-Spamd-Bar: +++++++ Authentication-Results: mx1.freebsd.org; dkim=fail (rsa verify failed) header.d=gilimex.com header.s=1553994678.gilimex header.b=CMr3QXuo; spf=pass (mx1.freebsd.org: domain of hoangchan@gilimex.com designates 103.90.221.50 as permitted sender) smtp.mailfrom=hoangchan@gilimex.com X-Spamd-Result: default: False [7.20 / 15.00]; SUBJ_EXCESS_BASE64(1.50)[]; R_SPF_ALLOW(-0.20)[+ip4:103.90.221.50]; R_DKIM_REJECT(1.00)[gilimex.com:s=1553994678.gilimex]; MIME_MA_MISSING_TEXT(2.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; DKIM_TRACE(0.00)[gilimex.com:-]; MIME_BASE64_TEXT(0.10)[]; HAS_X_PRIO_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: mx.gilimex.com]; FORGED_SENDER(0.30)[mail.gilimex.com@pmg.scmguard.vn,hoangchan@gilimex.com]; IP_SCORE(0.02)[country: VN(0.09)]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:135912, ipnet:103.90.221.0/24, country:VN]; RCVD_TLS_LAST(0.00)[]; FROM_NEQ_ENVFROM(0.00)[mail.gilimex.com@pmg.scmguard.vn,hoangchan@gilimex.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[scmguard.vn]; NEURAL_SPAM_MEDIUM(0.71)[0.709,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_SHORT(-0.31)[-0.313,0]; NEURAL_SPAM_LONG(1.00)[0.996,0]; MIME_HTML_ONLY(0.20)[]; RCVD_COUNT_TWO(0.00)[2]; GREYLIST(0.00)[pass,body] X-Spam: Yes MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 08:10:25 -0000 From owner-svn-src-all@freebsd.org Sun May 19 08:20:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DC1C15A7418; Sun, 19 May 2019 08:20:08 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com [209.85.166.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9701843DE; Sun, 19 May 2019 08:20:07 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-it1-f179.google.com with SMTP id q132so18303837itc.5; Sun, 19 May 2019 01:20:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QP+Xn0HtyG/EqsgaIhkvXAahQiGi39R5nGJsERvqbvk=; b=djBh09BXc2tiojZi4/DrD5QIaS/L+kBU99ClDQmBr4P3JzIY9yqzE0XLqhNX5zbnj4 qKBkVHE/0xZnB63btLIWwGOyyqOqrSXz+S/Tsug8eyDqROpIKd5X3D01UGK9mTdTbLFD OLpQsjASarBxACV5OOOf7Do97i01kvW+Symmwc5Uo7le9VmChCbeq94UkcSYDHZaTAcZ /3r0ONYUv/b5pnw/q0q1eAFVMkb6g7++EMtKO4UIJgL9KmsIge6XxeDIzk6qxKaCeoti i1FfL2IjYHiBXYU26+PeuOo6WC+klKgTvdc9afx0VpfWE8F3kivn8mbfdQxaTIdnvI+r GP5g== X-Gm-Message-State: APjAAAVsQCvz0/kebpKOqeVKkZXzUmcaN4hE2laXDUPKAd67YgGgdvRx 7MCanKPo+uNM5bkK/VvttPU3ku1ErsFSfREr1pE= X-Google-Smtp-Source: APXvYqw42EeHi7m6/F8HrIPR7M87fH2Pu2VmxMRcTBajEPnLcmHivzHkxlZqXoC6VTHLMhPbRQtv7XYKIi5OkC4fmVo= X-Received: by 2002:a02:caad:: with SMTP id e13mr2133735jap.142.1558253530178; Sun, 19 May 2019 01:12:10 -0700 (PDT) MIME-Version: 1.0 References: <201905161328.x4GDSmMd072071@repo.freebsd.org> <20190518084406.GX2748@kib.kiev.ua> In-Reply-To: <20190518084406.GX2748@kib.kiev.ua> From: Dmitry Chagin Date: Sun, 19 May 2019 11:11:59 +0300 Message-ID: Subject: Re: svn commit: r347695 - in head/sys: amd64/amd64 amd64/include kern To: Konstantin Belousov Cc: Dmitry Chagin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: C9701843DE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 08:20:08 -0000 =D1=81=D0=B1, 18 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 11:44, Konstantin B= elousov : > On Sat, May 18, 2019 at 11:35:29AM +0300, Dmitry Chagin wrote: > > =D1=87=D1=82, 16 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 16:29, Konstant= in Belousov : > > > > > Author: kib > > > Date: Thu May 16 13:28:48 2019 > > > New Revision: 347695 > > > URL: https://svnweb.freebsd.org/changeset/base/347695 > > > > > > Log: > > > amd64 pmap: rework delayed invalidation, removing global mutex. > > > > > > For machines having cmpxcgh16b instruction, i.e. everything but ver= y > > > early Athlons, provide lockless implementation of delayed > > > invalidation. > > > > > > The implementation maintains lock-less single-linked list with the > > > trick from the T.L. Harris article about volatile mark of the > elements > > > being removed. Double-CAS is used to atomically update both link an= d > > > generation. New thread starting DI appends itself to the end of th= e > > > queue, setting the generation to the generation of the last element > > > +1. On DI finish, thread donates its generation to the previous > > > element. The generation of the fake head of the list is the last > > > passed DI generation. Basically, the implementation is a queued > > > spinlock but without spinlock. > > > > > > > > > > Hi, Kostik! First of all thanks for the previous help. > > Second, this commit broke i915kms module. Unfortunatelly, > > I can't give you a lot of information becouse I see only black screen, > > but I can help with testing > Did you recompiled the module ? > I use pkg, but after your mail, yes, compiled drm-current-kmod root@mordor:~ # kldstat Id Refs Address Size Name 1 4 0xffffffff80200000 1d536e0 kernel 2 1 0xffffffff81f54000 11e8 acpi_call.ko root@mordor:~ # kldload i915kms sysctl_warn_reuse: can't re-use a leaf (compat.linuxkpi.debug)! drmn1: on vgapci1 device_attach: drmn1 attach returned 19 root@mordor:~ so, I'll ping freebsd-x11 From owner-svn-src-all@freebsd.org Sun May 19 09:18:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE2B815A89EF; Sun, 19 May 2019 09:18:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8076585F28; Sun, 19 May 2019 09:18:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D61C5036; Sun, 19 May 2019 09:18:10 +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 x4J9IAVm036580; Sun, 19 May 2019 09:18:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J9IAs1036579; Sun, 19 May 2019 09:18:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905190918.x4J9IAs1036579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 May 2019 09:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347968 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8076585F28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 09:18:11 -0000 Author: kib Date: Sun May 19 09:18:09 2019 New Revision: 347968 URL: https://svnweb.freebsd.org/changeset/base/347968 Log: Fix rw->ro remount when there is a text vnode mapping. Reported and tested by: hrs Sponsored by: The FreeBSD Foundation MFC after: 16 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun May 19 06:01:11 2019 (r347967) +++ head/sys/kern/vfs_subr.c Sun May 19 09:18:09 2019 (r347968) @@ -3146,7 +3146,7 @@ loop: if ((vp->v_type == VNON || (error == 0 && vattr.va_nlink > 0)) && - (vp->v_writecount == 0 || vp->v_type != VREG)) { + (vp->v_writecount <= 0 || vp->v_type != VREG)) { VOP_UNLOCK(vp, 0); vdropl(vp); continue; From owner-svn-src-all@freebsd.org Sun May 19 09:23:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42D6E15A8C51; Sun, 19 May 2019 09:23:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5919863FD; Sun, 19 May 2019 09:23:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A963751EE; Sun, 19 May 2019 09:23:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4J9NKmk041626; Sun, 19 May 2019 09:23:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J9NKOT041625; Sun, 19 May 2019 09:23:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905190923.x4J9NKOT041625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 19 May 2019 09:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347969 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 347969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5919863FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 09:23:21 -0000 Author: dchagin Date: Sun May 19 09:23:20 2019 New Revision: 347969 URL: https://svnweb.freebsd.org/changeset/base/347969 Log: Linux send() call returns EAGAIN instead of ENOTCONN in case when the socket is non-blocking and connect() is not finished yet. Initial patch developed by Steven Hartland in 2008 and adopted by me. PR: 129169 Reported by: smh@ MFC after: 2 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun May 19 09:18:09 2019 (r347968) +++ head/sys/compat/linux/linux_socket.c Sun May 19 09:23:20 2019 (r347969) @@ -798,6 +798,8 @@ linux_send(struct thread *td, struct linux_send_args * caddr_t to; int tolen; } */ bsd_args; + struct file *fp; + int error, fflag; bsd_args.s = args->s; bsd_args.buf = (caddr_t)PTRIN(args->msg); @@ -805,7 +807,21 @@ linux_send(struct thread *td, struct linux_send_args * bsd_args.flags = args->flags; bsd_args.to = NULL; bsd_args.tolen = 0; - return (sys_sendto(td, &bsd_args)); + error = sys_sendto(td, &bsd_args); + if (error == ENOTCONN) { + /* + * Linux doesn't return ENOTCONN for non-blocking sockets. + * Instead it returns the EAGAIN. + */ + error = getsock_cap(td, args->s, &cap_send_rights, &fp, + &fflag, NULL); + if (error == 0) { + if (fflag & FNONBLOCK) + error = EAGAIN; + fdrop(fp, td); + } + } + return (error); } struct linux_recv_args { From owner-svn-src-all@freebsd.org Sun May 19 09:24:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF74615A8CDE; Sun, 19 May 2019 09:24:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 520D086563; Sun, 19 May 2019 09:24:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2715951F1; Sun, 19 May 2019 09:24:52 +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 x4J9OqPH041749; Sun, 19 May 2019 09:24:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4J9OqQp041748; Sun, 19 May 2019 09:24:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905190924.x4J9OqQp041748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 May 2019 09:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347970 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 347970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 520D086563 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 09:24:52 -0000 Author: kib Date: Sun May 19 09:24:51 2019 New Revision: 347970 URL: https://svnweb.freebsd.org/changeset/base/347970 Log: MFC r347690, r347946: imgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance from r347148. Modified: stable/12/sys/kern/imgact_elf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Sun May 19 09:23:20 2019 (r347969) +++ stable/12/sys/kern/imgact_elf.c Sun May 19 09:24:51 2019 (r347970) @@ -958,12 +958,22 @@ __elfN(get_interp)(struct image_params *imgp, const El interp_name_len = phdr->p_filesz; if (phdr->p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr->p_offset) { + /* + * The vnode lock might be needed by the pagedaemon to + * clean pages owned by the vnode. Do not allow sleep + * waiting for memory with the vnode locked, instead + * try non-sleepable allocation first, and if it + * fails, go to the slow path were we drop the lock + * and do M_WAITOK. A text reference prevents + * modifications to the vnode content. + */ interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT); if (interp == NULL) { VOP_UNLOCK(imgp->vp, 0); interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); } + error = vn_rdwr(UIO_READ, imgp->vp, interp, interp_name_len, phdr->p_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, From owner-svn-src-all@freebsd.org Sun May 19 12:58:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A9815AD4E6; Sun, 19 May 2019 12:58:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECEAB8B839; Sun, 19 May 2019 12:58:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0D9774EC; Sun, 19 May 2019 12:58:45 +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 x4JCwjRx050473; Sun, 19 May 2019 12:58:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JCwjWS050469; Sun, 19 May 2019 12:58:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905191258.x4JCwjWS050469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 19 May 2019 12:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347971 - in head/sys: amd64/linux compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux compat/linux X-SVN-Commit-Revision: 347971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECEAB8B839 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 12:58:46 -0000 Author: trasz Date: Sun May 19 12:58:44 2019 New Revision: 347971 URL: https://svnweb.freebsd.org/changeset/base/347971 Log: Implement PTRACE_O_TRACESYSGOOD. This makes Linux strace(1) work. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20200 Modified: head/sys/amd64/linux/linux_ptrace.c head/sys/compat/linux/linux_emul.h head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Sun May 19 09:24:51 2019 (r347970) +++ head/sys/amd64/linux/linux_ptrace.c Sun May 19 12:58:44 2019 (r347971) @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include @@ -43,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #define LINUX_PTRACE_TRACEME 0 @@ -107,6 +111,37 @@ map_signum(int lsig, int *bsigp) return (0); } +int +linux_ptrace_status(struct thread *td, pid_t pid, int status) +{ + struct ptrace_lwpinfo lwpinfo; + struct linux_pemuldata *pem; + register_t saved_retval; + int error; + + saved_retval = td->td_retval[0]; + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + td->td_retval[0] = saved_retval; + if (error != 0) { + printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + return (status); + } + + pem = pem_find(td->td_proc); + KASSERT(pem != NULL, ("%s: proc emuldata not found.\n", __func__)); + + LINUX_PEM_SLOCK(pem); + if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && + lwpinfo.pl_flags & PL_FLAG_SCE) + status |= (LINUX_SIGTRAP | 0x80) << 8; + if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && + lwpinfo.pl_flags & PL_FLAG_SCX) + status |= (LINUX_SIGTRAP | 0x80) << 8; + LINUX_PEM_SUNLOCK(pem); + + return (status); +} + struct linux_pt_reg { l_ulong r15; l_ulong r14; @@ -279,6 +314,7 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void * static int linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) { + struct linux_pemuldata *pem; int mask; mask = 0; @@ -290,15 +326,20 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, return (EINVAL); } + pem = pem_find(td->td_proc); + KASSERT(pem != NULL, ("%s: proc emuldata not found.\n", __func__)); + /* * PTRACE_O_EXITKILL is ignored, we do that by default. */ + LINUX_PEM_XLOCK(pem); if (data & LINUX_PTRACE_O_TRACESYSGOOD) { - printf("%s: PTRACE_O_TRACESYSGOOD not implemented; " - "returning EINVAL\n", __func__); - return (EINVAL); + pem->ptrace_flags |= LINUX_PTRACE_O_TRACESYSGOOD; + } else { + pem->ptrace_flags &= ~LINUX_PTRACE_O_TRACESYSGOOD; } + LINUX_PEM_XUNLOCK(pem); if (data & LINUX_PTRACE_O_TRACEFORK) mask |= PTRACE_FORK; Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Sun May 19 09:24:51 2019 (r347970) +++ head/sys/compat/linux/linux_emul.h Sun May 19 12:58:44 2019 (r347971) @@ -32,6 +32,8 @@ #ifndef _LINUX_EMUL_H_ #define _LINUX_EMUL_H_ +struct image_params; + /* * modeled after similar structure in NetBSD * this will be extended as we need more functionality @@ -68,6 +70,7 @@ struct linux_pemuldata { struct sx pem_sx; /* lock for this struct */ void *epoll; /* epoll data */ uint32_t persona; /* process execution domain */ + uint32_t ptrace_flags; /* used by ptrace(2) */ }; #define LINUX_PEM_XLOCK(p) sx_xlock(&(p)->pem_sx) Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun May 19 09:24:51 2019 (r347970) +++ head/sys/compat/linux/linux_misc.c Sun May 19 12:58:44 2019 (r347971) @@ -886,27 +886,53 @@ linux_futimesat(struct thread *td, struct linux_futime } #endif -int -linux_common_wait(struct thread *td, int pid, int *status, - int options, struct rusage *ru) +static int +linux_common_wait(struct thread *td, int pid, int *statusp, + int options, struct __wrusage *wrup) { - int error, tmpstat; + siginfo_t siginfo; + idtype_t idtype; + id_t id; + int error, status, tmpstat; - error = kern_wait(td, pid, &tmpstat, options, ru); + if (pid == WAIT_ANY) { + idtype = P_ALL; + id = 0; + } else if (pid < 0) { + idtype = P_PGID; + id = (id_t)-pid; + } else { + idtype = P_PID; + id = (id_t)pid; + } + + /* + * For backward compatibility we implicitly add flags WEXITED + * and WTRAPPED here. + */ + options |= WEXITED | WTRAPPED; + error = kern_wait6(td, idtype, id, &status, options, wrup, &siginfo); if (error) return (error); - if (status) { - tmpstat &= 0xffff; - if (WIFSIGNALED(tmpstat)) + if (statusp) { + tmpstat = status & 0xffff; + if (WIFSIGNALED(tmpstat)) { tmpstat = (tmpstat & 0xffffff80) | bsd_to_linux_signal(WTERMSIG(tmpstat)); - else if (WIFSTOPPED(tmpstat)) + } else if (WIFSTOPPED(tmpstat)) { tmpstat = (tmpstat & 0xffff00ff) | (bsd_to_linux_signal(WSTOPSIG(tmpstat)) << 8); - else if (WIFCONTINUED(tmpstat)) +#if defined(__amd64__) && !defined(COMPAT_LINUX32) + if (WSTOPSIG(status) == SIGTRAP) { + tmpstat = linux_ptrace_status(td, + siginfo.si_pid, tmpstat); + } +#endif + } else if (WIFCONTINUED(tmpstat)) { tmpstat = 0xffff; - error = copyout(&tmpstat, status, sizeof(int)); + } + error = copyout(&tmpstat, statusp, sizeof(int)); } return (error); @@ -931,7 +957,7 @@ int linux_wait4(struct thread *td, struct linux_wait4_args *args) { int error, options; - struct rusage ru, *rup; + struct __wrusage wru, *wrup; if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) @@ -941,14 +967,14 @@ linux_wait4(struct thread *td, struct linux_wait4_args linux_to_bsd_waitopts(args->options, &options); if (args->rusage != NULL) - rup = &ru; + wrup = &wru; else - rup = NULL; - error = linux_common_wait(td, args->pid, args->status, options, rup); + wrup = NULL; + error = linux_common_wait(td, args->pid, args->status, options, wrup); if (error != 0) return (error); if (args->rusage != NULL) - error = linux_copyout_rusage(&ru, args->rusage); + error = linux_copyout_rusage(&wru.wru_self, args->rusage); return (error); } Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Sun May 19 09:24:51 2019 (r347970) +++ head/sys/compat/linux/linux_misc.h Sun May 19 12:58:44 2019 (r347971) @@ -149,8 +149,9 @@ extern int stclohz; #define LINUX_GRND_NONBLOCK 0x0001 #define LINUX_GRND_RANDOM 0x0002 -int linux_common_wait(struct thread *td, int pid, int *status, - int options, struct rusage *ru); +#if defined(__amd64__) && !defined(COMPAT_LINUX32) +int linux_ptrace_status(struct thread *td, int pid, int status); +#endif void linux_to_bsd_waitopts(int options, int *bsdopts); int linux_set_upcall_kse(struct thread *td, register_t stack); int linux_set_cloned_tls(struct thread *td, void *desc); From owner-svn-src-all@freebsd.org Sun May 19 13:14:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE18C15ADED7; Sun, 19 May 2019 13:14:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 2E37D8C37E; Sun, 19 May 2019 13:14:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4JDENJk069404; Sun, 19 May 2019 06:14:23 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4JDENmf069403; Sun, 19 May 2019 06:14:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905191314.x4JDENmf069403@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347962 - in stable/11: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/bm sys/dev/cs sys/dev/de sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/fe sys/dev/pcn sys/... In-Reply-To: <201905182043.x4IKhDdD038241@repo.freebsd.org> To: Brooks Davis Date: Sun, 19 May 2019 06:14:23 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2E37D8C37E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 13:14:26 -0000 > Author: brooks > Date: Sat May 18 20:43:13 2019 > New Revision: 347962 > URL: https://svnweb.freebsd.org/changeset/base/347962 > > Log: > MFC r339703, r347365, r347703, r347940 > > r339703: > Deprecate a number of less used 10 and 10/100 Ethernet devices. > > The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, > pcn, sf, sn, tl, tx, txp, vx, wb, xe > > The list as refined as part of FCP-0101. Per the FCP, devices may be > removed from the deprecation list if enough users are found or they are > converted to iflib. > > FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md > > r347365: > Update dme(4) to reflect that it will not be removed due to FCP-101. > > dme(4) is the built-in NIC on a couple non-expandable mips platforms and > thus should remain. The FCP has been updated to reflect this fact. > > Discussed with: imp > > r347703: > FCP-101: ae(4) is sufficently popular to be moved to the keep list. > > r347940: > Remove the notice that ae(4) will be removed in FreeBSD 13. > > MFC requested by: rgrimes > Approved by: re (kib) Thank you for following through with gettings this back to stable/11 for the upcoming release. Rod > Modified: > stable/11/share/man/man4/de.4 > stable/11/share/man/man4/ed.4 > stable/11/share/man/man4/man4.i386/cs.4 > stable/11/share/man/man4/man4.i386/ep.4 > stable/11/share/man/man4/man4.i386/ex.4 > stable/11/share/man/man4/man4.i386/fe.4 > stable/11/share/man/man4/man4.i386/vx.4 > stable/11/share/man/man4/man4.powerpc/bm.4 > stable/11/share/man/man4/pcn.4 > stable/11/share/man/man4/sf.4 > stable/11/share/man/man4/sn.4 > stable/11/share/man/man4/tl.4 > stable/11/share/man/man4/tx.4 > stable/11/share/man/man4/txp.4 > stable/11/share/man/man4/wb.4 > stable/11/share/man/man4/xe.4 > stable/11/sys/dev/bm/if_bm.c > stable/11/sys/dev/cs/if_cs.c > stable/11/sys/dev/de/if_de.c > stable/11/sys/dev/ed/if_ed.c > stable/11/sys/dev/ep/if_ep.c > stable/11/sys/dev/ex/if_ex.c > stable/11/sys/dev/fe/if_fe.c > stable/11/sys/dev/pcn/if_pcn.c > stable/11/sys/dev/sf/if_sf.c > stable/11/sys/dev/sn/if_sn.c > stable/11/sys/dev/tl/if_tl.c > stable/11/sys/dev/tx/if_tx.c > stable/11/sys/dev/txp/if_txp.c > stable/11/sys/dev/vx/if_vx.c > stable/11/sys/dev/wb/if_wb.c > stable/11/sys/dev/xe/if_xe.c > stable/11/sys/sys/systm.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/share/man/man4/de.4 > ============================================================================== > --- stable/11/share/man/man4/de.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/de.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt DE 4 > .Os > .Sh NAME > @@ -45,6 +45,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_de_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/ed.4 > ============================================================================== > --- stable/11/share/man/man4/ed.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/ed.4 Sat May 18 20:43:13 2019 (r347962) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 25, 2012 > +.Dd October 24, 2018 > .Dt ED 4 > .Os > .Sh NAME > @@ -51,6 +51,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_ed_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.i386/cs.4 > ============================================================================== > --- stable/11/share/man/man4/man4.i386/cs.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.i386/cs.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24 2018 > .Dt CS 4 i386 > .Os > .Sh NAME > @@ -52,6 +52,14 @@ In > .Cd hint.cs.0.port="0x300" > .Cd hint.cs.0.irq="10" > .Cd hint.cs.0.maddr="0xd000" > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.i386/ep.4 > ============================================================================== > --- stable/11/share/man/man4/man4.i386/ep.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.i386/ep.4 Sat May 18 20:43:13 2019 (r347962) > @@ -29,7 +29,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd April 1, 2011 > +.Dd October 24, 2018 > .Dt EP 4 i386 > .Os > .Sh NAME > @@ -49,6 +49,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_ep_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.i386/ex.4 > ============================================================================== > --- stable/11/share/man/man4/man4.i386/ex.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.i386/ex.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt EX 4 i386 > .Os > .Sh NAME > @@ -45,6 +45,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_ex_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.i386/fe.4 > ============================================================================== > --- stable/11/share/man/man4/man4.i386/fe.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.i386/fe.4 Sat May 18 20:43:13 2019 (r347962) > @@ -22,7 +22,7 @@ > .\" for fe driver. > .\" > .\" $FreeBSD$ > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt FE 4 i386 > .Os > .Sh NAME > @@ -48,6 +48,14 @@ In > .Cd hint.fe.0.at="isa" > .Cd hint.fe.0.port="0x300" > .Cd hint.fe.0.flags="0x0" > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.i386/vx.4 > ============================================================================== > --- stable/11/share/man/man4/man4.i386/vx.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.i386/vx.4 Sat May 18 20:43:13 2019 (r347962) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt VX 4 i386 > .Os > .Sh NAME > @@ -50,6 +50,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_vx_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/man4.powerpc/bm.4 > ============================================================================== > --- stable/11/share/man/man4/man4.powerpc/bm.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/man4.powerpc/bm.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 3, 2008 > +.Dd October 24, 2018 > .Dt BM 4 > .Os > .Sh NAME > @@ -46,6 +46,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_bm_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/pcn.4 > ============================================================================== > --- stable/11/share/man/man4/pcn.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/pcn.4 Sat May 18 20:43:13 2019 (r347962) > @@ -31,7 +31,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 31, 2006 > +.Dd October 24, 2018 > .Dt PCN 4 > .Os > .Sh NAME > @@ -52,6 +52,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_pcn_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/sf.4 > ============================================================================== > --- stable/11/share/man/man4/sf.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/sf.4 Sat May 18 20:43:13 2019 (r347962) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 21, 2008 > +.Dd October 24, 2018 > .Dt SF 4 > .Os > .Sh NAME > @@ -53,6 +53,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_sf_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/sn.4 > ============================================================================== > --- stable/11/share/man/man4/sn.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/sn.4 Sat May 18 20:43:13 2019 (r347962) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt SN 4 > .Os > .Sh NAME > @@ -44,6 +44,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_sn_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/tl.4 > ============================================================================== > --- stable/11/share/man/man4/tl.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/tl.4 Sat May 18 20:43:13 2019 (r347962) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt TL 4 > .Os > .Sh NAME > @@ -51,6 +51,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_tl_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/tx.4 > ============================================================================== > --- stable/11/share/man/man4/tx.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/tx.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt TX 4 > .Os > .Sh NAME > @@ -46,6 +46,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_tx_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/txp.4 > ============================================================================== > --- stable/11/share/man/man4/txp.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/txp.4 Sat May 18 20:43:13 2019 (r347962) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 26, 2012 > +.Dd October 24, 2018 > .Dt TXP 4 > .Os > .Sh NAME > @@ -46,6 +46,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_txp_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/wb.4 > ============================================================================== > --- stable/11/share/man/man4/wb.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/wb.4 Sat May 18 20:43:13 2019 (r347962) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24, 2018 > .Dt WB 4 > .Os > .Sh NAME > @@ -51,6 +51,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_wb_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/share/man/man4/xe.4 > ============================================================================== > --- stable/11/share/man/man4/xe.4 Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/share/man/man4/xe.4 Sat May 18 20:43:13 2019 (r347962) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 16, 2005 > +.Dd October 24 2018 > .Dt XE 4 > .Os > .Sh NAME > @@ -45,6 +45,14 @@ module at boot time, place the following line in > .Bd -literal -offset indent > if_xe_load="YES" > .Ed > +.Sh DEPRECATION NOTICE > +The > +.Nm > +driver is not present in > +.Fx 13.0 > +and later. > +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more > +information. > .Sh DESCRIPTION > The > .Nm > > Modified: stable/11/sys/dev/bm/if_bm.c > ============================================================================== > --- stable/11/sys/dev/bm/if_bm.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/bm/if_bm.c Sat May 18 20:43:13 2019 (r347962) > @@ -481,6 +481,8 @@ bm_attach(device_t dev) > ether_ifattach(ifp, sc->sc_enaddr); > ifp->if_hwassist = 0; > > + gone_by_fcp101_dev(dev); > + > return (0); > } > > > Modified: stable/11/sys/dev/cs/if_cs.c > ============================================================================== > --- stable/11/sys/dev/cs/if_cs.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/cs/if_cs.c Sat May 18 20:43:13 2019 (r347962) > @@ -572,6 +572,8 @@ cs_attach(device_t dev) > return (error); > } > > + gone_by_fcp101_dev(dev); > + > return (0); > } > > > Modified: stable/11/sys/dev/de/if_de.c > ============================================================================== > --- stable/11/sys/dev/de/if_de.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/de/if_de.c Sat May 18 20:43:13 2019 (r347962) > @@ -4430,6 +4430,8 @@ tulip_attach(tulip_softc_t * const sc) > TULIP_LOCK(sc); > sc->tulip_flags &= ~TULIP_DEVICEPROBE; > TULIP_UNLOCK(sc); > + > + gone_by_fcp101_dev(sc->tulip_dev); > } > > /* Release memory for a single descriptor ring. */ > > Modified: stable/11/sys/dev/ed/if_ed.c > ============================================================================== > --- stable/11/sys/dev/ed/if_ed.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/ed/if_ed.c Sat May 18 20:43:13 2019 (r347962) > @@ -363,6 +363,9 @@ ed_attach(device_t dev) > #endif > printf("\n"); > } > + > + gone_by_fcp101_dev(dev); > + > return (0); > } > > > Modified: stable/11/sys/dev/ep/if_ep.c > ============================================================================== > --- stable/11/sys/dev/ep/if_ep.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/ep/if_ep.c Sat May 18 20:43:13 2019 (r347962) > @@ -348,6 +348,8 @@ ep_attach(struct ep_softc *sc) > epstop(sc); > EP_UNLOCK(sc); > > + gone_by_fcp101_dev(sc->dev); > + > return (0); > } > > > Modified: stable/11/sys/dev/ex/if_ex.c > ============================================================================== > --- stable/11/sys/dev/ex/if_ex.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/ex/if_ex.c Sat May 18 20:43:13 2019 (r347962) > @@ -274,6 +274,8 @@ ex_attach(device_t dev) > return (error); > } > > + gone_by_fcp101_dev(dev); > + > return(0); > } > > > Modified: stable/11/sys/dev/fe/if_fe.c > ============================================================================== > --- stable/11/sys/dev/fe/if_fe.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/fe/if_fe.c Sat May 18 20:43:13 2019 (r347962) > @@ -870,6 +870,8 @@ fe_attach (device_t dev) > if (sc->stability & UNSTABLE_TYPE) > device_printf(dev, "warning: hardware type was not validated\n"); > > + gone_by_fcp101_dev(dev); > + > return 0; > } > > > Modified: stable/11/sys/dev/pcn/if_pcn.c > ============================================================================== > --- stable/11/sys/dev/pcn/if_pcn.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/pcn/if_pcn.c Sat May 18 20:43:13 2019 (r347962) > @@ -680,6 +680,8 @@ fail: > if (error) > pcn_detach(dev); > > + gone_by_fcp101_dev(dev); > + > return(error); > } > > > Modified: stable/11/sys/dev/sf/if_sf.c > ============================================================================== > --- stable/11/sys/dev/sf/if_sf.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/sf/if_sf.c Sat May 18 20:43:13 2019 (r347962) > @@ -914,6 +914,8 @@ sf_attach(device_t dev) > goto fail; > } > > + gone_by_fcp101_dev(dev); > + > fail: > if (error) > sf_detach(dev); > > Modified: stable/11/sys/dev/sn/if_sn.c > ============================================================================== > --- stable/11/sys/dev/sn/if_sn.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/sn/if_sn.c Sat May 18 20:43:13 2019 (r347962) > @@ -225,6 +225,9 @@ sn_attach(device_t dev) > sn_detach(dev); > return err; > } > + > + gone_by_fcp101_dev(dev); > + > return 0; > } > > > Modified: stable/11/sys/dev/tl/if_tl.c > ============================================================================== > --- stable/11/sys/dev/tl/if_tl.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/tl/if_tl.c Sat May 18 20:43:13 2019 (r347962) > @@ -1239,6 +1239,8 @@ tl_attach(dev) > goto fail; > } > > + gone_by_fcp101_dev(dev); > + > fail: > if (error) > tl_detach(dev); > > Modified: stable/11/sys/dev/tx/if_tx.c > ============================================================================== > --- stable/11/sys/dev/tx/if_tx.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/tx/if_tx.c Sat May 18 20:43:13 2019 (r347962) > @@ -426,6 +426,8 @@ epic_attach(device_t dev) > goto fail; > } > > + gone_by_fcp101_dev(dev); > + > return (0); > fail: > epic_release(sc); > > Modified: stable/11/sys/dev/txp/if_txp.c > ============================================================================== > --- stable/11/sys/dev/txp/if_txp.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/txp/if_txp.c Sat May 18 20:43:13 2019 (r347962) > @@ -471,6 +471,8 @@ txp_attach(device_t dev) > goto fail; > } > > + gone_by_fcp101_dev(dev); > + > return (0); > > fail: > > Modified: stable/11/sys/dev/vx/if_vx.c > ============================================================================== > --- stable/11/sys/dev/vx/if_vx.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/vx/if_vx.c Sat May 18 20:43:13 2019 (r347962) > @@ -204,6 +204,8 @@ vx_attach(device_t dev) > vx_stop(sc); > VX_UNLOCK(sc); > > + gone_by_fcp101_dev(dev); > + > return 1; > } > > > Modified: stable/11/sys/dev/wb/if_wb.c > ============================================================================== > --- stable/11/sys/dev/wb/if_wb.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/wb/if_wb.c Sat May 18 20:43:13 2019 (r347962) > @@ -692,6 +692,8 @@ wb_attach(dev) > goto fail; > } > > + gone_by_fcp101_dev(dev); > + > fail: > if (error) > wb_detach(dev); > > Modified: stable/11/sys/dev/xe/if_xe.c > ============================================================================== > --- stable/11/sys/dev/xe/if_xe.c Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/dev/xe/if_xe.c Sat May 18 20:43:13 2019 (r347962) > @@ -315,6 +315,8 @@ xe_attach(device_t dev) > return (err); > } > > + gone_by_fcp101_dev(dev); > + > /* Done */ > return (0); > } > > Modified: stable/11/sys/sys/systm.h > ============================================================================== > --- stable/11/sys/sys/systm.h Sat May 18 19:36:23 2019 (r347961) > +++ stable/11/sys/sys/systm.h Sat May 18 20:43:13 2019 (r347962) > @@ -482,6 +482,9 @@ void _gone_in_dev(struct device *dev, int major, const > #endif > #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) > #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) > +#define gone_by_fcp101_dev(dev) \ > + gone_in_dev((dev), 13, \ > + "see https://github.com/freebsd/fcp/blob/master/fcp-0101.md") > > __NULLABILITY_PRAGMA_POP > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun May 19 15:07:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD9F15B04AB; Sun, 19 May 2019 15:07:14 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 951AB8F6F8; Sun, 19 May 2019 15:07:14 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 842888A79; Sun, 19 May 2019 15:07:14 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JF7EVs018579; Sun, 19 May 2019 15:07:14 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JF7EvV018578; Sun, 19 May 2019 15:07:14 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905191507.x4JF7EvV018578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Sun, 19 May 2019 15:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347972 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 347972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 951AB8F6F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 15:07:15 -0000 Author: stevek Date: Sun May 19 15:07:14 2019 New Revision: 347972 URL: https://svnweb.freebsd.org/changeset/base/347972 Log: Add missing setting of hv_base to the leaf that we used. Correct setting hv_high to use regs[0], not leaf. Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sun May 19 12:58:44 2019 (r347971) +++ head/sys/x86/x86/identcpu.c Sun May 19 15:07:14 2019 (r347972) @@ -1382,7 +1382,8 @@ identify_hypervisor_cpuid_base(void) * and vendor identifier. */ if (vm_guest != VM_GUEST_VM || leaf == 0x40000000) { - hv_high = leaf; + hv_base = leaf; + hv_high = regs[0]; ((u_int *)&hv_vendor)[0] = regs[1]; ((u_int *)&hv_vendor)[1] = regs[2]; ((u_int *)&hv_vendor)[2] = regs[3]; From owner-svn-src-all@freebsd.org Sun May 19 15:44:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 435E515B0EC6; Sun, 19 May 2019 15:44:23 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D91BE69B47; Sun, 19 May 2019 15:44:22 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9812A9146; Sun, 19 May 2019 15:44:22 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JFiMjV039224; Sun, 19 May 2019 15:44:22 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JFiLSd039221; Sun, 19 May 2019 15:44:21 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905191544.x4JFiLSd039221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sun, 19 May 2019 15:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347973 - in head/sys: compat/lindebugfs modules modules/lindebugfs X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/lindebugfs modules modules/lindebugfs X-SVN-Commit-Revision: 347973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D91BE69B47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 15:44:23 -0000 Author: johalun Date: Sun May 19 15:44:21 2019 New Revision: 347973 URL: https://svnweb.freebsd.org/changeset/base/347973 Log: LinuxKPI: Finalize move of lindebugfs from ports to base. The source file was moved to base earlier and also improved upon, but never compiled in. This patch will: - Make a module in sys/modules - Make lindebugfs depend on linuxkpi (for seq_file) - Check if read/write functions are set before calling, DRM drivers don't always set both of them. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Added: head/sys/modules/lindebugfs/ head/sys/modules/lindebugfs/Makefile (contents, props changed) Modified: head/sys/compat/lindebugfs/lindebugfs.c head/sys/modules/Makefile Modified: head/sys/compat/lindebugfs/lindebugfs.c ============================================================================== --- head/sys/compat/lindebugfs/lindebugfs.c Sun May 19 15:07:14 2019 (r347972) +++ head/sys/compat/lindebugfs/lindebugfs.c Sun May 19 15:44:21 2019 (r347973) @@ -143,10 +143,17 @@ debugfs_fill(PFS_FILL_ARGS) } sf = lf.private_data; sf->buf = sb; - if (uio->uio_rw == UIO_READ) - rc = d->dm_fops->read(&lf, NULL, len, &off); - else - rc = d->dm_fops->write(&lf, buf, len, &off); + if (uio->uio_rw == UIO_READ) { + if (d->dm_fops->read) + rc = d->dm_fops->read(&lf, NULL, len, &off); + else + rc = ENODEV; + } else { + if (d->dm_fops->write) + rc = d->dm_fops->write(&lf, buf, len, &off); + else + rc = ENODEV; + } if (d->dm_fops->release) d->dm_fops->release(&vn, &lf); else @@ -307,3 +314,4 @@ PSEUDOFS(debugfs, 1, PR_ALLOW_MOUNT_LINSYSFS); #else PSEUDOFS(debugfs, 1, VFCF_JAIL); #endif +MODULE_DEPEND(lindebugfs, linuxkpi, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun May 19 15:07:14 2019 (r347972) +++ head/sys/modules/Makefile Sun May 19 15:44:21 2019 (r347973) @@ -205,6 +205,7 @@ SUBDIR= \ libalias \ libiconv \ libmchain \ + lindebugfs \ ${_linux} \ ${_linux_common} \ ${_linux64} \ Added: head/sys/modules/lindebugfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/lindebugfs/Makefile Sun May 19 15:44:21 2019 (r347973) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/compat/lindebugfs + +KMOD= lindebugfs +SRCS= vnode_if.h \ + device_if.h bus_if.h pci_if.h \ + lindebugfs.c + +CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include + +.include From owner-svn-src-all@freebsd.org Sun May 19 15:53:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEC6815B1362; Sun, 19 May 2019 15:53:33 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 56D306A1C5; Sun, 19 May 2019 15:53:32 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from vmware.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id 94BDF42EB9; Mon, 20 May 2019 00:53:19 +0900 (JST) Date: Sun, 19 May 2019 11:52:28 -0400 From: Yoshihiro Ota To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347968 - head/sys/kern Message-Id: <20190519115228.49fdc5c833c2abe06f894dc2@j.email.ne.jp> In-Reply-To: <201905190918.x4J9IAs1036579@repo.freebsd.org> References: <201905190918.x4J9IAs1036579@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 56D306A1C5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 15:53:34 -0000 Hi, Does this change fix 'mount -u -rw /path' to remount read-only device with write mode? I moticed an issue a couple of days ago but didn't have time to conform nor report. Thanks, Hiro On Sun, 19 May 2019 09:18:10 +0000 (UTC) Konstantin Belousov wrote: > Author: kib > Date: Sun May 19 09:18:09 2019 > New Revision: 347968 > URL: https://svnweb.freebsd.org/changeset/base/347968 > > Log: > Fix rw->ro remount when there is a text vnode mapping. > > Reported and tested by: hrs > Sponsored by: The FreeBSD Foundation > MFC after: 16 days > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Sun May 19 06:01:11 2019 (r347967) > +++ head/sys/kern/vfs_subr.c Sun May 19 09:18:09 2019 (r347968) > @@ -3146,7 +3146,7 @@ loop: > > if ((vp->v_type == VNON || > (error == 0 && vattr.va_nlink > 0)) && > - (vp->v_writecount == 0 || vp->v_type != VREG)) { > + (vp->v_writecount <= 0 || vp->v_type != VREG)) { > VOP_UNLOCK(vp, 0); > vdropl(vp); > continue; > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sun May 19 15:55:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C68A715B15AF; Sun, 19 May 2019 15:55:51 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 17B6F6A501; Sun, 19 May 2019 15:55:49 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from vmware.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id 05A1B43A04; Mon, 20 May 2019 00:55:45 +0900 (JST) Date: Sun, 19 May 2019 11:54:56 -0400 From: Yoshihiro Ota To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Benedict Reuschling , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib Message-Id: <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> In-Reply-To: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> References: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 17B6F6A501 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.15 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [-0.79 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[15.55.224.202.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[email.ne.jp]; NEURAL_HAM_LONG(-0.98)[-0.980,0]; NEURAL_SPAM_SHORT(0.49)[0.491,0]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[sbmx.asahi-net.or.jp]; RCPT_COUNT_SEVEN(0.00)[9]; NEURAL_HAM_MEDIUM(-0.57)[-0.575,0]; IP_SCORE(0.08)[asn: 4685(0.47), country: JP(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 15:55:52 -0000 I wonder if we can use a tool to confirm coding style like clang-format or something else. I tried to setup clang-format and 2 others in the past like a year ago but wasn't able to do... Hiro On Sat, 18 May 2019 06:06:51 -0700 (PDT) "Rodney W. Grimes" wrote: > > Hello Konstantin and Bruce, > > > > thank you for your comments. Clearly, this should have been addressed in > > the review and checked by a second pair of eyes. I mostly did the man > > page changes and can't comment much on the actual coding example. Two > > people (dab and jilles) approved the revision in the Phabricator review. > > There was plenty of time to review it between April 16 and May 15 when > > then the original submitter asked if there was anything else that needs > > to be done. > > The quality of a code review is highly dependent on who is invited > to do the reviewing, and how much participation and care those invited > have with respect to the process. Man pages that contain code samples > need to have more reviewers, you need man page experts, you need subject > mater experts, and you need coding experts. This review could of used > more reviewers (hind sight is 20/20) but if they had not been the right > reviewers the low quality commit would of probably still occurred. > > The amount of time in review is not a good measure of review completness, > that falls more onto the quality of the workmanship of those actually > commented on a review. I myself consider a LGTM, or a accept by a reviewer > who makes 0 comments on my code in phab as if that reviewer probably > just rubber stamped my change, UNLESS I have extremly high trust in > that person. If bde, imp, or kib stamp an approve on something of mine my > confidence level is very high and I do consider that code well reviewed, > if I get a rubber stamp from some others I am not so confident. > > Now we have the problem in that note every code review can be done by > such high quality engineers due to time and work load constraints, so > we need to raise the level of others closer to these shinning stars > and offset this lack of avaliable resources by other means (more > reviewers, long review cycles, automations, etc.) > > > > Now, having said that and the the change is now both in HEAD and > > stable/12, how do we proceed? Revert them both or patch those issues as > > follow-ups? Note that a src committer should do that and not me trying > > to add more EXAMPLE sections to man pages with my doc commit bit. > > There is another option, a revert is actually a local operation > to your checked out code, ou can check out head, revert this > commit, but do not commit, make the corrections, and then commit. > > When MFC's this single commit does the right thing. > > You could also revert in head, commit and later fix these > issues, commit, and then MFC both of those commits. > > All of your proposed solutions, and my additions are workable, > and I really have no preference on a single file change like > this. > > Good Day, > Rod > > > Regards, > > Benedict > > > > > > > > Am 18.05.19 um 07:45 schrieb Bruce Evans: > > > On Sat, 18 May 2019, Konstantin Belousov wrote: > > > > > >> On Sat, May 18, 2019 at 03:15:08AM +0000, Benedict Reuschling wrote: > > >>> Author: bcr (doc committer) > > >>> Date: Sat May 18 03:15:07 2019 > > >>> New Revision: 347951 > > >>> URL: https://svnweb.freebsd.org/changeset/base/347951 > > >>> > > >>> Log: > > >>> ? MFC r347617: > > >>> ? Add small EXAMPLE section to bsearch.3. > > >>> > > >>> ? Submitted by:??????????? fernape (via Phabricator) > > >>> ? Reviewed by:??????????? bcr, jilles, dab > > >>> ? Approved by:??????????? bcr (man pages), jilles (src) > > >>> ? Differential Revision:??????? https://reviews.freebsd.org/D19902 > > >>> > > >>> Modified: > > >>> ? stable/12/lib/libc/stdlib/bsearch.3 > > >>> Directory Properties: > > >>> ? stable/12/?? (props changed) > > >>> > > >>> Modified: stable/12/lib/libc/stdlib/bsearch.3 > > >>> ============================================================================== > > >>> > > >>> --- stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 02:02:14 > > >>> 2019??? (r347950) > > >>> +++ stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 03:15:07 > > >>> 2019??? (r347951) > > >>> @@ -32,7 +32,7 @@ > > >>> ?.\"???? @(#)bsearch.3??? 8.3 (Berkeley) 4/19/94 > > >>> ?.\" $FreeBSD$ > > >>> ?.\" > > >>> -.Dd February 22, 2013 > > >>> +.Dd May 15, 2019 > > >>> ?.Dt BSEARCH 3 > > >>> ?.Os > > >>> ?.Sh NAME > > >>> @@ -83,6 +83,61 @@ The > > >>> ?function returns a pointer to a matching member of the array, or a null > > >>> ?pointer if no match is found. > > >>> ?If two members compare as equal, which member is matched is > > >>> unspecified. > > >>> +.Sh EXAMPLES > > >>> +A sample program that searches people by age in a sorted array: > > >>> +.Bd -literal > > >>> +#include > > >>> +#include > > >>> +#include > > >>> +#include > > >>> +#include > > >>> + > > >>> +struct person { > > >>> +??? char name[5]; > > >>> +??? int age; > > >>> +}; > > > > > > This example has a high density of style bugs.? kib pointed out some. > > > Some of the others are: > > > > > > (1) Not sorting the struct members on alignment.? (style(9) says to sort > > > ??? on use, then size, but means alignment). > > > (2) Not indenting the struct member names. > > > (3) Not use a prefix for struct member names.? This is not important for > > > ??? small programs. > > > > > >>> + > > >>> +int > > >>> +compare(const void *key, const void *array_member) > > >>> +{ > > >>> +??? int age = (intptr_t) key; > > >>> +??? struct person person = *(struct person *) array_member; > > >> These two lines contain at least three style(9) bugs, and at least one > > >> warning at higher warning level. > > >> > > >>> + > > >>> +??? return (age - person.age); > > >>> +} > > >>> + > > >>> +int > > >>> +main() > > >> Why use K&R definition ? > > >> > > >>> +{ > > >>> +??? struct person *friend; > > >>> + > > >>> +??? /* Sorted array */ > > >>> +??? struct person friends[6] = { > > >>> +??????? { "paul", 22 }, > > >>> +??????? { "anne", 25 }, > > >>> +??????? { "fred", 25 }, > > >>> +??????? { "mary", 27 }, > > >>> +??????? { "mark", 35 }, > > >>> +??????? { "bill", 50 } > > >>> +??? }; > > >>> + > > >>> +??? size_t array_size = sizeof(friends) / sizeof(struct person); > > >> Since you used const elsewere, why did not you used it there ? > > > > > > (4) The size expression is obfuscated by spelling the element size as > > > ??? sizeof(struct person) instead of sizeof(friends[0]). > > > (5?) FreeBSD now spells this size expression as nitems(friends).? I don't > > > ??? like the unportability of this, especially in an example. > > > > > >> > > >>> + > > >>> +??? friend = bsearch((void *)22, &friends, array_size, sizeof(struct > > >>> person), compare); > > >> Taking address of an array is weird. > > >> Line is too long. > > > > > > (6) C99 specifies that the search is for a member of the array that matches > > > ??? the object pointed to by 'key'.? Here the key of (void *)22 is a > > > ??? not a pointer to an object.? It is a cookie which points to garbage. > > > ??? The cookie is unique enough to work in practice.? Perhaps you can > > > ??? prove it to always work if the option type intptr_t is supported. > > > ??? But this is a bad example. > > > (4a) same obfuscation of the element size. > > > > > >> > > >>> +??? assert(strcmp(friend->name, "paul") == 0); > > >>> +??? printf("name: %s\enage: %d\en", friend->name, friend->age); > > >>> + > > > > > > (7) Extra blank line.? This is not too bad, but is not done consistently. > > > > > >>> +??? friend = bsearch((void *)25, &friends, array_size, sizeof(struct > > >>> person), compare); > > > > > > (8) More too-long lines. > > > (4b) More sizeof(person)'s. > > > > > >>> +??? assert(strcmp(friend->name, "fred") == 0 || strcmp(friend->name, > > >>> "anne") == 0); > > > > > > (7a) No extra blank line for "fred". > > > > > >>> +??? printf("name: %s\enage: %d\en", friend->name, friend->age); > > >>> + > > >>> +??? friend = bsearch((void *)30, &friends, array_size, sizeof(struct > > >>> person), compare); > > >>> +??? assert(friend == NULL); > > >>> +??? printf("friend aged 30 not found\en"); > > > > > > I didn't notice before that the key cookie was an encoding of the age. > > > > > > The key is not unique (there are 2 25's).? This gives an example of low > > > quality data and the example has minimal error handling handling for this > > > without describing what it is doing (it asserts uniqueness for age 22 and > > > it asserts one of the 2 possibilities for age 25.? It can only do this > > > because it knows too much about the data). > > > > > > It is more than a style bug to handle errors in data by assert() or > > > otherwise killing the program, except possibly when the data is supposed > > > to be good. > > > > > >>> + > > >>> +??? return (EXIT_SUCCESS); > > >>> +} > > >>> +.Ed > > >>> ?.Sh SEE ALSO > > >>> ?.Xr db 3 , > > >>> ?.Xr lsearch 3 , > > > > > > Bruce > > > > > > -- > Rod Grimes rgrimes@freebsd.org > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sun May 19 16:57:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2560715B2B05; Sun, 19 May 2019 16:57:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4B5F6C451; Sun, 19 May 2019 16:57:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E40E9D2D; Sun, 19 May 2019 16:57:01 +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 x4JGv06G075753; Sun, 19 May 2019 16:57:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JGv0tI075747; Sun, 19 May 2019 16:57:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905191657.x4JGv0tI075747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 19 May 2019 16:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347974 - in head/sys: conf dev/usb dev/usb/net modules/usb/usb X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: conf dev/usb dev/usb/net modules/usb/usb X-SVN-Commit-Revision: 347974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4B5F6C451 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 16:57:02 -0000 Author: ian Date: Sun May 19 16:56:59 2019 New Revision: 347974 URL: https://svnweb.freebsd.org/changeset/base/347974 Log: Add common support functions for USB devices configured via FDT data. FDT data is sometimes used to configure usb devices which are hardwired into an embedded system. Because the devices are instantiated by the usb enumeration process rather than by ofwbus iterating through the fdt data, it is somewhat difficult for a usb driver to locate fdt data that belongs to it. In the past, various ad-hoc methods have been used, which can lead to errors such applying configuration that should apply only to a hardwired device onto a similar device attached by the user at runtime. For example, if the user adds an ethernet device that uses the same driver as the builtin ethernet, both devices might end up with the same MAC address. These changes add a new usb_fdt_get_node() helper function that a driver can use to locate FDT data that belongs to a single unique instance of the device. This function locates the proper FDT data using the mechanism detailed in the standard "usb-device.txt" binding document [1]. There is also a new usb_fdt_get_mac_addr() function, used to retrieve the mac address for a given device instance from the fdt data. It uses usb_fdt_get_node() to locate the right node in the FDT data, and attempts to obtain the mac-address or local-mac-address property (in that order, the same as linux does it). The existing if_smsc driver is modified to use the new functions, both as an example and for testing the new functions. Rpi and rpi2 boards use this driver and provide the mac address via the fdt data. [1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/usb/usb-device.txt Differential Revision: https://reviews.freebsd.org/D20262 Added: head/sys/dev/usb/usb_fdt_support.c (contents, props changed) head/sys/dev/usb/usb_fdt_support.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/net/if_smsc.c head/sys/modules/usb/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 19 15:44:21 2019 (r347973) +++ head/sys/conf/files Sun May 19 16:56:59 2019 (r347974) @@ -3215,6 +3215,7 @@ dev/usb/usb_dev.c optional usb dev/usb/usb_device.c optional usb dev/usb/usb_dynamic.c optional usb dev/usb/usb_error.c optional usb +dev/usb/usb_fdt_support.c optional usb fdt dev/usb/usb_generic.c optional usb dev/usb/usb_handle_request.c optional usb dev/usb/usb_hid.c optional usb Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sun May 19 15:44:21 2019 (r347973) +++ head/sys/dev/usb/net/if_smsc.c Sun May 19 16:56:59 2019 (r347974) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include @@ -1559,148 +1560,7 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data return (rc); } -#ifdef FDT -/* - * This is FreeBSD-specific compatibility strings for RPi/RPi2 - */ -static phandle_t -smsc_fdt_find_eth_node(phandle_t start) -{ - phandle_t child, node; - - /* Traverse through entire tree to find usb ethernet nodes. */ - for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if ((ofw_bus_node_is_compatible(node, "net,ethernet") && - ofw_bus_node_is_compatible(node, "usb,device")) || - ofw_bus_node_is_compatible(node, "usb424,ec00")) - return (node); - child = smsc_fdt_find_eth_node(node); - if (child != -1) - return (child); - } - - return (-1); -} - -/* - * Check if node's path is <*>/usb/hub/ethernet - */ -static int -smsc_fdt_is_usb_eth(phandle_t node) -{ - char name[16]; - int len; - - memset(name, 0, sizeof(name)); - len = OF_getprop(node, "name", name, sizeof(name)); - if (len <= 0) - return (0); - - if (strcmp(name, "ethernet")) - return (0); - - node = OF_parent(node); - if (node == -1) - return (0); - len = OF_getprop(node, "name", name, sizeof(name)); - if (len <= 0) - return (0); - - if (strcmp(name, "hub")) - return (0); - - node = OF_parent(node); - if (node == -1) - return (0); - len = OF_getprop(node, "name", name, sizeof(name)); - if (len <= 0) - return (0); - - if (strcmp(name, "usb")) - return (0); - - return (1); -} - -static phandle_t -smsc_fdt_find_eth_node_by_path(phandle_t start) -{ - phandle_t child, node; - - /* Traverse through entire tree to find usb ethernet nodes. */ - for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (smsc_fdt_is_usb_eth(node)) - return (node); - child = smsc_fdt_find_eth_node_by_path(node); - if (child != -1) - return (child); - } - - return (-1); -} - -/* - * Look through known names that can contain mac address - * return 0 if valid MAC address has been found - */ -static int -smsc_fdt_read_mac_property(phandle_t node, unsigned char *mac) -{ - int len; - - /* Check if there is property */ - if ((len = OF_getproplen(node, "local-mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "local-mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - - if ((len = OF_getproplen(node, "mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - - return (ENXIO); -} - /** - * Get MAC address from FDT blob. Firmware or loader should fill - * mac-address or local-mac-address property. Returns 0 if MAC address - * obtained, error code otherwise. - */ -static int -smsc_fdt_find_mac(unsigned char *mac) -{ - phandle_t node, root; - - root = OF_finddevice("/"); - node = smsc_fdt_find_eth_node(root); - if (node != -1) { - if (smsc_fdt_read_mac_property(node, mac) == 0) - return (0); - } - - /* - * If it's not FreeBSD FDT blob for RPi, try more - * generic .../usb/hub/ethernet - */ - node = smsc_fdt_find_eth_node_by_path(root); - - if (node != -1) - return smsc_fdt_read_mac_property(node, mac); - - return (ENXIO); -} -#endif - -/** * smsc_attach_post - Called after the driver attached to the USB interface * @ue: the USB ethernet device * @@ -1748,7 +1608,7 @@ smsc_attach_post(struct usb_ether *ue) err = smsc_eeprom_read(sc, 0x01, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); #ifdef FDT if ((err != 0) || (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr))) - err = smsc_fdt_find_mac(sc->sc_ue.ue_eaddr); + err = usb_fdt_get_mac_addr(sc->sc_ue.ue_dev, &sc->sc_ue); #endif if ((err != 0) || (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr))) { read_random(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); Added: head/sys/dev/usb/usb_fdt_support.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/usb_fdt_support.c Sun May 19 16:56:59 2019 (r347974) @@ -0,0 +1,168 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ian Lepore + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Define a constant for allocating an array pointers to serve as a stack of + * devices between the controller and any arbitrary device on the bus. The + * stack ends with the device itself, so add 1 to the max hub nesting depth. + */ +#define MAX_UDEV_NEST (MAX(USB_HUB_MAX_DEPTH, USB_SS_HUB_DEPTH_MAX) + 1) + +static phandle_t +find_udev_in_children(phandle_t parent, struct usb_device *udev) +{ + phandle_t child; + ssize_t proplen; + uint32_t port; + char compat[16]; /* big enough for "usb1234,abcd" */ + + /* + * USB device nodes in FDT have a compatible string of "usb" followed by + * the vendorId,productId rendered in hex. The port number is encoded + * in the standard 'reg' property; it is one-based in the FDT data, but + * usb_device.port_index is zero-based. To uniquely identify a device, + * both the compatible string and the port number must match. + */ + snprintf(compat, sizeof(compat), "usb%x,%x", + UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct)); + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + if (!ofw_bus_node_is_compatible(child, compat)) + continue; + proplen = OF_getencprop(child, "reg", &port, sizeof(port)); + if (proplen != sizeof(port)) + continue; + if (port == (udev->port_index + 1)) + return (child); + } + return (-1); +} + +static bool +is_valid_mac_addr(uint8_t *addr) +{ + + /* + * All-bits-zero and all-bits-one are a couple common cases of what + * might get read from unprogrammed eeprom or OTP data, weed them out. + */ + if ((addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]) == 0x00) + return (false); + if ((addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff) + return (false); + return (true); +} + +int +usb_fdt_get_mac_addr(device_t dev, struct usb_ether* ue) +{ + phandle_t node; + ssize_t i, proplen; + uint8_t mac[sizeof(ue->ue_eaddr)]; + static const char *properties[] = { + "mac-address", + "local-mac-address" + }; + + if ((node = usb_fdt_get_node(ue->ue_dev, ue->ue_udev)) == -1) + return (ENXIO); + for (i = 0; i < nitems(properties); ++i) { + proplen = OF_getprop(node, properties[i], mac, sizeof(mac)); + if (proplen == sizeof(mac) && is_valid_mac_addr(mac)) { + memcpy(ue->ue_eaddr, mac, sizeof(ue->ue_eaddr)); + return (0); + } + } + return (ENXIO); +} + +phandle_t +usb_fdt_get_node(device_t dev, struct usb_device *udev) +{ + struct usb_device *ud; + struct usb_device *udev_stack[MAX_UDEV_NEST]; + phandle_t controller_node, node; + int idx; + + /* + * Start searching at the controller node. The usb_device links to the + * bus, and its parent is the controller. If we can't get the + * controller node, the requesting device cannot be in the fdt data. + */ + if ((controller_node = ofw_bus_get_node(udev->bus->parent)) == -1) + return (-1); + + /* + * Walk up the usb hub ancestor hierarchy, building a stack of devices + * that begins with the requesting device and includes all the hubs + * between it and the controller, NOT including the root hub (the FDT + * bindings treat the controller and root hub as the same thing). + */ + for (ud = udev, idx = 0; ud->parent_hub != NULL; ud = ud->parent_hub) { + KASSERT(idx < nitems(udev_stack), ("Too many hubs")); + udev_stack[idx++] = ud; + } + + /* + * Now walk down the stack of udevs from the controller to the + * requesting device, and also down the hierarchy of nested children of + * the controller node in the fdt data. At each nesting level of fdt + * data look for a child node whose properties match the vID,pID,portIdx + * tuple for the udev at the corresponding layer of the udev stack. As + * long as we keep matching up child nodes with udevs, loop and search + * within the children of the just-found child for the next-deepest hub. + * If at any level we fail to find a matching node, stop searching and + * return. When we hit the end of the stack (the requesting device) we + * return whatever the result was for the search at that nesting level. + */ + for (node = controller_node;;) { + node = find_udev_in_children(node, udev_stack[--idx]); + if (idx == 0 || node == -1) + break; + } + return (node); +} Added: head/sys/dev/usb/usb_fdt_support.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/usb_fdt_support.h Sun May 19 16:56:59 2019 (r347974) @@ -0,0 +1,48 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ian Lepore + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _USB_FDT_SUPPORT_H_ +#define _USB_FDT_SUPPORT_H_ + +struct usb_device; +struct usb_ether; + +/* + * Get the device's MAC address from the FDT data. Fills in ue->ue_eaddr and + * returns 0 on success, otherwise leaves ue_eaddr untouched and returns + * non-zero. This first attempts to get the address from the "mac-address" + * property, and if that's not valid it tries the "local-mac-address" property; + * this matches the linux interpretation of the precedence of those properties. + */ +int usb_fdt_get_mac_addr(device_t dev, struct usb_ether* ue); + +/* Get the FDT node for dev. Returns -1 if dev is not in the FDT data. */ +phandle_t usb_fdt_get_node(device_t dev, struct usb_device* udev); + +#endif Modified: head/sys/modules/usb/usb/Makefile ============================================================================== --- head/sys/modules/usb/usb/Makefile Sun May 19 15:44:21 2019 (r347973) +++ head/sys/modules/usb/usb/Makefile Sun May 19 16:56:59 2019 (r347974) @@ -39,4 +39,8 @@ SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if. usb_msctest.c usb_parse.c usb_pf.c usb_process.c usb_request.c \ usb_transfer.c usb_util.c +.if !empty(OPT_FDT) +SRCS+= usb_fdt_support.c ofw_bus_if.h +.endif + .include From owner-svn-src-all@freebsd.org Sun May 19 17:05:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDC5115B2F88; Sun, 19 May 2019 17:05:21 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay103.isp.belgacom.be (mailrelay103.isp.belgacom.be [195.238.20.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E92416CAA4; Sun, 19 May 2019 17:05:20 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DnAAAhjOFc/1H1sVtkHAEBAQQBAQc?= =?us-ascii?q?EAQGBUQcBAQsBAYIPWBFRASASFBSMLl+KDQEBggw1AYdngh6OGoF7CQEBAgE?= =?us-ascii?q?BAQEBKwwBAYRAAoIzJDQJDgEDAQEFAQEBAQRtHAxCAQwBhHsBBScTHCMQCw4?= =?us-ascii?q?GBAklD0gGE4Mjgg4LqkUzhDMBCwGEWoEKBoE0AYtngX+BEYMSPoREhWIEiwy?= =?us-ascii?q?INZRXCYIPhi6EQYgBJ5YfLYNPj0OQRTiBV00wCIMnghsXiGCFQT0DMINfi3g?= =?us-ascii?q?BAQ?= X-IPAS-Result: =?us-ascii?q?A2DnAAAhjOFc/1H1sVtkHAEBAQQBAQcEAQGBUQcBAQsBA?= =?us-ascii?q?YIPWBFRASASFBSMLl+KDQEBggw1AYdngh6OGoF7CQEBAgEBAQEBKwwBAYRAA?= =?us-ascii?q?oIzJDQJDgEDAQEFAQEBAQRtHAxCAQwBhHsBBScTHCMQCw4GBAklD0gGE4Mjg?= =?us-ascii?q?g4LqkUzhDMBCwGEWoEKBoE0AYtngX+BEYMSPoREhWIEiwyINZRXCYIPhi6EQ?= =?us-ascii?q?YgBJ5YfLYNPj0OQRTiBV00wCIMnghsXiGCFQT0DMINfi3gBAQ?= Received: from 81.245-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.245.81]) by relay.skynet.be with ESMTP; 19 May 2019 19:05:12 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id x4JH5Che001814; Sun, 19 May 2019 19:05:12 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 19 May 2019 19:05:11 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dmitry Chagin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347533 - in head/sys: compat/linux modules/linux_common Message-ID: <20190519190511.6e8f436c@kalimero.tijl.coosemans.org> In-Reply-To: <201905131748.x4DHmGaH020444@repo.freebsd.org> References: <201905131748.x4DHmGaH020444@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E92416CAA4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 17:05:22 -0000 On Mon, 13 May 2019 17:48:16 +0000 (UTC) Dmitry Chagin wrote: > Author: dchagin > Date: Mon May 13 17:48:16 2019 > New Revision: 347533 > URL: https://svnweb.freebsd.org/changeset/base/347533 > > Log: > Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions > alter the userspace sockaddr to convert the format between linux and BSD versions. > That's the minimum 3 of copyin/copyout operations for one syscall. > > Also some syscall uses linux_sa_put() and linux_getsockaddr() when load > sockaddr to userspace or from userspace accordingly. > > To avoid this chaos, especially converting sockaddr in the userspace, > rewrite these 4 functions to convert sockaddr only in kernel and leave > only 2 of this functions. > > Also in order to reduce duplication between MD parts of the Linuxulator put > struct sockaddr conversion functions that are MI out into linux_common module. > > PR: 232920 > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20157 > > Modified: > head/sys/compat/linux/linux.c > head/sys/compat/linux/linux.h > head/sys/compat/linux/linux_common.h > head/sys/compat/linux/linux_socket.c > head/sys/compat/linux/linux_socket.h > head/sys/modules/linux_common/Makefile > > Modified: head/sys/compat/linux/linux_socket.c > ============================================================================== > --- head/sys/compat/linux/linux_socket.c Mon May 13 16:38:48 2019 (r347532) > +++ head/sys/compat/linux/linux_socket.c Mon May 13 17:48:16 2019 (r347533) > @@ -1282,6 +1110,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc > struct mbuf *control = NULL; > struct mbuf **controlp; > struct timeval *ftmvl; > + struct l_sockaddr *lsa; > + struct sockaddr *sa; > l_timeval ltmvl; > caddr_t outbuf; > void *data; > @@ -1305,36 +1135,34 @@ linux_recvmsg_common(struct thread *td, l_int s, struc > return (error); > > if (msg->msg_name) { > - error = linux_to_bsd_sockaddr((struct sockaddr *)msg->msg_name, > - msg->msg_namelen); > - if (error != 0) > - goto bad; > + sa = malloc(msg->msg_namelen, M_SONAME, M_WAITOK); > + msg->msg_name = sa; > } > > uiov = msg->msg_iov; > msg->msg_iov = iov; > controlp = (msg->msg_control != NULL) ? &control : NULL; > - error = kern_recvit(td, s, msg, UIO_USERSPACE, controlp); > + error = kern_recvit(td, s, msg, UIO_SYSSPACE, controlp); > msg->msg_iov = uiov; > if (error != 0) > goto bad; > > - error = bsd_to_linux_msghdr(msg, &linux_msg); > - if (error != 0) > - goto bad; > - > - if (linux_msg.msg_name) { > - error = bsd_to_linux_sockaddr((struct sockaddr *) > - PTRIN(linux_msg.msg_name)); > + if (sa) { sa may be uninitialised here. From owner-svn-src-all@freebsd.org Sun May 19 17:28:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5AE15B342A; Sun, 19 May 2019 17:28:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 306036D298; Sun, 19 May 2019 17:28:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03DA4A24A; Sun, 19 May 2019 17:28:01 +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 x4JHS0As091611; Sun, 19 May 2019 17:28:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JHS0Kx091609; Sun, 19 May 2019 17:28:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905191728.x4JHS0Kx091609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 19 May 2019 17:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347975 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 347975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 306036D298 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 17:28:01 -0000 Author: tuexen Date: Sun May 19 17:28:00 2019 New Revision: 347975 URL: https://svnweb.freebsd.org/changeset/base/347975 Log: Improve input validation for the IPPROTO_SCTP level socket options SCTP_CONNECT_X and SCTP_CONNECT_X_DELAYED. Some issues where found by running syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 19 16:56:59 2019 (r347974) +++ head/sys/netinet/sctp_usrreq.c Sun May 19 17:28:00 2019 (r347975) @@ -1352,13 +1352,12 @@ static int sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval, size_t optsize, void *p, int delay) { - int error = 0; + int error; int creat_lock_on = 0; struct sctp_tcb *stcb = NULL; struct sockaddr *sa; unsigned int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr; uint32_t vrf_id; - int bad_addresses = 0; sctp_assoc_t *a_id; SCTPDBG(SCTP_DEBUG_PCB1, "Connectx called\n"); @@ -1397,17 +1396,12 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb totaddrp = (unsigned int *)optval; totaddr = *totaddrp; sa = (struct sockaddr *)(totaddrp + 1); - stcb = sctp_connectx_helper_find(inp, sa, &totaddr, &num_v4, &num_v6, &error, (unsigned int)(optsize - sizeof(int)), &bad_addresses); - if ((stcb != NULL) || bad_addresses) { + error = sctp_connectx_helper_find(inp, sa, totaddr, &num_v4, &num_v6, (unsigned int)(optsize - sizeof(int))); + if (error != 0) { /* Already have or am bring up an association */ SCTP_ASOC_CREATE_UNLOCK(inp); creat_lock_on = 0; - if (stcb) - SCTP_TCB_UNLOCK(stcb); - if (bad_addresses == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); - error = EALREADY; - } + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); goto out_now; } #ifdef INET6 Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 19 16:56:59 2019 (r347974) +++ head/sys/netinet/sctputil.c Sun May 19 17:28:00 2019 (r347975) @@ -6391,30 +6391,33 @@ out_now: return (added); } -struct sctp_tcb * +int sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - unsigned int *totaddr, - unsigned int *num_v4, unsigned int *num_v6, int *error, - unsigned int limit, int *bad_addr) + unsigned int totaddr, + unsigned int *num_v4, unsigned int *num_v6, + unsigned int limit) { struct sockaddr *sa; - struct sctp_tcb *stcb = NULL; + struct sctp_tcb *stcb; unsigned int incr, at, i; at = 0; sa = addr; - *error = *num_v6 = *num_v4 = 0; + *num_v6 = *num_v4 = 0; /* account and validate addresses */ - for (i = 0; i < *totaddr; i++) { + if (totaddr == 0) { + return (EINVAL); + } + for (i = 0; i < totaddr; i++) { + if (at + sizeof(struct sockaddr) > limit) { + return (EINVAL); + } switch (sa->sa_family) { #ifdef INET case AF_INET: incr = (unsigned int)sizeof(struct sockaddr_in); if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } (*num_v4) += 1; break; @@ -6427,46 +6430,34 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, stru sin6 = (struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { /* Must be non-mapped for connectx */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } incr = (unsigned int)sizeof(struct sockaddr_in6); if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } (*num_v6) += 1; break; } #endif default: - *totaddr = i; - incr = 0; - /* we are done */ - break; + return (EINVAL); } - if (i == *totaddr) { - break; + if ((at + incr) > limit) { + return (EINVAL); } SCTP_INP_INCR_REF(inp); stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb != NULL) { - /* Already have or am bring up an association */ - return (stcb); + SCTP_TCB_UNLOCK(stcb); + return (EALREADY); } else { SCTP_INP_DECR_REF(inp); } - if ((at + incr) > limit) { - *totaddr = i; - break; - } + at += incr; sa = (struct sockaddr *)((caddr_t)sa + incr); } - return ((struct sctp_tcb *)NULL); + return (0); } /* Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun May 19 16:56:59 2019 (r347974) +++ head/sys/netinet/sctputil.h Sun May 19 17:28:00 2019 (r347975) @@ -211,10 +211,9 @@ int sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr, int totaddr, int *error); -struct sctp_tcb * -sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - unsigned int *totaddr, unsigned int *num_v4, unsigned int *num_v6, - int *error, unsigned int limit, int *bad_addr); +int +sctp_connectx_helper_find(struct sctp_inpcb *, struct sockaddr *, + unsigned int, unsigned int *, unsigned int *, unsigned int); int sctp_is_there_an_abort_here(struct mbuf *, int, uint32_t *); #ifdef INET6 From owner-svn-src-all@freebsd.org Sun May 19 17:51:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 223E715B3EB8; Sun, 19 May 2019 17:51:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE78E6E0F2; Sun, 19 May 2019 17:51:14 +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 x4JHp6rt029300 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 19 May 2019 20:51:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4JHp6rt029300 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4JHp4F7029299; Sun, 19 May 2019 20:51:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 May 2019 20:51:04 +0300 From: Konstantin Belousov To: Yoshihiro Ota Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347968 - head/sys/kern Message-ID: <20190519175104.GP2748@kib.kiev.ua> References: <201905190918.x4J9IAs1036579@repo.freebsd.org> <20190519115228.49fdc5c833c2abe06f894dc2@j.email.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519115228.49fdc5c833c2abe06f894dc2@j.email.ne.jp> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 17:51:16 -0000 On Sun, May 19, 2019 at 11:52:28AM -0400, Yoshihiro Ota wrote: > Hi, > > Does this change fix 'mount -u -rw /path' to remount read-only device with write mode? > I moticed an issue a couple of days ago but didn't have time to conform nor report. I do not understand your description. If you mean does this commit has any relevance to the issue of remounting ro->rw, it should not. It only affects rw->ro remounts, when you have a binary executed from the mount point. > > Thanks, > Hiro > > On Sun, 19 May 2019 09:18:10 +0000 (UTC) > Konstantin Belousov wrote: > > > Author: kib > > Date: Sun May 19 09:18:09 2019 > > New Revision: 347968 > > URL: https://svnweb.freebsd.org/changeset/base/347968 > > > > Log: > > Fix rw->ro remount when there is a text vnode mapping. > > > > Reported and tested by: hrs > > Sponsored by: The FreeBSD Foundation > > MFC after: 16 days > > > > Modified: > > head/sys/kern/vfs_subr.c > > > > Modified: head/sys/kern/vfs_subr.c > > ============================================================================== > > --- head/sys/kern/vfs_subr.c Sun May 19 06:01:11 2019 (r347967) > > +++ head/sys/kern/vfs_subr.c Sun May 19 09:18:09 2019 (r347968) > > @@ -3146,7 +3146,7 @@ loop: > > > > if ((vp->v_type == VNON || > > (error == 0 && vattr.va_nlink > 0)) && > > - (vp->v_writecount == 0 || vp->v_type != VREG)) { > > + (vp->v_writecount <= 0 || vp->v_type != VREG)) { > > VOP_UNLOCK(vp, 0); > > vdropl(vp); > > continue; > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sun May 19 17:53:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A91715B3F70; Sun, 19 May 2019 17:53:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8A66E477; Sun, 19 May 2019 17:53:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1420AA730; Sun, 19 May 2019 17:53:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JHraI3006949; Sun, 19 May 2019 17:53:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JHrao7006948; Sun, 19 May 2019 17:53:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905191753.x4JHrao7006948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 19 May 2019 17:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347976 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 347976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D8A66E477 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 17:53:37 -0000 Author: tuexen Date: Sun May 19 17:53:36 2019 New Revision: 347976 URL: https://svnweb.freebsd.org/changeset/base/347976 Log: Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state. This issue was found by running syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 19 17:28:00 2019 (r347975) +++ head/sys/netinet/sctp_usrreq.c Sun May 19 17:53:36 2019 (r347976) @@ -5332,10 +5332,11 @@ sctp_setopt(struct socket *so, int optname, void *optv net->dest_state &= ~SCTP_ADDR_NOHB; } if (paddrp->spp_flags & SPP_HB_DEMAND) { - /* on demand HB */ - sctp_send_hb(stcb, net, SCTP_SO_LOCKED); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { + sctp_send_hb(stcb, net, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); + } } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { From owner-svn-src-all@freebsd.org Sun May 19 18:31:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E774F158AEF0; Sun, 19 May 2019 18:31:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 832FE6F675; Sun, 19 May 2019 18:31:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59BD6AD92; Sun, 19 May 2019 18:31:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JIVM97026315; Sun, 19 May 2019 18:31:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JIVMc0026314; Sun, 19 May 2019 18:31:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905191831.x4JIVMc0026314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 May 2019 18:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347977 - stable/11/etc/ntp X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/etc/ntp X-SVN-Commit-Revision: 347977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 832FE6F675 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 18:31:23 -0000 Author: delphij Date: Sun May 19 18:31:21 2019 New Revision: 347977 URL: https://svnweb.freebsd.org/changeset/base/347977 Log: MFC r347488,347606: Update leap-seconds to leap-seconds.3676924800. Approved by: re (kib) Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Sun May 19 17:53:36 2019 (r347976) +++ stable/11/etc/ntp/leap-seconds Sun May 19 18:31:21 2019 (r347977) @@ -61,7 +61,12 @@ # or # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. +# July, 1991. +# reprinted in: +# Christine Hackman and Donald B Sullivan (eds.) +# Time and Frequency Measurement +# American Association of Physics Teachers (1996) +# , pp. 75-86 # # 4. The decision to insert a leap second into UTC is currently # the responsibility of the International Earth Rotation and @@ -199,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C53 -# File expires on: 28 December 2017 +# Updated through IERS Bulletin C57 +# File expires on: 28 December 2019 # -#@ 3723408000 +#@ 3786480000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -247,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d +#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a From owner-svn-src-all@freebsd.org Sun May 19 19:42:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF1B1158F7F4; Sun, 19 May 2019 19:42:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B26771AD6; Sun, 19 May 2019 19:42:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 520B5B9A0; Sun, 19 May 2019 19:42:36 +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 x4JJgaIX065398; Sun, 19 May 2019 19:42:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JJgaWd065397; Sun, 19 May 2019 19:42:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905191942.x4JJgaWd065397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 19 May 2019 19:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347978 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 347978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B26771AD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 19:42:37 -0000 Author: dim Date: Sun May 19 19:42:35 2019 New Revision: 347978 URL: https://svnweb.freebsd.org/changeset/base/347978 Log: Fix OptionalObsoleteFiles copy/paste mistake from r345236, which connected libomp to the build. The comparison should not have been against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously. MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 19 18:31:21 2019 (r347977) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 19 19:42:35 2019 (r347978) @@ -7749,7 +7749,7 @@ OLD_FILES+=usr/share/man/man8/smpquery.8.gz OLD_FILES+=usr/share/man/man8/vendstat.8.gz .endif -.if ${MK_OPENSSH} == no +.if ${MK_OPENMP} == no .if ${MK_GCC} == no OLD_FILES+=usr/include/omp.h .endif From owner-svn-src-all@freebsd.org Sun May 19 20:13:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 666A91590229; Sun, 19 May 2019 20:13:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDEF7729C2; Sun, 19 May 2019 20:13:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE1A5C05A; Sun, 19 May 2019 20:13:55 +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 x4JKDtda081381; Sun, 19 May 2019 20:13:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JKDtTA081379; Sun, 19 May 2019 20:13:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905192013.x4JKDtTA081379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 19 May 2019 20:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347979 - in head: lib/libomp tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: lib/libomp tools/build/mk X-SVN-Commit-Revision: 347979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDEF7729C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 20:13:56 -0000 Author: dim Date: Sun May 19 20:13:55 2019 New Revision: 347979 URL: https://svnweb.freebsd.org/changeset/base/347979 Log: To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC does not ship a -lomp symlink. Also update OptionalObsoleteFiles for this, and add 32-bit variants while here. Submitted by: jbeich PR: 237975 MFC after: 3 days Modified: head/lib/libomp/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Sun May 19 19:42:35 2019 (r347978) +++ head/lib/libomp/Makefile Sun May 19 20:13:55 2019 (r347979) @@ -68,4 +68,6 @@ VERSION_MAP= ${OMPSRC}/exports_so.txt LIBADD+= pthread LIBADD+= m +SYMLINKS+= ${SHLIB_NAME} ${LIBDIR}/libgomp.so + .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 19 19:42:35 2019 (r347978) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 19 20:13:55 2019 (r347979) @@ -2746,12 +2746,16 @@ OLD_FILES+=usr/include/omp.h .endif OLD_FILES+=usr/lib/libgcov.a OLD_FILES+=usr/lib/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib/libgomp.so +.endif OLD_LIBS+=usr/lib/libgomp.so.1 OLD_FILES+=usr/lib/libgomp_p.a OLD_FILES+=usr/lib32/libgcov.a OLD_FILES+=usr/lib32/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib32/libgomp.so +.endif OLD_LIBS+=usr/lib32/libgomp.so.1 OLD_FILES+=usr/lib32/libgomp_p.a OLD_FILES+=usr/libexec/cc1 @@ -7752,8 +7756,11 @@ OLD_FILES+=usr/share/man/man8/vendstat.8.gz .if ${MK_OPENMP} == no .if ${MK_GCC} == no OLD_FILES+=usr/include/omp.h +OLD_LIBS+=usr/lib/libgomp.so +OLD_LIBS+=usr/lib32/libgomp.so .endif OLD_LIBS+=usr/lib/libomp.so +OLD_LIBS+=usr/lib32/libomp.so .endif .if ${MK_OPENSSH} == no From owner-svn-src-all@freebsd.org Sun May 19 18:57:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C11B0158B884; Sun, 19 May 2019 18:57:09 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxout1bln1.prossl.de (mxout1bln1.prossl.de [91.233.87.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 164EF706EE; Sun, 19 May 2019 18:57:08 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from Voyager-109.local ([207.164.22.10]) (authenticated bits=0) by mx1bln1.prossl.de (8.15.2/8.14.9) with ESMTPSA id x4JIv2GX095222 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 19 May 2019 20:57:04 +0200 Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib To: Yoshihiro Ota , rgrimes@freebsd.org Cc: "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov , Ed Maste References: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> From: Benedict Reuschling Openpgp: preference=signencrypt Autocrypt: addr=bcr@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFr4feYBCACdrnRpuvW/d/PeKuFu54ifaGhG+yFf3wnWaQX8hTCvySbv6A24Owot6cyU vhjdsifZ9iRQ82Likl+6OxI9qBXR9N+WCv1ut46q+mL50YLnYRejRCz8vEmVunlyVDKjsBY5 DtjsaRXMJ/D56wh3ROd9VYjrDHWobu+bg9D7RIv0kCyoPd0JsYRFXISgt4IocWVLT8ciWqiT Pp3m37BPrtXhR3EDOnHmGWPf6SuolvveqyOlpdguD3LAkFJDLeq3isnMaLXUhcsTqBTBLdOT 6EJHBYCcq39izNVC88JsVBmEuByhpb0LaXrBFQWhUG5RyecROAqrx+DWhcZnxayCtr3NABEB AAG0N0JlbmVkaWN0IFJldXNjaGxpbmcgKHd3dy5mcmVlYnNkLm9yZykgPGJjckBGcmVlQlNE Lm9yZz6JAVQEEwEKAD4CGwMFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AWIQRTQnZtbeuE5dPj 3Pah0MHTBYXRWAUCWviOpwUJA8J3wQAKCRCh0MHTBYXRWJfJB/9qxBylB2KlA5EkdhyOp9cO O8kGpx301Rg6I/IUDACmDRvZckthpaUlNJ/RBYtid12o9A9kIhabdEaZfoBcV+ehyq3iSnff 9U+YlXkQ0iOflujWfgyMKNmaseWAPl6aCYc4gUsRH6YTVJFANPdofAIghEFLeY4jPsfkCIPP SAzUK1kQDtsHc5zwTYltqiKRBxQe1Y8WftitRp4LkTkR2wxWggp5oS6yKzh0kRir+U+5pFWZ 9g4ZQGxqodp8fKHI1IsJvs921UArjbmtLmDbrd28SK96i5ck4xga6mPf7ShhE9haYy1A+cbK fDhwizaJUl/H3jjXXbPv1MuIsvo+qEKVuQENBFr4f7wBCACxULIM5UFaEyZwAojYMXwIF/QW zq20MXaQXjn2JxJp04VaQHCL794ZrNtvkTvyqxYVFCKjvJHPXsT4zKuglMSTi83choejs7DJ 4YNmBBJKDHbugAcb5OgdTaT+ztUGl1VL4S3iEvWJwBAOUuzd9TTC/4GhYnUJR7A0CeEZnPfF av2K+d8BZ8x/XryFgQo3Wi5FnOekwls4v1wzzJE4ssaW4p357fmXRG2Czzytzf/W3I2/VWFm 2J8P8TIzSoJq+girktqhH+dYwbDeWkldWj6egcMdpVzJ89ottXARQYeu6YFSHnmHHnBhX2hV z+K2WkVLqYwj7XdBQAtPxIk8VlMBABEBAAGJAnIEGAEKACYCGwIWIQRTQnZtbeuE5dPj3Pah 0MHTBYXRWAUCWviOsgUJA8J19gFAwHQgBBkBCgAdFiEEwXonQDvNfP/33IoBVXQ7/QHhjTUF Alr4f7wACgkQVXQ7/QHhjTWg7Qf/WzBvcfskO8HBHfmLEE5zJRIOgogl6kVwvwR6PjihhMFC iBeH2fGz8nTtkouSttcbMnLnmV0qVv/r5FgIohTlEimaQUh7LgQKiql2SdYVpF1ha/3NHerR 1Rc0OGW+eliseI9b9/OKkY1AOaRM98HGJZB6TO2iKf2wiJDjr1RdlN2VcCST+ksG2Ehc3RvZ UTY1Kw5i9BOKsTsiQkrpCsrZ2/0tqvwv7efYJ0FOHfm0WbmvAlfdpxqsWmtgdsa0m/ItBtpo zIhlZs8/BlOmDK5571bAmWOV0apXSgp6OTmeQkpIsJKjwj/JwOhzvfkxZv03Js4+51xKjotT ma8XGjnJKgkQodDB0wWF0Vj+Wwf/f5cEjvLmq+Xw0KYjPA8oqk9L5a4Z9J/BdeH630koZ2wP YUwUsF/rFfdZf7jHvJJas1I0ctsutvhlgu4Elb7kJrfNRMSXUXe8ucdPS/cH9M/y9e7flW3i c/Ik14rV1Z1E9ME0CtDzfUtS3BfhyxpgmHbQmgPv/NkCE8Zu+nU/1QInpi7ZrDWWyJOCndcm R4kZpP0MJ0OCTWGDkDtJG4zIRQKeJKscqolWo7yu3GiG/Fr9W5cfr3IIo9xp8UQ06idbjjSV jItrSmL/HoZYQ7DSGCsQObC6snbkdeWRSaz/TCzEth5O0NGgA37apNaF3TZTbxRWcMG9uICc oGpDIZeCe7kBDQRa+IBQAQgA2EV0IFUgcJEpznzSxRhKajgLUmP/CJkUrXRipRrR0PqeXEH2 dF1+T8JObDVBN33oXwbXfIvBUhEw2uWsAHDW8OqzUsCTUxdy3ehVHkxHw1deXfvYf5VTtSli QsVIEJ0LZtD3V0idDnfGAhWqbMubBtF2tj1I6P2Py+RlU1pMD4B4g8zcWU+H4H39tpLkd9c/ kTemaX6QwRNW42L8+tDjL4pUogf8/tweMOj9LDOWVTqE2lipWxCH0uTEj8G8kSMLCyGgjxni MFDpjJLu3ETBZMevA+HNWS80RGbT2byu0FbeqXdRV3/+PL3MUY3mOs91bVgxpULG3aDcEmWd IJzNgQARAQABiQE8BBgBCgAmAhsMFiEEU0J2bW3rhOXT49z2odDB0wWF0VgFAlr4jsAFCQPC dXAACgkQodDB0wWF0VgnUQf/T1Z0SBj8YdepF91TTQnvH21USuyEsWCIX8d2xrUqGdVnwlIS fllS3SKTZQJdFhqQtEEYrKRhUDHrPt5Sm0NBisiD+lLcRajv7si4Xj8/ZY/gFjt7RrraYv5D Yb1BjSzsY4YEtq55jDknGufmBpannhnLFFlltt12Sa+xVgZMOl3g8zMjQkiPMtesw1DMDy9N lPB2WlbBVQlkzNHMifpIEiqc+ckZJavYabl/Nsv/kbMFGTizdIllN2EML6l9/KUC3Iw0OWB9 pnge7j3cX7+6sv4ypu65B/XMb4h/4HvXs4D2NW0HIIWtPA50fjjPSJs2JHJt9qVkI7/rNNNL byRcKQ== Organization: The FreeBSD Project Message-ID: <7fd4e212-79b2-c632-c7ae-60687bbe1a61@FreeBSD.org> Date: Sun, 19 May 2019 14:57:01 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yrDxsoDbMU0Jyuot8MnziHlkVEGtvvtLR" X-Null-Tag: 50e5d1d20b4377aea219fcf568502c90 X-Rspamd-Queue-Id: 164EF706EE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-Mailman-Approved-At: Sun, 19 May 2019 20:17:39 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 18:57:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --yrDxsoDbMU0Jyuot8MnziHlkVEGtvvtLR Content-Type: multipart/mixed; boundary="pWqGWROSTzjf1uL0jHtKl2NlNiQzWFRf9"; protected-headers="v1" From: Benedict Reuschling To: Yoshihiro Ota , rgrimes@freebsd.org Cc: "Rodney W. Grimes" , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov , Ed Maste Message-ID: <7fd4e212-79b2-c632-c7ae-60687bbe1a61@FreeBSD.org> Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib References: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> In-Reply-To: <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> --pWqGWROSTzjf1uL0jHtKl2NlNiQzWFRf9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 19.05.19 um 11:54 schrieb Yoshihiro Ota: > I wonder if we can use a tool to confirm coding style like > clang-format or something else. >=20 > I tried to setup clang-format and 2 others in the past like > a year ago but wasn't able to do... >=20 We were discussing that a little bit at BSDCan. clang-format has a few edge cases (or our style(9) needs to change (many potential bikesheds there). There was also talk about using annotations to give the tool some hints about which parts it should ignore that are different in our style. Ed Maste is the better person to talk to about it than me (and on separate different mailing list perhaps). Back the original issue: I reopened the review and have asked the submitter to incorporate the feedback from here. Regards to all Benedict >=20 > On Sat, 18 May 2019 06:06:51 -0700 (PDT) > "Rodney W. Grimes" wrote: >=20 >>> Hello Konstantin and Bruce, >>> >>> thank you for your comments. Clearly, this should have been addressed= in >>> the review and checked by a second pair of eyes. I mostly did the man= >>> page changes and can't comment much on the actual coding example. Two= >>> people (dab and jilles) approved the revision in the Phabricator revi= ew. >>> There was plenty of time to review it between April 16 and May 15 whe= n >>> then the original submitter asked if there was anything else that nee= ds >>> to be done. >> >> The quality of a code review is highly dependent on who is invited >> to do the reviewing, and how much participation and care those invited= >> have with respect to the process. Man pages that contain code samples= >> need to have more reviewers, you need man page experts, you need subje= ct >> mater experts, and you need coding experts. This review could of used= >> more reviewers (hind sight is 20/20) but if they had not been the righ= t >> reviewers the low quality commit would of probably still occurred. >> >> The amount of time in review is not a good measure of review completne= ss, >> that falls more onto the quality of the workmanship of those actually >> commented on a review. I myself consider a LGTM, or a accept by a rev= iewer >> who makes 0 comments on my code in phab as if that reviewer probably >> just rubber stamped my change, UNLESS I have extremly high trust in >> that person. If bde, imp, or kib stamp an approve on something of min= e my >> confidence level is very high and I do consider that code well reviewe= d, >> if I get a rubber stamp from some others I am not so confident. >> >> Now we have the problem in that note every code review can be done by >> such high quality engineers due to time and work load constraints, so >> we need to raise the level of others closer to these shinning stars >> and offset this lack of avaliable resources by other means (more >> reviewers, long review cycles, automations, etc.) >>> >>> Now, having said that and the the change is now both in HEAD and >>> stable/12, how do we proceed? Revert them both or patch those issues = as >>> follow-ups? Note that a src committer should do that and not me tryin= g >>> to add more EXAMPLE sections to man pages with my doc commit bit. >> >> There is another option, a revert is actually a local operation >> to your checked out code, ou can check out head, revert this >> commit, but do not commit, make the corrections, and then commit. >> >> When MFC's this single commit does the right thing. >> >> You could also revert in head, commit and later fix these >> issues, commit, and then MFC both of those commits. >> >> All of your proposed solutions, and my additions are workable, >> and I really have no preference on a single file change like >> this. >> >> Good Day, >> Rod >> >>> Regards, >>> Benedict >>> >>> >>> >>> Am 18.05.19 um 07:45 schrieb Bruce Evans: >>>> On Sat, 18 May 2019, Konstantin Belousov wrote: >>>> >>>>> On Sat, May 18, 2019 at 03:15:08AM +0000, Benedict Reuschling wrote= : >>>>>> Author: bcr (doc committer) >>>>>> Date: Sat May 18 03:15:07 2019 >>>>>> New Revision: 347951 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/347951 >>>>>> >>>>>> Log: >>>>>> ? MFC r347617: >>>>>> ? Add small EXAMPLE section to bsearch.3. >>>>>> >>>>>> ? Submitted by:??????????? fernape (via Phabricator) >>>>>> ? Reviewed by:??????????? bcr, jilles, dab >>>>>> ? Approved by:??????????? bcr (man pages), jilles (src) >>>>>> ? Differential Revision:??????? https://reviews.freebsd.org/D19902= >>>>>> >>>>>> Modified: >>>>>> ? stable/12/lib/libc/stdlib/bsearch.3 >>>>>> Directory Properties: >>>>>> ? stable/12/?? (props changed) >>>>>> >>>>>> Modified: stable/12/lib/libc/stdlib/bsearch.3 >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >>>>>> >>>>>> --- stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 02:02:14 >>>>>> 2019??? (r347950) >>>>>> +++ stable/12/lib/libc/stdlib/bsearch.3??? Sat May 18 03:15:07 >>>>>> 2019??? (r347951) >>>>>> @@ -32,7 +32,7 @@ >>>>>> ?.\"???? @(#)bsearch.3??? 8.3 (Berkeley) 4/19/94 >>>>>> ?.\" $FreeBSD$ >>>>>> ?.\" >>>>>> -.Dd February 22, 2013 >>>>>> +.Dd May 15, 2019 >>>>>> ?.Dt BSEARCH 3 >>>>>> ?.Os >>>>>> ?.Sh NAME >>>>>> @@ -83,6 +83,61 @@ The >>>>>> ?function returns a pointer to a matching member of the array, or = a null >>>>>> ?pointer if no match is found. >>>>>> ?If two members compare as equal, which member is matched is >>>>>> unspecified. >>>>>> +.Sh EXAMPLES >>>>>> +A sample program that searches people by age in a sorted array: >>>>>> +.Bd -literal >>>>>> +#include >>>>>> +#include >>>>>> +#include >>>>>> +#include >>>>>> +#include >>>>>> + >>>>>> +struct person { >>>>>> +??? char name[5]; >>>>>> +??? int age; >>>>>> +}; >>>> >>>> This example has a high density of style bugs.? kib pointed out some= =2E >>>> Some of the others are: >>>> >>>> (1) Not sorting the struct members on alignment.? (style(9) says to = sort >>>> ??? on use, then size, but means alignment). >>>> (2) Not indenting the struct member names. >>>> (3) Not use a prefix for struct member names.? This is not important= for >>>> ??? small programs. >>>> >>>>>> + >>>>>> +int >>>>>> +compare(const void *key, const void *array_member) >>>>>> +{ >>>>>> +??? int age =3D (intptr_t) key; >>>>>> +??? struct person person =3D *(struct person *) array_member; >>>>> These two lines contain at least three style(9) bugs, and at least = one >>>>> warning at higher warning level. >>>>> >>>>>> + >>>>>> +??? return (age - person.age); >>>>>> +} >>>>>> + >>>>>> +int >>>>>> +main() >>>>> Why use K&R definition ? >>>>> >>>>>> +{ >>>>>> +??? struct person *friend; >>>>>> + >>>>>> +??? /* Sorted array */ >>>>>> +??? struct person friends[6] =3D { >>>>>> +??????? { "paul", 22 }, >>>>>> +??????? { "anne", 25 }, >>>>>> +??????? { "fred", 25 }, >>>>>> +??????? { "mary", 27 }, >>>>>> +??????? { "mark", 35 }, >>>>>> +??????? { "bill", 50 } >>>>>> +??? }; >>>>>> + >>>>>> +??? size_t array_size =3D sizeof(friends) / sizeof(struct person)= ; >>>>> Since you used const elsewere, why did not you used it there ? >>>> >>>> (4) The size expression is obfuscated by spelling the element size a= s >>>> ??? sizeof(struct person) instead of sizeof(friends[0]). >>>> (5?) FreeBSD now spells this size expression as nitems(friends).? I = don't >>>> ??? like the unportability of this, especially in an example. >>>> >>>>> >>>>>> + >>>>>> +??? friend =3D bsearch((void *)22, &friends, array_size, sizeof(s= truct >>>>>> person), compare); >>>>> Taking address of an array is weird. >>>>> Line is too long. >>>> >>>> (6) C99 specifies that the search is for a member of the array that = matches >>>> ??? the object pointed to by 'key'.? Here the key of (void *)22 is a= >>>> ??? not a pointer to an object.? It is a cookie which points to garb= age. >>>> ??? The cookie is unique enough to work in practice.? Perhaps you ca= n >>>> ??? prove it to always work if the option type intptr_t is supported= =2E >>>> ??? But this is a bad example. >>>> (4a) same obfuscation of the element size. >>>> >>>>> >>>>>> +??? assert(strcmp(friend->name, "paul") =3D=3D 0); >>>>>> +??? printf("name: %s\enage: %d\en", friend->name, friend->age); >>>>>> + >>>> >>>> (7) Extra blank line.? This is not too bad, but is not done consiste= ntly. >>>> >>>>>> +??? friend =3D bsearch((void *)25, &friends, array_size, sizeof(s= truct >>>>>> person), compare); >>>> >>>> (8) More too-long lines. >>>> (4b) More sizeof(person)'s. >>>> >>>>>> +??? assert(strcmp(friend->name, "fred") =3D=3D 0 || strcmp(friend= ->name, >>>>>> "anne") =3D=3D 0); >>>> >>>> (7a) No extra blank line for "fred". >>>> >>>>>> +??? printf("name: %s\enage: %d\en", friend->name, friend->age); >>>>>> + >>>>>> +??? friend =3D bsearch((void *)30, &friends, array_size, sizeof(s= truct >>>>>> person), compare); >>>>>> +??? assert(friend =3D=3D NULL); >>>>>> +??? printf("friend aged 30 not found\en"); >>>> >>>> I didn't notice before that the key cookie was an encoding of the ag= e. >>>> >>>> The key is not unique (there are 2 25's).? This gives an example of = low >>>> quality data and the example has minimal error handling handling for= this >>>> without describing what it is doing (it asserts uniqueness for age 2= 2 and >>>> it asserts one of the 2 possibilities for age 25.? It can only do th= is >>>> because it knows too much about the data). >>>> >>>> It is more than a style bug to handle errors in data by assert() or >>>> otherwise killing the program, except possibly when the data is supp= osed >>>> to be good. >>>> >>>>>> + >>>>>> +??? return (EXIT_SUCCESS); >>>>>> +} >>>>>> +.Ed >>>>>> ?.Sh SEE ALSO >>>>>> ?.Xr db 3 , >>>>>> ?.Xr lsearch 3 , >>>> >>>> Bruce >>> >>> >> >> --=20 >> Rod Grimes rgrimes@fre= ebsd.org >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"= --pWqGWROSTzjf1uL0jHtKl2NlNiQzWFRf9-- --yrDxsoDbMU0Jyuot8MnziHlkVEGtvvtLR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEwXonQDvNfP/33IoBVXQ7/QHhjTUFAlzhpv0ACgkQVXQ7/QHh jTW2YAf+J++lPrES6tz+MpfJq/0E5EJ6n+IMmvqe3voAQWurhVnIesFAaXc7ZIdg eUWO44mzRE1RAzdvRb4TPyFtCYl1DQibwSP7oW4RjryeWNqUpvi+PRFMfZHG2G8X P7GqQDm5/X12wP4axKXAh9sd52nNr2Mm02GTB+6lOATAtFmJpCreYn2bGc4EtSBF ND4OAgqb53wUkHonvwIubtOKPbsyuafDWloYp4UIAjbuTPZQVSTOtJnx5qA8qO3L HJvjJLdPWHyUvHB9dzbyX8VuHF6DNqyUwRC1VFLUb/50dynIiw9lsx1WtimVqqS9 UTNQ2DTsKIiV/2r0ak3DuxpjX5A2FA== =UeGS -----END PGP SIGNATURE----- --yrDxsoDbMU0Jyuot8MnziHlkVEGtvvtLR-- From owner-svn-src-all@freebsd.org Sun May 19 20:24:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CA91590624; Sun, 19 May 2019 20:24:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D177E72ED9; Sun, 19 May 2019 20:24:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A62ACC1FC; Sun, 19 May 2019 20:24:18 +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 x4JKOILI086858; Sun, 19 May 2019 20:24:18 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JKOIZe086856; Sun, 19 May 2019 20:24:18 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905192024.x4JKOIZe086856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 19 May 2019 20:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347980 - head/lib/libsecureboot/openpgp X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/lib/libsecureboot/openpgp X-SVN-Commit-Revision: 347980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D177E72ED9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 20:24:19 -0000 Author: sjg Date: Sun May 19 20:24:17 2019 New Revision: 347980 URL: https://svnweb.freebsd.org/changeset/base/347980 Log: load_key_buf do not free data from dearmor The data returned by dearmor is referenced by the key leave it alone! Reviewed by: stevek MFC after: 2 days Modified: head/lib/libsecureboot/openpgp/opgp_key.c head/lib/libsecureboot/openpgp/opgp_sig.c Modified: head/lib/libsecureboot/openpgp/opgp_key.c ============================================================================== --- head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:13:55 2019 (r347979) +++ head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:24:17 2019 (r347980) @@ -168,6 +168,7 @@ load_key_buf(unsigned char *buf, size_t nbytes) initialize(); if (!(buf[0] & OPENPGP_TAG_ISTAG)) { + /* Note: we do *not* free data */ data = dearmor((char *)buf, nbytes, &nbytes); ptr = data; } else @@ -190,7 +191,6 @@ load_key_buf(unsigned char *buf, size_t nbytes) } } } - free(data); return (key); } @@ -209,8 +209,10 @@ openpgp_trust_add(OpenPGP_key *key) LIST_INIT(&trust_list); } - if (key) + if (key) { + DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id)); LIST_INSERT_HEAD(&trust_list, key, entries); + } } /** @@ -296,6 +298,7 @@ load_key_id(const char *keyID) if (!key) key = load_trusted_key_id(keyID); #endif + DEBUG_PRINTF(2, ("load_key_id(%s): %s\n", keyID, key ? "found" : "nope")); return (key); } Modified: head/lib/libsecureboot/openpgp/opgp_sig.c ============================================================================== --- head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:13:55 2019 (r347979) +++ head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:24:17 2019 (r347980) @@ -318,6 +318,7 @@ openpgp_verify(const char *filename, sdata = ddata = dearmor((char *)sdata, sbytes, &sbytes); ptr = sdata; rc = decode_packet(2, &ptr, sbytes, (decoder_t)decode_sig, sig); + DEBUG_PRINTF(2, ("rc=%d keyID=%s\n", rc, sig->key_id ? sig->key_id : "?")); if (rc == 0 && sig->key_id) { key = load_key_id(sig->key_id); if (!key) { From owner-svn-src-all@freebsd.org Sun May 19 20:28:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E0C11590733; Sun, 19 May 2019 20:28:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31CE77304A; Sun, 19 May 2019 20:28:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02346C1FD; Sun, 19 May 2019 20:28:51 +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 x4JKSoe0087079; Sun, 19 May 2019 20:28:50 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JKSoWw087076; Sun, 19 May 2019 20:28:50 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905192028.x4JKSoWw087076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 19 May 2019 20:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347981 - in head/lib/libsecureboot: . h tests X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/lib/libsecureboot: . h tests X-SVN-Commit-Revision: 347981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31CE77304A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 20:28:51 -0000 Author: sjg Date: Sun May 19 20:28:49 2019 New Revision: 347981 URL: https://svnweb.freebsd.org/changeset/base/347981 Log: libsecureboot: allow control of when pseudo pcr is updated During boot we only want to measure things which *must* be verified - this should provide more deterministic ordering. Reviewed by: stevek MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D20297 Modified: head/lib/libsecureboot/h/libsecureboot.h head/lib/libsecureboot/tests/tvo.c head/lib/libsecureboot/vepcr.c head/lib/libsecureboot/verify_file.c Modified: head/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- head/lib/libsecureboot/h/libsecureboot.h Sun May 19 20:24:17 2019 (r347980) +++ head/lib/libsecureboot/h/libsecureboot.h Sun May 19 20:28:49 2019 (r347981) @@ -81,6 +81,8 @@ unsigned char *verify_asc(const char *, int); /* OpenP void ve_pcr_init(void); void ve_pcr_update(unsigned char *, size_t); ssize_t ve_pcr_get(unsigned char *, size_t); +int ve_pcr_updating_get(void); +void ve_pcr_updating_set(int); /* flags for verify_{asc,sig,signed} */ #define VEF_VERBOSE 1 Modified: head/lib/libsecureboot/tests/tvo.c ============================================================================== --- head/lib/libsecureboot/tests/tvo.c Sun May 19 20:24:17 2019 (r347980) +++ head/lib/libsecureboot/tests/tvo.c Sun May 19 20:28:49 2019 (r347981) @@ -74,6 +74,9 @@ main(int argc, char *argv[]) } } +#ifdef VE_PCR_SUPPORT + ve_pcr_updating_set(1); +#endif ve_self_tests(); for ( ; optind < argc; optind++) { @@ -176,6 +179,10 @@ main(int argc, char *argv[]) } } } +#ifdef VE_PCR_SUPPORT + verify_pcr_export(); + printf("pcr=%s\n", getenv("loader.ve.pcr")); +#endif return (0); } Modified: head/lib/libsecureboot/vepcr.c ============================================================================== --- head/lib/libsecureboot/vepcr.c Sun May 19 20:24:17 2019 (r347980) +++ head/lib/libsecureboot/vepcr.c Sun May 19 20:28:49 2019 (r347981) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); static const br_hash_class *pcr_md = NULL; static br_hash_compat_context pcr_ctx; static size_t pcr_hlen = 0; +static int pcr_updating; /** * @brief initialize pcr context @@ -53,18 +54,37 @@ static size_t pcr_hlen = 0; void ve_pcr_init(void) { + pcr_updating = 0; pcr_hlen = br_sha256_SIZE; pcr_md = &br_sha256_vtable; pcr_md->init(&pcr_ctx.vtable); } /** + * @brief get pcr_updating state + */ +int +ve_pcr_updating_get(void) +{ + return (pcr_updating); +} + +/** + * @brief set pcr_updating state + */ +void +ve_pcr_updating_set(int updating) +{ + pcr_updating = updating; +} + +/** * @brief update pcr context */ void ve_pcr_update(unsigned char *data, size_t dlen) { - if (pcr_md) + if (pcr_updating != 0 && pcr_md != NULL) pcr_md->update(&pcr_ctx.vtable, data, dlen); } Modified: head/lib/libsecureboot/verify_file.c ============================================================================== --- head/lib/libsecureboot/verify_file.c Sun May 19 20:24:17 2019 (r347980) +++ head/lib/libsecureboot/verify_file.c Sun May 19 20:28:49 2019 (r347981) @@ -340,6 +340,14 @@ verify_file(int fd, const char *filename, off_t off, i if (rc != VE_FINGERPRINT_WRONG && loaded_manifests) { if (severity <= VE_GUESS) severity = severity_guess(filename); +#ifdef VE_PCR_SUPPORT + /* + * Only update pcr with things that must verify + * these tend to be processed in a more deterministic + * order, which makes our pseudo pcr more useful. + */ + ve_pcr_updating_set((severity == VE_MUST)); +#endif if ((rc = verify_fd(fd, filename, off, &st)) >= 0) { if (verbose || severity > VE_WANT) { #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0 From owner-svn-src-all@freebsd.org Sun May 19 20:44:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58D61590F4F; Sun, 19 May 2019 20:44:18 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53985738E4; Sun, 19 May 2019 20:44:18 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 456Ysr3KC1zDkM8; Sun, 19 May 2019 20:44:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id 6A0NQpWjEEzE; Sun, 19 May 2019 20:44:16 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:ad0d:f3a0:ed24:3d3d]) by mail.daemonic.se (Postfix) with ESMTPSA id 456Ysq5HSzzDjp8; Sun, 19 May 2019 20:44:15 +0000 (UTC) Subject: Re: svn commit: r347695 - in head/sys: amd64/amd64 amd64/include kern To: Dmitry Chagin , Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201905161328.x4GDSmMd072071@repo.freebsd.org> <20190518084406.GX2748@kib.kiev.ua> From: Niclas Zeising Message-ID: <342813b3-e7a9-4654-3945-b0105e582ab6@freebsd.org> Date: Sun, 19 May 2019 22:44:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 53985738E4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 20:44:19 -0000 On 2019-05-19 10:11, Dmitry Chagin wrote: > =D1=81=D0=B1, 18 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 11:44, Konstant= in Belousov : >=20 >> On Sat, May 18, 2019 at 11:35:29AM +0300, Dmitry Chagin wrote: >>> =D1=87=D1=82, 16 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 16:29, Konsta= ntin Belousov : >>> >>>> Author: kib >>>> Date: Thu May 16 13:28:48 2019 >>>> New Revision: 347695 >>>> URL: https://svnweb.freebsd.org/changeset/base/347695 >>>> >>>> Log: >>>> amd64 pmap: rework delayed invalidation, removing global mutex. >>>> >>>> For machines having cmpxcgh16b instruction, i.e. everything but v= ery >>>> early Athlons, provide lockless implementation of delayed >>>> invalidation. >>>> >>>> The implementation maintains lock-less single-linked list with th= e >>>> trick from the T.L. Harris article about volatile mark of the >> elements >>>> being removed. Double-CAS is used to atomically update both link = and >>>> generation. New thread starting DI appends itself to the end of = the >>>> queue, setting the generation to the generation of the last eleme= nt >>>> +1. On DI finish, thread donates its generation to the previous >>>> element. The generation of the fake head of the list is the last >>>> passed DI generation. Basically, the implementation is a queued >>>> spinlock but without spinlock. >>>> >>>> >>> >>> Hi, Kostik! First of all thanks for the previous help. >>> Second, this commit broke i915kms module. Unfortunatelly, >>> I can't give you a lot of information becouse I see only black screen= , >>> but I can help with testing >> Did you recompiled the module ? >> >=20 >=20 > I use pkg, but after your mail, yes, compiled drm-current-kmod >=20 > root@mordor:~ # kldstat > Id Refs Address Size Name > 1 4 0xffffffff80200000 1d536e0 kernel > 2 1 0xffffffff81f54000 11e8 acpi_call.ko > root@mordor:~ # kldload i915kms > sysctl_warn_reuse: can't re-use a leaf (compat.linuxkpi.debug)! > drmn1: on vgapci1 > device_attach: drmn1 attach returned 19 > root@mordor:~ >=20 > so, I'll ping freebsd-x11 Hi! drm-current-kmod was updated to the 20190519 snapshot, can you try that?=20 If it still fails, please send a message to x11@freebsd.org . Thanks! Regards --=20 Niclas Zeising From owner-svn-src-all@freebsd.org Sun May 19 21:05:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D387C1591F49; Sun, 19 May 2019 21:05:30 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail01.asahi-net.or.jp (mail01.asahi-net.or.jp [202.224.55.13]) by mx1.freebsd.org (Postfix) with ESMTP id 5731F74C76; Sun, 19 May 2019 21:05:29 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from vmware.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail01.asahi-net.or.jp (Postfix) with ESMTPSA id 6BF78121025; Mon, 20 May 2019 06:05:17 +0900 (JST) Date: Sun, 19 May 2019 17:04:17 -0400 From: Yoshihiro Ota To: Konstantin Belousov Cc: ota@j.email.ne.jp, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347968 - head/sys/kern Message-Id: <20190519170417.b05e8c43b2ccf9a6826a1d21@j.email.ne.jp> In-Reply-To: <20190519175104.GP2748@kib.kiev.ua> References: <201905190918.x4J9IAs1036579@repo.freebsd.org> <20190519115228.49fdc5c833c2abe06f894dc2@j.email.ne.jp> <20190519175104.GP2748@kib.kiev.ua> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5731F74C76 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 21:05:31 -0000 Hi Konstantin, I coundn't remount ro->rw a few days ago. This change isn't related, then. I will check/tesst it again later, then. Thanks, Hiro On Sun, 19 May 2019 20:51:04 +0300 Konstantin Belousov wrote: > On Sun, May 19, 2019 at 11:52:28AM -0400, Yoshihiro Ota wrote: > > Hi, > > > > Does this change fix 'mount -u -rw /path' to remount read-only device with write mode? > > I moticed an issue a couple of days ago but didn't have time to conform nor report. > > I do not understand your description. If you mean does this commit has > any relevance to the issue of remounting ro->rw, it should not. It only > affects rw->ro remounts, when you have a binary executed from the mount > point. > > > > > Thanks, > > Hiro > > > > On Sun, 19 May 2019 09:18:10 +0000 (UTC) > > Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Sun May 19 09:18:09 2019 > > > New Revision: 347968 > > > URL: https://svnweb.freebsd.org/changeset/base/347968 > > > > > > Log: > > > Fix rw->ro remount when there is a text vnode mapping. > > > > > > Reported and tested by: hrs > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 16 days > > > > > > Modified: > > > head/sys/kern/vfs_subr.c > > > > > > Modified: head/sys/kern/vfs_subr.c > > > ============================================================================== > > > --- head/sys/kern/vfs_subr.c Sun May 19 06:01:11 2019 (r347967) > > > +++ head/sys/kern/vfs_subr.c Sun May 19 09:18:09 2019 (r347968) > > > @@ -3146,7 +3146,7 @@ loop: > > > > > > if ((vp->v_type == VNON || > > > (error == 0 && vattr.va_nlink > 0)) && > > > - (vp->v_writecount == 0 || vp->v_type != VREG)) { > > > + (vp->v_writecount <= 0 || vp->v_type != VREG)) { > > > VOP_UNLOCK(vp, 0); > > > vdropl(vp); > > > continue; > > > _______________________________________________ > > > svn-src-all@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sun May 19 21:17:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6485B159261F; Sun, 19 May 2019 21:17:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9EA17541D; Sun, 19 May 2019 21:17:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52e.google.com with SMTP id t187so5740862pgb.13; Sun, 19 May 2019 14:17:23 -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=4mXy/522JeuV/477VyPq5Koge01HjA9x/TCxwfq9fI8=; b=aiDShEJFtHtEBbHWD08v2vNf/9xck7PTb+RpQVf9HOZLYuhxV2Mndyr5vrSnWQ0MOG xCCbVoXhvTZd1KID9qdClqckyGI1dbfeZwAu00Z6wLeGe3OoXrilGAo8iO1HVWqRDaIl Fs0n8BXZNkeWLjBfFrDgOwAafLB0F+Z8/ceIkxxuFiY/RS+qpa9gjNUjmtQdZ5XL9/dM 7kfuKTpZ4WobA5GO8/dwJEtT6U0IyZG9Xy+fjBp9JWu2Y4br5BCZQd/TYMW4pfKs/ygl x+iIboPTkubd1NO6m1dFd6klUFfynlK4C7lidF0+C3X+Mt5fXuuGBb6F/MNx4yxyKC4u 1Kow== 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=4mXy/522JeuV/477VyPq5Koge01HjA9x/TCxwfq9fI8=; b=QF3hLOEF7nQFh7DXehar16O04b7juAyE6/+aNiAgR473SB+SlxOyi8nAokQasj84xy TZ2I2zdf/kg/mjOkJbxY78r/ifRxCUTdRN5YNYl1RHS/SNH6cs7yM/Mr3RegH5MK7jN9 l9rV4dXrWJvQLdc8i0uxEkYPdRJlCicDIQ/MMy0KkdyICi4E3+dLK3V9h3GN5KtjslnC iSGguHiEvFnfFGCcD09cG0XaaEjq8n4KP3Q0/IYSGNhid9unHy86StTeBfNex/BVDsZc Og64zDkd5wz6POhBr2zGeaWY9x/Pvte++KDQZUY7hNU7Y2IKaF19XY5A9x8Lr1uFWMVw G8mQ== X-Gm-Message-State: APjAAAVDuurxSzs9M19ykiW03lmD5bGGwdcKvdsxJ/qv+Da+mbAjovSy qcE16ybQH9tIlI8c6m8WHrHr7X9L X-Google-Smtp-Source: APXvYqwNeUdPSO1tVID9NgrYE2srZph+eNn1N9c9YaZJknHfrNwx0Pa2pSCFtHuk56BlFgKzA5yjYQ== X-Received: by 2002:a63:1061:: with SMTP id 33mr45134809pgq.328.1558300642494; Sun, 19 May 2019 14:17:22 -0700 (PDT) Received: from ?IPv6:2607:fb90:b2dc:6706:6cd1:7a98:a302:2d76? ([2607:fb90:b2dc:6706:6cd1:7a98:a302:2d76]) by smtp.gmail.com with ESMTPSA id g7sm13920357pgr.46.2019.05.19.14.17.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 14:17:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r347979 - in head: lib/libomp tools/build/mk From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201905192013.x4JKDtTA081379@repo.freebsd.org> Date: Sun, 19 May 2019 14:17:20 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <06AABE77-D67B-4D2F-8658-A102D4633BD2@gmail.com> References: <201905192013.x4JKDtTA081379@repo.freebsd.org> To: Dimitry Andric X-Rspamd-Queue-Id: D9EA17541D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 21:17:24 -0000 > On May 19, 2019, at 13:13, Dimitry Andric wrote: >=20 > Author: dim > Date: Sun May 19 20:13:55 2019 > New Revision: 347979 > URL: https://svnweb.freebsd.org/changeset/base/347979 >=20 > Log: > To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC > does not ship a -lomp symlink. Also update OptionalObsoleteFiles for > this, and add 32-bit variants while here. >=20 > Submitted by: jbeich > PR: 237975 > MFC after: 3 days One question I meant to ask: why isn=E2=80=99t this a PRIVATELIB? Thanks! -Enji= From owner-svn-src-all@freebsd.org Sun May 19 21:44:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF0A5159324E; Sun, 19 May 2019 21:44:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32CC2762B6; Sun, 19 May 2019 21:44:28 +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 "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 0130514A28; Sun, 19 May 2019 21:44:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::a420:2b16:64d8:ba23] (unknown [IPv6:2001:470:7a58:0:a420:2b16:64d8:ba23]) (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 8C6A93D3FE; Sun, 19 May 2019 23:44:26 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_E3AA0DCA-C6E6-480D-9194-E4780F34CE71"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r347979 - in head: lib/libomp tools/build/mk Date: Sun, 19 May 2019 23:44:26 +0200 In-Reply-To: <06AABE77-D67B-4D2F-8658-A102D4633BD2@gmail.com> Cc: src-committers , svn-src-all , svn-src-head@freebsd.org To: Enji Cooper References: <201905192013.x4JKDtTA081379@repo.freebsd.org> <06AABE77-D67B-4D2F-8658-A102D4633BD2@gmail.com> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 32CC2762B6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 21:44:29 -0000 --Apple-Mail=_E3AA0DCA-C6E6-480D-9194-E4780F34CE71 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 19 May 2019, at 23:17, Enji Cooper wrote: >=20 >> On May 19, 2019, at 13:13, Dimitry Andric wrote: >>=20 >> Author: dim >> Date: Sun May 19 20:13:55 2019 >> New Revision: 347979 >> URL: https://svnweb.freebsd.org/changeset/base/347979 >>=20 >> Log: >> To avoid unnecessarily modifying ports, add a -lgomp symlink, since = GCC >> does not ship a -lomp symlink. Also update OptionalObsoleteFiles for >> this, and add 32-bit variants while here. >>=20 >> Submitted by: jbeich >> PR: 237975 >> MFC after: 3 days >=20 > One question I meant to ask: why isn=E2=80=99t this a PRIVATELIB? Because: 1) This library was added for the benefit of ports (and at the request of many, including ports people). 2) Nothing in the base system uses it. -Dimitry --Apple-Mail=_E3AA0DCA-C6E6-480D-9194-E4780F34CE71 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.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXOHOOgAKCRCwXqMKLiCW o5LAAKCqz0UWz3gSPZEUcEdIUPDQTMPscwCgsa1moACfjdy/WPFeGfb9wdcBj1E= =sLny -----END PGP SIGNATURE----- --Apple-Mail=_E3AA0DCA-C6E6-480D-9194-E4780F34CE71-- From owner-svn-src-all@freebsd.org Sun May 19 21:49:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA1A1593528; Sun, 19 May 2019 21:49:58 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD61A764CD; Sun, 19 May 2019 21:49:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91D18D01A; Sun, 19 May 2019 21:49:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JLnvrB028497; Sun, 19 May 2019 21:49:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JLnvt5028495; Sun, 19 May 2019 21:49:57 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201905192149.x4JLnvt5028495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 19 May 2019 21:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347982 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD61A764CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 21:49:58 -0000 Author: melifaro Date: Sun May 19 21:49:56 2019 New Revision: 347982 URL: https://svnweb.freebsd.org/changeset/base/347982 Log: Fix rt_ifa selection during loopback route insertion process. Currently such routes are added with a link-level IFA, which is plain wrong. Only after the insertion they get fixed by the special link_rtrequest() ifa handler. This behaviour complicates routing code and makes ifa selection more complex. Streamline this process by explicitly moving link_rtrequest() logic to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all this logic in the loopback route case by explicitly specifying proper rt_ifa inside the ifa_maintain_loopback_route().§ MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20076 Modified: head/sys/net/if.c head/sys/net/route.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun May 19 20:28:49 2019 (r347981) +++ head/sys/net/if.c Sun May 19 21:49:56 2019 (r347982) @@ -264,7 +264,6 @@ static void if_route(struct ifnet *, int flag, int fam static int if_setflag(struct ifnet *, int, int, int *, int); static int if_transmit(struct ifnet *ifp, struct mbuf *m); static void if_unroute(struct ifnet *, int flag, int fam); -static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *); static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int); static void do_link_state_change(void *, int); static int if_getgroup(struct ifgroupreq *, struct ifnet *); @@ -862,7 +861,6 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc sdl->sdl_type = ifp->if_type; ifp->if_addr = ifa; ifa->ifa_ifp = ifp; - ifa->ifa_rtrequest = link_rtrequest; ifa->ifa_addr = (struct sockaddr *)sdl; sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl); ifa->ifa_netmask = (struct sockaddr *)sdl; @@ -1892,6 +1890,7 @@ static int ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, struct sockaddr *ia) { + struct epoch_tracker et; int error; struct rt_addrinfo info; struct sockaddr_dl null_sdl; @@ -1902,6 +1901,16 @@ ifa_maintain_loopback_route(int cmd, const char *otype bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; + if (cmd == RTM_ADD) { + /* explicitly specify (loopback) ifa */ + if (info.rti_ifp != NULL) { + NET_EPOCH_ENTER(et); + info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); + if (info.rti_ifa != NULL) + ifa_ref(info.rti_ifa); + NET_EPOCH_EXIT(et); + } + } info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; @@ -2208,39 +2217,6 @@ ifa_preferred(struct ifaddr *cur, struct ifaddr *next) return (cur->ifa_carp && (!next->ifa_carp || ((*carp_master_p)(next) && !(*carp_master_p)(cur)))); -} - -#include - -/* - * Default action when installing a route with a Link Level gateway. - * Lookup an appropriate real ifa to point to. - * This should be moved to /sys/net/link.c eventually. - */ -static void -link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) -{ - struct epoch_tracker et; - struct ifaddr *ifa, *oifa; - struct sockaddr *dst; - struct ifnet *ifp; - - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) || - ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL)) - return; - NET_EPOCH_ENTER(et); - ifa = ifaof_ifpforaddr(dst, ifp); - if (ifa) { - oifa = rt->rt_ifa; - if (oifa != ifa) { - ifa_free(oifa); - ifa_ref(ifa); - } - rt->rt_ifa = ifa; - if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest) - ifa->ifa_rtrequest(cmd, rt, info); - } - NET_EPOCH_EXIT(et); } struct sockaddr_dl * Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun May 19 20:28:49 2019 (r347981) +++ head/sys/net/route.c Sun May 19 21:49:56 2019 (r347982) @@ -1276,12 +1276,14 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo /* * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, * it will be referenced so the caller must free it. + * + * Assume basic consistency checks are executed by callers: + * RTAX_DST exists, if RTF_GATEWAY is set, RTAX_GATEWAY exists as well. */ int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) { struct epoch_tracker et; - struct ifaddr *ifa; int needref, error; /* @@ -1291,21 +1293,54 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) error = 0; needref = (info->rti_ifa == NULL); NET_EPOCH_ENTER(et); + + /* If we have interface specified by the ifindex in the address, use it */ if (info->rti_ifp == NULL && ifpaddr != NULL && - ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0, fibnum)) != NULL) { - info->rti_ifp = ifa->ifa_ifp; + ifpaddr->sa_family == AF_LINK) { + const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)ifpaddr; + if (sdl->sdl_index != 0) + info->rti_ifp = ifnet_byindex_locked(sdl->sdl_index); } + /* + * If we have source address specified, try to find it + * TODO: avoid enumerating all ifas on all interfaces. + */ if (info->rti_ifa == NULL && ifaaddr != NULL) info->rti_ifa = ifa_ifwithaddr(ifaaddr); if (info->rti_ifa == NULL) { struct sockaddr *sa; - sa = ifaaddr != NULL ? ifaaddr : - (gateway != NULL ? gateway : dst); - if (sa != NULL && info->rti_ifp != NULL) + /* + * Most common use case for the userland-supplied routes. + * + * Choose sockaddr to select ifa. + * -- if ifp is set -- + * Order of preference: + * 1) IFA address + * 2) gateway address + * Note: for interface routes link-level gateway address + * is specified to indicate the interface index without + * specifying RTF_GATEWAY. In this case, ignore gateway + * Note: gateway AF may be different from dst AF. In this case, + * ignore gateway + * 3) final destination. + * 4) if all of these fails, try to get at least link-level ifa. + * -- else -- + * try to lookup gateway or dst in the routing table to get ifa + */ + if (info->rti_info[RTAX_IFA] != NULL) + sa = info->rti_info[RTAX_IFA]; + else if ((info->rti_flags & RTF_GATEWAY) != 0 && + gateway->sa_family == dst->sa_family) + sa = gateway; + else + sa = dst; + if (info->rti_ifp != NULL) { info->rti_ifa = ifaof_ifpforaddr(sa, info->rti_ifp); - else if (dst != NULL && gateway != NULL) + /* Case 4 */ + if (info->rti_ifa == NULL && gateway != NULL) + info->rti_ifa = ifaof_ifpforaddr(gateway, info->rti_ifp); + } else if (dst != NULL && gateway != NULL) info->rti_ifa = ifa_ifwithroute(flags, dst, gateway, fibnum); else if (sa != NULL) From owner-svn-src-all@freebsd.org Sun May 19 23:56:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C2F31595F00; Sun, 19 May 2019 23:56:06 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B98082EFC; Sun, 19 May 2019 23:56:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61B6AE5E5; Sun, 19 May 2019 23:56:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4JNu5OL099137; Sun, 19 May 2019 23:56:05 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4JNu5lx099136; Sun, 19 May 2019 23:56:05 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201905192356.x4JNu5lx099136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Sun, 19 May 2019 23:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347983 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 347983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B98082EFC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 23:56:06 -0000 Author: ygy (doc committer) Date: Sun May 19 23:56:04 2019 New Revision: 347983 URL: https://svnweb.freebsd.org/changeset/base/347983 Log: MFC r347565: Fix some spelling errors in ng_eiface(4). PR: 237764 Submitted by: Tom Marcoen Modified: stable/12/share/man/man4/ng_eiface.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ng_eiface.4 ============================================================================== --- stable/12/share/man/man4/ng_eiface.4 Sun May 19 21:49:56 2019 (r347982) +++ stable/12/share/man/man4/ng_eiface.4 Sun May 19 23:56:04 2019 (r347983) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 3, 2005 +.Dd May 14, 2019 .Dt NG_EIFACE 4 .Os .Sh NAME @@ -36,7 +36,7 @@ The .Vt eiface netgraph node implements the generic Ethernet interface. -When +When an .Vt eiface node is created, a new interface appears which is accessible via .Xr ifconfig 8 . @@ -78,7 +78,7 @@ which requires as an argument an string consisting of 6 colon-separated hex digits. .It Dv NGM_EIFACE_GET_IFNAME Pq Ic getifname Return the name of the associated interface as a -.Dv NUL Ns -terminated +.Dv NULL Ns -terminated .Tn ASCII string. .It Dv NGM_EIFACE_GET_IFADDRS @@ -97,7 +97,7 @@ Unlike most other node types, an .Vt eiface node does .Em not -go away when all hooks have been disconnected; rather, and explicit +go away when all hooks have been disconnected; rather, an explicit .Dv NGM_SHUTDOWN control message is required. .Sh SEE ALSO From owner-svn-src-all@freebsd.org Mon May 20 00:38:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056EB15970AE; Mon, 20 May 2019 00:38:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9145E83EA8; Mon, 20 May 2019 00:38:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44451ECA8; Mon, 20 May 2019 00:38:40 +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 x4K0ceOt019997; Mon, 20 May 2019 00:38:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4K0cNoZ019920; Mon, 20 May 2019 00:38:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905200038.x4K0cNoZ019920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 May 2019 00:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra124 arm/ti arm/versatile ar... X-SVN-Commit-Revision: 347984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9145E83EA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 00:38:41 -0000 Author: cem Date: Mon May 20 00:38:23 2019 New Revision: 347984 URL: https://svnweb.freebsd.org/changeset/base/347984 Log: Extract eventfilter declarations to sys/_eventfilter.h This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Added: head/sys/sys/_eventhandler.h (contents, props changed) Modified: head/sys/amd64/vmm/io/iommu.c head/sys/arm/allwinner/a10/a10_intc.c head/sys/arm/allwinner/a10_dmac.c head/sys/arm/allwinner/a31_dmac.c head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/aw_reset.c head/sys/arm/allwinner/aw_rsb.c head/sys/arm/allwinner/aw_spi.c head/sys/arm/allwinner/aw_thermal.c head/sys/arm/allwinner/aw_wdog.c head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pl190.c head/sys/arm/broadcom/bcm2835/bcm2835_rng.c head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/freescale/imx/imx_wdog.c head/sys/arm/mv/armada/thermal.c head/sys/arm/mv/armada/wdt.c head/sys/arm/mv/mv_spi.c head/sys/arm/mv/timer.c head/sys/arm/nvidia/tegra124/tegra124_machdep.c head/sys/arm/nvidia/tegra124/tegra124_pmc.c head/sys/arm/nvidia/tegra_xhci.c head/sys/arm/ti/ti_pruss.c head/sys/arm/ti/ti_wdt.c head/sys/arm/versatile/versatile_pci.c head/sys/arm/versatile/versatile_sic.c head/sys/arm64/arm64/gicv3_its.c head/sys/arm64/arm64/machdep.c head/sys/arm64/coresight/coresight.c head/sys/arm64/rockchip/clk/rk_cru.c head/sys/cam/cam_periph.h head/sys/cam/ctl/ctl_ha.c head/sys/cddl/compat/opensolaris/kern/opensolaris.c head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c head/sys/crypto/aesni/aesni.c head/sys/crypto/armv8/armv8_crypto.c head/sys/crypto/blake2/blake2_cryptodev.c head/sys/crypto/ccp/ccp.c head/sys/crypto/ccp/ccp_hardware.c head/sys/ddb/db_command.c head/sys/dev/acpi_support/acpi_panasonic.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_lid.c head/sys/dev/acpica/acpi_thermal.c head/sys/dev/acpica/acpi_video.c head/sys/dev/acpica/acpivar.h head/sys/dev/adb/adb_kbd.c head/sys/dev/adb/adb_mouse.c head/sys/dev/amdsbwd/amdsbwd.c head/sys/dev/atkbdc/psm.c head/sys/dev/cardbus/cardbus.c head/sys/dev/cmx/cmx.c head/sys/dev/coretemp/coretemp.c head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/dcons/dcons_crom.c head/sys/dev/dcons/dcons_os.c head/sys/dev/dcons/dcons_os.h head/sys/dev/evdev/evdev_private.h head/sys/dev/extres/syscon/syscon_generic.c head/sys/dev/firewire/firewire.c head/sys/dev/firewire/fwohci.c head/sys/dev/ichwd/ichwd.c head/sys/dev/ida/ida_disk.c head/sys/dev/ida/ida_pci.c head/sys/dev/iir/iir_ctrl.c head/sys/dev/ioat/ioat.c head/sys/dev/ipmi/ipmi.c head/sys/dev/ipmi/ipmi_opal.c head/sys/dev/ips/ips.c head/sys/dev/iscsi/icl_soft_proxy.c head/sys/dev/iscsi_initiator/iscsivar.h head/sys/dev/iwm/if_iwm_notif_wait.c head/sys/dev/led/led.c head/sys/dev/liquidio/lio_bsd.h head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfi_syspd.c head/sys/dev/mlx/mlxvar.h head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mpsvar.h head/sys/dev/mrsas/mrsas.h head/sys/dev/nmdm/nmdm.c head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ow/ow.c head/sys/dev/pccard/pccard.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcivar.h head/sys/dev/scc/scc_core.c head/sys/dev/scc/scc_dev_quicc.c head/sys/dev/scc/scc_dev_sab82532.c head/sys/dev/scc/scc_dev_z8530.c head/sys/dev/smartpqi/smartpqi_includes.h head/sys/dev/sound/pcm/sound.h head/sys/dev/tws/tws.h head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usbdi.h head/sys/dev/usb/wlan/if_run.c head/sys/dev/viawd/viawd.c head/sys/dev/vkbd/vkbd.c head/sys/dev/vmware/vmci/vmci.c head/sys/dev/vt/vt_cpulogos.c head/sys/dev/vt/vt_sysmouse.c head/sys/dev/watchdog/watchdog.c head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma_bank.c head/sys/dev/xdma/xdma_bio.c head/sys/dev/xdma/xdma_mbuf.c head/sys/dev/xdma/xdma_queue.c head/sys/dev/xdma/xdma_sg.c head/sys/dev/xen/console/xen_console.c head/sys/dev/xen/debug/debug.c head/sys/fs/devfs/devfs_vnops.c head/sys/i386/i386/elan-mmcr.c head/sys/i386/i386/geode.c head/sys/i386/i386/longrun.c head/sys/kern/bus_if.m head/sys/kern/init_main.c head/sys/kern/kern_clock.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_intr.c head/sys/kern/subr_power.c head/sys/kern/tty_tty.c head/sys/kern/vfs_mountroot.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/atheros/ar71xx_wdog.c head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/ethernet.h head/sys/net/if.c head/sys/net/if_clone.h head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/net/if_tuntap.c head/sys/net/if_var.h head/sys/net/if_vlan_var.h head/sys/netinet/if_ether.c head/sys/netinet/tcp_offload.c head/sys/netinet/toecore.c head/sys/netinet/toecore.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/cuda.c head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/smu.c head/sys/powerpc/powermac/vcoregpio.c head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_async.c head/sys/powerpc/powernv/opal_console.c head/sys/powerpc/powernv/opal_dev.c head/sys/powerpc/powernv/opal_flash.c head/sys/powerpc/powernv/opal_sensor.c head/sys/powerpc/powernv/xive.c head/sys/powerpc/powerpc/cpu.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/pseries/rtas_dev.c head/sys/powerpc/pseries/xics.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/mp_machdep.c head/sys/security/audit/audit.c head/sys/security/audit/audit_trigger.c head/sys/sys/_lock.h head/sys/sys/bus.h head/sys/sys/conf.h head/sys/sys/cpu.h head/sys/sys/eventhandler.h head/sys/sys/interrupt.h head/sys/sys/lock.h head/sys/sys/param.h head/sys/sys/pcpu.h head/sys/sys/power.h head/sys/sys/proc.h head/sys/sys/watchdog.h head/sys/vm/swap_pager.c head/sys/x86/acpica/OsdEnvironment.c head/sys/x86/cpufreq/smist.c head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_intrmap.c head/sys/x86/iommu/intel_quirks.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/vmm/io/iommu.c ============================================================================== --- head/sys/amd64/vmm/io/iommu.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/amd64/vmm/io/iommu.c Mon May 20 00:38:23 2019 (r347984) @@ -32,10 +32,10 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include +#include #include #include Modified: head/sys/arm/allwinner/a10/a10_intc.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_intc.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/a10/a10_intc.c Mon May 20 00:38:23 2019 (r347984) @@ -30,11 +30,12 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" -#include +#include #include #include #include #include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_dmac.c ============================================================================== --- head/sys/arm/allwinner/a10_dmac.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/a10_dmac.c Mon May 20 00:38:23 2019 (r347984) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include Modified: head/sys/arm/allwinner/a31_dmac.c ============================================================================== --- head/sys/arm/allwinner/a31_dmac.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/a31_dmac.c Mon May 20 00:38:23 2019 (r347984) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_ccu.c Mon May 20 00:38:23 2019 (r347984) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm/allwinner/aw_reset.c ============================================================================== --- head/sys/arm/allwinner/aw_reset.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_reset.c Mon May 20 00:38:23 2019 (r347984) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- head/sys/arm/allwinner/aw_rsb.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_rsb.c Mon May 20 00:38:23 2019 (r347984) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm/allwinner/aw_spi.c ============================================================================== --- head/sys/arm/allwinner/aw_spi.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_spi.c Mon May 20 00:38:23 2019 (r347984) @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_thermal.c Mon May 20 00:38:23 2019 (r347984) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/arm/allwinner/aw_wdog.c ============================================================================== --- head/sys/arm/allwinner/aw_wdog.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/aw_wdog.c Mon May 20 00:38:23 2019 (r347984) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Mon May 20 00:38:23 2019 (r347984) @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/arm/machdep.c Mon May 20 00:38:23 2019 (r347984) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/arm/pl190.c ============================================================================== --- head/sys/arm/arm/pl190.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/arm/pl190.c Mon May 20 00:38:23 2019 (r347984) @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_rng.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon May 20 00:38:23 2019 (r347984) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Mon May 20 00:38:23 2019 (r347984) @@ -29,12 +29,15 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include +#include #include +#include #include +#include +#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Mon May 20 00:38:23 2019 (r347984) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #ifdef SMP Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/freescale/imx/imx_wdog.c Mon May 20 00:38:23 2019 (r347984) @@ -33,13 +33,16 @@ __FBSDID("$FreeBSD$"); #include -#include +#include +#include #include +#include #include -#include -#include +#include #include #include +#include +#include #include #include Modified: head/sys/arm/mv/armada/thermal.c ============================================================================== --- head/sys/arm/mv/armada/thermal.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/mv/armada/thermal.c Mon May 20 00:38:23 2019 (r347984) @@ -33,9 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include +#include #include #include Modified: head/sys/arm/mv/armada/wdt.c ============================================================================== --- head/sys/arm/mv/armada/wdt.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/mv/armada/wdt.c Mon May 20 00:38:23 2019 (r347984) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/mv/mv_spi.c ============================================================================== --- head/sys/arm/mv/mv_spi.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/mv/mv_spi.c Mon May 20 00:38:23 2019 (r347984) @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/mv/timer.c Mon May 20 00:38:23 2019 (r347984) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Mon May 20 00:38:23 2019 (r347984) @@ -30,10 +30,11 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include #include +#include +#include +#include #include Modified: head/sys/arm/nvidia/tegra124/tegra124_pmc.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_pmc.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/nvidia/tegra124/tegra124_pmc.c Mon May 20 00:38:23 2019 (r347984) @@ -27,12 +27,14 @@ */ #include -#include #include #include -#include +#include #include +#include +#include #include +#include #include Modified: head/sys/arm/nvidia/tegra_xhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_xhci.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/nvidia/tegra_xhci.c Mon May 20 00:38:23 2019 (r347984) @@ -34,15 +34,17 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include +#include #include +#include #include #include Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/ti/ti_pruss.c Mon May 20 00:38:23 2019 (r347984) @@ -38,8 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include Modified: head/sys/arm/ti/ti_wdt.c ============================================================================== --- head/sys/arm/ti/ti_wdt.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/ti/ti_wdt.c Mon May 20 00:38:23 2019 (r347984) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/versatile/versatile_pci.c Mon May 20 00:38:23 2019 (r347984) @@ -33,8 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include +#include #include #include Modified: head/sys/arm/versatile/versatile_sic.c ============================================================================== --- head/sys/arm/versatile/versatile_sic.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm/versatile/versatile_sic.c Mon May 20 00:38:23 2019 (r347984) @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm64/arm64/gicv3_its.c Mon May 20 00:38:23 2019 (r347984) @@ -42,8 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm64/arm64/machdep.c Mon May 20 00:38:23 2019 (r347984) @@ -42,8 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include #include #include #include Modified: head/sys/arm64/coresight/coresight.c ============================================================================== --- head/sys/arm64/coresight/coresight.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm64/coresight/coresight.c Mon May 20 00:38:23 2019 (r347984) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/arm64/rockchip/clk/rk_cru.c Mon May 20 00:38:23 2019 (r347984) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sun May 19 23:56:04 2019 (r347983) +++ head/sys/cam/cam_periph.h Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,8 @@ #include #ifdef _KERNEL +#include +#include #include #include Modified: head/sys/cam/ctl/ctl_ha.c ============================================================================== --- head/sys/cam/ctl/ctl_ha.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/cam/ctl/ctl_ha.c Mon May 20 00:38:23 2019 (r347984) @@ -30,23 +30,23 @@ __FBSDID("$FreeBSD$"); #include -#include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include #include #include +#include +#include #include -#include #include -#include #include #include +#include +#include #include #include #include Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris.c Mon May 20 00:38:23 2019 (r347984) @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon May 20 00:38:23 2019 (r347984) @@ -25,6 +25,7 @@ static const char rcsid[] = "@(#)$Id$"; # include "opt_random_ip_id.h" #endif #include +#include #include #include #include Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Mon May 20 00:38:23 2019 (r347984) @@ -178,7 +178,6 @@ static const char *const ioctl_names[] = { vchiq_static_assert((sizeof(ioctl_names)/sizeof(ioctl_names[0])) == (VCHIQ_IOC_MAX + 1)); -static eventhandler_tag vchiq_ehtag = NULL; static d_open_t vchiq_open; static d_close_t vchiq_close; static d_ioctl_t vchiq_ioctl; @@ -2918,9 +2917,6 @@ void vchiq_exit(void); void vchiq_exit(void) { - if (vchiq_ehtag == NULL) - EVENTHANDLER_DEREGISTER(dev_clone, vchiq_ehtag); - vchiq_ehtag = NULL; vchiq_platform_exit(&g_state); if (vchiq_cdev) { Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/crypto/aesni/aesni.c Mon May 20 00:38:23 2019 (r347984) @@ -35,17 +35,18 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include #include -#include #include -#include -#include #include +#include +#include #include +#include +#include #include #include Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/crypto/armv8/armv8_crypto.c Mon May 20 00:38:23 2019 (r347984) @@ -45,9 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include Modified: head/sys/crypto/blake2/blake2_cryptodev.c ============================================================================== --- head/sys/crypto/blake2/blake2_cryptodev.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/crypto/blake2/blake2_cryptodev.c Mon May 20 00:38:23 2019 (r347984) @@ -32,8 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include +#include #include #include Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/crypto/ccp/ccp.c Mon May 20 00:38:23 2019 (r347984) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include +#include #include #include #include Modified: head/sys/crypto/ccp/ccp_hardware.c ============================================================================== --- head/sys/crypto/ccp/ccp_hardware.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/crypto/ccp/ccp_hardware.c Mon May 20 00:38:23 2019 (r347984) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include +#include #include #include #include Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/ddb/db_command.c Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/dev/acpi_support/acpi_panasonic.c ============================================================================== --- head/sys/dev/acpi_support/acpi_panasonic.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpi_support/acpi_panasonic.c Mon May 20 00:38:23 2019 (r347984) @@ -31,10 +31,11 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include +#include +#include #include #include #include -#include #include #include Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpica/acpi.c Mon May 20 00:38:23 2019 (r347984) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include +#include #include #include #include Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpica/acpi_lid.c Mon May 20 00:38:23 2019 (r347984) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include +#include #include #include #include Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpica/acpi_thermal.c Mon May 20 00:38:23 2019 (r347984) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include +#include #include #include #include Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpica/acpi_video.c Mon May 20 00:38:23 2019 (r347984) @@ -30,10 +30,11 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include -#include #include #include #include Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/acpica/acpivar.h Mon May 20 00:38:23 2019 (r347984) @@ -35,7 +35,7 @@ #include "acpi_if.h" #include "bus_if.h" -#include +#include #ifdef INTRNG #include #endif Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/adb/adb_kbd.c Mon May 20 00:38:23 2019 (r347984) @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include #include Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/adb/adb_mouse.c Mon May 20 00:38:23 2019 (r347984) @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include #include Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/amdsbwd/amdsbwd.c Mon May 20 00:38:23 2019 (r347984) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include "opt_amdsbwd.h" #include +#include #include #include #include Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/atkbdc/psm.c Mon May 20 00:38:23 2019 (r347984) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/cardbus/cardbus.c Mon May 20 00:38:23 2019 (r347984) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/dev/cmx/cmx.c ============================================================================== --- head/sys/dev/cmx/cmx.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/cmx/cmx.c Mon May 20 00:38:23 2019 (r347984) @@ -41,7 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/coretemp/coretemp.c Mon May 20 00:38:23 2019 (r347984) @@ -36,14 +36,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include -#include +#include +#include +#include #include /* for curthread */ #include +#include +#include #include #include Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Mon May 20 00:38:23 2019 (r347984) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/cxgbe/tom/t4_tls.c Mon May 20 00:38:23 2019 (r347984) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/dev/dcons/dcons_crom.c ============================================================================== --- head/sys/dev/dcons/dcons_crom.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/dcons/dcons_crom.c Mon May 20 00:38:23 2019 (r347984) @@ -38,6 +38,7 @@ */ #include +#include #include #include #include Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/dcons/dcons_os.c Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,7 @@ */ #include +#include #include #include #include Modified: head/sys/dev/dcons/dcons_os.h ============================================================================== --- head/sys/dev/dcons/dcons_os.h Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/dcons/dcons_os.h Mon May 20 00:38:23 2019 (r347984) @@ -36,6 +36,8 @@ * $FreeBSD$ */ +#include + typedef void (*dcons_poll_fn)(void *, int); EVENTHANDLER_DECLARE(dcons_poll, dcons_poll_fn); Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/evdev/evdev_private.h Mon May 20 00:38:23 2019 (r347984) @@ -32,7 +32,9 @@ #include #include +#include #include +#include #include #include #include Modified: head/sys/dev/extres/syscon/syscon_generic.c ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/extres/syscon/syscon_generic.c Mon May 20 00:38:23 2019 (r347984) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/firewire/firewire.c Mon May 20 00:38:23 2019 (r347984) @@ -38,16 +38,15 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - +#include +#include #include #include -#include +#include #include -#include +#include #include -#include +#include #include #include /* used by smbus and newbus */ Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/firewire/fwohci.c Mon May 20 00:38:23 2019 (r347984) @@ -39,6 +39,7 @@ #include #include +#include #include #include #include Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ichwd/ichwd.c Mon May 20 00:38:23 2019 (r347984) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/dev/ida/ida_disk.c ============================================================================== --- head/sys/dev/ida/ida_disk.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ida/ida_disk.c Mon May 20 00:38:23 2019 (r347984) @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ida/ida_pci.c Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include Modified: head/sys/dev/iir/iir_ctrl.c ============================================================================== --- head/sys/dev/iir/iir_ctrl.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/iir/iir_ctrl.c Mon May 20 00:38:23 2019 (r347984) @@ -46,16 +46,18 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include #include -#include #include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ioat/ioat.c Mon May 20 00:38:23 2019 (r347984) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ipmi/ipmi.c Mon May 20 00:38:23 2019 (r347984) @@ -34,9 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include +#include #include #include #include Modified: head/sys/dev/ipmi/ipmi_opal.c ============================================================================== --- head/sys/dev/ipmi/ipmi_opal.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ipmi/ipmi_opal.c Mon May 20 00:38:23 2019 (r347984) @@ -28,8 +28,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include +#include #include #include #include Modified: head/sys/dev/ips/ips.c ============================================================================== --- head/sys/dev/ips/ips.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/ips/ips.c Mon May 20 00:38:23 2019 (r347984) @@ -30,10 +30,14 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include +#include +#include #include #include + +#include +#include static d_open_t ips_open; static d_close_t ips_close; Modified: head/sys/dev/iscsi/icl_soft_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_soft_proxy.c Sun May 19 23:56:04 2019 (r347983) +++ head/sys/dev/iscsi/icl_soft_proxy.c Mon May 20 00:38:23 2019 (r347984) @@ -74,9 +74,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include Modified: head/sys/dev/iscsi_initiator/iscsivar.h ============================================================================== --- head/sys/dev/iscsi_initiator/iscsivar.h Sun May 19 23:56:04 2019 (r347983) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 20 02:41:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36DD4159E0C4; Mon, 20 May 2019 02:41:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D164587D35; Mon, 20 May 2019 02:41:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8071A180FE; Mon, 20 May 2019 02:41:09 +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 x4K2f9ab082234; Mon, 20 May 2019 02:41:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4K2f9Tt082233; Mon, 20 May 2019 02:41:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905200241.x4K2f9Tt082233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 20 May 2019 02:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347985 - head/sys/dev/ksyms X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ksyms X-SVN-Commit-Revision: 347985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D164587D35 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 02:41:10 -0000 Author: jhibbits Date: Mon May 20 02:41:09 2019 New Revision: 347985 URL: https://svnweb.freebsd.org/changeset/base/347985 Log: ksyms: Fixup symbols for powerpc in the kernel, not just modules Summary: PowerPC kernels are fully position independent, just like kernel modules. The same fixups that are done for modules therefore need to be done to the kernel, else symbol resolution in, e.g., DTrace, cannot resolve the kernel symbols, so only addresses in the kernel are printed, while kernel module symbols are printed. Test Plan: Run lockstat on powerpc64. Note symbols are resolved for kernel and modules. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D20316 Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Mon May 20 00:38:23 2019 (r347984) +++ head/sys/dev/ksyms/ksyms.c Mon May 20 02:41:09 2019 (r347985) @@ -191,6 +191,7 @@ ksyms_add(linker_file_t lf, void *arg) size_t len, numsyms, strsz, symsz; linker_symval_t symval; int error, i, nsyms; + bool fixup; buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); to = arg; @@ -201,6 +202,12 @@ ksyms_add(linker_file_t lf, void *arg) strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); +#ifdef __powerpc__ + fixup = true; +#else + fixup = lf->id > 1; +#endif + while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); @@ -214,7 +221,7 @@ ksyms_add(linker_file_t lf, void *arg) nsyms = len / sizeof(Elf_Sym); for (i = 0; i < nsyms; i++) { symp[i].st_name += to->to_stridx; - if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, + if (fixup && LINKER_SYMBOL_VALUES(lf, (c_linker_sym_t)&symtab[i], &symval) == 0) { symp[i].st_value = (uintptr_t)symval.value; } From owner-svn-src-all@freebsd.org Mon May 20 03:35:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE424159FDD6; Mon, 20 May 2019 03:35:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6410C89DE7; Mon, 20 May 2019 03:35:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B5A18B34; Mon, 20 May 2019 03:35:15 +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 x4K3ZEBl014539; Mon, 20 May 2019 03:35:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4K3ZE08014537; Mon, 20 May 2019 03:35:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905200335.x4K3ZE08014537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 20 May 2019 03:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347986 - head/release/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/release/powerpc X-SVN-Commit-Revision: 347986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6410C89DE7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 03:35:16 -0000 Author: jhibbits Date: Mon May 20 03:35:14 2019 New Revision: 347986 URL: https://svnweb.freebsd.org/changeset/base/347986 Log: Update loader size on powerpc isos Summary: loader has grown to the point it's overflowing the existing 307200 bytes allocated to it in the HFS boot partition on the isos. Bump the space reservation up to 500k. Submitted by: Brandon Bergren MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20301 Modified: head/release/powerpc/generate-hfs.sh head/release/powerpc/hfs-boot.bz2.uu Modified: head/release/powerpc/generate-hfs.sh ============================================================================== --- head/release/powerpc/generate-hfs.sh Mon May 20 02:41:09 2019 (r347985) +++ head/release/powerpc/generate-hfs.sh Mon May 20 03:35:14 2019 (r347986) @@ -13,7 +13,7 @@ # $FreeBSD$ HFS_SIZE=400 #Size in 2048-byte blocks of the produced image -LOADER_SIZE=300k +LOADER_SIZE=500k # Generate 800K HFS image OUTPUT_FILE=hfs-boot Modified: head/release/powerpc/hfs-boot.bz2.uu ============================================================================== --- head/release/powerpc/hfs-boot.bz2.uu Mon May 20 02:41:09 2019 (r347985) +++ head/release/powerpc/hfs-boot.bz2.uu Mon May 20 03:35:14 2019 (r347986) @@ -2,22 +2,22 @@ HFS boot filesystem created by generate-hfs.sh DO NOT EDIT $FreeBSD$ begin 644 hfs-boot.bz2 -M0EIH.3%!62936=#$Y.(``"___?_O_G)7!_Y]OW??5#]U_^!`0`,@1`!!``!@ -M(0!`3,`"L"4.2U"2(H9%/:*>TFDVU3RGZID'J&C3U,@T-&@`/1!H>IZC1D#( -M`D24TTRFC1D]*;$@!IZ@Q!IH-````#0&33":?J@<:&AH:`:`Q`T!D``&F@`: -M`9````PDI1J>0Q,H/1J&@```!D-`````T-``#SZHHR(+Y*Y9J*Z:4KK=T]W@ -M4RV\LG/;0XDPC7^`9DO3/3&*].462T,NO#AA9C,O\0!)^Q@@S6";2`!);?8(B6BR1(-7Q*8?>>HPQSBQE>M$A9K6FFW<:#6[D931J%U.F8*`0 -MD(,M80A(0;]K'X'SI]G(C)Y).AK_/0)D(2$$]JB$]]F').M4RF8O%[IHK[0O -MMQ?'>O[U8EM;>U",KY^*%FO9C05_435?.4*F[6AIL%&9C<9W&& -M[ZMP(TG!'*4Z>@6TM)0BS.D._O,WR9OJ728V48I;DD=8QGBE7J-&L^?=0JEF -MV2`B/)/D\)83IS@32(;!P,152U()0VGQH>2F$UC:M!D5`F#1W$\:KKDR[TQB -MN;N5B1;P!7:AG#1BP2%-Q$7I6QE,Y?NHIK_LR+HA]22HW0.8(^G4/X`Z@!Z6 -8#PQ(0))/`A(0.'VUG_\7D\*>4\HS2-`:`#0````>IH`>H!H-`$B23)H"8% +M!^DF@!ID`:-!H-``&@]3U-`#0]('``-!H:#0`:9!H9`TT``!D`&0&0`$DDIH +M-I-`]0#3U-!HT`'J-``````T-`:&(\F**;,&,E=GQ&[8L)7V[YZ^ZJR_.@4& +MU2XDPC+N!>EYZ/W&3#04SE<:P5525]GTO0!)[3!!B8)L`$@-R?/:TG2RBWBD +M0W-`28BS(@AF_JA3LX#"=D,6`8$FQH;$D(00T-/U)FN-$V.@D&`83,*F)5QB +M4FE2VQ0-(20@DF(-O(HKUH0H8CD,%=&+-^.M]B8!::Q1RF@RL&TP46*0U-B% +MB<50X!"$#S8DV:/)48JA*AC$4DI.CV$L!H)>35`M2ZH9QEA%Q`A30=L(-&8J4!RX`FT"S%(H51.1'GG@?L)8[-HK%K>HLXPST0\@K. +M.0JVBB]*R,L4EW?[61,+)QSE0`]`'!N]>P2IX`_7`^,`A"!])"$DG#MJ +,K_B[DBG"A(;3UI(( ` end From owner-svn-src-all@freebsd.org Mon May 20 04:50:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD0D15A1432; Mon, 20 May 2019 04:50:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 A2B7C8B9D5; Mon, 20 May 2019 04:50:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4K4o9oL072253; Sun, 19 May 2019 21:50:09 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4K4o9uI072252; Sun, 19 May 2019 21:50:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905200450.x4K4o9uI072252@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347982 - head/sys/net In-Reply-To: <201905192149.x4JLnvt5028495@repo.freebsd.org> To: "Alexander V. Chernikov" Date: Sun, 19 May 2019 21:50:09 -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-Rspamd-Queue-Id: A2B7C8B9D5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.936,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 04:50:15 -0000 > Author: melifaro > Date: Sun May 19 21:49:56 2019 > New Revision: 347982 > URL: https://svnweb.freebsd.org/changeset/base/347982 > > Log: > Fix rt_ifa selection during loopback route insertion process. > Currently such routes are added with a link-level IFA, which is > plain wrong. Only after the insertion they get fixed by the special > link_rtrequest() ifa handler. This behaviour complicates routing code > and makes ifa selection more complex. > Streamline this process by explicitly moving link_rtrequest() logic > to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all > this logic in the loopback route case by explicitly specifying > proper rt_ifa inside the ifa_maintain_loopback_route().? > > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20076 I shall again state that from a routing protocol perspecitive and a POLA perspective having the kernel doing route maintanance of any kind is fundementally wrong. I still continue to stronly object to ifa_maintain_loopback_route code even being present in our kernel. Having these routes is a micro optimization at best, and cause issues when real and actual routing protocols are in use. Bruce Evans and myself have locally killed this code, and just about every router type person I show it to gets ill seeing it. Show many another system that does this and I might reconsider, but I have never ever seen one. > Modified: > head/sys/net/if.c > head/sys/net/route.c > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Sun May 19 20:28:49 2019 (r347981) > +++ head/sys/net/if.c Sun May 19 21:49:56 2019 (r347982) > @@ -264,7 +264,6 @@ static void if_route(struct ifnet *, int flag, int fam > static int if_setflag(struct ifnet *, int, int, int *, int); > static int if_transmit(struct ifnet *ifp, struct mbuf *m); > static void if_unroute(struct ifnet *, int flag, int fam); > -static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *); > static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int); > static void do_link_state_change(void *, int); > static int if_getgroup(struct ifgroupreq *, struct ifnet *); > @@ -862,7 +861,6 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc > sdl->sdl_type = ifp->if_type; > ifp->if_addr = ifa; > ifa->ifa_ifp = ifp; > - ifa->ifa_rtrequest = link_rtrequest; > ifa->ifa_addr = (struct sockaddr *)sdl; > sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl); > ifa->ifa_netmask = (struct sockaddr *)sdl; > @@ -1892,6 +1890,7 @@ static int > ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, > struct sockaddr *ia) > { > + struct epoch_tracker et; > int error; > struct rt_addrinfo info; > struct sockaddr_dl null_sdl; > @@ -1902,6 +1901,16 @@ ifa_maintain_loopback_route(int cmd, const char *otype > bzero(&info, sizeof(info)); > if (cmd != RTM_DELETE) > info.rti_ifp = V_loif; > + if (cmd == RTM_ADD) { > + /* explicitly specify (loopback) ifa */ > + if (info.rti_ifp != NULL) { > + NET_EPOCH_ENTER(et); > + info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); > + if (info.rti_ifa != NULL) > + ifa_ref(info.rti_ifa); > + NET_EPOCH_EXIT(et); > + } > + } > info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; > info.rti_info[RTAX_DST] = ia; > info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; > @@ -2208,39 +2217,6 @@ ifa_preferred(struct ifaddr *cur, struct ifaddr *next) > > return (cur->ifa_carp && (!next->ifa_carp || > ((*carp_master_p)(next) && !(*carp_master_p)(cur)))); > -} > - > -#include > - > -/* > - * Default action when installing a route with a Link Level gateway. > - * Lookup an appropriate real ifa to point to. > - * This should be moved to /sys/net/link.c eventually. > - */ > -static void > -link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) > -{ > - struct epoch_tracker et; > - struct ifaddr *ifa, *oifa; > - struct sockaddr *dst; > - struct ifnet *ifp; > - > - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) || > - ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL)) > - return; > - NET_EPOCH_ENTER(et); > - ifa = ifaof_ifpforaddr(dst, ifp); > - if (ifa) { > - oifa = rt->rt_ifa; > - if (oifa != ifa) { > - ifa_free(oifa); > - ifa_ref(ifa); > - } > - rt->rt_ifa = ifa; > - if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest) > - ifa->ifa_rtrequest(cmd, rt, info); > - } > - NET_EPOCH_EXIT(et); > } > > struct sockaddr_dl * > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Sun May 19 20:28:49 2019 (r347981) > +++ head/sys/net/route.c Sun May 19 21:49:56 2019 (r347982) > @@ -1276,12 +1276,14 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo > /* > * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, > * it will be referenced so the caller must free it. > + * > + * Assume basic consistency checks are executed by callers: > + * RTAX_DST exists, if RTF_GATEWAY is set, RTAX_GATEWAY exists as well. > */ > int > rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) > { > struct epoch_tracker et; > - struct ifaddr *ifa; > int needref, error; > > /* > @@ -1291,21 +1293,54 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) > error = 0; > needref = (info->rti_ifa == NULL); > NET_EPOCH_ENTER(et); > + > + /* If we have interface specified by the ifindex in the address, use it */ > if (info->rti_ifp == NULL && ifpaddr != NULL && > - ifpaddr->sa_family == AF_LINK && > - (ifa = ifa_ifwithnet(ifpaddr, 0, fibnum)) != NULL) { > - info->rti_ifp = ifa->ifa_ifp; > + ifpaddr->sa_family == AF_LINK) { > + const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)ifpaddr; > + if (sdl->sdl_index != 0) > + info->rti_ifp = ifnet_byindex_locked(sdl->sdl_index); > } > + /* > + * If we have source address specified, try to find it > + * TODO: avoid enumerating all ifas on all interfaces. > + */ > if (info->rti_ifa == NULL && ifaaddr != NULL) > info->rti_ifa = ifa_ifwithaddr(ifaaddr); > if (info->rti_ifa == NULL) { > struct sockaddr *sa; > > - sa = ifaaddr != NULL ? ifaaddr : > - (gateway != NULL ? gateway : dst); > - if (sa != NULL && info->rti_ifp != NULL) > + /* > + * Most common use case for the userland-supplied routes. > + * > + * Choose sockaddr to select ifa. > + * -- if ifp is set -- > + * Order of preference: > + * 1) IFA address > + * 2) gateway address > + * Note: for interface routes link-level gateway address > + * is specified to indicate the interface index without > + * specifying RTF_GATEWAY. In this case, ignore gateway > + * Note: gateway AF may be different from dst AF. In this case, > + * ignore gateway > + * 3) final destination. > + * 4) if all of these fails, try to get at least link-level ifa. > + * -- else -- > + * try to lookup gateway or dst in the routing table to get ifa > + */ > + if (info->rti_info[RTAX_IFA] != NULL) > + sa = info->rti_info[RTAX_IFA]; > + else if ((info->rti_flags & RTF_GATEWAY) != 0 && > + gateway->sa_family == dst->sa_family) > + sa = gateway; > + else > + sa = dst; > + if (info->rti_ifp != NULL) { > info->rti_ifa = ifaof_ifpforaddr(sa, info->rti_ifp); > - else if (dst != NULL && gateway != NULL) > + /* Case 4 */ > + if (info->rti_ifa == NULL && gateway != NULL) > + info->rti_ifa = ifaof_ifpforaddr(gateway, info->rti_ifp); > + } else if (dst != NULL && gateway != NULL) > info->rti_ifa = ifa_ifwithroute(flags, dst, gateway, > fibnum); > else if (sa != NULL) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 20 05:00:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE6815A1831; Mon, 20 May 2019 05:00:09 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 A62F98BE84; Mon, 20 May 2019 05:00:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4K506kU072318; Sun, 19 May 2019 22:00:06 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4K506YI072317; Sun, 19 May 2019 22:00:06 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905200500.x4K506YI072317@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347980 - head/lib/libsecureboot/openpgp In-Reply-To: <201905192024.x4JKOIZe086856@repo.freebsd.org> To: "Simon J. Gerraty" Date: Sun, 19 May 2019 22:00:06 -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-Rspamd-Queue-Id: A62F98BE84 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.933,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 05:00:09 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: sjg > Date: Sun May 19 20:24:17 2019 > New Revision: 347980 > URL: https://svnweb.freebsd.org/changeset/base/347980 > > Log: > load_key_buf do not free data from dearmor > > The data returned by dearmor is referenced by the key > leave it alone! > > Reviewed by: stevek > MFC after: 2 days This is an exception below the standard minimal limit during a code freeze, is there some reason for it? The next build should not be started before 3 days. > Modified: > head/lib/libsecureboot/openpgp/opgp_key.c > head/lib/libsecureboot/openpgp/opgp_sig.c > > Modified: head/lib/libsecureboot/openpgp/opgp_key.c > ============================================================================== > --- head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:13:55 2019 (r347979) > +++ head/lib/libsecureboot/openpgp/opgp_key.c Sun May 19 20:24:17 2019 (r347980) > @@ -168,6 +168,7 @@ load_key_buf(unsigned char *buf, size_t nbytes) > initialize(); > > if (!(buf[0] & OPENPGP_TAG_ISTAG)) { > + /* Note: we do *not* free data */ > data = dearmor((char *)buf, nbytes, &nbytes); > ptr = data; > } else > @@ -190,7 +191,6 @@ load_key_buf(unsigned char *buf, size_t nbytes) > } > } > } > - free(data); > return (key); > } > > @@ -209,8 +209,10 @@ openpgp_trust_add(OpenPGP_key *key) > > LIST_INIT(&trust_list); > } > - if (key) > + if (key) { > + DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id)); > LIST_INSERT_HEAD(&trust_list, key, entries); > + } > } > > /** > @@ -296,6 +298,7 @@ load_key_id(const char *keyID) > if (!key) > key = load_trusted_key_id(keyID); > #endif > + DEBUG_PRINTF(2, ("load_key_id(%s): %s\n", keyID, key ? "found" : "nope")); > return (key); > } > > > Modified: head/lib/libsecureboot/openpgp/opgp_sig.c > ============================================================================== > --- head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:13:55 2019 (r347979) > +++ head/lib/libsecureboot/openpgp/opgp_sig.c Sun May 19 20:24:17 2019 (r347980) > @@ -318,6 +318,7 @@ openpgp_verify(const char *filename, > sdata = ddata = dearmor((char *)sdata, sbytes, &sbytes); > ptr = sdata; > rc = decode_packet(2, &ptr, sbytes, (decoder_t)decode_sig, sig); > + DEBUG_PRINTF(2, ("rc=%d keyID=%s\n", rc, sig->key_id ? sig->key_id : "?")); > if (rc == 0 && sig->key_id) { > key = load_key_id(sig->key_id); > if (!key) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 20 05:45:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7621115A29C0; Mon, 20 May 2019 05:45:11 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8FDA8D3DC; Mon, 20 May 2019 05:45:10 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ed1-f68.google.com with SMTP id l25so21906095eda.9; Sun, 19 May 2019 22:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IYRV/2x4YbM0gkr71oK0bFW6/71kU27IFp9z2/Wg8dw=; b=msd0nrwdAmAgSZ1bGBRcPEV6xLIbbkq6I4v/iOwkkp0yss8JtQ1oVa8hUSQ24QTFyo 7i+km7Fas4/mEvxsVDrOhw7OoC69WePC2TG6NeHlSsKgA2mdML9BqrY0kBA4zdW61jHf Ov+/njw+1RfQMlJo6ODGcuP4l7s7BClmWkpViGudMROuZPEHznt2RdGrMc3zYWL3ICX6 /SVYMd0PQyjhQIoRVuilUzABkhB/chfXZ715mY4ftiH8xQxbo7zcaPDRpFCW1kuxIWmM TWBeUK7Jaw/qexZhjywg+KQuqH38qVD1TaaLpJ6bm0w2FVX+rBwF7yOrMQ4XPyZuyQq0 VmlQ== X-Gm-Message-State: APjAAAWuHs3egQ7ogA683C11IIv8YWKnp3129mnb15LGwZrW3zRtppdU 1vqfR4182WdV20OoO4iNHv6fmPfnjCBdkvGIiC6ZJ3vy X-Google-Smtp-Source: APXvYqzmfEp5NAYvybmrCF31+3Yl0zVon6yEoE5VAdAKjLbUUmPM4MwwNqrR1m76kZj7jx4qMIqDrmdD8zdgjxhRdqo= X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr46216878ejw.183.1558330655230; Sun, 19 May 2019 22:37:35 -0700 (PDT) MIME-Version: 1.0 References: <201905200038.x4K0cNoZ019920@repo.freebsd.org> In-Reply-To: <201905200038.x4K0cNoZ019920@repo.freebsd.org> From: Antoine Brodin Date: Mon, 20 May 2019 07:37:23 +0200 Message-ID: Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E8FDA8D3DC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 05:45:11 -0000 On Mon, May 20, 2019 at 2:38 AM Conrad Meyer wrote: > Author: cem > Date: Mon May 20 00:38:23 2019 > New Revision: 347984 > URL: https://svnweb.freebsd.org/changeset/base/347984 > > Log: > Extract eventfilter declarations to sys/_eventfilter.h > > This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" > in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header > pollution substantially. > > EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c > files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). > > As a side effect of reduced header pollution, many .c files and headers no > longer contain needed definitions. The remainder of the patch addresses > adding appropriate includes to fix those files. > > LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by > sys/mutex.h since r326106 (but silently protected by header pollution prior > to this change). > > No functional change (intended). Of course, any out of tree modules that > relied on header pollution for sys/eventhandler.h, sys/lock.h, or > sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Hi, Why request an exp-run and commit the patch before the exp-run has finished? Cheers, Antoine From owner-svn-src-all@freebsd.org Mon May 20 07:55:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F36415A511A; Mon, 20 May 2019 07:55:30 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) 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 37BE76A17E; Mon, 20 May 2019 07:55:28 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from [192.168.1.2] (p57BB409D.dip0.t-ipconnect.de [87.187.64.157]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 1437B721E280C; Mon, 20 May 2019 09:55:19 +0200 (CEST) From: Michael Tuexen Message-Id: <3214C1FD-B4C8-4A2F-8726-06D5B8878C79@fh-muenster.de> Content-Type: multipart/signed; boundary="Apple-Mail=_FB701B7B-6FE3-4718-A8B7-D128986CE440"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... Date: Mon, 20 May 2019 09:55:16 +0200 In-Reply-To: <201905200038.x4K0cNoZ019920@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Conrad Meyer References: <201905200038.x4K0cNoZ019920@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.11) 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 07:55:30 -0000 --Apple-Mail=_FB701B7B-6FE3-4718-A8B7-D128986CE440 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 20. May 2019, at 02:38, Conrad Meyer wrote: >=20 > Author: cem > Date: Mon May 20 00:38:23 2019 > New Revision: 347984 > URL: https://svnweb.freebsd.org/changeset/base/347984 >=20 > Log: > Extract eventfilter declarations to sys/_eventfilter.h >=20 > This allows replacing "sys/eventfilter.h" includes with = "sys/_eventfilter.h" > in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header > pollution substantially. >=20 > EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of = .c > files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). >=20 > As a side effect of reduced header pollution, many .c files and = headers no > longer contain needed definitions. The remainder of the patch = addresses > adding appropriate includes to fix those files. >=20 > LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as = required by > sys/mutex.h since r326106 (but silently protected by header pollution = prior > to this change). >=20 > No functional change (intended). Of course, any out of tree modules = that > relied on header pollution for sys/eventhandler.h, sys/lock.h, or > sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been = bumped. This breaks compiling kernels having the options options KCOV # Kernel Coverage Sanitizer options COVERAGE enabled. sys/kern/kern_kcov.c also needs to include sys/eventhandler.h Best regards Michael >=20 > Added: > head/sys/sys/_eventhandler.h (contents, props changed) > Modified: > head/sys/amd64/vmm/io/iommu.c > head/sys/arm/allwinner/a10/a10_intc.c > head/sys/arm/allwinner/a10_dmac.c > head/sys/arm/allwinner/a31_dmac.c > head/sys/arm/allwinner/aw_ccu.c > head/sys/arm/allwinner/aw_reset.c > head/sys/arm/allwinner/aw_rsb.c > head/sys/arm/allwinner/aw_spi.c > head/sys/arm/allwinner/aw_thermal.c > head/sys/arm/allwinner/aw_wdog.c > head/sys/arm/allwinner/clkng/aw_ccung.c > head/sys/arm/arm/machdep.c > head/sys/arm/arm/pl190.c > head/sys/arm/broadcom/bcm2835/bcm2835_rng.c > head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c > head/sys/arm/broadcom/bcm2835/bcm2836.c > head/sys/arm/freescale/imx/imx_wdog.c > head/sys/arm/mv/armada/thermal.c > head/sys/arm/mv/armada/wdt.c > head/sys/arm/mv/mv_spi.c > head/sys/arm/mv/timer.c > head/sys/arm/nvidia/tegra124/tegra124_machdep.c > head/sys/arm/nvidia/tegra124/tegra124_pmc.c > head/sys/arm/nvidia/tegra_xhci.c > head/sys/arm/ti/ti_pruss.c > head/sys/arm/ti/ti_wdt.c > head/sys/arm/versatile/versatile_pci.c > head/sys/arm/versatile/versatile_sic.c > head/sys/arm64/arm64/gicv3_its.c > head/sys/arm64/arm64/machdep.c > head/sys/arm64/coresight/coresight.c > head/sys/arm64/rockchip/clk/rk_cru.c > head/sys/cam/cam_periph.h > head/sys/cam/ctl/ctl_ha.c > head/sys/cddl/compat/opensolaris/kern/opensolaris.c > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c > head/sys/crypto/aesni/aesni.c > head/sys/crypto/armv8/armv8_crypto.c > head/sys/crypto/blake2/blake2_cryptodev.c > head/sys/crypto/ccp/ccp.c > head/sys/crypto/ccp/ccp_hardware.c > head/sys/ddb/db_command.c > head/sys/dev/acpi_support/acpi_panasonic.c > head/sys/dev/acpica/acpi.c > head/sys/dev/acpica/acpi_lid.c > head/sys/dev/acpica/acpi_thermal.c > head/sys/dev/acpica/acpi_video.c > head/sys/dev/acpica/acpivar.h > head/sys/dev/adb/adb_kbd.c > head/sys/dev/adb/adb_mouse.c > head/sys/dev/amdsbwd/amdsbwd.c > head/sys/dev/atkbdc/psm.c > head/sys/dev/cardbus/cardbus.c > head/sys/dev/cmx/cmx.c > head/sys/dev/coretemp/coretemp.c > head/sys/dev/cxgbe/cxgbei/cxgbei.c > head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c > head/sys/dev/cxgbe/tom/t4_tls.c > head/sys/dev/dcons/dcons_crom.c > head/sys/dev/dcons/dcons_os.c > head/sys/dev/dcons/dcons_os.h > head/sys/dev/evdev/evdev_private.h > head/sys/dev/extres/syscon/syscon_generic.c > head/sys/dev/firewire/firewire.c > head/sys/dev/firewire/fwohci.c > head/sys/dev/ichwd/ichwd.c > head/sys/dev/ida/ida_disk.c > head/sys/dev/ida/ida_pci.c > head/sys/dev/iir/iir_ctrl.c > head/sys/dev/ioat/ioat.c > head/sys/dev/ipmi/ipmi.c > head/sys/dev/ipmi/ipmi_opal.c > head/sys/dev/ips/ips.c > head/sys/dev/iscsi/icl_soft_proxy.c > head/sys/dev/iscsi_initiator/iscsivar.h > head/sys/dev/iwm/if_iwm_notif_wait.c > head/sys/dev/led/led.c > head/sys/dev/liquidio/lio_bsd.h > head/sys/dev/mfi/mfi_disk.c > head/sys/dev/mfi/mfi_pci.c > head/sys/dev/mfi/mfi_syspd.c > head/sys/dev/mlx/mlxvar.h > head/sys/dev/mmc/host/dwmmc.c > head/sys/dev/mpr/mprvar.h > head/sys/dev/mps/mpsvar.h > head/sys/dev/mrsas/mrsas.h > head/sys/dev/nmdm/nmdm.c > head/sys/dev/ntb/if_ntb/if_ntb.c > head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > head/sys/dev/ow/ow.c > head/sys/dev/pccard/pccard.c > head/sys/dev/pci/pci.c > head/sys/dev/pci/pci_iov.c > head/sys/dev/pci/pci_pci.c > head/sys/dev/pci/pcivar.h > head/sys/dev/scc/scc_core.c > head/sys/dev/scc/scc_dev_quicc.c > head/sys/dev/scc/scc_dev_sab82532.c > head/sys/dev/scc/scc_dev_z8530.c > head/sys/dev/smartpqi/smartpqi_includes.h > head/sys/dev/sound/pcm/sound.h > head/sys/dev/tws/tws.h > head/sys/dev/usb/net/if_cdce.c > head/sys/dev/usb/net/if_usie.c > head/sys/dev/usb/net/uhso.c > head/sys/dev/usb/serial/u3g.c > head/sys/dev/usb/usb_device.c > head/sys/dev/usb/usbdi.h > head/sys/dev/usb/wlan/if_run.c > head/sys/dev/viawd/viawd.c > head/sys/dev/vkbd/vkbd.c > head/sys/dev/vmware/vmci/vmci.c > head/sys/dev/vt/vt_cpulogos.c > head/sys/dev/vt/vt_sysmouse.c > head/sys/dev/watchdog/watchdog.c > head/sys/dev/xdma/xdma.c > head/sys/dev/xdma/xdma_bank.c > head/sys/dev/xdma/xdma_bio.c > head/sys/dev/xdma/xdma_mbuf.c > head/sys/dev/xdma/xdma_queue.c > head/sys/dev/xdma/xdma_sg.c > head/sys/dev/xen/console/xen_console.c > head/sys/dev/xen/debug/debug.c > head/sys/fs/devfs/devfs_vnops.c > head/sys/i386/i386/elan-mmcr.c > head/sys/i386/i386/geode.c > head/sys/i386/i386/longrun.c > head/sys/kern/bus_if.m > head/sys/kern/init_main.c > head/sys/kern/kern_clock.c > head/sys/kern/kern_exec.c > head/sys/kern/kern_exit.c > head/sys/kern/kern_fork.c > head/sys/kern/kern_proc.c > head/sys/kern/subr_bus_dma.c > head/sys/kern/subr_intr.c > head/sys/kern/subr_power.c > head/sys/kern/tty_tty.c > head/sys/kern/vfs_mountroot.c > head/sys/mips/atheros/ar71xx_machdep.c > head/sys/mips/atheros/ar71xx_wdog.c > head/sys/net/bpf.c > head/sys/net/bpf.h > head/sys/net/bpf_buffer.c > head/sys/net/ethernet.h > head/sys/net/if.c > head/sys/net/if_clone.h > head/sys/net/if_llatbl.c > head/sys/net/if_llatbl.h > head/sys/net/if_tuntap.c > head/sys/net/if_var.h > head/sys/net/if_vlan_var.h > head/sys/netinet/if_ether.c > head/sys/netinet/tcp_offload.c > head/sys/netinet/toecore.c > head/sys/netinet/toecore.h > head/sys/netinet6/nd6.c > head/sys/netinet6/nd6_nbr.c > head/sys/powerpc/ofw/ofw_machdep.c > head/sys/powerpc/powermac/cpcht.c > head/sys/powerpc/powermac/cuda.c > head/sys/powerpc/powermac/pmu.c > head/sys/powerpc/powermac/smu.c > head/sys/powerpc/powermac/vcoregpio.c > head/sys/powerpc/powernv/opal.h > head/sys/powerpc/powernv/opal_async.c > head/sys/powerpc/powernv/opal_console.c > head/sys/powerpc/powernv/opal_dev.c > head/sys/powerpc/powernv/opal_flash.c > head/sys/powerpc/powernv/opal_sensor.c > head/sys/powerpc/powernv/xive.c > head/sys/powerpc/powerpc/cpu.c > head/sys/powerpc/powerpc/openpic.c > head/sys/powerpc/ps3/ps3bus.c > head/sys/powerpc/pseries/rtas_dev.c > head/sys/powerpc/pseries/xics.c > head/sys/riscv/riscv/intr_machdep.c > head/sys/riscv/riscv/machdep.c > head/sys/riscv/riscv/mp_machdep.c > head/sys/security/audit/audit.c > head/sys/security/audit/audit_trigger.c > head/sys/sys/_lock.h > head/sys/sys/bus.h > head/sys/sys/conf.h > head/sys/sys/cpu.h > head/sys/sys/eventhandler.h > head/sys/sys/interrupt.h > head/sys/sys/lock.h > head/sys/sys/param.h > head/sys/sys/pcpu.h > head/sys/sys/power.h > head/sys/sys/proc.h > head/sys/sys/watchdog.h > head/sys/vm/swap_pager.c > head/sys/x86/acpica/OsdEnvironment.c > head/sys/x86/cpufreq/smist.c > head/sys/x86/iommu/intel_drv.c > head/sys/x86/iommu/intel_intrmap.c > head/sys/x86/iommu/intel_quirks.c > head/sys/x86/x86/tsc.c >=20 > Modified: head/sys/amd64/vmm/io/iommu.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/amd64/vmm/io/iommu.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/amd64/vmm/io/iommu.c Mon May 20 00:38:23 2019 = (r347984) > @@ -32,10 +32,10 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > -#include > #include > +#include > #include > +#include >=20 > #include > #include >=20 > Modified: head/sys/arm/allwinner/a10/a10_intc.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/arm/allwinner/a10/a10_intc.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/a10/a10_intc.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,11 +30,12 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_platform.h" >=20 > -#include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/allwinner/a10_dmac.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/arm/allwinner/a10_dmac.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/a10_dmac.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include >=20 > #include >=20 >=20 > Modified: head/sys/arm/allwinner/a31_dmac.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/arm/allwinner/a31_dmac.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/a31_dmac.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/allwinner/aw_ccu.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/arm/allwinner/aw_ccu.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_ccu.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/allwinner/aw_reset.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/arm/allwinner/aw_reset.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_reset.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/allwinner/aw_rsb.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/arm/allwinner/aw_rsb.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_rsb.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/allwinner/aw_spi.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/arm/allwinner/aw_spi.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_spi.c Mon May 20 00:38:23 2019 = (r347984) > @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/allwinner/aw_thermal.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/arm/allwinner/aw_thermal.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_thermal.c Mon May 20 00:38:23 2019 = (r347984) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/allwinner/aw_wdog.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/arm/allwinner/aw_wdog.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/aw_wdog.c Mon May 20 00:38:23 2019 = (r347984) > @@ -28,6 +28,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/allwinner/clkng/aw_ccung.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/arm/allwinner/clkng/aw_ccung.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/allwinner/clkng/aw_ccung.c Mon May 20 00:38:23 2019 = (r347984) > @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/arm/machdep.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/arm/arm/machdep.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/arm/machdep.c Mon May 20 00:38:23 2019 = (r347984) > @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/arm/pl190.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/arm/arm/pl190.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/arm/pl190.c Mon May 20 00:38:23 2019 = (r347984) > @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_rng.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/arm/broadcom/bcm2835/bcm2835_rng.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.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/arm/broadcom/bcm2835/bcm2835_wdog.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -29,12 +29,15 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > -#include > #include > +#include > #include > +#include > #include > +#include > #include > +#include > +#include >=20 > #include > #include >=20 > Modified: head/sys/arm/broadcom/bcm2835/bcm2836.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/arm/broadcom/bcm2835/bcm2836.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Mon May 20 00:38:23 2019 = (r347984) > @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #ifdef SMP >=20 > Modified: head/sys/arm/freescale/imx/imx_wdog.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/arm/freescale/imx/imx_wdog.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/freescale/imx/imx_wdog.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,13 +33,16 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > +#include > +#include > #include > +#include > #include > -#include > -#include > +#include > #include > #include > +#include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/mv/armada/thermal.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/arm/mv/armada/thermal.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/mv/armada/thermal.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,9 +33,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/mv/armada/wdt.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/arm/mv/armada/wdt.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/mv/armada/wdt.c Mon May 20 00:38:23 2019 = (r347984) > @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/mv/mv_spi.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/arm/mv/mv_spi.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/mv/mv_spi.c Mon May 20 00:38:23 2019 = (r347984) > @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); > #include >=20 > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm/mv/timer.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/arm/mv/timer.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/mv/timer.c Mon May 20 00:38:23 2019 = (r347984) > @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.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/arm/nvidia/tegra124/tegra124_machdep.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -30,10 +30,11 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > #include > -#include > #include > +#include > +#include > +#include >=20 > #include >=20 >=20 > Modified: head/sys/arm/nvidia/tegra124/tegra124_pmc.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/arm/nvidia/tegra124/tegra124_pmc.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/arm/nvidia/tegra124/tegra124_pmc.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -27,12 +27,14 @@ > */ >=20 > #include > -#include > #include > #include > -#include > +#include > #include > +#include > +#include > #include > +#include >=20 > #include >=20 >=20 > Modified: head/sys/arm/nvidia/tegra_xhci.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/arm/nvidia/tegra_xhci.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/nvidia/tegra_xhci.c Mon May 20 00:38:23 2019 = (r347984) > @@ -34,15 +34,17 @@ __FBSDID("$FreeBSD$"); > #include "opt_platform.h" >=20 > #include > -#include > -#include > -#include > -#include > #include > #include > #include > #include > +#include > +#include > +#include > +#include > +#include > #include > +#include >=20 > #include > #include >=20 > Modified: head/sys/arm/ti/ti_pruss.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/arm/ti/ti_pruss.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/ti/ti_pruss.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,8 +38,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/ti/ti_wdt.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/arm/ti/ti_wdt.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/ti/ti_wdt.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm/versatile/versatile_pci.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/arm/versatile/versatile_pci.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/versatile/versatile_pci.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,8 +33,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > +#include > #include > +#include > +#include > #include > #include >=20 >=20 > Modified: head/sys/arm/versatile/versatile_sic.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/arm/versatile/versatile_sic.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm/versatile/versatile_sic.c Mon May 20 00:38:23 2019 = (r347984) > @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm64/arm64/gicv3_its.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/arm64/arm64/gicv3_its.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm64/arm64/gicv3_its.c Mon May 20 00:38:23 2019 = (r347984) > @@ -42,8 +42,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm64/arm64/machdep.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/arm64/arm64/machdep.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm64/arm64/machdep.c Mon May 20 00:38:23 2019 = (r347984) > @@ -42,8 +42,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include =20 > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/arm64/coresight/coresight.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/arm64/coresight/coresight.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm64/coresight/coresight.c Mon May 20 00:38:23 2019 = (r347984) > @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/arm64/rockchip/clk/rk_cru.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/arm64/rockchip/clk/rk_cru.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/arm64/rockchip/clk/rk_cru.c Mon May 20 00:38:23 2019 = (r347984) > @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/cam/cam_periph.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/cam/cam_periph.h Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/cam/cam_periph.h Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,8 @@ > #include >=20 > #ifdef _KERNEL > +#include > +#include > #include > #include >=20 >=20 > Modified: head/sys/cam/ctl/ctl_ha.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/ctl/ctl_ha.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/cam/ctl/ctl_ha.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,23 +30,23 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > +#include > +#include > +#include > #include > #include > -#include > #include > #include > -#include > -#include > -#include > #include > #include > +#include > +#include > #include > -#include > #include > -#include > #include > #include > +#include > +#include > #include > #include > #include >=20 > Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.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/cddl/compat/opensolaris/kern/opensolaris.c Sun May = 19 23:56:04 2019 (r347983) > +++ head/sys/cddl/compat/opensolaris/kern/opensolaris.c Mon May = 20 00:38:23 2019 (r347984) > @@ -27,7 +27,7 @@ > */ >=20 > #include > -#include > +#include > #include > #include > #include >=20 > Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.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/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun May = 19 23:56:04 2019 (r347983) > +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon May = 20 00:38:23 2019 (r347984) > @@ -25,6 +25,7 @@ static const char rcsid[] =3D "@(#)$Id$"; > # include "opt_random_ip_id.h" > #endif > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.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/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Sun May = 19 23:56:04 2019 (r347983) > +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Mon May = 20 00:38:23 2019 (r347984) > @@ -178,7 +178,6 @@ static const char *const ioctl_names[] =3D { > vchiq_static_assert((sizeof(ioctl_names)/sizeof(ioctl_names[0])) =3D=3D > (VCHIQ_IOC_MAX + 1)); >=20 > -static eventhandler_tag vchiq_ehtag =3D NULL; > static d_open_t vchiq_open; > static d_close_t vchiq_close; > static d_ioctl_t vchiq_ioctl; > @@ -2918,9 +2917,6 @@ void vchiq_exit(void); > void > vchiq_exit(void) > { > - if (vchiq_ehtag =3D=3D NULL) > - EVENTHANDLER_DEREGISTER(dev_clone, vchiq_ehtag); > - vchiq_ehtag =3D NULL; >=20 > vchiq_platform_exit(&g_state); > if (vchiq_cdev) { >=20 > Modified: head/sys/crypto/aesni/aesni.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/crypto/aesni/aesni.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/crypto/aesni/aesni.c Mon May 20 00:38:23 2019 = (r347984) > @@ -35,17 +35,18 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > +#include > #include > #include > #include > #include > -#include > #include > -#include > -#include > #include > +#include > +#include > #include > +#include > +#include >=20 > #include > #include >=20 > Modified: head/sys/crypto/armv8/armv8_crypto.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/crypto/armv8/armv8_crypto.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/crypto/armv8/armv8_crypto.c Mon May 20 00:38:23 2019 = (r347984) > @@ -45,9 +45,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/crypto/blake2/blake2_cryptodev.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/crypto/blake2/blake2_cryptodev.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/crypto/blake2/blake2_cryptodev.c Mon May 20 00:38:23 2019 = (r347984) > @@ -32,8 +32,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > +#include > +#include > #include > #include >=20 >=20 > Modified: head/sys/crypto/ccp/ccp.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/crypto/ccp/ccp.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/crypto/ccp/ccp.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_ddb.h" >=20 > -#include > +#include > #include > #include > #include >=20 > Modified: head/sys/crypto/ccp/ccp_hardware.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/crypto/ccp/ccp_hardware.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/crypto/ccp/ccp_hardware.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_ddb.h" >=20 > -#include > +#include > #include > #include > #include >=20 > Modified: head/sys/ddb/db_command.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/ddb/db_command.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/ddb/db_command.c Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/acpi_support/acpi_panasonic.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/acpi_support/acpi_panasonic.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/dev/acpi_support/acpi_panasonic.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -31,10 +31,11 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_acpi.h" > #include > +#include > +#include > #include > #include > #include > -#include > #include >=20 > #include >=20 > Modified: head/sys/dev/acpica/acpi.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/acpica/acpi.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/acpica/acpi.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_acpi.h" >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/acpica/acpi_lid.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/acpica/acpi_lid.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/acpica/acpi_lid.c Mon May 20 00:38:23 2019 = (r347984) > @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_acpi.h" > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/acpica/acpi_thermal.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/acpica/acpi_thermal.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/acpica/acpi_thermal.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include "opt_acpi.h" > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/acpica/acpi_video.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/acpica/acpi_video.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/acpica/acpi_video.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,10 +30,11 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > +#include > #include > #include > #include > -#include > #include > #include > #include >=20 > Modified: head/sys/dev/acpica/acpivar.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/acpica/acpivar.h Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/acpica/acpivar.h Mon May 20 00:38:23 2019 = (r347984) > @@ -35,7 +35,7 @@ >=20 > #include "acpi_if.h" > #include "bus_if.h" > -#include > +#include > #ifdef INTRNG > #include > #endif >=20 > Modified: head/sys/dev/adb/adb_kbd.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/adb/adb_kbd.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/adb/adb_kbd.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,7 +30,9 @@ > #include > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/adb/adb_mouse.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/adb/adb_mouse.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/adb/adb_mouse.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,7 +30,9 @@ > #include > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/amdsbwd/amdsbwd.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/amdsbwd/amdsbwd.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/amdsbwd/amdsbwd.c Mon May 20 00:38:23 2019 = (r347984) > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_amdsbwd.h" >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/atkbdc/psm.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/atkbdc/psm.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/atkbdc/psm.c Mon May 20 00:38:23 2019 = (r347984) > @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/cardbus/cardbus.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/cardbus/cardbus.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/cardbus/cardbus.c Mon May 20 00:38:23 2019 = (r347984) > @@ -31,6 +31,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/cmx/cmx.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/cmx/cmx.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/cmx/cmx.c Mon May 20 00:38:23 2019 = (r347984) > @@ -41,7 +41,9 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/coretemp/coretemp.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/coretemp/coretemp.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/coretemp/coretemp.c Mon May 20 00:38:23 2019 = (r347984) > @@ -36,14 +36,15 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > -#include > -#include > -#include > #include > #include > -#include > +#include > +#include > +#include > #include /* for curthread */ > #include > +#include > +#include >=20 > #include > #include >=20 > Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.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/cxgbe/cxgbei/cxgbei.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include >=20 >=20 > Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.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/cxgbe/cxgbei/icl_cxgbei.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Mon May 20 00:38:23 2019 = (r347984) > @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/cxgbe/tom/t4_tls.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/cxgbe/tom/t4_tls.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/cxgbe/tom/t4_tls.c Mon May 20 00:38:23 2019 = (r347984) > @@ -33,6 +33,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/dcons/dcons_crom.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/dcons/dcons_crom.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/dcons/dcons_crom.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,6 +38,7 @@ > */ >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/dcons/dcons_os.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/dcons/dcons_os.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/dcons/dcons_os.c Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,7 @@ > */ >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/dcons/dcons_os.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/dcons/dcons_os.h Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/dcons/dcons_os.h Mon May 20 00:38:23 2019 = (r347984) > @@ -36,6 +36,8 @@ > * $FreeBSD$ > */ >=20 > +#include > + > typedef void (*dcons_poll_fn)(void *, int); > EVENTHANDLER_DECLARE(dcons_poll, dcons_poll_fn); >=20 >=20 > Modified: head/sys/dev/evdev/evdev_private.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/evdev/evdev_private.h Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/evdev/evdev_private.h Mon May 20 00:38:23 2019 = (r347984) > @@ -32,7 +32,9 @@ >=20 > #include > #include > +#include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/extres/syscon/syscon_generic.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/extres/syscon/syscon_generic.c Sun May 19 = 23:56:04 2019 (r347983) > +++ head/sys/dev/extres/syscon/syscon_generic.c Mon May 20 = 00:38:23 2019 (r347984) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/dev/firewire/firewire.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/firewire/firewire.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/firewire/firewire.c Mon May 20 00:38:23 2019 = (r347984) > @@ -38,16 +38,15 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > -#include > - > +#include > +#include > #include > #include > -#include > +#include > #include > -#include > +#include > #include > -#include > +#include >=20 > #include > #include /* used by smbus and newbus */ >=20 > Modified: head/sys/dev/firewire/fwohci.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/firewire/fwohci.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/firewire/fwohci.c Mon May 20 00:38:23 2019 = (r347984) > @@ -39,6 +39,7 @@ >=20 > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/ichwd/ichwd.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/ichwd/ichwd.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ichwd/ichwd.c Mon May 20 00:38:23 2019 = (r347984) > @@ -62,6 +62,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/ida/ida_disk.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/ida/ida_disk.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ida/ida_disk.c Mon May 20 00:38:23 2019 = (r347984) > @@ -41,6 +41,8 @@ > #include > #include > #include > +#include > +#include >=20 > #include > #include >=20 > Modified: head/sys/dev/ida/ida_pci.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/ida/ida_pci.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ida/ida_pci.c Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include >=20 > #include > #include >=20 > Modified: head/sys/dev/iir/iir_ctrl.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/iir/iir_ctrl.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/iir/iir_ctrl.c Mon May 20 00:38:23 2019 = (r347984) > @@ -46,16 +46,18 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > -#include > -#include > #include > #include > -#include > #include > +#include > +#include > +#include > +#include > +#include > +#include > #include > #include > +#include > #include >=20 > #include >=20 > Modified: head/sys/dev/ioat/ioat.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/ioat/ioat.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ioat/ioat.c Mon May 20 00:38:23 2019 = (r347984) > @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/ipmi/ipmi.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/ipmi/ipmi.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ipmi/ipmi.c Mon May 20 00:38:23 2019 = (r347984) > @@ -34,9 +34,12 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/ipmi/ipmi_opal.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/ipmi/ipmi_opal.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ipmi/ipmi_opal.c Mon May 20 00:38:23 2019 = (r347984) > @@ -28,8 +28,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > -#include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/ips/ips.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/ips/ips.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/ips/ips.c Mon May 20 00:38:23 2019 = (r347984) > @@ -30,10 +30,14 @@ > #include > __FBSDID("$FreeBSD$"); >=20 > -#include > -#include > +#include > +#include > +#include > #include > #include > + > +#include > +#include >=20 > static d_open_t ips_open; > static d_close_t ips_close; >=20 > Modified: head/sys/dev/iscsi/icl_soft_proxy.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/iscsi/icl_soft_proxy.c Sun May 19 23:56:04 2019 = (r347983) > +++ head/sys/dev/iscsi/icl_soft_proxy.c Mon May 20 00:38:23 2019 = (r347984) > @@ -74,9 +74,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > +#include > #include > #include > #include >=20 > Modified: head/sys/dev/iscsi_initiator/iscsivar.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/iscsi_initiator/iscsivar.h Sun May 19 23:56:04 2019 = (r347983) >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >=20 >=20 --Apple-Mail=_FB701B7B-6FE3-4718-A8B7-D128986CE440 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEJAw ggTVMIIDvaADAgECAghQTsb1PRG0ZDANBgkqhkiG9w0BAQsFADBxMQswCQYDVQQGEwJERTEcMBoG A1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRl cjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNMTQwNzIyMTIwODI2WhcN MTkwNzA5MjM1OTAwWjBaMQswCQYDVQQGEwJERTETMBEGA1UEChMKREZOLVZlcmVpbjEQMA4GA1UE CxMHREZOLVBLSTEkMCIGA1UEAxMbREZOLVZlcmVpbiBQQ0EgR2xvYmFsIC0gRzAxMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6ZvDZ4X5Da71jVTDllA1PWLpbkztlNcAW5UidNQg6zSP 1uzAMQQLmYHiphTSUqAoI4SLdIkEXlvg4njBeMsWyyg1OXstkEXQ7aAAeny/Sg4bAMOG6VwrMRF7 DPOCJEOMHDiLamgAmu7cT3ir0sYTm3at7t4m6O8Br3QPwQmi9mvOvdPNFDBP9eXjpMhim4IaAycw DQJlYE3t0QkjKpY1WCfTdsZxtpAdxO3/NYZ9bzOz2w/FEcKKg6GUXUFr2NIQ9Uz9ylGs2b3vkoO7 2uuLFlZWQ8/h1RM9ph8nMM1JVNvJEzSacXXFbOqnC5j5IZ0nrz6jOTlIaoytyZn7wxLyvQIDAQAB o4IBhjCCAYIwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRJt8bP6D0ff+pEexMp9/EKcD7eZDAf BgNVHSMEGDAWgBQxw3kbuvVT1xfgiXotF2wKsyudMzASBgNVHRMBAf8ECDAGAQH/AgECMGIGA1Ud IARbMFkwEQYPKwYBBAGBrSGCLAEBBAICMBEGDysGAQQBga0hgiwBAQQDADARBg8rBgEEAYGtIYIs AQEEAwEwDwYNKwYBBAGBrSGCLAEBBDANBgsrBgEEAYGtIYIsHjA+BgNVHR8ENzA1MDOgMaAvhi1o dHRwOi8vcGtpMDMzNi50ZWxlc2VjLmRlL3JsL0RUX1JPT1RfQ0FfMi5jcmwweAYIKwYBBQUHAQEE bDBqMCwGCCsGAQUFBzABhiBodHRwOi8vb2NzcDAzMzYudGVsZXNlYy5kZS9vY3NwcjA6BggrBgEF BQcwAoYuaHR0cDovL3BraTAzMzYudGVsZXNlYy5kZS9jcnQvRFRfUk9PVF9DQV8yLmNlcjANBgkq hkiG9w0BAQsFAAOCAQEAYyAo/ZwhhnK+OUZZOTIlvKkBmw3Myn1BnIZtCm4ssxNZdbEzkhthJxb/ w7LVNYL7hCoBSb1mu2YvssIGXW4/buMBWlvKQ2NclbbhMacf1QdfTeZlgk4y+cN8ekvNTVx07iHy dQLsUj7SyWrTkCNuSWc1vn9NVqTszC/Pt6GXqHI+ybxA1lqkCD3WvILDt7cyjrEsjmpttzUCGc/1 OURYY6ckABCwu/xOr24vOLulV0k/2G5QbyyXltwdRpplic+uzPLl2Z9Tsz6hL5Kp2AvGhB8Exuse 6J99tXulAvEkxSRjETTMWpMgKnmIOiVCkKllO3yG0xIVIyn8LNrMOVtUFzCCBaIwggSKoAMCAQIC BxekJKEJSDMwDQYJKoZIhvcNAQELBQAwWjELMAkGA1UEBhMCREUxEzARBgNVBAoTCkRGTi1WZXJl aW4xEDAOBgNVBAsTB0RGTi1QS0kxJDAiBgNVBAMTG0RGTi1WZXJlaW4gUENBIEdsb2JhbCAtIEcw MTAeFw0xNDA1MjcxNDU0MDlaFw0xOTA3MDkyMzU5MDBaMIHGMQswCQYDVQQGEwJERTEcMBoGA1UE CBMTTm9yZHJoZWluLVdlc3RmYWxlbjERMA8GA1UEBxMITXVlbnN0ZXIxIDAeBgNVBAoTF0ZhY2ho b2Noc2NodWxlIE11ZW5zdGVyMSMwIQYDVQQLExpEYXRlbnZlcmFyYmVpdHVuZ3N6ZW50cmFsZTEd MBsGA1UEAxMURkggTXVlbnN0ZXIgQ0EgLSBHMDExIDAeBgkqhkiG9w0BCQEWEWNhQGZoLW11ZW5z dGVyLmRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuHlsrvBs7CL9IqMH9r//QU9E pghTV/3skHuQZ3DpNY+lyJWOW5zbtUubgXt7lYHpIE4d4CclTZWqCHwoAI6gqzSSGjUKuX6/0ui/ LhXmlDvCBfwuER+T+3/R59hlLnhI5iYYPQiNywQIa3wJhBLTZrlXw8nDdjI54MAzcVDUX7l21sbo ZIA6idM7SXmshxoRQ6xsfPHskrceNMcvtHNDhVnVscwRUJQUR55fs0X7Y93PasugWPv3xmgNr1da Cq94eV+nslNU/GJaT9TQ3uG8pagLXl9NbDNkHIrvFAD5zXO0m/d00I4QhUVQyEtwnTegDqcM+WFh JXensgnZhWe6bwIDAQABo4IB/jCCAfowEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMC AQYwEQYDVR0gBAowCDAGBgRVHSAAMB0GA1UdDgQWBBQK81u85DGA1jVCiabTw8833tHf1zAfBgNV HSMEGDAWgBRJt8bP6D0ff+pEexMp9/EKcD7eZDAcBgNVHREEFTATgRFjYUBmaC1tdWVuc3Rlci5k ZTCBiAYDVR0fBIGAMH4wPaA7oDmGN2h0dHA6Ly9jZHAxLnBjYS5kZm4uZGUvZ2xvYmFsLXJvb3Qt Y2EvcHViL2NybC9jYWNybC5jcmwwPaA7oDmGN2h0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZ2xvYmFs LXJvb3QtY2EvcHViL2NybC9jYWNybC5jcmwwgdcGCCsGAQUFBwEBBIHKMIHHMDMGCCsGAQUFBzAB hidodHRwOi8vb2NzcC5wY2EuZGZuLmRlL09DU1AtU2VydmVyL09DU1AwRwYIKwYBBQUHMAKGO2h0 dHA6Ly9jZHAxLnBjYS5kZm4uZGUvZ2xvYmFsLXJvb3QtY2EvcHViL2NhY2VydC9jYWNlcnQuY3J0 MEcGCCsGAQUFBzAChjtodHRwOi8vY2RwMi5wY2EuZGZuLmRlL2dsb2JhbC1yb290LWNhL3B1Yi9j YWNlcnQvY2FjZXJ0LmNydDANBgkqhkiG9w0BAQsFAAOCAQEA3kcDNdZKb7kSD7s1ly2qa/2QbQe+ ld3LhZeOcfysdLtN8oweBmgT3MYoZ+D9c+SoUWJAwTKPB15DoGy+fWhelXTpQrqxIGb4ISr1JCjg slnmMUva0xjwZGxojZ9gE1bi18xfKw3+dMpwCLt6LbLTjr/tyH6otacwr2tZzuuJIUAORnefwTcr vmB21n/BEQH/ZXruWu8lSO3L9YAmQB6ViaZFCpn2sMmOLACdoWxmUQb3QAjsa327jHUjsz53k9q5 Zrx/g+zOg5s1Wmy2JOlLQMUIZXXf0/6rB5Fr2llx7dBG/Uk7NhZdNy7OzNzci0C4Wnkd8rDVEWHG hH2gfpcTfjCCBg0wggT1oAMCAQICBxuZiHQ3saMwDQYJKoZIhvcNAQELBQAwgcYxCzAJBgNVBAYT AkRFMRwwGgYDVQQIExNOb3JkcmhlaW4tV2VzdGZhbGVuMREwDwYDVQQHEwhNdWVuc3RlcjEgMB4G A1UEChMXRmFjaGhvY2hzY2h1bGUgTXVlbnN0ZXIxIzAhBgNVBAsTGkRhdGVudmVyYXJiZWl0dW5n c3plbnRyYWxlMR0wGwYDVQQDExRGSCBNdWVuc3RlciBDQSAtIEcwMTEgMB4GCSqGSIb3DQEJARYR Y2FAZmgtbXVlbnN0ZXIuZGUwHhcNMTYwNzA0MDcwNjEzWhcNMTkwNzA0MDcwNjEzWjB8MQswCQYD VQQGEwJERTEgMB4GA1UECgwXRmFjaGhvY2hzY2h1bGUgTXVlbnN0ZXIxMjAwBgNVBAsMKUZhY2hi ZXJlaWNoIEVsZWt0cm90ZWNobmlrIHVuZCBJbmZvcm1hdGlrMRcwFQYDVQQDDA5NaWNoYWVsIFR1 ZXhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyaGlBt2ZtuF8QP8zYNrGxXC+es PMajIPl+hu1LGHnN2BJ3J5ZMN44BOZw3n6LO1FaAgO8D4xU4/AELecX6VxJZ2zOOSD8uTYO4OnUu 24hkjFUQAj13tT644AKUQMMBpgj7wC52V5Jij+mZX/t1S38/WFiCGnirt4xTNi5OmN4K+VNZfG4x 0msDqFjJX70rF1y09/Mylu1M/Y0tu/I9DqhwDQT4LBOvyyaAlhSJ8Jb8m8YTt5xlOzrXlBmj4pKs 74y7C2IKRw4tFozGX1cf1LVEs2eBCb5iUwXrlcMipwm62sJ38GD00EOlRNTpAM5rDAcgWxMCffek bRv/01whtOkCAwEAAaOCAkcwggJDMEAGA1UdIAQ5MDcwEQYPKwYBBAGBrSGCLAEBBAMFMBEGDysG AQQBga0hgiwCAQQDATAPBg0rBgEEAYGtIYIsAQEEMAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgXg MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAdBgNVHQ4EFgQU0B2vaoSoEmYAggD04WZF 2hGif3UwHwYDVR0jBBgwFoAUCvNbvOQxgNY1Qomm08PPN97R39cwIAYDVR0RBBkwF4EVdHVleGVu QGZoLW11ZW5zdGVyLmRlMIGIBgNVHR8EgYAwfjA9oDugOYY3aHR0cDovL2NkcDEucGNhLmRmbi5k ZS9maC1tdWVuc3Rlci1jYS9wdWIvY3JsL2NhY3JsLmNybDA9oDugOYY3aHR0cDovL2NkcDIucGNh LmRmbi5kZS9maC1tdWVuc3Rlci1jYS9wdWIvY3JsL2NhY3JsLmNybDCB1wYIKwYBBQUHAQEEgcow gccwMwYIKwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2ZXIvT0NTUDBH BggrBgEFBQcwAoY7aHR0cDovL2NkcDEucGNhLmRmbi5kZS9maC1tdWVuc3Rlci1jYS9wdWIvY2Fj ZXJ0L2NhY2VydC5jcnQwRwYIKwYBBQUHMAKGO2h0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZmgtbXVl bnN0ZXItY2EvcHViL2NhY2VydC9jYWNlcnQuY3J0MA0GCSqGSIb3DQEBCwUAA4IBAQBI9v+seJM6 AlSIrmmpopz6zh8QAsqGLJkkY2D0KYFucUY/xZaJTtZxvmWddbKk2903Qhg+vZKOf87PHhip7/4t FSwhxYNSS36WsRJTeUa0f3KkSa28yrIRfWlJATgxfL5X/QQnopjCt34n4221kcsR7LHxBAn37ow+ /2L7WjWDDuOkaM9/ZSCtrN+yFRat1eUVs1Hk7sKT/bfJTsYqzovXitjmCP3YdB40dkuQ6/ZzEdXT bpa4c45RcRnPqKXnxknK0UfRHNHqk15W7dUPVMzSGFUvjhmWPP2wW6a8F1U5sEqfHcoBFC5CGjGy 7Gk2luk3obi/KLrDyZC+dkjhDYEpMYIEOTCCBDUCAQEwgdIwgcYxCzAJBgNVBAYTAkRFMRwwGgYD VQQIExNOb3JkcmhlaW4tV2VzdGZhbGVuMREwDwYDVQQHEwhNdWVuc3RlcjEgMB4GA1UEChMXRmFj aGhvY2hzY2h1bGUgTXVlbnN0ZXIxIzAhBgNVBAsTGkRhdGVudmVyYXJiZWl0dW5nc3plbnRyYWxl MR0wGwYDVQQDExRGSCBNdWVuc3RlciBDQSAtIEcwMTEgMB4GCSqGSIb3DQEJARYRY2FAZmgtbXVl bnN0ZXIuZGUCBxuZiHQ3saMwDQYJYIZIAWUDBAIBBQCgggI3MBgGCSqGSIb3DQEJAzELBgkqhkiG 9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE5MDUyMDA3NTUxNlowLwYJKoZIhvcNAQkEMSIEIF7zjkdq 2EXSwQY9vKT1/9r05gpNUMb0DMPAORVTWVWuMIHjBgkrBgEEAYI3EAQxgdUwgdIwgcYxCzAJBgNV BAYTAkRFMRwwGgYDVQQIExNOb3JkcmhlaW4tV2VzdGZhbGVuMREwDwYDVQQHEwhNdWVuc3RlcjEg MB4GA1UEChMXRmFjaGhvY2hzY2h1bGUgTXVlbnN0ZXIxIzAhBgNVBAsTGkRhdGVudmVyYXJiZWl0 dW5nc3plbnRyYWxlMR0wGwYDVQQDExRGSCBNdWVuc3RlciBDQSAtIEcwMTEgMB4GCSqGSIb3DQEJ ARYRY2FAZmgtbXVlbnN0ZXIuZGUCBxuZiHQ3saMwgeUGCyqGSIb3DQEJEAILMYHVoIHSMIHGMQsw CQYDVQQGEwJERTEcMBoGA1UECBMTTm9yZHJoZWluLVdlc3RmYWxlbjERMA8GA1UEBxMITXVlbnN0 ZXIxIDAeBgNVBAoTF0ZhY2hob2Noc2NodWxlIE11ZW5zdGVyMSMwIQYDVQQLExpEYXRlbnZlcmFy YmVpdHVuZ3N6ZW50cmFsZTEdMBsGA1UEAxMURkggTXVlbnN0ZXIgQ0EgLSBHMDExIDAeBgkqhkiG 9w0BCQEWEWNhQGZoLW11ZW5zdGVyLmRlAgcbmYh0N7GjMA0GCSqGSIb3DQEBAQUABIIBAD7XoNmY I1IhRR0MbJKUEysc5XSF74309nPcPEoe8ruzYy7dnO3mO0do9BR8hAJzdZ/cMypxvt8A9o6CsOWd ald/4mMREla5zbwVKVKGmCUVYe3Z8viRbMnYzRE7R9vWPjIVydQrCmSHqtzJXASGRWAd9KTDkM5a AD9sOf0Y7KXXLQPX5ruBiDIGRgpaT7KSRR48n4ubPx57FevOuO6DNF893k0E1V0wUZw2jNbXuQUN TbPbXiFWj7/cZvU9fo4b4PFM6+LW1cU5/Eig28T/Mn2dBoB7neP+Eo03tAwEae4smneYqI8mMAmb KzfPWmfZ/O+ccuOWGO4FS/t6JgHEu78AAAAAAAA= --Apple-Mail=_FB701B7B-6FE3-4718-A8B7-D128986CE440-- From owner-svn-src-all@freebsd.org Mon May 20 08:31:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF86B15A6099; Mon, 20 May 2019 08:31:02 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D6B26B387; Mon, 20 May 2019 08:31:02 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-it1-f195.google.com with SMTP id i63so21767897ita.3; Mon, 20 May 2019 01:31:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NKwbCtJ0CaA/2XXTuIweSGc5ULCtFAG12osamN7X7S4=; b=JPg1Pui0oib8xkvk8pESlSAFVY6W0JPe7CNMbVQT1ArLUsfK5b/4VZFoP0+GdaaRbO Pu7y9j3P1gMmOruhZ4g/MdfgAgXRAqSn0kFgiViWk7Cd1CYqULLRLWC53PZGGbt4hz/2 v70OVf0eThYej4Sjx1Q55HCCF51kpBRbYdNg39eipivSwJG+7h9VBG1wGZ+X7fDoBUo9 s2hFH8KYKFblq/y6NLo4sJ0HLroPD1dErI8qD4GFGc1EwTwp9Ovk0cX0uJtLcsEDbsVy Uk4oN+BJ5NqStGndu4ch7Aj5p2BePaDScV3RitepFiK/sguL6bfzUMiyniEPJu0aTZ4v 1rMA== X-Gm-Message-State: APjAAAUezxA38NlFk3YdM8FSW8egkeK+6hib/seNY0+gtFN9PsOfUxjl ZvxHa/xt4mN6x1lw8yCWFDJxo5JWKIeLx+g/EVpT5qMG X-Google-Smtp-Source: APXvYqz+EcwOGDa9zkB1HfeYWb8qRstbkAVrwRIXZKE7IvT7k0oaVCM2UZzWR9iUM4tZeMbX1PPLvPEVoZxmtY2g8Ng= X-Received: by 2002:a24:9987:: with SMTP id a129mr12716032ite.53.1558341055702; Mon, 20 May 2019 01:30:55 -0700 (PDT) MIME-Version: 1.0 References: <201905131748.x4DHmGaH020444@repo.freebsd.org> <20190519190511.6e8f436c@kalimero.tijl.coosemans.org> In-Reply-To: <20190519190511.6e8f436c@kalimero.tijl.coosemans.org> From: Dmitry Chagin Date: Mon, 20 May 2019 11:30:43 +0300 Message-ID: Subject: Re: svn commit: r347533 - in head/sys: compat/linux modules/linux_common To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: Dmitry Chagin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7D6B26B387 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 08:31:03 -0000 =D0=B2=D1=81, 19 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 20:05, T=C4=B3l Coo= semans : > On Mon, 13 May 2019 17:48:16 +0000 (UTC) Dmitry Chagin > wrote: > > Author: dchagin > > Date: Mon May 13 17:48:16 2019 > > New Revision: 347533 > > URL: https://svnweb.freebsd.org/changeset/base/347533 > > > > Log: > > Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions > > alter the userspace sockaddr to convert the format between linux and > BSD versions. > > That's the minimum 3 of copyin/copyout operations for one syscall. > > > > Also some syscall uses linux_sa_put() and linux_getsockaddr() when lo= ad > > sockaddr to userspace or from userspace accordingly. > > > > To avoid this chaos, especially converting sockaddr in the userspace, > > rewrite these 4 functions to convert sockaddr only in kernel and leav= e > > only 2 of this functions. > > > > Also in order to reduce duplication between MD parts of the > Linuxulator put > > struct sockaddr conversion functions that are MI out into linux_commo= n > module. > > > > PR: 232920 > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D20157 > > > > Modified: > > head/sys/compat/linux/linux.c > > head/sys/compat/linux/linux.h > > head/sys/compat/linux/linux_common.h > > head/sys/compat/linux/linux_socket.c > > head/sys/compat/linux/linux_socket.h > > head/sys/modules/linux_common/Makefile > > > > Modified: head/sys/compat/linux/linux_socket.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/compat/linux/linux_socket.c Mon May 13 16:38:48 2019 > (r347532) > > +++ head/sys/compat/linux/linux_socket.c Mon May 13 17:48:16 2019 > (r347533) > > @@ -1282,6 +1110,8 @@ linux_recvmsg_common(struct thread *td, l_int s, > struc > > struct mbuf *control =3D NULL; > > struct mbuf **controlp; > > struct timeval *ftmvl; > > + struct l_sockaddr *lsa; > > + struct sockaddr *sa; > > l_timeval ltmvl; > > caddr_t outbuf; > > void *data; > > @@ -1305,36 +1135,34 @@ linux_recvmsg_common(struct thread *td, l_int s= , > struc > > return (error); > > > > if (msg->msg_name) { > > - error =3D linux_to_bsd_sockaddr((struct sockaddr > *)msg->msg_name, > > - msg->msg_namelen); > > - if (error !=3D 0) > > - goto bad; > > + sa =3D malloc(msg->msg_namelen, M_SONAME, M_WAITOK); > > + msg->msg_name =3D sa; > > } > > > > uiov =3D msg->msg_iov; > > msg->msg_iov =3D iov; > > controlp =3D (msg->msg_control !=3D NULL) ? &control : NULL; > > - error =3D kern_recvit(td, s, msg, UIO_USERSPACE, controlp); > > + error =3D kern_recvit(td, s, msg, UIO_SYSSPACE, controlp); > > msg->msg_iov =3D uiov; > > if (error !=3D 0) > > goto bad; > > > > - error =3D bsd_to_linux_msghdr(msg, &linux_msg); > > - if (error !=3D 0) > > - goto bad; > > - > > - if (linux_msg.msg_name) { > > - error =3D bsd_to_linux_sockaddr((struct sockaddr *) > > - PTRIN(linux_msg.msg_name)); > > + if (sa) { > > sa may be uninitialised here. > yes, I see. thank you. also sa leaks if kern_recvit() returns error. will fix From owner-svn-src-all@freebsd.org Mon May 20 08:53:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272AE15A6875; Mon, 20 May 2019 08:53:02 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3DAA6C284; Mon, 20 May 2019 08:53:01 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108161.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4K8j1SA005526; Mon, 20 May 2019 01:52:59 -0700 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2053.outbound.protection.outlook.com [104.47.36.53]) by mx0b-00273201.pphosted.com with ESMTP id 2skfq90nee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 20 May 2019 01:52:58 -0700 Received: from MN2PR05CA0035.namprd05.prod.outlook.com (2603:10b6:208:c0::48) by SN6PR05MB5807.namprd05.prod.outlook.com (2603:10b6:805:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.13; Mon, 20 May 2019 08:52:57 +0000 Received: from CO1NAM05FT030.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by MN2PR05CA0035.outlook.office365.com (2603:10b6:208:c0::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.8 via Frontend Transport; Mon, 20 May 2019 08:52:56 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.239.12) by CO1NAM05FT030.mail.protection.outlook.com (10.152.96.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.10 via Frontend Transport; Mon, 20 May 2019 08:52:56 +0000 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 20 May 2019 01:52:55 -0700 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 20 May 2019 01:52:55 -0700 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 20 May 2019 01:52:55 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.50.162]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id x4K8qtZ5026560; Mon, 20 May 2019 01:52:55 -0700 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id F41E21F7EA; Mon, 20 May 2019 01:52:54 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id F3A231F7E9; Mon, 20 May 2019 01:52:54 -0700 (PDT) To: CC: , , , Subject: Re: svn commit: r347980 - head/lib/libsecureboot/openpgp In-Reply-To: <201905200500.x4K506YI072317@gndrsh.dnsmgr.net> References: <201905200500.x4K506YI072317@gndrsh.dnsmgr.net> Comments: In-reply-to: "Rodney W. Grimes" message dated "Sun, 19 May 2019 22:00:06 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <37829.1558342374.1@kaos.jnpr.net> Date: Mon, 20 May 2019 01:52:54 -0700 Message-ID: <39068.1558342374@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(376002)(396003)(39860400002)(136003)(346002)(2980300002)(52314003)(199004)(189003)(486006)(8676002)(81156014)(53936002)(2351001)(23726003)(6916009)(6266002)(7126003)(126002)(97876018)(476003)(11346002)(97756001)(446003)(46406003)(54906003)(316002)(76176011)(90966002)(229853002)(76506005)(50226002)(8936002)(7696005)(68736007)(50466002)(81166006)(2906002)(47776003)(356004)(450100002)(4326008)(186003)(69596002)(478600001)(77096007)(16586007)(107886003)(5660300002)(6246003)(336012)(9686003)(26005)(14444005)(4744005)(305945005)(70206006)(70586007)(55016002)(86362001)(53416004)(117636001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR05MB5807; H:P-EXFEND-EQX-01.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a37d9916-30aa-40bc-ed16-08d6dd008d9f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4710095)(4711036)(2017052603328); SRVR:SN6PR05MB5807; X-MS-TrafficTypeDiagnostic: SN6PR05MB5807: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 004395A01C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: TyY5xQGPYneA5xK6BMaDh0dlEoAKoUMBvs9W0i8y8My0CNexNBXXunm8gkBzMh8meQ6PDzh3wzWfsK7Mug5zZOK5q/a4a20TS83b3xKWIMI4e24cRsAzZNuHKF/8KGDZx/AGCQPyR56C5Ms7F/WWIAl21pgHcDnl0HUJUJ9inr0D3FyKtP2pTy7eL9vNqJ6B+kIzTQf/wcCNVZMo4db7cbu1RRfVVeoYe53cZZa8xAlJsanvxR7iFGMRrcQ94BctSrpGIEVuksCLTl2fC0sidUlloeVOq8fThGvMtenjd3JrRMP8oJl2zDq8P8Sp4jwPS4JlZ5I8IxdcTEu7gLB5SdGoc+JO0cnWUYxFWuWXb6Kg8P0rVcqGCY6Q3ldDztYO8qNSS30ENGzLKSJb3y1qI7RPLjX8uERqnXdThzF5/4c= X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2019 08:52:56.3579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a37d9916-30aa-40bc-ed16-08d6dd008d9f X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB5807 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-20_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=443 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905200064 X-Rspamd-Queue-Id: A3DAA6C284 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 08:53:02 -0000 Rodney W. Grimes wrote: > > Log: > > load_key_buf do not free data from dearmor > > > > The data returned by dearmor is referenced by the key > > leave it alone! > > > > Reviewed by: stevek > > MFC after: 2 days > > This is an exception below the standard minimal limit during > a code freeze, is there some reason for it? The next build > should not be started before 3 days. Sorry,should I wait until after freeze? This is all optional stuff anyway, so no great harm either way. From owner-svn-src-all@freebsd.org Mon May 20 05:28:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9739A15A2460 for ; Mon, 20 May 2019 05:28:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31AC88CC72 for ; Mon, 20 May 2019 05:28:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x833.google.com with SMTP id l3so4122835qtj.5 for ; Sun, 19 May 2019 22:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LmVi7xbGpzpQ3mXFaAmOj1aRTtqzhNPnAL808nADH5c=; b=qkRBVFiM3HcmQYDpuvUL+lITMQqeVpSPhVIHyYGgErH1Pf+NVdYnr9unhScEhvU4ew E0SvQrJorz1/Ip97FeaXkyac0jjeJJRI77B79UstWYqnThUDfFhcJdnQH1ky6zRhgt5R hReaglhOP1qA/ZOtJco0jHd9JntkavrVgyXgMqwjZZohAPFr8bR3sirD0K0kjrpEIIm3 KcdsdKNvvGp1trrWHVk4UgWDquAbLP1Eox3FEIN734d79nfP0Rlxjli3N7C9lG7kX/CA PED6OahKJjy6RFv+Vf3u4ADqGVx/R8WSLlzdFPzdW6vg8yvadM0vw6Oi2ZhShBfahzuW IYSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LmVi7xbGpzpQ3mXFaAmOj1aRTtqzhNPnAL808nADH5c=; b=fameC95JXzh25QY6dYY9pNVC7hi8KfMEEhuvAqJWar4Ar7nCXqTdrvicsz7/yYZrRp bKcrncjhvmDYIVesJ3Q7CQFR0ragksOynVO8qeHcH7qQs0+reic0os/acHwxG1pijXSw GTCwEUfauuXlUxGR5XjZsOuyRyjwbG4IbZiXhYynDFw/HRHIBfXwGlse5HZ683WY+TN1 DW+EIfMoiqYzdoStE+Kd+tYMwsgCo1Mb1qupvf2Vg4j1qboigndfTmAgvxpY60/B7BRg +aj1iXa99dNHsCwRT45rbSwgeKj8ZdjMEg+O/XVPmUfEhNJAF/X5kOhKE3qBIvQds96j TExA== X-Gm-Message-State: APjAAAUpW7EaxHZmaK1xouPDWFepzelGgdAkgcMGyh9u9QhYF9786EH2 rBDslmhLK8ZA62RVBVU7DpJ1KV56kI1D4xR5Y7KRfQ== X-Google-Smtp-Source: APXvYqyyDC3NdDjlGdBY/GRe6CocJp6Xrl5m/rE/GtNIWsLTI6mBFjOQ4BvezgwXoKsze+k5ffpO3jZaBPWyn77O6D0= X-Received: by 2002:a0c:9562:: with SMTP id m31mr41174613qvm.27.1558330084528; Sun, 19 May 2019 22:28:04 -0700 (PDT) MIME-Version: 1.0 References: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> In-Reply-To: <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> From: Warner Losh Date: Sun, 19 May 2019 23:27:53 -0600 Message-ID: Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib To: Yoshihiro Ota Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Benedict Reuschling , src-committers , svn-src-stable@freebsd.org, svn-src-all , svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov X-Rspamd-Queue-Id: 31AC88CC72 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-Mailman-Approved-At: Mon, 20 May 2019 10:28:30 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 05:28:05 -0000 On Sun, May 19, 2019 at 9:56 AM Yoshihiro Ota wrote: > I wonder if we can use a tool to confirm coding style like > clang-format or something else. > I don't know... it might be hard to do that inside a man page... Warner From owner-svn-src-all@freebsd.org Mon May 20 10:21:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70C4615A8865; Mon, 20 May 2019 10:21:13 +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 53E6D6EF0B; Mon, 20 May 2019 10:21:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7FAF93DBD1E; Mon, 20 May 2019 20:20:51 +1000 (AEST) Date: Mon, 20 May 2019 20:20:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Yoshihiro Ota , "Rodney W. Grimes" , "Rodney W. Grimes" , Benedict Reuschling , src-committers , svn-src-stable@freebsd.org, svn-src-all , svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib In-Reply-To: Message-ID: <20190520201507.R1014@besplex.bde.org> References: <201905181306.x4ID6piX064982@gndrsh.dnsmgr.net> <20190519115456.40571481c85c9f178657d6b9@j.email.ne.jp> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=sgSoKbxsTZY4yqxDgxsA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 53E6D6EF0B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.42 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-6.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; RCPT_COUNT_SEVEN(0.00)[11]; IP_SCORE(-2.76)[ip: (-7.74), ipnet: 211.28.0.0/14(-3.36), asn: 4804(-2.68), country: AU(-0.02)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-Mailman-Approved-At: Mon, 20 May 2019 10:28:46 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 10:21:13 -0000 On Sun, 19 May 2019, Warner Losh wrote: > On Sun, May 19, 2019 at 9:56 AM Yoshihiro Ota wrote: > >> I wonder if we can use a tool to confirm coding style like >> clang-format or something else. > > I don't know... it might be hard to do that inside a man page... Examples in man pages need special treatment since man adds a 5 column left margin and then must mangle tabs to preserve 8-column indentation. The examples must at least be formatted for width 74 instead of 79, but 74 is better anyway. I had some success turning SYNOPSIS sections into C code for checking that the headers are complete and the documented prototypes agree with the headers. Large examples would probably have to be extracted manually since they are less structured than SYNOPSIS sections. Bruce From owner-svn-src-all@freebsd.org Mon May 20 11:05:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77B3F15A9AB5; Mon, 20 May 2019 11:05:20 +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 A483D70802; Mon, 20 May 2019 11:05:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id DA301D407; Mon, 20 May 2019 21:05:07 +1000 (AEST) Date: Mon, 20 May 2019 21:05:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... In-Reply-To: <201905200038.x4K0cNoZ019920@repo.freebsd.org> Message-ID: <20190520202101.L1014@besplex.bde.org> References: <201905200038.x4K0cNoZ019920@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=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=ZYnaWQUgFQgQsxDDCCAA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: A483D70802 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 11:05:20 -0000 On Mon, 20 May 2019, Conrad Meyer wrote: > Log: > Extract eventfilter declarations to sys/_eventfilter.h sys/_eventhandler.h has 2 identical 72-line copies of the correct version. The second copy of the reinclusion guard works as a guard against the doubling too. > > This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" > in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header > pollution substantially. > > EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c > files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). Thanks, but this gives even more pollution. Almost everything includes sys/proc.h, so its already large pollution affects almost everything. The previous pollution in it didn't include sys/eventhandler.h, except possibly via a nested include. > Modified: head/sys/amd64/vmm/io/iommu.c > ============================================================================== > --- head/sys/amd64/vmm/io/iommu.c Sun May 19 23:56:04 2019 (r347983) > +++ head/sys/amd64/vmm/io/iommu.c Mon May 20 00:38:23 2019 (r347984) > @@ -32,10 +32,10 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include > -#include Error. sys/systm.h must be included after sys/param.h, since it contains macros like KASSERT() which may be used in inline functions in any kernel header except sys/param.h and possibly sys/types.h. > Modified: head/sys/arm/allwinner/a10/a10_intc.c > ============================================================================== > --- head/sys/arm/allwinner/a10/a10_intc.c Sun May 19 23:56:04 2019 (r347983) > +++ head/sys/arm/allwinner/a10/a10_intc.c Mon May 20 00:38:23 2019 (r347984) > @@ -30,11 +30,12 @@ __FBSDID("$FreeBSD$"); > > #include "opt_platform.h" > > -#include > +#include Including sys/types.h and not including sys/param.h was another error. sys/param.h supplies lots of standard pollution that may be depended on by any other kernel header. It is impractical to even test if sys/types.h works with all combinations of ifdefs. > #include > #include > #include > #include > +#include > #include > #include > #include sys/param.h is now included twice. It is another header that must be included in non-alphabetical order. The second include may have compensated for not including it first. > > Modified: head/sys/arm/allwinner/a10_dmac.c > ============================================================================== > --- head/sys/arm/allwinner/a10_dmac.c Sun May 19 23:56:04 2019 (r347983) > +++ head/sys/arm/allwinner/a10_dmac.c Mon May 20 00:38:23 2019 (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > > #include > > Modified: head/sys/arm/allwinner/a31_dmac.c > ============================================================================== > --- head/sys/arm/allwinner/a31_dmac.c Sun May 19 23:56:04 2019 (r347983) > +++ head/sys/arm/allwinner/a31_dmac.c Mon May 20 00:38:23 2019 (r347984) > @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > > #include I gave up trying to fix missing includes of sys/mutex.h and its prerequisite sys/lock.h 15+ years ago before disk code added lots more of them. sys/buf.h was polluted by adding an include of sys/mutex.h, and most disk drivers dependended on that. The only other includes of sys/mutex.h in a header were in sys/eventhandler.h and sys/vnode.h, and the latter was fixed in my version. This pollution has spread to sys/buf_ring.h, sys/fail.h, sys/jail.h, sys/mman.h, sys/msgbuf.h, sys/rmlock.h, sys/timeet.h and sys/tty.h. The smaller headers here are trivial to fix, and even sys/vnode.h wasn't hard to fix 15 years ago before the pollution spread. sys/mman.h seems to have only 1 mutex declaration, of a struct mtx, so using the correct header sys/_mutex.h works. Only inlines using mutexes cause pollution that is hard to avoid. sys/vnode.h still has only 1 inline function. Bruce From owner-svn-src-all@freebsd.org Mon May 20 12:32:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C58715AC346; Mon, 20 May 2019 12:32:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C355373C9D; Mon, 20 May 2019 12:32:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 671D51E439; Mon, 20 May 2019 12:32:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KCW5i7094610; Mon, 20 May 2019 12:32:05 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KCW1kA094589; Mon, 20 May 2019 12:32:01 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201905201232.x4KCW1kA094589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 20 May 2019 12:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347989 - in vendor/libarchive/dist: . build/ci build/ci/cirrus_ci contrib cpio/test libarchive libarchive/test tar tar/test test_utils X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: . build/ci build/ci/cirrus_ci contrib cpio/test libarchive libarchive/test tar tar/test test_utils X-SVN-Commit-Revision: 347989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C355373C9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 12:32:06 -0000 Author: mm Date: Mon May 20 12:32:00 2019 New Revision: 347989 URL: https://svnweb.freebsd.org/changeset/base/347989 Log: Update vendor/libarchive/dist to git b5818e39e128eca4951e2ab10467d4d850a2ba57 Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes NOTE: a version bump of libarchive will happen in the following days Added: vendor/libarchive/dist/build/ci/cirrus_ci/ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.cygwin vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29 vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29.distcheck vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.mingw vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.msvc vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.windows vendor/libarchive/dist/build/ci/cirrus_ci/ci.cmd (contents, props changed) vendor/libarchive/dist/build/ci/cirrus_ci/ci.sh (contents, props changed) vendor/libarchive/dist/contrib/archivetest.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_misc.3 (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_mtree_noprint.mtree.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_fileattr.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_hardlink.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_leftshift1.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_leftshift2.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_owner.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_symlink.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_raw.data.gz.uu vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_with_gnulabel.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu vendor/libarchive/dist/tar/test/test_option_exclude_vcs.c (contents, props changed) Deleted: vendor/libarchive/dist/.travis.yml vendor/libarchive/dist/build/ci/cirrus_ci.sh Modified: vendor/libarchive/dist/.cirrus.yml vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/build/ci/build.sh vendor/libarchive/dist/build/ci/travis_ci.sh vendor/libarchive/dist/cpio/test/test_basic.c vendor/libarchive/dist/cpio/test/test_format_newc.c vendor/libarchive/dist/cpio/test/test_gcpio_compat.c vendor/libarchive/dist/cpio/test/test_option_L_upper.c vendor/libarchive/dist/cpio/test/test_option_a.c vendor/libarchive/dist/cpio/test/test_option_c.c vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_private.h vendor/libarchive/dist/libarchive/archive_hmac.c vendor/libarchive/dist/libarchive/archive_match.c vendor/libarchive/dist/libarchive/archive_platform.h vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_private.h vendor/libarchive/dist/libarchive/archive_read_set_format.c vendor/libarchive/dist/libarchive/archive_read_support_filter_gzip.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/archive_read_support_format_raw.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_util.c vendor/libarchive/dist/libarchive/archive_windows.h vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_entry.c vendor/libarchive/dist/libarchive/test/test_fuzz.c vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_read_extract.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c vendor/libarchive/dist/libarchive/test/test_read_format_rar.c vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c vendor/libarchive/dist/libarchive/test/test_read_format_rar5_win32.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_raw.c vendor/libarchive/dist/libarchive/test/test_read_format_zip.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/libarchive/test/test_write_disk_symlink.c vendor/libarchive/dist/tar/bsdtar.1 vendor/libarchive/dist/tar/bsdtar.c vendor/libarchive/dist/tar/bsdtar.h vendor/libarchive/dist/tar/cmdline.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/test_basic.c vendor/libarchive/dist/tar/test/test_copy.c vendor/libarchive/dist/tar/test/test_option_C_mtree.c vendor/libarchive/dist/tar/test/test_option_H_upper.c vendor/libarchive/dist/tar/test/test_option_L_upper.c vendor/libarchive/dist/tar/test/test_option_U_upper.c vendor/libarchive/dist/tar/test/test_option_n.c vendor/libarchive/dist/tar/test/test_option_s.c vendor/libarchive/dist/tar/test/test_strip_components.c vendor/libarchive/dist/tar/test/test_symlink_dir.c vendor/libarchive/dist/test_utils/test_common.h vendor/libarchive/dist/test_utils/test_main.c Modified: vendor/libarchive/dist/.cirrus.yml ============================================================================== --- vendor/libarchive/dist/.cirrus.yml Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/.cirrus.yml Mon May 20 12:32:00 2019 (r347989) @@ -2,25 +2,130 @@ env: CIRRUS_CLONE_DEPTH: 1 ARCH: amd64 -task: +FreeBSD_task: matrix: - container: - image: fedora:29 + env: + BS: autotools + env: + BS: cmake + matrix: freebsd_instance: image: freebsd-12-0-release-amd64 freebsd_instance: image: freebsd-11-2-release-amd64 + prepare_script: + - ./build/ci/cirrus_ci/ci.sh prepare + configure_script: + - ./build/ci/build.sh -a autogen + - ./build/ci/build.sh -a configure + build_script: + - ./build/ci/build.sh -a build + test_script: + - ./build/ci/build.sh -a test + - ./build/ci/cirrus_ci/ci.sh test + install_script: + - ./build/ci/build.sh -a install + +MacOS_task: + matrix: + env: + BS: autotools + env: + BS: cmake + matrix: osx_instance: - image: mojave-xcode-10.1 + image: mojave-xcode-10.2 osx_instance: image: high-sierra-xcode-10.0 + prepare_script: + - ./build/ci/cirrus_ci/ci.sh prepare + configure_script: + - ./build/ci/build.sh -a autogen + - ./build/ci/build.sh -a configure + build_script: + - ./build/ci/build.sh -a build + test_script: + - ./build/ci/build.sh -a test + - ./build/ci/cirrus_ci/ci.sh test + install_script: + - ./build/ci/build.sh -a install + +Fedora_29_task: + container: + dockerfile: build/ci/cirrus_ci/Dockerfile.fc29 matrix: env: BS: autotools env: BS: cmake + configure_script: + - ./build/ci/build.sh -a autogen + - ./build/ci/build.sh -a configure + build_script: + - ./build/ci/build.sh -a build + test_script: + - ./build/ci/build.sh -a test install_script: - - ./build/ci/cirrus_ci.sh install - script: - - ./build/ci/build.sh - - ./build/ci/cirrus_ci.sh test + - ./build/ci/build.sh -a install + +Fedora_29_distcheck_task: + container: + dockerfile: build/ci/cirrus_ci/Dockerfile.fc29.distcheck + env: + BS: autotools + configure_script: + - ./build/ci/build.sh -a autogen + - ./build/ci/build.sh -a configure + distcheck_script: + - ./build/ci/build.sh -a distcheck + +Windows_MSVC_task: + windows_container: + dockerfile: build/ci/cirrus_ci/Dockerfile.msvc + os_version: 2019 + env: + BE: msvc + configure_script: + - build\ci\cirrus_ci\ci.cmd configure + build_script: + - build\ci\cirrus_ci\ci.cmd build + test_script: + - build\ci\cirrus_ci\ci.cmd test + instal_script: + - build\ci\cirrus_ci\ci.cmd install + +Windows_MinGW_task: + windows_container: + image: cirrusci/windowsservercore:2019 + os_version: 2019 + env: + BE: mingw-gcc + prepare_script: + - build\ci\cirrus_ci\ci.cmd prepare + deplibs_script: + - build\ci\cirrus_ci\ci.cmd deplibs + configure_script: + - build\ci\cirrus_ci\ci.cmd configure + build_script: + - build\ci\cirrus_ci\ci.cmd build + test_script: + - build\ci\cirrus_ci\ci.cmd test + install_script: + - build\ci\cirrus_ci\ci.cmd install + +Windows_Cygwin_task: + windows_container: + image: cirrusci/windowsservercore:2019 + os_version: 2019 + env: + BE: cygwin-gcc + prepare_script: + - build\ci\cirrus_ci\ci.cmd prepare + configure_script: + - build\ci\cirrus_ci\ci.cmd configure + build_script: + - build\ci\cirrus_ci\ci.cmd build + test_script: + - build\ci\cirrus_ci\ci.cmd test + install_script: + - build\ci\cirrus_ci\ci.cmd install Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/CMakeLists.txt Mon May 20 12:32:00 2019 (r347989) @@ -481,6 +481,7 @@ ENDIF() IF(LIBLZMA_FOUND) SET(HAVE_LIBLZMA 1) SET(HAVE_LZMA_H 1) + CMAKE_PUSH_CHECK_STATE() SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) @@ -494,6 +495,7 @@ IF(LIBLZMA_FOUND) IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) ADD_DEFINITIONS(-DLZMA_API_STATIC) ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + CMAKE_POP_CHECK_STATE() ELSE(LIBLZMA_FOUND) # LZMA not found and will not be used. ENDIF(LIBLZMA_FOUND) @@ -549,9 +551,11 @@ IF(LIBB2_FOUND) SET(HAVE_BLAKE2_H 1) SET(ARCHIVE_BLAKE2 FALSE) LIST(APPEND ADDITIONAL_LIBS ${LIBB2_LIBRARY}) + CMAKE_PUSH_CHECK_STATE() SET(CMAKE_REQUIRED_LIBRARIES ${LIBB2_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${LIBB2_INCLUDE_DIR}) CHECK_FUNCTION_EXISTS(blake2sp_init HAVE_LIBB2) + CMAKE_POP_CHECK_STATE() ELSE(LIBB2_FOUND) SET(ARCHIVE_BLAKE2 TRUE) ENDIF(LIBB2_FOUND) @@ -606,17 +610,18 @@ IF(ZSTD_FOUND) SET(HAVE_ZSTD_H 1) INCLUDE_DIRECTORIES(${ZSTD_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${ZSTD_LIBRARY}) + CMAKE_PUSH_CHECK_STATE() SET(CMAKE_REQUIRED_LIBRARIES ${ZSTD_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${ZSTD_INCLUDE_DIR}) CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_LIBZSTD) # # TODO: test for static library. # + CMAKE_POP_CHECK_STATE() ENDIF(ZSTD_FOUND) MARK_AS_ADVANCED(CLEAR ZSTD_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR ZSTD_LIBRARY) -set(CMAKE_REQUIRED_LIBRARIES) # # Check headers Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/Makefile.am Mon May 20 12:32:00 2019 (r347989) @@ -288,6 +288,7 @@ libarchive_man_MANS= \ libarchive/archive_entry.3 \ libarchive/archive_entry_acl.3 \ libarchive/archive_entry_linkify.3 \ + libarchive/archive_entry_misc.3 \ libarchive/archive_entry_paths.3 \ libarchive/archive_entry_perms.3 \ libarchive/archive_entry_stat.3 \ @@ -501,6 +502,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_tar_concatenated.c \ libarchive/test/test_read_format_tar_empty_pax.c \ libarchive/test/test_read_format_tar_empty_filename.c \ + libarchive/test/test_read_format_tar_empty_with_gnulabel.c \ libarchive/test/test_read_format_tar_filename.c \ libarchive/test/test_read_format_tbz.c \ libarchive/test/test_read_format_tgz.c \ @@ -511,10 +513,12 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_warc.c \ libarchive/test/test_read_format_xar.c \ libarchive/test/test_read_format_zip.c \ + libarchive/test/test_read_format_zip_7075_utf8_paths.c \ libarchive/test/test_read_format_zip_comment_stored.c \ libarchive/test/test_read_format_zip_encryption_data.c \ libarchive/test/test_read_format_zip_encryption_partially.c \ libarchive/test/test_read_format_zip_encryption_header.c \ + libarchive/test/test_read_format_zip_extra_padding.c \ libarchive/test/test_read_format_zip_filename.c \ libarchive/test/test_read_format_zip_high_compression.c \ libarchive/test/test_read_format_zip_jar.c \ @@ -721,6 +725,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_filter_lzop.tar.lzo.uu \ libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \ libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \ + libarchive/test/test_read_format_mtree_noprint.mtree.uu \ libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \ libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \ libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \ @@ -820,15 +825,51 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu \ libarchive/test/test_read_format_rar_noeof.rar.uu \ libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \ + libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu \ libarchive/test/test_read_format_rar_sfx.exe.uu \ libarchive/test/test_read_format_rar_subblock.rar.uu \ libarchive/test/test_read_format_rar_unicode.rar.uu \ libarchive/test/test_read_format_rar_windows.rar.uu \ + libarchive/test/test_read_format_rar5_arm.rar.uu \ + libarchive/test/test_read_format_rar5_blake2.rar.uu \ + libarchive/test/test_read_format_rar5_compressed.rar.uu \ + libarchive/test/test_read_format_rar5_distance_overflow.rar.uu \ + libarchive/test/test_read_format_rar5_extra_field_version.rar.uu \ + libarchive/test/test_read_format_rar5_fileattr.rar.uu \ + libarchive/test/test_read_format_rar5_hardlink.rar.uu \ + libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu \ + libarchive/test/test_read_format_rar5_leftshift1.rar.uu \ + libarchive/test/test_read_format_rar5_leftshift2.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu \ + libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu \ + libarchive/test/test_read_format_rar5_multiple_files.rar.uu \ + libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu \ + libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu \ + libarchive/test/test_read_format_rar5_owner.rar.uu \ + libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu \ + libarchive/test/test_read_format_rar5_solid.rar.uu \ + libarchive/test/test_read_format_rar5_stored.rar.uu \ + libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu \ + libarchive/test/test_read_format_rar5_symlink.rar.uu \ + libarchive/test/test_read_format_rar5_truncated_huff.rar.uu \ + libarchive/test/test_read_format_rar5_win32.rar.uu \ libarchive/test/test_read_format_raw.bufr.uu \ + libarchive/test/test_read_format_raw.data.gz.uu \ libarchive/test/test_read_format_raw.data.Z.uu \ libarchive/test/test_read_format_raw.data.uu \ libarchive/test/test_read_format_tar_concatenated.tar.uu \ libarchive/test/test_read_format_tar_empty_filename.tar.uu \ + libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu \ libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \ libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \ libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \ @@ -836,11 +877,16 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \ libarchive/test/test_read_format_warc.warc.uu \ libarchive/test/test_read_format_zip.zip.uu \ + libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu \ + libarchive/test/test_read_format_zip_bz2_hang.zip.uu \ + libarchive/test/test_read_format_zip_bzip2.zipx.uu \ + libarchive/test/test_read_format_zip_bzip2_multi.zipx.uu \ libarchive/test/test_read_format_zip_comment_stored_1.zip.uu \ libarchive/test/test_read_format_zip_comment_stored_2.zip.uu \ libarchive/test/test_read_format_zip_encryption_data.zip.uu \ libarchive/test/test_read_format_zip_encryption_header.zip.uu \ libarchive/test/test_read_format_zip_encryption_partially.zip.uu \ + libarchive/test/test_read_format_zip_extra_padding.zip.uu \ libarchive/test/test_read_format_zip_filename_cp866.zip.uu \ libarchive/test/test_read_format_zip_filename_cp932.zip.uu \ libarchive/test/test_read_format_zip_filename_koi8r.zip.uu \ @@ -849,6 +895,9 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \ libarchive/test/test_read_format_zip_high_compression.zip.uu \ libarchive/test/test_read_format_zip_length_at_end.zip.uu \ + libarchive/test/test_read_format_zip_lzma.zipx.uu \ + libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu \ + libarchive/test/test_read_format_zip_lzma_multi.zipx.uu \ libarchive/test/test_read_format_zip_jar.jar.uu \ libarchive/test/test_read_format_zip_mac_metadata.zip.uu \ libarchive/test/test_read_format_zip_malformed1.zip.uu \ @@ -858,6 +907,10 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_padded1.zip.uu \ libarchive/test/test_read_format_zip_padded2.zip.uu \ libarchive/test/test_read_format_zip_padded3.zip.uu \ + libarchive/test/test_read_format_zip_ppmd8.zipx.uu \ + libarchive/test/test_read_format_zip_ppmd8_crash_1.zipx.uu \ + libarchive/test/test_read_format_zip_ppmd8_crash_2.zipx.uu \ + libarchive/test/test_read_format_zip_ppmd8_multi.zipx.uu \ libarchive/test/test_read_format_zip_sfx.uu \ libarchive/test/test_read_format_zip_symlink.zip.uu \ libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu \ @@ -867,6 +920,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu \ libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu \ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu \ + libarchive/test/test_read_format_zip_xz_multi.zipx.uu \ libarchive/test/test_read_format_zip_zip64a.zip.uu \ libarchive/test/test_read_format_zip_zip64b.zip.uu \ libarchive/test/test_read_large_splitted_rar_aa.uu \ @@ -995,6 +1049,7 @@ bsdtar_test_SOURCES= \ tar/test/test_option_b.c \ tar/test/test_option_b64encode.c \ tar/test/test_option_exclude.c \ + tar/test/test_option_exclude_vcs.c \ tar/test/test_option_fflags.c \ tar/test/test_option_gid_gname.c \ tar/test/test_option_grzip.c \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/NEWS Mon May 20 12:32:00 2019 (r347989) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: vendor/libarchive/dist/build/ci/build.sh ============================================================================== --- vendor/libarchive/dist/build/ci/build.sh Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/build/ci/build.sh Mon May 20 12:32:00 2019 (r347989) @@ -8,11 +8,13 @@ # SRCDIR= # source directory # CONFIGURE_ARGS= # configure arguments # MAKE_ARGS= # make arguments +# DEBUG= # set -g -fsanitize=address flags ACTIONS= if [ -n "${BUILD_SYSTEM}" ]; then BS="${BUILD_SYSTEM}" fi + BS="${BS:-autotools}" MAKE="${MAKE:-make}" CMAKE="${CMAKE:-cmake}" @@ -21,7 +23,7 @@ SRCDIR="${SRCDIR:-`pwd`}" RET=0 usage () { - echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test ] [ -a ... ] [ -d builddir ] [-s srcdir ]" + echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test|install|distcheck ] [ -a ... ] [ -d builddir ] [-s srcdir ]" } inputerror () { echo $1 @@ -36,6 +38,8 @@ while getopts a:b:d:s: opt; do configure) ;; build) ;; test) ;; + install) ;; + distcheck) ;; *) inputerror "Invalid action (-a)" ;; esac ACTIONS="${ACTIONS} ${OPTARG}" @@ -58,8 +62,25 @@ while getopts a:b:d:s: opt; do ;; esac done +if [ -z "${MAKE_ARGS}" ]; then + if [ "${BS}" = "autotools" ]; then + MAKE_ARGS="V=1" + elif [ "${BS}" = "cmake" ]; then + MAKE_ARGS="VERBOSE=1" + fi +fi +if [ -n "${DEBUG}" ]; then + if [ -n "${CFLAGS}" ]; then + export CFLAGS="${CFLAGS} -g -fsanitize=address" + else + export CFLAGS="-g -fsanitize=address" + fi + if ["${BS}" = "cmake" ]; then + CONFIGURE_ARGS="${CONFIGURE_ARGS} -DCMAKE_C_CFLAGS=-g -fsanitize=address" + fi +fi if [ -z "${ACTIONS}" ]; then - ACTIONS="autogen configure build test" + ACTIONS="autogen configure build test install" fi if [ -z "${BS}" ]; then inputerror "Missing build system (-b) parameter" @@ -102,6 +123,15 @@ for action in ${ACTIONS}; do esac RET="$?" find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \; + ;; + install) + ${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir" + RET="$?" + cd ${BUILDDIR}/destdir && ls -lR . + ;; + distcheck) + ${MAKE} ${MAKE_ARGS} distcheck + RET="$?" ;; esac if [ "${RET}" != "0" ]; then Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.cygwin ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.cygwin Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,4 @@ +FROM cirrusci/windowsservercore:2019 + +RUN choco install -y --no-progress cygwin +RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29 Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,3 @@ +FROM fedora:29 + +RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29.distcheck ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.fc29.distcheck Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,3 @@ +FROM fedora:29 + +RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel groff ghostscript Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.mingw ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.mingw Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,8 @@ +FROM cirrusci/windowsservercore:2019 + +RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake +RUN choco install -y --no-progress mingw +RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz +RUN tar -x -f zlib-1.2.11.tar.gz +RUN cd zlib-1.2.11 && cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . && mingw32-make && mingw32-make install +RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.msvc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.msvc Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,9 @@ +FROM cirrusci/windowsservercore:2019 + +RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake +RUN choco install -y --no-progress visualstudio2017community +RUN choco install -y --no-progress visualstudio2017-workload-vctools +RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz +RUN tar -x -f zlib-1.2.11.tar.gz +RUN cd zlib-1.2.11 && cmake -G "Visual Studio 15 2017" . && cmake --build . --target ALL_BUILD --config Release && cmake --build . --target INSTALL --config Release +RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz Added: vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.windows ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/Dockerfile.windows Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,12 @@ +FROM cirrusci/windowsservercore:2019 + +RUN choco install -y --no-progress mingw +RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake +RUN choco install -y --no-progress visualstudio2017community +RUN choco install -y --no-progress visualstudio2017-workload-vctools +RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz +RUN tar -x -f zlib-1.2.11.tar.gz +RUN cd zlib-1.2.11 && cmake -G "Visual Studio 15 2017" . && cmake --build . --target ALL_BUILD --config Release && cmake --build . --target INSTALL --config Release +RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz +RUN choco install -y --no-progress cygwin +RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel Added: vendor/libarchive/dist/build/ci/cirrus_ci/ci.cmd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/ci.cmd Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,122 @@ +@ECHO OFF +SET ZLIB_VERSION=1.2.11 +IF NOT "%BE%"=="cygwin-gcc" ( + IF NOT "%BE%"=="mingw-gcc" ( + IF NOT "%BE%"=="msvc" ( + ECHO Environment variable BE must be cygwin-gcc, mingw-gcc or msvc + EXIT /b 1 + ) + ) +) + +IF "%1%"=="prepare" ( + IF "%BE%"=="cygwin-gcc" ( + @ECHO ON + choco install -y --no-progress cygwin || EXIT /b 1 + C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel || EXIT /b 1 + @EXIT /b 0 + ) ELSE IF "%BE%"=="mingw-gcc" ( + @ECHO ON + choco install -y --no-progress mingw || EXIT /b 1 + choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=System' cmake || EXIT /b 1 + @EXIT /b 0 + ) ELSE IF "%BE%"=="msvc" ( + @ECHO ON + choco install -y --no-progress visualstudio2017community || EXIT /b 1 + choco install -y --no-progress visualstudio2017-workload-vctools || EXIT /b 1 + choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=System' cmake || EXIT /b 1 + ) +) ELSE IF "%1"=="deplibs" ( + IF "%BE%"=="cygwin-gcc" ( + ECHO Skipping on this platform + EXIT /b 0 + ) + IF NOT EXIST build_ci\libs ( + MKDIR build_ci\libs + ) + CD build_ci\libs + IF NOT EXIST zlib-%ZLIB_VERSION%.tar.gz ( + curl -o zlib-%ZLIB_VERSION%.tar.gz https://www.zlib.net/zlib-%ZLIB_VERSION%.tar.gz + ) + IF NOT EXIST zlib-%ZLIB_VERSION% ( + tar -x -z -f zlib-%ZLIB_VERSION%.tar.gz + ) + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + CD zlib-%ZLIB_VERSION% + IF "%BE%"=="mingw-gcc" ( + cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1 + mingw32-make || EXIT /b 1 + mingw32-make test || EXIT /b 1 + mingw32-make install || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + cmake -G "Visual Studio 15 2017" . || EXIT /b 1 + cmake --build . --target ALL_BUILD --config Release || EXIT /b 1 + cmake --build . --target RUN_TESTS --config Release || EXIT /b 1 + cmake --build . --target INSTALL --config Release || EXIT /b 1 + ) +) ELSE IF "%1%"=="configure" ( + IF "%BE%"=="cygwin-gcc" ( + SET BS=cmake + SET CONFIGURE_ARGS=-DENABLE_ACL=OFF + C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a configure" || EXIT /b 1 + ) ELSE IF "%BE%"=="mingw-gcc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + MKDIR build_ci\cmake + CD build_ci\cmake + cmake -G "MinGW Makefiles" ..\.. || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + MKDIR build_ci\cmake + CD build_ci\cmake + cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" ..\.. || EXIT /b 1 + ) +) ELSE IF "%1%"=="build" ( + IF "%BE%"=="cygwin-gcc" ( + SET BS=cmake + C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a build" + ) ELSE IF "%BE%"=="mingw-gcc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + CD build_ci\cmake + mingw32-make || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + CD build_ci\cmake + cmake --build . --target ALL_BUILD --config Release + ) +) ELSE IF "%1%"=="test" ( + IF "%BE%"=="cygwin-gcc" ( + ECHO "Skipping tests on this platform" + EXIT /b 0 + REM SET BS=cmake + REM SET SKIP_TEST_SPARSE=1 + REM C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a test" + ) ELSE IF "%BE%"=="mingw-gcc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + COPY "C:\Program Files (x86)\zlib\bin\libzlib.dll" build_ci\cmake\bin\ + CD build_ci\cmake + SET SKIP_TEST_SPARSE=1 + mingw32-make test + ) ELSE IF "%BE%"=="msvc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + ECHO "Skipping tests on this platform" + EXIT /b 0 + REM CD build_ci\cmake + REM cmake --build . --target RUN_TESTS --config Release + ) +) ELSE IF "%1%"=="install" ( + IF "%BE%"=="cygwin-gcc" ( + SET BS=cmake + C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a install" + ) ELSE IF "%BE%"=="mingw-gcc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + CD build_ci\cmake + mingw32-make install DESTDIR=%cd%\destdir + ) ELSE IF "%BE%"=="msvc" ( + SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin + cmake --build . --target INSTALL --config Release + ) +) ELSE ( + ECHO "Usage: %0% prepare|deplibs|configure|build|test|install" + @EXIT /b 0 +) +@EXIT /b 0 Added: vendor/libarchive/dist/build/ci/cirrus_ci/ci.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/build/ci/cirrus_ci/ci.sh Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,56 @@ +#!/bin/sh +UNAME=`uname` +if [ "$1" = "prepare" ] +then + if [ "${UNAME}" = "FreeBSD" ] + then + set -x -e + sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf + mount -u -o acls / + mkdir /tmp_acl_nfsv4 + MD=`mdconfig -a -t swap -s 128M` + newfs /dev/$MD + tunefs -N enable /dev/$MD + mount /dev/$MD /tmp_acl_nfsv4 + chmod 1777 /tmp_acl_nfsv4 + pkg install -y autoconf automake cmake libiconv libtool pkgconf expat libxml2 liblz4 zstd + elif [ "${UNAME}" = "Darwin" ] + then + set -x -e + brew update > /dev/null + for pkg in autoconf automake libtool pkg-config cmake xz lz4 zstd + do + brew list $pkg > /dev/null && brew upgrade $pkg || brew install $pkg + done + elif [ "${UNAME}" = "Linux" ] + then + if [ -f "/etc/debian_version" ] + then + apt-get -y update + apt-get -y install build-essential locales automake libtool bison sharutils pkgconf libacl1-dev libbz2-dev libzip-dev zlib1g-dev liblzma-dev liblz4-dev libzstd-dev libssl-dev lrzip cmake + elif [ -f "/etc/fedora-release" ] + then + dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel + fi + fi +elif [ "$1" = "test" ] +then + if [ "${UNAME}" = "FreeBSD" ] + then + set -e + echo "Additional NFSv4 ACL tests" + CURDIR=`pwd` + if [ "${BS}" = "cmake" ] + then + BIN_SUBDIR="bin" + else + BIN_SUBDIR=. + fi + BUILDDIR="${CURDIR}/build_ci/${BS}" + cd "$BUILDDIR" + TMPDIR=/tmp_acl_nfsv4 ${BIN_SUBDIR}/libarchive_test -r "${CURDIR}/libarchive/test" -v test_acl_platform_nfs4 + fi +else + echo "Usage $0 prepare | test_nfsv4_acls" + exit 1 +fi Modified: vendor/libarchive/dist/build/ci/travis_ci.sh ============================================================================== --- vendor/libarchive/dist/build/ci/travis_ci.sh Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/build/ci/travis_ci.sh Mon May 20 12:32:00 2019 (r347989) @@ -15,13 +15,14 @@ case "$UNAME" in cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}" cmake --build . --target ALL_BUILD # Until fixed, we don't run tests on Windows (lots of fails + timeout) + #export SKIP_TEST_FUZZ=1 #cmake --build . --target RUN_TESTS set +x elif [ "${BS}" = "mingw" ]; then set -x cmake -G "MSYS Makefiles" -D CMAKE_C_COMPILER="${CC}" -D CMAKE_MAKE_PROGRAM="mingw32-make" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}" mingw32-make - # The MinGW tests time out on Travis CI, disable for now + #export SKIP_TEST_FUZZ=1 #mingw32-make test set +x else Added: vendor/libarchive/dist/contrib/archivetest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/contrib/archivetest.c Mon May 20 12:32:00 2019 (r347989) @@ -0,0 +1,218 @@ +/*- + * Copyright (c) 2019 Martin Matuska + * 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(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Archivetest verifies reading archives with libarchive + * + * It may be used to reproduce failures in testcases discovered by OSS-Fuzz + * https://github.com/google/oss-fuzz/blob/master/projects/libarchive + */ + +#include +#include +#include +#include +#include +#include + +const char *errnostr(int errno) +{ + char *estr; + switch(errno) { + case ARCHIVE_EOF: + estr = "ARCHIVE_EOF"; + break; + case ARCHIVE_OK: + estr = "ARCHIVE_OK"; + break; + case ARCHIVE_WARN: + estr = "ARCHIVE_WARN"; + break; + case ARCHIVE_RETRY: + estr = "ARCHIVE_RETRY"; + break; + case ARCHIVE_FAILED: + estr = "ARCHIVE_FAILED"; + break; + case ARCHIVE_FATAL: + estr = "ARCHIVE_FATAL"; + break; + default: + estr = "Unknown"; + break; + } + return (estr); +} + +void usage(const char *prog) +{ + fprintf(stderr, "Usage: %s [-f filename] [-h] [-q] [-s]\n", prog); +} + +void printhelp() +{ + fprintf(stdout, "archivetest: verify reading archives with " + "libarchive\n\n" + "Options:\n" + " -f filename Filename to verify\n" + " -h Show this help\n" + " -q Quiet mode\n" + " -s Verify only headers (skip data)\n\n" + "If no filename is specified, data is read from standard input.\n" + "\n%s\n", archive_version_details()); +} + +int v_print(int verbose, const char *format, ...) +{ + int r = 0; + + if (verbose) { + va_list args; + + va_start(args, format); + r = vfprintf(stdout, format, args); + va_end(args); + } + return (r); +} + +int main(int argc, char *argv[]) +{ + struct archive *a; + struct archive_entry *entry; + char *filename; + const char *p; + char buffer[4096]; + int c; + int v, skip_data; + int r = ARCHIVE_OK; + int format_printed; + + filename = NULL; + skip_data = 0; + v = 1; + + while ((c = getopt (argc, argv, "f:hqs")) != -1) { + switch (c) { + case 'f': + filename = optarg; + break; + case 'h': + printhelp(); + exit(0); + case 'q': + v = 0; + break; + case 's': + skip_data = 1; + break; + case '?': + if (optopt == 'f') + fprintf(stderr, "Option -%c requires " + "an argument.\n", optopt); + else if (isprint(optopt)) + fprintf(stderr, "Unknown option '-%c'" + ".\n", optopt); + else + fprintf(stderr, "Unknown option " + "character '\\x%x'.\n", optopt); + usage(argv[0]); + default: + exit(1); + } + } + + a = archive_read_new(); + + archive_read_support_filter_all(a); + archive_read_support_format_all(a); + + v_print(v, "Data source: "); + + if (filename == NULL) { + v_print(v, "standard input\n"); + r = archive_read_open_fd(a, STDIN_FILENO, 4096); + } else { + v_print(v, "filename: %s\n", filename); + r = archive_read_open_filename(a, filename, 4096); + } + + if (r != ARCHIVE_OK) { + archive_read_free(a); + fprintf(stderr, "Invalid or unsupported data source\n"); + exit(1); + } + + format_printed = 0; + c = 1; + + while (1) { + r = archive_read_next_header(a, &entry); + if (r == ARCHIVE_FATAL) { + v_print(v, "Entry %d: fatal error reading " + "header\n", c); + break; + } + if (!format_printed) { + v_print(v, "Filter: %s\nFormat: %s\n", + archive_filter_name(a, 0), archive_format_name(a)); + format_printed = 1; + } + if (r == ARCHIVE_RETRY) + continue; + if (r == ARCHIVE_EOF) + break; + p = archive_entry_pathname(entry); + v_print(v, "Entry %d: %s, pathname", c, errnostr(r)); + if (p == NULL || p[0] == '\0') + v_print(v, " unreadable"); + else + v_print(v, ": %s", p); + v_print(v, ", data: "); + if (skip_data) { + v_print(v, "skipping"); + } else { + while ((r = archive_read_data(a, buffer, 4096) > 0)) + ; + if (r == ARCHIVE_FATAL) { + v_print(v, "ERROR\nError string: %s\n", + archive_error_string(a)); + break; + } + v_print(v, "OK"); + } + v_print(v, "\n"); + c++; + } + + v_print(v, "Last return code: %s (%d)\n", errnostr(r), r); + if (r == ARCHIVE_EOF || r == ARCHIVE_OK) { + archive_read_free(a); + exit(0); + } + v_print(v, "Error string: %s\n", archive_error_string(a)); + archive_read_free(a); + exit(2); +} Modified: vendor/libarchive/dist/cpio/test/test_basic.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_basic.c Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/cpio/test/test_basic.c Mon May 20 12:32:00 2019 (r347989) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: vendor/libarchive/dist/cpio/test/test_format_newc.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_format_newc.c Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/cpio/test/test_format_newc.c Mon May 20 12:32:00 2019 (r347989) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: vendor/libarchive/dist/cpio/test/test_gcpio_compat.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_gcpio_compat.c Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/cpio/test/test_gcpio_compat.c Mon May 20 12:32:00 2019 (r347989) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: vendor/libarchive/dist/cpio/test/test_option_L_upper.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_L_upper.c Mon May 20 08:52:11 2019 (r347988) +++ vendor/libarchive/dist/cpio/test/test_option_L_upper.c Mon May 20 12:32:00 2019 (r347989) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_ * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 20 12:57:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98A0515ACA7C; Mon, 20 May 2019 12:57:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4508C75235; Mon, 20 May 2019 12:57:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EB4C1E8D8; Mon, 20 May 2019 12:57:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KCvjGX006588; Mon, 20 May 2019 12:57:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KCvdL0006559; Mon, 20 May 2019 12:57:39 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201905201257.x4KCvdL0006559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 20 May 2019 12:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347990 - in head: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test co... X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/test_uti... X-SVN-Commit-Revision: 347990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4508C75235 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 12:57:46 -0000 Author: mm Date: Mon May 20 12:57:39 2019 New Revision: 347990 URL: https://svnweb.freebsd.org/changeset/base/347990 Log: MFV r347989: Sync libarchive with vendor. Relevant vendor changes: Issue #795: XAR - do not try to add xattrs without an allocated name PR #812: non-recursive option for extract and list PR #958: support reading metadata from compressed files PR #999: add --exclude-vcs option to bsdtar Issue #1062: treat empty archives with a GNU volume header as valid PR #1074: Handle ZIP files with trailing 0s in the extra fields (Android APK archives) PR #1109: Ignore padding in Zip extra field data (Android APK archives) PR #1167: fix problems related to unreadable directories Issue #1168: fix handling of strtol() and strtoul() PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter PR #1174: ZIP reader - fix of MSZIP signature parsing PR #1175: gzip filter - fix reading files larger than 4GB from memory PR #1177: gzip filter - fix memory leak with repeated header reads PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field PR #1181: RAR5 - fix merge_block() recursion (OSS-Fuzz 12999, 13029, 13144, 13478, 13490) PR #1183: fix memory leak when decompressing ZIP files with LZMA PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817 OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables PR #1186: RAR5 - fix invalid type used for dictionary size mask (OSS-Fuzz 14537) PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555) PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories (OSS-Fuzz 14574) PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry OSS-Fuzz 14331: RAR5 - fix maximum owner name length OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check Additional RAR5 reader changes: - support symlinks, hardlinks, file owner, file group, versioned files - change ARCHIVE_FORMAT_RAR_V5 to 0x100000 - set correct mode for readonly directories - support readonly, hidden and system Windows file attributes MFC after: 2 weeks Added: head/contrib/libarchive/libarchive/archive_entry_misc.3 - copied unchanged from r347989, vendor/libarchive/dist/libarchive/archive_entry_misc.3 head/contrib/libarchive/libarchive/test/test_read_format_mtree_noprint.mtree.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_mtree_noprint.mtree.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_fileattr.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_fileattr.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_hardlink.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_hardlink.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift1.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_leftshift1.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_leftshift2.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_leftshift2.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_owner.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_owner.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_symlink.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_symlink.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_raw.data.gz.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_raw.data.gz.uu head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.c - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_with_gnulabel.c head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.c head/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.c head/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.zip.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu - copied unchanged from r347989, vendor/libarchive/dist/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu head/contrib/libarchive/tar/test/test_option_exclude_vcs.c - copied unchanged from r347989, vendor/libarchive/dist/tar/test/test_option_exclude_vcs.c Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/cpio/test/test_basic.c head/contrib/libarchive/cpio/test/test_format_newc.c head/contrib/libarchive/cpio/test/test_gcpio_compat.c head/contrib/libarchive/cpio/test/test_option_L_upper.c head/contrib/libarchive/cpio/test/test_option_a.c head/contrib/libarchive/cpio/test/test_option_c.c head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_private.h head/contrib/libarchive/libarchive/archive_hmac.c head/contrib/libarchive/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_read.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_private.h head/contrib/libarchive/libarchive/archive_read_set_format.c head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_read_support_format_raw.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/test/test_entry.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c head/contrib/libarchive/libarchive/test/test_read_extract.c head/contrib/libarchive/libarchive/test/test_read_format_mtree.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_raw.c head/contrib/libarchive/libarchive/test/test_read_format_zip.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/libarchive/test/test_write_disk_symlink.c head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/bsdtar.c head/contrib/libarchive/tar/bsdtar.h head/contrib/libarchive/tar/cmdline.c head/contrib/libarchive/tar/test/test_basic.c head/contrib/libarchive/tar/test/test_copy.c head/contrib/libarchive/tar/test/test_option_C_mtree.c head/contrib/libarchive/tar/test/test_option_H_upper.c head/contrib/libarchive/tar/test/test_option_L_upper.c head/contrib/libarchive/tar/test/test_option_U_upper.c head/contrib/libarchive/tar/test/test_option_n.c head/contrib/libarchive/tar/test/test_option_s.c head/contrib/libarchive/tar/test/test_strip_components.c head/contrib/libarchive/tar/test/test_symlink_dir.c head/contrib/libarchive/test_utils/test_common.h head/contrib/libarchive/test_utils/test_main.c head/lib/libarchive/Makefile head/lib/libarchive/tests/Makefile head/usr.bin/tar/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/NEWS Mon May 20 12:57:39 2019 (r347990) @@ -1,3 +1,13 @@ +Apr 16, 2019: Support for non-recursive list and extract + +Apr 14, 2019: New tar option: --exclude-vcs + +Mar 27, 2019: Support for file and directory symlinks on Windows + +Mar 12, 2019: Important fixes for storing file attributes and flags + +Jan 20, 2019: Support for xz, lzma, ppmd8 and bzip2 compression in zip archives + Oct 06, 2018: RAR 5.0 reader Sep 03, 2018: libarchive 3.3.3 released Modified: head/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_basic.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_basic.c Mon May 20 12:57:39 2019 (r347990) @@ -46,7 +46,7 @@ verify_files(const char *msg) /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* Another file with 1 link and different permissions. */ failure(msg); @@ -173,7 +173,7 @@ DEFINE_TEST(test_basic) /* Symlink to above file. */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); if (is_LargeInode("symlink")) { strncat(result, Modified: head/contrib/libarchive/cpio/test/test_format_newc.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_format_newc.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_format_newc.c Mon May 20 12:57:39 2019 (r347990) @@ -114,7 +114,7 @@ DEFINE_TEST(test_format_newc) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file1"); + assertMakeSymlink("symlink", "file1", 0); fprintf(list, "symlink\n"); } @@ -233,7 +233,12 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ +#if defined(_WIN32) && !defined(CYGWIN) + /* Mode: Group members bits and others bits do not work. */ + assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); +#else assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */ +#endif assertEqualInt(from_hex(e + 22, 8), uid); /* uid */ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */ assertEqualMem(e + 38, "00000001", 8); /* nlink */ Modified: head/contrib/libarchive/cpio/test/test_gcpio_compat.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_gcpio_compat.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_gcpio_compat.c Mon May 20 12:57:39 2019 (r347990) @@ -71,7 +71,7 @@ unpack_test(const char *from, const char *options, con /* Symlink */ if (canSymlink()) - assertIsSymlink("symlink", "file"); + assertIsSymlink("symlink", "file", 0); /* dir */ assertIsDir("dir", 0775); Modified: head/contrib/libarchive/cpio/test/test_option_L_upper.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_L_upper.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_option_L_upper.c Mon May 20 12:57:39 2019 (r347990) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); * tests won't run on Windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) #define CAT "type" +#define SEP "\\" #else #define CAT "cat" +#define SEP "/" #endif DEFINE_TEST(test_option_L_upper) @@ -51,7 +53,7 @@ DEFINE_TEST(test_option_L_upper) fprintf(filelist, "file\n"); /* Symlink to above file. */ - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); fclose(filelist); @@ -61,7 +63,7 @@ DEFINE_TEST(test_option_L_upper) assertTextFileContents("1 block\n", "copy.err"); failure("Regular -p without -L should preserve symlinks."); - assertIsSymlink("copy/symlink", NULL); + assertIsSymlink("copy/symlink", NULL, 0); r = systemf(CAT " filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); @@ -77,13 +79,14 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack", 0755); assertChdir("unpack"); - r = systemf(CAT " ../archive.out | %s -i >unpack.out 2>unpack.err", testprog); + r = systemf(CAT " .." SEP "archive.out | %s -i >unpack.out 2>unpack.err", testprog); + failure("Error invoking %s -i", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack.err"); assertChdir(".."); - assertIsSymlink("unpack/symlink", NULL); + assertIsSymlink("unpack/symlink", NULL, 0); r = systemf(CAT " filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); failure("Error invoking %s -oL", testprog); @@ -92,7 +95,8 @@ DEFINE_TEST(test_option_L_upper) assertMakeDir("unpack-L", 0755); assertChdir("unpack-L"); - r = systemf(CAT " ../archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + r = systemf(CAT " .." SEP "archive-L.out | %s -i >unpack-L.out 2>unpack-L.err", testprog); + failure("Error invoking %s -i < archive-L.out", testprog); assertEqualInt(r, 0); assertTextFileContents("1 block\n", "unpack-L.err"); Modified: head/contrib/libarchive/cpio/test/test_option_a.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_a.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_option_a.c Mon May 20 12:57:39 2019 (r347990) @@ -71,8 +71,13 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); +#if defined(_WIN32) && !defined(CYGWIN) + times.actime = 86400; + times.modtime = 86400; +#else times.actime = 1; times.modtime = 3; +#endif assertEqualInt(0, utime(files[i].name, ×)); /* Record whatever atime the file ended up with. */ Modified: head/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_c.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/cpio/test/test_option_c.c Mon May 20 12:57:39 2019 (r347990) @@ -85,7 +85,7 @@ DEFINE_TEST(test_option_c) /* "symlink" */ if (canSymlink()) { - assertMakeSymlink("symlink", "file"); + assertMakeSymlink("symlink", "file", 0); fprintf(filelist, "symlink\n"); } Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive.h Mon May 20 12:57:39 2019 (r347990) @@ -338,9 +338,9 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 -#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 +#define ARCHIVE_FORMAT_RAR_V5 0x100000 /* * Codes returned by archive_read_format_capabilities(). @@ -1095,6 +1095,8 @@ __LA_DECL int archive_match_excluded(struct archive *, */ __LA_DECL int archive_match_path_excluded(struct archive *, struct archive_entry *); +/* Control recursive inclusion of directory content when directory is included. Default on. */ +__LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int); /* Add exclusion pathname pattern. */ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); __LA_DECL int archive_match_exclude_pattern_w(struct archive *, Modified: head/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_entry.c Mon May 20 12:57:39 2019 (r347990) @@ -168,6 +168,7 @@ archive_entry_clear(struct archive_entry *entry) archive_entry_xattr_clear(entry); archive_entry_sparse_clear(entry); free(entry->stat); + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; memset(entry, 0, sizeof(*entry)); return entry; } @@ -202,6 +203,9 @@ archive_entry_clone(struct archive_entry *entry) entry2->ae_set = entry->ae_set; archive_mstring_copy(&entry2->ae_uname, &entry->ae_uname); + /* Copy symlink type */ + entry2->ae_symlink_type = entry->ae_symlink_type; + /* Copy encryption status */ entry2->encryption = entry->encryption; @@ -253,6 +257,7 @@ archive_entry_new2(struct archive *a) if (entry == NULL) return (NULL); entry->archive = a; + entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED; return (entry); } @@ -675,6 +680,12 @@ archive_entry_symlink(struct archive_entry *entry) return (NULL); } +int +archive_entry_symlink_type(struct archive_entry *entry) +{ + return (entry->ae_symlink_type); +} + const char * archive_entry_symlink_utf8(struct archive_entry *entry) { @@ -1246,6 +1257,12 @@ archive_entry_set_symlink(struct archive_entry *entry, } void +archive_entry_set_symlink_type(struct archive_entry *entry, int type) +{ + entry->ae_symlink_type = type; +} + +void archive_entry_set_symlink_utf8(struct archive_entry *entry, const char *linkname) { archive_mstring_copy_utf8(&entry->ae_symlink, linkname); @@ -1749,6 +1766,10 @@ static const struct flag { { "nohidden", L"nohidden", UF_HIDDEN, 0}, { "nouhidden", L"nouhidden", UF_HIDDEN, 0}, #endif +#ifdef FILE_ATTRIBUTE_HIDDEN + { "nohidden", L"nohidden", FILE_ATTRIBUTE_HIDDEN, 0}, + { "nouhidden", L"nouhidden", FILE_ATTRIBUTE_HIDDEN, 0}, +#endif #ifdef UF_OFFLINE { "nooffline", L"nooffline", UF_OFFLINE, 0}, { "nouoffline", L"nouoffline", UF_OFFLINE, 0}, @@ -1758,6 +1779,11 @@ static const struct flag { { "nourdonly", L"nourdonly", UF_READONLY, 0}, { "noreadonly", L"noreadonly", UF_READONLY, 0}, #endif +#ifdef FILE_ATTRIBUTE_READONLY + { "nordonly", L"nordonly", FILE_ATTRIBUTE_READONLY, 0}, + { "nourdonly", L"nourdonly", FILE_ATTRIBUTE_READONLY, 0}, + { "noreadonly", L"noreadonly", FILE_ATTRIBUTE_READONLY, 0}, +#endif #ifdef UF_SPARSE { "nosparse", L"nosparse", UF_SPARSE, 0}, { "nousparse", L"nousparse", UF_SPARSE, 0}, @@ -1769,6 +1795,10 @@ static const struct flag { #ifdef UF_SYSTEM { "nosystem", L"nosystem", UF_SYSTEM, 0}, { "nousystem", L"nousystem", UF_SYSTEM, 0}, +#endif +#ifdef FILE_ATTRIBUTE_SYSTEM + { "nosystem", L"nosystem", FILE_ATTRIBUTE_SYSTEM, 0}, + { "nousystem", L"nousystem", FILE_ATTRIBUTE_SYSTEM, 0}, #endif #if defined(FS_UNRM_FL) /* 'u' */ { "noundel", L"noundel", FS_UNRM_FL, 0}, Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_entry.h Mon May 20 12:57:39 2019 (r347990) @@ -191,6 +191,13 @@ struct archive_entry; #define AE_IFIFO ((__LA_MODE_T)0010000) /* + * Symlink types + */ +#define AE_SYMLINK_TYPE_UNDEFINED 0 +#define AE_SYMLINK_TYPE_FILE 1 +#define AE_SYMLINK_TYPE_DIRECTORY 2 + +/* * Basic object manipulation */ @@ -275,6 +282,7 @@ __LA_DECL int archive_entry_size_is_set(struct archi __LA_DECL const char *archive_entry_strmode(struct archive_entry *); __LA_DECL const char *archive_entry_symlink(struct archive_entry *); __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *); +__LA_DECL int archive_entry_symlink_type(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *); __LA_DECL const char *archive_entry_uname(struct archive_entry *); @@ -350,6 +358,7 @@ __LA_DECL void archive_entry_unset_size(struct archive __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *); __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int); __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); @@ -692,7 +701,6 @@ __LA_DECL void archive_entry_linkify(struct archive_en struct archive_entry **, struct archive_entry **); __LA_DECL struct archive_entry *archive_entry_partial_links( struct archive_entry_linkresolver *res, unsigned int *links); - #ifdef __cplusplus } #endif Copied: head/contrib/libarchive/libarchive/archive_entry_misc.3 (from r347989, vendor/libarchive/dist/libarchive/archive_entry_misc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_entry_misc.3 Mon May 20 12:57:39 2019 (r347990, copy of r347989, vendor/libarchive/dist/libarchive/archive_entry_misc.3) @@ -0,0 +1,62 @@ +.\" Copyright (c) 2019 Martin Matuska +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 15, 2019 +.Dt ARCHIVE_ENTRY_MISC 3 +.Os +.Sh NAME +.Nm archive_entry_symlink_type , +.Nm archive_entry_set_symlink_type +.Nd miscellaneous functions for manipulating properties of archive_entry. +.Sh LIBRARY +Streaming Archive Library (libarchive, -larchive) +.Sh SYNOPSIS +.In archive_entry.h +.Ft int +.Fn archive_entry_symlink_type "struct archive_entry *a" +.Ft void +.Fn archive_entry_set_symlink_type "struct archive_entry *a" "int" +.Sh DESCRIPTION +The function +.Fn archive_entry_symlink_type +returns and the function +.Fn archive_entry_set_symlink_type +sets the type of the symbolic link stored in an archive entry. These functions +have special meaning on operating systems that support multiple symbolic link +types (e.g. Microsoft Windows). +.Pp +Supported values are: +.Bl -tag -width "AE_SYMLINK_TYPE_DIRECTORY" -compact +.It AE_SYMLINK_TYPE_UNDEFINED +Symbolic link target type is not defined (default on unix systems) +.It AE_SYMLINK_TYPE_FILE +Symbolic link points to a file +.It AE_SYMLINK_TYPE_DIRECTORY +Symbolic link points to a directory +.El +.Sh SEE ALSO +.Xr archive_entry 3 , +.Xr archive_entry_paths 3 , +.Xr archive_entry_stat 3 , +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_private.h Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_entry_private.h Mon May 20 12:57:39 2019 (r347990) @@ -176,6 +176,9 @@ struct archive_entry { /* Miscellaneous. */ char strmode[12]; + + /* Symlink type support */ + int ae_symlink_type; }; #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: head/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_hmac.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_hmac.c Mon May 20 12:57:39 2019 (r347990) @@ -83,6 +83,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { +#pragma GCC diagnostic ignored "-Wcast-qual" BCRYPT_ALG_HANDLE hAlg; BCRYPT_HASH_HANDLE hHash; DWORD hash_len; Modified: head/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_match.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_match.c Mon May 20 12:57:39 2019 (r347990) @@ -93,6 +93,9 @@ struct archive_match { /* exclusion/inclusion set flag. */ int setflag; + /* Recursively include directory content? */ + int recursive_include; + /* * Matching filename patterns. */ @@ -223,6 +226,7 @@ archive_match_new(void) return (NULL); a->archive.magic = ARCHIVE_MATCH_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; + a->recursive_include = 1; match_list_init(&(a->inclusions)); match_list_init(&(a->exclusions)); __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); @@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, } /* + * When recursive inclusion of directory content is enabled, + * an inclusion pattern that matches a directory will also + * include everything beneath that directory. Enabled by default. + * + * For compatibility with GNU tar, exclusion patterns always + * match if a subset of the full patch matches (i.e., they are + * are not rooted at the beginning of the path) and thus there + * is no corresponding non-recursive exclusion mode. + */ +int +archive_match_set_inclusion_recursion(struct archive *_a, int enabled) +{ + struct archive_match *a; + + archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, + ARCHIVE_STATE_NEW, "archive_match_set_inclusion_recursion"); + a = (struct archive_match *)_a; + a->recursive_include = enabled; + return (ARCHIVE_OK); +} + +/* * Utility functions to get statistic information for inclusion patterns. */ int @@ -781,7 +807,10 @@ static int match_path_inclusion(struct archive_match *a, struct match *m, int mbs, const void *pn) { - int flag = PATHMATCH_NO_ANCHOR_END; + /* Recursive operation requires only a prefix match. */ + int flag = a->recursive_include ? + PATHMATCH_NO_ANCHOR_END : + 0; int r; if (mbs) { @@ -1232,7 +1261,7 @@ set_timefilter_pathname_mbs(struct archive_match *a, i archive_set_error(&(a->archive), EINVAL, "pathname is empty"); return (ARCHIVE_FAILED); } - if (stat(path, &st) != 0) { + if (la_stat(path, &st) != 0) { archive_set_error(&(a->archive), errno, "Failed to stat()"); return (ARCHIVE_FAILED); } Modified: head/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_platform.h Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_platform.h Mon May 20 12:57:39 2019 (r347990) @@ -69,6 +69,8 @@ * either Windows or Posix APIs. */ #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) #include "archive_windows.h" +#else +#define la_stat(path,stref) stat(path,stref) #endif /* Modified: head/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read.c Mon May 20 12:57:39 2019 (r347990) @@ -611,6 +611,15 @@ choose_filters(struct archive_read *a) return (ARCHIVE_FATAL); } +int +__archive_read_header(struct archive_read *a, struct archive_entry *entry) +{ + if (a->filter->read_header) + return a->filter->read_header(a->filter, entry); + else + return (ARCHIVE_OK); +} + /* * Read header of next entry. */ Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Mon May 20 12:57:39 2019 (r347990) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } } else #endif - if (stat(path, &s) != 0) { + if (la_stat(path, &s) != 0) { archive_set_error(&a->archive, errno, "Can't stat %s", path); return (ARCHIVE_FAILED); Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Mon May 20 12:57:39 2019 (r347990) @@ -909,7 +909,7 @@ next_entry(struct archive_read_disk *a, struct tree *t } } break; - } + } } while (lst == NULL); #ifdef __APPLE__ @@ -1295,10 +1295,23 @@ archive_read_disk_descend(struct archive *_a) if (t->visit_type != TREE_REGULAR || !t->descend) return (ARCHIVE_OK); + /* + * We must not treat the initial specified path as a physical dir, + * because if we do then we will try and ascend out of it by opening + * ".." which is (a) wrong and (b) causes spurious permissions errors + * if ".." is not readable by us. Instead, treat it as if it were a + * symlink. (This uses an extra fd, but it can only happen once at the + * top level of a traverse.) But we can't necessarily assume t->st is + * valid here (though t->lst is), which complicates the logic a + * little. + */ if (tree_current_is_physical_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->lst.st_dev, t->lst.st_ino, &t->restore_time); - t->stack->flags |= isDir; + if (t->stack->parent->parent != NULL) + t->stack->flags |= isDir; + else + t->stack->flags |= isDirLink; } else if (tree_current_is_dir(t)) { tree_push(t, t->basename, t->current_filesystem_id, t->st.st_dev, t->st.st_ino, &t->restore_time); @@ -2151,6 +2164,17 @@ tree_open(const char *path, int symlink_mode, int rest static struct tree * tree_reopen(struct tree *t, const char *path, int restore_time) { +#if defined(O_PATH) + /* Linux */ + const int o_flag = O_PATH; +#elif defined(O_SEARCH) + /* SunOS */ + const int o_flag = O_SEARCH; +#elif defined(O_EXEC) + /* FreeBSD */ + const int o_flag = O_EXEC; +#endif + t->flags = (restore_time != 0)?needsRestoreTimes:0; t->flags |= onInitialDir; t->visit_type = 0; @@ -2172,6 +2196,15 @@ tree_reopen(struct tree *t, const char *path, int rest t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); +#if defined(O_PATH) || defined(O_SEARCH) || defined(O_EXEC) + /* + * Most likely reason to fail opening "." is that it's not readable, + * so try again for execute. The consequences of not opening this are + * unhelpful and unnecessary errors later. + */ + if (t->initial_dir_fd < 0) + t->initial_dir_fd = open(".", o_flag | O_CLOEXEC); +#endif __archive_ensure_cloexec_flag(t->initial_dir_fd); t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); @@ -2479,7 +2512,7 @@ tree_current_stat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; - if (stat(tree_current_access_path(t), &t->st) != 0) + if (la_stat(tree_current_access_path(t), &t->st) != 0) #endif return NULL; t->flags |= hasStat; Modified: head/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_private.h Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_private.h Mon May 20 12:57:39 2019 (r347990) @@ -98,6 +98,8 @@ struct archive_read_filter { int (*close)(struct archive_read_filter *self); /* Function that handles switching from reading one block to the next/prev */ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); + /* Read any header metadata if available. */ + int (*read_header)(struct archive_read_filter *self, struct archive_entry *entry); /* My private data. */ void *data; @@ -250,6 +252,7 @@ int64_t __archive_read_seek(struct archive_read*, int6 int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); +int __archive_read_header(struct archive_read *, struct archive_entry *); int __archive_read_program(struct archive_read_filter *, const char *); void __archive_read_free_filters(struct archive_read *); struct archive_read_extract *__archive_read_get_extract(struct archive_read *); Modified: head/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_set_format.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_set_format.c Mon May 20 12:57:39 2019 (r347990) @@ -73,6 +73,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR: strcpy(str, "rar"); break; + case ARCHIVE_FORMAT_RAR_V5: + strcpy(str, "rar5"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); break; Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Mon May 20 12:57:39 2019 (r347990) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #endif #include "archive.h" +#include "archive_entry.h" +#include "archive_endian.h" #include "archive_private.h" #include "archive_read_private.h" @@ -56,6 +61,8 @@ struct private_data { size_t out_block_size; int64_t total_out; unsigned long crc; + uint32_t mtime; + char *name; char eof; /* True = found end of compressed data. */ }; @@ -123,7 +130,8 @@ archive_read_support_filter_gzip(struct archive *_a) * count of bits verified, suitable for use by bidder. */ static ssize_t -peek_at_header(struct archive_read_filter *filter, int *pbits) +peek_at_header(struct archive_read_filter *filter, int *pbits, + struct private_data *state) { const unsigned char *p; ssize_t avail, len; @@ -144,7 +152,9 @@ peek_at_header(struct archive_read_filter *filter, int return (0); bits += 3; header_flags = p[3]; - /* Bytes 4-7 are mod time. */ + /* Bytes 4-7 are mod time in little endian. */ + if (state) + state->mtime = archive_le32dec(p + 4); /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -161,6 +171,7 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { + ssize_t file_start = len; do { ++len; if (avail < len) @@ -169,6 +180,12 @@ peek_at_header(struct archive_read_filter *filter, int if (p == NULL) return (0); } while (p[len - 1] != 0); + + if (state) { + /* Reset the name in case of repeat header reads. */ + free(state->name); + state->name = strdup((const char *)&p[file_start]); + } } /* Null-terminated optional comment. */ @@ -214,12 +231,29 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel (void)self; /* UNUSED */ - if (peek_at_header(filter, &bits_checked)) + if (peek_at_header(filter, &bits_checked, NULL)) return (bits_checked); return (0); } +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + #ifndef HAVE_ZLIB_H /* @@ -272,6 +306,7 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; + self->read_header = gzip_read_header; state->in_stream = 0; /* We're not actually within a stream yet. */ @@ -289,7 +324,7 @@ consume_header(struct archive_read_filter *self) state = (struct private_data *)self->data; /* If this is a real header, consume it. */ - len = peek_at_header(self->upstream, NULL); + len = peek_at_header(self->upstream, NULL, state); if (len == 0) return (ARCHIVE_EOF); __archive_read_filter_consume(self->upstream, len); @@ -374,7 +409,7 @@ gzip_filter_read(struct archive_read_filter *self, con { struct private_data *state; size_t decompressed; - ssize_t avail_in; + ssize_t avail_in, max_in; int ret; state = (struct private_data *)self->data; @@ -408,6 +443,12 @@ gzip_filter_read(struct archive_read_filter *self, con "truncated gzip input"); return (ARCHIVE_FATAL); } + if (UINT_MAX >= SSIZE_MAX) + max_in = SSIZE_MAX; + else + max_in = UINT_MAX; + if (avail_in > max_in) + avail_in = max_in; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ @@ -469,6 +510,7 @@ gzip_filter_close(struct archive_read_filter *self) } } + free(state->name); free(state->out_block); free(state); return (ret); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Mon May 20 12:57:39 2019 (r347990) @@ -1509,8 +1509,8 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) goto nomszip; - else if (cab->stream.next_in[0] != 0x43 || - cab->stream.next_in[1] != 0x4b) + else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 || + cab->stream.next_in[1] != 0x4b)) goto nomszip; cab->stream.next_in += mszip; cab->stream.avail_in -= mszip; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Mon May 20 12:57:39 2019 (r347990) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_CTYPE_H +#include +#endif #include "archive.h" #include "archive_entry.h" @@ -1011,7 +1014,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree { ssize_t len; uintmax_t counter; - char *p; + char *p, *s; struct mtree_option *global; struct mtree_entry *last_entry; int r, is_form_d; @@ -1025,6 +1028,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree (void)detect_form(a, &is_form_d); for (counter = 1; ; ++counter) { + r = ARCHIVE_OK; len = readline(a, mtree, &p, 65536); if (len == 0) { mtree->this_entry = mtree->entries; @@ -1045,6 +1049,15 @@ read_mtree(struct archive_read *a, struct mtree *mtree continue; if (*p == '\r' || *p == '\n' || *p == '\0') continue; + /* Non-printable characters are not allowed */ + for (s = p;s < p + len - 1; s++) { + if (!isprint(*s)) { + r = ARCHIVE_FATAL; + break; + } + } + if (r != ARCHIVE_OK) + break; if (*p != '/') { r = process_add_entry(a, mtree, &global, p, len, &last_entry, is_form_d); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon May 20 12:57:39 2019 (r347990) @@ -1024,8 +1024,10 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: ret = read_data_compressed(a, buff, size, offset); - if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) + if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); + rar->start_new_table = 1; + } break; default: Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Mon May 20 12:32:00 2019 (r347989) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Mon May 20 12:57:39 2019 (r347990) @@ -33,6 +33,9 @@ #ifdef HAVE_ZLIB_H #include /* crc32 */ #endif +#ifdef HAVE_LIMITS_H +#include +#endif #include "archive.h" #ifndef HAVE_ZLIB_H @@ -78,230 +81,275 @@ static unsigned char rar5_signature[] = { 243, 192, 211, 128, 187, 166, 160, 161 }; static const ssize_t rar5_signature_size = sizeof(rar5_signature); -/* static const size_t g_unpack_buf_chunk_size = 1024; */ static const size_t g_unpack_window_size = 0x20000; +/* These could have been static const's, but they aren't, because of + * Visual Studio. */ +#define MAX_NAME_IN_CHARS 2048 +#define MAX_NAME_IN_BYTES (4 * MAX_NAME_IN_CHARS) + struct file_header { - ssize_t bytes_remaining; - ssize_t unpacked_size; - int64_t last_offset; /* Used in sanity checks. */ - int64_t last_size; /* Used in sanity checks. */ + ssize_t bytes_remaining; + ssize_t unpacked_size; + int64_t last_offset; /* Used in sanity checks. */ + int64_t last_size; /* Used in sanity checks. */ - uint8_t solid : 1; /* Is this a solid stream? */ - uint8_t service : 1; /* Is this file a service data? */ - uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t solid : 1; /* Is this a solid stream? */ + uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ + uint8_t dir : 1; /* Is this file entry a directory? */ - /* Optional time fields. */ - uint64_t e_mtime; - uint64_t e_ctime; - uint64_t e_atime; - uint32_t e_unix_ns; + /* Optional time fields. */ + uint64_t e_mtime; + uint64_t e_ctime; + uint64_t e_atime; + uint32_t e_unix_ns; - /* Optional hash fields. */ - uint32_t stored_crc32; - uint32_t calculated_crc32; - uint8_t blake2sp[32]; - blake2sp_state b2state; - char has_blake2; + /* Optional hash fields. */ + uint32_t stored_crc32; + uint32_t calculated_crc32; + uint8_t blake2sp[32]; + blake2sp_state b2state; + char has_blake2; + + /* Optional redir fields */ + uint64_t redir_type; + uint64_t redir_flags; }; +enum EXTRA { + EX_CRYPT = 0x01, + EX_HASH = 0x02, + EX_HTIME = 0x03, + EX_VERSION = 0x04, + EX_REDIR = 0x05, + EX_UOWNER = 0x06, + EX_SUBDATA = 0x07 +}; + +#define REDIR_SYMLINK_IS_DIR 1 + +enum REDIR_TYPE { + REDIR_TYPE_NONE = 0, + REDIR_TYPE_UNIXSYMLINK = 1, + REDIR_TYPE_WINSYMLINK = 2, + REDIR_TYPE_JUNCTION = 3, + REDIR_TYPE_HARDLINK = 4, + REDIR_TYPE_FILECOPY = 5, +}; + +#define OWNER_USER_NAME 0x01 +#define OWNER_GROUP_NAME 0x02 +#define OWNER_USER_UID 0x04 +#define OWNER_GROUP_GID 0x08 +#define OWNER_MAXNAMELEN 256 + enum FILTER_TYPE { - FILTER_DELTA = 0, /* Generic pattern. */ - FILTER_E8 = 1, /* Intel x86 code. */ - FILTER_E8E9 = 2, /* Intel x86 code. */ - FILTER_ARM = 3, /* ARM code. */ - FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ - FILTER_RGB = 5, /* Color palette, not used in RARv5. */ - FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ - FILTER_PPM = 7, /* Predictive pattern matching, not used in RARv5. */ - FILTER_NONE = 8, + FILTER_DELTA = 0, /* Generic pattern. */ + FILTER_E8 = 1, /* Intel x86 code. */ + FILTER_E8E9 = 2, /* Intel x86 code. */ + FILTER_ARM = 3, /* ARM code. */ + FILTER_AUDIO = 4, /* Audio filter, not used in RARv5. */ + FILTER_RGB = 5, /* Color palette, not used in RARv5. */ + FILTER_ITANIUM = 6, /* Intel's Itanium, not used in RARv5. */ + FILTER_PPM = 7, /* Predictive pattern matching, not used in + RARv5. */ + FILTER_NONE = 8, }; struct filter_info { - int type; - int channels; - int pos_r; + int type; + int channels; + int pos_r; - int64_t block_start; - ssize_t block_length; - uint16_t width; + int64_t block_start; + ssize_t block_length; + uint16_t width; }; struct data_ready { - char used; - const uint8_t* buf; - size_t size; - int64_t offset; + char used; + const uint8_t* buf; + size_t size; + int64_t offset; }; struct cdeque { - uint16_t beg_pos; - uint16_t end_pos; - uint16_t cap_mask; - uint16_t size; - size_t* arr; + uint16_t beg_pos; + uint16_t end_pos; + uint16_t cap_mask; + uint16_t size; + size_t* arr; }; struct decode_table { - uint32_t size; - int32_t decode_len[16]; - uint32_t decode_pos[16]; - uint32_t quick_bits; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 20 16:00:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A118F15B10D7; Mon, 20 May 2019 16:00:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48A4384740; Mon, 20 May 2019 16:00:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F00320700; Mon, 20 May 2019 16:00:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KG0XH1003963; Mon, 20 May 2019 16:00:33 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KG0WVI003962; Mon, 20 May 2019 16:00:33 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201905201600.x4KG0WVI003962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 20 May 2019 16:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347992 - head/gnu/usr.bin/binutils X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/gnu/usr.bin/binutils X-SVN-Commit-Revision: 347992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48A4384740 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 16:00:33 -0000 Author: luporl Date: Mon May 20 16:00:32 2019 New Revision: 347992 URL: https://svnweb.freebsd.org/changeset/base/347992 Log: [PPC] Enable build/install of ld.bfd on base When using LLVM+clang+lld on PowerPC64, ld.bfd is also needed, to link 32-bit binaries correctly, as lld support for 32-bit is still minimal. This change enables it to be built and installed when lld is used. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20259 Modified: head/gnu/usr.bin/binutils/Makefile Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Mon May 20 15:58:44 2019 (r347991) +++ head/gnu/usr.bin/binutils/Makefile Mon May 20 16:00:32 2019 (r347992) @@ -13,7 +13,9 @@ SUBDIR.${MK_BINUTILS}+= objdump # When we use ld.lld as /usr/bin/ld, do not install the non-ifunc-capable # GNU binutils 2.17.50 ld. -.if ${MK_LLD_IS_LD} == "no" +# Except if we are on powerpc, that needs the ld from binutils to link +# 32-bit binaries. +.if ${MK_LLD_IS_LD} == "no" || ${TARGET} == "powerpc" SUBDIR.${MK_BINUTILS}+=ld .endif From owner-svn-src-all@freebsd.org Mon May 20 16:31:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AD6915B1EB5; Mon, 20 May 2019 16:31:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBF0A86150; Mon, 20 May 2019 16:31:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5B0020D8C; Mon, 20 May 2019 16:31:47 +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 x4KGVlp1019491; Mon, 20 May 2019 16:31:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KGVkKp019484; Mon, 20 May 2019 16:31:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905201631.x4KGVkKp019484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 May 2019 16:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347995 - in stable/11: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: sys/sys usr.bin/ipcrm usr.bin/ipcs X-SVN-Commit-Revision: 347995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBF0A86150 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 16:31:48 -0000 Author: kib Date: Mon May 20 16:31:45 2019 New Revision: 347995 URL: https://svnweb.freebsd.org/changeset/base/347995 Log: MFC r329348 (by brooks): Get rid of the requirement to include SysV IPC headers with _KERNEL defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines. MFC r329390 (by lwhsu): Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC headers with _KERNEL. Sponsored by: Mellanox Technologies Approved by: re (gjb) Modified: stable/11/sys/sys/ipc.h stable/11/sys/sys/msg.h stable/11/sys/sys/sem.h stable/11/sys/sys/shm.h stable/11/usr.bin/ipcrm/ipcrm.c stable/11/usr.bin/ipcs/ipc.c stable/11/usr.bin/ipcs/ipc.h stable/11/usr.bin/ipcs/ipcs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ipc.h ============================================================================== --- stable/11/sys/sys/ipc.h Mon May 20 16:23:35 2019 (r347994) +++ stable/11/sys/sys/ipc.h Mon May 20 16:31:45 2019 (r347995) @@ -117,12 +117,14 @@ struct ipc_perm { #define IPC_INFO 3 /* get info */ #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_SYSVIPC_INTERNALS) /* Macros to convert between ipc ids and array indices or sequence ids */ #define IPCID_TO_IX(id) ((id) & 0xffff) #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) +#endif +#ifdef _KERNEL struct thread; struct proc; struct vmspace; Modified: stable/11/sys/sys/msg.h ============================================================================== --- stable/11/sys/sys/msg.h Mon May 20 16:23:35 2019 (r347994) +++ stable/11/sys/sys/msg.h Mon May 20 16:31:45 2019 (r347995) @@ -25,6 +25,9 @@ #include #include +#ifdef _WANT_SYSVMSG_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include /* @@ -116,7 +119,6 @@ struct mymsg { #endif #ifdef _KERNEL - struct msg { struct msg *msg_next; /* next msg in the chain */ long msg_type; /* type of this message */ @@ -126,7 +128,9 @@ struct msg { short msg_spot; /* location of start of msg in buffer */ struct label *label; /* MAC Framework label */ }; +#endif +#if defined(_KERNEL) || defined(_WANT_SYSVMSG_INTERNALS) /* * Based on the configuration parameters described in an SVR2 (yes, two) * config(1m) man page. @@ -145,7 +149,6 @@ struct msginfo { msgssz, /* size of a message segment (see notes above) */ msgseg; /* number of message segments */ }; -extern struct msginfo msginfo; /* * Kernel wrapper for the user-level structure. @@ -162,10 +165,13 @@ struct msqid_kernel { struct label *label; /* MAC label */ struct ucred *cred; /* creator's credentials */ }; +#endif -#endif /* _KERNEL */ +#ifdef _KERNEL +extern struct msginfo msginfo; -#if !defined(_KERNEL) || defined(_WANT_MSG_PROTOTYPES) +#else /* _KERNEL */ + __BEGIN_DECLS int msgctl(int, int, struct msqid_ds *); int msgget(key_t, int); @@ -176,7 +182,6 @@ int msgsnd(int, const void *, size_t, int); int msgsys(int, ...); #endif __END_DECLS - -#endif /* !_KERNEL || _WANT_MSG_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_MSG_H_ */ Modified: stable/11/sys/sys/sem.h ============================================================================== --- stable/11/sys/sys/sem.h Mon May 20 16:23:35 2019 (r347994) +++ stable/11/sys/sys/sem.h Mon May 20 16:31:45 2019 (r347995) @@ -10,6 +10,9 @@ #ifndef _SYS_SEM_H_ #define _SYS_SEM_H_ +#ifdef _WANT_SYSVSEM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #ifndef _PID_T_DECLARED @@ -101,8 +104,7 @@ union semun { #define SEM_A IPC_W /* alter permission */ #define SEM_R IPC_R /* read permission */ -#ifdef _KERNEL - +#if defined(_KERNEL) || defined(_WANT_SYSVSEM_INTERNALS) /* * semaphore info struct */ @@ -117,7 +119,6 @@ struct seminfo { semvmx, /* semaphore maximum value */ semaem; /* adjust on exit max value */ }; -extern struct seminfo seminfo; /* * Kernel wrapper for the user-level structure @@ -131,15 +132,17 @@ struct semid_kernel { /* internal "mode" bits */ #define SEM_ALLOC 01000 /* semaphore is allocated */ #define SEM_DEST 02000 /* semaphore will be destroyed on last detach */ +#endif +#ifdef _KERNEL +extern struct seminfo seminfo; /* * Process sem_undo vectors at proc exit. */ void semexit(struct proc *p); -#endif /* _KERNEL */ +#else /* !_KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SEM_PROTOTYPES) __BEGIN_DECLS #if __BSD_VISIBLE int semsys(int, ...); @@ -149,6 +152,6 @@ int semget(key_t, int, int); int semop(int, struct sembuf *, size_t); __END_DECLS -#endif /* !_KERNEL || _WANT_SEM_PROTOTYPES */ +#endif /* !_KERNEL */ #endif /* !_SYS_SEM_H_ */ Modified: stable/11/sys/sys/shm.h ============================================================================== --- stable/11/sys/sys/shm.h Mon May 20 16:23:35 2019 (r347994) +++ stable/11/sys/sys/shm.h Mon May 20 16:31:45 2019 (r347995) @@ -40,6 +40,9 @@ #define _SYS_SHM_H_ #include +#ifdef _WANT_SYSVSHM_INTERNALS +#define _WANT_SYSVIPC_INTERNALS +#endif #include #include @@ -104,9 +107,7 @@ struct shmid_ds { time_t shm_ctime; /* time of last change by shmctl() */ }; -#ifdef _KERNEL -#include - +#if defined(_KERNEL) || defined(_WANT_SYSVSHM_INTERNALS) /* * System 5 style catch-all structure for shared memory constants that * might be of interest to user programs. Do we really want/need this? @@ -119,19 +120,20 @@ struct shminfo { u_long shmall; /* max amount of shared memory (pages) */ }; +struct vm_object; + /* * Add a kernel wrapper to the shmid_ds struct so that private info (like the * MAC label) can be added to it, without changing the user interface. */ struct shmid_kernel { struct shmid_ds u; - vm_object_t object; + struct vm_object *object; struct label *label; /* MAC label */ struct ucred *cred; /* creator's credendials */ }; +#endif -extern struct shminfo shminfo; - struct shm_info { int used_ids; unsigned long shm_tot; @@ -141,15 +143,17 @@ struct shm_info { unsigned long swap_successes; }; -struct thread; +#ifdef _KERNEL struct proc; struct vmspace; +extern struct shminfo shminfo; + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); -#endif /* _KERNEL */ -#if !defined(_KERNEL) || defined(_WANT_SHM_PROTOTYPES) +#else /* !_KERNEL */ + #include #ifndef _SIZE_T_DECLARED @@ -167,6 +171,6 @@ int shmctl(int, int, struct shmid_ds *); int shmdt(const void *); __END_DECLS -#endif /* _KERNEL || _WANT_SHM_PROTOTYPES */ +#endif /* _KERNEL */ #endif /* !_SYS_SHM_H_ */ Modified: stable/11/usr.bin/ipcrm/ipcrm.c ============================================================================== --- stable/11/usr.bin/ipcrm/ipcrm.c Mon May 20 16:23:35 2019 (r347994) +++ stable/11/usr.bin/ipcrm/ipcrm.c Mon May 20 16:31:45 2019 (r347995) @@ -36,14 +36,12 @@ __FBSDID("$FreeBSD$"); #include -#define _WANT_MSG_PROTOTYPES -#define _WANT_SEM_PROTOTYPES -#define _WANT_SHM_PROTOTYPES -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: stable/11/usr.bin/ipcs/ipc.c ============================================================================== --- stable/11/usr.bin/ipcs/ipc.c Mon May 20 16:23:35 2019 (r347994) +++ stable/11/usr.bin/ipcs/ipc.c Mon May 20 16:31:45 2019 (r347995) @@ -35,11 +35,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include Modified: stable/11/usr.bin/ipcs/ipc.h ============================================================================== --- stable/11/usr.bin/ipcs/ipc.h Mon May 20 16:23:35 2019 (r347994) +++ stable/11/usr.bin/ipcs/ipc.h Mon May 20 16:31:45 2019 (r347995) @@ -68,3 +68,6 @@ extern kvm_t *kd; extern struct semid_kernel *sema; extern struct msqid_kernel *msqids; extern struct shmid_kernel *shmsegs; +extern struct seminfo seminfo; +extern struct msginfo msginfo; +extern struct shminfo shminfo; Modified: stable/11/usr.bin/ipcs/ipcs.c ============================================================================== --- stable/11/usr.bin/ipcs/ipcs.c Mon May 20 16:23:35 2019 (r347994) +++ stable/11/usr.bin/ipcs/ipcs.c Mon May 20 16:31:45 2019 (r347995) @@ -32,11 +32,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL +#define _WANT_SYSVMSG_INTERNALS +#include +#define _WANT_SYSVSEM_INTERNALS #include +#define _WANT_SYSVSHM_INTERNALS #include -#include -#undef _KERNEL #include #include From owner-svn-src-all@freebsd.org Mon May 20 16:38:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BCF415B2173; Mon, 20 May 2019 16:38:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F03B086677; Mon, 20 May 2019 16:38: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C542520DD5; Mon, 20 May 2019 16:38: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 x4KGcCI3024667; Mon, 20 May 2019 16:38:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KGcC53024665; Mon, 20 May 2019 16:38:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905201638.x4KGcC53024665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 20 May 2019 16:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347996 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 347996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F03B086677 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 16:38:13 -0000 Author: ngie Date: Mon May 20 16:38:12 2019 New Revision: 347996 URL: https://svnweb.freebsd.org/changeset/base/347996 Log: Replace uses of `foo.(de|en)code('hex')` with `binascii.(un)?hexlify(foo)` Python 3 no longer doesn't support encoding/decoding hexadecimal numbers using the `str.format` method. The backwards compatible new method (using the binascii module/methods) is a comparable means of converting to/from hexadecimal format. In short, the functional change is the following: * `foo.decode('hex')` -> `binascii.unhexlify(foo)` * `foo.encode('hex')` -> `binascii.hexlify(foo)` While here, move the dpkt import in `cryptodev.py` down per PEP8, so it comes after the standard library provided imports. PR: 237403 MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Mon May 20 16:31:45 2019 (r347995) +++ head/tests/sys/opencrypto/cryptodev.py Mon May 20 16:38:12 2019 (r347996) @@ -32,7 +32,7 @@ from __future__ import print_function import array -import dpkt +import binascii from fcntl import ioctl import os import random @@ -40,6 +40,8 @@ import signal from struct import pack as _pack import time +import dpkt + from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] @@ -493,7 +495,7 @@ class KATCCMParser: def _spdechex(s): - return ''.join(s.split()).decode('hex') + return binascii.hexlify(''.join(s.split())) if __name__ == '__main__': if True: @@ -525,15 +527,15 @@ if __name__ == '__main__': c = Crypto(CRYPTO_AES_ICM, key) enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', binascii.hexlify(enc)) + print(' ct:', binascii.hexlify(ct)) assert ct == enc dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', binascii.hexlify(dec)) + print(' pt:', binascii.hexlify(pt)) assert pt == dec elif False: @@ -546,15 +548,15 @@ if __name__ == '__main__': c = Crypto(CRYPTO_AES_ICM, key) enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', binascii.hexlify(enc)) + print(' ct:', binascii.hexlify(ct)) assert ct == enc dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', binascii.hexlify(dec)) + print(' pt:', binascii.hexlify(pt)) assert pt == dec elif False: @@ -566,15 +568,15 @@ if __name__ == '__main__': enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', binascii.hexlify(enc)) + print(' ct:', binascii.hexlify(ct)) assert ct == enc dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', binascii.hexlify(dec)) + print(' pt:', binascii.hexlify(pt)) assert pt == dec elif False: @@ -592,26 +594,26 @@ if __name__ == '__main__': enc, enctag = c.encrypt(pt, iv, aad=aad) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', binascii.hexlify(enc)) + print(' ct:', binascii.hexlify(ct)) assert enc == ct - print('etg:', enctag.encode('hex')) - print('tag:', tag.encode('hex')) + print('etg:', binascii.hexlify(enctag)) + print('tag:', binascii.hexlify(tag)) assert enctag == tag # Make sure we get EBADMSG #enctag = enctag[:-1] + 'a' dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', binascii.hexlify(dec)) + print(' pt:', binascii.hexlify(pt)) assert dec == pt - print('dtg:', dectag.encode('hex')) - print('tag:', tag.encode('hex')) + print('dtg:', binascii.hexlify(dectag)) + print('tag:', binascii.hexlify(tag)) assert dectag == tag elif False: @@ -628,27 +630,27 @@ if __name__ == '__main__': enc, enctag = c.encrypt(pt, iv, aad=aad) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', binascii.hexlify(enc)) + print(' ct:', binascii.hexlify(ct)) assert enc == ct - print('etg:', enctag.encode('hex')) - print('tag:', tag.encode('hex')) + print('etg:', binascii.hexlify(enctag)) + print('tag:', binascii.hexlify(tag)) assert enctag == tag elif False: for i in range(100000): - c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')) - data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex') - ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex') + c = Crypto(CRYPTO_AES_XTS, binascii.unhexlify('1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382')) + data = binascii.unhexlify('52a42bca4e9425a25bbc8c8bf6129dec') + ct = binascii.unhexlify('517e602becd066b65fa4f4f56ddfe240') iv = _pack('QQ', 71, 0) enc = c.encrypt(data, iv) assert enc == ct elif True: - c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')) - data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex') - ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex') + c = Crypto(CRYPTO_AES_XTS, binascii.unhexlify('1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382')) + data = binascii.unhexlify('52a42bca4e9425a25bbc8c8bf6129dec') + ct = binascii.unhexlify('517e602becd066b65fa4f4f56ddfe240') iv = _pack('QQ', 71, 0) enc = c.encrypt(data, iv) @@ -660,7 +662,7 @@ if __name__ == '__main__': #c.perftest(COP_ENCRYPT, 192*1024, reps=30000) else: - key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex') + key = binascii.unhexlify('1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382') print('XTS %d testing:' % (len(key) * 8)) c = Crypto(CRYPTO_AES_XTS, key) for i in [ 8192, 192*1024]: Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Mon May 20 16:31:45 2019 (r347995) +++ head/tests/sys/opencrypto/cryptotest.py Mon May 20 16:38:12 2019 (r347996) @@ -30,6 +30,8 @@ # from __future__ import print_function + +import binascii import errno import cryptodev import itertools @@ -106,13 +108,13 @@ def GenTestCase(cname): [ 'Count', 'Key', 'IV', 'CT', 'AAD', 'Tag', 'PT', ]): for data in lines: curcnt = int(data['Count']) - cipherkey = data['Key'].decode('hex') - iv = data['IV'].decode('hex') - aad = data['AAD'].decode('hex') - tag = data['Tag'].decode('hex') + cipherkey = binascii.unhexlify(data['Key']) + iv = binascii.unhexlify(data['IV']) + aad = binascii.unhexlify(data['AAD']) + tag = binascii.unhexlify(data['Tag']) if 'FAIL' not in data: - pt = data['PT'].decode('hex') - ct = data['CT'].decode('hex') + pt = binascii.unhexlify(data['PT']) + ct = binascii.unhexlify(data['CT']) if len(iv) != 12: # XXX - isn't supported @@ -139,8 +141,8 @@ def GenTestCase(cname): raise continue rtag = rtag[:len(tag)] - data['rct'] = rct.encode('hex') - data['rtag'] = rtag.encode('hex') + data['rct'] = binascii.hexlify(rct) + data['rtag'] = binascii.hexlify(rtag) self.assertEqual(rct, ct, repr(data)) self.assertEqual(rtag, tag, repr(data)) else: @@ -158,8 +160,8 @@ def GenTestCase(cname): if e.errno != errno.EINVAL: raise continue - data['rpt'] = rpt.encode('hex') - data['rtag'] = rtag.encode('hex') + data['rpt'] = binascii.hexlify(rpt) + data['rtag'] = binascii.hexlify(rtag) self.assertEqual(rpt, pt, repr(data)) @@ -178,10 +180,10 @@ def GenTestCase(cname): for data in lines: curcnt = int(data['COUNT']) - cipherkey = data['KEY'].decode('hex') - iv = data['IV'].decode('hex') - pt = data['PLAINTEXT'].decode('hex') - ct = data['CIPHERTEXT'].decode('hex') + cipherkey = binascii.unhexlify(data['KEY']) + iv = binascii.unhexlify(data['IV']) + pt = binascii.unhexlify(data['PLAINTEXT']) + ct = binascii.unhexlify(data['CIPHERTEXT']) if swapptct: pt, ct = ct, pt @@ -207,10 +209,10 @@ def GenTestCase(cname): for data in lines: curcnt = int(data['COUNT']) nbits = int(data['DataUnitLen']) - cipherkey = data['Key'].decode('hex') + cipherkey = binascii.unhexlify(data['Key']) iv = struct.pack('QQ', int(data['DataUnitSeqNumber']), 0) - pt = data['PT'].decode('hex') - ct = data['CT'].decode('hex') + pt = binascii.unhexlify(data['PT']) + ct = binascii.unhexlify(data['CT']) if nbits % 128 != 0: # XXX - mark as skipped @@ -234,15 +236,15 @@ def GenTestCase(cname): if Nlen != 12: # OCF only supports 12 byte IVs continue - key = data['Key'].decode('hex') - nonce = data['Nonce'].decode('hex') + key = binascii.unhexlify(data['Key']) + nonce = binascii.unhexlify(data['Nonce']) Alen = int(data['Alen']) if Alen != 0: - aad = data['Adata'].decode('hex') + aad = binascii.unhexlify(data['Adata']) else: aad = None - payload = data['Payload'].decode('hex') - ct = data['CT'].decode('hex') + payload = binascii.unhexlify(data['Payload']) + ct = binascii.unhexlify(data['CT']) try: c = Crypto(crid=crid, @@ -277,14 +279,14 @@ def GenTestCase(cname): if Tlen != 16: # OCF only supports 16 byte tags continue - key = data['Key'].decode('hex') - nonce = data['Nonce'].decode('hex') + key = binascii.unhexlify(data['Key']) + nonce = binascii.unhexlify(data['Nonce']) Alen = int(data['Alen']) if Alen != 0: - aad = data['Adata'].decode('hex') + aad = binascii.unhexlify(data['Adata']) else: aad = None - ct = data['CT'].decode('hex') + ct = binascii.unhexlify(data['CT']) tag = ct[-16:] ct = ct[:-16] @@ -306,7 +308,7 @@ def GenTestCase(cname): r = Crypto.decrypt(c, payload, nonce, aad, tag) - payload = data['Payload'].decode('hex') + payload = binascii.unhexlify(data['Payload']) plen = int(data('Plen')) payload = payload[:plen] self.assertEqual(r, payload, @@ -339,10 +341,10 @@ def GenTestCase(cname): for data in lines: curcnt = int(data['COUNT']) key = data['KEYs'] * 3 - cipherkey = key.decode('hex') - iv = data['IV'].decode('hex') - pt = data['PLAINTEXT'].decode('hex') - ct = data['CIPHERTEXT'].decode('hex') + cipherkey = binascii.unhexlify(key) + iv = binascii.unhexlify(data['IV']) + pt = binascii.unhexlify(data['PLAINTEXT']) + ct = binascii.unhexlify(data['CIPHERTEXT']) if swapptct: pt, ct = ct, pt @@ -387,9 +389,9 @@ def GenTestCase(cname): continue for data in lines: - msg = data['Msg'].decode('hex') + msg = binascii.unhexlify(data['Msg']) msg = msg[:int(data['Len'])] - md = data['MD'].decode('hex') + md = binascii.unhexlify(data['MD']) try: c = Crypto(mac=alg, crid=crid, @@ -440,9 +442,9 @@ def GenTestCase(cname): continue for data in lines: - key = data['Key'].decode('hex') - msg = data['Msg'].decode('hex') - mac = data['Mac'].decode('hex') + key = binascii.unhexlify(data['Key']) + msg = binascii.unhexlify(data['Msg']) + mac = binascii.unhexlify(data['Mac']) tlen = int(data['Tlen']) if len(key) > blocksize: From owner-svn-src-all@freebsd.org Mon May 20 17:43:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFF9815B3E89; Mon, 20 May 2019 17:43:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6542189505; Mon, 20 May 2019 17:43:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FAD021996; Mon, 20 May 2019 17:43:59 +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 x4KHhxAq061645; Mon, 20 May 2019 17:43:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KHhxYU061644; Mon, 20 May 2019 17:43:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905201743.x4KHhxYU061644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 20 May 2019 17:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347998 - head/sys/mips/mediatek X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/mediatek X-SVN-Commit-Revision: 347998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6542189505 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 17:44:00 -0000 Author: adrian Date: Mon May 20 17:43:58 2019 New Revision: 347998 URL: https://svnweb.freebsd.org/changeset/base/347998 Log: [mediatek] Add support for non-flash devices on the SPI bus of the Mediatek SoCs. The existing SPI support only worked for directly attached flash chips. it didn't implement clock programming or chipselect. It also supports transfers with unbalanced tx/rx command sizes. Submitted by: Differential Revision: https://reviews.freebsd.org/D20101 Modified: head/sys/mips/mediatek/mtk_spi_v1.c Modified: head/sys/mips/mediatek/mtk_spi_v1.c ============================================================================== --- head/sys/mips/mediatek/mtk_spi_v1.c Mon May 20 16:39:31 2019 (r347997) +++ head/sys/mips/mediatek/mtk_spi_v1.c Mon May 20 17:43:58 2019 (r347998) @@ -43,6 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include "gpiobus_if.h" + +#include + #include #include #include "spibus_if.h" @@ -53,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -81,6 +87,8 @@ __FBSDID("$FreeBSD$"); struct mtk_spi_softc { device_t sc_dev; struct resource *sc_mem_res; + struct gpiobus_pin *gpio_cs; + int nonflash; }; static int mtk_spi_probe(device_t); @@ -127,7 +135,7 @@ mtk_spi_attach(device_t dev) sc->sc_dev = dev; rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); + RF_SHAREABLE | RF_ACTIVE); if (!sc->sc_mem_res) { device_printf(dev, "Could not map memory\n"); return (ENXIO); @@ -138,14 +146,20 @@ mtk_spi_attach(device_t dev) return (EBUSY); } - SPI_WRITE(sc, MTK_SPICFG, MSBFIRST | SPICLKPOL | TX_ON_CLK_FALL | - SPI_CLK_DIV8); /* XXX: make it configurable */ - /* - * W25Q64CV max 104MHz, bus 120-192 MHz, so divide by 2. - * Update: divide by 4, DEV2 to fast for flash. - */ + if (ofw_bus_has_prop(dev, "non-flash")) + sc->nonflash = 1; + else + sc->nonflash = 0; - device_add_child(dev, "spibus", 0); + ofw_gpiobus_parse_gpios(dev, "cs-gpios", &sc->gpio_cs); + + if (sc->gpio_cs != NULL) { + GPIO_PIN_SETFLAGS(sc->gpio_cs->dev, sc->gpio_cs->pin, + GPIO_PIN_OUTPUT); + GPIO_PIN_SET(sc->gpio_cs->dev, sc->gpio_cs->pin, 1); + } + + device_add_child(dev, "spibus", -1); return (bus_generic_attach(dev)); } @@ -169,7 +183,12 @@ mtk_spi_chip_activate(struct mtk_spi_softc *sc) /* * Put all CSx to low */ - SPI_CLEAR_BITS(sc, MTK_SPICTL, CS_HIGH | HIZSMOSI); + if (sc->gpio_cs != NULL) { + GPIO_PIN_SET(sc->gpio_cs->dev, sc->gpio_cs->pin, 0); + SPI_CLEAR_BITS(sc, MTK_SPICTL, HIZSMOSI); + } else { + SPI_CLEAR_BITS(sc, MTK_SPICTL, CS_HIGH | HIZSMOSI); + } } static void @@ -179,7 +198,12 @@ mtk_spi_chip_deactivate(struct mtk_spi_softc *sc) /* * Put all CSx to high */ - SPI_SET_BITS(sc, MTK_SPICTL, CS_HIGH | HIZSMOSI); + if (sc->gpio_cs != NULL) { + GPIO_PIN_SET(sc->gpio_cs->dev, sc->gpio_cs->pin, 1); + SPI_SET_BITS(sc, MTK_SPICTL, HIZSMOSI); + } else { + SPI_SET_BITS(sc, MTK_SPICTL, CS_HIGH | HIZSMOSI); + } } static int @@ -224,12 +248,15 @@ mtk_spi_transfer(device_t dev, device_t child, struct { struct mtk_spi_softc *sc; uint8_t *buf, byte, *tx_buf; - uint32_t cs; + uint32_t cs, clock, mode; int i, sz, error = 0, write = 0; + int div, clk, cfgreg; sc = device_get_softc(dev); spibus_get_cs(child, &cs); + spibus_get_clock(child, &clock); + spibus_get_mode(child, &mode); cs &= ~SPIBUS_CS_HIGH; @@ -237,44 +264,80 @@ mtk_spi_transfer(device_t dev, device_t child, struct /* Only 1 CS */ return (ENXIO); - /* There is always a command to transfer. */ - tx_buf = (uint8_t *)(cmd->tx_cmd); - - /* Perform some fixup because MTK dont support duplex SPI */ - switch(tx_buf[0]) { - case CMD_READ_IDENT: - cmd->tx_cmd_sz = 1; - cmd->rx_cmd_sz = 3; + cfgreg = MSBFIRST; + switch(mode) { + case 0: /* This is workadound because of + mode 0 not work this soc. */ + case 3: + cfgreg |= SPICLKPOL | TX_ON_CLK_FALL; break; - case CMD_ENTER_4B_MODE: - case CMD_EXIT_4B_MODE: - case CMD_WRITE_ENABLE: - case CMD_WRITE_DISABLE: - cmd->tx_cmd_sz = 1; - cmd->rx_cmd_sz = 0; + case 1: + cfgreg |= TX_ON_CLK_FALL; break; - case CMD_READ_STATUS: - cmd->tx_cmd_sz = 1; - cmd->rx_cmd_sz = 1; + case 2: + cfgreg |= CAPT_ON_CLK_FALL; break; - case CMD_READ: - case CMD_FAST_READ: - cmd->rx_cmd_sz = cmd->tx_data_sz = 0; - break; - case CMD_SECTOR_ERASE: - cmd->rx_cmd_sz = 0; - break; - case CMD_PAGE_PROGRAM: - cmd->rx_cmd_sz = cmd->rx_data_sz = 0; - break; - } + } + + /* + * W25Q64CV max 104MHz, bus 120-192 MHz, so divide by 2. + * Update: divide by 4, DEV2 to fast for flash. + */ + if (clock != 0) { + div = (mtk_soc_get_cpuclk() + (clock - 1)) / clock; + clk = fls(div) - 2; + if (clk < 0) + clk = 0; + else if (clk > 6) + clk = 6; + } else { + clk = 6; + } + + SPI_WRITE(sc, MTK_SPICFG, cfgreg | clk); + + if (sc->nonflash == 0) { + /* There is always a command to transfer. */ + tx_buf = (uint8_t *)(cmd->tx_cmd); + + /* Perform some fixup because MTK dont support duplex SPI */ + switch(tx_buf[0]) { + case CMD_READ_IDENT: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 3; + break; + case CMD_ENTER_4B_MODE: + case CMD_EXIT_4B_MODE: + case CMD_WRITE_ENABLE: + case CMD_WRITE_DISABLE: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 0; + break; + case CMD_READ_STATUS: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 1; + break; + case CMD_READ: + case CMD_FAST_READ: + cmd->rx_cmd_sz = cmd->tx_data_sz = 0; + break; + case CMD_SECTOR_ERASE: + cmd->rx_cmd_sz = 0; + break; + case CMD_PAGE_PROGRAM: + cmd->rx_cmd_sz = cmd->rx_data_sz = 0; + break; + } + } mtk_spi_chip_activate(sc); if (cmd->tx_cmd_sz + cmd->rx_cmd_sz) { buf = (uint8_t *)(cmd->rx_cmd); tx_buf = (uint8_t *)(cmd->tx_cmd); - sz = cmd->tx_cmd_sz + cmd->rx_cmd_sz; + sz = cmd->tx_cmd_sz; + if (sc->nonflash == 0) + sz += cmd->rx_cmd_sz; for (i = 0; i < sz; i++) { if(i < cmd->tx_cmd_sz) { From owner-svn-src-all@freebsd.org Mon May 20 17:34:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF23315B3B80; Mon, 20 May 2019 17:34:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 0495688F64; Mon, 20 May 2019 17:34:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4KHY8Mk074765; Mon, 20 May 2019 10:34:08 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4KHY7wH074764; Mon, 20 May 2019 10:34:07 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905201734.x4KHY7wH074764@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib In-Reply-To: To: Warner Losh Date: Mon, 20 May 2019 10:34:07 -0700 (PDT) CC: Yoshihiro Ota , "Rodney W. Grimes" , "Rodney W. Grimes" , Benedict Reuschling , src-committers , svn-src-stable@freebsd.org, svn-src-all , svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov 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-Rspamd-Queue-Id: 0495688F64 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.955,0] X-Mailman-Approved-At: Mon, 20 May 2019 17:44:35 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 17:34:38 -0000 > On Sun, May 19, 2019 at 9:56 AM Yoshihiro Ota wrote: > > > I wonder if we can use a tool to confirm coding style like > > clang-format or something else. > > > > I don't know... it might be hard to do that inside a man page... Given the current tooling I concur, so we need .include for mandoc, and teach mandoc how to format example code which is mostly knows how to do, or atleast there was lots of groff code to do that. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 20 18:07:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEE815B46A3; Mon, 20 May 2019 18:07:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F28EF8A2BA; Mon, 20 May 2019 18:07:45 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C79E121CFF; Mon, 20 May 2019 18:07:45 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KI7jv9072282; Mon, 20 May 2019 18:07:45 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KI7jov072281; Mon, 20 May 2019 18:07:45 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905201807.x4KI7jov072281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 20 May 2019 18:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347999 - head/lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/libarchive/tests X-SVN-Commit-Revision: 347999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F28EF8A2BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 18:07:46 -0000 Author: lwhsu Date: Mon May 20 18:07:45 2019 New Revision: 347999 URL: https://svnweb.freebsd.org/changeset/base/347999 Log: Install missing data file for lib.libarchive.functional_test.test_read_format_zip_utf8_paths MFC after: 2 weeks (with r347989) Sponsored by: The FreeBSD Foundation Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Mon May 20 17:43:58 2019 (r347998) +++ head/lib/libarchive/tests/Makefile Mon May 20 18:07:45 2019 (r347999) @@ -557,6 +557,7 @@ ${PACKAGE}FILES+= test_read_format_ustar_filename_eucj ${PACKAGE}FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu ${PACKAGE}FILES+= test_read_format_warc.warc.uu ${PACKAGE}FILES+= test_read_format_zip.zip.uu +${PACKAGE}FILES+= test_read_format_zip_7075_utf8_paths.zip.uu ${PACKAGE}FILES+= test_read_format_zip_bz2_hang.zip.uu ${PACKAGE}FILES+= test_read_format_zip_bzip2.zipx.uu ${PACKAGE}FILES+= test_read_format_zip_bzip2_multi.zipx.uu From owner-svn-src-all@freebsd.org Mon May 20 18:15:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF6115B4E2F; Mon, 20 May 2019 18:15:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 15B228BF24; Mon, 20 May 2019 18:15:24 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4KIFM6H074972; Mon, 20 May 2019 11:15:22 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4KIFMw4074971; Mon, 20 May 2019 11:15:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905201815.x4KIFMw4074971@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347980 - head/lib/libsecureboot/openpgp In-Reply-To: <39068.1558342374@kaos.jnpr.net> To: "Simon J. Gerraty" Date: Mon, 20 May 2019 11:15:22 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 15B228BF24 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 18:15:25 -0000 > Rodney W. Grimes wrote: > > > Log: > > > load_key_buf do not free data from dearmor > > > > > > The data returned by dearmor is referenced by the key > > > leave it alone! > > > > > > Reviewed by: stevek > > > MFC after: 2 days > > > > This is an exception below the standard minimal limit during > > a code freeze, is there some reason for it? The next build > > should not be started before 3 days. > > Sorry,should I wait until after freeze? > This is all optional stuff anyway, so no great harm either way. No, please do merge this at 3 days, it is just that the normal minimum bake time in ^head is 3 days, freeze or not. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 20 18:35:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 905CC15B53C9; Mon, 20 May 2019 18:35:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 333DB8C8F2; Mon, 20 May 2019 18:35:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08C6922230; Mon, 20 May 2019 18:35:24 +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 x4KIZNI4091272; Mon, 20 May 2019 18:35:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KIZNZd091271; Mon, 20 May 2019 18:35:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905201835.x4KIZNZd091271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 20 May 2019 18:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348000 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 348000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 333DB8C8F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 18:35:24 -0000 Author: trasz Date: Mon May 20 18:35:23 2019 New Revision: 348000 URL: https://svnweb.freebsd.org/changeset/base/348000 Log: Improve tree(3) tests by using ATF_REQUIRE where applicable. MFC after: 2 weeks Sponsored by: Klara Inc. Modified: head/tests/sys/sys/rb_test.c head/tests/sys/sys/splay_test.c Modified: head/tests/sys/sys/rb_test.c ============================================================================== --- head/tests/sys/sys/rb_test.c Mon May 20 18:07:45 2019 (r347999) +++ head/tests/sys/sys/rb_test.c Mon May 20 18:35:23 2019 (r348000) @@ -69,7 +69,7 @@ ATF_TC_BODY(rb_test, tc) for (i = 0; i < ITER; i++) { tmp = malloc(sizeof(struct node)); - ATF_CHECK_MSG(tmp != NULL, "malloc failed"); + ATF_REQUIRE_MSG(tmp != NULL, "malloc failed"); do { tmp->key = arc4random_uniform(MAX-MIN); tmp->key += MIN; @@ -82,20 +82,22 @@ ATF_TC_BODY(rb_test, tc) if (tmp->key < min) min = tmp->key; } - ATF_CHECK_EQ(NULL, RB_INSERT(tree, &root, tmp)); + ATF_REQUIRE_EQ(NULL, RB_INSERT(tree, &root, tmp)); } ins = RB_MIN(tree, &root); + ATF_REQUIRE_MSG(ins != NULL, "RB_MIN error"); ATF_CHECK_EQ(min, ins->key); tmp = ins; ins = RB_MAX(tree, &root); + ATF_REQUIRE_MSG(ins != NULL, "RB_MAX error"); ATF_CHECK_EQ(max, ins->key); ATF_CHECK_EQ(tmp, RB_REMOVE(tree, &root, tmp)); for (i = 0; i < ITER - 1; i++) { tmp = RB_ROOT(&root); - ATF_CHECK_MSG(tmp != NULL, "RB_ROOT error"); + ATF_REQUIRE_MSG(tmp != NULL, "RB_ROOT error"); ATF_CHECK_EQ(tmp, RB_REMOVE(tree, &root, tmp)); free(tmp); } Modified: head/tests/sys/sys/splay_test.c ============================================================================== --- head/tests/sys/sys/splay_test.c Mon May 20 18:07:45 2019 (r347999) +++ head/tests/sys/sys/splay_test.c Mon May 20 18:35:23 2019 (r348000) @@ -69,7 +69,7 @@ ATF_TC_BODY(splay_test, tc) for (i = 0; i < ITER; i++) { tmp = malloc(sizeof(struct node)); - ATF_CHECK_MSG(tmp != NULL, "malloc failed"); + ATF_REQUIRE_MSG(tmp != NULL, "malloc failed"); do { tmp->key = arc4random_uniform(MAX-MIN); tmp->key += MIN; @@ -82,20 +82,22 @@ ATF_TC_BODY(splay_test, tc) if (tmp->key < min) min = tmp->key; } - ATF_CHECK_EQ(NULL, SPLAY_INSERT(tree, &root, tmp)); + ATF_REQUIRE_EQ(NULL, SPLAY_INSERT(tree, &root, tmp)); } ins = SPLAY_MIN(tree, &root); + ATF_REQUIRE_MSG(ins != NULL, "SPLAY_MIN error"); ATF_CHECK_EQ(min, ins->key); tmp = ins; ins = SPLAY_MAX(tree, &root); + ATF_REQUIRE_MSG(ins != NULL, "SPLAY_MAX error"); ATF_CHECK_EQ(max, ins->key); ATF_CHECK_EQ(tmp, SPLAY_REMOVE(tree, &root, tmp)); for (i = 0; i < ITER - 1; i++) { tmp = SPLAY_ROOT(&root); - ATF_CHECK_MSG(tmp != NULL, "SPLAY_ROOT error"); + ATF_REQUIRE_MSG(tmp != NULL, "SPLAY_ROOT error"); ATF_CHECK_EQ(tmp, SPLAY_REMOVE(tree, &root, tmp)); free(tmp); } From owner-svn-src-all@freebsd.org Mon May 20 18:41:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FA2215B564A; Mon, 20 May 2019 18:41:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 025AF8CBCF; Mon, 20 May 2019 18:41:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C2822280; Mon, 20 May 2019 18:41:07 +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 x4KIf7uk091576; Mon, 20 May 2019 18:41:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KIf7eD091575; Mon, 20 May 2019 18:41:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905201841.x4KIf7eD091575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 May 2019 18:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348001 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 025AF8CBCF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 18:41:08 -0000 Author: emaste Date: Mon May 20 18:41:07 2019 New Revision: 348001 URL: https://svnweb.freebsd.org/changeset/base/348001 Log: muge: configure LEDs per dtb (for Raspberry Pi 3B+) Also apply some style(9) and remove the message about EEPROM configuration (if there's an EEPROM the hardware handles LED configuration itself). PR: 237325 Reviewed by: ian MFC after: 2 weeks Submitted by: Ralf Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 18:35:23 2019 (r348000) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 18:41:07 2019 (r348001) @@ -173,6 +173,7 @@ struct muge_softc { struct mtx sc_mtx; struct usb_xfer *sc_xfer[MUGE_N_TRANSFER]; int sc_phyno; + uint32_t sc_leds; /* Settings for the mac control (MAC_CSR) register. */ uint32_t sc_rfe_ctl; @@ -891,6 +892,7 @@ lan78xx_phy_init(struct muge_softc *sc) muge_dbg_printf(sc, "Initializing PHY.\n"); uint16_t bmcr; usb_ticks_t start_ticks; + uint32_t hw_reg; const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); MUGE_LOCK_ASSERT(sc, MA_OWNED); @@ -931,6 +933,15 @@ lan78xx_phy_init(struct muge_softc *sc) bmcr |= BMCR_AUTOEN; lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, bmcr); bmcr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); + + /* Enable appropriate LEDs. */ + if (sc->sc_leds != 0 && + lan78xx_read_reg(sc, ETH_HW_CFG, &hw_reg) == 0) { + hw_reg &= ~(ETH_HW_CFG_LEDO_EN_ | ETH_HW_CFG_LED1_EN_ | + ETH_HW_CFG_LED2_EN_ | ETH_HW_CFG_LED3_EN_ ); + hw_reg |= sc->sc_leds; + lan78xx_write_reg(sc, ETH_HW_CFG, hw_reg); + } return (0); } @@ -1523,6 +1534,37 @@ muge_fdt_find_mac(const char *compatible, unsigned cha return (ENXIO); } + +/** + * muge_fdt_count_led_modes - read number of LED modes from node + * @compatible: compatible string for DTB node in the form + * "usb[N]NNN,[M]MMM" + * where NNN is vendor id and MMM is product id + * @amount: memory to store number of LED entries to + * + * Tries to find matching node in DTS and obtain number of entries from it. + * + * RETURNS: + * Returns 0 on success, error code otherwise + */ +static int +muge_fdt_count_led_modes(struct muge_softc *sc, const char *compatible, + uint32_t *amount) +{ + phandle_t node, root; + ssize_t proplen; + + *amount = 0; + root = OF_finddevice("/"); + node = muge_fdt_find_eth_node(root, compatible); + if (node != -1 && + (proplen = OF_getproplen(node, "microchip,led-modes")) > 0) { + *amount = proplen / sizeof( uint32_t ); + return (0); + } + + return (ENXIO); +} #endif /** @@ -1591,6 +1633,41 @@ muge_set_mac_addr(struct usb_ether *ue) } /** + * muge_set_leds - Initializes NIC LEDs pattern + * @ue: the USB ethernet device + * + * Tries to store the LED modes. + * Supports only DTB blob like the Linux driver does. + */ +static void +muge_set_leds(struct usb_ether *ue) +{ + struct muge_softc *sc = uether_getsc(ue); +#ifdef FDT + char compatible[16]; + struct usb_attach_arg *uaa = device_get_ivars(ue->ue_dev); + uint32_t count; +#endif + + sc->sc_leds = 0; /* no LED mode is set */ + if (lan78xx_eeprom_present(sc)) + return; +#ifdef FDT + snprintf(compatible, sizeof(compatible), "usb%x,%x", + uaa->info.idVendor, uaa->info.idProduct); + if (muge_fdt_count_led_modes(sc, compatible, &count) == 0) { + sc->sc_leds = (count > 0) * ETH_HW_CFG_LEDO_EN_ | + (count > 1) * ETH_HW_CFG_LED1_EN_ | + (count > 2) * ETH_HW_CFG_LED2_EN_ | + (count > 3) * ETH_HW_CFG_LED3_EN_; + muge_dbg_printf(sc, "LED modes set from FDT blob\n"); + return; + } +#endif + muge_dbg_printf(sc, "LED configuration not available\n"); +} + +/** * muge_attach_post - Called after the driver attached to the USB interface * @ue: the USB ethernet device * @@ -1610,6 +1687,7 @@ muge_attach_post(struct usb_ether *ue) sc->sc_phyno = 1; muge_set_mac_addr(ue); + muge_set_leds(ue); /* Initialise the chip for the first time */ lan78xx_chip_init(sc); From owner-svn-src-all@freebsd.org Mon May 20 19:08:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68626158F544; Mon, 20 May 2019 19:08:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07A1F8DC61; Mon, 20 May 2019 19:08:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D500B2276C; Mon, 20 May 2019 19:08:55 +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 x4KJ8tVQ007074; Mon, 20 May 2019 19:08:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJ8tO9007073; Mon, 20 May 2019 19:08:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905201908.x4KJ8tO9007073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 May 2019 19:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348002 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07A1F8DC61 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:08:56 -0000 Author: markj Date: Mon May 20 19:08:55 2019 New Revision: 348002 URL: https://svnweb.freebsd.org/changeset/base/348002 Log: Typo. MFC after: 3 days Modified: head/share/man/man9/DRIVER_MODULE.9 Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Mon May 20 18:41:07 2019 (r348001) +++ head/share/man/man9/DRIVER_MODULE.9 Mon May 20 19:08:55 2019 (r348002) @@ -125,7 +125,7 @@ macro allows a driver to be registered for a specific The boot time probe and attach process makes multiple passes over the device tree. Certain critical drivers that provide basic services needed by other -devices are attach during earlier passes. +devices are attached during earlier passes. Most drivers are attached in a final general pass. A driver that attaches during an early pass must register for a specific pass level From owner-svn-src-all@freebsd.org Mon May 20 19:12:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F1C6158F84A; Mon, 20 May 2019 19:12:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93DC58E06D; Mon, 20 May 2019 19:12:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7967B2290E; Mon, 20 May 2019 19:12:29 +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 x4KJCTcX012080; Mon, 20 May 2019 19:12:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJCTUT012079; Mon, 20 May 2019 19:12:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905201912.x4KJCTUT012079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 May 2019 19:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348003 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93DC58E06D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:12:30 -0000 Author: markj Date: Mon May 20 19:12:29 2019 New Revision: 348003 URL: https://svnweb.freebsd.org/changeset/base/348003 Log: Add a man page for DEFINE_IFUNC. Reviewed by: kib Discussed with: emaste MFC after: 2 weeks Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20310 Added: head/share/man/man9/DEFINE_IFUNC.9 (contents, props changed) Added: head/share/man/man9/DEFINE_IFUNC.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/DEFINE_IFUNC.9 Mon May 20 19:12:29 2019 (r348003) @@ -0,0 +1,143 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation +.\" +.\" This documentation was written by Mark Johnston +.\" under sponsorship from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 18, 2019 +.Dt DEFINE_IFUNC 9 +.Os +.Sh NAME +.Nm DEFINE_IFUNC +.Nd define a kernel function with an implementation selected at run-time +.Sh SYNOPSIS +.In machine/ifunc.h +.Fn DEFINE_IFUNC qual ret_type name args +.Sh DESCRIPTION +ifuncs are a linker feature which allows the programmer to define functions +whose implementation is selected at boot-time or module load-time. +The +.Nm +macro can be used to define an ifunc. +The selection is performed by a resolver function, which returns a pointer +to the selected function. +ifunc resolvers are invoked very early during the machine-dependent +initialization routine, or at load time for dynamically loaded modules. +Resolution must occur before the first call to an ifunc. +ifunc resolution is performed after CPU features are enumerated and after the +kernel's environment is initialized. +The typical use-case for an ifunc is a routine whose behavior depends on +optional CPU features. +For example, newer generations of a given CPU architecture may provide an +instruction to optimize a common operation. +To avoid the overhead of testing for the CPU feature each time the operation +is performed, an ifunc can be used to provide two implementations for the +operation: one targeting platforms with the extra instruction, and one +for older platforms. +.Pp +Because +.Nm +is a macro that defines a dynamically typed function, its usage looks somewhat +unusual. +The +.Ar qual +parameter is a list of zero or more C function qualifiers to be applied to the +ifunc. +This parameter is typically empty or the +.Dv static +qualifier. +.Ar ret_type +is the return type of the ifunc. +.Ar name +is the name of the ifunc. +.Ar args +is a parenthesized, comma-separated list of the parameter types of the function, +as they would appear in a C function declaration. +.Pp +The +.Nm +usage must be followed by the resolver function body. +The resolver must return a function with return type +.Ar ret_type +and parameter types +.Ar args . +The resolver function is defined with the +.Ql resolver +gcc-style function attribute, causing the corresponding +.Xr elf 5 +function symbol to be of type +.Dv STT_GNU_IFUNC +instead of +.Dv STT_FUNC . +The kernel linker invokes the resolver to process relocations targeting ifunc +calls and PLT entries referencing such symbols. +.Sh EXAMPLES +ifunc resolvers are executed early during boot, before most kernel facilities +are available. +They are effectively limited to checking CPU feature flags and tunables. +.Bd -literal +static size_t +fast_strlen(const char *s __unused) +{ + size_t len; + + /* Fast, but may not be correct in all cases. */ + __asm("movq $42,%0\\n" : "=r" (len)); + return (len); +} + +static size_t +slow_strlen(const char *s) +{ + const char *t; + + for (t = s; *t != '\\0'; t++); + return (t - s); +} + +DEFINE_IFUNC(, size_t, strlen, (const char *)) +{ + int enabled; + + enabled = 1; + TUNABLE_INT_FETCH("debug.use_fast_strlen", &enabled); + if (enabled && (cpu_features & CPUID_FAST_STRLEN) != 0) + return (fast_strlen); + else + return (slow_strlen); +} +.Ed +.Pp +This defines a +.Fn strlen +function with an optimized implementation for CPUs that advertise support. +.Sh SEE ALSO +.Xr elf 5 +.Sh NOTES +ifuncs are not supported on all architectures. +They require both toolchain support, to emit function symbols of type +.Dv STT_GNU_IFUNC , +and kernel linker support to invoke ifunc resolvers during boot or +during module load. From owner-svn-src-all@freebsd.org Mon May 20 19:14:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD30158F8D9; Mon, 20 May 2019 19:14:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E9F18E21A; Mon, 20 May 2019 19:14:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A13B2292E; Mon, 20 May 2019 19:14:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KJE7V5012206; Mon, 20 May 2019 19:14:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJE7lp012205; Mon, 20 May 2019 19:14:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905201914.x4KJE7lp012205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 May 2019 19:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348004 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E9F18E21A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:14:08 -0000 Author: markj Date: Mon May 20 19:14:07 2019 New Revision: 348004 URL: https://svnweb.freebsd.org/changeset/base/348004 Log: kcov depends on eventhandler.h. MFC after: 3 days Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Mon May 20 19:12:29 2019 (r348003) +++ head/sys/kern/kern_kcov.c Mon May 20 19:14:07 2019 (r348004) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Mon May 20 19:21:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 182DE158FB44; Mon, 20 May 2019 19:21:05 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (unknown [IPv6:2001:19f0:5801:ebe:d87d:d822:b408:4936]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 074A68E523; Mon, 20 May 2019 19:21:03 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x4KJKru9040267 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 May 2019 05:20:58 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x4KJKl2x040255 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 May 2019 05:20:47 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x4KJKlb6040254; Tue, 21 May 2019 05:20:47 +1000 (AEST) (envelope-from peter) Date: Tue, 21 May 2019 05:20:47 +1000 From: Peter Jeremy To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... Message-ID: <20190520192047.GA3524@server.rulingia.com> References: <201905200038.x4K0cNoZ019920@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <201905200038.x4K0cNoZ019920@repo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:21:05 -0000 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-May-20 00:38:23 +0000, Conrad Meyer wrote: >Author: cem >Date: Mon May 20 00:38:23 2019 >New Revision: 347984 >URL: https://svnweb.freebsd.org/changeset/base/347984 > >Log: > Extract eventfilter declarations to sys/_eventfilter.h =2E.. > No functional change (intended). Of course, any out of tree modules that > relied on header pollution for sys/eventhandler.h, sys/lock.h, or > sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bump= ed. This seems to have broken at least netmap and netdump for me: /usr/src/sys/dev/netmap/netmap_freebsd.c:191:3: error: implicit declaration= of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,-Wimplicit-= function-declaration] EVENTHANDLER_REGISTER(ifnet_arrival_event, ^ =2E.. /usr/src/sys/netinet/netdump/netdump_client.c:1458:22: error: implicit decl= aration of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,-Wim= plicit-function-declaration] nd_detach_cookie =3D EVENTHANDLER_REGISTER(ifnet_departure_= event, ^ --=20 Peter Jeremy --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlzi/g9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRm7A//Xu2bpx8pXREMW4pkZQU14IyPOi8//EFHhwFwGB/RNoQDe6LShG8Pus+Y PDUjInx0D2sTDS38XRVszmo9Qr+gZ75pkT2wSdHlxoxsrySdhtwDGX0Ro79D73HL TWzGODlm5gn2JOutPha7R6PFh4blFAEFUkPPhTWwKnGpJIuAtlzwuxw9c5DBPu2O r692fGHjKUUz/z6Mkl0RPUAGNtRdRQ+Ath3Fgn48a/w92FuE9XNXJAGpYuKbV9DS 2pPvfuKEXC4n5rr75cvwcJkYC+CfS4UFFWGuPzHeAJ9zE7Uyj9s2xM/7NyWpGyZy EyY9Ui8Y7MlliZxGbjg4WitNVDoeu3xaGE8bUEEgmWeHhSdBPPDa2AoA2cD8lr9i j9UWDmRG6Q5O9LCrHgOEewpimnISYV/Xl+1A0HMQxsN1hy3TtNgEuUEVNagDuFPz lh9TtAJyPpsl28xQp9L8kR+gmC71oxNBnW/5ygFHxDmZ75uz8fMMSLwJ8+5aAw6X 8LkgX00bu5Twl/TRl94MwvXBLbwiGn+Y5RfW53uYU39hWyaIQ3ufedabq+12bl66 K27/Go+Y871vKM+Hh9ginp4/h5wRJ4sIluC1xBisiOwbfBACgu191ag+RQuQXHOb l4sEDaN+QZbcYJxCbksyzU9A2zbSNEJfsFiv3uA6bLo6QVB+0qI= =bl+S -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE-- From owner-svn-src-all@freebsd.org Mon May 20 19:21:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EDAA158FD47; Mon, 20 May 2019 19:21:37 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2185C8E7DE; Mon, 20 May 2019 19:21:37 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 125622297D; Mon, 20 May 2019 19:21:37 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KJLaxM012646; Mon, 20 May 2019 19:21:36 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJLZWK012637; Mon, 20 May 2019 19:21:35 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201905201921.x4KJLZWK012637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 20 May 2019 19:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348005 - in head: cddl/contrib/opensolaris/lib/libzfs/common stand/common stand/ofw/libofw stand/powerpc/boot1.chrp stand/powerpc/kboot stand/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common stand/common stand/ofw/libofw stand/powerpc/boot1.chrp stand/powerpc/kboot stand/powerpc/ofw X-SVN-Commit-Revision: 348005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2185C8E7DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:21:37 -0000 Author: luporl Date: Mon May 20 19:21:35 2019 New Revision: 348005 URL: https://svnweb.freebsd.org/changeset/base/348005 Log: [PowerPC64] stand: fix build using clang 8 as compiler This change fixes "stand" build issues when using clang 8 as compiler. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20026 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c head/stand/common/load_elf.c head/stand/ofw/libofw/ofw_net.c head/stand/ofw/libofw/openfirm.c head/stand/powerpc/boot1.chrp/boot1.c head/stand/powerpc/kboot/Makefile head/stand/powerpc/kboot/main.c head/stand/powerpc/ofw/elf_freebsd.c head/stand/powerpc/ofw/ppc64_elf_freebsd.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon May 20 19:14:07 2019 (r348004) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon May 20 19:21:35 2019 (r348005) @@ -114,7 +114,7 @@ get_stats_for_obj(differ_info_t *di, const char *dsnam (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Unable to determine path or stats for " - "object %lld in %s"), obj, dsname); + "object %jd in %s"), (uintmax_t)obj, dsname); return (-1); } } @@ -406,8 +406,8 @@ write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff } else { (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, - "next allocated object (> %lld) find failure"), - zc.zc_obj); + "next allocated object (> %jd) find failure"), + (uintmax_t)zc.zc_obj); di->zerr = errno; break; } Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/common/load_elf.c Mon May 20 19:21:35 2019 (r348005) @@ -483,7 +483,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off += 0x01000000; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("Converted entry 0x%08x\n", ehdr->e_entry); + printf("Converted entry 0x%jx\n", (uintmax_t)ehdr->e_entry); #endif } else off = 0; @@ -509,8 +509,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", - ehdr->e_entry, off); + printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n", + (uintmax_t)ehdr->e_entry, off); #endif #else off = 0; /* other archs use direct mapped kernels */ Modified: head/stand/ofw/libofw/ofw_net.c ============================================================================== --- head/stand/ofw/libofw/ofw_net.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/ofw/libofw/ofw_net.c Mon May 20 19:21:35 2019 (r348005) @@ -225,12 +225,12 @@ ofwn_init(struct iodesc *desc, void *machdep_hint) dmabuf = NULL; if (OF_call_method("dma-alloc", netinstance, 1, 1, (64 * 1024), &dmabuf) < 0) { - printf("Failed to allocate DMA buffer (got %08x).\n", dmabuf); + printf("Failed to allocate DMA buffer (got %p).\n", dmabuf); goto punt; } #if defined(NETIF_DEBUG) - printf("ofwn_init: allocated DMA buffer: %08x\n", dmabuf); + printf("ofwn_init: allocated DMA buffer: %p\n", dmabuf); #endif #endif Modified: head/stand/ofw/libofw/openfirm.c ============================================================================== --- head/stand/ofw/libofw/openfirm.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/ofw/libofw/openfirm.c Mon May 20 19:21:35 2019 (r348005) @@ -669,7 +669,6 @@ OF_block_size(ihandle_t instance) } /* -/* * Memory functions */ Modified: head/stand/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/stand/powerpc/boot1.chrp/boot1.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/powerpc/boot1.chrp/boot1.c Mon May 20 19:21:35 2019 (r348005) @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "paths.h" Modified: head/stand/powerpc/kboot/Makefile ============================================================================== --- head/stand/powerpc/kboot/Makefile Mon May 20 19:14:07 2019 (r348004) +++ head/stand/powerpc/kboot/Makefile Mon May 20 19:21:35 2019 (r348005) @@ -36,9 +36,6 @@ CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -# 64-bit bridge extensions -CFLAGS+= -Wa,-mppc64bridge - DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/powerpc/kboot/main.c Mon May 20 19:21:35 2019 (r348005) @@ -484,8 +484,18 @@ kboot_kseg_get(int *nseg, void **ptr) void _start(int argc, const char **argv, char **env) { +// This makes error "variable 'sp' is uninitialized" be just a warning on clang. +// Initializing 'sp' is not desired here as it would overwrite "r1" original value +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wuninitialized" +#endif register volatile void **sp asm("r1"); main((int)sp[0], (const char **)&sp[1]); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } /* Modified: head/stand/powerpc/ofw/elf_freebsd.c ============================================================================== --- head/stand/powerpc/ofw/elf_freebsd.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/powerpc/ofw/elf_freebsd.c Mon May 20 19:21:35 2019 (r348005) @@ -84,7 +84,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp) if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) return (error); - printf("Kernel entry at 0x%lx ...\n", e->e_entry); + printf("Kernel entry at 0x%x ...\n", entry); dev_cleanup(); if (dtbp != 0) { Modified: head/stand/powerpc/ofw/ppc64_elf_freebsd.c ============================================================================== --- head/stand/powerpc/ofw/ppc64_elf_freebsd.c Mon May 20 19:14:07 2019 (r348004) +++ head/stand/powerpc/ofw/ppc64_elf_freebsd.c Mon May 20 19:21:35 2019 (r348005) @@ -87,7 +87,7 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp) if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) return (error); - printf("Kernel entry at 0x%lx ...\n", entry); + printf("Kernel entry at 0x%x ...\n", entry); dev_cleanup(); From owner-svn-src-all@freebsd.org Mon May 20 19:31:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C00159017F; Mon, 20 May 2019 19:31:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1A058ECB8; Mon, 20 May 2019 19:31: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9886222C5F; Mon, 20 May 2019 19:31: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 x4KJVop4018627; Mon, 20 May 2019 19:31:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KJVo5C018626; Mon, 20 May 2019 19:31:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905201931.x4KJVo5C018626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 May 2019 19:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348006 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1A058ECB8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:31:51 -0000 Author: emaste Date: Mon May 20 19:31:49 2019 New Revision: 348006 URL: https://svnweb.freebsd.org/changeset/base/348006 Log: muge: update FDT LED configuration Also use LED mode settings from the FDT to set the PHY. From v3 of the patch submitted in the PR. I moved the sc_led_modes and sc_led_modes_mask default setting outside of the #ifdef FDT case. PR: 237325 Submitted by: Ralf Reviewed by: ian MFC after: 2 weeks MFC with: r348001 Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20325 Modified: head/sys/dev/usb/net/if_muge.c head/sys/dev/usb/net/if_mugereg.h Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 19:21:35 2019 (r348005) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 19:31:49 2019 (r348006) @@ -174,6 +174,8 @@ struct muge_softc { struct usb_xfer *sc_xfer[MUGE_N_TRANSFER]; int sc_phyno; uint32_t sc_leds; + uint16_t sc_led_modes; + uint16_t sc_led_modes_mask; /* Settings for the mac control (MAC_CSR) register. */ uint32_t sc_rfe_ctl; @@ -890,7 +892,7 @@ static int lan78xx_phy_init(struct muge_softc *sc) { muge_dbg_printf(sc, "Initializing PHY.\n"); - uint16_t bmcr; + uint16_t bmcr, lmsr; usb_ticks_t start_ticks; uint32_t hw_reg; const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); @@ -934,6 +936,16 @@ lan78xx_phy_init(struct muge_softc *sc) lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, bmcr); bmcr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); + /* Configure LED Modes. */ + if (sc->sc_led_modes_mask != 0xffff) { + lmsr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_PHY_LED_MODE); + lmsr &= sc->sc_led_modes_mask; + lmsr |= sc->sc_led_modes; + lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_PHY_LED_MODE, lmsr); + } + /* Enable appropriate LEDs. */ if (sc->sc_leds != 0 && lan78xx_read_reg(sc, ETH_HW_CFG, &hw_reg) == 0) { @@ -1534,37 +1546,6 @@ muge_fdt_find_mac(const char *compatible, unsigned cha return (ENXIO); } - -/** - * muge_fdt_count_led_modes - read number of LED modes from node - * @compatible: compatible string for DTB node in the form - * "usb[N]NNN,[M]MMM" - * where NNN is vendor id and MMM is product id - * @amount: memory to store number of LED entries to - * - * Tries to find matching node in DTS and obtain number of entries from it. - * - * RETURNS: - * Returns 0 on success, error code otherwise - */ -static int -muge_fdt_count_led_modes(struct muge_softc *sc, const char *compatible, - uint32_t *amount) -{ - phandle_t node, root; - ssize_t proplen; - - *amount = 0; - root = OF_finddevice("/"); - node = muge_fdt_find_eth_node(root, compatible); - if (node != -1 && - (proplen = OF_getproplen(node, "microchip,led-modes")) > 0) { - *amount = proplen / sizeof( uint32_t ); - return (0); - } - - return (ENXIO); -} #endif /** @@ -1646,25 +1627,37 @@ muge_set_leds(struct usb_ether *ue) #ifdef FDT char compatible[16]; struct usb_attach_arg *uaa = device_get_ivars(ue->ue_dev); + phandle_t root, node; + pcell_t led_modes[4]; /* 4 LEDs are possible */ + ssize_t proplen; uint32_t count; #endif sc->sc_leds = 0; /* no LED mode is set */ + sc->sc_led_modes = 0; + sc->sc_led_modes_mask = 0xffff; if (lan78xx_eeprom_present(sc)) return; #ifdef FDT snprintf(compatible, sizeof(compatible), "usb%x,%x", uaa->info.idVendor, uaa->info.idProduct); - if (muge_fdt_count_led_modes(sc, compatible, &count) == 0) { + root = OF_finddevice("/"); + if ((node = muge_fdt_find_eth_node(root, compatible)) != -1 && + (proplen = OF_getencprop(node, "microchip,led-modes", led_modes, + sizeof(led_modes))) > 0) { + count = proplen / sizeof( uint32_t ); sc->sc_leds = (count > 0) * ETH_HW_CFG_LEDO_EN_ | (count > 1) * ETH_HW_CFG_LED1_EN_ | (count > 2) * ETH_HW_CFG_LED2_EN_ | (count > 3) * ETH_HW_CFG_LED3_EN_; + while (count-- > 0) { + sc->sc_led_modes |= + (led_modes[count] & 0xf) << (4 * count); + sc->sc_led_modes_mask <<= 4; + } muge_dbg_printf(sc, "LED modes set from FDT blob\n"); - return; } #endif - muge_dbg_printf(sc, "LED configuration not available\n"); } /** Modified: head/sys/dev/usb/net/if_mugereg.h ============================================================================== --- head/sys/dev/usb/net/if_mugereg.h Mon May 20 19:21:35 2019 (r348005) +++ head/sys/dev/usb/net/if_mugereg.h Mon May 20 19:31:49 2019 (r348006) @@ -190,6 +190,8 @@ #define MUGE_EXT_PAGE_SPACE_1 0x0001 #define MUGE_EXT_PAGE_SPACE_2 0x0002 +#define MUGE_PHY_LED_MODE 29 + /* Extended Register Page 1 Space */ #define MUGE_EXT_MODE_CTRL 0x0013 #define MUGE_EXT_MODE_CTRL_MDIX_MASK_ 0x000C From owner-svn-src-all@freebsd.org Mon May 20 19:32:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C6715901AD; Mon, 20 May 2019 19:32:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 942F78EF3C; Mon, 20 May 2019 19:32:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id g16so11975960iom.9; Mon, 20 May 2019 12:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=u5QCbIA0nXMtc8i21bv+SrovCA7M3bJ8x8NyEEFQyOc=; b=s7f8Ifk8TvRK8QgXe/bn//UvqzP58Zpoa6P0v6wkmlZrfZ1Z9RzRnuh5H7HnDukUBR ZMZklREGl41UdFomz9W4sBktXhMQwnJ69kLQjApLI7TAYxo08xNPluS9OJD8PLETnfU9 g8Es/Jao2fmzJqHJbftkmRpr/Vy0H4RbYxnYaSB4KPI5LEKOkF2Ni0V88JdvaS4F3ZdK fWStNWJNkCabQPzaC7I+9hhEtH8ORzQy/3LDGGmTYE2HVddTLt4MNi7SkOlpfLVOULaG JKv3+fiAB4L3e9/LKHxYQocx8M4N6NXiSJUfklEdKRG6czdIvMt3K4A1t3JA8ctNyWM5 YveA== X-Gm-Message-State: APjAAAUUjlS22GclpR2WWTGmr8QznaqCqfAV0FshvAUpNYbeEb4QqDWM olAeEWN7fC9s3VWUpfvBE6uK4r+T X-Google-Smtp-Source: APXvYqyrGMzVNAC8tuzRcD5sDOmWXibRwZGJUOqFKEmZbysPi8BOTRP9uYipL2B+DkGqnkeHykEuwA== X-Received: by 2002:a6b:c945:: with SMTP id z66mr40841963iof.191.1558380723182; Mon, 20 May 2019 12:32:03 -0700 (PDT) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com. [209.85.166.52]) by smtp.gmail.com with ESMTPSA id t63sm151153ita.42.2019.05.20.12.32.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 12:32:02 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id g84so12004417ioa.1; Mon, 20 May 2019 12:32:02 -0700 (PDT) X-Received: by 2002:a6b:c411:: with SMTP id y17mr9717396ioa.265.1558380722801; Mon, 20 May 2019 12:32:02 -0700 (PDT) MIME-Version: 1.0 References: <201905200038.x4K0cNoZ019920@repo.freebsd.org> <20190520192047.GA3524@server.rulingia.com> In-Reply-To: <20190520192047.GA3524@server.rulingia.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 20 May 2019 12:31:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... To: Peter Jeremy Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 942F78EF3C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 19:32:10 -0000 Hi Peter, Thanks for reporting this. I ran a full tinderbox on this change (many many tinderboxes) and am not sure how I missed this. I have to run to an appointment now, but will fix these in a couple hours if no one else beats me to it. The fix is straightforward =E2=80=94 include . Best, Conrad On Mon, May 20, 2019 at 12:21 PM Peter Jeremy wrote: > > On 2019-May-20 00:38:23 +0000, Conrad Meyer wrote: > >Author: cem > >Date: Mon May 20 00:38:23 2019 > >New Revision: 347984 > >URL: https://svnweb.freebsd.org/changeset/base/347984 > > > >Log: > > Extract eventfilter declarations to sys/_eventfilter.h > ... > > No functional change (intended). Of course, any out of tree modules t= hat > > relied on header pollution for sys/eventhandler.h, sys/lock.h, or > > sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bu= mped. > > This seems to have broken at least netmap and netdump for me: > /usr/src/sys/dev/netmap/netmap_freebsd.c:191:3: error: implicit declarati= on of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,-Wimplici= t-function-declaration] > EVENTHANDLER_REGISTER(ifnet_arrival_event, > ^ > ... > /usr/src/sys/netinet/netdump/netdump_client.c:1458:22: error: implicit de= claration of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,-W= implicit-function-declaration] > nd_detach_cookie =3D EVENTHANDLER_REGISTER(ifnet_departur= e_event, > ^ > > -- > Peter Jeremy From owner-svn-src-all@freebsd.org Mon May 20 20:48:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB3E6159218D; Mon, 20 May 2019 20:48:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA3691CDA; Mon, 20 May 2019 20:48:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32DAA238A3; Mon, 20 May 2019 20:48:05 +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 x4KKm4Ad061772; Mon, 20 May 2019 20:48:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KKm41C061771; Mon, 20 May 2019 20:48:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905202048.x4KKm41C061771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 May 2019 20:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348008 - head/lib/csu/mips X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/mips X-SVN-Commit-Revision: 348008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DA3691CDA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:48:06 -0000 Author: emaste Date: Mon May 20 20:48:04 2019 New Revision: 348008 URL: https://svnweb.freebsd.org/changeset/base/348008 Log: mips: remove 16-byte alignment from .init and .fini epilogues The .init and .fini epilogues from crtn should be placed immediately after any instructions in .init and .fini sections from the linked objects. Using 16-byte alignment for the epilogues on MIPS was a bug, but it did not cause any issue with GNU ld as GNU ld (2.17.50) fills the padding with NOPs. Current versions of LLD fill any padding between different object files with trap instructions. Inserting trap padding prior to the .init/.fini epilogue is undesriable as the resulting binary will crash at runtime. The .init and .fini sections in object files linked between crti and crtn must already be a multiple of the instruction size and so no alignment directive is required in crtn. Indeed, other architectures (except sparc64) do not specify alignment in their crtn implementations. Reported by: arichardson Reviewed by: andrew Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D18291 Modified: head/lib/csu/mips/crtn.S Modified: head/lib/csu/mips/crtn.S ============================================================================== --- head/lib/csu/mips/crtn.S Mon May 20 19:36:36 2019 (r348007) +++ head/lib/csu/mips/crtn.S Mon May 20 20:48:04 2019 (r348008) @@ -5,7 +5,6 @@ __FBSDID("$FreeBSD$"); .gnu_attribute 4, 0 #endif .section .init,"ax",%progbits - .align 4 .set noreorder #if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64)) REG_L gp, CALLFRAME_GP(sp) @@ -16,7 +15,6 @@ __FBSDID("$FreeBSD$"); .set reorder .section .fini,"ax",%progbits - .align 4 .set noreorder #if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64)) REG_L gp, CALLFRAME_GP(sp) From owner-svn-src-all@freebsd.org Mon May 20 21:23:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E712A1593363; Mon, 20 May 2019 21:23:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 870E5937B5; Mon, 20 May 2019 21:23:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 616A723FE7; Mon, 20 May 2019 21:23:34 +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 x4KLNYN8083398; Mon, 20 May 2019 21:23:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KLNYVA083397; Mon, 20 May 2019 21:23:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905202123.x4KLNYVA083397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 May 2019 21:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348011 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 870E5937B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 21:23:35 -0000 Author: markj Date: Mon May 20 21:23:33 2019 New Revision: 348011 URL: https://svnweb.freebsd.org/changeset/base/348011 Log: Hook DEFINE_IFUNC.9 up to the build. Reported by: pluknet MFC with: r348003 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon May 20 20:55:01 2019 (r348010) +++ head/share/man/man9/Makefile Mon May 20 21:23:33 2019 (r348011) @@ -75,6 +75,7 @@ MAN= accept_filter.9 \ DB_COMMAND.9 \ DECLARE_GEOM_CLASS.9 \ DECLARE_MODULE.9 \ + DEFINE_IFUNC.9 \ DELAY.9 \ devclass.9 \ devclass_find.9 \ From owner-svn-src-all@freebsd.org Mon May 20 21:33:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE4F15936E4; Mon, 20 May 2019 21:33:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCCBF93D2B; Mon, 20 May 2019 21:33:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7854F241A1; Mon, 20 May 2019 21:33:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4KLXNXW088722; Mon, 20 May 2019 21:33:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KLXMPE088717; Mon, 20 May 2019 21:33:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905202133.x4KLXMPE088717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 20 May 2019 21:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348012 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Commit-Revision: 348012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCCBF93D2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 21:33:24 -0000 Author: brooks Date: Mon May 20 21:33:22 2019 New Revision: 348012 URL: https://svnweb.freebsd.org/changeset/base/348012 Log: MFC r347963: Change ed(4), ep(4), and fxp(4) examples to em(4). ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains popular in older systems, but isn't as future proof as em(4). Reviewed by: bz, jhb Differential Revision: https://reviews.freebsd.org/D20311 Modified: stable/12/libexec/rc/rc.conf stable/12/sbin/ifconfig/ifconfig.8 stable/12/share/man/man5/rc.conf.5 stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall stable/12/usr.sbin/jail/jail.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Mon May 20 21:23:33 2019 (r348011) +++ stable/12/libexec/rc/rc.conf Mon May 20 21:33:22 2019 (r348012) @@ -121,9 +121,9 @@ hostid_file="/etc/hostid" # File with hostuuid. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. -#dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only +#dhclient_flags_em0="" # Extra dhclient flags for em0 only background_dhclient="NO" # Start dhcp client in the background. -#background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. +#background_dhclient_em0="YES" # Start dhcp client on em0 in the background. synchronous_dhclient="NO" # Start dhclient directly on configured # interfaces during startup. defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. @@ -147,19 +147,19 @@ firewall_client_net="192.0.2.0/24" # IPv4 Network addr # firewall. #firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for # "client" firewall. -firewall_simple_iif="ed1" # Inside network interface for "simple" +firewall_simple_iif="em1" # Inside network interface for "simple" # firewall. firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple" # firewall. -firewall_simple_oif="ed0" # Outside network interface for "simple" +firewall_simple_oif="em0" # Outside network interface for "simple" # firewall. firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple" # firewall. -#firewall_simple_iif_ipv6="ed1" # Inside IPv6 network interface for "simple" +#firewall_simple_iif_ipv6="em1" # Inside IPv6 network interface for "simple" # firewall. #firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix # for "simple" firewall. -#firewall_simple_oif_ipv6="ed0" # Outside IPv6 network interface for "simple" +#firewall_simple_oif_ipv6="em0" # Outside IPv6 network interface for "simple" # firewall. #firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix # for "simple" firewall. @@ -241,14 +241,14 @@ cloned_interfaces="" # List of cloned network interfa #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. #ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. -#ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry -#ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias -#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. -#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry +#ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias +#ifconfig_em0_name="net0" # Change interface name from em0 to net0. +#vlans_em0="101 vlan0" # vlan(4) interfaces for em0 device #create_args_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlandebug(8) -#ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. +#ipv4_addrs_em0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge @@ -336,7 +336,7 @@ bootparamd_flags="" # Flags to bootparamd pppoed_enable="NO" # Run the PPP over Ethernet daemon. pppoed_provider="*" # Provider and ppp(8) config file entry. pppoed_flags="-P /var/run/pppoed.pid" # Flags to pppoed (if enabled). -pppoed_interface="fxp0" # The interface that pppoed runs on. +pppoed_interface="em0" # The interface that pppoed runs on. sshd_enable="NO" # Enable sshd sshd_program="/usr/sbin/sshd" # path to sshd, if you want a different one. sshd_flags="" # Additional flags for sshd. @@ -506,11 +506,11 @@ route6d_flags="" # Flags to IPv6 routing daemon. # addrs. #route6d_flags="-q" # If you want to run a routing daemon on an end # node, you should stop advertisement. -#ipv6_network_interfaces="ed0 ep0" # Examples for router +#ipv6_network_interfaces="em0 em1" # Examples for router # or static configuration for end node. # Choose correct prefix value. -#ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. -#ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. +#ipv6_prefix_em0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. +#ipv6_prefix_em1="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. ipv6_default_interface="NO" # Default output interface for scoped addrs. # This works only with # ipv6_gateway_enable="NO". Modified: stable/12/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.8 Mon May 20 21:23:33 2019 (r348011) +++ stable/12/sbin/ifconfig/ifconfig.8 Mon May 20 21:33:22 2019 (r348012) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 27, 2018 +.Dd May 18, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -196,7 +196,7 @@ This parameter is a string of the form .Dq name unit , for example, -.Dq Li ed0 . +.Dq Li em0 . .It Ar groupname List the interfaces in the given group. .El @@ -2919,26 +2919,26 @@ Assign the IPv4 address with a network mask of .Li 255.255.255.0 , to the interface -.Li fxp0 : -.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0 +.Li em0 : +.Dl # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0 .Pp Add the IPv4 address .Li 192.0.2.45 , with the CIDR network prefix .Li /28 , to the interface -.Li ed0 , +.Li em0 , using .Cm add as a synonym for the canonical form of the option .Cm alias : -.Dl # ifconfig ed0 inet 192.0.2.45/28 add +.Dl # ifconfig em0 inet 192.0.2.45/28 add .Pp Remove the IPv4 address .Li 192.0.2.45 from the interface -.Li ed0 : -.Dl # ifconfig ed0 inet 192.0.2.45 -alias +.Li em0 : +.Dl # ifconfig em0 inet 192.0.2.45 -alias .Pp Enable IPv6 functionality of the interface: .Dl # ifconfig em0 inet6 -ifdisabled Modified: stable/12/share/man/man5/rc.conf.5 ============================================================================== --- stable/12/share/man/man5/rc.conf.5 Mon May 20 21:23:33 2019 (r348011) +++ stable/12/share/man/man5/rc.conf.5 Mon May 20 21:33:22 2019 (r348012) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2019 +.Dd May 18, 2019 .Dt RC.CONF 5 .Os .Sh NAME @@ -1262,11 +1262,11 @@ It is possible to add IP alias entries using syntax with the address family keyword such as .Li inet . Assuming that the interface in question was -.Li ed0 , +.Li em0 , it might look something like this: .Bd -literal -ifconfig_ed0_alias0="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_ed0_alias1="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_em0_alias0="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_em0_alias1="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp It also possible to configure multiple IP addresses in Classless @@ -1306,11 +1306,11 @@ not for the other address families such as .Li inet6 . .Pp With the interface in question being -.Li ed0 , +.Li em0 , an example could look like: .Bd -literal -ifconfig_ed0_alias2="inet 192.0.2.129/27" -ifconfig_ed0_alias3="inet 192.0.2.1-5/28" +ifconfig_em0_alias2="inet 192.0.2.129/27" +ifconfig_em0_alias3="inet 192.0.2.1-5/28" .Ed .Pp and so on. @@ -1332,10 +1332,10 @@ its contents are passed to Execution stops at the first unsuccessful access, so if something like this is present: .Bd -literal -ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" -ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" -ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_ed0_alias4="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_em0_alias0="inet 127.0.0.251 netmask 0xffffffff" +ifconfig_em0_alias1="inet 127.0.0.252 netmask 0xffffffff" +ifconfig_em0_alias2="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_em0_alias4="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp Then note that alias4 would @@ -1351,7 +1351,7 @@ variable, which has the same functionality as .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n and can have all of entries in a variable like the following: .Bd -literal -ifconfig_ed0_aliases="\\ +ifconfig_em0_aliases="\\ inet 127.0.0.251 netmask 0xffffffff \\ inet 127.0.0.252 netmask 0xffffffff \\ inet 127.0.0.253 netmask 0xffffffff \\ @@ -1458,11 +1458,11 @@ to the .Va ifconfig_ Ns Aq Ar interface variable. For instance, to initialize the -.Li ed0 +.Li em0 device via DHCP, it is possible to use something like: .Bd -literal -ifconfig_ed0="DHCP" +ifconfig_em0="DHCP" .Ed .Pp If you want to configure your wireless interface with @@ -1513,7 +1513,7 @@ variable. .Pp It is also possible to rename an interface by doing: .Bd -literal -ifconfig_ed0_name="net0" +ifconfig_em0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed .It Va ipv6_enable @@ -1686,8 +1686,8 @@ with keyword. For example: .Bd -literal -ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" -ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" +ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" +ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp Interfaces that have an @@ -1714,7 +1714,7 @@ defined in If only a link-local address is needed on the interface, the following configuration can be used: .Bd -literal -ifconfig_ed0_ipv6="inet6 auto_linklocal" +ifconfig_em0_ipv6="inet6 auto_linklocal" .Ed .Pp A link-local address can also be configured manually. @@ -1723,7 +1723,7 @@ so that it does not change when the network interface card is replaced. For example: .Bd -literal -ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" +ifconfig_em0_ipv6="inet6 fe80::1 prefixlen 64" .Ed .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str @@ -1737,15 +1737,15 @@ is empty. .Pp For example, the following configuration .Bd -literal -ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0" +ipv6_prefix_em0="2001:db8:1:0 2001:db8:2:0" .Ed .Pp is equivalent to the following: .Bd -literal -ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" -ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" -ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" -ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" +ifconfig_em0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" +ifconfig_em0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" +ifconfig_em0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" +ifconfig_em0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" .Ed .Pp These Subnet-Router anycast addresses will be added only when Modified: stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall ============================================================================== --- stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Mon May 20 21:23:33 2019 (r348011) +++ stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Mon May 20 21:33:22 2019 (r348012) @@ -195,13 +195,13 @@ case ${firewall_type} in ############ # set these to your outside interface network and netmask and ip - oif="ed0" + oif="em0" onet="192.0.2.0" omask="255.255.255.240" oip="192.0.2.1" # set these to your inside interface network and netmask and ip - iif="ed1" + iif="em1" inet="192.0.2.16" imask="255.255.255.240" iip="192.0.2.17" Modified: stable/12/usr.sbin/jail/jail.8 ============================================================================== --- stable/12/usr.sbin/jail/jail.8 Mon May 20 21:23:33 2019 (r348011) +++ stable/12/usr.sbin/jail/jail.8 Mon May 20 21:33:22 2019 (r348012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd May 18, 2019 .Dt JAIL 8 .Os .Sh NAME @@ -1099,7 +1099,7 @@ testjail { mount.devfs; host.hostname = testhostname; ip4.addr = 192.0.2.100; - interface = ed0; + interface = em0; exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; } From owner-svn-src-all@freebsd.org Mon May 20 21:45:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98DCB15939E7; Mon, 20 May 2019 21:45:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33CD3942B2; Mon, 20 May 2019 21:45:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EE662436D; Mon, 20 May 2019 21:45:01 +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 x4KLj0vQ093866; Mon, 20 May 2019 21:45:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KLj0Jc093865; Mon, 20 May 2019 21:45:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905202145.x4KLj0Jc093865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 20 May 2019 21:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348013 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33CD3942B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 21:45:01 -0000 Author: ian Date: Mon May 20 21:45:00 2019 New Revision: 348013 URL: https://svnweb.freebsd.org/changeset/base/348013 Log: Use the new usb fdt support functions to locate the proper fdt node for the device instance, and to get the MAC address for the device instance. The ad-hoc code this replaces could find the wrong instance if multiple devices were present. Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 21:33:22 2019 (r348012) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 21:45:00 2019 (r348013) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include @@ -1454,101 +1455,7 @@ tr_setup: } } -#ifdef FDT /** - * muge_fdt_find_eth_node - find descendant node with required compatibility - * @start: start node - * @compatible: compatible string used to identify the node - * - * Loop through all descendant nodes and return first match with required - * compatibility. - * - * RETURNS: - * Returns node's phandle on success -1 otherwise - */ -static phandle_t -muge_fdt_find_eth_node(phandle_t start, const char *compatible) -{ - phandle_t child, node; - - /* Traverse through entire tree to find usb ethernet nodes. */ - for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (ofw_bus_node_is_compatible(node, compatible)) - return (node); - child = muge_fdt_find_eth_node(node, compatible); - if (child != -1) - return (child); - } - - return (-1); -} - -/** - * muge_fdt_read_mac_property - read MAC address from node - * @node: USB device node - * @mac: memory to store MAC address to - * - * Check for common properties that might contain MAC address - * passed by boot loader. - * - * RETURNS: - * Returns 0 on success, error code otherwise - */ -static int -muge_fdt_read_mac_property(phandle_t node, unsigned char *mac) -{ - int len; - - /* Check if there is property */ - if ((len = OF_getproplen(node, "local-mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "local-mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - - if ((len = OF_getproplen(node, "mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - - return (ENXIO); -} - -/** - * muge_fdt_find_mac - read MAC address from node - * @compatible: compatible string for DTB node in the form "usb[N]NNN,[M]MMM" - * where NNN is vendor id and MMM is product id - * @mac: memory to store MAC address to - * - * Tries to find matching node in DTS and obtain MAC address info from it - * - * RETURNS: - * Returns 0 on success, error code otherwise - */ -static int -muge_fdt_find_mac(const char *compatible, unsigned char *mac) -{ - phandle_t node, root; - - root = OF_finddevice("/"); - node = muge_fdt_find_eth_node(root, compatible); - if (node != -1) { - if (muge_fdt_read_mac_property(node, mac) == 0) - return (0); - } - - return (ENXIO); -} -#endif - -/** * muge_set_mac_addr - Initiailizes NIC MAC address * @ue: the USB ethernet device * @@ -1560,10 +1467,6 @@ muge_set_mac_addr(struct usb_ether *ue) { struct muge_softc *sc = uether_getsc(ue); uint32_t mac_h, mac_l; -#ifdef FDT - char compatible[16]; - struct usb_attach_arg *uaa = device_get_ivars(ue->ue_dev); -#endif memset(sc->sc_ue.ue_eaddr, 0xff, ETHER_ADDR_LEN); @@ -1599,10 +1502,10 @@ muge_set_mac_addr(struct usb_ether *ue) } #ifdef FDT - snprintf(compatible, sizeof(compatible), "usb%x,%x", - uaa->info.idVendor, uaa->info.idProduct); - if (muge_fdt_find_mac(compatible, sc->sc_ue.ue_eaddr) == 0) { - muge_dbg_printf(sc, "MAC assigned from FDT blob\n"); + /* ue->ue_eaddr modified only if config exists for this dev instance. */ + usb_fdt_get_mac_addr(ue->ue_dev, ue); + if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + muge_dbg_printf(sc, "MAC read from FDT data\n"); return; } #endif @@ -1625,9 +1528,7 @@ muge_set_leds(struct usb_ether *ue) { struct muge_softc *sc = uether_getsc(ue); #ifdef FDT - char compatible[16]; - struct usb_attach_arg *uaa = device_get_ivars(ue->ue_dev); - phandle_t root, node; + phandle_t node; pcell_t led_modes[4]; /* 4 LEDs are possible */ ssize_t proplen; uint32_t count; @@ -1639,10 +1540,7 @@ muge_set_leds(struct usb_ether *ue) if (lan78xx_eeprom_present(sc)) return; #ifdef FDT - snprintf(compatible, sizeof(compatible), "usb%x,%x", - uaa->info.idVendor, uaa->info.idProduct); - root = OF_finddevice("/"); - if ((node = muge_fdt_find_eth_node(root, compatible)) != -1 && + if ((node = usb_fdt_get_node(ue->ue_dev, ue->ue_udev)) != -1 && (proplen = OF_getencprop(node, "microchip,led-modes", led_modes, sizeof(led_modes))) > 0) { count = proplen / sizeof( uint32_t ); @@ -1655,7 +1553,7 @@ muge_set_leds(struct usb_ether *ue) (led_modes[count] & 0xf) << (4 * count); sc->sc_led_modes_mask <<= 4; } - muge_dbg_printf(sc, "LED modes set from FDT blob\n"); + muge_dbg_printf(sc, "LED modes set from FDT data\n"); } #endif } From owner-svn-src-all@freebsd.org Mon May 20 22:04:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0028159415D; Mon, 20 May 2019 22:04:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71B5295021; Mon, 20 May 2019 22:04:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B20A24705; Mon, 20 May 2019 22:04:02 +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 x4KM42iF005127; Mon, 20 May 2019 22:04:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KM42vr005126; Mon, 20 May 2019 22:04:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905202204.x4KM42vr005126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 20 May 2019 22:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348016 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71B5295021 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:04:03 -0000 Author: ian Date: Mon May 20 22:04:01 2019 New Revision: 348016 URL: https://svnweb.freebsd.org/changeset/base/348016 Log: Don't detour through sc->sc_ue when we have a direct pointer to ue in hand already. Also, shorten a variable name for nicer line-wrapping. No functional changes. Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 22:02:54 2019 (r348015) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 22:04:01 2019 (r348016) @@ -1468,7 +1468,7 @@ muge_set_mac_addr(struct usb_ether *ue) struct muge_softc *sc = uether_getsc(ue); uint32_t mac_h, mac_l; - memset(sc->sc_ue.ue_eaddr, 0xff, ETHER_ADDR_LEN); + memset(ue->ue_eaddr, 0xff, ETHER_ADDR_LEN); uint32_t val; lan78xx_read_reg(sc, 0, &val); @@ -1476,26 +1476,26 @@ muge_set_mac_addr(struct usb_ether *ue) /* Read current MAC address from RX_ADDRx registers. */ if ((lan78xx_read_reg(sc, ETH_RX_ADDRL, &mac_l) == 0) && (lan78xx_read_reg(sc, ETH_RX_ADDRH, &mac_h) == 0)) { - sc->sc_ue.ue_eaddr[5] = (uint8_t)((mac_h >> 8) & 0xff); - sc->sc_ue.ue_eaddr[4] = (uint8_t)((mac_h) & 0xff); - sc->sc_ue.ue_eaddr[3] = (uint8_t)((mac_l >> 24) & 0xff); - sc->sc_ue.ue_eaddr[2] = (uint8_t)((mac_l >> 16) & 0xff); - sc->sc_ue.ue_eaddr[1] = (uint8_t)((mac_l >> 8) & 0xff); - sc->sc_ue.ue_eaddr[0] = (uint8_t)((mac_l) & 0xff); + ue->ue_eaddr[5] = (uint8_t)((mac_h >> 8) & 0xff); + ue->ue_eaddr[4] = (uint8_t)((mac_h) & 0xff); + ue->ue_eaddr[3] = (uint8_t)((mac_l >> 24) & 0xff); + ue->ue_eaddr[2] = (uint8_t)((mac_l >> 16) & 0xff); + ue->ue_eaddr[1] = (uint8_t)((mac_l >> 8) & 0xff); + ue->ue_eaddr[0] = (uint8_t)((mac_l) & 0xff); } /* If RX_ADDRx did not provide a valid MAC address, try EEPROM. */ - if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + if (ETHER_IS_VALID(ue->ue_eaddr)) { muge_dbg_printf(sc, "MAC assigned from registers\n"); return; } if ((lan78xx_eeprom_present(sc) && lan78xx_eeprom_read_raw(sc, ETH_E2P_MAC_OFFSET, - sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || + ue->ue_eaddr, ETHER_ADDR_LEN) == 0) || (lan78xx_otp_read(sc, OTP_MAC_OFFSET, - sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { - if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + ue->ue_eaddr, ETHER_ADDR_LEN) == 0)) { + if (ETHER_IS_VALID(ue->ue_eaddr)) { muge_dbg_printf(sc, "MAC read from EEPROM\n"); return; } @@ -1504,16 +1504,16 @@ muge_set_mac_addr(struct usb_ether *ue) #ifdef FDT /* ue->ue_eaddr modified only if config exists for this dev instance. */ usb_fdt_get_mac_addr(ue->ue_dev, ue); - if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + if (ETHER_IS_VALID(ue->ue_eaddr)) { muge_dbg_printf(sc, "MAC read from FDT data\n"); return; } #endif muge_dbg_printf(sc, "MAC assigned randomly\n"); - arc4rand(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN, 0); - sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ - sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ + arc4rand(ue->ue_eaddr, ETHER_ADDR_LEN, 0); + ue->ue_eaddr[0] &= ~0x01; /* unicast */ + ue->ue_eaddr[0] |= 0x02; /* locally administered */ } /** @@ -1529,7 +1529,7 @@ muge_set_leds(struct usb_ether *ue) struct muge_softc *sc = uether_getsc(ue); #ifdef FDT phandle_t node; - pcell_t led_modes[4]; /* 4 LEDs are possible */ + pcell_t modes[4]; /* 4 LEDs are possible */ ssize_t proplen; uint32_t count; #endif @@ -1541,16 +1541,15 @@ muge_set_leds(struct usb_ether *ue) return; #ifdef FDT if ((node = usb_fdt_get_node(ue->ue_dev, ue->ue_udev)) != -1 && - (proplen = OF_getencprop(node, "microchip,led-modes", led_modes, - sizeof(led_modes))) > 0) { + (proplen = OF_getencprop(node, "microchip,led-modes", modes, + sizeof(modes))) > 0) { count = proplen / sizeof( uint32_t ); sc->sc_leds = (count > 0) * ETH_HW_CFG_LEDO_EN_ | (count > 1) * ETH_HW_CFG_LED1_EN_ | (count > 2) * ETH_HW_CFG_LED2_EN_ | (count > 3) * ETH_HW_CFG_LED3_EN_; while (count-- > 0) { - sc->sc_led_modes |= - (led_modes[count] & 0xf) << (4 * count); + sc->sc_led_modes |= (modes[count] & 0xf) << (4 * count); sc->sc_led_modes_mask <<= 4; } muge_dbg_printf(sc, "LED modes set from FDT data\n"); From owner-svn-src-all@freebsd.org Mon May 20 22:21:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 398111594872; Mon, 20 May 2019 22:21:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDACF95BEA; Mon, 20 May 2019 22:21:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E76FF24A47; Mon, 20 May 2019 22:21:47 +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 x4KMLlMe013205; Mon, 20 May 2019 22:21:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KMLlYe013204; Mon, 20 May 2019 22:21:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905202221.x4KMLlYe013204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 20 May 2019 22:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348018 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDACF95BEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:21:49 -0000 Author: ian Date: Mon May 20 22:21:47 2019 New Revision: 348018 URL: https://svnweb.freebsd.org/changeset/base/348018 Log: A MAC adddress from FDT data should override anything stored in eeprom or OTP registers (because the user is in control of the fdt data). Remove the early returns from the code that tries to find a good mac address, so that the execution always flows through the routine to get an address from FDT data last, when on FDT-enabled systems. Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 22:21:42 2019 (r348017) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 22:21:47 2019 (r348018) @@ -1484,36 +1484,36 @@ muge_set_mac_addr(struct usb_ether *ue) ue->ue_eaddr[0] = (uint8_t)((mac_l) & 0xff); } - /* If RX_ADDRx did not provide a valid MAC address, try EEPROM. */ + /* + * If RX_ADDRx did not provide a valid MAC address, try EEPROM. If that + * doesn't work, try OTP. Whether any of these methods work or not, try + * FDT data, because it is allowed to override the EEPROM/OTP values. + */ if (ETHER_IS_VALID(ue->ue_eaddr)) { muge_dbg_printf(sc, "MAC assigned from registers\n"); - return; + } else if (lan78xx_eeprom_present(sc) && lan78xx_eeprom_read_raw(sc, + ETH_E2P_MAC_OFFSET, ue->ue_eaddr, ETHER_ADDR_LEN) == 0 && + ETHER_IS_VALID(ue->ue_eaddr)) { + muge_dbg_printf(sc, "MAC assigned from EEPROM\n"); + } else if (lan78xx_otp_read(sc, OTP_MAC_OFFSET, ue->ue_eaddr, + ETHER_ADDR_LEN) == 0 && ETHER_IS_VALID(ue->ue_eaddr)) { + muge_dbg_printf(sc, "MAC assigned from OTP\n"); } - if ((lan78xx_eeprom_present(sc) && - lan78xx_eeprom_read_raw(sc, ETH_E2P_MAC_OFFSET, - ue->ue_eaddr, ETHER_ADDR_LEN) == 0) || - (lan78xx_otp_read(sc, OTP_MAC_OFFSET, - ue->ue_eaddr, ETHER_ADDR_LEN) == 0)) { - if (ETHER_IS_VALID(ue->ue_eaddr)) { - muge_dbg_printf(sc, "MAC read from EEPROM\n"); - return; - } - } - #ifdef FDT /* ue->ue_eaddr modified only if config exists for this dev instance. */ usb_fdt_get_mac_addr(ue->ue_dev, ue); if (ETHER_IS_VALID(ue->ue_eaddr)) { - muge_dbg_printf(sc, "MAC read from FDT data\n"); - return; + muge_dbg_printf(sc, "MAC assigned from FDT data\n"); } #endif - muge_dbg_printf(sc, "MAC assigned randomly\n"); - arc4rand(ue->ue_eaddr, ETHER_ADDR_LEN, 0); - ue->ue_eaddr[0] &= ~0x01; /* unicast */ - ue->ue_eaddr[0] |= 0x02; /* locally administered */ + if (!ETHER_IS_VALID(ue->ue_eaddr)) { + muge_dbg_printf(sc, "MAC assigned randomly\n"); + arc4rand(ue->ue_eaddr, ETHER_ADDR_LEN, 0); + ue->ue_eaddr[0] &= ~0x01; /* unicast */ + ue->ue_eaddr[0] |= 0x02; /* locally administered */ + } } /** From owner-svn-src-all@freebsd.org Mon May 20 22:32:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E8331594DD6; Mon, 20 May 2019 22:32:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A9A796309; Mon, 20 May 2019 22:32:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8CAD24C43; Mon, 20 May 2019 22:32:26 +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 x4KMWQJB020105; Mon, 20 May 2019 22:32:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KMWQrO020104; Mon, 20 May 2019 22:32:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905202232.x4KMWQrO020104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 20 May 2019 22:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348019 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A9A796309 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:32:27 -0000 Author: ngie Date: Mon May 20 22:32:26 2019 New Revision: 348019 URL: https://svnweb.freebsd.org/changeset/base/348019 Log: Allow the end-user to pass along arguments to cryptotest.py via `$CRYPTOTEST_ARGS` This allows someone to use `-v` to dump out standard output. Modified: head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Mon May 20 22:21:47 2019 (r348018) +++ head/tests/sys/opencrypto/runtests.sh Mon May 20 22:32:26 2019 (r348019) @@ -81,7 +81,7 @@ if ! sysctl $cdas_sysctl=1; then fi echo "1..1" -if "$PYTHON" $(dirname $0)/cryptotest.py; then +if "$PYTHON" $(dirname $0)/cryptotest.py $CRYPTOTEST_ARGS; then echo "ok 1" else echo "not ok 1" From owner-svn-src-all@freebsd.org Mon May 20 22:32:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA801594DFA; Mon, 20 May 2019 22:32:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACF4C96345; Mon, 20 May 2019 22:32:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E87624C47; Mon, 20 May 2019 22:32:31 +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 x4KMWVWA021109; Mon, 20 May 2019 22:32:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4KMWVrt021108; Mon, 20 May 2019 22:32:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905202232.x4KMWVrt021108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 20 May 2019 22:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348020 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 348020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACF4C96345 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:32:33 -0000 Author: ian Date: Mon May 20 22:32:31 2019 New Revision: 348020 URL: https://svnweb.freebsd.org/changeset/base/348020 Log: Reverse the bit logic of sc_led_modes_mask. Instead of initializing it to all-ones then carving out blocks of zeroes where specified values go, init it to all-zeroes, put in ones where values need to be masked, then use it as value &= ~sc_led_modes_mask. In addition to being more idiomatic, this means everything related to FDT data is initialized to zero along with the rest of the softc, and that allows removing some #ifdef FDT sections and wrapping the whole muge_set_leds() function in a single ifdef block. This also deletes the early-out from muge_set_leds() when an eeprom exists. Even if there is an eeprom with led config in it, the fdt data (if present) should override that, because the user is in control of the fdt data. Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon May 20 22:32:26 2019 (r348019) +++ head/sys/dev/usb/net/if_muge.c Mon May 20 22:32:31 2019 (r348020) @@ -938,10 +938,10 @@ lan78xx_phy_init(struct muge_softc *sc) bmcr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); /* Configure LED Modes. */ - if (sc->sc_led_modes_mask != 0xffff) { + if (sc->sc_led_modes_mask != 0) { lmsr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MUGE_PHY_LED_MODE); - lmsr &= sc->sc_led_modes_mask; + lmsr &= ~sc->sc_led_modes_mask; lmsr |= sc->sc_led_modes; lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MUGE_PHY_LED_MODE, lmsr); @@ -1526,20 +1526,13 @@ muge_set_mac_addr(struct usb_ether *ue) static void muge_set_leds(struct usb_ether *ue) { - struct muge_softc *sc = uether_getsc(ue); #ifdef FDT + struct muge_softc *sc = uether_getsc(ue); phandle_t node; pcell_t modes[4]; /* 4 LEDs are possible */ ssize_t proplen; uint32_t count; -#endif - sc->sc_leds = 0; /* no LED mode is set */ - sc->sc_led_modes = 0; - sc->sc_led_modes_mask = 0xffff; - if (lan78xx_eeprom_present(sc)) - return; -#ifdef FDT if ((node = usb_fdt_get_node(ue->ue_dev, ue->ue_udev)) != -1 && (proplen = OF_getencprop(node, "microchip,led-modes", modes, sizeof(modes))) > 0) { @@ -1550,7 +1543,7 @@ muge_set_leds(struct usb_ether *ue) (count > 3) * ETH_HW_CFG_LED3_EN_; while (count-- > 0) { sc->sc_led_modes |= (modes[count] & 0xf) << (4 * count); - sc->sc_led_modes_mask <<= 4; + sc->sc_led_modes_mask |= 0xf << (4 * count); } muge_dbg_printf(sc, "LED modes set from FDT data\n"); } From owner-svn-src-all@freebsd.org Mon May 20 22:46:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3697F15951A3; Mon, 20 May 2019 22:46:32 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501o.mail.yandex.net (forward501o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E676796B7A; Mon, 20 May 2019 22:46:29 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward501o.mail.yandex.net (Yandex) with ESMTP id 051CB1E800F2; Tue, 21 May 2019 01:46:18 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mK0Kgvap1g-kHwS255o; Tue, 21 May 2019 01:46:17 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1558392377; bh=PysOE3COcN6lH80R3jhR1o/VNVpnE7aWpQcDC07csss=; h=Message-Id:Cc:Subject:Date:References:To:From; b=o7M1UxmwwOM+CupiymaSv440xpJLjtr07Kr4jPcGjAC2/T3y6zWeaQTrM6/1TNZT4 lNPNCMH4qYaGTHwhcq6ol5ERWuYmP3XsPEdeMQAOssweOmN4b1Q1k+uiV3f8GhpELJ tMG7yUIZkrA+w8nVo3xAyM4xvdLNFD20xujUCa04= Received: by myt4-ea6eba8eca77.qloud-c.yandex.net with HTTP; Tue, 21 May 2019 01:46:17 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: "rgrimes@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201905192149.x4JLnvt5028495@repo.freebsd.org> <201905200450.x4K4o9uI072252@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347982 - head/sys/net MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 21 May 2019 01:46:17 +0300 Message-Id: <17209181558392377@myt4-ea6eba8eca77.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: E676796B7A X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=o7M1Uxmw; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:1a2d::611 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-4.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1a2d::/64]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.72)[ipnet: 2a02:6b8::/32(-4.78), asn: 13238(-3.83), country: RU(0.01)]; MX_GOOD(-0.01)[mx.yandex.net,mx.yandex.net,mx.yandex.net,mx.yandex.net,mx.yandex.net]; DKIM_TRACE(0.00)[ipfw.ru:+]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; TO_DN_EQ_ADDR_ALL(0.00)[]; FORGED_SENDER(0.30)[melifaro@freebsd.org,melifaro@ipfw.ru]; RCVD_IN_DNSWL_LOW(-0.10)[1.1.6.0.0.0.0.0.0.0.0.0.0.0.0.0.d.2.a.1.0.0.0.0.8.b.6.0.2.0.a.2.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; FROM_NEQ_ENVFROM(0.00)[melifaro@freebsd.org,melifaro@ipfw.ru] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 22:46:32 -0000 20.05.2019, 07:50, "Rodney W. Grimes" : >>  Author: melifaro >>  Date: Sun May 19 21:49:56 2019 >>  New Revision: 347982 >>  URL: https://svnweb.freebsd.org/changeset/base/347982 >> >>  Log: >>    Fix rt_ifa selection during loopback route insertion process. >>      Currently such routes are added with a link-level IFA, which is >>      plain wrong. Only after the insertion they get fixed by the special >>      link_rtrequest() ifa handler. This behaviour complicates routing code >>      and makes ifa selection more complex. >>    Streamline this process by explicitly moving link_rtrequest() logic >>      to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all >>      this logic in the loopback route case by explicitly specifying >>      proper rt_ifa inside the ifa_maintain_loopback_route().? >> >>    MFC after: 2 weeks >>    Differential Revision: https://reviews.freebsd.org/D20076 > > I shall again state that from a routing protocol perspecitive > and a POLA perspective having the kernel doing route maintanance > of any kind is fundementally wrong. > > I still continue to stronly object to ifa_maintain_loopback_route > code even being present in our kernel. Having these routes > is a micro optimization at best, and cause issues when real > and actual routing protocols are in use. I agree with that. It indeed causes decent amount of complications and I (as another router type person) prefer to have it gone as well. However, one has to carefully check uRPF functionality in our firewalls, implement fib-aware in_localip_more (and its IPv6 counterpart) to make it happen. > > Bruce Evans and myself have locally killed this code, and > just about every router type person I show it to gets ill > seeing it. > > Show many another system that does this and I might reconsider, > but I have never ever seen one. > >>  Modified: >>    head/sys/net/if.c >>    head/sys/net/route.c >> >>  Modified: head/sys/net/if.c >>  ============================================================================== >>  --- head/sys/net/if.c Sun May 19 20:28:49 2019 (r347981) >>  +++ head/sys/net/if.c Sun May 19 21:49:56 2019 (r347982) >>  @@ -264,7 +264,6 @@ static void if_route(struct ifnet *, int flag, int fam >>   static int if_setflag(struct ifnet *, int, int, int *, int); >>   static int if_transmit(struct ifnet *ifp, struct mbuf *m); >>   static void if_unroute(struct ifnet *, int flag, int fam); >>  -static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *); >>   static int if_delmulti_locked(struct ifnet *, struct ifmultiaddr *, int); >>   static void do_link_state_change(void *, int); >>   static int if_getgroup(struct ifgroupreq *, struct ifnet *); >>  @@ -862,7 +861,6 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc >>                   sdl->sdl_type = ifp->if_type; >>                   ifp->if_addr = ifa; >>                   ifa->ifa_ifp = ifp; >>  - ifa->ifa_rtrequest = link_rtrequest; >>                   ifa->ifa_addr = (struct sockaddr *)sdl; >>                   sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl); >>                   ifa->ifa_netmask = (struct sockaddr *)sdl; >>  @@ -1892,6 +1890,7 @@ static int >>   ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, >>       struct sockaddr *ia) >>   { >>  + struct epoch_tracker et; >>           int error; >>           struct rt_addrinfo info; >>           struct sockaddr_dl null_sdl; >>  @@ -1902,6 +1901,16 @@ ifa_maintain_loopback_route(int cmd, const char *otype >>           bzero(&info, sizeof(info)); >>           if (cmd != RTM_DELETE) >>                   info.rti_ifp = V_loif; >>  + if (cmd == RTM_ADD) { >>  + /* explicitly specify (loopback) ifa */ >>  + if (info.rti_ifp != NULL) { >>  + NET_EPOCH_ENTER(et); >>  + info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); >>  + if (info.rti_ifa != NULL) >>  + ifa_ref(info.rti_ifa); >>  + NET_EPOCH_EXIT(et); >>  + } >>  + } >>           info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; >>           info.rti_info[RTAX_DST] = ia; >>           info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; >>  @@ -2208,39 +2217,6 @@ ifa_preferred(struct ifaddr *cur, struct ifaddr *next) >> >>           return (cur->ifa_carp && (!next->ifa_carp || >>               ((*carp_master_p)(next) && !(*carp_master_p)(cur)))); >>  -} >>  - >>  -#include >>  - >>  -/* >>  - * Default action when installing a route with a Link Level gateway. >>  - * Lookup an appropriate real ifa to point to. >>  - * This should be moved to /sys/net/link.c eventually. >>  - */ >>  -static void >>  -link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) >>  -{ >>  - struct epoch_tracker et; >>  - struct ifaddr *ifa, *oifa; >>  - struct sockaddr *dst; >>  - struct ifnet *ifp; >>  - >>  - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) || >>  - ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL)) >>  - return; >>  - NET_EPOCH_ENTER(et); >>  - ifa = ifaof_ifpforaddr(dst, ifp); >>  - if (ifa) { >>  - oifa = rt->rt_ifa; >>  - if (oifa != ifa) { >>  - ifa_free(oifa); >>  - ifa_ref(ifa); >>  - } >>  - rt->rt_ifa = ifa; >>  - if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest) >>  - ifa->ifa_rtrequest(cmd, rt, info); >>  - } >>  - NET_EPOCH_EXIT(et); >>   } >> >>   struct sockaddr_dl * >> >>  Modified: head/sys/net/route.c >>  ============================================================================== >>  --- head/sys/net/route.c Sun May 19 20:28:49 2019 (r347981) >>  +++ head/sys/net/route.c Sun May 19 21:49:56 2019 (r347982) >>  @@ -1276,12 +1276,14 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo >>   /* >>    * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, >>    * it will be referenced so the caller must free it. >>  + * >>  + * Assume basic consistency checks are executed by callers: >>  + * RTAX_DST exists, if RTF_GATEWAY is set, RTAX_GATEWAY exists as well. >>    */ >>   int >>   rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) >>   { >>           struct epoch_tracker et; >>  - struct ifaddr *ifa; >>           int needref, error; >> >>           /* >>  @@ -1291,21 +1293,54 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) >>           error = 0; >>           needref = (info->rti_ifa == NULL); >>           NET_EPOCH_ENTER(et); >>  + >>  + /* If we have interface specified by the ifindex in the address, use it */ >>           if (info->rti_ifp == NULL && ifpaddr != NULL && >>  - ifpaddr->sa_family == AF_LINK && >>  - (ifa = ifa_ifwithnet(ifpaddr, 0, fibnum)) != NULL) { >>  - info->rti_ifp = ifa->ifa_ifp; >>  + ifpaddr->sa_family == AF_LINK) { >>  + const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)ifpaddr; >>  + if (sdl->sdl_index != 0) >>  + info->rti_ifp = ifnet_byindex_locked(sdl->sdl_index); >>           } >>  + /* >>  + * If we have source address specified, try to find it >>  + * TODO: avoid enumerating all ifas on all interfaces. >>  + */ >>           if (info->rti_ifa == NULL && ifaaddr != NULL) >>                   info->rti_ifa = ifa_ifwithaddr(ifaaddr); >>           if (info->rti_ifa == NULL) { >>                   struct sockaddr *sa; >> >>  - sa = ifaaddr != NULL ? ifaaddr : >>  - (gateway != NULL ? gateway : dst); >>  - if (sa != NULL && info->rti_ifp != NULL) >>  + /* >>  + * Most common use case for the userland-supplied routes. >>  + * >>  + * Choose sockaddr to select ifa. >>  + * -- if ifp is set -- >>  + * Order of preference: >>  + * 1) IFA address >>  + * 2) gateway address >>  + * Note: for interface routes link-level gateway address >>  + * is specified to indicate the interface index without >>  + * specifying RTF_GATEWAY. In this case, ignore gateway >>  + * Note: gateway AF may be different from dst AF. In this case, >>  + * ignore gateway >>  + * 3) final destination. >>  + * 4) if all of these fails, try to get at least link-level ifa. >>  + * -- else -- >>  + * try to lookup gateway or dst in the routing table to get ifa >>  + */ >>  + if (info->rti_info[RTAX_IFA] != NULL) >>  + sa = info->rti_info[RTAX_IFA]; >>  + else if ((info->rti_flags & RTF_GATEWAY) != 0 && >>  + gateway->sa_family == dst->sa_family) >>  + sa = gateway; >>  + else >>  + sa = dst; >>  + if (info->rti_ifp != NULL) { >>                           info->rti_ifa = ifaof_ifpforaddr(sa, info->rti_ifp); >>  - else if (dst != NULL && gateway != NULL) >>  + /* Case 4 */ >>  + if (info->rti_ifa == NULL && gateway != NULL) >>  + info->rti_ifa = ifaof_ifpforaddr(gateway, info->rti_ifp); >>  + } else if (dst != NULL && gateway != NULL) >>                           info->rti_ifa = ifa_ifwithroute(flags, dst, gateway, >>                                                           fibnum); >>                   else if (sa != NULL) > > -- > Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 00:04:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12FB21596C0E; Tue, 21 May 2019 00:04:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A511D6A32A; Tue, 21 May 2019 00:04:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AA5725B75; Tue, 21 May 2019 00:04:20 +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 x4L04Klq068113; Tue, 21 May 2019 00:04:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L04KIO068112; Tue, 21 May 2019 00:04:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905210004.x4L04KIO068112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 21 May 2019 00:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348022 - in head/sys: dev/netmap netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/netmap netinet/netdump X-SVN-Commit-Revision: 348022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A511D6A32A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 00:04:21 -0000 Author: cem Date: Tue May 21 00:04:19 2019 New Revision: 348022 URL: https://svnweb.freebsd.org/changeset/base/348022 Log: Add two missing eventhandler.h headers These are obviously missing from the .c files, but don't show up in any tinderbox configuration (due to latent header pollution of some kind). It seems some configurations don't have this pollution, and the includes are obviously missing, so go ahead and add them. Reported by: Peter Jeremy X-MFC-With: r347984 Modified: head/sys/dev/netmap/netmap_freebsd.c head/sys/netinet/netdump/netdump_client.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon May 20 22:37:42 2019 (r348021) +++ head/sys/dev/netmap/netmap_freebsd.c Tue May 21 00:04:19 2019 (r348022) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include /* POLLIN, POLLOUT */ #include /* types used in module initialization */ Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Mon May 20 22:37:42 2019 (r348021) +++ head/sys/netinet/netdump/netdump_client.c Tue May 21 00:04:19 2019 (r348022) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Tue May 21 00:05:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A5181596CE9; Tue, 21 May 2019 00:05:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD5C66A523; Tue, 21 May 2019 00:05:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f182.google.com with SMTP id h11so1889106itf.5; Mon, 20 May 2019 17:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=Uh+SsxcJJIUC1fceM1o4cc0dDQpuvRI8PhdBUAyfyCc=; b=jnhh9UK5Q/OVZNV2S6FF5W9V6UK5AYLqyUf90KDy7yDtoyU2269y4MZoMHA0JUSbL1 ddcPdMaijBdbIRbZZbo+ZUZcFE7R5AdYm4CxEatGpro/WctDHR2f4yeISOWNYkUYBGwR 6BUELqgMDfVsRIlYXuaiqG1v3qYyeF6Wd905sQlKPggXnvZc7n6gbMncqzwvWodctGzs vDwPuWOijd1RXQaN5h/LJyY4fZNUS/SSYejraf5FA9Q+AZpLwEMxKfpKex5GgsRr1RZ2 ow6ThNfl+0WEQasOfTmt5QTu42OK165gHhH8MAnvqCtSr/KlmiAEt0PDKxHzdtRFtosg /WUw== X-Gm-Message-State: APjAAAWnjQeExbebQrJB/X51WDZ6guxb8UWSxFFKdDJZH1YmEsMyzH3G tph18Z68mclppsQR5kxJuD1p4Lzm X-Google-Smtp-Source: APXvYqxOAR2OREMIYLXsL+oP2puLtQ44Byn4rWRzTxJEkWN/QMw2/XCV1egBrH56nQWTrqwRAsEGfw== X-Received: by 2002:a02:95aa:: with SMTP id b39mr49464656jai.45.1558396811207; Mon, 20 May 2019 17:00:11 -0700 (PDT) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com. [209.85.166.44]) by smtp.gmail.com with ESMTPSA id r139sm573844ita.22.2019.05.20.17.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 17:00:10 -0700 (PDT) Received: by mail-io1-f44.google.com with SMTP id s20so12486087ioj.7; Mon, 20 May 2019 17:00:10 -0700 (PDT) X-Received: by 2002:a05:6602:157:: with SMTP id v23mr5175944iot.80.1558396810738; Mon, 20 May 2019 17:00:10 -0700 (PDT) MIME-Version: 1.0 References: <201905200038.x4K0cNoZ019920@repo.freebsd.org> <20190520192047.GA3524@server.rulingia.com> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 20 May 2019 16:59:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347984 - in head/sys: amd64/vmm/io arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/mv/armada arm/nvidia arm/nvidia/tegra12... To: Peter Jeremy Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: CD5C66A523 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 00:05:53 -0000 Hi Peter, Can you share what your kernel configuration is? I believe the error is masked in existing tinderbox kernel configurations ( https://ci.freebsd.org/tinderbox/ ) by some remaining header pollution that must be conditional on an option. The files you've pointed out are missing the eventhandler header (and fixing that is trivial), but I'd like to better understand where the leak is so that other misses can be located. Thanks, Conrad On Mon, May 20, 2019 at 12:31 PM Conrad Meyer wrote: > > Hi Peter, > > Thanks for reporting this. I ran a full tinderbox on this change > (many many tinderboxes) and am not sure how I missed this. I have to > run to an appointment now, but will fix these in a couple hours if no > one else beats me to it. The fix is straightforward =E2=80=94 include > . > > Best, > Conrad > > On Mon, May 20, 2019 at 12:21 PM Peter Jeremy wrote: > > > > On 2019-May-20 00:38:23 +0000, Conrad Meyer wrote: > > >Author: cem > > >Date: Mon May 20 00:38:23 2019 > > >New Revision: 347984 > > >URL: https://svnweb.freebsd.org/changeset/base/347984 > > > > > >Log: > > > Extract eventfilter declarations to sys/_eventfilter.h > > ... > > > No functional change (intended). Of course, any out of tree modules= that > > > relied on header pollution for sys/eventhandler.h, sys/lock.h, or > > > sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been = bumped. > > > > This seems to have broken at least netmap and netdump for me: > > /usr/src/sys/dev/netmap/netmap_freebsd.c:191:3: error: implicit declara= tion of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,-Wimpli= cit-function-declaration] > > EVENTHANDLER_REGISTER(ifnet_arrival_event, > > ^ > > ... > > /usr/src/sys/netinet/netdump/netdump_client.c:1458:22: error: implicit = declaration of function 'EVENTHANDLER_REGISTER' is invalid in C99 [-Werror,= -Wimplicit-function-declaration] > > nd_detach_cookie =3D EVENTHANDLER_REGISTER(ifnet_depart= ure_event, > > ^ > > > > -- > > Peter Jeremy From owner-svn-src-all@freebsd.org Tue May 21 00:30:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9F2015973E3; Tue, 21 May 2019 00:30:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 033D16AE4A; Tue, 21 May 2019 00:30:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C609525ED1; Tue, 21 May 2019 00:30:29 +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 x4L0UTFY079093; Tue, 21 May 2019 00:30:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L0UTVJ079092; Tue, 21 May 2019 00:30:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210030.x4L0UTVJ079092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 00:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348024 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 033D16AE4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 00:30:31 -0000 Author: ngie Date: Tue May 21 00:30:29 2019 New Revision: 348024 URL: https://svnweb.freebsd.org/changeset/base/348024 Log: Followup to r347996 Replace uses of `foo.encode("hex")` with `binascii.hexlify(foo)` for forwards compatibility between python 2.x and python 3. PR: 237403 MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Tue May 21 00:07:53 2019 (r348023) +++ head/tests/sys/opencrypto/cryptotest.py Tue May 21 00:30:29 2019 (r348024) @@ -262,7 +262,7 @@ def GenTestCase(cname): out = r + tag self.assertEqual(out, ct, "Count " + data['Count'] + " Actual: " + \ - repr(out.encode("hex")) + " Expected: " + \ + repr(binascii.hexlify(out)) + " Expected: " + \ repr(data) + " on " + cname) def runCCMDecrypt(self, fname): @@ -313,7 +313,7 @@ def GenTestCase(cname): payload = payload[:plen] self.assertEqual(r, payload, "Count " + data['Count'] + \ - " Actual: " + repr(r.encode("hex")) + \ + " Actual: " + repr(binascii.hexlify(r)) + \ " Expected: " + repr(data) + \ " on " + cname) @@ -405,7 +405,7 @@ def GenTestCase(cname): _, r = c.encrypt(msg, iv="") self.assertEqual(r, md, "Actual: " + \ - repr(r.encode("hex")) + " Expected: " + repr(data) + " on " + cname) + repr(binascii.hexlify(r)) + " Expected: " + repr(data) + " on " + cname) @unittest.skipIf(cname not in shamodules, 'skipping SHA-HMAC on %s' % str(cname)) def test_sha1hmac(self): @@ -462,7 +462,7 @@ def GenTestCase(cname): _, r = c.encrypt(msg, iv="") self.assertEqual(r[:tlen], mac, "Actual: " + \ - repr(r.encode("hex")) + " Expected: " + repr(data)) + repr(binascii.hexlify(r)) + " Expected: " + repr(data)) return GendCryptoTestCase From owner-svn-src-all@freebsd.org Tue May 21 00:46:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95B51597AED; Tue, 21 May 2019 00:46:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF736BACC; Tue, 21 May 2019 00:46: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2416426216; Tue, 21 May 2019 00:46: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 x4L0klwv090023; Tue, 21 May 2019 00:46:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L0kl2w090022; Tue, 21 May 2019 00:46:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210046.x4L0kl2w090022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 00:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348025 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DF736BACC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 00:46:48 -0000 Author: ngie Date: Tue May 21 00:46:47 2019 New Revision: 348025 URL: https://svnweb.freebsd.org/changeset/base/348025 Log: Unbreak the build when `ELF_VERBOSE` is defined after r348005 This change properly terminates the formatting string quote modification done in r348005, which is triggered when `ELF_VERBOSE` is defined. MFC with: r348005 Reported by: ci (amd64, gcc) Modified: head/stand/common/load_elf.c Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Tue May 21 00:30:29 2019 (r348024) +++ head/stand/common/load_elf.c Tue May 21 00:46:47 2019 (r348025) @@ -509,7 +509,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ off -= ehdr->e_entry & ~PAGE_MASK; ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("ehdr->e_entry 0x%jx", va<->pa off %llx\n", + printf("ehdr->e_entry 0x%jx, va<->pa off %llx\n", (uintmax_t)ehdr->e_entry, off); #endif #else From owner-svn-src-all@freebsd.org Tue May 21 01:10:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19BB7159924D; Tue, 21 May 2019 01:10:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 690256CB52; Tue, 21 May 2019 01:10:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4L1ALWi076421; Mon, 20 May 2019 18:10:21 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4L1AL4I076420; Mon, 20 May 2019 18:10:21 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905210110.x4L1AL4I076420@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347982 - head/sys/net In-Reply-To: <17209181558392377@myt4-ea6eba8eca77.qloud-c.yandex.net> To: "Alexander V. Chernikov" Date: Mon, 20 May 2019 18:10:21 -0700 (PDT) CC: "rgrimes@freebsd.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 690256CB52 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 01:10:27 -0000 > 20.05.2019, 07:50, "Rodney W. Grimes" : > >> ?Author: melifaro > >> ?Date: Sun May 19 21:49:56 2019 > >> ?New Revision: 347982 > >> ?URL: https://svnweb.freebsd.org/changeset/base/347982 > >> > >> ?Log: > >> ???Fix rt_ifa selection during loopback route insertion process. > >> ?????Currently such routes are added with a link-level IFA, which is > >> ?????plain wrong. Only after the insertion they get fixed by the special > >> ?????link_rtrequest() ifa handler. This behaviour complicates routing code > >> ?????and makes ifa selection more complex. > >> ???Streamline this process by explicitly moving link_rtrequest() logic > >> ?????to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all > >> ?????this logic in the loopback route case by explicitly specifying > >> ?????proper rt_ifa inside the ifa_maintain_loopback_route().? > >> > >> ???MFC after: 2 weeks > >> ???Differential Revision: https://reviews.freebsd.org/D20076 > > > > I shall again state that from a routing protocol perspecitive > > and a POLA perspective having the kernel doing route maintanance > > of any kind is fundementally wrong. > > > > I still continue to stronly object to ifa_maintain_loopback_route > > code even being present in our kernel. Having these routes > > is a micro optimization at best, and cause issues when real > > and actual routing protocols are in use. > I agree with that. It indeed causes decent amount of complications and I (as another router type person) prefer to have it gone as well. > However, one has to carefully check uRPF functionality in our firewalls, implement fib-aware in_localip_more (and its IPv6 counterpart) to make it happen. How about we implement the simplest next step, make this behavior either a kernel compile time option with #ifdef, and/or a sysctl to turn it off with a bit that defaults to current behavior while we investigate the harder solution? > > Bruce Evans and myself have locally killed this code, and > > just about every router type person I show it to gets ill > > seeing it. > > > > Show many another system that does this and I might reconsider, > > but I have never ever seen one. > > > >> ?Modified: > >> ???head/sys/net/if.c > >> ???head/sys/net/route.c ... > > > > Rod Grimes rgrimes@freebsd.org -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 01:18:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7EEA1599755; Tue, 21 May 2019 01:18:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7391E6D16D; Tue, 21 May 2019 01:18:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4870226722; Tue, 21 May 2019 01:18:48 +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 x4L1ImM0006040; Tue, 21 May 2019 01:18:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L1Ihfr006019; Tue, 21 May 2019 01:18:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905210118.x4L1Ihfr006019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 21 May 2019 01:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348026 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/freescale/imx arm/rockchip arm/ti/am335x compat/linuxkpi/common/src dev/drm2/ttm dev/fb dev/hdmi dev/iscsi_initiator dev/mlx... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/amlogic/aml8726 arm/freescale/imx arm/rockchip arm/ti/am335x compat/linuxkpi/common/src dev/drm2/ttm dev/fb dev/hdmi dev/iscsi_initiator dev/mlx4/mlx4_en dev/mlx5/mlx5_e... X-SVN-Commit-Revision: 348026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7391E6D16D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 01:18:49 -0000 Author: cem Date: Tue May 21 01:18:43 2019 New Revision: 348026 URL: https://svnweb.freebsd.org/changeset/base/348026 Log: Include eventhandler.h in more compilation units This was enumerated with exhaustive search for sys/eventhandler.h includes, cross-referenced against EVENTHANDLER_* usage with the comm(1) utility. Manual checking was performed to avoid redundant includes in some drivers where a common os_bsd.h (for example) included sys/eventhandler.h indirectly, but it is possible some of these are redundant with driver-specific headers in ways I didn't notice. (These CUs did not show up as missing eventhandler.h in tinderbox.) X-MFC-With: r347984 Modified: head/sys/arm/allwinner/a10_fb.c head/sys/arm/allwinner/a10_hdmi.c head/sys/arm/amlogic/aml8726/aml8726_wdt.c head/sys/arm/freescale/imx/imx6_ipu.c head/sys/arm/rockchip/rk30xx_wdog.c head/sys/arm/ti/am335x/am335x_lcd.c head/sys/arm/ti/am335x/tda19988.c head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/dev/drm2/ttm/ttm_page_alloc.c head/sys/dev/fb/creator.c head/sys/dev/fb/fbd.c head/sys/dev/hdmi/dwc_hdmi.c head/sys/dev/iscsi_initiator/iscsi.c head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/mips/atheros/ar531x/ar5315_wdog.c head/sys/mips/cavium/octeon_wdog.c head/sys/mips/ingenic/jz4780_lcd.c head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/arm/allwinner/a10_fb.c ============================================================================== --- head/sys/arm/allwinner/a10_fb.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/allwinner/a10_fb.c Tue May 21 01:18:43 2019 (r348026) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_hdmi.c ============================================================================== --- head/sys/arm/allwinner/a10_hdmi.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/allwinner/a10_hdmi.c Tue May 21 01:18:43 2019 (r348026) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/amlogic/aml8726/aml8726_wdt.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_wdt.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/amlogic/aml8726/aml8726_wdt.c Tue May 21 01:18:43 2019 (r348026) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/freescale/imx/imx6_ipu.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ipu.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/freescale/imx/imx6_ipu.c Tue May 21 01:18:43 2019 (r348026) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_wdog.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/rockchip/rk30xx_wdog.c Tue May 21 01:18:43 2019 (r348026) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/ti/am335x/am335x_lcd.c Tue May 21 01:18:43 2019 (r348026) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/ti/am335x/tda19988.c ============================================================================== --- head/sys/arm/ti/am335x/tda19988.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/arm/ti/am335x/tda19988.c Tue May 21 01:18:43 2019 (r348026) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 21 01:18:43 2019 (r348026) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Tue May 21 01:18:43 2019 (r348026) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t)) Modified: head/sys/dev/fb/creator.c ============================================================================== --- head/sys/dev/fb/creator.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/fb/creator.c Tue May 21 01:18:43 2019 (r348026) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/fb/fbd.c Tue May 21 01:18:43 2019 (r348026) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/hdmi/dwc_hdmi.c ============================================================================== --- head/sys/dev/hdmi/dwc_hdmi.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/hdmi/dwc_hdmi.c Tue May 21 01:18:43 2019 (r348026) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi_initiator/iscsi.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/iscsi_initiator/iscsi.c Tue May 21 01:18:43 2019 (r348026) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DO_EVENTHANDLER +#include +#endif #include #include #include Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Tue May 21 01:18:43 2019 (r348026) @@ -47,6 +47,7 @@ #include #include +#include #include #include Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue May 21 01:18:43 2019 (r348026) @@ -27,6 +27,7 @@ #include "en.h" +#include #include #include Modified: head/sys/mips/atheros/ar531x/ar5315_wdog.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_wdog.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/mips/atheros/ar531x/ar5315_wdog.c Tue May 21 01:18:43 2019 (r348026) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/mips/cavium/octeon_wdog.c ============================================================================== --- head/sys/mips/cavium/octeon_wdog.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/mips/cavium/octeon_wdog.c Tue May 21 01:18:43 2019 (r348026) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/mips/ingenic/jz4780_lcd.c ============================================================================== --- head/sys/mips/ingenic/jz4780_lcd.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/mips/ingenic/jz4780_lcd.c Tue May 21 01:18:43 2019 (r348026) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Tue May 21 01:18:43 2019 (r348026) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "core_priv.h" +#include #include #include Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue May 21 01:18:43 2019 (r348026) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "ipoib.h" +#include static int ipoib_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Tue May 21 00:46:47 2019 (r348025) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Tue May 21 01:18:43 2019 (r348026) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include From owner-svn-src-all@freebsd.org Tue May 21 01:27:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42BF11599C29; Tue, 21 May 2019 01:27:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD2B86D7E0; Tue, 21 May 2019 01:27:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B51C0268CB; Tue, 21 May 2019 01:27:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L1R8Al011211; Tue, 21 May 2019 01:27:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L1R8xi011210; Tue, 21 May 2019 01:27:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905210127.x4L1R8xi011210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 May 2019 01:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348027 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 348027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD2B86D7E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 01:27:09 -0000 Author: markj Date: Tue May 21 01:27:08 2019 New Revision: 348027 URL: https://svnweb.freebsd.org/changeset/base/348027 Log: MFC r347570: Specify -z notext when building with -z ifunc-noplt. Modified: stable/12/sys/conf/kern.pre.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/kern.pre.mk ============================================================================== --- stable/12/sys/conf/kern.pre.mk Tue May 21 01:18:43 2019 (r348026) +++ stable/12/sys/conf/kern.pre.mk Tue May 21 01:27:08 2019 (r348027) @@ -131,7 +131,7 @@ LDFLAGS+= -z max-page-size=2097152 .if ${LINKER_TYPE} != "lld" LDFLAGS+= -z common-page-size=4096 .else -LDFLAGS+= -z ifunc-noplt +LDFLAGS+= -z notext -z ifunc-noplt .endif .endif From owner-svn-src-all@freebsd.org Tue May 21 01:30:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F3F1599CFD; Tue, 21 May 2019 01:30:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 162CE6D967; Tue, 21 May 2019 01:30:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4L1UQrf076512; Mon, 20 May 2019 18:30:26 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4L1UQhN076511; Mon, 20 May 2019 18:30:26 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905210130.x4L1UQhN076511@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348012 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail In-Reply-To: <201905202133.x4KLXMPE088717@repo.freebsd.org> To: Brooks Davis Date: Mon, 20 May 2019 18:30:26 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@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-Rspamd-Queue-Id: 162CE6D967 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 01:30:29 -0000 > Author: brooks > Date: Mon May 20 21:33:22 2019 > New Revision: 348012 > URL: https://svnweb.freebsd.org/changeset/base/348012 > > Log: > MFC r347963: > > Change ed(4), ep(4), and fxp(4) examples to em(4). > > ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains > popular in older systems, but isn't as future proof as em(4). > > Reviewed by: bz, jhb > Differential Revision: https://reviews.freebsd.org/D20311 Though this made since to me in head, it does not in stable, as you may of just broke someones running system when they do a merge master if they happened to of depended on the very long standing defaults of fxp that are NOT in comment lines below. IMHO we should not change user visible defaults in /etc/defaults/rc.conf on a brance, mininal is this requires some form of merge master update notice mechanism which we do not have. Should of laso been tagged Release Notes: Yes. > > Modified: > stable/12/libexec/rc/rc.conf > stable/12/sbin/ifconfig/ifconfig.8 > stable/12/share/man/man5/rc.conf.5 > stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall > stable/12/usr.sbin/jail/jail.8 > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/libexec/rc/rc.conf > ============================================================================== > --- stable/12/libexec/rc/rc.conf Mon May 20 21:23:33 2019 (r348011) > +++ stable/12/libexec/rc/rc.conf Mon May 20 21:33:22 2019 (r348012) > @@ -121,9 +121,9 @@ hostid_file="/etc/hostid" # File with hostuuid. > nisdomainname="NO" # Set to NIS domain if using NIS (or NO). > dhclient_program="/sbin/dhclient" # Path to dhcp client program. > dhclient_flags="" # Extra flags to pass to dhcp client. > -#dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only > +#dhclient_flags_em0="" # Extra dhclient flags for em0 only > background_dhclient="NO" # Start dhcp client in the background. > -#background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. > +#background_dhclient_em0="YES" # Start dhcp client on em0 in the background. > synchronous_dhclient="NO" # Start dhclient directly on configured > # interfaces during startup. > defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. > @@ -147,19 +147,19 @@ firewall_client_net="192.0.2.0/24" # IPv4 Network addr > # firewall. > #firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for > # "client" firewall. > -firewall_simple_iif="ed1" # Inside network interface for "simple" > +firewall_simple_iif="em1" # Inside network interface for "simple" The effects active real possible used default value, though low likely hood being edX. > firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple" > # firewall. > -firewall_simple_oif="ed0" # Outside network interface for "simple" > +firewall_simple_oif="em0" # Outside network interface for "simple" > # firewall. > firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple" > # firewall. > -#firewall_simple_iif_ipv6="ed1" # Inside IPv6 network interface for "simple" > +#firewall_simple_iif_ipv6="em1" # Inside IPv6 network interface for "simple" > # firewall. > #firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix > # for "simple" firewall. > -#firewall_simple_oif_ipv6="ed0" # Outside IPv6 network interface for "simple" > +#firewall_simple_oif_ipv6="em0" # Outside IPv6 network interface for "simple" > # firewall. > #firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix > # for "simple" firewall. > @@ -241,14 +241,14 @@ cloned_interfaces="" # List of cloned network interfa > #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. > #ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. > #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. > -#ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry > -#ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias > -#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. > -#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device > +#ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry > +#ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias > +#ifconfig_em0_name="net0" # Change interface name from em0 to net0. > +#vlans_em0="101 vlan0" # vlan(4) interfaces for em0 device > #create_args_vlan0="vlan 102" # vlan tag for vlan0 device > #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device > #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlandebug(8) > -#ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. > +#ipv4_addrs_em0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. > # > #autobridge_interfaces="bridge0" # List of bridges to check > #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge > @@ -336,7 +336,7 @@ bootparamd_flags="" # Flags to bootparamd > pppoed_enable="NO" # Run the PPP over Ethernet daemon. > pppoed_provider="*" # Provider and ppp(8) config file entry. > pppoed_flags="-P /var/run/pppoed.pid" # Flags to pppoed (if enabled). > -pppoed_interface="fxp0" # The interface that pppoed runs on. > +pppoed_interface="em0" # The interface that pppoed runs on. This one effects a higher likely used default. > sshd_enable="NO" # Enable sshd > sshd_program="/usr/sbin/sshd" # path to sshd, if you want a different one. > sshd_flags="" # Additional flags for sshd. > @@ -506,11 +506,11 @@ route6d_flags="" # Flags to IPv6 routing daemon. > # addrs. > #route6d_flags="-q" # If you want to run a routing daemon on an end > # node, you should stop advertisement. > -#ipv6_network_interfaces="ed0 ep0" # Examples for router > +#ipv6_network_interfaces="em0 em1" # Examples for router > # or static configuration for end node. > # Choose correct prefix value. > -#ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. > -#ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. > +#ipv6_prefix_em0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. > +#ipv6_prefix_em1="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. > ipv6_default_interface="NO" # Default output interface for scoped addrs. > # This works only with > # ipv6_gateway_enable="NO". > > Modified: stable/12/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- stable/12/sbin/ifconfig/ifconfig.8 Mon May 20 21:23:33 2019 (r348011) > +++ stable/12/sbin/ifconfig/ifconfig.8 Mon May 20 21:33:22 2019 (r348012) > @@ -28,7 +28,7 @@ > .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 > .\" $FreeBSD$ > .\" > -.Dd June 27, 2018 > +.Dd May 18, 2019 > .Dt IFCONFIG 8 > .Os > .Sh NAME > @@ -196,7 +196,7 @@ This > parameter is a string of the form > .Dq name unit , > for example, > -.Dq Li ed0 . > +.Dq Li em0 . > .It Ar groupname > List the interfaces in the given group. > .El > @@ -2919,26 +2919,26 @@ Assign the IPv4 address > with a network mask of > .Li 255.255.255.0 , > to the interface > -.Li fxp0 : > -.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0 > +.Li em0 : > +.Dl # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0 > .Pp > Add the IPv4 address > .Li 192.0.2.45 , > with the CIDR network prefix > .Li /28 , > to the interface > -.Li ed0 , > +.Li em0 , > using > .Cm add > as a synonym for the canonical form of the option > .Cm alias : > -.Dl # ifconfig ed0 inet 192.0.2.45/28 add > +.Dl # ifconfig em0 inet 192.0.2.45/28 add > .Pp > Remove the IPv4 address > .Li 192.0.2.45 > from the interface > -.Li ed0 : > -.Dl # ifconfig ed0 inet 192.0.2.45 -alias > +.Li em0 : > +.Dl # ifconfig em0 inet 192.0.2.45 -alias > .Pp > Enable IPv6 functionality of the interface: > .Dl # ifconfig em0 inet6 -ifdisabled > > Modified: stable/12/share/man/man5/rc.conf.5 > ============================================================================== > --- stable/12/share/man/man5/rc.conf.5 Mon May 20 21:23:33 2019 (r348011) > +++ stable/12/share/man/man5/rc.conf.5 Mon May 20 21:33:22 2019 (r348012) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 21, 2019 > +.Dd May 18, 2019 > .Dt RC.CONF 5 > .Os > .Sh NAME > @@ -1262,11 +1262,11 @@ It is possible to add IP alias entries using > syntax with the address family keyword such as > .Li inet . > Assuming that the interface in question was > -.Li ed0 , > +.Li em0 , > it might look something like this: > .Bd -literal > -ifconfig_ed0_alias0="inet 127.0.0.253 netmask 0xffffffff" > -ifconfig_ed0_alias1="inet 127.0.0.254 netmask 0xffffffff" > +ifconfig_em0_alias0="inet 127.0.0.253 netmask 0xffffffff" > +ifconfig_em0_alias1="inet 127.0.0.254 netmask 0xffffffff" > .Ed > .Pp > It also possible to configure multiple IP addresses in Classless > @@ -1306,11 +1306,11 @@ not for the other address families such as > .Li inet6 . > .Pp > With the interface in question being > -.Li ed0 , > +.Li em0 , > an example could look like: > .Bd -literal > -ifconfig_ed0_alias2="inet 192.0.2.129/27" > -ifconfig_ed0_alias3="inet 192.0.2.1-5/28" > +ifconfig_em0_alias2="inet 192.0.2.129/27" > +ifconfig_em0_alias3="inet 192.0.2.1-5/28" > .Ed > .Pp > and so on. > @@ -1332,10 +1332,10 @@ its contents are passed to > Execution stops at the first unsuccessful access, so if > something like this is present: > .Bd -literal > -ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" > -ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" > -ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" > -ifconfig_ed0_alias4="inet 127.0.0.254 netmask 0xffffffff" > +ifconfig_em0_alias0="inet 127.0.0.251 netmask 0xffffffff" > +ifconfig_em0_alias1="inet 127.0.0.252 netmask 0xffffffff" > +ifconfig_em0_alias2="inet 127.0.0.253 netmask 0xffffffff" > +ifconfig_em0_alias4="inet 127.0.0.254 netmask 0xffffffff" > .Ed > .Pp > Then note that alias4 would > @@ -1351,7 +1351,7 @@ variable, which has the same functionality as > .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n > and can have all of entries in a variable like the following: > .Bd -literal > -ifconfig_ed0_aliases="\\ > +ifconfig_em0_aliases="\\ > inet 127.0.0.251 netmask 0xffffffff \\ > inet 127.0.0.252 netmask 0xffffffff \\ > inet 127.0.0.253 netmask 0xffffffff \\ > @@ -1458,11 +1458,11 @@ to the > .Va ifconfig_ Ns Aq Ar interface > variable. > For instance, to initialize the > -.Li ed0 > +.Li em0 > device via DHCP, > it is possible to use something like: > .Bd -literal > -ifconfig_ed0="DHCP" > +ifconfig_em0="DHCP" > .Ed > .Pp > If you want to configure your wireless interface with > @@ -1513,7 +1513,7 @@ variable. > .Pp > It is also possible to rename an interface by doing: > .Bd -literal > -ifconfig_ed0_name="net0" > +ifconfig_em0_name="net0" > ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" > .Ed > .It Va ipv6_enable > @@ -1686,8 +1686,8 @@ with > keyword. > For example: > .Bd -literal > -ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" > -ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" > +ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" > +ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" > .Ed > .Pp > Interfaces that have an > @@ -1714,7 +1714,7 @@ defined in > If only a link-local address is needed on the interface, > the following configuration can be used: > .Bd -literal > -ifconfig_ed0_ipv6="inet6 auto_linklocal" > +ifconfig_em0_ipv6="inet6 auto_linklocal" > .Ed > .Pp > A link-local address can also be configured manually. > @@ -1723,7 +1723,7 @@ so that it does not change when the network interface > card is replaced. > For example: > .Bd -literal > -ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" > +ifconfig_em0_ipv6="inet6 fe80::1 prefixlen 64" > .Ed > .It Va ipv6_prefix_ Ns Aq Ar interface > .Pq Vt str > @@ -1737,15 +1737,15 @@ is empty. > .Pp > For example, the following configuration > .Bd -literal > -ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0" > +ipv6_prefix_em0="2001:db8:1:0 2001:db8:2:0" > .Ed > .Pp > is equivalent to the following: > .Bd -literal > -ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" > -ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" > -ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" > -ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" > +ifconfig_em0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" > +ifconfig_em0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" > +ifconfig_em0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" > +ifconfig_em0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" > .Ed > .Pp > These Subnet-Router anycast addresses will be added only when > > Modified: stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall > ============================================================================== > --- stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Mon May 20 21:23:33 2019 (r348011) > +++ stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Mon May 20 21:33:22 2019 (r348012) > @@ -195,13 +195,13 @@ case ${firewall_type} in > ############ > > # set these to your outside interface network and netmask and ip > - oif="ed0" > + oif="em0" > onet="192.0.2.0" > omask="255.255.255.240" > oip="192.0.2.1" > > # set these to your inside interface network and netmask and ip > - iif="ed1" > + iif="em1" > inet="192.0.2.16" > imask="255.255.255.240" > iip="192.0.2.17" > > Modified: stable/12/usr.sbin/jail/jail.8 > ============================================================================== > --- stable/12/usr.sbin/jail/jail.8 Mon May 20 21:23:33 2019 (r348011) > +++ stable/12/usr.sbin/jail/jail.8 Mon May 20 21:33:22 2019 (r348012) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 10, 2018 > +.Dd May 18, 2019 > .Dt JAIL 8 > .Os > .Sh NAME > @@ -1099,7 +1099,7 @@ testjail { > mount.devfs; > host.hostname = testhostname; > ip4.addr = 192.0.2.100; > - interface = ed0; > + interface = em0; > exec.start = "/bin/sh /etc/rc"; > exec.stop = "/bin/sh /etc/rc.shutdown"; > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 01:42:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C52159A29E; Tue, 21 May 2019 01:42:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F0E06E171; Tue, 21 May 2019 01:42:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47FA826C26; Tue, 21 May 2019 01:42:58 +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 x4L1gwU8021506; Tue, 21 May 2019 01:42:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L1gw4d021505; Tue, 21 May 2019 01:42:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905210142.x4L1gw4d021505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 21 May 2019 01:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348028 - head/stand/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/stand/powerpc X-SVN-Commit-Revision: 348028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F0E06E171 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 01:42:59 -0000 Author: jhibbits Date: Tue May 21 01:42:57 2019 New Revision: 348028 URL: https://svnweb.freebsd.org/changeset/base/348028 Log: stand/powerpc: Only build loader.kboot for powerpc64 kboot is only made for powerpc64 systems, not 32-bit systems. This unbreaks the build for powerpcspe. Reported by: ngie Modified: head/stand/powerpc/Makefile Modified: head/stand/powerpc/Makefile ============================================================================== --- head/stand/powerpc/Makefile Tue May 21 01:27:08 2019 (r348027) +++ head/stand/powerpc/Makefile Tue May 21 01:42:57 2019 (r348028) @@ -5,6 +5,9 @@ NO_OBJ=t .include SUBDIR.yes= boot1.chrp ofw uboot + +.if "${TARGET_ARCH}" == "powerpc64" SUBDIR.${MK_FDT}+= kboot +.endif .include From owner-svn-src-all@freebsd.org Tue May 21 02:13:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00838159AF68; Tue, 21 May 2019 02:13:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD736F10E; Tue, 21 May 2019 02:13: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75C242714F; Tue, 21 May 2019 02:13: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 x4L2Dksr037566; Tue, 21 May 2019 02:13:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2DkbQ037565; Tue, 21 May 2019 02:13:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210213.x4L2DkbQ037565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 02:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348031 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CD736F10E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:13:47 -0000 Author: ngie Date: Tue May 21 02:13:46 2019 New Revision: 348031 URL: https://svnweb.freebsd.org/changeset/base/348031 Log: Squash deprecation warning related to array.array(..).tostring() In version 3.2+, `array.array(..).tostring()` was renamed to `array.array(..).tobytes()`. Conditionally call `array.array(..).tobytes()` if the python version is 3.2+. PR: 237403 MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:02:09 2019 (r348030) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:13:46 2019 (r348031) @@ -38,6 +38,7 @@ import os import random import signal from struct import pack as _pack +import sys import time import dpkt @@ -151,6 +152,11 @@ def _findop(crid, name): return fop.crid, name +def array_tobytes(array_obj): + if sys.version_info[:2] >= (3, 2): + return array_obj.tobytes() + return array_obj.tostring() + class Crypto: @staticmethod def findcrid(name): @@ -218,9 +224,9 @@ class Crypto: #print('cop:', cop) ioctl(_cryptodev, CIOCCRYPT, str(cop)) - s = s.tostring() + s = array_tobytes(s) if self._maclen is not None: - return s, m.tostring() + return s, array_tobytes(m) return s @@ -255,9 +261,9 @@ class Crypto: ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) - s = s.tostring() + s = array_tobytes(s) - return s, tag.tostring() + return s, array_tobytes(tag) def perftest(self, op, size, timeo=3): inp = array.array('B', (random.randint(0, 255) for x in range(size))) From owner-svn-src-all@freebsd.org Tue May 21 02:30:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791A4159E436; Tue, 21 May 2019 02:30:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8626F7BE; Tue, 21 May 2019 02:30:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDEFD27304; Tue, 21 May 2019 02:30:43 +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 x4L2UhTD042970; Tue, 21 May 2019 02:30:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2Uhl2042968; Tue, 21 May 2019 02:30:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210230.x4L2Uhl2042968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 02:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348032 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F8626F7BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:30:44 -0000 Author: ngie Date: Tue May 21 02:30:43 2019 New Revision: 348032 URL: https://svnweb.freebsd.org/changeset/base/348032 Log: Fix `KAT(CCM)?Parser` file descriptor leaks Make `KAT(CCM)?Parser` into a context suite-capable object by implementing `__enter__` and `__exit__` methods which manage opening up the file descriptors and closing them on context exit. This implementation was decided over adding destructor logic to a `__del__` method, as there are a number of issues around object lifetimes when dealing with threading cleanup, atexit handlers, and a number of other less obvious edgecases. Plus, the architected solution is more pythonic and clean. Complete the iterator implementation by implementing a `__next__` method for both classes which handles iterating over the data using a generator pattern, and by changing `__iter__` to return the object instead of the data which it would iterate over. Alias the `__next__` method to `next` when working with python 2.x in order to maintain functional compatibility between the two major versions. As part of this work and to ensure readability, push the initialization of the parser objects up one layer and pass it down to a helper function. This could have been done via a decorator, but I was trying to keep it simple for other developers to make it easier to modify in the future. This fixes ResourceWarnings with python 3. PR: 237403 MFC after: 1 week Tested with: python 2.7.16 (amd64), python 3.6.8 (amd64) Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:13:46 2019 (r348031) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:30:43 2019 (r348032) @@ -323,11 +323,23 @@ class MismatchError(Exception): class KATParser: def __init__(self, fname, fields): - self.fp = open(fname) self.fields = set(fields) self._pending = None + self.fname = fname + self.fp = None + def __enter__(self): + self.fp = open(self.fname) + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + if self.fp is not None: + self.fp.close() + def __iter__(self): + return self + + def __next__(self): while True: didread = False if self._pending is not None: @@ -340,13 +352,14 @@ class KATParser: if didread and not i: return - if (i and i[0] == '#') or not i.strip(): - continue - if i[0] == '[': - yield i[1:].split(']', 1)[0], self.fielditer() - else: - raise ValueError('unknown line: %r' % repr(i)) + if not i.startswith('#') and i.strip(): + break + if i[0] == '[': + yield i[1:].split(']', 1)[0], self.fielditer() + else: + raise ValueError('unknown line: %r' % repr(i)) + def eatblanks(self): while True: line = self.fp.readline() @@ -400,10 +413,19 @@ class KATParser: # section. class KATCCMParser: def __init__(self, fname): - self.fp = open(fname) self._pending = None + self.fname = fname + self.fp = None + + def __enter__(self): + self.fp = open(self.fname) self.read_globals() + return self + def __exit__(self, exc_type, exc_value, exc_tb): + if self.fp is not None: + self.fp.close() + def read_globals(self): self.global_values = {} while True: @@ -463,6 +485,9 @@ class KATCCMParser: self.section_values[f] = v def __iter__(self): + return self + + def __next__(self): while True: if self._pending: line = self._pending @@ -503,6 +528,10 @@ class KATCCMParser: def _spdechex(s): return binascii.hexlify(''.join(s.split())) +if sys.version_info[0] < 3: + KATCCMParser.next = KATCCMParser.__next__ + KATParser.next = KATParser.__next__ + if __name__ == '__main__': if True: try: @@ -518,11 +547,13 @@ if __name__ == '__main__': except IOError: pass elif False: - kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ]) - for mode, ni in kp: - print(i, ni) - for j in ni: - print(j) + columns = [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ] + fname = '/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp' + with KATParser(fname, columns) as kp: + for mode, ni in kp: + print(i, ni) + for j in ni: + print(j) elif False: key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') iv = _spdechex('00000000000000000000000000000001') Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Tue May 21 02:13:46 2019 (r348031) +++ head/tests/sys/opencrypto/cryptotest.py Tue May 21 02:30:43 2019 (r348032) @@ -104,8 +104,12 @@ def GenTestCase(cname): else: raise RuntimeError('unknown mode: %r' % repr(mode)) - for bogusmode, lines in cryptodev.KATParser(fname, - [ 'Count', 'Key', 'IV', 'CT', 'AAD', 'Tag', 'PT', ]): + columns = [ 'Count', 'Key', 'IV', 'CT', 'AAD', 'Tag', 'PT', ] + with cryptodev.KATParser(fname, columns) as parser: + self.runGCMWithParser(parser, mode) + + def runGCMWithParser(self, parser, mode): + for _, lines in next(parser): for data in lines: curcnt = int(data['Count']) cipherkey = binascii.unhexlify(data['Key']) @@ -166,9 +170,13 @@ def GenTestCase(cname): repr(data)) def runCBC(self, fname): + columns = [ 'COUNT', 'KEY', 'IV', 'PLAINTEXT', 'CIPHERTEXT', ] + with cryptodev.KATParser(fname, columns) as parser: + self.runCBCWithParser(parser) + + def runCBCWithParser(self, parser): curfun = None - for mode, lines in cryptodev.KATParser(fname, - [ 'COUNT', 'KEY', 'IV', 'PLAINTEXT', 'CIPHERTEXT', ]): + for mode, lines in next(parser): if mode == 'ENCRYPT': swapptct = False curfun = Crypto.encrypt @@ -193,10 +201,14 @@ def GenTestCase(cname): self.assertEqual(r, ct) def runXTS(self, fname, meth): + columns = [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', + 'CT'] + with cryptodev.KATParser(fname, columns) as parser: + self.runXTSWithParser(parser, meth) + + def runXTSWithParser(self, parser, meth): curfun = None - for mode, lines in cryptodev.KATParser(fname, - [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', - 'CT' ]): + for mode, lines in next(parser): if mode == 'ENCRYPT': swapptct = False curfun = Crypto.encrypt @@ -231,7 +243,11 @@ def GenTestCase(cname): self.assertEqual(r, ct) def runCCMEncrypt(self, fname): - for data in cryptodev.KATCCMParser(fname): + with cryptodev.KATCCMParser(fname) as parser: + self.runCCMEncryptWithParser(parser) + + def runCCMEncryptWithParser(self, parser): + for data in next(parser): Nlen = int(data['Nlen']) if Nlen != 12: # OCF only supports 12 byte IVs @@ -266,11 +282,15 @@ def GenTestCase(cname): repr(data) + " on " + cname) def runCCMDecrypt(self, fname): + with cryptodev.KATCCMParser(fname) as parser: + self.runCCMDecryptWithParser(parser) + + def runCCMDecryptWithParser(self, parser): # XXX: Note that all of the current CCM # decryption test vectors use IV and tag sizes # that aren't supported by OCF none of the # tests are actually ran. - for data in cryptodev.KATCCMParser(fname): + for data in next(parser): Nlen = int(data['Nlen']) if Nlen != 12: # OCF only supports 12 byte IVs @@ -326,9 +346,13 @@ def GenTestCase(cname): self.runTDES(i) def runTDES(self, fname): + columns = [ 'COUNT', 'KEYs', 'IV', 'PLAINTEXT', 'CIPHERTEXT', ] + with cryptodev.KATParser(fname, columns) as parser: + self.runTDESWithParser(parser) + + def runTDESWithParser(self, parser): curfun = None - for mode, lines in cryptodev.KATParser(fname, - [ 'COUNT', 'KEYs', 'IV', 'PLAINTEXT', 'CIPHERTEXT', ]): + for mode, lines in next(parser): if mode == 'ENCRYPT': swapptct = False curfun = Crypto.encrypt @@ -365,9 +389,12 @@ def GenTestCase(cname): # Skip SHA512_(224|256) tests if fname.find('SHA512_') != -1: return + columns = [ 'Len', 'Msg', 'MD' ] + with cryptodev.KATParser(fname, columns) as parser: + self.runSHAWithParser(parser) - for hashlength, lines in cryptodev.KATParser(fname, - [ 'Len', 'Msg', 'MD' ]): + def runSHAWithParser(self, parser): + for hashlength, lines in next(parser): # E.g., hashlength will be "L=20" (bytes) hashlen = int(hashlength.split("=")[1]) @@ -413,8 +440,12 @@ def GenTestCase(cname): self.runSHA1HMAC(i) def runSHA1HMAC(self, fname): - for hashlength, lines in cryptodev.KATParser(fname, - [ 'Count', 'Klen', 'Tlen', 'Key', 'Msg', 'Mac' ]): + columns = [ 'Count', 'Klen', 'Tlen', 'Key', 'Msg', 'Mac' ] + with cryptodev.KATParser(fname, columns) as parser: + self.runSHA1HMACWithParser(parser) + + def runSHA1HMACWithParser(self, parser): + for hashlength, lines in next(parser): # E.g., hashlength will be "L=20" (bytes) hashlen = int(hashlength.split("=")[1]) From owner-svn-src-all@freebsd.org Tue May 21 02:31:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D46B159E4B4; Tue, 21 May 2019 02:31:35 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107D36F98D; Tue, 21 May 2019 02:31:35 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEB6927363; Tue, 21 May 2019 02:31:34 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L2VYXI046844; Tue, 21 May 2019 02:31:34 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2VYEl046841; Tue, 21 May 2019 02:31:34 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905210231.x4L2VYEl046841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 21 May 2019 02:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348033 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 348033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 107D36F98D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:31:35 -0000 Author: johalun Date: Tue May 21 02:31:34 2019 New Revision: 348033 URL: https://svnweb.freebsd.org/changeset/base/348033 Log: MFC r347592: LinuxKPI: Let del_timer return a value to match Linux. This patch is part of https://reviews.freebsd.org/D19565. Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/timer.h stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/timer.h Tue May 21 02:30:43 2019 (r348032) +++ stable/12/sys/compat/linuxkpi/common/include/linux/timer.h Tue May 21 02:31:34 2019 (r348033) @@ -81,8 +81,8 @@ extern unsigned long linux_timer_hz_mask; extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); +extern int del_timer(struct timer_list *); -#define del_timer(timer) (void)callout_stop(&(timer)->callout) #define del_timer_sync(timer) (void)callout_drain(&(timer)->callout) #define timer_pending(timer) callout_pending(&(timer)->callout) #define round_jiffies(j) \ Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 21 02:30:43 2019 (r348032) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 21 02:31:34 2019 (r348033) @@ -1906,6 +1906,15 @@ add_timer_on(struct timer_list *timer, int cpu) &linux_timer_callback_wrapper, timer, cpu); } +int +del_timer(struct timer_list *timer) +{ + + if (callout_stop(&(timer)->callout) == -1) + return (0); + return (1); +} + static void linux_timer_init(void *arg) { From owner-svn-src-all@freebsd.org Tue May 21 02:38:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A1B9159E887; Tue, 21 May 2019 02:38:22 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD8256FD2D; Tue, 21 May 2019 02:38:21 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9150F274B8; Tue, 21 May 2019 02:38:21 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L2cLQ5048258; Tue, 21 May 2019 02:38:21 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2cLoA048257; Tue, 21 May 2019 02:38:21 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905210238.x4L2cLoA048257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 21 May 2019 02:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348035 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD8256FD2D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:38:22 -0000 Author: johalun Date: Tue May 21 02:38:21 2019 New Revision: 348035 URL: https://svnweb.freebsd.org/changeset/base/348035 Log: MFC r347601: LinuxKPI: Add prepare to pm_ops and bump FreeBSD version. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/device.h Tue May 21 02:36:12 2019 (r348034) +++ stable/12/sys/compat/linuxkpi/common/include/linux/device.h Tue May 21 02:38:21 2019 (r348035) @@ -61,6 +61,7 @@ struct class { }; struct dev_pm_ops { + int (*prepare)(struct device *dev); int (*suspend)(struct device *dev); int (*suspend_late)(struct device *dev); int (*resume)(struct device *dev); From owner-svn-src-all@freebsd.org Tue May 21 02:36:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 770B8159E7CB; Tue, 21 May 2019 02:36:13 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 148626FC05; Tue, 21 May 2019 02:36:13 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4EB9274B5; Tue, 21 May 2019 02:36:12 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L2aCna048109; Tue, 21 May 2019 02:36:12 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2aCSO048108; Tue, 21 May 2019 02:36:12 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905210236.x4L2aCSO048108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 21 May 2019 02:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348034 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 148626FC05 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:36:13 -0000 Author: johalun Date: Tue May 21 02:36:12 2019 New Revision: 348034 URL: https://svnweb.freebsd.org/changeset/base/348034 Log: MFC r347600: LinuxKPI: Add vm_fault_t type. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Tue May 21 02:31:34 2019 (r348033) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mm_types.h Tue May 21 02:36:12 2019 (r348034) @@ -35,6 +35,8 @@ #include +typedef int vm_fault_t; + struct vm_area_struct; struct task_struct; From owner-svn-src-all@freebsd.org Tue May 21 02:42:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3236159EC6C; Tue, 21 May 2019 02:42:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71235701B4; Tue, 21 May 2019 02:42:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 480EF27675; Tue, 21 May 2019 02:42:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L2gh8H053131; Tue, 21 May 2019 02:42:43 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2gh1c053130; Tue, 21 May 2019 02:42:43 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905210242.x4L2gh1c053130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 21 May 2019 02:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348036 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 348036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71235701B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:42:44 -0000 Author: johalun Date: Tue May 21 02:42:42 2019 New Revision: 348036 URL: https://svnweb.freebsd.org/changeset/base/348036 Log: Bump FreeBSD version after change to struct in linuxkpi from r348035. Modified: stable/12/sys/sys/param.h Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue May 21 02:38:21 2019 (r348035) +++ stable/12/sys/sys/param.h Tue May 21 02:42:42 2019 (r348036) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200509 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue May 21 02:49:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8938B159EE2F; Tue, 21 May 2019 02:49:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E98F70513; Tue, 21 May 2019 02:49: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01EC52767E; Tue, 21 May 2019 02:49: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 x4L2nFGm053643; Tue, 21 May 2019 02:49:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L2nFKm053642; Tue, 21 May 2019 02:49:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210249.x4L2nFKm053642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 02:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348039 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E98F70513 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 02:49:16 -0000 Author: ngie Date: Tue May 21 02:49:15 2019 New Revision: 348039 URL: https://svnweb.freebsd.org/changeset/base/348039 Log: Remove spurious newline Even though some python styles suggest there should be multiple newlines between methods/classes, for consistency with the surrounding code, it's best to be consistent by having merely one newline between each functional block. MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:46:00 2019 (r348038) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 02:49:15 2019 (r348039) @@ -524,7 +524,6 @@ class KATCCMParser: yield values - def _spdechex(s): return binascii.hexlify(''.join(s.split())) From owner-svn-src-all@freebsd.org Tue May 21 03:05:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B26F8159F955; Tue, 21 May 2019 03:05:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 516CA71352; Tue, 21 May 2019 03:05:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2726227A3F; Tue, 21 May 2019 03:05:25 +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 x4L35Pbr064928; Tue, 21 May 2019 03:05:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L35PBl064927; Tue, 21 May 2019 03:05:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905210305.x4L35PBl064927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 21 May 2019 03:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348040 - head/stand/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/stand/powerpc X-SVN-Commit-Revision: 348040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 516CA71352 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 03:05:25 -0000 Author: jhibbits Date: Tue May 21 03:05:24 2019 New Revision: 348040 URL: https://svnweb.freebsd.org/changeset/base/348040 Log: stand: TARGET_ARCH is spelled MACHINE_ARCH in Makefiles Reported by: imp Modified: head/stand/powerpc/Makefile Modified: head/stand/powerpc/Makefile ============================================================================== --- head/stand/powerpc/Makefile Tue May 21 02:49:15 2019 (r348039) +++ head/stand/powerpc/Makefile Tue May 21 03:05:24 2019 (r348040) @@ -6,7 +6,7 @@ NO_OBJ=t SUBDIR.yes= boot1.chrp ofw uboot -.if "${TARGET_ARCH}" == "powerpc64" +.if "${MACHINE_ARCH}" == "powerpc64" SUBDIR.${MK_FDT}+= kboot .endif From owner-svn-src-all@freebsd.org Tue May 21 03:52:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A258F15A176A; Tue, 21 May 2019 03:52:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0167302B; Tue, 21 May 2019 03:52:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6C8330B; Tue, 21 May 2019 03:52: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 x4L3qmWV090981; Tue, 21 May 2019 03:52:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L3qm5X090980; Tue, 21 May 2019 03:52:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210352.x4L3qm5X090980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 03:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348042 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C0167302B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 03:52:49 -0000 Author: ngie Date: Tue May 21 03:52:48 2019 New Revision: 348042 URL: https://svnweb.freebsd.org/changeset/base/348042 Log: Fix encoding issues with python 3 In python 3, the default encoding was switched from ascii character sets to unicode character sets in order to support internationalization by default. Some interfaces, like ioctls and packets, however, specify data in terms of non-unicode encodings formats, either in host endian (`fcntl.ioctl`) or network endian (`dpkt`) byte order/format. This change alters assumptions made by previous code where it was all data objects were assumed to be basestrings, when they should have been treated as byte arrays. In order to achieve this the following are done: * str objects with encodings needing to be encoded as ascii byte arrays are done so via `.encode("ascii")`. In order for this to work on python 3 in a type agnostic way (as it anecdotally varied depending on the caller), call `.encode("ascii")` only on str objects with python 3 to cast them to ascii byte arrays in a helper function name `str_to_ascii(..)`. * `dpkt.Packet` objects needing to be passed in to `fcntl.ioctl(..)` are done so by casting them to byte arrays via `bytes()`, which calls `dpkt.Packet__str__` under the covers and does the necessary str to byte array conversion needed for the `dpkt` APIs and `struct` module. In order to accomodate this change, apply the necessary typecasting for the byte array literal in order to search `fop.name` for nul bytes. This resolves all remaining python 2.x and python 3.x compatibility issues on amd64. More work needs to be done for the tests to function with i386, in general (this is a legacy issue). PR: 237403 MFC after: 1 week Tested with: python 2.7.16 (amd64), python 3.6.8 (amd64) Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 03:06:10 2019 (r348041) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 03:52:48 2019 (r348042) @@ -136,16 +136,22 @@ def _getdev(): _cryptodev = _getdev() +def str_to_ascii(val): + if sys.version_info[0] >= 3: + if isinstance(val, str): + return val.encode("ascii") + return val + def _findop(crid, name): fop = FindOp() fop.crid = crid - fop.name = name + fop.name = str_to_ascii(name) s = array.array('B', fop.pack_hdr()) ioctl(_cryptodev, CIOCFINDDEV, s, 1) fop.unpack(s) try: - idx = fop.name.index('\x00') + idx = fop.name.index(b'\x00') name = fop.name[:idx] except ValueError: name = fop.name @@ -218,11 +224,11 @@ class Crypto: if self._maclen is not None: m = array.array('B', [0] * self._maclen) cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', iv) + ivbuf = array.array('B', str_to_ascii(iv)) cop.iv = ivbuf.buffer_info()[0] #print('cop:', cop) - ioctl(_cryptodev, CIOCCRYPT, str(cop)) + ioctl(_cryptodev, CIOCCRYPT, bytes(cop)) s = array_tobytes(s) if self._maclen is not None: @@ -236,6 +242,7 @@ class Crypto: caead.op = op caead.flags = CRD_F_IV_EXPLICIT caead.flags = 0 + src = str_to_ascii(src) caead.len = len(src) s = array.array('B', src) caead.src = caead.dst = s.buffer_info()[0] @@ -246,6 +253,7 @@ class Crypto: if self._maclen is None: raise ValueError('must have a tag length') + tag = str_to_ascii(tag) if tag is None: tag = array.array('B', [0] * self._maclen) else: @@ -259,7 +267,7 @@ class Crypto: caead.ivlen = len(iv) caead.iv = ivbuf.buffer_info()[0] - ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) + ioctl(_cryptodev, CIOCCRYPTAEAD, bytes(caead)) s = array_tobytes(s) @@ -267,6 +275,7 @@ class Crypto: def perftest(self, op, size, timeo=3): inp = array.array('B', (random.randint(0, 255) for x in range(size))) + inp = str_to_ascii(inp) out = array.array('B', inp) # prep ioctl @@ -293,8 +302,9 @@ class Crypto: start = time.time() reps = 0 + cop = bytes(cop) while not exit[0]: - ioctl(_cryptodev, CIOCCRYPT, str(cop)) + ioctl(_cryptodev, CIOCCRYPT, cop) reps += 1 end = time.time() From owner-svn-src-all@freebsd.org Tue May 21 04:03:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF6115A1BC6; Tue, 21 May 2019 04:03:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C01587371D; Tue, 21 May 2019 04:03:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A2234D4; Tue, 21 May 2019 04:03:22 +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 x4L43Mu1096637; Tue, 21 May 2019 04:03:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L43MGG096636; Tue, 21 May 2019 04:03:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210403.x4L43MGG096636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 04:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348045 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C01587371D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 04:03:23 -0000 Author: ngie Date: Tue May 21 04:03:22 2019 New Revision: 348045 URL: https://svnweb.freebsd.org/changeset/base/348045 Log: Follow up to r348042: cast `aad` to a byte array This is not completely necessary today, but this change is being made in a conservative manner to avoid accidental breakage in the future, if this ever was a unicode string. PR: 237403 MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 04:01:16 2019 (r348044) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 04:03:22 2019 (r348045) @@ -246,6 +246,7 @@ class Crypto: caead.len = len(src) s = array.array('B', src) caead.src = caead.dst = s.buffer_info()[0] + aad = str_to_ascii(aad) caead.aadlen = len(aad) saad = array.array('B', aad) caead.aad = saad.buffer_info()[0] From owner-svn-src-all@freebsd.org Tue May 21 04:11:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E311A15A1EBE; Tue, 21 May 2019 04:11:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8784873C37; Tue, 21 May 2019 04:11:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6473A51D; Tue, 21 May 2019 04:11:17 +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 x4L4BHnW001765; Tue, 21 May 2019 04:11:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L4BGxu001761; Tue, 21 May 2019 04:11:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905210411.x4L4BGxu001761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 21 May 2019 04:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348047 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 348047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8784873C37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 04:11:18 -0000 Author: ngie Date: Tue May 21 04:11:16 2019 New Revision: 348047 URL: https://svnweb.freebsd.org/changeset/base/348047 Log: Add my name to the copyright I have contributed a number of changes to these tests over the past few hundred revisions, and believe I deserve credit for the changes I have made (plus, the copyright hadn't been updated since 2014). MFC after: 1 week Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Tue May 21 04:05:03 2019 (r348046) +++ head/tests/sys/opencrypto/cryptodev.py Tue May 21 04:11:16 2019 (r348047) @@ -3,6 +3,7 @@ # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney # All rights reserved. +# Copyright 2019 Enji Cooper # # This software was developed by John-Mark Gurney under # the sponsorship from the FreeBSD Foundation. Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Tue May 21 04:05:03 2019 (r348046) +++ head/tests/sys/opencrypto/cryptotest.py Tue May 21 04:11:16 2019 (r348047) @@ -2,6 +2,7 @@ # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. +# Copyright 2019 Enji Cooper # # This software was developed by John-Mark Gurney under # the sponsorship from the FreeBSD Foundation. Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Tue May 21 04:05:03 2019 (r348046) +++ head/tests/sys/opencrypto/runtests.sh Tue May 21 04:11:16 2019 (r348047) @@ -2,6 +2,7 @@ # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. +# Copyright 2019 Enji Cooper # # This software was developed by John-Mark Gurney under # the sponsorship from the FreeBSD Foundation. From owner-svn-src-all@freebsd.org Tue May 21 08:23:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E5415A6995; Tue, 21 May 2019 08:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 047AB83469; Tue, 21 May 2019 08:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCFFA304A; Tue, 21 May 2019 08:23:24 +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 x4L8NO8B032570; Tue, 21 May 2019 08:23:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L8NO2W032569; Tue, 21 May 2019 08:23:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905210823.x4L8NO2W032569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 21 May 2019 08:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348049 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 348049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 047AB83469 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 08:23:25 -0000 Author: trasz Date: Tue May 21 08:23:24 2019 New Revision: 348049 URL: https://svnweb.freebsd.org/changeset/base/348049 Log: Make linux_ptrace() use linux_msg() instead of printf(). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_ptrace.c Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Tue May 21 04:27:52 2019 (r348048) +++ head/sys/amd64/linux/linux_ptrace.c Tue May 21 08:23:24 2019 (r348049) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define LINUX_PTRACE_TRACEME 0 #define LINUX_PTRACE_PEEKTEXT 1 @@ -123,7 +124,7 @@ linux_ptrace_status(struct thread *td, pid_t pid, int error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); td->td_retval[0] = saved_retval; if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (status); } @@ -320,9 +321,9 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, mask = 0; if (data & ~LINUX_PTRACE_O_MASK) { - printf("%s: unknown ptrace option %lx set; " - "returning EINVAL\n", - __func__, data & ~LINUX_PTRACE_O_MASK); + linux_msg(td, "unknown ptrace option %lx set; " + "returning EINVAL", + data & ~LINUX_PTRACE_O_MASK); return (EINVAL); } @@ -357,8 +358,8 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, mask |= PTRACE_VFORK; /* XXX: Close enough? */ if (data & LINUX_PTRACE_O_TRACEEXIT) { - printf("%s: PTRACE_O_TRACEEXIT not implemented; " - "returning EINVAL\n", __func__); + linux_msg(td, "PTRACE_O_TRACEEXIT not implemented; " + "returning EINVAL"); return (EINVAL); } @@ -381,7 +382,7 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, voi error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (error); } if (lwpinfo.pl_flags & PL_FLAG_SCE) { @@ -433,7 +434,7 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid error = copyin((const void *)data, &iov, sizeof(iov)); if (error != 0) { - printf("%s: copyin error %d\n", __func__, error); + linux_msg(td, "copyin error %d", error); return (error); } @@ -451,8 +452,7 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", - __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (error); } if (lwpinfo.pl_flags & PL_FLAG_SCE) { @@ -474,14 +474,14 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid len = MIN(iov.iov_len, sizeof(l_regset)); error = copyout(&l_regset, (void *)iov.iov_base, len); if (error != 0) { - printf("%s: copyout error %d\n", __func__, error); + linux_msg(td, "copyout error %d", error); return (error); } iov.iov_len -= len; error = copyout(&iov, (void *)data, sizeof(iov)); if (error != 0) { - printf("%s: iov copyout error %d\n", __func__, error); + linux_msg(td, "iov copyout error %d", error); return (error); } @@ -496,8 +496,8 @@ linux_ptrace_getregset(struct thread *td, pid_t pid, l case LINUX_NT_PRSTATUS: return (linux_ptrace_getregset_prstatus(td, pid, data)); default: - printf("%s: PTRACE_GETREGSET request %ld not implemented; " - "returning EINVAL\n", __func__, addr); + linux_msg(td, "PTRACE_GETREGSET request %ld not implemented; " + "returning EINVAL", addr); return (EINVAL); } } @@ -506,7 +506,7 @@ static int linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) { - printf("%s: PTRACE_SEIZE not implemented; returning EINVAL\n", __func__); + linux_msg(td, "PTRACE_SEIZE not implemented; returning EINVAL"); return (EINVAL); } @@ -587,8 +587,8 @@ linux_ptrace(struct thread *td, struct linux_ptrace_ar error = linux_ptrace_seize(td, pid, uap->addr, uap->data); break; default: - printf("%s: ptrace(%ld, ...) not implemented; returning EINVAL\n", - __func__, uap->req); + linux_msg(td, "ptrace(%ld, ...) not implemented; " + "returning EINVAL", uap->req); error = EINVAL; break; } From owner-svn-src-all@freebsd.org Tue May 21 08:24:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5BC015A69E9; Tue, 21 May 2019 08:24:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0EE835B1; Tue, 21 May 2019 08:24:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28039304B; Tue, 21 May 2019 08:24:23 +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 x4L8ONIJ032655; Tue, 21 May 2019 08:24:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L8ON7W032654; Tue, 21 May 2019 08:24:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905210824.x4L8ON7W032654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 21 May 2019 08:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348050 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 348050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D0EE835B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 08:24:24 -0000 Author: trasz Date: Tue May 21 08:24:22 2019 New Revision: 348050 URL: https://svnweb.freebsd.org/changeset/base/348050 Log: Xr make_dev(9) from devfs(5). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/devfs.5 Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Tue May 21 08:23:24 2019 (r348049) +++ head/share/man/man5/devfs.5 Tue May 21 08:24:22 2019 (r348050) @@ -127,7 +127,8 @@ volume located on .Sh SEE ALSO .Xr fdescfs 5 , .Xr devfs 8 , -.Xr mount 8 +.Xr mount 8 , +.Xr make_dev 9 .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Tue May 21 13:29:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A25515ADF20; Tue, 21 May 2019 13:29:55 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE0798DB70; Tue, 21 May 2019 13:29:54 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1FA165AE; Tue, 21 May 2019 13:29:54 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LDTstl090905; Tue, 21 May 2019 13:29:54 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LDTsUh090903; Tue, 21 May 2019 13:29:54 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905211329.x4LDTsUh090903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Tue, 21 May 2019 13:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348051 - in head/sys: kern sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: in head/sys: kern sys x86/x86 X-SVN-Commit-Revision: 348051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE0798DB70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 13:29:55 -0000 Author: stevek Date: Tue May 21 13:29:53 2019 New Revision: 348051 URL: https://svnweb.freebsd.org/changeset/base/348051 Log: The older detection methods (smbios.bios.vendor and smbios.system.product) are able to determine some virtual machines, but the vm_guest variable was still only being set to VM_GUEST_VM. Since we do know what some of them specifically are, we can set vm_guest appropriately. Also, if we see the CPUID has the HV flag, but we were unable to find a definitive vendor in the Hypervisor CPUID Information Leaf, fall back to the older detection methods, as they may be able to determine a specific HV type. Add VM_GUEST_PARALLELS value to VM_GUEST for Parallels. Approved by: cem Differential Revision: https://reviews.freebsd.org/D20305 Modified: head/sys/kern/subr_param.c head/sys/sys/systm.h head/sys/x86/x86/identcpu.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue May 21 08:24:22 2019 (r348050) +++ head/sys/kern/subr_param.c Tue May 21 13:29:53 2019 (r348051) @@ -146,15 +146,16 @@ SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CT * corresponding enum VM_GUEST members. */ static const char *const vm_guest_sysctl_names[] = { - "none", - "generic", - "xen", - "hv", - "vmware", - "kvm", - "bhyve", - "vbox", - NULL + [VM_GUEST_NO] = "none", + [VM_GUEST_VM] = "generic", + [VM_GUEST_XEN] = "xen", + [VM_GUEST_HV] = "hv", + [VM_GUEST_VMWARE] = "vmware", + [VM_GUEST_KVM] = "kvm", + [VM_GUEST_BHYVE] = "bhyve", + [VM_GUEST_VBOX] = "vbox", + [VM_GUEST_PARALLELS] = "parallels", + [VM_LAST] = NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue May 21 08:24:22 2019 (r348050) +++ head/sys/sys/systm.h Tue May 21 13:29:53 2019 (r348051) @@ -79,7 +79,7 @@ extern int vm_guest; /* Running as virtual machine gu */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_GUEST_VBOX, - VM_LAST }; + VM_GUEST_PARALLELS, VM_LAST }; /* * These functions need to be declared before the KASSERT macro is invoked in Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue May 21 08:24:22 2019 (r348050) +++ head/sys/x86/x86/identcpu.c Tue May 21 13:29:53 2019 (r348051) @@ -1305,23 +1305,27 @@ hook_tsc_freq(void *arg __unused) SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, SI_ORDER_ANY, hook_tsc_freq, NULL); -static const char *const vm_bnames[] = { - "QEMU", /* QEMU */ - "Plex86", /* Plex86 */ - "Bochs", /* Bochs */ - "Xen", /* Xen */ - "BHYVE", /* bhyve */ - "Seabios", /* KVM */ - NULL +static const struct { + const char * vm_bname; + int vm_guest; +} vm_bnames[] = { + { "QEMU", VM_GUEST_VM }, /* QEMU */ + { "Plex86", VM_GUEST_VM }, /* Plex86 */ + { "Bochs", VM_GUEST_VM }, /* Bochs */ + { "Xen", VM_GUEST_XEN }, /* Xen */ + { "BHYVE", VM_GUEST_BHYVE }, /* bhyve */ + { "Seabios", VM_GUEST_KVM }, /* KVM */ }; -static const char *const vm_pnames[] = { - "VMware Virtual Platform", /* VMWare VM */ - "Virtual Machine", /* Microsoft VirtualPC */ - "VirtualBox", /* Sun xVM VirtualBox */ - "Parallels Virtual Platform", /* Parallels VM */ - "KVM", /* KVM */ - NULL +static const struct { + const char * vm_pname; + int vm_guest; +} vm_pnames[] = { + { "VMware Virtual Platform", VM_GUEST_VMWARE }, + { "Virtual Machine", VM_GUEST_VM }, /* Microsoft VirtualPC */ + { "VirtualBox", VM_GUEST_VBOX }, + { "Parallels Virtual Platform", VM_GUEST_PARALLELS }, + { "KVM", VM_GUEST_KVM }, }; static struct { @@ -1413,7 +1417,10 @@ identify_hypervisor(void) if (cpu_feature2 & CPUID2_HV) { vm_guest = VM_GUEST_VM; identify_hypervisor_cpuid_base(); - return; + + /* If we have a definitive vendor, we can return now. */ + if (*hv_vendor != '\0') + return; } /* @@ -1438,19 +1445,27 @@ identify_hypervisor(void) */ p = kern_getenv("smbios.bios.vendor"); if (p != NULL) { - for (i = 0; vm_bnames[i] != NULL; i++) - if (strcmp(p, vm_bnames[i]) == 0) { - vm_guest = VM_GUEST_VM; - freeenv(p); - return; + for (i = 0; i < nitems(vm_bnames); i++) + if (strcmp(p, vm_bnames[i].vm_bname) == 0) { + vm_guest = vm_bnames[i].vm_guest; + /* If we have a specific match, return */ + if (vm_guest != VM_GUEST_VM) { + freeenv(p); + return; + } + /* + * We are done with bnames, but there might be + * a more specific match in the pnames + */ + break; } freeenv(p); } p = kern_getenv("smbios.system.product"); if (p != NULL) { - for (i = 0; vm_pnames[i] != NULL; i++) - if (strcmp(p, vm_pnames[i]) == 0) { - vm_guest = VM_GUEST_VM; + for (i = 0; i < nitems(vm_pnames); i++) + if (strcmp(p, vm_pnames[i].vm_pname) == 0) { + vm_guest = vm_pnames[i].vm_guest; freeenv(p); return; } @@ -2586,7 +2601,7 @@ static void print_hypervisor_info(void) { - if (*hv_vendor) + if (*hv_vendor != '\0') printf("Hypervisor: Origin = \"%s\"\n", hv_vendor); } From owner-svn-src-all@freebsd.org Tue May 21 15:12:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A130F15B026A; Tue, 21 May 2019 15:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 452B26A96E; Tue, 21 May 2019 15:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 230ED77E3; Tue, 21 May 2019 15:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LFCD2a046142; Tue, 21 May 2019 15:12:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LFCDEi046141; Tue, 21 May 2019 15:12:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905211512.x4LFCDEi046141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 May 2019 15:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348052 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 452B26A96E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 15:12:14 -0000 Author: kib Date: Tue May 21 15:12:13 2019 New Revision: 348052 URL: https://svnweb.freebsd.org/changeset/base/348052 Log: NDFREE(): Fix unlocking for LOCKPARENT|LOCKLEAF and ndp->ni_dvp == ndp->ni_vp. NDFREE() calculates unlock_dvp after ndp->ni_vp is unlocked and zeroed out. This makes the comparision of ni_dvp with ni_vp always fail. Move the calculation of unlock_dvp right after unlock_vp, so that the code sees correct ni_vp value. Reproduced by chdir("/usr"); open("/..", O_BENEATH | O_RDONLY); Reported by: syzkaller Reviewed by: markj, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20304 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Tue May 21 13:29:53 2019 (r348051) +++ head/sys/kern/vfs_lookup.c Tue May 21 15:12:13 2019 (r348052) @@ -1332,6 +1332,10 @@ NDFREE(struct nameidata *ndp, const u_int flags) if (!(flags & NDF_NO_VP_UNLOCK) && (ndp->ni_cnd.cn_flags & LOCKLEAF) && ndp->ni_vp) unlock_vp = 1; + if (!(flags & NDF_NO_DVP_UNLOCK) && + (ndp->ni_cnd.cn_flags & LOCKPARENT) && + ndp->ni_dvp != ndp->ni_vp) + unlock_dvp = 1; if (!(flags & NDF_NO_VP_RELE) && ndp->ni_vp) { if (unlock_vp) { vput(ndp->ni_vp); @@ -1342,10 +1346,6 @@ NDFREE(struct nameidata *ndp, const u_int flags) } if (unlock_vp) VOP_UNLOCK(ndp->ni_vp, 0); - if (!(flags & NDF_NO_DVP_UNLOCK) && - (ndp->ni_cnd.cn_flags & LOCKPARENT) && - ndp->ni_dvp != ndp->ni_vp) - unlock_dvp = 1; if (!(flags & NDF_NO_DVP_RELE) && (ndp->ni_cnd.cn_flags & (LOCKPARENT|WANTPARENT))) { if (unlock_dvp) { From owner-svn-src-all@freebsd.org Tue May 21 15:19:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F35F315B03A1; Tue, 21 May 2019 15:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98A606AC1D; Tue, 21 May 2019 15:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88E017805; Tue, 21 May 2019 15:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LFJnRw048308; Tue, 21 May 2019 15:19:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LFJn33048307; Tue, 21 May 2019 15:19:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905211519.x4LFJn33048307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 May 2019 15:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348053 - stable/12/sys/x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/include X-SVN-Commit-Revision: 348053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98A606AC1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 15:19:50 -0000 Author: kib Date: Tue May 21 15:19:49 2019 New Revision: 348053 URL: https://svnweb.freebsd.org/changeset/base/348053 Log: MFC r347216: amd64: fix BUS_SPACE_MAXSIZE to 64bit max value. Modified: stable/12/sys/x86/include/bus.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/bus.h ============================================================================== --- stable/12/sys/x86/include/bus.h Tue May 21 15:12:13 2019 (r348052) +++ stable/12/sys/x86/include/bus.h Tue May 21 15:19:49 2019 (r348053) @@ -114,7 +114,11 @@ #define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF +#if defined(__amd64__) +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFULL +#else #define BUS_SPACE_MAXSIZE 0xFFFFFFFF +#endif #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF #if defined(__amd64__) || defined(PAE) From owner-svn-src-all@freebsd.org Tue May 21 16:15:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCA515B190F; Tue, 21 May 2019 16:15:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD9E6CC38; Tue, 21 May 2019 16:15:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7AC368192; Tue, 21 May 2019 16:15:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348012 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail To: rgrimes@freebsd.org, Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905210130.x4L1UQhN076511@gndrsh.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <951303cd-eef0-725f-7a5f-60d8adc1819f@FreeBSD.org> Date: Tue, 21 May 2019 09:15:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905210130.x4L1UQhN076511@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1AD9E6CC38 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 16:15:14 -0000 On 5/20/19 6:30 PM, Rodney W. Grimes wrote: >> Author: brooks >> Date: Mon May 20 21:33:22 2019 >> New Revision: 348012 >> URL: https://svnweb.freebsd.org/changeset/base/348012 >> >> Log: >> MFC r347963: >> >> Change ed(4), ep(4), and fxp(4) examples to em(4). >> >> ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains >> popular in older systems, but isn't as future proof as em(4). >> >> Reviewed by: bz, jhb >> Differential Revision: https://reviews.freebsd.org/D20311 > > Though this made since to me in head, it does not in stable, > as you may of just broke someones running system when they > do a merge master if they happened to of depended on the very > long standing defaults of fxp that are NOT in comment lines > below. > > IMHO we should not change user visible defaults > in /etc/defaults/rc.conf on a brance, mininal is > this requires some form of merge master update notice > mechanism which we do not have. While I agree with the sentiment, the fact that these values are set is just broken. The ones that aren't already comments should be fixed to be comments in HEAD at least. I think it is safe to merge all of the changes that aren't uncommented lines in rc.conf though. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 21 16:36:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D94B015B1DF3; Tue, 21 May 2019 16:36:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70C946D654; Tue, 21 May 2019 16:36:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36AF2859C; Tue, 21 May 2019 16:36:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LGaU07089933; Tue, 21 May 2019 16:36:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LGaT3B089926; Tue, 21 May 2019 16:36:29 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905211636.x4LGaT3B089926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 21 May 2019 16:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348055 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Commit-Revision: 348055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70C946D654 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 16:36:31 -0000 Author: brooks Date: Tue May 21 16:36:28 2019 New Revision: 348055 URL: https://svnweb.freebsd.org/changeset/base/348055 Log: Revert r348012, MFC r347963. Several of the changes touch actual defaults. These defaults are all mistakes and no one should rely on them, but changing them in a stable branch is clearly inappropriate. Reported by: rgrimes Modified: stable/12/libexec/rc/rc.conf stable/12/sbin/ifconfig/ifconfig.8 stable/12/share/man/man5/rc.conf.5 stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall stable/12/usr.sbin/jail/jail.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Tue May 21 15:59:17 2019 (r348054) +++ stable/12/libexec/rc/rc.conf Tue May 21 16:36:28 2019 (r348055) @@ -121,9 +121,9 @@ hostid_file="/etc/hostid" # File with hostuuid. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. -#dhclient_flags_em0="" # Extra dhclient flags for em0 only +#dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only background_dhclient="NO" # Start dhcp client in the background. -#background_dhclient_em0="YES" # Start dhcp client on em0 in the background. +#background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. synchronous_dhclient="NO" # Start dhclient directly on configured # interfaces during startup. defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. @@ -147,19 +147,19 @@ firewall_client_net="192.0.2.0/24" # IPv4 Network addr # firewall. #firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for # "client" firewall. -firewall_simple_iif="em1" # Inside network interface for "simple" +firewall_simple_iif="ed1" # Inside network interface for "simple" # firewall. firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple" # firewall. -firewall_simple_oif="em0" # Outside network interface for "simple" +firewall_simple_oif="ed0" # Outside network interface for "simple" # firewall. firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple" # firewall. -#firewall_simple_iif_ipv6="em1" # Inside IPv6 network interface for "simple" +#firewall_simple_iif_ipv6="ed1" # Inside IPv6 network interface for "simple" # firewall. #firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix # for "simple" firewall. -#firewall_simple_oif_ipv6="em0" # Outside IPv6 network interface for "simple" +#firewall_simple_oif_ipv6="ed0" # Outside IPv6 network interface for "simple" # firewall. #firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix # for "simple" firewall. @@ -241,14 +241,14 @@ cloned_interfaces="" # List of cloned network interfa #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. #ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. -#ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry -#ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias -#ifconfig_em0_name="net0" # Change interface name from em0 to net0. -#vlans_em0="101 vlan0" # vlan(4) interfaces for em0 device +#ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry +#ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias +#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device #create_args_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlandebug(8) -#ipv4_addrs_em0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. +#ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge @@ -336,7 +336,7 @@ bootparamd_flags="" # Flags to bootparamd pppoed_enable="NO" # Run the PPP over Ethernet daemon. pppoed_provider="*" # Provider and ppp(8) config file entry. pppoed_flags="-P /var/run/pppoed.pid" # Flags to pppoed (if enabled). -pppoed_interface="em0" # The interface that pppoed runs on. +pppoed_interface="fxp0" # The interface that pppoed runs on. sshd_enable="NO" # Enable sshd sshd_program="/usr/sbin/sshd" # path to sshd, if you want a different one. sshd_flags="" # Additional flags for sshd. @@ -506,11 +506,11 @@ route6d_flags="" # Flags to IPv6 routing daemon. # addrs. #route6d_flags="-q" # If you want to run a routing daemon on an end # node, you should stop advertisement. -#ipv6_network_interfaces="em0 em1" # Examples for router +#ipv6_network_interfaces="ed0 ep0" # Examples for router # or static configuration for end node. # Choose correct prefix value. -#ipv6_prefix_em0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. -#ipv6_prefix_em1="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. +#ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. +#ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. ipv6_default_interface="NO" # Default output interface for scoped addrs. # This works only with # ipv6_gateway_enable="NO". Modified: stable/12/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.8 Tue May 21 15:59:17 2019 (r348054) +++ stable/12/sbin/ifconfig/ifconfig.8 Tue May 21 16:36:28 2019 (r348055) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd May 3, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -196,7 +196,7 @@ This parameter is a string of the form .Dq name unit , for example, -.Dq Li em0 . +.Dq Li ed0 . .It Ar groupname List the interfaces in the given group. .El @@ -2919,26 +2919,26 @@ Assign the IPv4 address with a network mask of .Li 255.255.255.0 , to the interface -.Li em0 : -.Dl # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0 +.Li fxp0 : +.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0 .Pp Add the IPv4 address .Li 192.0.2.45 , with the CIDR network prefix .Li /28 , to the interface -.Li em0 , +.Li ed0 , using .Cm add as a synonym for the canonical form of the option .Cm alias : -.Dl # ifconfig em0 inet 192.0.2.45/28 add +.Dl # ifconfig ed0 inet 192.0.2.45/28 add .Pp Remove the IPv4 address .Li 192.0.2.45 from the interface -.Li em0 : -.Dl # ifconfig em0 inet 192.0.2.45 -alias +.Li ed0 : +.Dl # ifconfig ed0 inet 192.0.2.45 -alias .Pp Enable IPv6 functionality of the interface: .Dl # ifconfig em0 inet6 -ifdisabled Modified: stable/12/share/man/man5/rc.conf.5 ============================================================================== --- stable/12/share/man/man5/rc.conf.5 Tue May 21 15:59:17 2019 (r348054) +++ stable/12/share/man/man5/rc.conf.5 Tue May 21 16:36:28 2019 (r348055) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd March 21, 2019 .Dt RC.CONF 5 .Os .Sh NAME @@ -1262,11 +1262,11 @@ It is possible to add IP alias entries using syntax with the address family keyword such as .Li inet . Assuming that the interface in question was -.Li em0 , +.Li ed0 , it might look something like this: .Bd -literal -ifconfig_em0_alias0="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_em0_alias1="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_ed0_alias0="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_ed0_alias1="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp It also possible to configure multiple IP addresses in Classless @@ -1306,11 +1306,11 @@ not for the other address families such as .Li inet6 . .Pp With the interface in question being -.Li em0 , +.Li ed0 , an example could look like: .Bd -literal -ifconfig_em0_alias2="inet 192.0.2.129/27" -ifconfig_em0_alias3="inet 192.0.2.1-5/28" +ifconfig_ed0_alias2="inet 192.0.2.129/27" +ifconfig_ed0_alias3="inet 192.0.2.1-5/28" .Ed .Pp and so on. @@ -1332,10 +1332,10 @@ its contents are passed to Execution stops at the first unsuccessful access, so if something like this is present: .Bd -literal -ifconfig_em0_alias0="inet 127.0.0.251 netmask 0xffffffff" -ifconfig_em0_alias1="inet 127.0.0.252 netmask 0xffffffff" -ifconfig_em0_alias2="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_em0_alias4="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" +ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" +ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_ed0_alias4="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp Then note that alias4 would @@ -1351,7 +1351,7 @@ variable, which has the same functionality as .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n and can have all of entries in a variable like the following: .Bd -literal -ifconfig_em0_aliases="\\ +ifconfig_ed0_aliases="\\ inet 127.0.0.251 netmask 0xffffffff \\ inet 127.0.0.252 netmask 0xffffffff \\ inet 127.0.0.253 netmask 0xffffffff \\ @@ -1458,11 +1458,11 @@ to the .Va ifconfig_ Ns Aq Ar interface variable. For instance, to initialize the -.Li em0 +.Li ed0 device via DHCP, it is possible to use something like: .Bd -literal -ifconfig_em0="DHCP" +ifconfig_ed0="DHCP" .Ed .Pp If you want to configure your wireless interface with @@ -1513,7 +1513,7 @@ variable. .Pp It is also possible to rename an interface by doing: .Bd -literal -ifconfig_em0_name="net0" +ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed .It Va ipv6_enable @@ -1686,8 +1686,8 @@ with keyword. For example: .Bd -literal -ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" -ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" +ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" +ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp Interfaces that have an @@ -1714,7 +1714,7 @@ defined in If only a link-local address is needed on the interface, the following configuration can be used: .Bd -literal -ifconfig_em0_ipv6="inet6 auto_linklocal" +ifconfig_ed0_ipv6="inet6 auto_linklocal" .Ed .Pp A link-local address can also be configured manually. @@ -1723,7 +1723,7 @@ so that it does not change when the network interface card is replaced. For example: .Bd -literal -ifconfig_em0_ipv6="inet6 fe80::1 prefixlen 64" +ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" .Ed .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str @@ -1737,15 +1737,15 @@ is empty. .Pp For example, the following configuration .Bd -literal -ipv6_prefix_em0="2001:db8:1:0 2001:db8:2:0" +ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0" .Ed .Pp is equivalent to the following: .Bd -literal -ifconfig_em0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" -ifconfig_em0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" -ifconfig_em0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" -ifconfig_em0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" +ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" +ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" +ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" +ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" .Ed .Pp These Subnet-Router anycast addresses will be added only when Modified: stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall ============================================================================== --- stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Tue May 21 15:59:17 2019 (r348054) +++ stable/12/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Tue May 21 16:36:28 2019 (r348055) @@ -195,13 +195,13 @@ case ${firewall_type} in ############ # set these to your outside interface network and netmask and ip - oif="em0" + oif="ed0" onet="192.0.2.0" omask="255.255.255.240" oip="192.0.2.1" # set these to your inside interface network and netmask and ip - iif="em1" + iif="ed1" inet="192.0.2.16" imask="255.255.255.240" iip="192.0.2.17" Modified: stable/12/usr.sbin/jail/jail.8 ============================================================================== --- stable/12/usr.sbin/jail/jail.8 Tue May 21 15:59:17 2019 (r348054) +++ stable/12/usr.sbin/jail/jail.8 Tue May 21 16:36:28 2019 (r348055) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd November 27, 2018 .Dt JAIL 8 .Os .Sh NAME @@ -1099,7 +1099,7 @@ testjail { mount.devfs; host.hostname = testhostname; ip4.addr = 192.0.2.100; - interface = em0; + interface = ed0; exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; } From owner-svn-src-all@freebsd.org Tue May 21 16:40:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2A4F15B1F6C; Tue, 21 May 2019 16:40:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9665E6DA57; Tue, 21 May 2019 16:40:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id DBCC93C475F; Tue, 21 May 2019 16:40:33 +0000 (UTC) Date: Tue, 21 May 2019 16:40:33 +0000 From: Brooks Davis To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r348012 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail Message-ID: <20190521164033.GG68351@spindle.one-eyed-alien.net> References: <201905202133.x4KLXMPE088717@repo.freebsd.org> <201905210130.x4L1UQhN076511@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cYtjc4pxslFTELvY" Content-Disposition: inline In-Reply-To: <201905210130.x4L1UQhN076511@gndrsh.dnsmgr.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 9665E6DA57 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.921,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 16:40:36 -0000 --cYtjc4pxslFTELvY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2019 at 06:30:26PM -0700, Rodney W. Grimes wrote: > > Author: brooks > > Date: Mon May 20 21:33:22 2019 > > New Revision: 348012 > > URL: https://svnweb.freebsd.org/changeset/base/348012 > >=20 > > Log: > > MFC r347963: > > =20 > > Change ed(4), ep(4), and fxp(4) examples to em(4). > > =20 > > ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains > > popular in older systems, but isn't as future proof as em(4). > > =20 > > Reviewed by: bz, jhb > > Differential Revision: https://reviews.freebsd.org/D20311 >=20 > Though this made since to me in head, it does not in stable, > as you may of just broke someones running system when they > do a merge master if they happened to of depended on the very > long standing defaults of fxp that are NOT in comment lines > below. I didn't really thing about fact these are actual defaults. We should comment out or remove most/all of these out. They are a terrible idea... I've reverted in r348055. -- Brooks --cYtjc4pxslFTELvY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJc5CoBAAoJEKzQXbSebgfAhYEH/iYSrjerHOr41M0KP2TN+/Mf SENkSYdTWBPQwZsYd9to/y7ybOUGKZfzoa5s8HZN9wdOpditdiKc6cCHEhXC1HwJ T2kNfPMJ3XO6IMdRGwCeSHekIG8giTntw2IjhX7rF6eWUMjEYJctqwzSv9CP2WIm qdOg6ychO6UohChzS7aMVtr5H1tcd4efc5C61IdF/lJU7T7dwvk/VSeoB5GWhJCw nXII3Mvb4t4uSfNHwuRMJXsOH2g+FGJ29mG3/Kg1lg14s2+3NpbBea49NwadBydZ tNLS/UN06Tju+LO89FWFD/uOZwRjzUGfVZmsMuCI0mxiMrLPcf3P3R7cUBUe7jk= =4gpw -----END PGP SIGNATURE----- --cYtjc4pxslFTELvY-- From owner-svn-src-all@freebsd.org Tue May 21 16:54:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 475D715B2676; Tue, 21 May 2019 16:54:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 C81A06E438; Tue, 21 May 2019 16:54:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4LGsEDv080016; Tue, 21 May 2019 09:54:14 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4LGsEAR080015; Tue, 21 May 2019 09:54:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905211654.x4LGsEAR080015@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348012 - in stable/12: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail In-Reply-To: <20190521164033.GG68351@spindle.one-eyed-alien.net> To: Brooks Davis Date: Tue, 21 May 2019 09:54:14 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@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-Rspamd-Queue-Id: C81A06E438 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 16:54:17 -0000 > On Mon, May 20, 2019 at 06:30:26PM -0700, Rodney W. Grimes wrote: > > > Author: brooks > > > Date: Mon May 20 21:33:22 2019 > > > New Revision: 348012 > > > URL: https://svnweb.freebsd.org/changeset/base/348012 > > > > > > Log: > > > MFC r347963: > > > > > > Change ed(4), ep(4), and fxp(4) examples to em(4). > > > > > > ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains > > > popular in older systems, but isn't as future proof as em(4). > > > > > > Reviewed by: bz, jhb > > > Differential Revision: https://reviews.freebsd.org/D20311 > > > > Though this made since to me in head, it does not in stable, > > as you may of just broke someones running system when they > > do a merge master if they happened to of depended on the very > > long standing defaults of fxp that are NOT in comment lines > > below. > > I didn't really thing about fact these are actual defaults. We should > comment out or remove most/all of these out. They are a terrible idea... > > I've reverted in r348055. Thank you, and I fully agree on the terrible idea, perhaps look at rewritting the effected code so that it errors out or at least warns if these values are not set, then remove the setting of them in etc/default/rc.conf would be one way to clean this up. > -- Brooks -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 18:04:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0FEE15B40A3; Tue, 21 May 2019 18:04:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66EAA7089A; Tue, 21 May 2019 18:04:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB4894DA; Tue, 21 May 2019 18:03:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LI3x3j036725; Tue, 21 May 2019 18:03:59 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LI3xkm036724; Tue, 21 May 2019 18:03:59 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905211803.x4LI3xkm036724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 21 May 2019 18:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348056 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 348056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66EAA7089A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 18:04:04 -0000 Author: dchagin Date: Tue May 21 18:03:58 2019 New Revision: 348056 URL: https://svnweb.freebsd.org/changeset/base/348056 Log: Do not leak sa in linux_recvfrom() call if kern_recvit() fails. MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue May 21 16:36:28 2019 (r348055) +++ head/sys/compat/linux/linux_socket.c Tue May 21 18:03:58 2019 (r348056) @@ -908,7 +908,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfro error = kern_recvit(td, args->s, &msg, UIO_SYSSPACE, NULL); if (error != 0) - return (error); + goto out; if (PTRIN(args->from) != NULL) { error = bsd_to_linux_sockaddr(sa, &lsa, msg.msg_namelen); @@ -921,7 +921,7 @@ linux_recvfrom(struct thread *td, struct linux_recvfro if (error == 0 && PTRIN(args->fromlen) != NULL) error = copyout(&msg.msg_namelen, PTRIN(args->fromlen), sizeof(msg.msg_namelen)); - +out: free(sa, M_SONAME); return (error); } From owner-svn-src-all@freebsd.org Tue May 21 18:05:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ED9C15B422A; Tue, 21 May 2019 18:05:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0635971000; Tue, 21 May 2019 18:05:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6DFF94E1; Tue, 21 May 2019 18:05:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LI5vO7037585; Tue, 21 May 2019 18:05:57 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LI5vJO037584; Tue, 21 May 2019 18:05:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905211805.x4LI5vJO037584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 21 May 2019 18:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348057 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 348057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0635971000 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 18:05:58 -0000 Author: dchagin Date: Tue May 21 18:05:57 2019 New Revision: 348057 URL: https://svnweb.freebsd.org/changeset/base/348057 Log: Do not use uninitialised sa. Reported by: tijl@ MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue May 21 18:03:58 2019 (r348056) +++ head/sys/compat/linux/linux_socket.c Tue May 21 18:05:57 2019 (r348057) @@ -1165,7 +1165,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc if (error != 0) goto bad; - if (sa) { + if (msg->msg_name) { msg->msg_name = PTRIN(linux_msg.msg_name); error = bsd_to_linux_sockaddr(sa, &lsa, msg->msg_namelen); if (error == 0) From owner-svn-src-all@freebsd.org Tue May 21 18:08:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A0415B4311; Tue, 21 May 2019 18:08:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF5CA71378; Tue, 21 May 2019 18:08:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8805494E2; Tue, 21 May 2019 18:08:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LI8J0l037727; Tue, 21 May 2019 18:08:19 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LI8JU4037726; Tue, 21 May 2019 18:08:19 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905211808.x4LI8JU4037726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 21 May 2019 18:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348058 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 348058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF5CA71378 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 18:08:20 -0000 Author: dchagin Date: Tue May 21 18:08:19 2019 New Revision: 348058 URL: https://svnweb.freebsd.org/changeset/base/348058 Log: Do not leak sa in linux_recvmsg() call if kern_recvit() fails. MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue May 21 18:05:57 2019 (r348057) +++ head/sys/compat/linux/linux_socket.c Tue May 21 18:08:19 2019 (r348058) @@ -1155,7 +1155,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc if (msg->msg_name) { sa = malloc(msg->msg_namelen, M_SONAME, M_WAITOK); msg->msg_name = sa; - } + } else + sa = NULL; uiov = msg->msg_iov; msg->msg_iov = iov; @@ -1172,7 +1173,6 @@ linux_recvmsg_common(struct thread *td, l_int s, struc error = copyout(lsa, PTRIN(msg->msg_name), msg->msg_namelen); free(lsa, M_SONAME); - free(sa, M_SONAME); if (error != 0) goto bad; } @@ -1292,6 +1292,7 @@ bad: } free(iov, M_IOV); free(linux_cmsg, M_LINUX); + free(sa, M_SONAME); return (error); } From owner-svn-src-all@freebsd.org Tue May 21 16:09:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD3A615B1668; Tue, 21 May 2019 16:09:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80BC76C766; Tue, 21 May 2019 16:09:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 174DF804E; Tue, 21 May 2019 16:09:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347951 - stable/12/lib/libc/stdlib To: rgrimes@freebsd.org, Warner Losh Cc: Yoshihiro Ota , "Rodney W. Grimes" , Benedict Reuschling , src-committers , svn-src-stable@freebsd.org, svn-src-all , svn-src-stable-12@freebsd.org, Bruce Evans , Konstantin Belousov References: <201905201734.x4KHY7wH074764@gndrsh.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <00fa30ef-a454-d658-d81f-74efbe1d0429@FreeBSD.org> Date: Tue, 21 May 2019 09:09:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905201734.x4KHY7wH074764@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 80BC76C766 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-Mailman-Approved-At: Tue, 21 May 2019 18:22:30 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 16:09:56 -0000 On 5/20/19 10:34 AM, Rodney W. Grimes wrote: >> On Sun, May 19, 2019 at 9:56 AM Yoshihiro Ota wrote: >> >>> I wonder if we can use a tool to confirm coding style like >>> clang-format or something else. >>> >> >> I don't know... it might be hard to do that inside a man page... > > Given the current tooling I concur, so we need .include > for mandoc, and teach mandoc how to format example code which > is mostly knows how to do, or atleast there was lots of groff > code to do that. I would prefer this approach if at all possible. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 21 18:38:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231B215B5787; Tue, 21 May 2019 18:38:47 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D513872A79; Tue, 21 May 2019 18:38:44 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108162.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4LIYUdt019198; Tue, 21 May 2019 11:38:43 -0700 Received: from nam03-dm3-obe.outbound.protection.outlook.com (mail-dm3nam03lp2054.outbound.protection.outlook.com [104.47.41.54]) by mx0b-00273201.pphosted.com with ESMTP id 2smfx40r75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 21 May 2019 11:38:43 -0700 Received: from DM6PR05CA0033.namprd05.prod.outlook.com (2603:10b6:5:f8::46) by DM6PR05MB6714.namprd05.prod.outlook.com (2603:10b6:5:131::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.7; Tue, 21 May 2019 18:38:41 +0000 Received: from BY2NAM05FT010.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::205) by DM6PR05CA0033.outlook.office365.com (2603:10b6:5:f8::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.7 via Frontend Transport; Tue, 21 May 2019 18:38:41 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.239.12) by BY2NAM05FT010.mail.protection.outlook.com (10.152.100.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.10 via Frontend Transport; Tue, 21 May 2019 18:38:40 +0000 Received: from P-EXBEND-EQX-03.jnpr.net (10.104.8.56) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 21 May 2019 11:38:40 -0700 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXBEND-EQX-03.jnpr.net (10.104.8.56) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 21 May 2019 11:38:40 -0700 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 21 May 2019 11:38:40 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.50.162]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id x4LIcent015147; Tue, 21 May 2019 11:38:40 -0700 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id 010051FF62; Tue, 21 May 2019 11:38:40 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 008301FF61; Tue, 21 May 2019 11:38:39 -0700 (PDT) To: CC: , , , Subject: Re: svn commit: r347980 - head/lib/libsecureboot/openpgp In-Reply-To: <201905201815.x4KIFMw4074971@gndrsh.dnsmgr.net> References: <201905201815.x4KIFMw4074971@gndrsh.dnsmgr.net> Comments: In-reply-to: "Rodney W. Grimes" message dated "Mon, 20 May 2019 11:15:22 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <46593.1558463919.1@kaos.jnpr.net> Date: Tue, 21 May 2019 11:38:39 -0700 Message-ID: <50618.1558463919@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(189003)(199004)(52314003)(81166006)(6266002)(2351001)(76506005)(68736007)(117636001)(4744005)(53416004)(81156014)(8676002)(46406003)(6246003)(54906003)(305945005)(90966002)(47776003)(7126003)(476003)(107886003)(23726003)(7696005)(76176011)(486006)(126002)(446003)(11346002)(70206006)(70586007)(53936002)(2906002)(50226002)(8936002)(450100002)(5660300002)(16586007)(50466002)(4326008)(186003)(26005)(77096007)(336012)(86362001)(356004)(229853002)(6916009)(55016002)(97876018)(316002)(478600001)(97756001)(69596002)(9686003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR05MB6714; H:P-EXFEND-EQX-01.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53e5511f-192b-49ba-095e-08d6de1b8bc6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4710095)(4711036)(2017052603328); SRVR:DM6PR05MB6714; X-MS-TrafficTypeDiagnostic: DM6PR05MB6714: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0044C17179 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: iCfNYwSFb8NpmPqq/qGEitQvZsFZOl6tY+ZsN6j+AkIqNHnZVJfwdc8aJdksIH5aB9Nu7bDu4HbuCH839lQdYHomqgYI+vJ3KYq65fU6Z1uNRzBM3AepJ+8/eGrRYvpDdXgEGHAy3KqbJV/uSYg6OtJk88EJDuVv3bd84KPnGFUAT69LIf4lxvYydXkcJNAmWSuS1LLvk7VEHLWLB++U7OjHwEZoaUvkI5+4JI7lE5Vm9V9zFmxyn97e5A4penjoakXCc6uvGr6pTO+L9JhS6sxsekWIjYDzgCYrACUiGhqahAYNmWRcI6UD0099YVdWBMpRkL7frwnbK87eeWCJxINI0CF80lXHP8N6yimo5YJj1FqVPYmH6tw0UF2LXz5PRrYbnmw4hu5yAVwGYEljsci9V7DYaJnkYT40XmFHZXc= X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2019 18:38:40.9798 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53e5511f-192b-49ba-095e-08d6de1b8bc6 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB6714 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-21_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=484 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905210114 X-Rspamd-Queue-Id: D513872A79 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.87 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:67.231.152.164]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWELVE(0.00)[12]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.38)[0.379,0]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; MX_GOOD(-0.01)[mxb-00273201.gslb.pphosted.com,mxa-00273201.gslb.pphosted.com]; IP_SCORE(-0.14)[ip: (-0.39), ipnet: 67.231.152.0/24(-0.15), asn: 22843(-0.09), country: US(-0.06)]; RCVD_IN_DNSWL_LOW(-0.10)[164.152.231.67.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 18:38:47 -0000 Rodney W. Grimes wrote: > > Sorry,should I wait until after freeze? > > This is all optional stuff anyway, so no great harm either way. > > No, please do merge this at 3 days, it is just that the > normal minimum bake time in ^head is 3 days, freeze or not. Ah, got it. Thanks --sjg From owner-svn-src-all@freebsd.org Tue May 21 18:42:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FB1C15B59C9; Tue, 21 May 2019 18:42:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB27D72EF0; Tue, 21 May 2019 18:42:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87B7D9B96; Tue, 21 May 2019 18:42:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LIgaZk058087; Tue, 21 May 2019 18:42:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LIga6Q058086; Tue, 21 May 2019 18:42:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905211842.x4LIga6Q058086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 May 2019 18:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348059 - head/sys/dev/vt/hw/efifb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vt/hw/efifb X-SVN-Commit-Revision: 348059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB27D72EF0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 18:42:37 -0000 Author: emaste Date: Tue May 21 18:42:36 2019 New Revision: 348059 URL: https://svnweb.freebsd.org/changeset/base/348059 Log: vt efifb: add suspend/resume calls Using the latest NVIDIA driver, upon resuming from suspend with X running the display remained blank. Additionally OpenGL applications that were running triggered a number of error messages from the NVIDIA driver. This occurred because the vt efifb back-end did not signal the X server to release the display before suspending (or to re-acquire it after resuming). The NVIDIA driver includes code for smoothly shutting down and re-initializing the GPU, which was not getting called. Since the NVIDIA driver doesn't currently support framebuffer devices and vt is forced to fall back to the efifb back-end, add vd_suspend and vd_resume members to connect the suspend/resume path. This ensures the X server is properly able to re-initialize the display. PR: 237050 Submitted by: Erik Kurzinger Reviewed by: markj MFC after: 2 weeks Event: Waterloo Hackathon 2019 Modified: head/sys/dev/vt/hw/efifb/efifb.c Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Tue May 21 18:08:19 2019 (r348058) +++ head/sys/dev/vt/hw/efifb/efifb.c Tue May 21 18:42:36 2019 (r348059) @@ -64,6 +64,8 @@ static struct vt_driver vt_efifb_driver = { .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, + .vd_suspend = vt_suspend, + .vd_resume = vt_resume, /* Better than VGA, but still generic driver. */ .vd_priority = VD_PRIORITY_GENERIC + 1, }; From owner-svn-src-all@freebsd.org Tue May 21 19:18:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1898915B69EB; Tue, 21 May 2019 19:18:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE33274A6D; Tue, 21 May 2019 19:18:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85085A0BC; Tue, 21 May 2019 19:18:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LJItTf074023; Tue, 21 May 2019 19:18:55 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LJItPX074022; Tue, 21 May 2019 19:18:55 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201905211918.x4LJItPX074022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 May 2019 19:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348060 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 348060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE33274A6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 19:18:56 -0000 Author: bz Date: Tue May 21 19:18:55 2019 New Revision: 348060 URL: https://svnweb.freebsd.org/changeset/base/348060 Log: Similarly to r338257,338306 try to fold the two consecutive #ifdef RSS section in udp_output() into one by moving a '}' outside of the conditional block. MFC after: 2 months Event: Waterloo Hackathon 2019 Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue May 21 18:42:36 2019 (r348059) +++ head/sys/netinet/udp_usrreq.c Tue May 21 19:18:55 2019 (r348060) @@ -1505,8 +1505,9 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s if (flowtype != M_HASHTYPE_NONE) { m->m_pkthdr.flowid = flowid; M_HASHTYPE_SET(m, flowtype); + } #ifdef RSS - } else { + else { uint32_t hash_val, hash_type; /* * Calculate an appropriate RSS hash for UDP and @@ -1529,10 +1530,8 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s m->m_pkthdr.flowid = hash_val; M_HASHTYPE_SET(m, hash_type); } -#endif } -#ifdef RSS /* * Don't override with the inp cached flowid value. * From owner-svn-src-all@freebsd.org Tue May 21 19:23:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABAF215B6EDA; Tue, 21 May 2019 19:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D993751EF; Tue, 21 May 2019 19:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E42A26C; Tue, 21 May 2019 19:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LJNuSR079045; Tue, 21 May 2019 19:23:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LJNufW079044; Tue, 21 May 2019 19:23:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201905211923.x4LJNufW079044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 May 2019 19:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348061 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 348061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D993751EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 19:23:57 -0000 Author: bz Date: Tue May 21 19:23:56 2019 New Revision: 348061 URL: https://svnweb.freebsd.org/changeset/base/348061 Log: Massively blow up the locking-related KASSERTs used to make sure that we end up in a consistent locking state at the end of udp_output() in order to be able to see what the values are based on which we once took a decision (note: some values may have changed). This helped to debug a syzkaller report. MFC after: 2 months Event: Waterloo Hackathon 2019 Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue May 21 19:18:55 2019 (r348060) +++ head/sys/netinet/udp_usrreq.c Tue May 21 19:23:56 2019 (r348061) @@ -1566,12 +1566,22 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s release: if (unlock_udbinfo == UH_WLOCKED) { KASSERT(unlock_inp == UH_WLOCKED, - ("%s: excl udbinfo lock, shared inp lock", __func__)); + ("%s: excl udbinfo lock %#03x, shared inp lock %#03x, " + "sin %p daddr %#010x inp %p laddr %#010x lport %#06x " + "src fam %#04x", + __func__, unlock_udbinfo, unlock_inp, sin, + (sin != NULL) ? sin->sin_addr.s_addr : 0xfefefefe, inp, + inp->inp_laddr.s_addr, inp->inp_lport, src.sin_family)); INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); } else if (unlock_udbinfo == UH_RLOCKED) { KASSERT(unlock_inp == UH_RLOCKED, - ("%s: shared udbinfo lock, excl inp lock", __func__)); + ("%s: shared udbinfo lock %#03x, excl inp lock %#03x, " + "sin %p daddr %#010x inp %p laddr %#010x lport %#06x " + "src fam %#04x", + __func__, unlock_udbinfo, unlock_inp, sin, + (sin != NULL) ? sin->sin_addr.s_addr : 0xfefefefe, inp, + inp->inp_laddr.s_addr, inp->inp_lport, src.sin_family)); INP_HASH_RUNLOCK_ET(pcbinfo, et); INP_RUNLOCK(inp); } else if (unlock_inp == UH_WLOCKED) From owner-svn-src-all@freebsd.org Tue May 21 19:42:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E5A15B79B6; Tue, 21 May 2019 19:42:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE267618C; Tue, 21 May 2019 19:42:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09B8DA5CA; Tue, 21 May 2019 19:42:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LJg4Cg088782; Tue, 21 May 2019 19:42:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LJg4hZ088781; Tue, 21 May 2019 19:42:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201905211942.x4LJg4hZ088781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 May 2019 19:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348063 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 348063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DE267618C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 19:42:05 -0000 Author: bz Date: Tue May 21 19:42:04 2019 New Revision: 348063 URL: https://svnweb.freebsd.org/changeset/base/348063 Log: Add very basic afinet socket tests which I started to write in order to then try to reproduce a kernel panic, which turned out to be a race condition and hard to test from here. Commit the changes anywhere as the "bind zero" case was a surprise to me and we should try to maintain this status. Also it is easy examples someone can build upon. With help from: markj Event: Waterloo Hackathon 2019 Added: head/tests/sys/netinet/socket_afinet.c (contents, props changed) Modified: head/tests/sys/netinet/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Tue May 21 19:34:39 2019 (r348062) +++ head/tests/sys/netinet/Makefile Tue May 21 19:42:04 2019 (r348063) @@ -4,7 +4,8 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} ATF_TESTS_C= ip_reass_test \ - so_reuseport_lb_test + so_reuseport_lb_test \ + socket_afinet ATF_TESTS_SH= fibs_test Added: head/tests/sys/netinet/socket_afinet.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/socket_afinet.c Tue May 21 19:42:04 2019 (r348063) @@ -0,0 +1,97 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +ATF_TC_WITHOUT_HEAD(socket_afinet); +ATF_TC_BODY(socket_afinet, tc) +{ + int sd; + + sd = socket(PF_INET, SOCK_DGRAM, 0); + ATF_CHECK(sd >= 0); + + close(sd); +} + +ATF_TC_WITHOUT_HEAD(socket_afinet_bind_zero); +ATF_TC_BODY(socket_afinet_bind_zero, tc) +{ + int sd, rc; + struct sockaddr_in sin; + + sd = socket(PF_INET, SOCK_DGRAM, 0); + ATF_CHECK(sd >= 0); + + bzero(&sin, sizeof(sin)); + /* + * For AF_INET we do not check the family in in_pcbbind_setup(9), + * sa_len gets set from the syscall argument in getsockaddr(9), + * so we bind to 0:0. + */ + rc = bind(sd, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + + close(sd); +} + +ATF_TC_WITHOUT_HEAD(socket_afinet_bind_ok); +ATF_TC_BODY(socket_afinet_bind_ok, tc) +{ + int sd, rc; + struct sockaddr_in sin; + + sd = socket(PF_INET, SOCK_DGRAM, 0); + ATF_CHECK(sd >= 0); + + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_port = htons(6666); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + rc = bind(sd, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + + close(sd); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, socket_afinet); + ATF_TP_ADD_TC(tp, socket_afinet_bind_zero); + ATF_TP_ADD_TC(tp, socket_afinet_bind_ok); + + return atf_no_error(); +} From owner-svn-src-all@freebsd.org Tue May 21 20:38:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12A4A158CC61; Tue, 21 May 2019 20:38:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC27E77DFA; Tue, 21 May 2019 20:38:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9428BAE4C; Tue, 21 May 2019 20:38:53 +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 x4LKcrIw016102; Tue, 21 May 2019 20:38:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LKcmoq016080; Tue, 21 May 2019 20:38:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905212038.x4LKcmoq016080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 21 May 2019 20:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348064 - in head/sys: arm64/arm64 dev/acpica dev/ixgbe fs/unionfs kern mips/mips riscv/riscv ufs/ffs ufs/ufs vm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: arm64/arm64 dev/acpica dev/ixgbe fs/unionfs kern mips/mips riscv/riscv ufs/ffs ufs/ufs vm X-SVN-Commit-Revision: 348064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC27E77DFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 20:38:54 -0000 Author: cem Date: Tue May 21 20:38:48 2019 New Revision: 348064 URL: https://svnweb.freebsd.org/changeset/base/348064 Log: Include ktr.h in more compilation units Similar to r348026, exhaustive search for uses of CTRn() and cross reference ktr.h includes. Where it was obvious that an OS compat header of some kind included ktr.h indirectly, .c files were left alone. Some of these files clearly got ktr.h via header pollution in some scenarios, or tinderbox would not be passing prior to this revision, but go ahead and explicitly include it in files using it anyway. Like r348026, these CUs did not show up in tinderbox as missing the include. Reported by: peterj (arm64/mp_machdep.c) X-MFC-With: r347984 Sponsored by: Dell EMC Isilon Modified: head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/arm64/trap.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/ixgbe/if_sriov.c head/sys/fs/unionfs/union_subr.c head/sys/kern/kern_exit.c head/sys/kern/subr_eventhandler.c head/sys/kern/sys_process.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/trap.c head/sys/riscv/riscv/trap.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_extattr.c head/sys/vm/vnode_pager.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/arm64/arm64/mp_machdep.c Tue May 21 20:38:48 2019 (r348064) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/arm64/arm64/trap.c Tue May 21 20:38:48 2019 (r348064) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/dev/acpica/acpi_ec.c Tue May 21 20:38:48 2019 (r348064) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include #include +#include #include #include #include Modified: head/sys/dev/ixgbe/if_sriov.c ============================================================================== --- head/sys/dev/ixgbe/if_sriov.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/dev/ixgbe/if_sriov.c Tue May 21 20:38:48 2019 (r348064) @@ -37,6 +37,8 @@ #ifdef PCI_IOV +#include + MALLOC_DEFINE(M_IXGBE_SRIOV, "ix_sriov", "ix SR-IOV allocations"); /************************************************************************ Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/fs/unionfs/union_subr.c Tue May 21 20:38:48 2019 (r348064) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/kern_exit.c Tue May 21 20:38:48 2019 (r348064) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/subr_eventhandler.c Tue May 21 20:38:48 2019 (r348064) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/sys_process.c Tue May 21 20:38:48 2019 (r348064) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/vfs_bio.c Tue May 21 20:38:48 2019 (r348064) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/vfs_cache.c Tue May 21 20:38:48 2019 (r348064) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/vfs_mount.c Tue May 21 20:38:48 2019 (r348064) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/vfs_subr.c Tue May 21 20:38:48 2019 (r348064) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/kern/vfs_vnops.c Tue May 21 20:38:48 2019 (r348064) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/mips/mips/freebsd32_machdep.c Tue May 21 20:38:48 2019 (r348064) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/mips/mips/pm_machdep.c Tue May 21 20:38:48 2019 (r348064) @@ -40,13 +40,13 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include #include #include #include +#include #include #include #include Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/mips/mips/trap.c Tue May 21 20:38:48 2019 (r348064) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/riscv/riscv/trap.c Tue May 21 20:38:48 2019 (r348064) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue May 21 20:38:48 2019 (r348064) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/ufs/ufs/ufs_extattr.c Tue May 21 20:38:48 2019 (r348064) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue May 21 19:42:04 2019 (r348063) +++ head/sys/vm/vnode_pager.c Tue May 21 20:38:48 2019 (r348064) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Tue May 21 21:14:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB35A158F88A; Tue, 21 May 2019 21:14:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E30280FEF; Tue, 21 May 2019 21:14:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 657D6B513; Tue, 21 May 2019 21:14:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LLENxv036683; Tue, 21 May 2019 21:14:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLENka036682; Tue, 21 May 2019 21:14:23 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905212114.x4LLENka036682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 May 2019 21:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348065 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 348065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E30280FEF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:14:24 -0000 Author: allanjude Date: Tue May 21 21:14:22 2019 New Revision: 348065 URL: https://svnweb.freebsd.org/changeset/base/348065 Log: Correct the way remaining battery life is calculated Previously, if a system had multiple batteries, the remaining life percentage was calculated as the average of each battery's percent remaining. This results in rather incorrect values when you consider the case of the Thinkpad X270 that has a small 3 cell internally battery, and a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%, but battery 1 is at 10%, you do not infact have 55% of your capacity remaining. The new method calculates the percentage based on remaining capacity out of total capacity, giving a much more accurate reading. PR: 229818 Submitted by: Keegan Drake H.P. MFC after: 2 weeks Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Tue May 21 20:38:48 2019 (r348064) +++ head/sys/dev/acpica/acpi_battery.c Tue May 21 21:14:22 2019 (r348065) @@ -119,7 +119,7 @@ int acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo) { int batt_stat, devcount, dev_idx, error, i; - int total_cap, total_min, valid_rate, valid_units; + int total_cap, total_lfcap, total_min, valid_rate, valid_units; devclass_t batt_dc; device_t batt_dev; struct acpi_bst *bst; @@ -152,6 +152,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ dev_idx = -1; batt_stat = valid_rate = valid_units = 0; + total_cap = total_lfcap = 0; for (i = 0; i < devcount; i++) { /* Default info for every battery is "not present". */ acpi_reset_battinfo(&bi[i]); @@ -210,17 +211,23 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba if (!acpi_battery_bif_valid(bif)) continue; - /* Calculate percent capacity remaining. */ - bi[i].cap = (100 * bst[i].cap) / bif->lfcap; - /* * Some laptops report the "design-capacity" instead of the * "real-capacity" when the battery is fully charged. That breaks * the above arithmetic as it needs to be 100% maximum. */ - if (bi[i].cap > 100) - bi[i].cap = 100; + if (bst[i].cap > bif->lfcap) + bst[i].cap = bif->lfcap; + /* Calculate percent capacity remaining. */ + bi[i].cap = (100 * bst[i].cap) / bif->lfcap; + + /* If this battery is not present, don't use its capacity. */ + if (bi[i].cap != -1) { + total_cap += bst[i].cap; + total_lfcap += bif->lfcap; + } + /* * On systems with more than one battery, they may get used * sequentially, thus bst.rate may only signify the one currently @@ -241,7 +248,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba } /* Pass 2: calculate capacity and remaining time for all batteries. */ - total_cap = total_min = 0; + total_min = 0; for (i = 0; i < devcount; i++) { /* * If any batteries are discharging, use the sum of the bst.rate @@ -253,10 +260,6 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba else bi[i].min = 0; total_min += bi[i].min; - - /* If this battery is not present, don't use its capacity. */ - if (bi[i].cap != -1) - total_cap += bi[i].cap; } /* @@ -265,7 +268,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba */ if (valid_units > 0) { if (dev == NULL) { - battinfo->cap = total_cap / valid_units; + battinfo->cap = (total_cap * 100) / total_lfcap; battinfo->min = total_min; battinfo->state = batt_stat; battinfo->rate = valid_rate; From owner-svn-src-all@freebsd.org Tue May 21 21:22:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BA5F158FB79; Tue, 21 May 2019 21:22:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A26F481509; Tue, 21 May 2019 21:22:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F25FB6DF; Tue, 21 May 2019 21:22:44 +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 x4LLMiWg041720; Tue, 21 May 2019 21:22:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLMhup041717; Tue, 21 May 2019 21:22:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905212122.x4LLMhup041717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 May 2019 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348066 - in head/libexec/bootpd: . bootpgw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/libexec/bootpd: . bootpgw X-SVN-Commit-Revision: 348066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A26F481509 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:22:45 -0000 Author: markj Date: Tue May 21 21:22:43 2019 New Revision: 348066 URL: https://svnweb.freebsd.org/changeset/base/348066 Log: bootpd: Add an option to skip modifications to the ARP table. PR: 30854 Submitted by: Dan Lukes Reviewed by: imp (previous version) MFC after: 1 week Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D2581 Modified: head/libexec/bootpd/bootpd.8 head/libexec/bootpd/bootpd.c head/libexec/bootpd/bootpgw/bootpgw.c Modified: head/libexec/bootpd/bootpd.8 ============================================================================== --- head/libexec/bootpd/bootpd.8 Tue May 21 21:14:22 2019 (r348065) +++ head/libexec/bootpd/bootpd.8 Tue May 21 21:22:43 2019 (r348066) @@ -2,7 +2,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 10, 2004 +.Dd May 21, 2019 .Dt BOOTPD 8 .Os .Sh NAME @@ -103,6 +103,8 @@ option may be used to force standalone or inetd mode r .Sh OPTIONS The following options are available: .Bl -tag -width indent +.It Fl a +Skip ARP table modifications. .It Fl t Ar timeout Specify the .Ar timeout Modified: head/libexec/bootpd/bootpd.c ============================================================================== --- head/libexec/bootpd/bootpd.c Tue May 21 21:14:22 2019 (r348065) +++ head/libexec/bootpd/bootpd.c Tue May 21 21:22:43 2019 (r348066) @@ -143,6 +143,7 @@ struct timeval actualtimeout = 15 * 60L, /* tv_sec */ 0 /* tv_usec */ }; +int arpmod = TRUE; /* modify the ARP table */ /* * General @@ -266,6 +267,9 @@ main(argc, argv) break; switch (argv[0][1]) { + case 'a': /* don't modify the ARP table */ + arpmod = FALSE; + break; case 'c': /* chdir_path */ if (argv[0][2]) { stmp = &(argv[0][2]); @@ -583,8 +587,9 @@ PRIVATE void usage() { fprintf(stderr, - "usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); fprintf(stderr, " [bootptab [dumpfile]]\n"); + fprintf(stderr, "\t -a\tdon't modify ARP table\n"); fprintf(stderr, "\t -c n\tset current directory\n"); fprintf(stderr, "\t -d n\tset debug level\n"); fprintf(stderr, "\t -h n\tset the hostname to listen on\n"); @@ -1067,10 +1072,12 @@ sendreply(forward, dst_override) if (haf == 0) haf = HTYPE_ETHERNET; - if (debug > 1) - report(LOG_INFO, "setarp %s - %s", - inet_ntoa(dst), haddrtoa(ha, len)); - setarp(s, &dst, haf, ha, len); + if (arpmod) { + if (debug > 1) + report(LOG_INFO, "setarp %s - %s", + inet_ntoa(dst), haddrtoa(ha, len)); + setarp(s, &dst, haf, ha, len); + } } if ((forward == 0) && Modified: head/libexec/bootpd/bootpgw/bootpgw.c ============================================================================== --- head/libexec/bootpd/bootpgw/bootpgw.c Tue May 21 21:14:22 2019 (r348065) +++ head/libexec/bootpd/bootpgw/bootpgw.c Tue May 21 21:22:43 2019 (r348066) @@ -124,6 +124,7 @@ struct timeval actualtimeout = u_char maxhops = 4; /* Number of hops allowed for requests. */ u_int minwait = 3; /* Number of seconds client must wait before its bootrequest packets are forwarded. */ +int arpmod = TRUE; /* modify the ARP table */ /* * General @@ -238,6 +239,9 @@ main(argc, argv) break; switch (argv[0][1]) { + case 'a': /* don't modify the ARP table */ + arpmod = FALSE; + break; case 'd': /* debug level */ if (argv[0][2]) { stmp = &(argv[0][2]); @@ -496,7 +500,8 @@ static void usage() { fprintf(stderr, - "usage: bootpgw [-d level] [-i] [-s] [-t timeout] server\n"); + "usage: \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n"); + fprintf(stderr, "\t -a\tdon't modify ARP table\n"); fprintf(stderr, "\t -d n\tset debug level\n"); fprintf(stderr, "\t -h n\tset max hop count\n"); fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n"); @@ -641,19 +646,23 @@ handle_reply() send_addr.sin_addr = bp->bp_yiaddr; send_addr.sin_port = htons(bootpc_port); - /* Create an ARP cache entry for the client. */ - ha = bp->bp_chaddr; - len = bp->bp_hlen; - if (len > MAXHADDRLEN) - len = MAXHADDRLEN; - haf = (int) bp->bp_htype; - if (haf == 0) - haf = HTYPE_ETHERNET; + if (arpmod) { + /* Create an ARP cache entry for the client. */ + ha = bp->bp_chaddr; + len = bp->bp_hlen; + struct in_addr dst; - if (debug > 1) - report(LOG_INFO, "setarp %s - %s", - inet_ntoa(bp->bp_yiaddr), haddrtoa(ha, len)); - setarp(s, &bp->bp_yiaddr, haf, ha, len); + if (len > MAXHADDRLEN) + len = MAXHADDRLEN; + haf = (int) bp->bp_htype; + if (haf == 0) + haf = HTYPE_ETHERNET; + + if (debug > 1) + report(LOG_INFO, "setarp %s - %s", + inet_ntoa(dst), haddrtoa(ha, len)); + setarp(s, &dst, haf, ha, len); + } /* Send reply with same size packet as request used. */ if (sendto(s, pktbuf, pktlen, 0, From owner-svn-src-all@freebsd.org Tue May 21 21:26:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50BB2158FE51; Tue, 21 May 2019 21:26:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E98948191C; Tue, 21 May 2019 21:26:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2D60B708; Tue, 21 May 2019 21:26:14 +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 x4LLQEAP042067; Tue, 21 May 2019 21:26:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLQEhS042066; Tue, 21 May 2019 21:26:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905212126.x4LLQEhS042066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 21 May 2019 21:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348067 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E98948191C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:26:15 -0000 Author: cem Date: Tue May 21 21:26:14 2019 New Revision: 348067 URL: https://svnweb.freebsd.org/changeset/base/348067 Log: mqueuefs: Do not allow manipulation of the pseudo-dirents "." and ".." "." and ".." names are not maintained in the mqueuefs dirent datastructure and cannot be opened as mqueues. Creating or removing them is invalid; return EINVAL instead of crashing. PR: 236836 Submitted by: Torbjørn Birch Moltu Discussed with: jilles (earlier version) Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Tue May 21 21:22:43 2019 (r348066) +++ head/sys/kern/uipc_mqueue.c Tue May 21 21:26:14 2019 (r348067) @@ -2042,6 +2042,12 @@ kern_kmq_open(struct thread *td, const char *upath, in len = strlen(path); if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) return (EINVAL); + /* + * "." and ".." are magic directories, populated on the fly, and cannot + * be opened as queues. + */ + if (strcmp(path, "/.") == 0 || strcmp(path, "/..") == 0) + return (EINVAL); AUDIT_ARG_UPATH1_CANON(path); error = falloc(td, &fp, &fd, O_CLOEXEC); @@ -2141,6 +2147,8 @@ sys_kmq_unlink(struct thread *td, struct kmq_unlink_ar len = strlen(path); if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) + return (EINVAL); + if (strcmp(path, "/.") == 0 || strcmp(path, "/..") == 0) return (EINVAL); AUDIT_ARG_UPATH1_CANON(path); From owner-svn-src-all@freebsd.org Tue May 21 21:26:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CFDB158FE87; Tue, 21 May 2019 21:26:19 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F9228193A; Tue, 21 May 2019 21:26:19 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F22F8B70A; Tue, 21 May 2019 21:26:18 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LLQIiM042132; Tue, 21 May 2019 21:26:18 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLQIDO042131; Tue, 21 May 2019 21:26:18 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905212126.x4LLQIDO042131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 May 2019 21:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348068 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F9228193A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:26:19 -0000 Author: allanjude Date: Tue May 21 21:26:18 2019 New Revision: 348068 URL: https://svnweb.freebsd.org/changeset/base/348068 Log: ZFS: Make deadman tunables no longer read-only This allows the user to enable, disable, and adjust the I/O deadman at runtime. This can be especially useful when a pool is backed by remote storage (such as iscsi, ggated, etc). PR: 221906 Submitted by: Fabian Keil Obtained from: ElectroBSD MFC after: 1 week Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue May 21 21:26:14 2019 (r348067) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue May 21 21:26:18 2019 (r348068) @@ -363,13 +363,13 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RWTUN, &zfs_deadman_synctime_ms, 0, "Stalled ZFS I/O expiration time in milliseconds"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RwTUN, &zfs_deadman_checktime_ms, 0, "Period of checks for stalled ZFS I/O in milliseconds"); -SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN, &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); From owner-svn-src-all@freebsd.org Tue May 21 21:27:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28F6A158FF6D; Tue, 21 May 2019 21:27:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF28D81D3F; Tue, 21 May 2019 21:27:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99B00B70D; Tue, 21 May 2019 21:27:14 +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 x4LLREJ7042227; Tue, 21 May 2019 21:27:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLREI8042226; Tue, 21 May 2019 21:27:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905212127.x4LLREI8042226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 May 2019 21:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348069 - head/libexec/bootpd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/libexec/bootpd X-SVN-Commit-Revision: 348069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF28D81D3F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:27:15 -0000 Author: emaste Date: Tue May 21 21:27:14 2019 New Revision: 348069 URL: https://svnweb.freebsd.org/changeset/base/348069 Log: bootpd: avoid the same error indication for different issues There were several (apparently) copy-pasted NEED validation macros, leading to the same error string for different issues. Change the YP and NTP tags so they are distinct. PR: 30863 Submitted by: Dan Lukes Reviewed by: markj MFC after: 1 week Event: Waterloo Hackathon 2019 Modified: head/libexec/bootpd/dovend.c Modified: head/libexec/bootpd/dovend.c ============================================================================== --- head/libexec/bootpd/dovend.c Tue May 21 21:26:18 2019 (r348068) +++ head/libexec/bootpd/dovend.c Tue May 21 21:27:14 2019 (r348069) @@ -147,7 +147,7 @@ dovend_rfc1497(hp, buf, len) if (insert_ip(TAG_NIS_SERVER, hp->nis_server, &vp, &bytesleft)) - NEED(8, "ds"); + NEED(8, "ys"); } if (hp->flags.nis_domain) { /* @@ -155,7 +155,7 @@ dovend_rfc1497(hp, buf, len) * TAG_NIS_DOMAIN and length. */ len = strlen(hp->nis_domain->string); - NEED((len + 2), "dn"); + NEED((len + 2), "yn"); *vp++ = TAG_NIS_DOMAIN; *vp++ = (byte) (len & 0xFF); bcopy(hp->nis_domain->string, vp, len); @@ -187,7 +187,7 @@ dovend_rfc1497(hp, buf, len) if (insert_ip(TAG_NTP_SERVER, hp->ntp_server, &vp, &bytesleft)) - NEED(8, "ts"); + NEED(8, "nt"); } /* * I wonder: If the hostname were "promoted" into the BOOTP From owner-svn-src-all@freebsd.org Tue May 21 21:35:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E3611590770; Tue, 21 May 2019 21:35:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0F48265A; Tue, 21 May 2019 21:35:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA104B8BF; Tue, 21 May 2019 21:35:37 +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 x4LLZbxM047362; Tue, 21 May 2019 21:35:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLZbkB047361; Tue, 21 May 2019 21:35:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905212135.x4LLZbkB047361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 21 May 2019 21:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348070 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B0F48265A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:35:38 -0000 Author: cem Date: Tue May 21 21:35:37 2019 New Revision: 348070 URL: https://svnweb.freebsd.org/changeset/base/348070 Log: sys/lockmgr.h: Update #error to point at correct _lock.h After r347984, these macros live in sys/_lock.h. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/sys/lockmgr.h Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Tue May 21 21:27:14 2019 (r348069) +++ head/sys/sys/lockmgr.h Tue May 21 21:35:37 2019 (r348070) @@ -58,7 +58,7 @@ #ifdef _KERNEL #if !defined(LOCK_FILE) || !defined(LOCK_LINE) -#error "LOCK_FILE and LOCK_LINE not defined, include before" +#error "LOCK_FILE and LOCK_LINE not defined, include before" #endif struct thread; From owner-svn-src-all@freebsd.org Tue May 21 21:39:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C1D15908F3; Tue, 21 May 2019 21:39:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF94782865; Tue, 21 May 2019 21:39:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86046B8D9; Tue, 21 May 2019 21:39:03 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LLd3Sk047552; Tue, 21 May 2019 21:39:03 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LLd3Dx047551; Tue, 21 May 2019 21:39:03 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905212139.x4LLd3Dx047551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 May 2019 21:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348071 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF94782865 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 21:39:04 -0000 Author: allanjude Date: Tue May 21 21:39:03 2019 New Revision: 348071 URL: https://svnweb.freebsd.org/changeset/base/348071 Log: Fix typo in r348068 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue May 21 21:35:37 2019 (r348070) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue May 21 21:39:03 2019 (r348071) @@ -366,7 +366,7 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RWTUN, &zfs_deadman_synctime_ms, 0, "Stalled ZFS I/O expiration time in milliseconds"); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RwTUN, +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RWTUN, &zfs_deadman_checktime_ms, 0, "Period of checks for stalled ZFS I/O in milliseconds"); SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN, From owner-svn-src-all@freebsd.org Tue May 21 22:11:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 457401591758; Tue, 21 May 2019 22:11:55 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6DCD83C13; Tue, 21 May 2019 22:11:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1760C1AC; Tue, 21 May 2019 22:11:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LMBsc9064633; Tue, 21 May 2019 22:11:54 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LMBrQS064628; Tue, 21 May 2019 22:11:53 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905212211.x4LMBrQS064628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 May 2019 22:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348072 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 348072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6DCD83C13 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 22:11:55 -0000 Author: allanjude Date: Tue May 21 22:11:53 2019 New Revision: 348072 URL: https://svnweb.freebsd.org/changeset/base/348072 Log: Add missing errors section to md[2-5], ripemd160, sha*, and skein* manpages PR: 148987 Submitted by: Dan Lukes (original version) MFC after: 1 week Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Modified: head/lib/libmd/mdX.3 head/lib/libmd/ripemd.3 head/lib/libmd/sha.3 head/lib/libmd/sha256.3 head/lib/libmd/sha512.3 head/lib/libmd/skein.3 Modified: head/lib/libmd/mdX.3 ============================================================================== --- head/lib/libmd/mdX.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/mdX.3 Tue May 21 22:11:53 2019 (r348072) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd May 21, 2019 .Dt MDX 3 .Os .Sh NAME @@ -144,6 +144,26 @@ after use. If the .Fa buf argument is non-null it must point to at least 33 characters of buffer space. +.Sh ERRORS +The +.Fn MDXEnd +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn MDXFile +and +.Fn MDXFileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr MDXEnd 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/ripemd.3 ============================================================================== --- head/lib/libmd/ripemd.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/ripemd.3 Tue May 21 22:11:53 2019 (r348072) @@ -124,6 +124,26 @@ after use. If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. +.Sh ERRORS +The +.Fn RIPEMD160_End +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn RIPEMD160_File +and +.Fn RIPEMD160_FileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr RIPEMD160_End 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/sha.3 Tue May 21 22:11:53 2019 (r348072) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd May 21, 2019 .Dt SHA 3 .Os .Sh NAME @@ -155,6 +155,26 @@ after use. If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. +.Sh ERRORS +The +.Fn SHA1_End +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn SHA1_File +and +.Fn SHA1_FileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr SHA1_End 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/sha256.3 ============================================================================== --- head/lib/libmd/sha256.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/sha256.3 Tue May 21 22:11:53 2019 (r348072) @@ -146,6 +146,26 @@ argument is non-null it must point to at least 65 char .Pp SHA224 is identical SHA256, except it has slightly different initialization vectors, and is truncated to a shorter digest. +.Sh ERRORS +The +.Fn SHA256_End +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn SHA256_File +and +.Fn SHA256_FileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr SHA256_End 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/sha512.3 Tue May 21 22:11:53 2019 (r348072) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd May 21, 2019 .Dt SHA512 3 .Os .Sh NAME @@ -190,6 +190,26 @@ which converts the return value to a 65-character (including the terminating '\e0') .Tn ASCII string which represents the 256 bits in hexadecimal. +.Sh ERRORS +The +.Fn SHA512_End +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn SHA512_File +and +.Fn SHA512_FileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr SHA512_End 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , Modified: head/lib/libmd/skein.3 ============================================================================== --- head/lib/libmd/skein.3 Tue May 21 21:39:03 2019 (r348071) +++ head/lib/libmd/skein.3 Tue May 21 22:11:53 2019 (r348072) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2016 +.Dd May 21, 2019 .Dt SKEIN 3 .Os .Sh NAME @@ -188,6 +188,26 @@ functions are similar to the .Li SKEIN256_ functions except they produce a 512-bit, 65 character, or 1024-bit, 129 character, output. +.Sh ERRORS +The +.Fn SKEIN256_End +function called with a null buf argument may fail and return NULL if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient storage space is available. +.El +.Pp +The +.Fn SKEIN256_File +and +.Fn SKEIN256_FileChunk +may return NULL when underlying +.Xr open 2 , +.Xr fstat 2 , +.Xr lseek 2 , +or +.Xr SKEIN256_End 2 +fail. .Sh SEE ALSO .Xr md4 3 , .Xr md5 3 , From owner-svn-src-all@freebsd.org Tue May 21 22:17:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065B415919A7; Tue, 21 May 2019 22:17:02 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7018401A; Tue, 21 May 2019 22:17:01 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7542FC229; Tue, 21 May 2019 22:17:01 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LMH1sT068160; Tue, 21 May 2019 22:17:01 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LMH1GG068159; Tue, 21 May 2019 22:17:01 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905212217.x4LMH1GG068159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 21 May 2019 22:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348073 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 348073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F7018401A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 22:17:02 -0000 Author: allanjude Date: Tue May 21 22:17:00 2019 New Revision: 348073 URL: https://svnweb.freebsd.org/changeset/base/348073 Log: Add admonitions against using MD5 and SHA1 to the API man pages Modified: head/lib/libmd/mdX.3 head/lib/libmd/sha.3 Modified: head/lib/libmd/mdX.3 ============================================================================== --- head/lib/libmd/mdX.3 Tue May 21 22:11:53 2019 (r348072) +++ head/lib/libmd/mdX.3 Tue May 21 22:17:00 2019 (r348073) @@ -208,6 +208,8 @@ This code is derived directly from these implementatio .Pp Phk ristede runen. .Sh BUGS -No method is known to exist which finds two files having the same hash value, -nor to find a file with a specific hash value. -There is on the other hand no guarantee that such a method does not exist. +The +.Tn MD5 +algorithm has been proven to be vulnerable to practical collision +attacks and should not be relied upon to produce unique outputs, +.Em nor should they be used as part of a cryptographic signature scheme. Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Tue May 21 22:11:53 2019 (r348072) +++ head/lib/libmd/sha.3 Tue May 21 22:17:00 2019 (r348073) @@ -191,9 +191,11 @@ published .Tn FIPS standards. .Sh BUGS -No method is known to exist which finds two files having the same hash value, -nor to find a file with a specific hash value. -There is on the other hand no guarantee that such a method does not exist. +The +.Tn SHA1 +algorithm has been proven to be vulnerable to practical collision +attacks and should not be relied upon to produce unique outputs, +.Em nor should they be used as part of a cryptographic signature scheme. .Pp The .Tn IA32 From owner-svn-src-all@freebsd.org Tue May 21 22:24:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E4971591F20; Tue, 21 May 2019 22:24:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E386846F2; Tue, 21 May 2019 22:24:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C71D4C3FE; Tue, 21 May 2019 22:24:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4LMOcdP073511; Tue, 21 May 2019 22:24:38 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LMOci0073510; Tue, 21 May 2019 22:24:38 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905212224.x4LMOci0073510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 21 May 2019 22:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348074 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 348074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E386846F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 22:24:39 -0000 Author: mckusick Date: Tue May 21 22:24:38 2019 New Revision: 348074 URL: https://svnweb.freebsd.org/changeset/base/348074 Log: This revision began as a simple change to eliminate an uninitialized warning found by Coverity. However, upon closer inspection the implementation of fsck_ffs's fsck_readdir() and dircheck() functions is both nearly impossible to follow and fails to check / fix directories in several cases. So, this revision is an entire rewrite of these two functions to clarify what they are doing and also to get something that works properly. Referred by: cem Reviewed by: kib, David G Lawrence MFC after: 3 days CID 1401317: namlen may be used uninitialized Modified: head/sbin/fsck_ffs/dir.c Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Tue May 21 22:17:00 2019 (r348073) +++ head/sbin/fsck_ffs/dir.c Tue May 21 22:24:38 2019 (r348074) @@ -61,7 +61,7 @@ static struct dirtemplate dirhead = { }; static int chgino(struct inodesc *); -static int dircheck(struct inodesc *, struct direct *); +static int dircheck(struct inodesc *, struct bufarea *, struct direct *); static int expanddir(union dinode *dp, char *name); static void freedir(ino_t ino, ino_t parent); static struct direct *fsck_readdir(struct inodesc *); @@ -139,78 +139,70 @@ dirscan(struct inodesc *idesc) } /* - * get next entry in a directory. + * Get and verify the next entry in a directory. + * We also verify that if there is another entry in the block that it is + * valid, so if it is not valid it can be subsumed into the current entry. */ static struct direct * fsck_readdir(struct inodesc *idesc) { struct direct *dp, *ndp; struct bufarea *bp; - long size, blksiz, fix, dploc; - int dc; + long size, blksiz, subsume_ndp; + subsume_ndp = 0; blksiz = idesc->id_numfrags * sblock.fs_fsize; + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) + return (NULL); bp = getdirblk(idesc->id_blkno, blksiz); - if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && - idesc->id_loc < blksiz) { - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if ((dc = dircheck(idesc, dp)) > 0) { - if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } - goto dpok; - } - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - dp->d_reclen = DIRBLKSIZ; - dp->d_ino = 0; - dp->d_type = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; - if (fix) - dirty(bp); - idesc->id_loc += DIRBLKSIZ; - idesc->id_filesize -= DIRBLKSIZ; - return (dp); + dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + /* + * Only need to check current entry if it is the first in the + * the block, as later entries will have been checked in the + * previous call to this function. + */ + if (idesc->id_loc % DIRBLKSIZ != 0 || dircheck(idesc, bp, dp) != 0) { + /* + * Current entry is good, update to point at next. + */ + idesc->id_loc += dp->d_reclen; + idesc->id_filesize -= dp->d_reclen; + /* + * If at end of directory block, just return this entry. + */ + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz || + idesc->id_loc % DIRBLKSIZ == 0) + return (dp); + /* + * If the next entry good, return this entry. + */ + ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + if (dircheck(idesc, bp, ndp) != 0) + return (dp); + /* + * The next entry is bad, so subsume it and the remainder + * of this directory block into this entry. + */ + subsume_ndp = 1; } -dpok: - if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) - return NULL; - dploc = idesc->id_loc; - dp = (struct direct *)(bp->b_un.b_buf + dploc); - idesc->id_loc += dp->d_reclen; - idesc->id_filesize -= dp->d_reclen; - if ((idesc->id_loc % DIRBLKSIZ) == 0) - return (dp); - ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { - if ((dc = dircheck(idesc, ndp)) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) - dirty(bp); - } else if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } + /* + * Current or next entry is bad. Zap current entry or + * subsume next entry into current entry as appropriate. + */ + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (NULL); + if (subsume_ndp) { + memset(ndp, 0, size); + dp->d_reclen += size; + } else { + memset(dp, 0, size); + dp->d_reclen = size; } + if (dofix(idesc, "DIRECTORY CORRUPTED")) + dirty(bp); return (dp); } @@ -219,65 +211,80 @@ dpok: * This is a superset of the checks made in the kernel. * Also optionally clears padding and unused directory space. * - * Returns 0 if the entry is bad, 1 if the entry is good and no changes - * were made, and 2 if the entry is good but modified to clear out padding - * and unused space and needs to be written back to disk. + * Returns 0 if the entry is bad, 1 if the entry is good. */ static int -dircheck(struct inodesc *idesc, struct direct *dp) +dircheck(struct inodesc *idesc, struct bufarea *bp, struct direct *dp) { size_t size; char *cp; - u_char type; u_int8_t namlen; int spaceleft, modified, unused; - modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + size = DIRSIZ(0, dp); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || + dp->d_reclen < size || + idesc->id_filesize < size || (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; + modified = 0; if (dp->d_ino == 0) { + if (!zflag || fswritefd < 0) + return (1); /* - * Special case of an unused directory entry. Normally - * the kernel would coalesce unused space with the previous - * entry by extending its d_reclen, but there are situations - * (e.g. fsck) where that doesn't occur. - * If we're clearing out directory cruft (-z flag), then make - * sure this entry gets fully cleared as well. + * Special case of an unused directory entry. Normally only + * occurs at the beginning of a directory block when the block + * contains no entries. Other than the first entry in a + * directory block, the kernel coalesces unused space with + * the previous entry by extending its d_reclen. However, + * when cleaning up a directory, fsck may set d_ino to zero + * in the middle of a directory block. If we're clearing out + * directory cruft (-z flag), then make sure that all directory + * space in entries with d_ino == 0 gets fully cleared. */ - if (zflag && fswritefd >= 0) { - if (dp->d_type != 0) { - dp->d_type = 0; + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + unused = dp->d_reclen - __offsetof(struct direct, d_name); + for (cp = dp->d_name; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; modified = 1; } - if (dp->d_namlen != 0) { - dp->d_namlen = 0; - modified = 1; - } - if (dp->d_name[0] != '\0') { - dp->d_name[0] = '\0'; - modified = 1; - } } - goto good; + if (modified) + dirty(bp); + return (1); } - size = DIRSIZ(0, dp); + /* + * The d_type field should not be tested here. A bad type is an error + * in the entry itself but is not a corruption of the directory + * structure itself. So blowing away all the remaining entries in the + * directory block is inappropriate. Rather the type error should be + * checked in pass1 and fixed there. + * + * The name validation should also be done in pass1 although the + * check to see if the name is longer than fits in the space + * allocated for it (i.e., the *cp != '\0' fails after exiting the + * loop below) then it really is a structural error that requires + * the stronger action taken here. + */ namlen = dp->d_namlen; - type = dp->d_type; - if (dp->d_reclen < size || - idesc->id_filesize < size || - namlen == 0 || - type > 15) + if (namlen == 0 || dp->d_type > 15) goto bad; - for (cp = dp->d_name, size = 0; size < namlen; size++) - if (*cp == '\0' || (*cp++ == '/')) + for (cp = dp->d_name, size = 0; size < namlen; size++) { + if (*cp == '\0' || *cp++ == '/') goto bad; + } if (*cp != '\0') goto bad; - -good: if (zflag && fswritefd >= 0) { /* * Clear unused directory entry space, including the d_name @@ -300,11 +307,9 @@ good: } } - if (modified) { - return 2; - } + if (modified) + dirty(bp); } - return (1); bad: From owner-svn-src-all@freebsd.org Tue May 21 22:55:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ED631592C0E; Tue, 21 May 2019 22:55:02 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 8BA41858FF; Tue, 21 May 2019 22:55:01 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4LMswuP081367; Tue, 21 May 2019 15:54:58 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4LMswao081366; Tue, 21 May 2019 15:54:58 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905212254.x4LMswao081366@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348066 - in head/libexec/bootpd: . bootpgw In-Reply-To: <201905212122.x4LLMhup041717@repo.freebsd.org> To: Mark Johnston Date: Tue, 21 May 2019 15:54:58 -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-Rspamd-Queue-Id: 8BA41858FF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 22:55:02 -0000 > Author: markj > Date: Tue May 21 21:22:43 2019 > New Revision: 348066 > URL: https://svnweb.freebsd.org/changeset/base/348066 > > Log: > bootpd: Add an option to skip modifications to the ARP table. > > PR: 30854 > Submitted by: Dan Lukes > Reviewed by: imp (previous version) > MFC after: 1 week > Event: Waterloo Hackathon 2019 > Differential Revision: https://reviews.freebsd.org/D2581 > > Modified: > head/libexec/bootpd/bootpd.8 > head/libexec/bootpd/bootpd.c > head/libexec/bootpd/bootpgw/bootpgw.c > > Modified: head/libexec/bootpd/bootpd.8 > ============================================================================== > --- head/libexec/bootpd/bootpd.8 Tue May 21 21:14:22 2019 (r348065) > +++ head/libexec/bootpd/bootpd.8 Tue May 21 21:22:43 2019 (r348066) > @@ -2,7 +2,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 10, 2004 > +.Dd May 21, 2019 > .Dt BOOTPD 8 > .Os > .Sh NAME > @@ -103,6 +103,8 @@ option may be used to force standalone or inetd mode r > .Sh OPTIONS > The following options are available: > .Bl -tag -width indent > +.It Fl a > +Skip ARP table modifications. > .It Fl t Ar timeout > Specify the > .Ar timeout > > Modified: head/libexec/bootpd/bootpd.c > ============================================================================== > --- head/libexec/bootpd/bootpd.c Tue May 21 21:14:22 2019 (r348065) > +++ head/libexec/bootpd/bootpd.c Tue May 21 21:22:43 2019 (r348066) > @@ -143,6 +143,7 @@ struct timeval actualtimeout = > 15 * 60L, /* tv_sec */ > 0 /* tv_usec */ > }; > +int arpmod = TRUE; /* modify the ARP table */ > > /* > * General > @@ -266,6 +267,9 @@ main(argc, argv) > break; > switch (argv[0][1]) { > > + case 'a': /* don't modify the ARP table */ > + arpmod = FALSE; > + break; > case 'c': /* chdir_path */ > if (argv[0][2]) { > stmp = &(argv[0][2]); > @@ -583,8 +587,9 @@ PRIVATE void > usage() > { > fprintf(stderr, > - "usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > fprintf(stderr, " [bootptab [dumpfile]]\n"); > + fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > fprintf(stderr, "\t -c n\tset current directory\n"); > fprintf(stderr, "\t -d n\tset debug level\n"); > fprintf(stderr, "\t -h n\tset the hostname to listen on\n"); > @@ -1067,10 +1072,12 @@ sendreply(forward, dst_override) > if (haf == 0) > haf = HTYPE_ETHERNET; > > - if (debug > 1) > - report(LOG_INFO, "setarp %s - %s", > - inet_ntoa(dst), haddrtoa(ha, len)); > - setarp(s, &dst, haf, ha, len); > + if (arpmod) { > + if (debug > 1) > + report(LOG_INFO, "setarp %s - %s", > + inet_ntoa(dst), haddrtoa(ha, len)); > + setarp(s, &dst, haf, ha, len); > + } > } > > if ((forward == 0) && > > Modified: head/libexec/bootpd/bootpgw/bootpgw.c > ============================================================================== > --- head/libexec/bootpd/bootpgw/bootpgw.c Tue May 21 21:14:22 2019 (r348065) > +++ head/libexec/bootpd/bootpgw/bootpgw.c Tue May 21 21:22:43 2019 (r348066) > @@ -124,6 +124,7 @@ struct timeval actualtimeout = > u_char maxhops = 4; /* Number of hops allowed for requests. */ > u_int minwait = 3; /* Number of seconds client must wait before > its bootrequest packets are forwarded. */ > +int arpmod = TRUE; /* modify the ARP table */ > > /* > * General > @@ -238,6 +239,9 @@ main(argc, argv) > break; > switch (argv[0][1]) { > > + case 'a': /* don't modify the ARP table */ > + arpmod = FALSE; > + break; > case 'd': /* debug level */ > if (argv[0][2]) { > stmp = &(argv[0][2]); > @@ -496,7 +500,8 @@ static void > usage() > { > fprintf(stderr, > - "usage: bootpgw [-d level] [-i] [-s] [-t timeout] server\n"); > + "usage: \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n"); ^^^^ this looks very odd and is a very long line. Output would be: usage:bb bootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server I believe what you want here is: /*234567890123456789012345678901234567890123456789012345678901234567890123456789*/ /*234567890123456789012345678901234567890123456789012345678901234567890123456789*/ "usage:\t bootpgw [-a] [-d level] [-h count] [-i] [-s]" "[-t timeout] [-w time]\n" "\t server\n"); (Ignore my /*234 comments, that is just how I figure out how to fit these types of things.) > + fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > fprintf(stderr, "\t -d n\tset debug level\n"); > fprintf(stderr, "\t -h n\tset max hop count\n"); > fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n"); The whole usage thing uses a space after tab, which also seems odd to me. I am use to using usage done using pure spaces, no tabs anyplace, usage: followed by 1 space. > @@ -641,19 +646,23 @@ handle_reply() > send_addr.sin_addr = bp->bp_yiaddr; > send_addr.sin_port = htons(bootpc_port); > > - /* Create an ARP cache entry for the client. */ > - ha = bp->bp_chaddr; > - len = bp->bp_hlen; > - if (len > MAXHADDRLEN) > - len = MAXHADDRLEN; > - haf = (int) bp->bp_htype; > - if (haf == 0) > - haf = HTYPE_ETHERNET; > + if (arpmod) { > + /* Create an ARP cache entry for the client. */ > + ha = bp->bp_chaddr; > + len = bp->bp_hlen; > + struct in_addr dst; > > - if (debug > 1) > - report(LOG_INFO, "setarp %s - %s", > - inet_ntoa(bp->bp_yiaddr), haddrtoa(ha, len)); > - setarp(s, &bp->bp_yiaddr, haf, ha, len); > + if (len > MAXHADDRLEN) > + len = MAXHADDRLEN; > + haf = (int) bp->bp_htype; > + if (haf == 0) > + haf = HTYPE_ETHERNET; > + > + if (debug > 1) > + report(LOG_INFO, "setarp %s - %s", > + inet_ntoa(dst), haddrtoa(ha, len)); > + setarp(s, &dst, haf, ha, len); > + } > > /* Send reply with same size packet as request used. */ > if (sendto(s, pktbuf, pktlen, 0, > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 22:56:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 636901592CF7; Tue, 21 May 2019 22:56:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04D8085A6C; Tue, 21 May 2019 22:56:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1738C9B3; Tue, 21 May 2019 22:56:22 +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 x4LMuMqr089055; Tue, 21 May 2019 22:56:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4LMuMbB089052; Tue, 21 May 2019 22:56:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905212256.x4LMuMbB089052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 May 2019 22:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348075 - in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Commit-Revision: 348075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 04D8085A6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 22:56:23 -0000 Author: kib Date: Tue May 21 22:56:21 2019 New Revision: 348075 URL: https://svnweb.freebsd.org/changeset/base/348075 Log: Do not call hw_mds_recalculate() from initializecpu(). If MDS mitigation is enabled by the tunable but MDS microcode is not early-loaded, software mitigation is selected. This causes initializecpu() to try to allocate memory which makes boot process very unhappy. Create SYSINIT that runs sufficiently late to succeed. Reported by: naddy PR: 237968 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/initcpu.c head/sys/i386/i386/initcpu.c head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Tue May 21 22:24:38 2019 (r348074) +++ head/sys/amd64/amd64/initcpu.c Tue May 21 22:56:21 2019 (r348075) @@ -257,7 +257,6 @@ initializecpu(void) hw_ibrs_recalculate(); hw_ssb_recalculate(false); amd64_syscall_ret_flush_l1d_recalc(); - hw_mds_recalculate(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Tue May 21 22:24:38 2019 (r348074) +++ head/sys/i386/i386/initcpu.c Tue May 21 22:56:21 2019 (r348075) @@ -749,7 +749,6 @@ initializecpu(void) msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); } - hw_mds_recalculate(); if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue May 21 22:24:38 2019 (r348074) +++ head/sys/x86/x86/cpu_machdep.c Tue May 21 22:56:21 2019 (r348075) @@ -1106,6 +1106,14 @@ hw_mds_recalculate(void) } } +static void +hw_mds_recalculate_boot(void *arg __unused) +{ + + hw_mds_recalculate(); +} +SYSINIT(mds_recalc, SI_SUB_SMP, SI_ORDER_ANY, hw_mds_recalculate_boot, NULL); + static int sysctl_mds_disable_handler(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@freebsd.org Tue May 21 23:03:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD54B1593052; Tue, 21 May 2019 23:03:39 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 1B1DF85F2A; Tue, 21 May 2019 23:03:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4LN3bX7081423; Tue, 21 May 2019 16:03:37 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4LN3bMd081422; Tue, 21 May 2019 16:03:37 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905212303.x4LN3bMd081422@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348073 - head/lib/libmd In-Reply-To: <201905212217.x4LMH1GG068159@repo.freebsd.org> To: Allan Jude Date: Tue, 21 May 2019 16:03:37 -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-Rspamd-Queue-Id: 1B1DF85F2A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 23:03:39 -0000 > Author: allanjude > Date: Tue May 21 22:17:00 2019 > New Revision: 348073 > URL: https://svnweb.freebsd.org/changeset/base/348073 > > Log: > Add admonitions against using MD5 and SHA1 to the API man pages > > Modified: > head/lib/libmd/mdX.3 > head/lib/libmd/sha.3 > > Modified: head/lib/libmd/mdX.3 > ============================================================================== > --- head/lib/libmd/mdX.3 Tue May 21 22:11:53 2019 (r348072) > +++ head/lib/libmd/mdX.3 Tue May 21 22:17:00 2019 (r348073) > @@ -208,6 +208,8 @@ This code is derived directly from these implementatio > .Pp > Phk ristede runen. > .Sh BUGS > -No method is known to exist which finds two files having the same hash value, > -nor to find a file with a specific hash value. > -There is on the other hand no guarantee that such a method does not exist. > +The > +.Tn MD5 There needs to be a discussion about .Tn, some people are ripping them out of man pages, others are adding them. mandoc is a semantic mark up language, .Tn gives the following word the semantic of being a Tradename. Yes, I know, mandoc ignroes them BUTT other tools do not, mandoc is not the end all in what can process our man pages, groff/troff should still be able to produce photo typesetter output and the .Tn's look nice when you do that. I would like to see that we stop removing them and infact, as this man page does, properly recognize trademarks/names in our man pages "as is often required by law." Now, one final nit, I can neither verify nor deny that "MD5" is a tradename. > +algorithm has been proven to be vulnerable to practical collision > +attacks and should not be relied upon to produce unique outputs, > +.Em nor should they be used as part of a cryptographic signature scheme. > > Modified: head/lib/libmd/sha.3 > ============================================================================== > --- head/lib/libmd/sha.3 Tue May 21 22:11:53 2019 (r348072) > +++ head/lib/libmd/sha.3 Tue May 21 22:17:00 2019 (r348073) > @@ -191,9 +191,11 @@ published > .Tn FIPS > standards. > .Sh BUGS > -No method is known to exist which finds two files having the same hash value, > -nor to find a file with a specific hash value. > -There is on the other hand no guarantee that such a method does not exist. > +The > +.Tn SHA1 > +algorithm has been proven to be vulnerable to practical collision > +attacks and should not be relied upon to produce unique outputs, > +.Em nor should they be used as part of a cryptographic signature scheme. > .Pp > The > .Tn IA32 > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 21 23:15:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA0F01593358; Tue, 21 May 2019 23:15:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6DCA8644E; Tue, 21 May 2019 23:15:49 +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 x4LNFgti029415 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 22 May 2019 02:15:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4LNFgti029415 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4LNFgDg029414; Wed, 22 May 2019 02:15:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 May 2019 02:15:42 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348070 - head/sys/sys Message-ID: <20190521231542.GX2748@kib.kiev.ua> References: <201905212135.x4LLZbkB047361@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905212135.x4LLZbkB047361@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 23:15:51 -0000 On Tue, May 21, 2019 at 09:35:37PM +0000, Conrad Meyer wrote: > Author: cem > Date: Tue May 21 21:35:37 2019 > New Revision: 348070 > URL: https://svnweb.freebsd.org/changeset/base/348070 > > Log: > sys/lockmgr.h: Update #error to point at correct _lock.h > > After r347984, these macros live in sys/_lock.h. No functional change. > > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/sys/lockmgr.h > > Modified: head/sys/sys/lockmgr.h > ============================================================================== > --- head/sys/sys/lockmgr.h Tue May 21 21:27:14 2019 (r348069) > +++ head/sys/sys/lockmgr.h Tue May 21 21:35:37 2019 (r348070) > @@ -58,7 +58,7 @@ > #ifdef _KERNEL > > #if !defined(LOCK_FILE) || !defined(LOCK_LINE) > -#error "LOCK_FILE and LOCK_LINE not defined, include before" > +#error "LOCK_FILE and LOCK_LINE not defined, include before" > #endif > > struct thread; I do not think that this change is good. sys/_lock.h is very special and should be only used in specific circumstances. A consumer of the lockmgr.h interface which needs to use _lock.h instead of lock.h already knows that (and in fact I doubt that lockmgr.h can work with only _lock.h included). From owner-svn-src-all@freebsd.org Wed May 22 00:21:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B337A159554B; Wed, 22 May 2019 00:21:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 550F488D70; Wed, 22 May 2019 00:21:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45366D9AA; Wed, 22 May 2019 00:21:43 +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 x4M0Lh4F034060; Wed, 22 May 2019 00:21:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M0LhG4034059; Wed, 22 May 2019 00:21:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905220021.x4M0LhG4034059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 22 May 2019 00:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348076 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 550F488D70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 00:21:43 -0000 Author: cem Date: Wed May 22 00:21:42 2019 New Revision: 348076 URL: https://svnweb.freebsd.org/changeset/base/348076 Log: Revert r348070 Konstantin points out that lockmgr probably requires the whole lock.h anyway. Requested by: kib Modified: head/sys/sys/lockmgr.h Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Tue May 21 22:56:21 2019 (r348075) +++ head/sys/sys/lockmgr.h Wed May 22 00:21:42 2019 (r348076) @@ -58,7 +58,7 @@ #ifdef _KERNEL #if !defined(LOCK_FILE) || !defined(LOCK_LINE) -#error "LOCK_FILE and LOCK_LINE not defined, include before" +#error "LOCK_FILE and LOCK_LINE not defined, include before" #endif struct thread; From owner-svn-src-all@freebsd.org Wed May 22 01:11:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B101E15964D4; Wed, 22 May 2019 01:11:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54E408A20C; Wed, 22 May 2019 01:11:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F322E101; Wed, 22 May 2019 01:11:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M1BMvI060636; Wed, 22 May 2019 01:11:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M1BMLj060635; Wed, 22 May 2019 01:11:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905220111.x4M1BMLj060635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 May 2019 01:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348077 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 348077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54E408A20C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 01:11:22 -0000 Author: asomers Date: Wed May 22 01:11:21 2019 New Revision: 348077 URL: https://svnweb.freebsd.org/changeset/base/348077 Log: Link fhlinkat(2) man page Reviewed by: kib MFC after: 3 days MFC-With: r341689 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20339 Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed May 22 00:21:42 2019 (r348076) +++ head/lib/libc/sys/Makefile.inc Wed May 22 01:11:21 2019 (r348077) @@ -394,6 +394,7 @@ MLINKS+=extattr_get_file.2 extattr.2 \ MLINKS+=ffclock.2 ffclock_getcounter.2 \ ffclock.2 ffclock_getestimate.2 \ ffclock.2 ffclock_setestimate.2 +MLINKS+=fhlink.2 fhlinkat.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=fsync.2 fdatasync.2 MLINKS+=getdirentries.2 getdents.2 From owner-svn-src-all@freebsd.org Wed May 22 01:22:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05ED61596A3A; Wed, 22 May 2019 01:22:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAEC8A80E; Wed, 22 May 2019 01:22:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75B32E414; Wed, 22 May 2019 01:22:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M1MXC2066601; Wed, 22 May 2019 01:22:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M1MXtx066600; Wed, 22 May 2019 01:22:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905220122.x4M1MXtx066600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 22 May 2019 01:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348078 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 348078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AAEC8A80E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 01:22:34 -0000 Author: cem Date: Wed May 22 01:22:33 2019 New Revision: 348078 URL: https://svnweb.freebsd.org/changeset/base/348078 Log: pmc: Fix stack std::string lifetime It's invalid to reference a C++ string's c_str() buffer after the object goes out of scope. Adjust the scope of the string to match the use in write(2) to fix the misuse. CID: 1393383 Reported by: Coverity Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.cc Wed May 22 01:11:21 2019 (r348077) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Wed May 22 01:22:33 2019 (r348078) @@ -180,11 +180,12 @@ pmc_find_name(idmap & map, uint32_t id, char *list[LIS static void pmc_log_event(int fd, struct pmclog_ev *ev, bool json) { + string ret; int len; const void *buf; if (json) { - string ret = event_to_json(ev); + ret = event_to_json(ev); buf = ret.c_str(); len = ret.size(); } else { From owner-svn-src-all@freebsd.org Wed May 22 02:43:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E256159801E; Wed, 22 May 2019 02:43:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF0A88C92F; Wed, 22 May 2019 02:43:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94A81F1B9; Wed, 22 May 2019 02:43:17 +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 x4M2hHMw009063; Wed, 22 May 2019 02:43:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M2hH0U009062; Wed, 22 May 2019 02:43:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905220243.x4M2hH0U009062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 22 May 2019 02:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348079 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 348079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF0A88C92F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 02:43:18 -0000 Author: jhibbits Date: Wed May 22 02:43:17 2019 New Revision: 348079 URL: https://svnweb.freebsd.org/changeset/base/348079 Log: powerpc/booke: Use wrtee instead of msr to restore EE bit The MSR[EE] bit does not require synchronization when changing. This is a trivial micro-optimization, removing the trailing isync from mtmsr(). MFC after: 1 week Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 22 01:22:33 2019 (r348078) +++ head/sys/powerpc/booke/pmap.c Wed May 22 02:43:17 2019 (r348079) @@ -3916,7 +3916,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) entry->mas7 = 0; break; } - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); entry->virt = entry->mas2 & MAS2_EPN_MASK; entry->phys = ((vm_paddr_t)(entry->mas7 & MAS7_RPN) << 32) | @@ -3991,7 +3991,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) msr = mfmsr(); __asm __volatile("wrteei 0"); tlb1_write_entry_int(&args); - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); } } @@ -4390,7 +4390,7 @@ tid_flush(tlbtid_t tid) mtspr(SPR_MAS6, tid << MAS6_SPID0_SHIFT); /* tlbilxpid */ __asm __volatile("isync; .long 0x7c000024; isync; msync"); - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); return; } @@ -4415,7 +4415,7 @@ tid_flush(tlbtid_t tid) mtspr(SPR_MAS1, mas1); __asm __volatile("isync; tlbwe; isync; msync"); } - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); } #ifdef DDB From owner-svn-src-all@freebsd.org Wed May 22 03:10:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A42F1598C8E; Wed, 22 May 2019 03:10:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB5748D94C; Wed, 22 May 2019 03:10:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E28F57F; Wed, 22 May 2019 03:10:23 +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 x4M3ANK8020664; Wed, 22 May 2019 03:10:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3AN9d020663; Wed, 22 May 2019 03:10:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905220310.x4M3AN9d020663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 May 2019 03:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348080 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 348080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB5748D94C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:10:24 -0000 Author: markj Date: Wed May 22 03:10:23 2019 New Revision: 348080 URL: https://svnweb.freebsd.org/changeset/base/348080 Log: Make it possible to generate makefiles for arch-dependent DTrace tests. MFC after: 1 week Event: Waterloo Hackathon 2019 Modified: head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed May 22 02:43:17 2019 (r348079) +++ head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Wed May 22 03:10:23 2019 (r348080) @@ -24,9 +24,10 @@ fmtflist() genmakefile() { - local basedir=$1 + local class=$1 + local group=$2 - local tdir=${CONTRIB_TESTDIR}/${basedir} + local tdir=${CONTRIB_TESTDIR}/${class}/${group} local tfiles=$(find $tdir -type f -a \ \( -name \*.d -o -name \*.ksh -o -name \*.out \) | sort | fmtflist) local tcfiles=$(find $tdir -type f -a -name \*.c | sort | fmtflist) @@ -34,7 +35,7 @@ genmakefile() # One-off variable definitions. local special - case "$basedir" in + case "$group" in proc) special=" LIBADD.tst.sigwait.exe+= rt @@ -80,7 +81,7 @@ $special .include "../../dtrace.test.mk" __EOF__ - mv -f $makefile ${ORIGINDIR}/../common/${basedir}/Makefile + mv -f $makefile ${ORIGINDIR}/../${class}/${group}/Makefile } set -e @@ -93,9 +94,10 @@ export LC_ALL=C readonly ORIGINDIR=$(realpath $(dirname $0)) readonly TOPDIR=$(realpath ${ORIGINDIR}/../../../../..) -readonly CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common +readonly CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst -# Generate a Makefile for each test group under common/. -for dir in $(find ${CONTRIB_TESTDIR} -mindepth 1 -maxdepth 1 -type d); do - genmakefile $(basename $dir) +for class in common i386; do + for group in $(find ${CONTRIB_TESTDIR}/$class -mindepth 1 -maxdepth 1 -type d); do + genmakefile $class $(basename $group) + done done From owner-svn-src-all@freebsd.org Wed May 22 03:42:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B9D8159A5FA; Wed, 22 May 2019 03:42:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D50A88E92D; Wed, 22 May 2019 03:42:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96552FB22; Wed, 22 May 2019 03:42:04 +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 x4M3g4p1040996; Wed, 22 May 2019 03:42:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3g3Wq040989; Wed, 22 May 2019 03:42:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905220342.x4M3g3Wq040989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 May 2019 03:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348081 - in head: cddl/usr.sbin/dtrace/tests cddl/usr.sbin/dtrace/tests/i386 cddl/usr.sbin/dtrace/tests/i386/arrays cddl/usr.sbin/dtrace/tests/i386/funcs cddl/usr.sbin/dtrace/tests/i38... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: cddl/usr.sbin/dtrace/tests cddl/usr.sbin/dtrace/tests/i386 cddl/usr.sbin/dtrace/tests/i386/arrays cddl/usr.sbin/dtrace/tests/i386/funcs cddl/usr.sbin/dtrace/tests/i386/pid cddl/usr.sbin/dtrac... X-SVN-Commit-Revision: 348081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D50A88E92D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:42:05 -0000 Author: markj Date: Wed May 22 03:42:03 2019 New Revision: 348081 URL: https://svnweb.freebsd.org/changeset/base/348081 Log: Hook up the existing i386 DTrace tests to the build. Now that it's relatively easy to do so, we might as well. MFC after: 1 week Event: Waterloo Hackathon 2019 Added: head/cddl/usr.sbin/dtrace/tests/i386/ head/cddl/usr.sbin/dtrace/tests/i386/Makefile (contents, props changed) head/cddl/usr.sbin/dtrace/tests/i386/arrays/ head/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile (contents, props changed) head/cddl/usr.sbin/dtrace/tests/i386/funcs/ head/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile (contents, props changed) head/cddl/usr.sbin/dtrace/tests/i386/pid/ head/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile (contents, props changed) head/cddl/usr.sbin/dtrace/tests/i386/ustack/ head/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/tests/Makefile head/etc/mtree/BSD.tests.dist Modified: head/cddl/usr.sbin/dtrace/tests/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/Makefile Wed May 22 03:10:23 2019 (r348080) +++ head/cddl/usr.sbin/dtrace/tests/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -4,6 +4,10 @@ TESTS_SUBDIRS+= common +.if ${MACHINE_CPUARCH} == "i386" +TESTS_SUBDIRS+= i386 +.endif + .PATH: ${SRCTOP}/tests KYUAFILE= yes Added: head/cddl/usr.sbin/dtrace/tests/i386/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/i386/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/i386 +TESTS_SUBDIRS+= arrays \ + funcs \ + pid \ + ustack + +.PATH: ${.CURDIR:H:H:H:H:H}/tests +KYUAFILE= YES + +.include Added: head/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/i386/arrays/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.uregsarray.d \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" Added: head/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/i386/funcs/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.badcopyin.d \ + tst.badcopyinstr.d \ + tst.badcopyout.d \ + tst.badcopyoutstr.d \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" Added: head/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/i386/pid/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.badinstr.d \ + tst.branch.d \ + tst.embedded.d \ + tst.ret.d \ + tst.retlist.ksh \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" Added: head/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/i386/ustack/Makefile Wed May 22 03:42:03 2019 (r348081) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + annotated_helper.d \ + helper_helper.d \ + tst.annotated.d \ + tst.annotated.d.out \ + tst.circstack.d \ + tst.helper.d \ + tst.helper.d.out \ + +TESTEXES= \ + + +CFILES= \ + tst.annotated.c \ + tst.helper.c \ + + +.include "../../dtrace.test.mk" Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed May 22 03:10:23 2019 (r348080) +++ head/etc/mtree/BSD.tests.dist Wed May 22 03:42:03 2019 (r348081) @@ -238,6 +238,16 @@ version .. .. + i386 + arrays + .. + funcs + .. + pid + .. + ustack + .. + .. .. zfsd .. From owner-svn-src-all@freebsd.org Wed May 22 03:49:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC05E159A98C; Wed, 22 May 2019 03:49:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB968ED2C; Wed, 22 May 2019 03:49:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66F5DFC6C; Wed, 22 May 2019 03:49:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M3nd9m041359; Wed, 22 May 2019 03:49:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3ndtV041358; Wed, 22 May 2019 03:49:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905220349.x4M3ndtV041358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 May 2019 03:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348082 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 348082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EB968ED2C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:49:40 -0000 Author: markj Date: Wed May 22 03:49:38 2019 New Revision: 348082 URL: https://svnweb.freebsd.org/changeset/base/348082 Log: Provide an example of using dhclient-script(5) to configure netdump. Reviewed by: cem MFC after: 1 week Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20345 Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Wed May 22 03:42:03 2019 (r348081) +++ head/sbin/dumpon/dumpon.8 Wed May 22 03:49:38 2019 (r348082) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 6, 2019 +.Dd May 21, 2019 .Dt DUMPON 8 .Os .Sh NAME @@ -317,6 +317,49 @@ Note that the live kernel might be at a different path which can be examined by looking at the .Va kern.bootfile .Xr sysctl 8 . +.Pp +The +.Nm +.Xr rc 8 +script runs early during boot, typically before networking is configured. +This makes it unsuitable for configuring +.Xr netdump +when the client address is dynamic. +To configure +.Xr netdump +when +.Xr dhclient +binds to a server, +.Xr dhclient-script +can be used to run +.Xr dumpon . +For example, to automatically configure +.Xr netdump +on the vtnet0 interface, add the following to +.Pa /etc/dhclient-exit-hooks . +.Bd -literal +case $reason in +BOUND|REBIND|REBOOT|RENEW) + if [ "$interface" != vtnet0 ] || [ -n "$old_ip_address" -a \\ + "$old_ip_address" = "$new_ip_address" ]; then + break + fi + if [ -n "$new_routers" ]; then + # Take the first router in the list. + gateway_flag="-g ${new_routers%% *}" + fi + dumpon -c $new_ip_address -s $server $gateway_flag vtnet0 + ;; +esac +.Ed +.Pp +Be sure to fill in the server IP address and change the interface name if +needed, and to configure +.Pp +.Dl dumpdev="NO" +.Pp +in +.Pa /etc/rc.conf . .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , From owner-svn-src-all@freebsd.org Wed May 22 03:52:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA9DB159AC6F; Wed, 22 May 2019 03:52:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 760CF8F26F; Wed, 22 May 2019 03:52:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 477C7FE34; Wed, 22 May 2019 03:52:40 +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 x4M3qeXo046417; Wed, 22 May 2019 03:52:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3qeNf046416; Wed, 22 May 2019 03:52:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905220352.x4M3qeNf046416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 May 2019 03:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348083 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 348083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 760CF8F26F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:52:41 -0000 Author: markj Date: Wed May 22 03:52:39 2019 New Revision: 348083 URL: https://svnweb.freebsd.org/changeset/base/348083 Log: Update the example added in r348082 to specify a dump device priority. Event: Waterloo Hackathon 2019 Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Wed May 22 03:49:38 2019 (r348082) +++ head/sbin/dumpon/dumpon.8 Wed May 22 03:52:39 2019 (r348083) @@ -345,21 +345,17 @@ BOUND|REBIND|REBOOT|RENEW) break fi if [ -n "$new_routers" ]; then - # Take the first router in the list. + # Take the first router in the list. gateway_flag="-g ${new_routers%% *}" fi - dumpon -c $new_ip_address -s $server $gateway_flag vtnet0 + # Configure as the highest-priority dump device. + dumpon -i 0 -c $new_ip_address -s $server $gateway_flag vtnet0 ;; esac .Ed .Pp Be sure to fill in the server IP address and change the interface name if -needed, and to configure -.Pp -.Dl dumpdev="NO" -.Pp -in -.Pa /etc/rc.conf . +needed. .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , From owner-svn-src-all@freebsd.org Wed May 22 03:54:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AB73159AD24; Wed, 22 May 2019 03:54:26 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02B1C8F3F0; Wed, 22 May 2019 03:54:26 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AFFCFE3B; Wed, 22 May 2019 03:54:25 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M3sP8d046530; Wed, 22 May 2019 03:54:25 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3sPsE046529; Wed, 22 May 2019 03:54:25 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220354.x4M3sPsE046529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 03:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348084 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02B1C8F3F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:54:26 -0000 Author: johalun Date: Wed May 22 03:54:25 2019 New Revision: 348084 URL: https://svnweb.freebsd.org/changeset/base/348084 Log: MFC r347622: LinuxKPI: Include asm/atomic-long.h from atomic.h. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/atomic.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/atomic.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/atomic.h Wed May 22 03:52:39 2019 (r348083) +++ stable/12/sys/compat/linuxkpi/common/include/linux/atomic.h Wed May 22 03:54:25 2019 (r348084) @@ -31,5 +31,6 @@ #include #include +#include #endif /* _LINUX_ATOMIC_H_ */ From owner-svn-src-all@freebsd.org Wed May 22 03:58:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E306A159AE21; Wed, 22 May 2019 03:58:42 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81BB48F594; Wed, 22 May 2019 03:58:42 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57DE0FE43; Wed, 22 May 2019 03:58:42 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M3wgtV046782; Wed, 22 May 2019 03:58:42 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M3wgeP046781; Wed, 22 May 2019 03:58:42 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220358.x4M3wgeP046781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 03:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348085 - stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 348085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81BB48F594 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 03:58:43 -0000 Author: johalun Date: Wed May 22 03:58:41 2019 New Revision: 348085 URL: https://svnweb.freebsd.org/changeset/base/348085 Log: MFC r347620: LinuxKPI: Update user_access_begin for Linux v5.0. Check the new LINUXKPI_VERSION macro for backwards compatibility. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/asm/uaccess.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed May 22 03:54:25 2019 (r348084) +++ stable/12/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed May 22 03:58:41 2019 (r348085) @@ -52,7 +52,11 @@ copy_from_user(void *to, const void *from, unsigned lo #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +#define user_access_begin(ptr, len) access_ok(ptr, len) +#else #define user_access_begin() do { } while (0) +#endif #define user_access_end() do { } while (0) #define unsafe_get_user(x, ptr, err) do { \ From owner-svn-src-all@freebsd.org Wed May 22 04:00:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0D6D159AEDC; Wed, 22 May 2019 04:00:14 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46E0C8F6F3; Wed, 22 May 2019 04:00:14 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22056FE4C; Wed, 22 May 2019 04:00:14 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M40EG0046960; Wed, 22 May 2019 04:00:14 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M40Es1046959; Wed, 22 May 2019 04:00:14 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220400.x4M40Es1046959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 04:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348086 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46E0C8F6F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:00:14 -0000 Author: johalun Date: Wed May 22 04:00:13 2019 New Revision: 348086 URL: https://svnweb.freebsd.org/changeset/base/348086 Log: MFC r347626: LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 22 03:58:41 2019 (r348085) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 22 04:00:13 2019 (r348086) @@ -130,9 +130,14 @@ #define ALIGN(x, y) roundup2((x), (y)) #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +/* Moved from linuxkpi_gplv2 */ +#define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0) +#endif #define DIV_ROUND_UP(x, n) howmany(x, n) #define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) +#define DIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n)) #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(...) printf(__VA_ARGS__) From owner-svn-src-all@freebsd.org Wed May 22 04:02:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05625159E155; Wed, 22 May 2019 04:02:11 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C8968FA9C; Wed, 22 May 2019 04:02:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77737FFE4; Wed, 22 May 2019 04:02:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M42Ah4051201; Wed, 22 May 2019 04:02:10 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M42Afs051200; Wed, 22 May 2019 04:02:10 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220402.x4M42Afs051200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 04:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348087 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C8968FA9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:02:11 -0000 Author: johalun Date: Wed May 22 04:02:10 2019 New Revision: 348087 URL: https://svnweb.freebsd.org/changeset/base/348087 Log: MFC r347623: LinuxKPI: Move {lower|upper}_32_bits macros from port to base. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/compiler.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/compiler.h Wed May 22 04:00:13 2019 (r348086) +++ stable/12/sys/compat/linuxkpi/common/include/linux/compiler.h Wed May 22 04:02:10 2019 (r348087) @@ -81,6 +81,12 @@ #define barrier() __asm__ __volatile__("": : :"memory") +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +/* Moved from drm_os_freebsd.h */ +#define lower_32_bits(n) ((u32)(n)) +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) +#endif + #define ___PASTE(a,b) a##b #define __PASTE(a,b) ___PASTE(a,b) From owner-svn-src-all@freebsd.org Wed May 22 04:08:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F0DF159E38A; Wed, 22 May 2019 04:08:46 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D32278FF7F; Wed, 22 May 2019 04:08:45 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6EF618007; Wed, 22 May 2019 04:08:45 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M48jqU052915; Wed, 22 May 2019 04:08:45 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M48jDJ052914; Wed, 22 May 2019 04:08:45 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220408.x4M48jDJ052914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 04:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348088 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D32278FF7F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:08:46 -0000 Author: johalun Date: Wed May 22 04:08:45 2019 New Revision: 348088 URL: https://svnweb.freebsd.org/changeset/base/348088 Log: MFC r347619: LinuxKPI: Expand ktime functionality. Also, make ktime_get_raw call getnanouptime instead of getnanotime to match (the correct) ktime_get_raw_ns. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Wed May 22 04:02:10 2019 (r348087) +++ stable/12/sys/compat/linuxkpi/common/include/linux/ktime.h Wed May 22 04:08:45 2019 (r348088) @@ -35,8 +35,6 @@ #include #include -#define ktime_get_ts(x) getnanouptime(x) - /* time values in nanoseconds */ typedef s64 ktime_t; @@ -93,6 +91,13 @@ ktime_add_ms(ktime_t kt, int64_t ms) } static inline ktime_t +ktime_add_us(ktime_t kt, int64_t us) +{ + + return (ktime_add_ns(kt, us * NSEC_PER_USEC)); +} + +static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { return (kt - ns); @@ -172,11 +177,20 @@ timeval_to_ktime(struct timeval tv) return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC)); } +static inline int64_t +timespec64_to_ns(struct timespec64 *ts) +{ + return (timespec_to_ns(ts)); +} + #define ktime_to_timespec(kt) ns_to_timespec(kt) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) -#define ktime_get_ts64(ts) ktime_get_ts(ts) +#define ktime_get_ts(ts) getnanouptime(ts) +#define ktime_get_ts64(ts) getnanouptime(ts) +#define ktime_get_raw_ts64(ts) getnanouptime(ts) +#define getrawmonotonic64(ts) getnanouptime(ts) static inline int64_t ktime_get_ns(void) @@ -229,7 +243,7 @@ ktime_get_raw(void) { struct timespec ts; - nanotime(&ts); + nanouptime(&ts); return (timespec_to_ktime(ts)); } From owner-svn-src-all@freebsd.org Wed May 22 04:10:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96FB2159E57C; Wed, 22 May 2019 04:10:25 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DE4168159; Wed, 22 May 2019 04:10:25 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18F961800C; Wed, 22 May 2019 04:10:25 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M4AOfQ053076; Wed, 22 May 2019 04:10:24 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M4AOma053075; Wed, 22 May 2019 04:10:24 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905220410.x4M4AOma053075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 22 May 2019 04:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348089 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DE4168159 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:10:25 -0000 Author: johalun Date: Wed May 22 04:10:24 2019 New Revision: 348089 URL: https://svnweb.freebsd.org/changeset/base/348089 Log: MFC r347621: LinuxKPI: Add get_random_u32 function. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/random.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/random.h Wed May 22 04:08:45 2019 (r348088) +++ stable/12/sys/compat/linuxkpi/common/include/linux/random.h Wed May 22 04:10:24 2019 (r348089) @@ -35,6 +35,8 @@ #include #include +#define get_random_u32() get_random_int() + static inline void get_random_bytes(void *buf, int nbytes) { From owner-svn-src-all@freebsd.org Wed May 22 04:13:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C59159E9A8; Wed, 22 May 2019 04:13:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9D669C7E; Wed, 22 May 2019 04:13:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB71D181A9; Wed, 22 May 2019 04:13:57 +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 x4M4DviV057785; Wed, 22 May 2019 04:13:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M4DvBm057783; Wed, 22 May 2019 04:13:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905220413.x4M4DvBm057783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 May 2019 04:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348090 - in head/libexec/bootpd: . bootpgw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/libexec/bootpd: . bootpgw X-SVN-Commit-Revision: 348090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B9D669C7E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:13:58 -0000 Author: markj Date: Wed May 22 04:13:57 2019 New Revision: 348090 URL: https://svnweb.freebsd.org/changeset/base/348090 Log: Marginally improve usage() message style in bootpd. - Remove an extra space after "usage:". - Avoid lines exceeding 80 columns. Based on notes from rgrimes. MFC with: r348066 Event: Waterloo Hackathon 2019 Modified: head/libexec/bootpd/bootpd.c head/libexec/bootpd/bootpgw/bootpgw.c Modified: head/libexec/bootpd/bootpd.c ============================================================================== --- head/libexec/bootpd/bootpd.c Wed May 22 04:10:24 2019 (r348089) +++ head/libexec/bootpd/bootpd.c Wed May 22 04:13:57 2019 (r348090) @@ -587,8 +587,8 @@ PRIVATE void usage() { fprintf(stderr, - "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); - fprintf(stderr, " [bootptab [dumpfile]]\n"); + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname]\n" + " [-t timeout] [bootptab [dumpfile]]\n"); fprintf(stderr, "\t -a\tdon't modify ARP table\n"); fprintf(stderr, "\t -c n\tset current directory\n"); fprintf(stderr, "\t -d n\tset debug level\n"); Modified: head/libexec/bootpd/bootpgw/bootpgw.c ============================================================================== --- head/libexec/bootpd/bootpgw/bootpgw.c Wed May 22 04:10:24 2019 (r348089) +++ head/libexec/bootpd/bootpgw/bootpgw.c Wed May 22 04:13:57 2019 (r348090) @@ -500,7 +500,8 @@ static void usage() { fprintf(stderr, - "usage: \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n"); + "usage: bootpgw [-a] [-i | -s] [-d level] [-h count] [-t timeout]\n" + " [-w time] server\n"); fprintf(stderr, "\t -a\tdon't modify ARP table\n"); fprintf(stderr, "\t -d n\tset debug level\n"); fprintf(stderr, "\t -h n\tset max hop count\n"); From owner-svn-src-all@freebsd.org Wed May 22 04:25:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50628159EE2D; Wed, 22 May 2019 04:25:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 B1D5F6A510; Wed, 22 May 2019 04:25:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4M4PNSK082700; Tue, 21 May 2019 21:25:23 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4M4PNCB082699; Tue, 21 May 2019 21:25:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905220425.x4M4PNCB082699@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348090 - in head/libexec/bootpd: . bootpgw In-Reply-To: <201905220413.x4M4DvBm057783@repo.freebsd.org> To: Mark Johnston Date: Tue, 21 May 2019 21:25:23 -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-Rspamd-Queue-Id: B1D5F6A510 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:25:26 -0000 > Author: markj > Date: Wed May 22 04:13:57 2019 > New Revision: 348090 > URL: https://svnweb.freebsd.org/changeset/base/348090 > > Log: > Marginally improve usage() message style in bootpd. > > - Remove an extra space after "usage:". > - Avoid lines exceeding 80 columns. > > Based on notes from rgrimes. Thanks, but you missed an important aspect of those notes, see inline below. > > MFC with: r348066 > Event: Waterloo Hackathon 2019 > > Modified: > head/libexec/bootpd/bootpd.c > head/libexec/bootpd/bootpgw/bootpgw.c > > Modified: head/libexec/bootpd/bootpd.c > ============================================================================== > --- head/libexec/bootpd/bootpd.c Wed May 22 04:10:24 2019 (r348089) > +++ head/libexec/bootpd/bootpd.c Wed May 22 04:13:57 2019 (r348090) > @@ -587,8 +587,8 @@ PRIVATE void > usage() > { > fprintf(stderr, > - "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > - fprintf(stderr, " [bootptab [dumpfile]]\n"); > + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname]\n" > + " [-t timeout] [bootptab [dumpfile]]\n"); > fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > fprintf(stderr, "\t -c n\tset current directory\n"); > fprintf(stderr, "\t -d n\tset debug level\n"); These 3 printf's are now miss aligned and contain a \t that should not be there: there may be more, I am only look at what is in context here. - fprintf(stderr, "\t -a\tdon't modify ARP table\n"); - fprintf(stderr, "\t -c n\tset current directory\n"); - fprintf(stderr, "\t -d n\tset debug level\n"); + fprintf(stderr, " -a\tdon't modify ARP table\n"); + fprintf(stderr, " -c n\tset current directory\n"); + fprintf(stderr, " -d n\tset debug level\n"); Regards, Rod > Modified: head/libexec/bootpd/bootpgw/bootpgw.c > ============================================================================== > --- head/libexec/bootpd/bootpgw/bootpgw.c Wed May 22 04:10:24 2019 (r348089) > +++ head/libexec/bootpd/bootpgw/bootpgw.c Wed May 22 04:13:57 2019 (r348090) > @@ -500,7 +500,8 @@ static void > usage() > { > fprintf(stderr, > - "usage: \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n"); > + "usage: bootpgw [-a] [-i | -s] [-d level] [-h count] [-t timeout]\n" > + " [-w time] server\n"); > fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > fprintf(stderr, "\t -d n\tset debug level\n"); > fprintf(stderr, "\t -h n\tset max hop count\n"); Same comments as above -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed May 22 04:51:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E476A159F584; Wed, 22 May 2019 04:51:09 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AEAF6B176; Wed, 22 May 2019 04:51:09 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 638D8186E3; Wed, 22 May 2019 04:51:09 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M4p9YL075674; Wed, 22 May 2019 04:51:09 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M4p8x6075670; Wed, 22 May 2019 04:51:08 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201905220451.x4M4p8x6075670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 22 May 2019 04:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348091 - head/sys/dev/aacraid X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sys/dev/aacraid X-SVN-Commit-Revision: 348091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AEAF6B176 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 04:51:10 -0000 Author: sobomax Date: Wed May 22 04:51:08 2019 New Revision: 348091 URL: https://svnweb.freebsd.org/changeset/base/348091 Log: Make aacraid(4) working on ASR8805 & ASR8402 in particular. This patch has been in the PR system for 5 months and then on reviews for another 5. Nobody came with any cases where it fails, while many people cried for it to be commited & merged. PR: 209468 Submitted by: Prasad B M Reported by: Steven Peterson Approved by: scottl MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18408 Modified: head/sys/dev/aacraid/aacraid.c head/sys/dev/aacraid/aacraid_cam.c head/sys/dev/aacraid/aacraid_reg.h head/sys/dev/aacraid/aacraid_var.h Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Wed May 22 04:13:57 2019 (r348090) +++ head/sys/dev/aacraid/aacraid.c Wed May 22 04:51:08 2019 (r348091) @@ -264,7 +264,7 @@ aacraid_attach(struct aac_softc *sc) /* * Check that the firmware on the card is supported. */ - sc->msi_enabled = FALSE; + sc->msi_enabled = sc->msi_tupelo = FALSE; if ((error = aac_check_firmware(sc)) != 0) return(error); @@ -284,8 +284,8 @@ aacraid_attach(struct aac_softc *sc) */ if ((error = aac_alloc(sc)) != 0) return(error); + aac_define_int_mode(sc); if (!(sc->flags & AAC_FLAGS_SYNC_MODE)) { - aac_define_int_mode(sc); if ((error = aac_init(sc)) != 0) return(error); } @@ -728,7 +728,7 @@ aacraid_free(struct aac_softc *sc) else break; } - if (sc->msi_enabled) + if (sc->msi_enabled || sc->msi_tupelo) pci_release_msi(sc->aac_dev); /* destroy data-transfer DMA tag */ @@ -1316,6 +1316,9 @@ aacraid_map_command_sg(void *arg, bus_dma_segment_t *s fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "nseg %d", nseg); mtx_assert(&sc->aac_io_lock, MA_OWNED); + if ((sc->flags & AAC_FLAGS_SYNC_MODE) && sc->aac_sync_cm) + return; + /* copy into the FIB */ if (cm->cm_sgtable != NULL) { if (fib->Header.Command == RawIo2) { @@ -1433,11 +1436,14 @@ aacraid_map_command_sg(void *arg, bus_dma_segment_t *s cm->cm_flags |= AAC_CMD_MAPPED; - if (sc->flags & AAC_FLAGS_SYNC_MODE) { + if (cm->cm_flags & AAC_CMD_WAIT) { + aacraid_sync_command(sc, AAC_MONKER_SYNCFIB, + cm->cm_fibphys, 0, 0, 0, NULL, NULL); + } else if (sc->flags & AAC_FLAGS_SYNC_MODE) { u_int32_t wait = 0; - aacraid_sync_command(sc, AAC_MONKER_SYNCFIB, cm->cm_fibphys, 0, 0, 0, &wait, NULL); - } else if (cm->cm_flags & AAC_CMD_WAIT) { - aacraid_sync_command(sc, AAC_MONKER_SYNCFIB, cm->cm_fibphys, 0, 0, 0, NULL, NULL); + sc->aac_sync_cm = cm; + aacraid_sync_command(sc, AAC_MONKER_SYNCFIB, + cm->cm_fibphys, 0, 0, 0, &wait, NULL); } else { int count = 10000000L; while (AAC_SEND_COMMAND(sc, cm) != 0) { @@ -1617,6 +1623,7 @@ aac_check_firmware(struct aac_softc *sc) options = AAC_GET_MAILBOX(sc, 1); atu_size = AAC_GET_MAILBOX(sc, 2); sc->supported_options = options; + sc->doorbell_mask = AAC_GET_MAILBOX(sc, 3); if ((options & AAC_SUPPORTED_4GB_WINDOW) != 0 && (sc->flags & AAC_FLAGS_NO4GB) == 0) @@ -1631,13 +1638,13 @@ aac_check_firmware(struct aac_softc *sc) sc->flags |= AAC_FLAGS_SG_64BIT; } if (sc->aac_if.aif_send_command) { - if ((options & AAC_SUPPORTED_NEW_COMM_TYPE3) || - (options & AAC_SUPPORTED_NEW_COMM_TYPE4)) - sc->flags |= AAC_FLAGS_NEW_COMM | AAC_FLAGS_NEW_COMM_TYPE34; + if (options & AAC_SUPPORTED_NEW_COMM_TYPE2) + sc->flags |= AAC_FLAGS_NEW_COMM | AAC_FLAGS_NEW_COMM_TYPE2; else if (options & AAC_SUPPORTED_NEW_COMM_TYPE1) sc->flags |= AAC_FLAGS_NEW_COMM | AAC_FLAGS_NEW_COMM_TYPE1; - else if (options & AAC_SUPPORTED_NEW_COMM_TYPE2) - sc->flags |= AAC_FLAGS_NEW_COMM | AAC_FLAGS_NEW_COMM_TYPE2; + else if ((options & AAC_SUPPORTED_NEW_COMM_TYPE3) || + (options & AAC_SUPPORTED_NEW_COMM_TYPE4)) + sc->flags |= AAC_FLAGS_NEW_COMM | AAC_FLAGS_NEW_COMM_TYPE34; } if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE) sc->flags |= AAC_FLAGS_ARRAY_64BIT; @@ -1851,8 +1858,30 @@ aac_define_int_mode(struct aac_softc *sc) dev = sc->aac_dev; + if (sc->flags & AAC_FLAGS_SYNC_MODE) { + device_printf(dev, "using line interrupts\n"); + sc->aac_max_msix = 1; + sc->aac_vector_cap = sc->aac_max_fibs; + return; + } + /* max. vectors from AAC_MONKER_GETCOMMPREF */ if (sc->aac_max_msix == 0) { + if (sc->aac_hwif == AAC_HWIF_SRC) { + msi_count = 1; + if ((error = pci_alloc_msi(dev, &msi_count)) != 0) { + device_printf(dev, "alloc msi failed - err=%d; " + "will use INTx\n", error); + pci_release_msi(dev); + } else { + sc->msi_tupelo = TRUE; + } + } + if (sc->msi_tupelo) + device_printf(dev, "using MSI interrupts\n"); + else + device_printf(dev, "using line interrupts\n"); + sc->aac_max_msix = 1; sc->aac_vector_cap = sc->aac_max_fibs; return; @@ -1958,7 +1987,7 @@ aac_setup_intr(struct aac_softc *sc) void *tag; msi_count = sc->aac_max_msix; - rid = (sc->msi_enabled ? 1:0); + rid = ((sc->msi_enabled || sc->msi_tupelo)? 1:0); for (i = 0; i < msi_count; i++, rid++) { if ((res = bus_alloc_resource_any(sc->aac_dev,SYS_RES_IRQ, &rid, @@ -2854,14 +2883,14 @@ aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t a fib = cm->cm_fib; srbcmd = (struct aac_srb *)fib->data; - if ((error = copyin((void *)&user_srb->data_len, &fibsize, - sizeof (u_int32_t)) != 0)) + if ((error = copyin((void *)&user_srb->data_len, &fibsize, + sizeof (u_int32_t))) != 0) goto out; if (fibsize > (sc->aac_max_fib_size-sizeof(struct aac_fib_header))) { error = EINVAL; goto out; } - if ((error = copyin((void *)user_srb, srbcmd, fibsize) != 0)) + if ((error = copyin((void *)user_srb, srbcmd, fibsize)) != 0) goto out; srbcmd->function = 0; /* SRBF_ExecuteScsi */ @@ -2895,13 +2924,10 @@ aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t a srb_sg_bytecount = sg.SgByteCount; srb_sg_address = sg.SgAddress; - if (srb_sg_address > 0xffffffffull && - !(sc->flags & AAC_FLAGS_SG_64BIT)) -#endif - { - error = EINVAL; - goto out; - } +#else + error = EINVAL; + goto out; +#endif } else { error = EINVAL; goto out; @@ -3701,7 +3727,7 @@ aac_get_bus_info(struct aac_softc *sc) caminf->TargetsPerBus = businfo.TargetsPerBus; caminf->BusNumber = i+1; caminf->BusType = PASSTHROUGH_BUS; - caminf->InitiatorBusId = businfo.InitiatorBusId[i]; + caminf->InitiatorBusId = -1; caminf->aac_sc = sc; caminf->sim_dev = child; caminf->aac_cam = NULL; @@ -3745,7 +3771,7 @@ aac_reset_adapter(struct aac_softc *sc) struct aac_fib *fib; struct aac_pause_command *pc; u_int32_t status, reset_mask, waitCount, max_msix_orig; - int msi_enabled_orig; + int ret, msi_enabled_orig; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_assert(&sc->aac_io_lock, MA_OWNED); @@ -3804,50 +3830,61 @@ aac_reset_adapter(struct aac_softc *sc) AAC_MEM0_SETREG4(sc, AAC_IRCSR, AAC_IRCSR_CORES_RST); /* We need to wait for 5 seconds before accessing the MU again - * 10000 * 100us = 1000,000us = 1000ms = 1s + * 10000 * 100us = 1000,000us = 1000ms = 1s */ waitCount = 5 * 10000; while (waitCount) { DELAY(100); /* delay 100 microseconds */ waitCount--; } - } else if ((aacraid_sync_command(sc, - AAC_IOP_RESET_ALWAYS, 0, 0, 0, 0, &status, &reset_mask)) != 0) { - /* call IOP_RESET for older firmware */ - if ((aacraid_sync_command(sc, - AAC_IOP_RESET, 0, 0, 0, 0, &status, NULL)) != 0) { + } else { + ret = aacraid_sync_command(sc, AAC_IOP_RESET_ALWAYS, + 0, 0, 0, 0, &status, &reset_mask); + if (ret && !sc->doorbell_mask) { + /* call IOP_RESET for older firmware */ + if ((aacraid_sync_command(sc, AAC_IOP_RESET, 0,0,0,0, + &status, NULL)) != 0) { + if (status == AAC_SRB_STS_INVALID_REQUEST) { + device_printf(sc->aac_dev, + "IOP_RESET not supported\n"); + } else { + /* probably timeout */ + device_printf(sc->aac_dev, + "IOP_RESET failed\n"); + } - if (status == AAC_SRB_STS_INVALID_REQUEST) - device_printf(sc->aac_dev, "IOP_RESET not supported\n"); - else - /* probably timeout */ - device_printf(sc->aac_dev, "IOP_RESET failed\n"); + /* unwind aac_shutdown() */ + aac_alloc_sync_fib(sc, &fib); + pc = (struct aac_pause_command *)&fib->data[0]; + pc->Command = VM_ContainerConfig; + pc->Type = CT_PAUSE_IO; + pc->Timeout = 1; + pc->Min = 1; + pc->NoRescan = 1; - /* unwind aac_shutdown() */ - aac_alloc_sync_fib(sc, &fib); - pc = (struct aac_pause_command *)&fib->data[0]; - pc->Command = VM_ContainerConfig; - pc->Type = CT_PAUSE_IO; - pc->Timeout = 1; - pc->Min = 1; - pc->NoRescan = 1; + (void) aac_sync_fib(sc, ContainerCommand, 0, + fib, sizeof (struct aac_pause_command)); + aac_release_sync_fib(sc); - (void) aac_sync_fib(sc, ContainerCommand, 0, fib, - sizeof (struct aac_pause_command)); - aac_release_sync_fib(sc); - - goto finish; + goto finish; + } + } else if (sc->doorbell_mask) { + ret = 0; + reset_mask = sc->doorbell_mask; } - } else if (sc->aac_support_opt2 & AAC_SUPPORTED_DOORBELL_RESET) { - AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, reset_mask); - /* - * We need to wait for 5 seconds before accessing the doorbell - * again, 10000 * 100us = 1000,000us = 1000ms = 1s - */ - waitCount = 5 * 10000; - while (waitCount) { - DELAY(100); /* delay 100 microseconds */ - waitCount--; + if (!ret && + (sc->aac_support_opt2 & AAC_SUPPORTED_DOORBELL_RESET)) { + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, reset_mask); + /* + * We need to wait for 5 seconds before accessing the + * doorbell again; + * 10000 * 100us = 1000,000us = 1000ms = 1s + */ + waitCount = 5 * 10000; + while (waitCount) { + DELAY(100); /* delay 100 microseconds */ + waitCount--; + } } } Modified: head/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- head/sys/dev/aacraid/aacraid_cam.c Wed May 22 04:13:57 2019 (r348090) +++ head/sys/dev/aacraid/aacraid_cam.c Wed May 22 04:51:08 2019 (r348091) @@ -1017,8 +1017,8 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->version_num = 1; cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; - cpi->max_target = camsc->inf->TargetsPerBus; - cpi->max_lun = 8; /* Per the controller spec */ + cpi->max_target = camsc->inf->TargetsPerBus - 1; + cpi->max_lun = 7; /* Per the controller spec */ cpi->initiator_id = camsc->inf->InitiatorBusId; cpi->bus_id = camsc->inf->BusNumber; #if __FreeBSD_version >= 800000 @@ -1389,15 +1389,9 @@ aacraid_startio(struct aac_softc *sc) * Try to get a command that's been put off for lack of * resources */ - if (sc->flags & AAC_FLAGS_SYNC_MODE) { - /* sync. transfer mode */ - if (sc->aac_sync_cm) - break; - cm = aac_dequeue_ready(sc); - sc->aac_sync_cm = cm; - } else { - cm = aac_dequeue_ready(sc); - } + if ((sc->flags & AAC_FLAGS_SYNC_MODE) && sc->aac_sync_cm) + break; + cm = aac_dequeue_ready(sc); /* nothing to do? */ if (cm == NULL) Modified: head/sys/dev/aacraid/aacraid_reg.h ============================================================================== --- head/sys/dev/aacraid/aacraid_reg.h Wed May 22 04:13:57 2019 (r348090) +++ head/sys/dev/aacraid/aacraid_reg.h Wed May 22 04:51:08 2019 (r348091) @@ -42,7 +42,7 @@ /* * Misc. magic numbers. */ -#define AAC_MAX_CONTAINERS 64 +#define AAC_MAX_CONTAINERS 240 #define AAC_BLOCK_SIZE 512 /* Modified: head/sys/dev/aacraid/aacraid_var.h ============================================================================== --- head/sys/dev/aacraid/aacraid_var.h Wed May 22 04:13:57 2019 (r348090) +++ head/sys/dev/aacraid/aacraid_var.h Wed May 22 04:51:08 2019 (r348091) @@ -49,7 +49,7 @@ #define AAC_DRIVER_MAJOR_VERSION 3 #define AAC_DRIVER_MINOR_VERSION 2 -#define AAC_DRIVER_BUGFIX_LEVEL 5 +#define AAC_DRIVER_BUGFIX_LEVEL 10 #define AAC_DRIVER_TYPE AAC_TYPE_RELEASE #ifndef AAC_DRIVER_BUILD @@ -481,9 +481,12 @@ struct aac_softc u_int32_t aac_feature_bits; /* feature bits from suppl. info */ u_int32_t aac_support_opt2; /* supp. options from suppl. info */ u_int32_t aac_max_aif; /* max. AIF count */ + u_int32_t doorbell_mask; /* for IOP reset */ u_int32_t aac_max_msix; /* max. MSI-X vectors */ u_int32_t aac_vector_cap; /* MSI-X vector capab.*/ int msi_enabled; /* MSI/MSI-X enabled */ + int msi_tupelo; /* Series 6 support for */ + /* single MSI interrupt */ #define AAC_CAM_TARGET_WILDCARD ~0 void (*cam_rescan_cb)(struct aac_softc *, uint32_t, uint32_t); From owner-svn-src-all@freebsd.org Wed May 22 05:32:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 344AA159FF03; Wed, 22 May 2019 05:32:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF4996C161; Wed, 22 May 2019 05:32:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 429E418F6E; Wed, 22 May 2019 05:32:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M5WfZd099703; Wed, 22 May 2019 05:32:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M5Wdne099695; Wed, 22 May 2019 05:32:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905220532.x4M5Wdne099695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 May 2019 05:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348092 - in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 348092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF4996C161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 05:32:42 -0000 Author: dchagin Date: Wed May 22 05:32:39 2019 New Revision: 348092 URL: https://svnweb.freebsd.org/changeset/base/348092 Log: MFC r347052: In order to reduce duplication between MD parts of the Linuxulator move bits that are MI out into the headers in compat/linux. For that remove bogus _packed attribute from struct l_sockaddr and use MI types for struct members. And continue to move into the linux_common module a code that is intended for both Linuxulator modules (both instruction set - 32 & 64 bit) or for external modules like linsysfs or linprocfs. To avoid header pollution introduce new sys/compat/linux_common.h header. Added: stable/12/sys/compat/linux/linux_common.h - copied unchanged from r347052, head/sys/compat/linux/linux_common.h Modified: stable/12/sys/amd64/linux/linux.h stable/12/sys/amd64/linux32/linux.h stable/12/sys/arm64/linux/linux.h stable/12/sys/compat/linux/linux.c stable/12/sys/compat/linux/linux.h stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/i386/linux/linux.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux.h ============================================================================== --- stable/12/sys/amd64/linux/linux.h Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/amd64/linux/linux.h Wed May 22 05:32:39 2019 (r348092) @@ -377,11 +377,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -390,9 +385,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: stable/12/sys/amd64/linux32/linux.h ============================================================================== --- stable/12/sys/amd64/linux32/linux.h Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/amd64/linux32/linux.h Wed May 22 05:32:39 2019 (r348092) @@ -478,11 +478,6 @@ union l_semun { l_uintptr_t __pad; } __packed; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -} __packed; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -491,9 +486,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: stable/12/sys/arm64/linux/linux.h ============================================================================== --- stable/12/sys/arm64/linux/linux.h Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/arm64/linux/linux.h Wed May 22 05:32:39 2019 (r348092) @@ -264,11 +264,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -277,9 +272,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: stable/12/sys/compat/linux/linux.c ============================================================================== --- stable/12/sys/compat/linux/linux.c Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/compat/linux/linux.c Wed May 22 05:32:39 2019 (r348092) @@ -29,10 +29,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include + #include +#include +CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = { LINUX_SIGHUP, /* SIGHUP */ @@ -202,4 +213,98 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) LINUX_SIGADDSET(*lss, l); } } +} + +/* + * Translate a Linux interface name to a FreeBSD interface name, + * and return the associated ifnet structure + * bsdname and lxname need to be least IFNAMSIZ bytes long, but + * can point to the same buffer. + */ +struct ifnet * +ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) +{ + struct ifnet *ifp; + int len, unit; + char *ep; + int is_eth, is_lo, index; + + for (len = 0; len < LINUX_IFNAMSIZ; ++len) + if (!isalpha(lxname[len]) || lxname[len] == 0) + break; + if (len == 0 || len == LINUX_IFNAMSIZ) + return (NULL); + /* Linux loopback interface name is lo (not lo0) */ + is_lo = (len == 2 && !strncmp(lxname, "lo", len)) ? 1 : 0; + unit = (int)strtoul(lxname + len, &ep, 10); + if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && + is_lo == 0) + return (NULL); + index = 0; + is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + + CURVNET_SET(TD_TO_VNET(td)); + IFNET_RLOCK(); + CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { + /* + * Allow Linux programs to use FreeBSD names. Don't presume + * we never have an interface named "eth", so don't make + * the test optional based on is_eth. + */ + if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) + break; + if (is_eth && IFP_IS_ETH(ifp) && unit == index++) + break; + if (is_lo && IFP_IS_LOOP(ifp)) + break; + } + IFNET_RUNLOCK(); + CURVNET_RESTORE(); + if (ifp != NULL && bsdname != NULL) + strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); + return (ifp); +} + +void +linux_ifflags(struct ifnet *ifp, short *flags) +{ + + *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + /* these flags have no Linux equivalent */ + *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| + IFF_LINK0|IFF_LINK1|IFF_LINK2); + /* Linux' multicast flag is in a different bit */ + if (*flags & IFF_MULTICAST) { + *flags &= ~IFF_MULTICAST; + *flags |= 0x1000; + } +} + +int +linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) +{ + struct ifaddr *ifa; + struct sockaddr_dl *sdl; + + if (IFP_IS_LOOP(ifp)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_LOOPBACK; + return (0); + } + + if (!IFP_IS_ETH(ifp)) + return (ENOENT); + + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sdl = (struct sockaddr_dl*)ifa->ifa_addr; + if (sdl != NULL && (sdl->sdl_family == AF_LINK) && + (sdl->sdl_type == IFT_ETHER)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_ETHER; + bcopy(LLADDR(sdl), lsa->sa_data, LINUX_IFHWADDRLEN); + return (0); + } + } + + return (ENOENT); } Modified: stable/12/sys/compat/linux/linux.h ============================================================================== --- stable/12/sys/compat/linux/linux.h Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/compat/linux/linux.h Wed May 22 05:32:39 2019 (r348092) @@ -29,6 +29,23 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ +#define LINUX_IFHWADDRLEN 6 +#define LINUX_IFNAMSIZ 16 + +/* + * Criteria for interface name translation + */ +#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) +#define IFP_IS_LOOP(ifp) (ifp->if_type == IFT_LOOP) + +struct l_sockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +#define LINUX_ARPHRD_ETHER 1 +#define LINUX_ARPHRD_LOOPBACK 772 + /* sigaltstack */ #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 Copied: stable/12/sys/compat/linux/linux_common.h (from r347052, head/sys/compat/linux/linux_common.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linux/linux_common.h Wed May 22 05:32:39 2019 (r348092, copy of r347052, head/sys/compat/linux/linux_common.h) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Dmitry Chagin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_COMMON_H_ +#define _LINUX_COMMON_H_ + +struct ifnet *ifname_linux_to_bsd(struct thread *td, + const char *lxname, char *bsdname); +void linux_ifflags(struct ifnet *ifp, short *flags); +int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa); + +#endif /* _LINUX_COMMON_H_ */ Modified: stable/12/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.c Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/compat/linux/linux_ioctl.c Wed May 22 05:32:39 2019 (r348092) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include #include @@ -2122,56 +2123,6 @@ linux_ioctl_console(struct thread *td, struct linux_io } /* - * Criteria for interface name translation - */ -#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) - -/* - * Translate a Linux interface name to a FreeBSD interface name, - * and return the associated ifnet structure - * bsdname and lxname need to be least IFNAMSIZ bytes long, but - * can point to the same buffer. - */ - -static struct ifnet * -ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) -{ - struct ifnet *ifp; - int len, unit; - char *ep; - int is_eth, index; - - for (len = 0; len < LINUX_IFNAMSIZ; ++len) - if (!isalpha(lxname[len])) - break; - if (len == 0 || len == LINUX_IFNAMSIZ) - return (NULL); - unit = (int)strtoul(lxname + len, &ep, 10); - if (ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) - return (NULL); - index = 0; - is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; - CURVNET_SET(TD_TO_VNET(td)); - IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* - * Allow Linux programs to use FreeBSD names. Don't presume - * we never have an interface named "eth", so don't make - * the test optional based on is_eth. - */ - if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) - break; - if (is_eth && IFP_IS_ETH(ifp) && unit == index++) - break; - } - IFNET_RUNLOCK(); - CURVNET_RESTORE(); - if (ifp != NULL) - strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); - return (ifp); -} - -/* * Implement the SIOCGIFNAME ioctl */ @@ -2332,50 +2283,20 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, s { l_short flags; - flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; - /* these flags have no Linux equivalent */ - flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| - IFF_LINK0|IFF_LINK1|IFF_LINK2); - /* Linux' multicast flag is in a different bit */ - if (flags & IFF_MULTICAST) { - flags &= ~IFF_MULTICAST; - flags |= 0x1000; - } + linux_ifflags(ifp, &flags); return (copyout(&flags, &ifr->ifr_flags, sizeof(flags))); } -#define ARPHRD_ETHER 1 -#define ARPHRD_LOOPBACK 772 - static int linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr) { - struct ifaddr *ifa; - struct sockaddr_dl *sdl; struct l_sockaddr lsa; - if (ifp->if_type == IFT_LOOP) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_LOOPBACK; - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - - if (ifp->if_type != IFT_ETHER) + if (linux_ifhwaddr(ifp, &lsa) != 0) return (ENOENT); - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && (sdl->sdl_family == AF_LINK) && - (sdl->sdl_type == IFT_ETHER)) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_ETHER; - bcopy(LLADDR(sdl), lsa.sa_data, LINUX_IFHWADDRLEN); - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - } - - return (ENOENT); + return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); } Modified: stable/12/sys/i386/linux/linux.h ============================================================================== --- stable/12/sys/i386/linux/linux.h Wed May 22 04:51:08 2019 (r348091) +++ stable/12/sys/i386/linux/linux.h Wed May 22 05:32:39 2019 (r348092) @@ -454,11 +454,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -467,9 +462,6 @@ struct l_ifmap { u_char dma; u_char port; }; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { From owner-svn-src-all@freebsd.org Wed May 22 05:33:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D5F159FF78; Wed, 22 May 2019 05:33:49 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94DB06C29A; Wed, 22 May 2019 05:33:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FAD218F70; Wed, 22 May 2019 05:33:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M5Xmxo099823; Wed, 22 May 2019 05:33:48 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M5XmV9099822; Wed, 22 May 2019 05:33:48 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905220533.x4M5XmV9099822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 May 2019 05:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348093 - in stable/12/sys/modules: linux linux64 X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys/modules: linux linux64 X-SVN-Commit-Revision: 348093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94DB06C29A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 05:33:49 -0000 Author: dchagin Date: Wed May 22 05:33:47 2019 New Revision: 348093 URL: https://svnweb.freebsd.org/changeset/base/348093 Log: MFC r347196: The build process generates assym.inc from genassym.o, so don't forget to clean genassym.o Modified: stable/12/sys/modules/linux/Makefile stable/12/sys/modules/linux64/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/linux/Makefile ============================================================================== --- stable/12/sys/modules/linux/Makefile Wed May 22 05:32:39 2019 (r348092) +++ stable/12/sys/modules/linux/Makefile Wed May 22 05:33:47 2019 (r348093) @@ -47,7 +47,8 @@ EXPORT_SYMS+= linux_ioctl_register_handler EXPORT_SYMS+= linux_ioctl_unregister_handler .endif -CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o +CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o \ + genassym.o linux${SFX}_assym.h: linux${SFX}_genassym.o sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} Modified: stable/12/sys/modules/linux64/Makefile ============================================================================== --- stable/12/sys/modules/linux64/Makefile Wed May 22 05:32:39 2019 (r348092) +++ stable/12/sys/modules/linux64/Makefile Wed May 22 05:33:47 2019 (r348093) @@ -21,7 +21,8 @@ SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h SRCS+= opt_apic.h .endif -CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o +CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ + genassym.o OBJS= ${VDSO}.so From owner-svn-src-all@freebsd.org Wed May 22 05:34:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41CE8159FFF2; Wed, 22 May 2019 05:34:45 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9EE66C3C8; Wed, 22 May 2019 05:34:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD28818F71; Wed, 22 May 2019 05:34:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M5YiUk099918; Wed, 22 May 2019 05:34:44 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M5Yi2m099917; Wed, 22 May 2019 05:34:44 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905220534.x4M5Yi2m099917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 May 2019 05:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348094 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 348094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9EE66C3C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 05:34:45 -0000 Author: dchagin Date: Wed May 22 05:34:44 2019 New Revision: 348094 URL: https://svnweb.freebsd.org/changeset/base/348094 Log: MFC r347202: Complete r347052 (https://reviews.freebsd.org/D20137) as it it was not a final revision. Fix style issues and change bool-like variables from int to bool. Modified: stable/12/sys/compat/linux/linux.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux.c ============================================================================== --- stable/12/sys/compat/linux/linux.c Wed May 22 05:33:47 2019 (r348093) +++ stable/12/sys/compat/linux/linux.c Wed May 22 05:34:44 2019 (r348094) @@ -227,21 +227,22 @@ ifname_linux_to_bsd(struct thread *td, const char *lxn struct ifnet *ifp; int len, unit; char *ep; - int is_eth, is_lo, index; + int index; + bool is_eth, is_lo; for (len = 0; len < LINUX_IFNAMSIZ; ++len) - if (!isalpha(lxname[len]) || lxname[len] == 0) + if (!isalpha(lxname[len]) || lxname[len] == '\0') break; if (len == 0 || len == LINUX_IFNAMSIZ) return (NULL); /* Linux loopback interface name is lo (not lo0) */ - is_lo = (len == 2 && !strncmp(lxname, "lo", len)) ? 1 : 0; + is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); unit = (int)strtoul(lxname + len, &ep, 10); if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && is_lo == 0) return (NULL); index = 0; - is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); CURVNET_SET(TD_TO_VNET(td)); IFNET_RLOCK(); From owner-svn-src-all@freebsd.org Wed May 22 05:35:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E91015A1093; Wed, 22 May 2019 05:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7B686C510; Wed, 22 May 2019 05:35:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8245718F73; Wed, 22 May 2019 05:35:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M5ZaWG000129; Wed, 22 May 2019 05:35:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M5Za3v000128; Wed, 22 May 2019 05:35:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905220535.x4M5Za3v000128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 May 2019 05:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348095 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 348095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7B686C510 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 05:35:37 -0000 Author: dchagin Date: Wed May 22 05:35:35 2019 New Revision: 348095 URL: https://svnweb.freebsd.org/changeset/base/348095 Log: MFC r347203: Rewrite linux_ifflags() in more readable Linuxulator style. Modified: stable/12/sys/compat/linux/linux.c stable/12/sys/compat/linux/linux.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux.c ============================================================================== --- stable/12/sys/compat/linux/linux.c Wed May 22 05:34:44 2019 (r348094) +++ stable/12/sys/compat/linux/linux.c Wed May 22 05:35:35 2019 (r348095) @@ -269,16 +269,30 @@ ifname_linux_to_bsd(struct thread *td, const char *lxn void linux_ifflags(struct ifnet *ifp, short *flags) { + unsigned short fl; - *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; - /* these flags have no Linux equivalent */ - *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| - IFF_LINK0|IFF_LINK1|IFF_LINK2); - /* Linux' multicast flag is in a different bit */ - if (*flags & IFF_MULTICAST) { - *flags &= ~IFF_MULTICAST; - *flags |= 0x1000; - } + fl = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + *flags = 0; + if (fl & IFF_UP) + *flags |= LINUX_IFF_UP; + if (fl & IFF_BROADCAST) + *flags |= LINUX_IFF_BROADCAST; + if (fl & IFF_DEBUG) + *flags |= LINUX_IFF_DEBUG; + if (fl & IFF_LOOPBACK) + *flags |= LINUX_IFF_LOOPBACK; + if (fl & IFF_POINTOPOINT) + *flags |= LINUX_IFF_POINTOPOINT; + if (fl & IFF_DRV_RUNNING) + *flags |= LINUX_IFF_RUNNING; + if (fl & IFF_NOARP) + *flags |= LINUX_IFF_NOARP; + if (fl & IFF_PROMISC) + *flags |= LINUX_IFF_PROMISC; + if (fl & IFF_ALLMULTI) + *flags |= LINUX_IFF_ALLMULTI; + if (fl & IFF_MULTICAST) + *flags |= LINUX_IFF_MULTICAST; } int Modified: stable/12/sys/compat/linux/linux.h ============================================================================== --- stable/12/sys/compat/linux/linux.h Wed May 22 05:34:44 2019 (r348094) +++ stable/12/sys/compat/linux/linux.h Wed May 22 05:35:35 2019 (r348095) @@ -46,6 +46,26 @@ struct l_sockaddr { #define LINUX_ARPHRD_ETHER 1 #define LINUX_ARPHRD_LOOPBACK 772 +/* + * net device flags + */ +#define LINUX_IFF_UP 0x0001 +#define LINUX_IFF_BROADCAST 0x0002 +#define LINUX_IFF_DEBUG 0x0004 +#define LINUX_IFF_LOOPBACK 0x0008 +#define LINUX_IFF_POINTOPOINT 0x0010 +#define LINUX_IFF_NOTRAILERS 0x0020 +#define LINUX_IFF_RUNNING 0x0040 +#define LINUX_IFF_NOARP 0x0080 +#define LINUX_IFF_PROMISC 0x0100 +#define LINUX_IFF_ALLMULTI 0x0200 +#define LINUX_IFF_MASTER 0x0400 +#define LINUX_IFF_SLAVE 0x0800 +#define LINUX_IFF_MULTICAST 0x1000 +#define LINUX_IFF_PORTSEL 0x2000 +#define LINUX_IFF_AUTOMEDIA 0x4000 +#define LINUX_IFF_DYNAMIC 0x8000 + /* sigaltstack */ #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 From owner-svn-src-all@freebsd.org Wed May 22 05:37:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E62B315A1165; Wed, 22 May 2019 05:37:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3D66C665; Wed, 22 May 2019 05:37:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4302A18F74; Wed, 22 May 2019 05:37:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M5bUY1000264; Wed, 22 May 2019 05:37:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M5bUxR000263; Wed, 22 May 2019 05:37:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905220537.x4M5bUxR000263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 22 May 2019 05:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348096 - stable/12/sys/compat/linsysfs X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/compat/linsysfs X-SVN-Commit-Revision: 348096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D3D66C665 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 05:37:31 -0000 Author: dchagin Date: Wed May 22 05:37:29 2019 New Revision: 348096 URL: https://svnweb.freebsd.org/changeset/base/348096 Log: MFC r347204: Adds sys/class/net devices to linsysfs. Only two interfaces are created eth0 and lo and they expose the following properties: address, addr_len, flags, ifindex, mty, tx_queue_len and type. Initial patch developed by Carlos Neira in 2017 and finished by me. MFC r347218: Remove wrong copyright line. Discussed with Carlos Neira. Modified: stable/12/sys/compat/linsysfs/linsysfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linsysfs/linsysfs.c ============================================================================== --- stable/12/sys/compat/linsysfs/linsysfs.c Wed May 22 05:35:35 2019 (r348095) +++ stable/12/sys/compat/linsysfs/linsysfs.c Wed May 22 05:37:29 2019 (r348096) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,7 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include #include #include @@ -64,6 +69,146 @@ atoi(const char *str) return (int)strtol(str, (char **)NULL, 10); } +static int +linsysfs_ifnet_addr(PFS_FILL_ARGS) +{ + struct l_sockaddr lsa; + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + if (linux_ifhwaddr(ifp, &lsa) != 0) + return (ENOENT); + sbuf_printf(sb, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", + lsa.sa_data[0], lsa.sa_data[1], lsa.sa_data[2], + lsa.sa_data[3], lsa.sa_data[4], lsa.sa_data[5]); + return (0); +} + +static int +linsysfs_ifnet_addrlen(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", LINUX_IFHWADDRLEN); + return (0); +} + +static int +linsysfs_ifnet_flags(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + unsigned short flags; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + linux_ifflags(ifp, &flags); + sbuf_printf(sb, "0x%x\n", flags); + return (0); +} + +static int +linsysfs_ifnet_ifindex(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + sbuf_printf(sb, "%u\n", ifp->if_index); + return (0); +} + +static int +linsysfs_ifnet_mtu(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + sbuf_printf(sb, "%u\n", ifp->if_mtu); + return (0); +} + +static int +linsysfs_ifnet_tx_queue_len(PFS_FILL_ARGS) +{ + + /* XXX */ + sbuf_printf(sb, "1000\n"); + return (0); +} + +static int +linsysfs_ifnet_type(PFS_FILL_ARGS) +{ + struct l_sockaddr lsa; + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + if (linux_ifhwaddr(ifp, &lsa) != 0) + return (ENOENT); + sbuf_printf(sb, "%d\n", lsa.sa_family); + return (0); +} + +static void +linsysfs_listnics(struct pfs_node *dir) +{ + struct pfs_node *nic; + struct pfs_node *lo; + + nic = pfs_create_dir(dir, "eth0", NULL, NULL, NULL, 0); + + pfs_create_file(nic, "address", &linsysfs_ifnet_addr, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "addr_len", &linsysfs_ifnet_addrlen, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "flags", &linsysfs_ifnet_flags, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "ifindex", &linsysfs_ifnet_ifindex, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "mtu", &linsysfs_ifnet_mtu, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "type", &linsysfs_ifnet_type, + NULL, NULL, NULL, PFS_RD); + + lo = pfs_create_dir(dir, "lo", NULL, NULL, NULL, 0); + + pfs_create_file(lo, "address", &linsysfs_ifnet_addr, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "addr_len", &linsysfs_ifnet_addrlen, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "flags", &linsysfs_ifnet_flags, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "ifindex", &linsysfs_ifnet_ifindex, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "mtu", &linsysfs_ifnet_mtu, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "type", &linsysfs_ifnet_type, + NULL, NULL, NULL, PFS_RD); +} + /* * Filler function for proc_name */ @@ -475,6 +620,7 @@ linsysfs_init(PFS_INIT_ARGS) struct pfs_node *drm; struct pfs_node *pci; struct pfs_node *scsi; + struct pfs_node *net; struct pfs_node *devdir, *chardev; devclass_t devclass; device_t dev; @@ -488,6 +634,9 @@ linsysfs_init(PFS_INIT_ARGS) scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0); drm = pfs_create_dir(class, "drm", NULL, NULL, NULL, 0); + /* /sys/class/net/.. */ + net = pfs_create_dir(class, "net", NULL, NULL, NULL, 0); + /* /sys/dev/... */ devdir = pfs_create_dir(root, "dev", NULL, NULL, NULL, 0); chardev = pfs_create_dir(devdir, "char", NULL, NULL, NULL, 0); @@ -514,6 +663,7 @@ linsysfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); linsysfs_listcpus(cpu); + linsysfs_listnics(net); return (0); } From owner-svn-src-all@freebsd.org Wed May 22 07:21:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66AB015A2ED0; Wed, 22 May 2019 07:21:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7D76FC53; Wed, 22 May 2019 07:21:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA4891A0AA; Wed, 22 May 2019 07:21: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 x4M7L5Rj055737; Wed, 22 May 2019 07:21:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7L5Tr055735; Wed, 22 May 2019 07:21:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220721.x4M7L5Tr055735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348098 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7D76FC53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:21:06 -0000 Author: manu Date: Wed May 22 07:21:05 2019 New Revision: 348098 URL: https://svnweb.freebsd.org/changeset/base/348098 Log: pkgbase: Move rc.firewall to libexec/rc Put it with all the other rc files Reviewed by: bapt Modified: head/etc/Makefile head/libexec/rc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 22 06:02:51 2019 (r348097) +++ head/etc/Makefile Wed May 22 07:21:05 2019 (r348098) @@ -17,7 +17,6 @@ SUBDIR+=sendmail BIN1= \ login.access \ rc.bsdextended \ - rc.firewall \ termcap.small # NB: keep these sorted by MK_* knobs Modified: head/libexec/rc/Makefile ============================================================================== --- head/libexec/rc/Makefile Wed May 22 06:02:51 2019 (r348097) +++ head/libexec/rc/Makefile Wed May 22 07:21:05 2019 (r348098) @@ -1,8 +1,13 @@ # $FreeBSD$ +.include + CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS CONFETCDIR= /etc CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown +.if ${MK_IPFW} != "no" +CONFETC+= rc.firewall +.endif CONFETCMODE= 644 CONFETCEXEC= netstart pccard_ether rc.resume rc.suspend CONFETCEXECDIR= /etc From owner-svn-src-all@freebsd.org Wed May 22 07:21:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74C415A3072; Wed, 22 May 2019 07:21:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCED6FDE6; Wed, 22 May 2019 07:21:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 577B41A0DA; Wed, 22 May 2019 07:21:40 +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 x4M7LeTY055805; Wed, 22 May 2019 07:21:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7LeOd055804; Wed, 22 May 2019 07:21:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220721.x4M7LeOd055804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348099 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7BCED6FDE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:21:41 -0000 Author: manu Date: Wed May 22 07:21:39 2019 New Revision: 348099 URL: https://svnweb.freebsd.org/changeset/base/348099 Log: pkgbase: Move rc.bsdextended to libexec/rc Reviewed by: bapt Modified: head/etc/Makefile head/libexec/rc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 22 07:21:05 2019 (r348098) +++ head/etc/Makefile Wed May 22 07:21:39 2019 (r348099) @@ -16,7 +16,6 @@ SUBDIR+=sendmail BIN1= \ login.access \ - rc.bsdextended \ termcap.small # NB: keep these sorted by MK_* knobs Modified: head/libexec/rc/Makefile ============================================================================== --- head/libexec/rc/Makefile Wed May 22 07:21:05 2019 (r348098) +++ head/libexec/rc/Makefile Wed May 22 07:21:39 2019 (r348099) @@ -4,7 +4,7 @@ CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS CONFETCDIR= /etc -CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown +CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown rc.bsdextended .if ${MK_IPFW} != "no" CONFETC+= rc.firewall .endif From owner-svn-src-all@freebsd.org Wed May 22 07:22:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0951115A30C1; Wed, 22 May 2019 07:22:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA7B6FF5D; Wed, 22 May 2019 07:22:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C5BA1A0FC; Wed, 22 May 2019 07:22:09 +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 x4M7M9Sa057574; Wed, 22 May 2019 07:22:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7M8ue057572; Wed, 22 May 2019 07:22:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220722.x4M7M8ue057572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348100 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9EA7B6FF5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:22:10 -0000 Author: manu Date: Wed May 22 07:22:08 2019 New Revision: 348100 URL: https://svnweb.freebsd.org/changeset/base/348100 Log: pkgbase: Move rc.sendmail to libexec/rc Reviewed by: bapt Modified: head/etc/Makefile head/libexec/rc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 22 07:21:39 2019 (r348099) +++ head/etc/Makefile Wed May 22 07:22:08 2019 (r348100) @@ -20,10 +20,6 @@ BIN1= \ # NB: keep these sorted by MK_* knobs -.if ${MK_SENDMAIL} != "no" -BIN1+= rc.sendmail -.endif - .if ${MK_SENDMAIL} == "no" ETCMAIL=mailer.conf aliases .else Modified: head/libexec/rc/Makefile ============================================================================== --- head/libexec/rc/Makefile Wed May 22 07:21:39 2019 (r348099) +++ head/libexec/rc/Makefile Wed May 22 07:22:08 2019 (r348100) @@ -8,6 +8,9 @@ CONFETC= network.subr rc rc.initdiskless rc.subr rc.sh .if ${MK_IPFW} != "no" CONFETC+= rc.firewall .endif +.if ${MK_SENDMAIL} != "no" +CONFETC+= rc.sendmail +.endif CONFETCMODE= 644 CONFETCEXEC= netstart pccard_ether rc.resume rc.suspend CONFETCEXECDIR= /etc From owner-svn-src-all@freebsd.org Wed May 22 07:22:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA05715A313A; Wed, 22 May 2019 07:22:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59F0B7020A; Wed, 22 May 2019 07:22:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 296A31A234; Wed, 22 May 2019 07:22:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M7MZGs057634; Wed, 22 May 2019 07:22:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7MY6W057632; Wed, 22 May 2019 07:22:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220722.x4M7MY6W057632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348101 - in head: etc share/termcap X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc share/termcap X-SVN-Commit-Revision: 348101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59F0B7020A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:22:35 -0000 Author: manu Date: Wed May 22 07:22:34 2019 New Revision: 348101 URL: https://svnweb.freebsd.org/changeset/base/348101 Log: pkgbase: Move termcap.small to share/termcap Reviewed by: bapt Modified: head/etc/Makefile head/share/termcap/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 22 07:22:08 2019 (r348100) +++ head/etc/Makefile Wed May 22 07:22:34 2019 (r348101) @@ -16,7 +16,7 @@ SUBDIR+=sendmail BIN1= \ login.access \ - termcap.small + login.access # NB: keep these sorted by MK_* knobs Modified: head/share/termcap/Makefile ============================================================================== --- head/share/termcap/Makefile Wed May 22 07:22:08 2019 (r348100) +++ head/share/termcap/Makefile Wed May 22 07:22:34 2019 (r348101) @@ -10,6 +10,7 @@ MAN= termcap.5 FILES= termcap termcap.db FILESDIR= ${BINDIR}/misc CLEANFILES+= termcap.db +CONFS= termcap.small .include From owner-svn-src-all@freebsd.org Wed May 22 07:23:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3700215A31A3; Wed, 22 May 2019 07:23:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C788970330; Wed, 22 May 2019 07:23:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FDBD1A235; Wed, 22 May 2019 07:23:04 +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 x4M7N4Ku057702; Wed, 22 May 2019 07:23:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7N4bS057699; Wed, 22 May 2019 07:23:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220723.x4M7N4bS057699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348102 - in head: etc share/examples usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc share/examples usr.bin/login X-SVN-Commit-Revision: 348102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C788970330 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:23:05 -0000 Author: manu Date: Wed May 22 07:23:03 2019 New Revision: 348102 URL: https://svnweb.freebsd.org/changeset/base/348102 Log: pkgbase: Move login.access to usb.bin/login Also remove the etc-examples target as we don't have any files to handle here. Reviewed by: bapt Modified: head/etc/Makefile head/share/examples/Makefile head/usr.bin/login/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 22 07:22:34 2019 (r348101) +++ head/etc/Makefile Wed May 22 07:23:03 2019 (r348102) @@ -14,10 +14,6 @@ UPDATE_DEPENDFILE= no SUBDIR+=sendmail .endif -BIN1= \ - login.access \ - login.access - # NB: keep these sorted by MK_* knobs .if ${MK_SENDMAIL} == "no" @@ -56,9 +52,6 @@ distribution: @echo "set DESTDIR before running \"make ${.TARGET}\"" @false .endif - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${BIN1} ${DESTDIR}/etc ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap @@ -167,11 +160,6 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" .endfor .endif - -etc-examples: ${META_DEPS} - cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${BIN1} ${BIN2} \ - ${DESTDIR}${SHAREDIR}/examples/etc .include Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Wed May 22 07:22:34 2019 (r348101) +++ head/share/examples/Makefile Wed May 22 07:23:03 2019 (r348102) @@ -381,9 +381,8 @@ SER_${d:tu:C/\//_/g}DIR+= ${SHAREDIR}/examples/${d} BINDIR= ${SHAREDIR}/examples -beforeinstall: copies etc-examples +beforeinstall: copies META_TARGETS+= copies -.ORDER: etc-examples copies: .for i in ${LDIRS} @@ -391,9 +390,6 @@ copies: rm -f ${DESTDIR}${BINDIR}/$i; \ fi .endfor - -etc-examples: - ${_+_}(cd ${SRCTOP}/etc; ${MAKE} etc-examples) SUBDIR+= smbfs Modified: head/usr.bin/login/Makefile ============================================================================== --- head/usr.bin/login/Makefile Wed May 22 07:22:34 2019 (r348101) +++ head/usr.bin/login/Makefile Wed May 22 07:23:03 2019 (r348102) @@ -3,7 +3,7 @@ .include -CONFS= fbtab login.conf motd +CONFS= fbtab login.conf motd login.access PROG= login SRCS= login.c login_fbtab.c CFLAGS+=-DLOGALL From owner-svn-src-all@freebsd.org Wed May 22 07:25:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65BC415A32E2; Wed, 22 May 2019 07:25:18 +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 F2D457053D; Wed, 22 May 2019 07:25:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (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 CB88E260298; Wed, 22 May 2019 09:25:15 +0200 (CEST) Subject: Re: svn commit: r348089 - stable/12/sys/compat/linuxkpi/common/include/linux To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905220410.x4M4AOma053075@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <8dba7fb5-daf0-0764-2bde-1b8c30131b4b@selasky.org> Date: Wed, 22 May 2019 09:24:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905220410.x4M4AOma053075@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: F2D457053D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.914,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:25:18 -0000 On 2019-05-22 06:10, Johannes Lundberg wrote: > Author: johalun > Date: Wed May 22 04:10:24 2019 > New Revision: 348089 > URL: https://svnweb.freebsd.org/changeset/base/348089 > > Log: > MFC r347621: > LinuxKPI: Add get_random_u32 function. > > This patch is part of D19565 > > Reviewed by: hps > Approved by: imp (mentor), hps > > Modified: > stable/12/sys/compat/linuxkpi/common/include/linux/random.h > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/compat/linuxkpi/common/include/linux/random.h > ============================================================================== > --- stable/12/sys/compat/linuxkpi/common/include/linux/random.h Wed May 22 04:08:45 2019 (r348088) > +++ stable/12/sys/compat/linuxkpi/common/include/linux/random.h Wed May 22 04:10:24 2019 (r348089) > @@ -35,6 +35,8 @@ > #include > #include > > +#define get_random_u32() get_random_int() > + > static inline void > get_random_bytes(void *buf, int nbytes) > { > > Please also MFC your patches to FreeBSD -11 . --HPS From owner-svn-src-all@freebsd.org Wed May 22 07:38:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C032715A39A2; Wed, 22 May 2019 07:38:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2E1710F1; Wed, 22 May 2019 07:38:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A99A1A41F; Wed, 22 May 2019 07:38:55 +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 x4M7ctBZ063099; Wed, 22 May 2019 07:38:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7ctmi063098; Wed, 22 May 2019 07:38:55 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220738.x4M7ctmi063098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348103 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E2E1710F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:38:56 -0000 Author: manu Date: Wed May 22 07:38:54 2019 New Revision: 348103 URL: https://svnweb.freebsd.org/changeset/base/348103 Log: pkgbase: Really move rc.firewall Messed up with git->svn in r348098 Added: head/libexec/rc/rc.firewall - copied unchanged from r348102, head/etc/rc.firewall Deleted: head/etc/rc.firewall Copied: head/libexec/rc/rc.firewall (from r348102, head/etc/rc.firewall) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/rc.firewall Wed May 22 07:38:54 2019 (r348103, copy of r348102, head/etc/rc.firewall) @@ -0,0 +1,557 @@ +#!/bin/sh - +# Copyright (c) 1996 Poul-Henning Kamp +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Setup system for ipfw(4) firewall service. +# + +# Suck in the configuration variables. +if [ -z "${source_rc_confs_defined}" ]; then + if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs + elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf + fi +fi + +############ +# Define the firewall type in /etc/rc.conf. Valid values are: +# open - will allow anyone in +# client - will try to protect just this machine +# simple - will try to protect a whole network +# closed - totally disables IP services except via lo0 interface +# workstation - will try to protect just this machine using stateful +# firewalling. See below for rc.conf variables used +# UNKNOWN - disables the loading of firewall rules. +# filename - will load the rules in the given filename (full path required) +# +# For ``client'' and ``simple'' the entries below should be customized +# appropriately. + +############ +# +# If you don't know enough about packet filtering, we suggest that you +# take time to read this book: +# +# Building Internet Firewalls, 2nd Edition +# Brent Chapman and Elizabeth Zwicky +# +# O'Reilly & Associates, Inc +# ISBN 1-56592-871-7 +# http://www.ora.com/ +# http://www.oreilly.com/catalog/fire2/ +# +# For a more advanced treatment of Internet Security read: +# +# Firewalls and Internet Security: Repelling the Wily Hacker, 2nd Edition +# William R. Cheswick, Steven M. Bellowin, Aviel D. Rubin +# +# Addison-Wesley / Prentice Hall +# ISBN 0-201-63466-X +# http://www.pearsonhighered.com/ +# http://www.pearsonhighered.com/educator/academic/product/0,3110,020163466X,00.html +# + +setup_loopback() { + ############ + # Only in rare cases do you want to change these rules + # + ${fwcmd} add 100 pass all from any to any via lo0 + ${fwcmd} add 200 deny all from any to 127.0.0.0/8 + ${fwcmd} add 300 deny ip from 127.0.0.0/8 to any + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add 400 deny all from any to ::1 + ${fwcmd} add 500 deny all from ::1 to any + fi +} + +setup_ipv6_mandatory() { + [ $ipv6_available -eq 0 ] || return 0 + + ############ + # Only in rare cases do you want to change these rules + # + # ND + # + # DAD + ${fwcmd} add pass ipv6-icmp from :: to ff02::/16 + # RS, RA, NS, NA, redirect... + ${fwcmd} add pass ipv6-icmp from fe80::/10 to fe80::/10 + ${fwcmd} add pass ipv6-icmp from fe80::/10 to ff02::/16 + + # Allow ICMPv6 destination unreachable + ${fwcmd} add pass ipv6-icmp from any to any icmp6types 1 + + # Allow NS/NA/toobig (don't filter it out) + ${fwcmd} add pass ipv6-icmp from any to any icmp6types 2,135,136 +} + +. /etc/rc.subr +. /etc/network.subr + +if [ -n "${1}" ]; then + firewall_type="${1}" +fi +if [ -z "${firewall_rc_config_load}" ]; then + load_rc_config ipfw +else + for i in ${firewall_rc_config_load}; do + load_rc_config $i + done +fi + +afexists inet6 +ipv6_available=$? + +############ +# Set quiet mode if requested +# +case ${firewall_quiet} in +[Yy][Ee][Ss]) + fwcmd="/sbin/ipfw -q" + ;; +*) + fwcmd="/sbin/ipfw" + ;; +esac + +############ +# Flush out the list before we begin. +# +${fwcmd} -f flush + +setup_loopback +setup_ipv6_mandatory + +############ +# Network Address Translation. All packets are passed to natd(8) +# before they encounter your remaining rules. The firewall rules +# will then be run again on each packet after translation by natd +# starting at the rule number following the divert rule. +# +# For ``simple'' firewall type the divert rule should be put to a +# different place to not interfere with address-checking rules. +# +case ${firewall_type} in +[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt]) + case ${natd_enable} in + [Yy][Ee][Ss]) + if [ -n "${natd_interface}" ]; then + ${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface} + fi + ;; + esac + case ${firewall_nat_enable} in + [Yy][Ee][Ss]) + if [ -n "${firewall_nat_interface}" ]; then + if echo "${firewall_nat_interface}" | \ + grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then + firewall_nat_flags="ip ${firewall_nat_interface} ${firewall_nat_flags}" + else + firewall_nat_flags="if ${firewall_nat_interface} ${firewall_nat_flags}" + fi + ${fwcmd} nat 123 config log ${firewall_nat_flags} + ${fwcmd} add 50 nat 123 ip4 from any to any via ${firewall_nat_interface} + fi + ;; + esac +esac + +############ +# If you just configured ipfw in the kernel as a tool to solve network +# problems or you just want to disallow some particular kinds of traffic +# then you will want to change the default policy to open. You can also +# do this as your only action by setting the firewall_type to ``open''. +# +# ${fwcmd} add 65000 pass all from any to any + + +# Prototype setups. +# +case ${firewall_type} in +[Oo][Pp][Ee][Nn]) + ${fwcmd} add 65000 pass all from any to any + ;; + +[Cc][Ll][Ii][Ee][Nn][Tt]) + ############ + # This is a prototype setup that will protect your system somewhat + # against people from outside your own network. + # + # Configuration: + # firewall_client_net: Network address of local IPv4 network. + # firewall_client_net_ipv6: Network address of local IPv6 network. + ############ + + # set this to your local network + net="$firewall_client_net" + net6="$firewall_client_net_ipv6" + + # Allow limited broadcast traffic from my own net. + ${fwcmd} add pass all from ${net} to 255.255.255.255 + + # Allow any traffic to or from my own net. + ${fwcmd} add pass all from me to ${net} + ${fwcmd} add pass all from ${net} to me + if [ -n "$net6" ]; then + ${fwcmd} add pass all from me to ${net6} + ${fwcmd} add pass all from ${net6} to me + fi + + if [ -n "$net6" ]; then + # Allow any link-local multicast traffic + ${fwcmd} add pass all from fe80::/10 to ff02::/16 + ${fwcmd} add pass all from ${net6} to ff02::/16 + # Allow DHCPv6 + ${fwcmd} add pass udp from fe80::/10 to me 546 + fi + + # Allow TCP through if setup succeeded + ${fwcmd} add pass tcp from any to any established + + # Allow IP fragments to pass through + ${fwcmd} add pass all from any to any frag + + # Allow setup of incoming email + ${fwcmd} add pass tcp from any to me 25 setup + + # Allow setup of outgoing TCP connections only + ${fwcmd} add pass tcp from me to any setup + + # Disallow setup of all other TCP connections + ${fwcmd} add deny tcp from any to any setup + + # Allow DNS queries out in the world + ${fwcmd} add pass udp from me to any 53 keep-state + + # Allow NTP queries out in the world + ${fwcmd} add pass udp from me to any 123 keep-state + + # Everything else is denied by default, unless the + # IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel + # config file. + ;; + +[Ss][Ii][Mm][Pp][Ll][Ee]) + ############ + # This is a prototype setup for a simple firewall. Configure this + # machine as a DNS and NTP server, and point all the machines + # on the inside at this machine for those services. + # + # Configuration: + # firewall_simple_iif: Inside IPv4 network interface. + # firewall_simple_inet: Inside IPv4 network address. + # firewall_simple_oif: Outside IPv4 network interface. + # firewall_simple_onet: Outside IPv4 network address. + # firewall_simple_iif_ipv6: Inside IPv6 network interface. + # firewall_simple_inet_ipv6: Inside IPv6 network prefix. + # firewall_simple_oif_ipv6: Outside IPv6 network interface. + # firewall_simple_onet_ipv6: Outside IPv6 network prefix. + ############ + BAD_ADDR_TBL=13 + + # set these to your outside interface network + oif="$firewall_simple_oif" + onet="$firewall_simple_onet" + oif6="${firewall_simple_oif_ipv6:-$firewall_simple_oif}" + onet6="$firewall_simple_onet_ipv6" + + # set these to your inside interface network + iif="$firewall_simple_iif" + inet="$firewall_simple_inet" + iif6="${firewall_simple_iif_ipv6:-$firewall_simple_iif}" + inet6="$firewall_simple_inet_ipv6" + + # Stop spoofing + ${fwcmd} add deny all from ${inet} to any in via ${oif} + ${fwcmd} add deny all from ${onet} to any in via ${iif} + if [ -n "$inet6" ]; then + ${fwcmd} add deny all from ${inet6} to any in via ${oif6} + if [ -n "$onet6" ]; then + ${fwcmd} add deny all from ${onet6} to any in \ + via ${iif6} + fi + fi + + # Define stuff we should never send out or receive in. + # Stop RFC1918 nets on the outside interface + ${fwcmd} table ${BAD_ADDR_TBL} flush + ${fwcmd} table ${BAD_ADDR_TBL} add 10.0.0.0/8 + ${fwcmd} table ${BAD_ADDR_TBL} add 172.16.0.0/12 + ${fwcmd} table ${BAD_ADDR_TBL} add 192.168.0.0/16 + + # And stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1, + # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E) + # on the outside interface + ${fwcmd} table ${BAD_ADDR_TBL} add 0.0.0.0/8 + ${fwcmd} table ${BAD_ADDR_TBL} add 169.254.0.0/16 + ${fwcmd} table ${BAD_ADDR_TBL} add 192.0.2.0/24 + ${fwcmd} table ${BAD_ADDR_TBL} add 224.0.0.0/4 + ${fwcmd} table ${BAD_ADDR_TBL} add 240.0.0.0/4 + + ${fwcmd} add deny all from any to "table($BAD_ADDR_TBL)" via ${oif} + + # Network Address Translation. This rule is placed here deliberately + # so that it does not interfere with the surrounding address-checking + # rules. If for example one of your internal LAN machines had its IP + # address set to 192.0.2.1 then an incoming packet for it after being + # translated by natd(8) would match the `deny' rule above. Similarly + # an outgoing packet originated from it before being translated would + # match the `deny' rule below. + case ${natd_enable} in + [Yy][Ee][Ss]) + if [ -n "${natd_interface}" ]; then + ${fwcmd} add divert natd ip4 from any to any via ${natd_interface} + fi + ;; + esac + + ${fwcmd} add deny all from "table($BAD_ADDR_TBL)" to any via ${oif} + if [ -n "$inet6" ]; then + # Stop unique local unicast address on the outside interface + ${fwcmd} add deny all from fc00::/7 to any via ${oif6} + ${fwcmd} add deny all from any to fc00::/7 via ${oif6} + + # Stop site-local on the outside interface + ${fwcmd} add deny all from fec0::/10 to any via ${oif6} + ${fwcmd} add deny all from any to fec0::/10 via ${oif6} + + # Disallow "internal" addresses to appear on the wire. + ${fwcmd} add deny all from ::ffff:0.0.0.0/96 to any \ + via ${oif6} + ${fwcmd} add deny all from any to ::ffff:0.0.0.0/96 \ + via ${oif6} + + # Disallow packets to malicious IPv4 compatible prefix. + ${fwcmd} add deny all from ::224.0.0.0/100 to any via ${oif6} + ${fwcmd} add deny all from any to ::224.0.0.0/100 via ${oif6} + ${fwcmd} add deny all from ::127.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::127.0.0.0/104 via ${oif6} + ${fwcmd} add deny all from ::0.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::0.0.0.0/104 via ${oif6} + ${fwcmd} add deny all from ::255.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::255.0.0.0/104 via ${oif6} + + ${fwcmd} add deny all from ::0.0.0.0/96 to any via ${oif6} + ${fwcmd} add deny all from any to ::0.0.0.0/96 via ${oif6} + + # Disallow packets to malicious 6to4 prefix. + ${fwcmd} add deny all from 2002:e000::/20 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:e000::/20 via ${oif6} + ${fwcmd} add deny all from 2002:7f00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:7f00::/24 via ${oif6} + ${fwcmd} add deny all from 2002:0000::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:0000::/24 via ${oif6} + ${fwcmd} add deny all from 2002:ff00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:ff00::/24 via ${oif6} + + ${fwcmd} add deny all from 2002:0a00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:0a00::/24 via ${oif6} + ${fwcmd} add deny all from 2002:ac10::/28 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:ac10::/28 via ${oif6} + ${fwcmd} add deny all from 2002:c0a8::/32 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:c0a8::/32 via ${oif6} + + ${fwcmd} add deny all from ff05::/16 to any via ${oif6} + ${fwcmd} add deny all from any to ff05::/16 via ${oif6} + fi + + # Allow TCP through if setup succeeded + ${fwcmd} add pass tcp from any to any established + + # Allow IP fragments to pass through + ${fwcmd} add pass all from any to any frag + + # Allow setup of incoming email + ${fwcmd} add pass tcp from any to me 25 setup + + # Allow access to our DNS + ${fwcmd} add pass tcp from any to me 53 setup + ${fwcmd} add pass udp from any to me 53 + ${fwcmd} add pass udp from me 53 to any + + # Allow access to our WWW + ${fwcmd} add pass tcp from any to me 80 setup + + # Reject&Log all setup of incoming connections from the outside + ${fwcmd} add deny log ip4 from any to any in via ${oif} setup proto tcp + if [ -n "$inet6" ]; then + ${fwcmd} add deny log ip6 from any to any in via ${oif6} \ + setup proto tcp + fi + + # Allow setup of any other TCP connection + ${fwcmd} add pass tcp from any to any setup + + # Allow DNS queries out in the world + ${fwcmd} add pass udp from me to any 53 keep-state + + # Allow NTP queries out in the world + ${fwcmd} add pass udp from me to any 123 keep-state + + # Everything else is denied by default, unless the + # IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel + # config file. + ;; + +[Ww][Oo][Rr][Kk][Ss][Tt][Aa][Tt][Ii][Oo][Nn]) + # Configuration: + # firewall_myservices: List of ports/protocols on which this + # host offers services. + # firewall_allowservices: List of IPv4 and/or IPv6 addresses + # that have access to + # $firewall_myservices. + # firewall_trusted: List of IPv4 and/or IPv6 addresses + # that have full access to this host. + # Be very careful when setting this. + # This option can seriously degrade + # the level of protection provided by + # the firewall. + # firewall_logdeny: Boolean (YES/NO) specifying if the + # default denied packets should be + # logged (in /var/log/security). + # firewall_nologports: List of TCP/UDP ports for which + # denied incoming packets are not + # logged. + + # Allow packets for which a state has been built. + ${fwcmd} add check-state + + # For services permitted below. + ${fwcmd} add pass tcp from me to any established + + # Allow any connection out, adding state for each. + ${fwcmd} add pass tcp from me to any setup keep-state + ${fwcmd} add pass udp from me to any keep-state + ${fwcmd} add pass icmp from me to any keep-state + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass ipv6-icmp from me to any keep-state + fi + + # Allow DHCP. + ${fwcmd} add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out + ${fwcmd} add pass udp from any 67 to me 68 in + ${fwcmd} add pass udp from any 67 to 255.255.255.255 68 in + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass udp from fe80::/10 to me 546 in + fi + # Some servers will ping the IP while trying to decide if it's + # still in use. + ${fwcmd} add pass icmp from any to any icmptype 8 + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass ipv6-icmp from any to any icmp6type 128,129 + fi + + # Allow "mandatory" ICMP in. + ${fwcmd} add pass icmp from any to any icmptype 3,4,11 + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass ipv6-icmp from any to any icmp6type 3 + fi + + # Add permits for this workstations published services below + # Only IPs and nets in firewall_allowservices is allowed in. + # If you really wish to let anyone use services on your + # workstation, then set "firewall_allowservices='any'" in /etc/rc.conf + # + # Note: We don't use keep-state as that would allow DoS of + # our statetable. + # You can add 'keep-state' to the lines for slightly + # better performance if you fell that DoS of your + # workstation won't be a problem. + # + for i in ${firewall_allowservices} ; do + for j in ${firewall_myservices} ; do + case $j in + [0-9A-Za-z]*/[Pp][Rr][Oo][Tt][Oo]) + ${fwcmd} add pass ${j%/[Pp][Rr][Oo][Tt][Oo]} from $i to me + ;; + [0-9A-Za-z]*/[Tt][Cc][Pp]) + ${fwcmd} add pass tcp from $i to me ${j%/[Tt][Cc][Pp]} + ;; + [0-9A-Za-z]*/[Uu][Dd][Pp]) + ${fwcmd} add pass udp from $i to me ${j%/[Uu][Dd][Pp]} + ;; + *[0-9A-Za-z]) + echo "Consider using ${j}/tcp in firewall_myservices." \ + > /dev/stderr + ${fwcmd} add pass tcp from $i to me $j + ;; + *) + echo "Invalid port in firewall_myservices: $j" > /dev/stderr + ;; + esac + done + done + + # Allow all connections from trusted IPs. + # Playing with the content of firewall_trusted could seriously + # degrade the level of protection provided by the firewall. + for i in ${firewall_trusted} ; do + ${fwcmd} add pass ip from $i to me + done + + ${fwcmd} add 65000 count ip from any to any + + # Drop packets to ports where we don't want logging + for i in ${firewall_nologports} ; do + ${fwcmd} add deny { tcp or udp } from any to any $i in + done + + # Broadcasts and multicasts + ${fwcmd} add deny ip from any to 255.255.255.255 + ${fwcmd} add deny ip from any to 224.0.0.0/24 in # XXX + + # Noise from routers + ${fwcmd} add deny udp from any to any 520 in + + # Noise from webbrowsing. + # The stateful filter is a bit aggressive, and will cause some + # connection teardowns to be logged. + ${fwcmd} add deny tcp from any 80,443 to any 1024-65535 in + + # Deny and (if wanted) log the rest unconditionally. + log="" + if [ ${firewall_logdeny:-x} = "YES" -o ${firewall_logdeny:-x} = "yes" ] ; then + log="log logamount 500" # The default of 100 is too low. + sysctl net.inet.ip.fw.verbose=1 >/dev/null + fi + ${fwcmd} add deny $log ip from any to any + ;; + +[Cc][Ll][Oo][Ss][Ee][Dd]) + ${fwcmd} add 65000 deny ip from any to any + ;; +[Uu][Nn][Kk][Nn][Oo][Ww][Nn]) + ;; +*) + if [ -r "${firewall_type}" ]; then + ${fwcmd} ${firewall_flags} ${firewall_type} + fi + ;; +esac From owner-svn-src-all@freebsd.org Wed May 22 07:40:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5636915A3BD8; Wed, 22 May 2019 07:40:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D69A971312; Wed, 22 May 2019 07:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B261A423; Wed, 22 May 2019 07:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M7e0fr063216; Wed, 22 May 2019 07:40:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7e0CH063215; Wed, 22 May 2019 07:40:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220740.x4M7e0CH063215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348104 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D69A971312 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:40:01 -0000 Author: manu Date: Wed May 22 07:39:59 2019 New Revision: 348104 URL: https://svnweb.freebsd.org/changeset/base/348104 Log: pkgbase: Really move rc.bsdextended Messed up with git->svn in r348099 Added: head/libexec/rc/rc.bsdextended - copied unchanged from r348103, head/etc/rc.bsdextended Deleted: head/etc/rc.bsdextended Copied: head/libexec/rc/rc.bsdextended (from r348103, head/etc/rc.bsdextended) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/rc.bsdextended Wed May 22 07:39:59 2019 (r348104, copy of r348103, head/etc/rc.bsdextended) @@ -0,0 +1,138 @@ +#!/bin/sh +# +# Copyright (c) 2004 Tom Rhodes +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#### +# Sample startup policy for the mac_bsdextended(4) security module. +# +# Suck in the system configuration variables. +#### +if [ -z "${source_rc_confs_defined}" ]; then + if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs + elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf + fi +fi + +#### +# Set ugidfw(8) to CMD: +#### +CMD=/usr/sbin/ugidfw + +#### +# WARNING: recommended reading is the handbook's MAC +# chapter and the ugidfw(8) manual page. You can +# lock yourself out of the system very quickly by setting +# incorrect values here. These are only examples. +#### + +#### +# Build a generic list of rules here, these should be +# modified before using this script. +# +# For apache to read user files, the ruleadd must give +# it permissions by default. +#### +#${CMD} add subject uid 80 object not uid 80 mode rxws; +#${CMD} add subject gid 80 object not gid 80 mode rxws; + +#### +# majordomo compat: +#${CMD} add subject uid 54 object not uid 54 mode rxws; +#${CMD} add subject gid 26 object gid 54 mode rxws; + +#### +# This is for root: +${CMD} add subject uid 0 object not uid 0 mode arxws; +${CMD} add subject gid 0 object not gid 0 mode arxws; + +#### +# And for majordomo: +#${CMD} add subject uid 54 object not uid 54 mode rxws; +#${CMD} add subject gid 54 object not gid 54 mode rxws; + +#### +# And for bin: +${CMD} add subject uid 3 object not uid 3 mode rxws; +${CMD} add subject gid 7 object not gid 7 mode rxws; + +#### +# And for mail/pop: +#${CMD} add subject uid 68 object not uid 68 mode rxws; +#${CMD} add subject gid 6 object not gid 6 mode arxws; + +#### +# And for smmsp: +${CMD} add subject uid 25 object not uid 25 mode rxws; +${CMD} add subject gid 25 object not gid 25 mode rxws; + +#### +# And for mailnull: +${CMD} add subject uid 26 object not uid 26 mode rxws; +${CMD} add subject gid 26 object not gid 26 mode rxws; + +#### +# For cyrus: +#${CMD} add subject uid 60 object not uid 60 mode rxws; +#${CMD} add subject gid 60 object not gid 60 mode rxws; + +#### +# For stunnel: +#${CMD} add subject uid 1018 object not uid 1018 mode rxws; +#${CMD} add subject gid 1018 object not gid 1018 mode rxws; + +#### +# For the nobody account: +${CMD} add subject uid 65534 object not uid 65534 mode rxws; +${CMD} add subject gid 65534 object not gid 65534 mode rxws; + +#### +# NOTICE: The next script adds a rule to allow +# access their mailbox which is owned by GID `6'. +# Removing this will give mailbox lock issues. +for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' /etc/passwd`; + do ${CMD} add subject uid $x object gid 6 mode arwxs; +done; + +#### +# Use some script to get a list of users and +# add all users to mode n for all other users. This +# will isolate all users from other user home directories while +# permitting them to use commands and browse the system. +for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' /etc/passwd`; + do ${CMD} add subject not uid $x object uid $x mode n; +done; + +### +# Do the same thing but only for group ids in place of +# user IDs. +for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $3 }' /etc/passwd`; + do ${CMD} add subject not gid $x object uid $x mode n; +done; From owner-svn-src-all@freebsd.org Wed May 22 07:40:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A9415A3CB4; Wed, 22 May 2019 07:40:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A22FF7148B; Wed, 22 May 2019 07:40:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BCBA1A42C; Wed, 22 May 2019 07:40:40 +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 x4M7eeZx063284; Wed, 22 May 2019 07:40:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7eeZV063283; Wed, 22 May 2019 07:40:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220740.x4M7eeZV063283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348105 - in head: etc libexec/rc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc libexec/rc X-SVN-Commit-Revision: 348105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A22FF7148B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:40:41 -0000 Author: manu Date: Wed May 22 07:40:39 2019 New Revision: 348105 URL: https://svnweb.freebsd.org/changeset/base/348105 Log: pkgbase: Really move rc.sendmail Messed up with git->svn in r348100 Added: head/libexec/rc/rc.sendmail - copied unchanged from r348104, head/etc/rc.sendmail Deleted: head/etc/rc.sendmail Copied: head/libexec/rc/rc.sendmail (from r348104, head/etc/rc.sendmail) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/rc.sendmail Wed May 22 07:40:39 2019 (r348105, copy of r348104, head/etc/rc.sendmail) @@ -0,0 +1,277 @@ +#!/bin/sh + +# +# Copyright (c) 2002 Gregory Neil Shapiro. All Rights Reserved. +# Copyright (c) 2000, 2002 The FreeBSD Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# This script is used by /etc/rc at boot time to start sendmail. It +# is meant to be sendmail specific and not a generic script for all +# MTAs. It is only called by /etc/rc if the rc.conf mta_start_script is +# set to /etc/rc.sendmail. This provides the opportunity for other MTAs +# to provide their own startup script. + +# The script is also used by /etc/mail/Makefile to enable the +# start/stop/restart targets. + +# The source for the script can be found in src/etc/sendmail/rc.sendmail. + +if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs +elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf +fi + +# The sendmail binary +sendmail_program=${sendmail_program:-/usr/sbin/sendmail} + +# The pid is used to stop and restart the running daemon(s). +sendmail_pidfile=${sendmail_pidfile:-/var/run/sendmail.pid} +sendmail_mspq_pidfile=${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid} + +start_mta() +{ + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + ;; + [Yy][Ee][Ss]) + echo -n ' sendmail' + ${sendmail_program} ${sendmail_flags} + ;; + *) + case ${sendmail_submit_enable} in + [Yy][Ee][Ss]) + echo -n ' sendmail-submit' + ${sendmail_program} ${sendmail_submit_flags} + ;; + *) + case ${sendmail_outbound_enable} in + [Yy][Ee][Ss]) + echo -n ' sendmail-outbound' + ${sendmail_program} ${sendmail_outbound_flags} + ;; + esac + ;; + esac + ;; + esac +} + +stop_mta() +{ + # Check to make sure we are configured to start an MTA + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_submit_enable} in + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_outbound_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + ;; + esac + ;; + esac + + if [ -r ${sendmail_pidfile} ]; then + echo -n ' sendmail' + kill -TERM `head -1 ${sendmail_pidfile}` + else + echo "$0: stop-mta: ${sendmail_pidfile} not found" + fi +} + +restart_mta() +{ + # Check to make sure we are configured to start an MTA + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_submit_enable} in + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_outbound_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + ;; + esac + ;; + esac + if [ -r ${sendmail_pidfile} ]; then + echo -n ' sendmail' + kill -HUP `head -1 ${sendmail_pidfile}` + else + echo "$0: restart-mta: ${sendmail_pidfile} not found" + fi +} + +start_mspq() +{ + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + ;; + *) + if [ -r /etc/mail/submit.cf ]; then + case ${sendmail_msp_queue_enable} in + [Yy][Ee][Ss]) + echo -n ' sendmail-clientmqueue' + ${sendmail_program} ${sendmail_msp_queue_flags} + ;; + esac + fi + ;; + esac +} + +stop_mspq() +{ + # Check to make sure we are configured to start an MSP queue runner + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + *) + if [ -r /etc/mail/submit.cf ]; then + case ${sendmail_msp_queue_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + fi + ;; + esac + + if [ -r ${sendmail_mspq_pidfile} ]; then + echo -n ' sendmail-clientmqueue' + kill -TERM `head -1 ${sendmail_mspq_pidfile}` + else + echo "$0: stop-mspq: ${sendmail_mspq_pidfile} not found" + fi +} + +restart_mspq() +{ + # Check to make sure we are configured to start an MSP queue runner + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + *) + if [ -r /etc/mail/submit.cf ]; then + case ${sendmail_msp_queue_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + fi + ;; + esac + + if [ -r ${sendmail_mspq_pidfile} ]; then + echo -n ' sendmail-clientmqueue' + kill -HUP `head -1 ${sendmail_mspq_pidfile}` + else + echo "$0: restart-mspq: ${sendmail_mspq_pidfile} not found" + fi +} + +# If no argument is given, assume we are being called at boot time. +_action=${1:-start} + +case ${_action} in +start) + start_mta + start_mspq + ;; + +stop) + stop_mta + stop_mspq + ;; + +restart) + restart_mta + restart_mspq + ;; + +start-mta) + start_mta + ;; + +stop-mta) + stop_mta + ;; + +restart-mta) + restart_mta + ;; + +start-mspq) + start_mspq + ;; + +stop-mspq) + stop_mspq + ;; + +restart-mspq) + restart_mspq + ;; + +*) + echo "usage: `basename $0` {start|stop|restart}" >&2 + echo " `basename $0` {start-mta|stop-mta|restart-mta}" >&2 + echo " `basename $0` {start-mspq|stop-mspq|restart-mspq}" >&2 + exit 64 + ;; + +esac +exit 0 From owner-svn-src-all@freebsd.org Wed May 22 07:41:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E52A515A3F2A; Wed, 22 May 2019 07:41:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8072671791; Wed, 22 May 2019 07:41:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D6971A565; Wed, 22 May 2019 07:41:21 +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 x4M7fLvH064076; Wed, 22 May 2019 07:41:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7fL9H064075; Wed, 22 May 2019 07:41:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220741.x4M7fL9H064075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348106 - in head: etc share/termcap X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc share/termcap X-SVN-Commit-Revision: 348106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8072671791 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:41:22 -0000 Author: manu Date: Wed May 22 07:41:20 2019 New Revision: 348106 URL: https://svnweb.freebsd.org/changeset/base/348106 Log: pkgbase: Really move termcap.small Messed up with git->svn in r348101 Added: head/share/termcap/termcap.small - copied unchanged from r348105, head/etc/termcap.small Deleted: head/etc/termcap.small Copied: head/share/termcap/termcap.small (from r348105, head/etc/termcap.small) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/termcap/termcap.small Wed May 22 07:41:20 2019 (r348106, copy of r348105, head/etc/termcap.small) @@ -0,0 +1,315 @@ +# Copyright (c) 1980, 1985, 1989 The Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# @(#)termcap.src 5.88 (Berkeley) 4/30/91 +# $FreeBSD$ +# +# for syscons +# common entry without semigraphics +cons25w|ansiw|ansi80x25-raw:\ + :am:bs:NP:ms:pt:AX:eo:bw:ut:km:\ + :co#80:li#25:pa#64:Co#8:it#8:\ + :al=\E[L:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:\ + :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ho=\E[H:ic=\E[@:cb=\E[1K:\ + :nd=\E[C:rs=\Ec:so=\E[7m:se=\E[27m:up=\E[A:cr=^M:ta=^I:\ + :AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:sc=\E7:rc=\E8:\ + :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:\ + :k9=\E[U:k;=\E[V:F1=\E[W:F2=\E[X:K2=\E[E:nw=\E[E:ec=\E[%dX:\ + :kb=^H:kh=\E[H:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:le=^H:sf=\E[S:sr=\E[T:\ + :kN=\E[G:kP=\E[I:@7=\E[F:kI=\E[L:kD=\177:kB=\E[Z:\ + :IC=\E[%d@:DC=\E[%dP:SF=\E[%dS:SR=\E[%dT:AL=\E[%dL:DL=\E[%dM:\ + :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:cv=\E[%i%dd:ch=\E[%i%d`:\ + :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:bl=^G:\ + :ve=\E[=S:vi=\E[=1S:vs=\E[=2S: +# CP437 FreeBSD console with ACS support +cons25|ansis|ansi80x25:\ + :ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261i^U0\333y\363z\362:\ + :tc=cons25w: +cons25-m|ansis-mono|ansi80x25-mono:\ + :pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25: +cons30|ansi80x30:\ + :li#30:tc=cons25: +cons30-m|ansi80x30-mono:\ + :li#30:tc=cons25-m: +cons43|ansi80x43:\ + :li#43:tc=cons25: +cons43-m|ansi80x43-mono:\ + :li#43:tc=cons25-m: +cons50|ansil|ansi80x50:\ + :li#50:tc=cons25: +cons50-m|ansil-mono|ansi80x50-mono:\ + :li#50:tc=cons25-m: +cons60|ansi80x60:\ + :li#60:tc=cons25: +cons60-m|ansi80x60-mono:\ + :li#60:tc=cons25-m: +# Syscons console with 132 characters (VESA modes) +cons25-w|ansi132x25:\ + :co#132:tc=cons25: +cons30-w|ansi132x30:\ + :co#132:tc=cons30: +cons43-w|ansi132x43:\ + :co#132:tc=cons43: +cons50-w|ansil-w|ansi132x50:\ + :co#132:tc=cons50: +cons60-w|ansi132x60:\ + :co#132:tc=cons60: +# KOI8-R/KOI8-U FreeBSD console with ACS support +cons25r|cons25u|pc3r|ibmpc3r|cons25-koi8:\ + :ac=q\200x\201m\204v\211j\205t\206n\212u\207l\202w\210k\203y\230z\231f\234~\225a\220h\2210\215:\ + :tc=cons25w: +cons25r-m|cons25u-m|pc3r-m|ibmpc3r-mono|cons25-koi8-mono:\ + :pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25r: +cons30r|cons30u|cons30-koi8:\ + :li#30:tc=cons25r: +cons30r-m|cons30u-m|cons30-koi8-mono:\ + :li#30:tc=cons25r-m: +cons43r|cons43u|cons43-koi8:\ + :li#43:tc=cons25r: +cons43r-m|cons43u-m|cons43-koi8-mono:\ + :li#43:tc=cons25r-m: +cons50r|cons50u|cons50-koi8:\ + :li#50:tc=cons25r: +cons50r-m|cons50u-m|cons50-koi8-mono:\ + :li#50:tc=cons25r-m: +cons60r|cons60u|cons60-koi8:\ + :li#60:tc=cons25r: +cons60r-m|cons60u-m|cons60-koi8-mono:\ + :li#60:tc=cons25r-m: +# Syscons console with 90 characters (VGA modes) +# KOI8-R/KOI8-U FreeBSD console with ACS support. +cons25r-v|cons25u-v|pc3r-v|ibmpc3r-vga|cons25-koi8-vga:\ + :co#90:tc=cons25r: +cons25r-mv|cons25u-mv|pc3r-mv|ibmpc3r-monovga|cons25-koi8-monovga:\ + :co#90:tc=cons25r-m: +cons30r-v|cons30u-v|cons30-koi8-vga:\ + :co#90:tc=cons30r: +cons30r-mv|cons30u-mv|cons30-koi8-monovga:\ + :co#90:tc=cons30r-m: +cons43r-v|cons43u-v|cons43-koi8-vga:\ + :co#90:tc=cons43r: +cons43r-mv|cons43u-mv|cons43-koi8-monovga:\ + :co#90:tc=cons43r-m: +cons50r-v|cons50u-v|cons50-koi8-vga:\ + :co#90:tc=cons50r: +cons50r-mv|cons50u-mv|cons50-koi8-monovga:\ + :co#90:tc=cons50r-m: +cons60r-v|cons60u-v|cons60-koi8-vga:\ + :co#90:tc=cons60r: +cons60r-mv|cons60u-mv|cons60-koi8-monovga:\ + :co#90:tc=cons60r-m: +# ISO 8859-2 FreeBSD console with ACS support +cons25l2|cons25-iso8859-2:\ + :ac=f\260i\247:\ + :tc=cons25w: +cons25l2-m|cons25-iso8859-2-mono:\ + :pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25l2: +cons30l2|cons30-iso8859-2:\ + :li#30:tc=cons25l2: +cons30l2-m|cons30-iso8859-2-mono:\ + :li#30:tc=cons25l2-m: +cons43l2|cons43-iso8859-2:\ + :li#43:tc=cons25l2: +cons43l2-m|cons43-iso8859-2-mono:\ + :li#43:tc=cons25l2-m: +cons50l2|cons50-iso8859-2:\ + :li#50:tc=cons25l2: +cons50l2-m|cons50-iso8859-2-mono:\ + :li#50:tc=cons25l2-m: +cons60l2|cons60-iso8859-2:\ + :li#60:tc=cons25l2: +cons60l2-m|cons60-iso8859-2-mono:\ + :li#60:tc=cons25l2-m: +# ISO 8859-1 FreeBSD console with ACS support +cons25l1|cons25-iso8859-1:\ + :ac=f\260g\261}\243+\253,\273i\247:\ + :tc=cons25w: +cons25l1-m|cons25-iso8859-1-mono:\ + :pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25l1: +cons30l1|cons30-iso8859-1:\ + :li#30:tc=cons25l1: +cons30l1-m|cons30-iso8859-1-mono:\ + :li#30:tc=cons25l1-m: +cons43l1|cons43-iso8859-1:\ + :li#43:tc=cons25l1: +cons43l1-m|cons43-iso8859-1-mono:\ + :li#43:tc=cons25l1-m: +cons50l1|cons50-iso8859-1:\ + :li#50:tc=cons25l1: +cons50l1-m|cons50-iso8859-1-mono:\ + :li#50:tc=cons25l1-m: +cons60l1|cons60-iso8859-1:\ + :li#60:tc=cons25l1: +cons60l1-m|cons60-iso8859-1-mono:\ + :li#60:tc=cons25l1-m: +# 132x25 ISO 8859-1 FreeBSD console +cons25l1-w|cons25w-iso8859-1:\ + :co#132:tc=cons25l1: +cons30l1-w|cons30w-iso8859-1:\ + :co#132:tc=cons30l1: +cons43l1-w|cons43w-iso8859-1:\ + :co#132:tc=cons43l1: +cons50l1-w|cons50w-iso8859-1:\ + :co#132:tc=cons50l1: +cons60l1-w|cons60w-iso8859-1:\ + :co#132:tc=cons60l1: +# ISO 8859-7 FreeBSD console with ACS support +cons25l7|cons25-iso8859-7:\ + :ac=f\260g\261{\360}\243+\253,\273i\247:\ + :tc=cons25w: +cons25l7-m|cons25-iso8859-7-mono:\ + :pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25l7: +cons30l7|cons30-iso8859-7:\ + :li#30:tc=cons25l7: +cons30l7-m|cons30-iso8859-7-mono:\ + :li#30:tc=cons25l7-m: +cons43l7|cons43-iso8859-7:\ + :li#43:tc=cons25l7: +cons43l7-m|cons43-iso8859-7-mono:\ + :li#43:tc=cons25l7-m: +cons50l7|cons50-iso8859-7:\ + :li#50:tc=cons25l7: +cons50l7-m|cons50-iso8859-7-mono:\ + :li#50:tc=cons25l7-m: +cons60l7|cons60-iso8859-7:\ + :li#60:tc=cons25l7: +cons60l7-m|cons60-iso8859-7-mono:\ + :li#60:tc=cons25l7-m: + +SC|screen|VT 100/ANSI X3.64 virtual terminal:\ + :am:xn:ms:mi:G0:km:\ + :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\ + :cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\ + :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\ + :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\ + :li#24:co#80:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:\ + :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:sr=\EM:al=\E[L:\ + :AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\ + :DC=\E[%dP:im=\E[4h:ei=\E[4l:IC=\E[%d@:\ + :ks=\E[?1h\E=:ke=\E[?1l\E>:vb=\Eg:\ + :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ + :F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\ + :F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ + :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\ + :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\ + :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ + :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\ + :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00: + +vt100|dec-vt100|vt100-am|vt100am|dec vt100:\ + :do=2\E[B:co#80:li#24:cl=50\E[H\E[J:sf=2*\ED:\ + :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ + :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ + :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\ + :is=\E>\E[?1;3;4;5l\E[?7;8h\E[1;24r\E[24;1H:\ + :if=/usr/share/tabset/vt100:nw=2\EE:ho=\E[H:\ + :as=2\E(0:ae=2\E(B:\ + :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||:\ + :rs=\E>\E[?1;3;4;5l\E[?7;8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ + :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=\177:\ + :k0=\EOy:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\EOt:\ + :k6=\EOu:k7=\EOv:k8=\EOl:k9=\EOw:k;=\EOx:@8=\EOM:\ + :K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\ + :sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\ + :LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\ + :RA=\E[?7l:SA=\E[?7h:po=\E[5i:pf=\E[4i: + +# $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $ +# +xterm-new|modern xterm:\ + :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\ + :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ + :tc=xterm-basic: +# +# This chunk is used for building the VT220/Sun/PC keyboard variants. +xterm-basic|modern xterm common:\ + :am:bs:km:mi:ms:ut:xn:AX:\ + :Co#8:co#80:kn#12:li#24:pa#64:\ + :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ + :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\ + :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ + :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ + :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ + :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ + :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ + :so=\E[7m:sr=\EM:st=\EH:\ + :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: +# +# This is the only entry which you should have to customize, since "xterm" +# is widely used for a variety of incompatible terminal emulations including +# color_xterm and rxvt. +xterm|X11 terminal emulator:\ + :tc=xterm-new: +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +xterm-clear:\ + :te=\E[?1049l:ti=\E[?1049h:\ + :tc=xterm-new: +# +# This should work for the commonly used "color xterm" variations (XFree86 +# xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for +# XFree86 and rxvt, some applications that use colors will be less efficient, +# and in a few special cases (with "smart" optimization) the wrong color will +# be painted in spots. +xterm-color|generic "ANSI" color xterm:\ + :Co#8:NC@:pa#64:\ + :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:tc=xterm-r6: +# +# Compatible with the X11R6.3 xterm +xterm-r6|xterm-old|X11R6 xterm:\ + :am:bs:km:mi:ms:pt:xn:\ + :co#80:kn#20:li#24:\ + :*6=\E[4~:@0=\E[1~:@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ + :DO=\E[%dB:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:\ + :F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:\ + :FA=\E[34~:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:\ + :as=^N:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:\ + :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:eA=\E)0:ei=\E[4l:\ + :ho=\E[H:im=\E[4h:\ + :is=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ + :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\ + :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\ + :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:md=\E[1m:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:\ + :rc=\E8:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\ + :ue=\E[m:up=\E[A:us=\E[4m: +# +# Add the capability to "clear the screen" after exiting vi, more/less, etc. +xterm-r6-clear:\ + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\ + :tc=xterm-r6: From owner-svn-src-all@freebsd.org Wed May 22 07:42:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A54F15A3FF0; Wed, 22 May 2019 07:42:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 160F571997; Wed, 22 May 2019 07:42:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F0331A5BD; Wed, 22 May 2019 07:41:59 +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 x4M7fxCd064872; Wed, 22 May 2019 07:41:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M7fx8B064871; Wed, 22 May 2019 07:41:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905220741.x4M7fx8B064871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 May 2019 07:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348107 - in head: etc usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: etc usr.bin/login X-SVN-Commit-Revision: 348107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 160F571997 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 07:42:00 -0000 Author: manu Date: Wed May 22 07:41:58 2019 New Revision: 348107 URL: https://svnweb.freebsd.org/changeset/base/348107 Log: pkgbase: Really move login.access Messed up with git->svn r348102 Added: head/usr.bin/login/login.access - copied unchanged from r348106, head/etc/login.access Deleted: head/etc/login.access Copied: head/usr.bin/login/login.access (from r348106, head/etc/login.access) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/login/login.access Wed May 22 07:41:58 2019 (r348107, copy of r348106, head/etc/login.access) @@ -0,0 +1,46 @@ +# $FreeBSD$ +# +# Login access control table. +# +# When someone logs in, the table is scanned for the first entry that +# matches the (user, host) combination, or, in case of non-networked +# logins, the first entry that matches the (user, tty) combination. The +# permissions field of that table entry determines whether the login will +# be accepted or refused. +# +# Format of the login access control table is three fields separated by a +# ":" character: +# +# permission : users : origins +# +# The first field should be a "+" (access granted) or "-" (access denied) +# character. The second field should be a list of one or more login names, +# group names, or ALL (always matches). The third field should be a list +# of one or more tty names (for non-networked logins), host names, domain +# names (begin with "."), host addresses, internet network numbers (end +# with "."), ALL (always matches) or LOCAL (matches any string that does +# not contain a "." character). If you run NIS you can use @netgroupname +# in host or user patterns. +# +# The EXCEPT operator makes it possible to write very compact rules. +# +# The group file is searched only when a name does not match that of the +# logged-in user. Only groups are matched in which users are explicitly +# listed: the program does not look at a user's primary group id value. +# +############################################################################## +# +# Disallow console logins to all but a few accounts. +# +#-:ALL EXCEPT wheel shutdown sync:console +# +# Disallow non-local logins to privileged accounts (group wheel). +# +#-:wheel:ALL EXCEPT LOCAL .win.tue.nl +# +# Some accounts are not allowed to login from anywhere: +# +#-:wsbscaro wsbsecr wsbspac wsbsym wscosor wstaiwde:ALL +# +# All other accounts are allowed to login from anywhere. +# From owner-svn-src-all@freebsd.org Wed May 22 08:30:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC66415A56DF; Wed, 22 May 2019 08:30:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C67873797; Wed, 22 May 2019 08:30:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 258DD1AD06; Wed, 22 May 2019 08:30:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4M8U478089727; Wed, 22 May 2019 08:30:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4M8U46a089726; Wed, 22 May 2019 08:30:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905220830.x4M8U46a089726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 22 May 2019 08:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348108 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 348108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C67873797 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 08:30:04 -0000 Author: avg Date: Wed May 22 08:30:03 2019 New Revision: 348108 URL: https://svnweb.freebsd.org/changeset/base/348108 Log: acpi_hpet: restore support for timers defined only in HPET table This fixes a regress introduced in r339754. After that change the code required that there is a HPET device in the ACPI namespace. The problem has been noticed on an PC Engines apu2 system. While here, fix a small formatting issue. Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed May 22 07:41:58 2019 (r348107) +++ head/sys/dev/acpica/acpi_hpet.c Wed May 22 08:30:03 2019 (r348108) @@ -455,9 +455,12 @@ hpet_probe(device_t dev) ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); if (acpi_disabled("hpet") || acpi_hpet_disabled) return (ENXIO); - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids, NULL); + if (acpi_get_handle(dev) != NULL) + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids, NULL); + else + rv = 0; if (rv <= 0) - device_set_desc(dev, "High Precision Event Timer"); + device_set_desc(dev, "High Precision Event Timer"); return (rv); } From owner-svn-src-all@freebsd.org Wed May 22 11:40:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7861915A8CF7; Wed, 22 May 2019 11:40:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C71A81351; Wed, 22 May 2019 11:40:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id q62so1762582ljq.7; Wed, 22 May 2019 04:40:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=HLtUwxY+E3uTFdbmdDz8sLBN02WZkNWNe5M2MMN5XJY=; b=ZrOonggtxOwD5K+NreLjuMMY/QkzAwFXzUGA+ALGdAfLipf/ghZrHhhD2FYu2JDmnZ rzr04AW14jeFaEo2ifuXCwwUrU8dNv8RdBN/EvIuHRrAVBt1Mn3Nz0SXkhYaQXXRNR5a oVMF49lWb5V3lfQ68sHCznw8lOYbh8TZMMiHA/NEr1ofD1t/hg7byXGaOWKzZRLquFDP xgqFu1qz0Mibmi5EAYI4qh7VRUEbyWvVRK2dMextHWtUNzgadPdXUnQazD5bXxi5+R4h R605JsIhvToacB1FuKQ6BWEbTF+Zt6Rbdh4KVvx9XCOMcjMls0AuPbAmt+DU2H4FBLC+ rogw== X-Gm-Message-State: APjAAAWOaLzpcCb8xbcvMLcc00Z9ivPhFHSa9ZL7TFqkQ+k05EZKZiHG U75RhG2ZFvciqwLg/OUgcWrPCU+Q X-Google-Smtp-Source: APXvYqwp56o3gPY+hzAuSrReczvG5spQWDUMF/QWlaSUdvHGIUa/idePZjFN2YcBFlZ3WtzwDXTyJw== X-Received: by 2002:a2e:9dc6:: with SMTP id x6mr23236430ljj.27.1558525231523; Wed, 22 May 2019 04:40:31 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id o18sm5140918lfb.61.2019.05.22.04.40.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 04:40:30 -0700 (PDT) Subject: Re: svn commit: r336547 - in head/etc: defaults rc.d To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807201359.w6KDxT1p087000@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <6b966875-23f5-28cf-9e65-7c30974eef05@FreeBSD.org> Date: Wed, 22 May 2019 14:40:29 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201807201359.w6KDxT1p087000@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5C71A81351 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.17 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.26)[ip: (-0.50), ipnet: 209.85.128.0/17(-3.47), asn: 15169(-2.27), country: US(-0.06)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.90)[-0.898,0]; RCVD_IN_DNSWL_NONE(0.00)[174.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 11:40:40 -0000 Something I've just noticed about this commit: On 20/07/2018 16:59, Ian Lepore wrote: > Author: ian > Date: Fri Jul 20 13:59:29 2018 > New Revision: 336547 > URL: https://svnweb.freebsd.org/changeset/base/336547 > > Log: > Automatically run ntpd as non-root when possible. [snip] > +ntpd_precmd() > +{ > + local driftopt > + > + # If we can run as a non-root user, switch uid to ntpd and use the > + # new default location for the driftfile inside the ntpd-owned dir. > + # Otherwise, figure out what to do about the driftfile option. If set > + # by the admin, we don't add the option. If the file exists in the old > + # default location we use that, else we use the new default location. > + if can_run_nonroot; then > + _user="ntpd" > + driftopt="-f ${_ntp_default_driftfile}" > + elif [ -z "${rc_flags##*-f*}" ] || > + [ -z "${rc_flags##*--driftfile*}" ] || It seems that the two checks above produce a false positive if rc_flags is empty already. And that's the case on a system that I recently brought up (very recent CURRENT via source install). /etc/defaults/rc.conf has ntpd_flags="". As a result ntpd is started without the drift file option. And the stock /etc/ntp.conf also does not have the directive. > + grep -q "^[ \t]*driftfile" "${ntpd_config}"; then > + driftopt="" # admin set the option, we don't need to add it. > + elif [ -f "${_ntp_old_driftfile}" ]; then > + driftopt="-f ${_ntp_old_driftfile}" > + else > + driftopt="-f ${_ntp_default_driftfile}" > fi -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed May 22 12:42:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A72DE15AB22D; Wed, 22 May 2019 12:42:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B80E483D13; Wed, 22 May 2019 12:42:34 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id p18so1353383qkk.0; Wed, 22 May 2019 05:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to; bh=ZpGT3Fq1B4qZ1a7PN+uQrqHrd7dZfr5Hn2A9AFmgBfU=; b=Fl/QEnLtLcSVVBYTQKfbsqVuffesAMrLZatwA35h3SKq/rt79mROEj2LCGKtTySMZU Jz9QOWEl+7Xl+g4iWrRyr42hGedBmaKLP8iBlGoZ9vb85cvpAsXKzKJyB/5yY7q8bUGe WJ9XfPyEDYnSYpte5Jwtjja8blftFG4tjrRBhJnxN6d2DGDouW7n09fjHPnAYFypBPMJ lq/lQMtTQItYtJsFAOyi9/JF4oIKCoMJ7P+LrgMDDc12v4P5JR6YEJ6VcEsuQOnoiLMn vWQq/uLct/U8BZ4fpQnlf38KvZy/wnf0A3niGxcPR5mX3AF42PtzF9WrIdzdll87d+Cv mM0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to; bh=ZpGT3Fq1B4qZ1a7PN+uQrqHrd7dZfr5Hn2A9AFmgBfU=; b=I3H0HoefJ+sMeP5B+A3W4OCrPksYo3ATRr97VuYnK5K26wCOuRHr04vextvlW3pDu7 kS1jt/7blJZBt0ciAinpPDBT2frLseLdAQP6XT0F2xQWwJuBAL8OfaufEwY4g7ojF/bu i6VDY24/L6kQgCob6M/DtMi7I2AC+U5WdHilYznCD0nUVJAFGRr81c7YM/xz6wjbCX1Z RSed5zef7gV3L2hCau8Qpc1g9hvgEfMABFvQhkp9uKUTO3AKt43JiB2PSbjAZ5Zox+Hr DRHCh8u5ngHgsj4YkWg3o/1uVXNLtGBfuvwWtEfV+S3iZK5OxmUEpnRnb7QWGGiuTcHA VBWQ== X-Gm-Message-State: APjAAAUmIEu1DNHymiYF9lTtzQ7XiRBxJvFDig4oVnUjf//9ZlUCnW3E OCCBeg9T+K6x9gJfJFkMbKrjAcEM X-Google-Smtp-Source: APXvYqxPtAm/jrGbfntsLDNvHR8wxiMOaqrW9i6Y/wXZR5iDhPc6Hw0sUpXBt0UGxXJd/n9avf6flw== X-Received: by 2002:a05:620a:1670:: with SMTP id d16mr1427380qko.288.1558528954024; Wed, 22 May 2019 05:42:34 -0700 (PDT) Received: from mbp-eth.home ([2804:f1c:800:fc00:643a:afe3:8082:5268]) by smtp.gmail.com with ESMTPSA id d58sm18255820qtb.11.2019.05.22.05.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 05:42:32 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r347961 - head To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905181936.x4IJaNir001183@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <47ad59b3-5adf-20bf-5dcc-23da82610cea@FreeBSD.org> Date: Wed, 22 May 2019 09:42:29 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905181936.x4IJaNir001183@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RexGqtS0a1CdPsbaAyA9Xn7PK6szj97j0" X-Rspamd-Queue-Id: B80E483D13 X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Fl/QEnLt; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-8.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[FreeBSD.org]; IP_SCORE(-2.99)[ip: (-9.35), ipnet: 2607:f8b0::/32(-3.26), asn: 15169(-2.27), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 12:42:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RexGqtS0a1CdPsbaAyA9Xn7PK6szj97j0 Content-Type: multipart/mixed; boundary="1V69Y7efo5iSUg3r6A3RGUEI8LRoFEXIr"; protected-headers="v1" From: Renato Botelho To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <47ad59b3-5adf-20bf-5dcc-23da82610cea@FreeBSD.org> Subject: Re: svn commit: r347961 - head References: <201905181936.x4IJaNir001183@repo.freebsd.org> In-Reply-To: <201905181936.x4IJaNir001183@repo.freebsd.org> --1V69Y7efo5iSUg3r6A3RGUEI8LRoFEXIr Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18/05/19 16:36, Brad Davis wrote: > Author: brd > Date: Sat May 18 19:36:23 2019 > New Revision: 347961 > URL: https://svnweb.freebsd.org/changeset/base/347961 >=20 > Log: > Add note to UPDATING for users of mergemaster after the move of maste= r.passwd > and group in r347638. > =20 > Approved by: allanjude (mentor) >=20 > Modified: > head/UPDATING >=20 > Modified: head/UPDATING > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/UPDATING Sat May 18 19:32:38 2019 (r347960) > +++ head/UPDATING Sat May 18 19:36:23 2019 (r347961) > @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > =20 > +20190517: > + For users of mergemaster, after recent changes to locations of > + master.passwd and group in the source tree mergemaster needs to be > + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster= > + and run `make install'. > + etcupdate is installing group and master.passwd to /lib/libc/gen. It seems wrong. root@x230:/usr/src # etcupdate -p A /lib/libc/gen/group A /lib/libc/gen/master.passwd --=20 Renato Botelho --1V69Y7efo5iSUg3r6A3RGUEI8LRoFEXIr-- --RexGqtS0a1CdPsbaAyA9Xn7PK6szj97j0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAlzlQ7ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 MTg4QjM0Q0FBQzlGQkM5Nzk5M0NCQjVCOUUwNEMzOTY2Qjg2MUEACgkQW54Ew5Zr hhqSWAf7BJ/1EpLKOmRNI1tzYp/Ea92DQxXtPkWTORWkLkg/w/dQ1L1c6Flu4ZAZ 18w20fcUoJU7MgrvEpFkR5yzk2EpWulQAJIMkkmHCXDl3ZJGto6Ilw3vSMiA3cqa loXRPsmyDUm3cDGTbKeAJuR861zCQJ5DEg/65Vrw4yaAJ1UB+55TGtY40whuJt80 o6R+w1oU3RhOKkNjst1hTmwT5rV6i3PFpy0KuZ8fV1qlPOPKw0rfsruXLBc5VdYL mHw2ssMKxdp7psUNPfaKwHJhkts4z9AqNepRv+vZFTs7B6whvE67F78OVu8fDRrb Bs3dPDYpcZRlUrftGyXiIngbIByf/w== =OJLu -----END PGP SIGNATURE----- --RexGqtS0a1CdPsbaAyA9Xn7PK6szj97j0-- From owner-svn-src-all@freebsd.org Wed May 22 12:48:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06FD815AB427; Wed, 22 May 2019 12:48:23 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BDAE84058; Wed, 22 May 2019 12:48:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 72B8D1334B; Wed, 22 May 2019 12:48:22 +0000 (UTC) Date: Wed, 22 May 2019 12:48:22 +0000 From: Alexey Dokuchaev To: Renato Botelho Cc: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347961 - head Message-ID: <20190522124822.GA99369@FreeBSD.org> References: <201905181936.x4IJaNir001183@repo.freebsd.org> <47ad59b3-5adf-20bf-5dcc-23da82610cea@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47ad59b3-5adf-20bf-5dcc-23da82610cea@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 9BDAE84058 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 12:48:23 -0000 On Wed, May 22, 2019 at 09:42:29AM -0300, Renato Botelho wrote: > On 18/05/19 16:36, Brad Davis wrote: > > New Revision: 347961 > > URL: https://svnweb.freebsd.org/changeset/base/347961 > > > > Log: > > Add note to UPDATING for users of mergemaster after the move of > > master.passwd and group in r347638. > > > > Approved by: allanjude (mentor) > > > > Modified: > > head/UPDATING > > > > +20190517: > > + For users of mergemaster, after recent changes to locations of > > + master.passwd and group in the source tree mergemaster needs to be > > + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster > > + and run `make install'. > > + > > etcupdate is installing group and master.passwd to /lib/libc/gen. It > seems wrong. > > root@x230:/usr/src # etcupdate -p > A /lib/libc/gen/group > A /lib/libc/gen/master.passwd *facepalm* Let me ask again: why these files were moved out of their perfectly (and likely the only) reasonable location (etc/) under some cryptic libc/gen/ which not only makes little sense per se, but also breaks mergemaster(8) and similar tools? ./danfe From owner-svn-src-all@freebsd.org Wed May 22 13:11:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89F3C15ABCF3; Wed, 22 May 2019 13:11:12 +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 1ACC785253; Wed, 22 May 2019 13:11:12 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id D258F19E94; Wed, 22 May 2019 13:11:10 +0000 (UTC) Subject: Re: svn commit: r348073 - head/lib/libmd To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905212303.x4LN3bMd081422@gndrsh.dnsmgr.net> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= mQINBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABtCJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+iQI/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6a5Ag0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAGJAiUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Message-ID: Date: Wed, 22 May 2019 09:11:06 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905212303.x4LN3bMd081422@gndrsh.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3BoRBk4dGJi2pjtPiUsIpwHBIUSXw6UF5" X-Rspamd-Queue-Id: 1ACC785253 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 13:11:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3BoRBk4dGJi2pjtPiUsIpwHBIUSXw6UF5 Content-Type: multipart/mixed; boundary="CXgCs5BHiKKJpNbRVX8o4ctM0P9GHf0JJ"; protected-headers="v1" From: Allan Jude To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r348073 - head/lib/libmd References: <201905212303.x4LN3bMd081422@gndrsh.dnsmgr.net> In-Reply-To: <201905212303.x4LN3bMd081422@gndrsh.dnsmgr.net> --CXgCs5BHiKKJpNbRVX8o4ctM0P9GHf0JJ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-05-21 19:03, Rodney W. Grimes wrote: >> Author: allanjude >> Date: Tue May 21 22:17:00 2019 >> New Revision: 348073 >> URL: https://svnweb.freebsd.org/changeset/base/348073 >> >> Log: >> Add admonitions against using MD5 and SHA1 to the API man pages >> >> Modified: >> head/lib/libmd/mdX.3 >> head/lib/libmd/sha.3 >> >> Modified: head/lib/libmd/mdX.3 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libmd/mdX.3 Tue May 21 22:11:53 2019 (r348072) >> +++ head/lib/libmd/mdX.3 Tue May 21 22:17:00 2019 (r348073) >> @@ -208,6 +208,8 @@ This code is derived directly from these implement= atio >> .Pp >> Phk ristede runen. >> .Sh BUGS >> -No method is known to exist which finds two files having the same has= h value, >> -nor to find a file with a specific hash value. >> -There is on the other hand no guarantee that such a method does not e= xist. >> +The >> +.Tn MD5 >=20 > There needs to be a discussion about .Tn, some people are ripping > them out of man pages, others are adding them. mandoc is a semantic > mark up language, .Tn gives the following word the semantic of being > a Tradename. >=20 > Yes, I know, mandoc ignroes them BUTT other tools do not, mandoc is > not the end all in what can process our man pages, groff/troff should > still be able to produce photo typesetter output and the .Tn's look > nice when you do that. >=20 > I would like to see that we stop removing them and infact, as this > man page does, properly recognize trademarks/names in our man pages > "as is often required by law." >=20 > Now, one final nit, I can neither verify nor deny that "MD5" is > a tradename. >=20 >> +algorithm has been proven to be vulnerable to practical collision >> +attacks and should not be relied upon to produce unique outputs, >> +.Em nor should they be used as part of a cryptographic signature sche= me. >> >> Modified: head/lib/libmd/sha.3 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libmd/sha.3 Tue May 21 22:11:53 2019 (r348072) >> +++ head/lib/libmd/sha.3 Tue May 21 22:17:00 2019 (r348073) >> @@ -191,9 +191,11 @@ published >> .Tn FIPS >> standards. >> .Sh BUGS >> -No method is known to exist which finds two files having the same has= h value, >> -nor to find a file with a specific hash value. >> -There is on the other hand no guarantee that such a method does not e= xist. >> +The >> +.Tn SHA1 >> +algorithm has been proven to be vulnerable to practical collision >> +attacks and should not be relied upon to produce unique outputs, >> +.Em nor should they be used as part of a cryptographic signature sche= me. >> .Pp >> The >> .Tn IA32 >> >> >=20 I borrowed the message (with .Tn markup) from the md5(1) man page, and just added it to the library reference man pages since they said 'No method is known to exist which finds two files having the same hash value' which has not been true in a while. I did not spend any effort deciding which markup to use there, as I don't think MD5 or SHA1 are tradenames, just acronyms. --=20 Allan Jude --CXgCs5BHiKKJpNbRVX8o4ctM0P9GHf0JJ-- --3BoRBk4dGJi2pjtPiUsIpwHBIUSXw6UF5 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.22 (MingW32) iQIcBAEBAgAGBQJc5UpuAAoJEBmVNT4SmAt+BfoP+wRmgomDHpFGbcqCufhkMuPD zm81SjiK3Yce9sYAHKDffejoOnPPoahMlcPCPLfL4Yr00TK41j1tnbALm3p67Jh0 mowaLUCmj4r1XvaYCeEWDVEzVOUXmenCo/KPC4aFuGnjJmlsP4bFPx2pCJi1QoTd kYgAYTG2N3VrkHDUneQV7WqmJh0+JVlJxwVoWigXTkjlRo/hATRroBhw45JFj8oo QzI7hl5X6ThglaluJAkpYEOQcPOBzMKCDScwqdZImYr2Hkf1BwpFSySmsf20zimA 5F33ebv7Wv2e8zBpI9wji58vr+CCtOUN4NnpXw29XRl6u+97z8jXBWxboocG92cJ 4JEt4zeI1Rprwphkn5SSes8WPb0FjWYe04tBLTsSKVFokMb05v3B0zp9Ofa4q8qI COGqABicQ+SH1qr0+43xeqc0HyHW2YmE/InOtj3nRYNKsffYs6GRUe2Cg63ET5RC 13YyLIHGo0mkn8XylyqsmqRC947tshoLc2M6mzzqZpDFqbyXbxrdCQrcFRqozbtt 48/tIZzFHz1GBUB++RTi99Fy7luon8On2WUy+jyqY43WzSze0lfoNe5LvfqXvtr6 +AQwotytelfpu6AwuMClRmzNXlyn6t05F9QxgvJhfEXaOYrb9eL5MJpK2s0LYZWU cMZRjGt1hH52XZRBlqzP =N3oy -----END PGP SIGNATURE----- --3BoRBk4dGJi2pjtPiUsIpwHBIUSXw6UF5-- From owner-svn-src-all@freebsd.org Wed May 22 13:44:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AC8315AC9F5; Wed, 22 May 2019 13:44:17 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E25B88662E; Wed, 22 May 2019 13:44:16 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB851E3DB; Wed, 22 May 2019 13:44:16 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MDiG2d056471; Wed, 22 May 2019 13:44:16 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MDiGGV056469; Wed, 22 May 2019 13:44:16 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201905221344.x4MDiGGV056469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 22 May 2019 13:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348109 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 348109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E25B88662E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 13:44:17 -0000 Author: gallatin Date: Wed May 22 13:44:15 2019 New Revision: 348109 URL: https://svnweb.freebsd.org/changeset/base/348109 Log: x86 MCA: introduce MCA hooks for different vendor implementations This is needed for AMD SMCA processors, as SMCA uses different MSR address for access MCA banks. Use IA32 specific msr_ops as defualt, and use SMCA-specific msr_ops when on an SMCA-enabled processor Submitted by: chandu from amd dot com Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D18055 Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/mca.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed May 22 08:30:03 2019 (r348108) +++ head/sys/x86/include/specialreg.h Wed May 22 13:44:15 2019 (r348109) @@ -944,6 +944,16 @@ #define MC_MISC_AMD_PTR_MASK 0x00000000ff000000 /* Pointer to additional registers */ #define MC_MISC_AMD_PTR_SHIFT 24 +/* AMD Scalable MCA */ +#define MSR_SMCA_MC0_CTL 0xc0002000 +#define MSR_SMCA_MC0_STATUS 0xc0002001 +#define MSR_SMCA_MC0_ADDR 0xc0002002 +#define MSR_SMCA_MC0_MISC0 0xc0002003 +#define MSR_SMCA_MC_CTL(x) (MSR_SMCA_MC0_CTL + 0x10 * (x)) +#define MSR_SMCA_MC_STATUS(x) (MSR_SMCA_MC0_STATUS + 0x10 * (x)) +#define MSR_SMCA_MC_ADDR(x) (MSR_SMCA_MC0_ADDR + 0x10 * (x)) +#define MSR_SMCA_MC_MISC(x) (MSR_SMCA_MC0_MISC0 + 0x10 * (x)) + /* * The following four 3-byte registers control the non-cacheable regions. * These registers must be written as three separate bytes. Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Wed May 22 08:30:03 2019 (r348108) +++ head/sys/x86/x86/mca.c Wed May 22 13:44:15 2019 (r348109) @@ -90,6 +90,13 @@ struct mca_internal { STAILQ_ENTRY(mca_internal) link; }; +struct mca_enumerator_ops { + unsigned int (*ctl)(int); + unsigned int (*status)(int); + unsigned int (*addr)(int); + unsigned int (*misc)(int); +}; + static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); static volatile int mca_count; /* Number of records stored. */ @@ -124,6 +131,61 @@ static struct taskqueue *mca_tq; static struct task mca_refill_task, mca_scan_task; static struct mtx mca_lock; +static unsigned int +mca_ia32_ctl_reg(int bank) +{ + return (MSR_MC_CTL(bank)); +} + +static unsigned int +mca_ia32_status_reg(int bank) +{ + return (MSR_MC_STATUS(bank)); +} + +static unsigned int +mca_ia32_addr_reg(int bank) +{ + return (MSR_MC_ADDR(bank)); +} + +static unsigned int +mca_ia32_misc_reg(int bank) +{ + return (MSR_MC_MISC(bank)); +} + +static unsigned int +mca_smca_ctl_reg(int bank) +{ + return (MSR_SMCA_MC_CTL(bank)); +} + +static unsigned int +mca_smca_status_reg(int bank) +{ + return (MSR_SMCA_MC_STATUS(bank)); +} + +static unsigned int +mca_smca_addr_reg(int bank) +{ + return (MSR_SMCA_MC_ADDR(bank)); +} + +static unsigned int +mca_smca_misc_reg(int bank) +{ + return (MSR_SMCA_MC_MISC(bank)); +} + +static struct mca_enumerator_ops mca_msr_ops = { + .ctl = mca_ia32_ctl_reg, + .status = mca_ia32_status_reg, + .addr = mca_ia32_addr_reg, + .misc = mca_ia32_misc_reg +}; + #ifdef DEV_APIC static struct cmc_state **cmc_state; /* Indexed by cpuid, bank. */ static struct amd_et_state **amd_et_state; /* Indexed by cpuid, bank. */ @@ -462,7 +524,7 @@ mca_check_status(int bank, struct mca_record *rec) uint64_t status; u_int p[4]; - status = rdmsr(MSR_MC_STATUS(bank)); + status = rdmsr(mca_msr_ops.status(bank)); if (!(status & MC_STATUS_VAL)) return (0); @@ -471,10 +533,10 @@ mca_check_status(int bank, struct mca_record *rec) rec->mr_bank = bank; rec->mr_addr = 0; if (status & MC_STATUS_ADDRV) - rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_addr = rdmsr(mca_msr_ops.addr(bank)); rec->mr_misc = 0; if (status & MC_STATUS_MISCV) - rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_misc = rdmsr(mca_msr_ops.misc(bank)); rec->mr_tsc = rdtsc(); rec->mr_apic_id = PCPU_GET(apic_id); rec->mr_mcg_cap = rdmsr(MSR_MCG_CAP); @@ -488,7 +550,7 @@ mca_check_status(int bank, struct mca_record *rec) * errors so that the BIOS can see them. */ if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); + wrmsr(mca_msr_ops.status(bank), 0); do_cpuid(0, p); } return (1); @@ -648,7 +710,7 @@ amd_thresholding_update(enum scan_mode mode, int bank, int count; cc = &amd_et_state[PCPU_GET(cpuid)][bank]; - misc = rdmsr(MSR_MC_MISC(bank)); + misc = rdmsr(mca_msr_ops.misc(bank)); count = (misc & MC_MISC_AMD_CNT_MASK) >> MC_MISC_AMD_CNT_SHIFT; count = count - (MC_MISC_AMD_CNT_MAX - cc->cur_threshold); @@ -660,7 +722,7 @@ amd_thresholding_update(enum scan_mode mode, int bank, misc |= (uint64_t)(MC_MISC_AMD_CNT_MAX - cc->cur_threshold) << MC_MISC_AMD_CNT_SHIFT; misc &= ~MC_MISC_AMD_OVERFLOW; - wrmsr(MSR_MC_MISC(bank), misc); + wrmsr(mca_msr_ops.misc(bank), misc); if (mode == CMCI && valid) cc->last_intr = time_uptime; } @@ -978,7 +1040,7 @@ amd_thresholding_start(struct amd_et_state *cc, int ba KASSERT(amd_elvt >= 0, ("ELVT offset is not set")); - misc = rdmsr(MSR_MC_MISC(bank)); + misc = rdmsr(mca_msr_ops.misc(bank)); misc &= ~MC_MISC_AMD_INT_MASK; misc |= MC_MISC_AMD_INT_LVT; @@ -993,7 +1055,7 @@ amd_thresholding_start(struct amd_et_state *cc, int ba misc &= ~MC_MISC_AMD_OVERFLOW; misc |= MC_MISC_AMD_CNTEN; - wrmsr(MSR_MC_MISC(bank), misc); + wrmsr(mca_msr_ops.misc(bank), misc); } static void @@ -1011,7 +1073,7 @@ amd_thresholding_monitor(int i) return; /* The counter must be valid and present. */ - misc = rdmsr(MSR_MC_MISC(i)); + misc = rdmsr(mca_msr_ops.misc(i)); if ((misc & (MC_MISC_AMD_VAL | MC_MISC_AMD_CNTP)) != (MC_MISC_AMD_VAL | MC_MISC_AMD_CNTP)) return; @@ -1119,6 +1181,12 @@ _mca_init(int boot) if ((mask & (1UL << 5)) == 0) wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); } + if (amd_rascap & AMDRAS_SCALABLE_MCA) { + mca_msr_ops.ctl = mca_smca_ctl_reg; + mca_msr_ops.status = mca_smca_status_reg; + mca_msr_ops.addr = mca_smca_addr_reg; + mca_msr_ops.misc = mca_smca_misc_reg; + } /* * The cmci_monitor() must not be executed @@ -1142,12 +1210,13 @@ _mca_init(int boot) skip = 1; } else if (cpu_vendor_id == CPU_VENDOR_AMD) { /* BKDG for Family 10h: unset GartTblWkEn. */ - if (i == MC_AMDNB_BANK && family >= 0xf) + if (i == MC_AMDNB_BANK && family >= 0xf && + family < 0x17) ctl &= ~(1UL << 10); } if (!skip) - wrmsr(MSR_MC_CTL(i), ctl); + wrmsr(mca_msr_ops.ctl(i), ctl); #ifdef DEV_APIC if (cmci_supported(mcg_cap)) { @@ -1164,7 +1233,7 @@ _mca_init(int boot) #endif /* Clear all errors. */ - wrmsr(MSR_MC_STATUS(i), 0); + wrmsr(mca_msr_ops.status(i), 0); } if (boot) mtx_unlock_spin(&mca_lock); From owner-svn-src-all@freebsd.org Wed May 22 15:10:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05FFA15AE10B; Wed, 22 May 2019 15:10:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB4B89DFA; Wed, 22 May 2019 15:10:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8DE971628A; Wed, 22 May 2019 15:10:28 +0000 (UTC) Date: Wed, 22 May 2019 15:10:28 +0000 From: Alexey Dokuchaev To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345815 - in head: lib/libcam sys/cam sys/cam/nvme Message-ID: <20190522151028.GA29205@FreeBSD.org> References: <201904021937.x32JbrRk067921@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904021937.x32JbrRk067921@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 9CB4B89DFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.89)[-0.890,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:10:29 -0000 On Tue, Apr 02, 2019 at 07:37:53PM +0000, Alexander Motin wrote: > New Revision: 345815 > URL: https://svnweb.freebsd.org/changeset/base/345815 > > Log: > Make cam_error_print() decode NVMe commands. > > Modified: head/sys/cam/nvme/nvme_xpt.c > ... > @@ -769,11 +769,13 @@ nvme_proto_debug_out(union ccb *ccb) > { > char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; > > - if (ccb->ccb_h.func_code != XPT_NVME_IO) > + if (ccb->ccb_h.func_code != XPT_NVME_IO || > + ccb->ccb_h.func_code != XPT_NVME_ADMIN) > return; PVS Studio complains that "Expression is always true. Probably the '&&' operator should be used here". Can you take a look? ./danfe From owner-svn-src-all@freebsd.org Wed May 22 15:11:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21F7C15AE188; Wed, 22 May 2019 15:11:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x134.google.com (mail-it1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F0E8A11A; Wed, 22 May 2019 15:11:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x134.google.com with SMTP id t184so4115188itf.2; Wed, 22 May 2019 08:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jmYyRyRUtdQaPcewqV8dUTpRK7hF3QR35AzpkB0zo/8=; b=lU3crDl6ABlm4wQmN3RmitNrBWe7oohiIVkSv17Tw3m6D4FghrV3ibrLC0ld6kkMrb pde9Zid69n8nJBa5NY00lTPN9x+jEQ3h54ceDMUzLDnwAga/d2BQXI0VN+6y2RNAkMBU zU5LYk+PelBqoqfx/qQGIvIkX4/zXwSPBboBpp+yugBmo9EPq1F6TZG71TnXHV0C5Iay uf0cOrxcnTCPFDYzbON+oLf2/ALNgaEA3wRMgsVkiiYkyj0zT+8VBBVKu7MNwBCPH6V9 SyJUG9Sv5GyCie/DxK3KEtslSdZ5Uzu+htm4/vJONx6ggnKxDIoj+ITnK6C3IVTvnxbS ICtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=jmYyRyRUtdQaPcewqV8dUTpRK7hF3QR35AzpkB0zo/8=; b=H5lSMsQaqfslodx9Woa2xIp+0ofm3w5LtPR6rSd/RdkY83ZJH2OmAQzreEnVF/6+tB MZ1c+20953DJy3WXN7XS7U1n+nFYIG6tg0Xk1aLHsoro/+HI/OZrcFG5Det+ZFbf5V6c h7FsNz4ufH/wLFQSVtr6GDNYdOtDUpohv/aP4OCl1eQEOqVGBBYWHeC3QEzvaGx4XIdA WdXDXXH73Yd1f8bxKGrZgKcyw+gjeQgh9+tph0WL9PN+dtUSI4NVAU5ooYC7dp0LrcDD EbDdI1MFw4OaXN8HWIeU6VtM1HjsEd9DU+1WZN9bHgHPFYxY/mY6YKk3JOlAZDN12bAK Kp/A== X-Gm-Message-State: APjAAAXuwK0RZottlsI5N1/gcKzEP0KLtC16sb553pmXrTKdlZmiGAFT ezKBxdX+xDG6GPhF8avI8Lx1W2Rq X-Google-Smtp-Source: APXvYqwqoPUlvuNu021HKpSrE8FZfi9r/LsimGnuQgH5XW7cCGwJZC8HlOp95y+VZfh+RiY7ifHXRw== X-Received: by 2002:a24:834b:: with SMTP id d72mr8310547ite.109.1558537879502; Wed, 22 May 2019 08:11:19 -0700 (PDT) Received: from spy (cs-auth-dc-129-97-60-193.dynamic.uwaterloo.ca. [129.97.60.193]) by smtp.gmail.com with ESMTPSA id d71sm3073380itc.18.2019.05.22.08.11.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2019 08:11:18 -0700 (PDT) Sender: Mark Johnston Date: Wed, 22 May 2019 11:11:16 -0400 From: Mark Johnston To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348090 - in head/libexec/bootpd: . bootpgw Message-ID: <20190522151116.GB5125@spy> References: <201905220413.x4M4DvBm057783@repo.freebsd.org> <201905220425.x4M4PNCB082699@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905220425.x4M4PNCB082699@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: B0F0E8A11A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:11:21 -0000 On Tue, May 21, 2019 at 09:25:23PM -0700, Rodney W. Grimes wrote: > > Author: markj > > Date: Wed May 22 04:13:57 2019 > > New Revision: 348090 > > URL: https://svnweb.freebsd.org/changeset/base/348090 > > > > Log: > > Marginally improve usage() message style in bootpd. > > > > - Remove an extra space after "usage:". > > - Avoid lines exceeding 80 columns. > > > > Based on notes from rgrimes. > > Thanks, but you missed an important aspect of those notes, > see inline below. > > > > > MFC with: r348066 > > Event: Waterloo Hackathon 2019 > > > > Modified: > > head/libexec/bootpd/bootpd.c > > head/libexec/bootpd/bootpgw/bootpgw.c > > > > Modified: head/libexec/bootpd/bootpd.c > > ============================================================================== > > --- head/libexec/bootpd/bootpd.c Wed May 22 04:10:24 2019 (r348089) > > +++ head/libexec/bootpd/bootpd.c Wed May 22 04:13:57 2019 (r348090) > > @@ -587,8 +587,8 @@ PRIVATE void > > usage() > > { > > fprintf(stderr, > > - "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > > - fprintf(stderr, " [bootptab [dumpfile]]\n"); > > + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname]\n" > > + " [-t timeout] [bootptab [dumpfile]]\n"); > > fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > > fprintf(stderr, "\t -c n\tset current directory\n"); > > fprintf(stderr, "\t -d n\tset debug level\n"); > > These 3 printf's are now miss aligned and contain a \t that should not be there: > there may be more, I am only look at what is in context here. > - fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > - fprintf(stderr, "\t -c n\tset current directory\n"); > - fprintf(stderr, "\t -d n\tset debug level\n"); > + fprintf(stderr, " -a\tdon't modify ARP table\n"); > + fprintf(stderr, " -c n\tset current directory\n"); > + fprintf(stderr, " -d n\tset debug level\n"); They were seemingly misaligned before too. Before: usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout] [bootptab [dumpfile]] -c n set current directory -d n set debug level -h n set the hostname to listen on -i force inetd mode (run as child of inetd) -s force standalone mode (run without inetd) -t n set inetd exit timeout to n minutes After: usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout] [bootptab [dumpfile]] -a don't modify ARP table -c n set current directory -d n set debug level -h n set the hostname to listen on -i force inetd mode (run as child of inetd) -s force standalone mode (run without inetd) -t n set inetd exit timeout to n minutes To be honest I have no desire to spend more time on bootpd than I already have. You are welcome to improve the usage formatting if you like. From owner-svn-src-all@freebsd.org Wed May 22 15:21:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BDD15AE5C5; Wed, 22 May 2019 15:21:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5173C8A727; Wed, 22 May 2019 15:21:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2694616663; Wed, 22 May 2019 15:21:24 +0000 (UTC) Date: Wed, 22 May 2019 15:21:24 +0000 From: Alexey Dokuchaev To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310524 - in head/sys/cam: ctl scsi Message-ID: <20190522152124.GA36423@FreeBSD.org> References: <201612241742.uBOHgYQp045291@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612241742.uBOHgYQp045291@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 5173C8A727 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.82)[-0.825,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:21:24 -0000 On Sat, Dec 24, 2016 at 05:42:34PM +0000, Alexander Motin wrote: > New Revision: 310524 > URL: https://svnweb.freebsd.org/changeset/base/310524 > > Log: > Improve length handling when writing sense data. > > - Allow maximal sense size limitation via Control Extension mode page. > - When sense size limited, include descriptors atomically: whole or none. > - Set new SDAT_OVFL bit if some descriptors don't fit the limit. > - Report real written sense length instead of static maximal 252 bytes. > > Modified: head/sys/cam/scsi/scsi_all.c > ... > break; > - case SSD_ELEM_DESC: > - default: > - > - /* > - * If the user passes in descriptor sense, > - * we can't handle that in fixed format. > - * So just skip it, and any unknown argument > - * types. > - */ > + } > + if (len > sizeof(sense->cmd_spec_info)) { > + data += len - sizeof(sense->cmd_spec_info); > + len -= len - sizeof(sense->cmd_spec_info); PVS Studio complains here: error: V765 A compound assignment expression 'x -= x - ...' is suspicious. Consider inspecting it for a possible error. This "len -= len - sizeof(...)" indeed looks weird, can you take a look? ./danfe From owner-svn-src-all@freebsd.org Wed May 22 15:25:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C30215AE8FC; Wed, 22 May 2019 15:25:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC38B8AB28; Wed, 22 May 2019 15:25:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C84FD1F510; Wed, 22 May 2019 15:25:10 +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 x4MFPAxU008773; Wed, 22 May 2019 15:25:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MFPARv008772; Wed, 22 May 2019 15:25:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905221525.x4MFPARv008772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 May 2019 15:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348110 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 348110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC38B8AB28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:25:11 -0000 Author: mav Date: Wed May 22 15:25:10 2019 New Revision: 348110 URL: https://svnweb.freebsd.org/changeset/base/348110 Log: Fix condition broken at r345815. Reported by: danfe MFC after: 3 days Modified: head/sys/cam/nvme/nvme_xpt.c Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Wed May 22 13:44:15 2019 (r348109) +++ head/sys/cam/nvme/nvme_xpt.c Wed May 22 15:25:10 2019 (r348110) @@ -769,7 +769,7 @@ nvme_proto_debug_out(union ccb *ccb) { char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; - if (ccb->ccb_h.func_code != XPT_NVME_IO || + if (ccb->ccb_h.func_code != XPT_NVME_IO && ccb->ccb_h.func_code != XPT_NVME_ADMIN) return; From owner-svn-src-all@freebsd.org Wed May 22 15:39:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DCAE15AED4D; Wed, 22 May 2019 15:39:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F05F8B21C; Wed, 22 May 2019 15:39:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0513C1F6B2; Wed, 22 May 2019 15:39:36 +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 x4MFdZDQ013932; Wed, 22 May 2019 15:39:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MFdZmm013931; Wed, 22 May 2019 15:39:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905221539.x4MFdZmm013931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 May 2019 15:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348111 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 348111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F05F8B21C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:39:36 -0000 Author: mav Date: Wed May 22 15:39:35 2019 New Revision: 348111 URL: https://svnweb.freebsd.org/changeset/base/348111 Log: Simplify math added in r310524. Should be no functional change. Reported by: danfe MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed May 22 15:25:10 2019 (r348110) +++ head/sys/cam/scsi/scsi_all.c Wed May 22 15:39:35 2019 (r348111) @@ -3943,7 +3943,7 @@ scsi_set_sense_data_fixed_va(struct scsi_sense_data *s } if (len > sizeof(sense->cmd_spec_info)) { data += len - sizeof(sense->cmd_spec_info); - len -= len - sizeof(sense->cmd_spec_info); + len = sizeof(sense->cmd_spec_info); } bcopy(data, &sense->cmd_spec_info[ sizeof(sense->cmd_spec_info) - len], len); From owner-svn-src-all@freebsd.org Wed May 22 15:39:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABF5D15AED87; Wed, 22 May 2019 15:39:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc30.google.com (mail-yw1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3811C8B343; Wed, 22 May 2019 15:39:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc30.google.com with SMTP id w21so1014650ywd.6; Wed, 22 May 2019 08:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=z50MBqQ/LytoXX4l1yIAwSRIhs+tDDFAeLu17NLBKgs=; b=mtyZyNvt+c2HjuPLLF3Tz0mQz2ERkmm0eSdFwnMCrHUOC7tOV9Qs+yKxct6LBjd67i kUI88gd2QLfzmMXuNIxFKVVwiI0ucUIjq7+nZxN5jYk7IgdLuRVpGJOZQehag+dPUJZ9 6TTwH7g3OqwcVl1Ahv7XKHISQ7nrMnwsXhpUUMhDmlAves9NIhWQSFLDats07qkOHotJ ytGY8uu5DyFJPxRt41mzUid8adn6/YCq6+NajXp25AT8NC7CHJGdbYyXbV8fYN2yPvUq xnNDnE5uLcb+meGLRg30R1oUjLuK3iHlOmBAR68WUEfc1t0VtdLmStz7vMgq4B3CK/Kz HUeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=z50MBqQ/LytoXX4l1yIAwSRIhs+tDDFAeLu17NLBKgs=; b=Ls7U0QTi2m9xt0tb3zChJQeZE21g01jLOZJzsDj2IfOoSUieFXeGv5DkHcRLUW1ufL nE/apAa/XyiXSVPiQlwgs7L5l5KFEp/kQnmZ/z5QRZLEbxo+TNiX2XrMYU0bugP7V3g5 Zyz70rRBxFXx7n8ADRp/xzPBWPU0hDWdeRQAsI9dN8hGpQO0kA168h1tAk03lLxyRUAY WaA1ndl7niVUuRC70owmsID2M1UvInJlhhtpSuJKHGiEPcRhad0yDMVIo1Wk2QkrGIc/ Hs/rwzmyp2CaCRaP+x5QjLY5NInS4Hj1bt08PIW9sYvd6VH9Y/aYxP8lUNsx0YThRKpX TU/w== X-Gm-Message-State: APjAAAWG8tZ3hEK/1PbrSpLJ9Ubx2r5le8NCUf9sT5w+NOpHzKL3XOtG LSMZWpLiKMr6M+/MjkzFdyLpTSIEAbo= X-Google-Smtp-Source: APXvYqxSzSZy4PbaRloix06l+3YA4l7GsmaQeIdQXiqCgt4W0bgn8dJAIhRdNCrDlffOG/Vem6Zwug== X-Received: by 2002:a81:5e8b:: with SMTP id s133mr4438935ywb.149.1558539597423; Wed, 22 May 2019 08:39:57 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id o76sm5221529ywd.49.2019.05.22.08.39.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 08:39:56 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r345815 - in head: lib/libcam sys/cam sys/cam/nvme To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904021937.x32JbrRk067921@repo.freebsd.org> <20190522151028.GA29205@FreeBSD.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <66c4b8cb-fca1-da79-fb35-86742e549e60@FreeBSD.org> Date: Wed, 22 May 2019 11:39:56 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190522151028.GA29205@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3811C8B343 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:39:58 -0000 On 22.05.2019 11:10, Alexey Dokuchaev wrote: > On Tue, Apr 02, 2019 at 07:37:53PM +0000, Alexander Motin wrote: >> New Revision: 345815 >> URL: https://svnweb.freebsd.org/changeset/base/345815 >> >> Log: >> Make cam_error_print() decode NVMe commands. >> >> Modified: head/sys/cam/nvme/nvme_xpt.c >> ... >> @@ -769,11 +769,13 @@ nvme_proto_debug_out(union ccb *ccb) >> { >> char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; >> >> - if (ccb->ccb_h.func_code != XPT_NVME_IO) >> + if (ccb->ccb_h.func_code != XPT_NVME_IO || >> + ccb->ccb_h.func_code != XPT_NVME_ADMIN) >> return; > > PVS Studio complains that "Expression is always true. Probably the '&&' > operator should be used here". Can you take a look? Fixed. Thank you. -- Alexander Motin From owner-svn-src-all@freebsd.org Wed May 22 15:40:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67EF515AEE19; Wed, 22 May 2019 15:40:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E69058B4CF; Wed, 22 May 2019 15:40:43 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc2b.google.com with SMTP id a130so999791ywe.13; Wed, 22 May 2019 08:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sR6ntA1/6v/Yn2B4oa1NdLrI1k9UcuJ4m0xdd7y2A5Y=; b=B5WkNK52FtKRNCljmA720qZO2PnS7Hb2n3LhN3OPkoHxB+EPyg853rGUaMfKWKJs1W m4V+clLLDtpY2iRQAAq0CS5kCMRixRkhCnwfzYuuYR2KDUKKrzVt5DO0LZwf1m1i3jj/ 1RCSi+5OQ65scatrwEt8uhGcy717EqSiNBAY81TB7x6M2HPLk5xFPAbqRp8jqNUMTQFc oiW8fa6nJOA8bNRWRAMhfkXBXndlLNWQYTwo42f87ei7ZM+TdCVg7NKRH8JnNNyWBB94 zYWI0MC9MKBinTT/bPOdjRaeV7aA236k4LWAZN84eWusb94BYmYUHTKpeQaz2jQLWBAO T5Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=sR6ntA1/6v/Yn2B4oa1NdLrI1k9UcuJ4m0xdd7y2A5Y=; b=sUQbj3qGte5i4cbI/+58IHGYyz5xKa/5IUQ0443m+TuxpkWTlGP/AMJu8hey8dC25I te4lb1eychk2/KxWXzFzCalJiD2YsV4cm+Poo0B91CB+e/bI6oEg+H0OVznI1kxj8TAi EWiTb/Z0pcEAyaAuISJW3gkbfzVU7zlNEHrjeqEyIa5O//6Y/ymgFsQfP+iIYaY1Wobb utY3OkDUqCI5s5ikMgff/O1a+a0uH1gSzVPKvNiI8zcfhX1Fa5hBYvK9Zu3sGT9RLbPO 2/9vzRL6jW4Fx0bHBdB3JAE2S2naXLRDWcCJrBSKwgv1/yPUOHe/K45h/hmyTLHqIKE2 5GlA== X-Gm-Message-State: APjAAAVdMYKvEtLH9o0EHTDQAHoaGK2KuktMn0KnE7agovdqZxo9/K3a Arg30VuSkpErEWVa8d34nMrlLkZ0lHc= X-Google-Smtp-Source: APXvYqwa/sJNx2nDA371sDwRDC7XH+d61LoHWEVjbTwBu+AYm+H9ysc2lG8I7KM6Tmf5AZIhAd0nrA== X-Received: by 2002:a81:5806:: with SMTP id m6mr40086868ywb.102.1558539643092; Wed, 22 May 2019 08:40:43 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id m3sm6539003ywf.39.2019.05.22.08.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 08:40:42 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r310524 - in head/sys/cam: ctl scsi To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201612241742.uBOHgYQp045291@repo.freebsd.org> <20190522152124.GA36423@FreeBSD.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <8fdc1e42-b8aa-3af1-27b3-f78c3918e7ea@FreeBSD.org> Date: Wed, 22 May 2019 11:40:42 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190522152124.GA36423@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E69058B4CF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:40:44 -0000 On 22.05.2019 11:21, Alexey Dokuchaev wrote: > On Sat, Dec 24, 2016 at 05:42:34PM +0000, Alexander Motin wrote: >> New Revision: 310524 >> URL: https://svnweb.freebsd.org/changeset/base/310524 >> >> Log: >> Improve length handling when writing sense data. >> >> - Allow maximal sense size limitation via Control Extension mode page. >> - When sense size limited, include descriptors atomically: whole or none. >> - Set new SDAT_OVFL bit if some descriptors don't fit the limit. >> - Report real written sense length instead of static maximal 252 bytes. >> >> Modified: head/sys/cam/scsi/scsi_all.c >> ... >> + } >> + if (len > sizeof(sense->cmd_spec_info)) { >> + data += len - sizeof(sense->cmd_spec_info); >> + len -= len - sizeof(sense->cmd_spec_info); > > PVS Studio complains here: error: V765 A compound assignment expression 'x > -= x - ...' is suspicious. Consider inspecting it for a possible error. > > This "len -= len - sizeof(...)" indeed looks weird, can you take a look? It may be weird, but not incorrect. Fixed though. -- Alexander Motin From owner-svn-src-all@freebsd.org Wed May 22 15:42:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED62F15AF02F; Wed, 22 May 2019 15:42:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D57F8B8C7; Wed, 22 May 2019 15:42:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 794B016F7C; Wed, 22 May 2019 15:42:34 +0000 (UTC) Date: Wed, 22 May 2019 15:42:34 +0000 From: Alexey Dokuchaev To: Alexander Motin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r310524 - in head/sys/cam: ctl scsi Message-ID: <20190522154234.GA55867@FreeBSD.org> References: <201612241742.uBOHgYQp045291@repo.freebsd.org> <20190522152124.GA36423@FreeBSD.org> <8fdc1e42-b8aa-3af1-27b3-f78c3918e7ea@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fdc1e42-b8aa-3af1-27b3-f78c3918e7ea@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 8D57F8B8C7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.905,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:42:35 -0000 On Wed, May 22, 2019 at 11:40:42AM -0400, Alexander Motin wrote: > On 22.05.2019 11:21, Alexey Dokuchaev wrote: > > On Sat, Dec 24, 2016 at 05:42:34PM +0000, Alexander Motin wrote: > >> New Revision: 310524 > >> URL: https://svnweb.freebsd.org/changeset/base/310524 > >> > >> Modified: head/sys/cam/scsi/scsi_all.c > >> ... > >> + } > >> + if (len > sizeof(sense->cmd_spec_info)) { > >> + data += len - sizeof(sense->cmd_spec_info); > >> + len -= len - sizeof(sense->cmd_spec_info); > > > > PVS Studio complains here: error: V765 A compound assignment expression 'x > > -= x - ...' is suspicious. Consider inspecting it for a possible error. > > > > This "len -= len - sizeof(...)" indeed looks weird, can you take a look? > > It may be weird, but not incorrect. Fixed though. Wow that was fast! Thanks (for both commits), ./danfe From owner-svn-src-all@freebsd.org Wed May 22 15:48:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731E115AF1CB; Wed, 22 May 2019 15:48:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 CC93F8BB58; Wed, 22 May 2019 15:48:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4MFmAZH085474; Wed, 22 May 2019 08:48:10 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4MFmAIF085473; Wed, 22 May 2019 08:48:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905221548.x4MFmAIF085473@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348090 - in head/libexec/bootpd: . bootpgw In-Reply-To: <20190522151116.GB5125@spy> To: Mark Johnston Date: Wed, 22 May 2019 08:48:10 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CC93F8BB58 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:48:14 -0000 > On Tue, May 21, 2019 at 09:25:23PM -0700, Rodney W. Grimes wrote: > > > Author: markj > > > Date: Wed May 22 04:13:57 2019 > > > New Revision: 348090 > > > URL: https://svnweb.freebsd.org/changeset/base/348090 > > > > > > Log: > > > Marginally improve usage() message style in bootpd. > > > > > > - Remove an extra space after "usage:". > > > - Avoid lines exceeding 80 columns. > > > > > > Based on notes from rgrimes. > > > > Thanks, but you missed an important aspect of those notes, > > see inline below. > > > > > > > > MFC with: r348066 > > > Event: Waterloo Hackathon 2019 > > > > > > Modified: > > > head/libexec/bootpd/bootpd.c > > > head/libexec/bootpd/bootpgw/bootpgw.c > > > > > > Modified: head/libexec/bootpd/bootpd.c > > > ============================================================================== > > > --- head/libexec/bootpd/bootpd.c Wed May 22 04:10:24 2019 (r348089) > > > +++ head/libexec/bootpd/bootpd.c Wed May 22 04:13:57 2019 (r348090) > > > @@ -587,8 +587,8 @@ PRIVATE void > > > usage() > > > { > > > fprintf(stderr, > > > - "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > > > - fprintf(stderr, " [bootptab [dumpfile]]\n"); > > > + "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname]\n" > > > + " [-t timeout] [bootptab [dumpfile]]\n"); > > > fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > > > fprintf(stderr, "\t -c n\tset current directory\n"); > > > fprintf(stderr, "\t -d n\tset debug level\n"); > > > > These 3 printf's are now miss aligned and contain a \t that should not be there: > > there may be more, I am only look at what is in context here. > > - fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > > - fprintf(stderr, "\t -c n\tset current directory\n"); > > - fprintf(stderr, "\t -d n\tset debug level\n"); > > + fprintf(stderr, " -a\tdon't modify ARP table\n"); > > + fprintf(stderr, " -c n\tset current directory\n"); > > + fprintf(stderr, " -d n\tset debug level\n"); > > They were seemingly misaligned before too. > > Before: > usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout] > [bootptab [dumpfile]] > -c n set current directory > -d n set debug level > -h n set the hostname to listen on > -i force inetd mode (run as child of inetd) > -s force standalone mode (run without inetd) > -t n set inetd exit timeout to n minutes > > After: > usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] > [-t timeout] [bootptab [dumpfile]] > -a don't modify ARP table > -c n set current directory > -d n set debug level > -h n set the hostname to listen on > -i force inetd mode (run as child of inetd) > -s force standalone mode (run without inetd) > -t n set inetd exit timeout to n minutes > > To be honest I have no desire to spend more time on bootpd than I > already have. You are welcome to improve the usage formatting if > you like. omg, really? Old "folke lore" You touched, you own it. If I didnt have to go through bde and/or phk I would of just gone and commited the clean up. I have handed you the diff. Perhaps a phab review before would of made this less painfull. And perhaps a phab review once an issue had been raised would of been really less painful. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed May 22 15:55:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0357E15AFC54 for ; Wed, 22 May 2019 15:55:30 +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 6DC668C675 for ; Wed, 22 May 2019 15:55:29 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1558540520; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=NTYcUTi/hpek4IB90tIo/m8+cqTaGKM8p2K6va2XL7+ywPQUXtfQhBeEYcfJ30WPEl65vOjMhLukQ U4vEX+FCHd7c1lP5bA0Fi8brz/s+60EwJ/WkaM15n8bXVkQKvtdEsDQnrfOcJiT5LsZc8HAMnS+Frp O0wDr5lIdzmPYcbDOmqOEWUKr1X+0JXjAqW2H7pgPKWJMAdJ0hVsBBohjKrMMJU2TYIODim76RGCfe Vq3AGkjTBlDAfHTjqVyLUoCgjfbq7BzCARRTkcEFDA42baBufXkHsH/aAbY5Qd3V2LRNSY+TjeGkBS CjeoqdTH9vDne9uy5Z6LNVwM1ckX68w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=gKnsbhQkIvCxNclI2m/oiLWsOQpjYVU2uFH0D1rHf3Y=; b=SP5Vv8OOQ8IH6NmiaZ5JcaAm8spMlfvmSe+BbbRcTINC5zl92VNv9nsr/yTCErVcy8PR509fliiWL EQEy3L7U+tCHGVD8JqOsilqpm4NcBEP5+MdKZDx2zr6e+AR6cV/P3Pj/YCOPXKo2P3YCvZnWO5SCUK SZDjtJDxkuzuZ0nx1eWSvMvKGqPvygASwxhS+xOCtmMnxMuKlZlWxzPr60kwGV0nZK4LHGjthtR0Ol LiGxJ4s5QwsdN0181eVWgkNTDf3QOppV7VCExiFOradGNmsMWBGwS9Q6ptTkUH5fAwXfecV4gN6NxI NQW1Lfu9m77pv9p5+y2ZY9YiNMXaEgw== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=gKnsbhQkIvCxNclI2m/oiLWsOQpjYVU2uFH0D1rHf3Y=; b=ozWtREdY3fV6K13Z1tYu6y74HOFDZSbMdROSCeOmEru6oO3dfHyf/aiPfiwLH+T2KmVOPevwgsBwK jLin/OXYLyui1g/Gwhl2RpZUQxfZ0UjhelY7m69FzSayw68YFCim5F9h904Z0xqLil3wMwM7lyY5nC hTIqqFPqkV1xhYlBtiS79RKm8oBhYT4TRkXdFdnYihoXh+Y6ZVH+z9GT8UhHHGwMaUcun3NDNKiXI6 xEzt0lA2FS+dteRVjARU0TBNMdH4Iwv7GPJ1Z2+DSc1cdbyReKF6+IMcy9zWKWur7v5I2K4CUmamOR VsmALaULWn3wxknjNDcP0J8ITb5yj+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: fd796119-7ca9-11e9-85c6-c97e5c048ed3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id fd796119-7ca9-11e9-85c6-c97e5c048ed3; Wed, 22 May 2019 15:55:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4MFtFZ3006056; Wed, 22 May 2019 09:55:15 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1d047fa8535df8688a21d17b3a869182df62c942.camel@freebsd.org> Subject: Re: svn commit: r348090 - in head/libexec/bootpd: . bootpgw From: Ian Lepore To: rgrimes@freebsd.org, Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 22 May 2019 09:55:15 -0600 In-Reply-To: <201905221548.x4MFmAIF085473@gndrsh.dnsmgr.net> References: <201905221548.x4MFmAIF085473@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6DC668C675 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:55:30 -0000 On Wed, 2019-05-22 at 08:48 -0700, Rodney W. Grimes wrote: > > On Tue, May 21, 2019 at 09:25:23PM -0700, Rodney W. Grimes wrote: > > > > Author: markj > > > > Date: Wed May 22 04:13:57 2019 > > > > New Revision: 348090 > > > > URL: https://svnweb.freebsd.org/changeset/base/348090 > > > > > > > > Log: > > > > Marginally improve usage() message style in bootpd. > > > > > > > > - Remove an extra space after "usage:". > > > > - Avoid lines exceeding 80 columns. > > > > > > > > Based on notes from rgrimes. > > > > > > Thanks, but you missed an important aspect of those notes, > > > see inline below. > > > > > > > > > > > MFC with: r348066 > > > > Event: Waterloo Hackathon 2019 > > > > > > > > Modified: > > > > head/libexec/bootpd/bootpd.c > > > > head/libexec/bootpd/bootpgw/bootpgw.c > > > > > > > > Modified: head/libexec/bootpd/bootpd.c > > > > =============================================================== > > > > =============== > > > > --- head/libexec/bootpd/bootpd.c Wed May 22 04:10:24 > > > > 2019 (r348089) > > > > +++ head/libexec/bootpd/bootpd.c Wed May 22 04:13:57 > > > > 2019 (r348090) > > > > @@ -587,8 +587,8 @@ PRIVATE void > > > > usage() > > > > { > > > > fprintf(stderr, > > > > - "usage: bootpd [-a] [-i | -s] [-c > > > > chdir-path] [-d level] [-h hostname] [-t timeout]\n"); > > > > - fprintf(stderr, " [bootptab > > > > [dumpfile]]\n"); > > > > + "usage: bootpd [-a] [-i | -s] [-c chdir-path] > > > > [-d level] [-h hostname]\n" > > > > + " [-t timeout] [bootptab > > > > [dumpfile]]\n"); > > > > fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > > > > fprintf(stderr, "\t -c n\tset current directory\n"); > > > > fprintf(stderr, "\t -d n\tset debug level\n"); > > > > > > These 3 printf's are now miss aligned and contain a \t that > > > should not be there: > > > there may be more, I am only look at what is in context here. > > > - fprintf(stderr, "\t -a\tdon't modify ARP table\n"); > > > - fprintf(stderr, "\t -c n\tset current directory\n"); > > > - fprintf(stderr, "\t -d n\tset debug level\n"); > > > + fprintf(stderr, " -a\tdon't modify ARP table\n"); > > > + fprintf(stderr, " -c n\tset current > > > directory\n"); > > > + fprintf(stderr, " -d n\tset debug level\n"); > > > > They were seemingly misaligned before too. > > > > Before: > > usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] > > [-t timeout] > > [bootptab [dumpfile]] > > -c n set current directory > > -d n set debug level > > -h n set the hostname to listen on > > -i force inetd mode (run as child of inetd) > > -s force standalone mode (run without inetd) > > -t n set inetd exit timeout to n minutes > > > > After: > > usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h > > hostname] > > [-t timeout] [bootptab [dumpfile]] > > -a don't modify ARP table > > -c n set current directory > > -d n set debug level > > -h n set the hostname to listen on > > -i force inetd mode (run as child of inetd) > > -s force standalone mode (run without inetd) > > -t n set inetd exit timeout to n minutes > > > > To be honest I have no desire to spend more time on bootpd than I > > already have. You are welcome to improve the usage formatting if > > you like. > > omg, really? Old "folke lore" You touched, you own it. > > If I didnt have to go through bde and/or phk I would of just gone > and commited the clean up. I have handed you the diff. > > Perhaps a phab review before would of made this less painfull. > And perhaps a phab review once an issue had been raised would > of been really less painful. > Or perhaps trying to browbeat someone into doing extensive changes when all they intended to do was a simple obvious thing is asking too much. You seem to expend quite a bit of energy in making perfect the enemy of better. The long term result of that is that either people will just habitually ignore your feedback, or they'll stop doing simple things to make the world better because they're tired of being told their work achieves less than perfection. -- Ian From owner-svn-src-all@freebsd.org Wed May 22 15:56:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A06C15AFD47; Wed, 22 May 2019 15:56:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E57F8C80B; Wed, 22 May 2019 15:56:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 141A11FA20; Wed, 22 May 2019 15:56:42 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MFufsZ024559; Wed, 22 May 2019 15:56:41 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MFufae024556; Wed, 22 May 2019 15:56:41 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201905221556.x4MFufae024556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 22 May 2019 15:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348112 - in head/sys: conf powerpc/aim powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/powerpc X-SVN-Commit-Revision: 348112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E57F8C80B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 15:56:42 -0000 Author: luporl Date: Wed May 22 15:56:41 2019 New Revision: 348112 URL: https://svnweb.freebsd.org/changeset/base/348112 Log: Fix PPC64 kernel build with clang8 + lld8 This patch fixes the following lld link errors: - unsupported dynamic relocations on read-only sections - out-of-range TOC references Submitted by: git_bdragon.rtk0.net Reviewed by: jhibbits, luporl MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19352 Modified: head/sys/conf/ldscript.powerpc64 head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/powerpc/cpu_subr64.S Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Wed May 22 15:39:35 2019 (r348111) +++ head/sys/conf/ldscript.powerpc64 Wed May 22 15:56:41 2019 (r348112) @@ -98,7 +98,8 @@ SECTIONS .opd : ALIGN(8) { KEEP (*(.opd)) } .branch_lt : ALIGN(8) { *(.branch_lt) } . = ALIGN(4096); - .got : ALIGN(8) { __tocbase = .; *(.got .toc) } + .got : ALIGN(8) { __tocbase = .; *(.got) } + .toc : ALIGN(8) { *(.toc) } .dynamic : { *(.dynamic) } :text :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Wed May 22 15:39:35 2019 (r348111) +++ head/sys/powerpc/aim/trap_subr64.S Wed May 22 15:56:41 2019 (r348112) @@ -317,29 +317,33 @@ CNAME(rstcode): * processor is waking up from power saving mode * It is software reset when 46:47 = 0b00 */ + /* 0x00 */ + ld %r2,TRAP_GENTRAP(0) /* Real-mode &generictrap */ mfsrr1 %r9 /* Load SRR1 into r9 */ andis. %r9,%r9,0x3 /* Logic AND with 46:47 bits */ + beq 2f /* Branch if software reset */ - bl 1f - .llong cpu_wakeup_handler + /* 0x10 */ + /* Reset was wakeup */ + addi %r9,%r2,(cpu_wakeup_handler-generictrap) + b 1f /* Was power save, do the wakeup */ - /* It is software reset */ - + /* Reset was software reset */ /* Explicitly set MSR[SF] */ 2: mfmsr %r9 li %r8,1 + /* 0x20 */ insrdi %r9,%r8,1,0 mtmsrd %r9 isync - bl 1f - .llong cpu_reset_handler /* Make sure to maintain 8-byte alignment */ + addi %r9,%r2,(cpu_reset_handler-generictrap) -1: mflr %r9 - ld %r9,0(%r9) - mtlr %r9 - - blr + /* 0x30 */ +1: mtlr %r9 + blr /* Branch to either cpu_reset_handler + * or cpu_wakeup_handler. + */ CNAME(rstcodeend): cpu_reset_handler: @@ -459,52 +463,59 @@ CNAME(hypertrapcode): addi %r1,%r1,(generichypertrap-generictrap) mtlr %r1 li %r1, 0xe0 /* How to get the vector from LR */ - blrl /* Branch to generictrap */ + blrl /* Branch to generichypertrap */ CNAME(hypertrapcodeend): /* * For SLB misses: do special things for the kernel * - * Note: SPRG1 is always safe to overwrite any time the MMU is on, which is + * Note: SPRG1 is always safe to overwrite any time the MMU was on, which is * the only time this can be called. */ .globl CNAME(slbtrap),CNAME(slbtrapend) .p2align 3 CNAME(slbtrap): + /* 0x00 */ mtsprg1 %r1 /* save SP */ GET_CPUINFO(%r1) - std %r2,(PC_SLBSAVE+16)(%r1) - mfcr %r2 /* save CR */ - std %r2,(PC_SLBSAVE+104)(%r1) + std %r2,(PC_SLBSAVE+16)(%r1) /* save r2 */ + mfcr %r2 + /* 0x10 */ + std %r2,(PC_SLBSAVE+104)(%r1) /* save CR */ mfsrr1 %r2 /* test kernel mode */ mtcr %r2 bf 17,2f /* branch if PSL_PR is false */ + /* 0x20 */ /* User mode */ - ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ - mtcr %r2 - ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2 */ - mflr %r1 /* Save the old LR in r1 */ - mtsprg2 %r1 /* And then in SPRG2 */ - /* 52 bytes so far */ - bl 1f - .llong generictrap -1: mflr %r1 - ld %r1,0(%r1) + ld %r2,(PC_SLBSAVE+104)(%r1) + mtcr %r2 /* restore CR */ + ld %r2,(PC_SLBSAVE+16)(%r1) /* restore r2 */ + mflr %r1 + /* 0x30 */ + mtsprg2 %r1 /* save LR in SPRG2 */ + ld %r1,TRAP_GENTRAP(0) /* real-mode &generictrap */ mtlr %r1 li %r1, 0x80 /* How to get the vector from LR */ + /* 0x40 */ blrl /* Branch to generictrap */ - /* 84 bytes */ 2: mflr %r2 /* Save the old LR in r2 */ - nop - bl 3f /* Begin dance to jump to kern_slbtrap*/ - .llong kern_slbtrap -3: mflr %r1 - ld %r1,0(%r1) + /* Kernel mode */ + ld %r1,TRAP_GENTRAP(0) /* Real-mode &generictrap */ + addi %r1,%r1,(kern_slbtrap-generictrap) + /* 0x50 */ mtlr %r1 GET_CPUINFO(%r1) - blrl /* 124 bytes -- 4 to spare */ + blrl /* Branch to kern_slbtrap */ +/* must fit in 128 bytes! */ CNAME(slbtrapend): +/* + * On entry: + * SPRG1: SP + * r1: pcpu + * r2: LR + * LR: branch address in trap region + */ kern_slbtrap: std %r2,(PC_SLBSAVE+136)(%r1) /* old LR */ std %r3,(PC_SLBSAVE+24)(%r1) /* save R3 */ @@ -512,7 +523,7 @@ kern_slbtrap: /* Check if this needs to be handled as a regular trap (userseg miss) */ mflr %r2 andi. %r2,%r2,0xff80 - cmpwi %r2,0x380 + cmpwi %r2,EXC_DSE bne 1f mfdar %r2 b 2f @@ -641,14 +652,8 @@ CNAME(alitrap): mflr %r28 /* save LR */ mfcr %r29 /* save CR */ - /* Begin dance to branch to s_trap in a bit */ - b 1f - .p2align 3 -1: nop - bl 1f - .llong s_trap -1: mflr %r31 - ld %r31,0(%r31) + ld %r31,TRAP_GENTRAP(0) + addi %r31,%r31,(s_trap - generictrap) mtlr %r31 /* Put our exception vector in SPRG3 */ @@ -658,7 +663,7 @@ CNAME(alitrap): /* Test whether we already had PR set */ mfsrr1 %r31 mtcr %r31 - blrl + blrl /* Branch to s_trap */ CNAME(aliend): /* @@ -681,12 +686,10 @@ CNAME(dsitrap): mfsrr1 %r31 /* test kernel mode */ mtcr %r31 mflr %r28 /* save LR (SP already saved) */ - bl 1f /* Begin branching to disitrap */ - .llong disitrap -1: mflr %r1 - ld %r1,0(%r1) + ld %r1,TRAP_GENTRAP(0) + addi %r1,%r1,(disitrap-generictrap) mtlr %r1 - blrl /* Branch to generictrap */ + blrl /* Branch to disitrap */ CNAME(dsiend): /* @@ -956,7 +959,7 @@ CNAME(dblow): mtlr %r1 li %r1, 0 /* How to get the vector from LR */ blrl /* Branch to generictrap */ - + /* No fallthrough */ 1: GET_CPUINFO(%r1) std %r27,(PC_DBSAVE+CPUSAVE_R27)(%r1) /* free r27 */ @@ -966,12 +969,9 @@ CNAME(dblow): std %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ std %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ - nop /* alignment */ - bl 9f /* Begin branch */ - .llong dbtrap -9: mflr %r1 - ld %r1,0(%r1) + ld %r1,TRAP_GENTRAP(0) + addi %r1,%r1,(dbtrap-generictrap) mtlr %r1 - blrl /* Branch to generictrap */ + blrl /* Branch to dbtrap */ CNAME(dbend): #endif /* KDB */ Modified: head/sys/powerpc/powerpc/cpu_subr64.S ============================================================================== --- head/sys/powerpc/powerpc/cpu_subr64.S Wed May 22 15:39:35 2019 (r348111) +++ head/sys/powerpc/powerpc/cpu_subr64.S Wed May 22 15:56:41 2019 (r348112) @@ -31,7 +31,6 @@ #include - .globl CNAME(power_save_sequence) .p2align 3 ENTRY(enter_idle_powerx) mfsprg0 %r3 /* Get the pcpu pointer */ @@ -65,11 +64,9 @@ ENTRY(enter_idle_powerx) std %r1,PCB_SP(%r3) /* Save the stack pointer */ std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ - /* Set where we want to jump */ bl 1f - .llong power_save_sequence /* Remember about 8 byte alignment */ 1: mflr %r3 - ld %r3,0(%r3) + addi %r3,%r3,power_save_sequence-1b mtsrr0 %r3 /* Set MSR */ @@ -82,7 +79,7 @@ ENTRY(enter_idle_powerx) rfid .p2align 2 -CNAME(power_save_sequence): +power_save_sequence: bl 1f .llong 0x0 /* Playground for power-save sequence */ 1: mflr %r3 From owner-svn-src-all@freebsd.org Wed May 22 16:20:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E67215B06A7; Wed, 22 May 2019 16:20:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3F8D8D5D9; Wed, 22 May 2019 16:20:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id B5A1317CAD; Wed, 22 May 2019 16:20:05 +0000 (UTC) Date: Wed, 22 May 2019 16:20:05 +0000 From: Alexey Dokuchaev To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r250609 - head/sys/dev/ath Message-ID: <20190522162005.GA82729@FreeBSD.org> References: <201305131903.r4DJ3DHm045333@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305131903.r4DJ3DHm045333@svn.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: C3F8D8D5D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:20:06 -0000 On Mon, May 13, 2013 at 07:03:13PM +0000, Adrian Chadd wrote: > New Revision: 250609 > URL: http://svnweb.freebsd.org/changeset/base/250609 > > Log: > Since the node state is 100% back under the TX lock, just kill the use > of atomics. > > Modified: > head/sys/dev/ath/if_ath.c > > @@ -6140,13 +6133,13 @@ ath_tx_update_tim(struct ath_softc *sc, > /* > * Don't bother grabbing the lock unless the queue is empty. > */ > - if (atomic_load_acq_int(&an->an_swq_depth) != 0) > + if (&an->an_swq_depth != 0) > return; > > if (an->an_is_powersave && > an->an_stack_psq == 0 && > an->an_tim_set == 1 && > - atomic_load_acq_int(&an->an_swq_depth) == 0) { > + an->an_swq_depth == 0) { PVS Studio complains here: warning: V560 A part of conditional expression is always true: an->an_swq_depth == 0. Which probably makes sense since you return earlier if it's != 0. ./danfe From owner-svn-src-all@freebsd.org Wed May 22 16:24:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B6915B0A2B; Wed, 22 May 2019 16:24:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF95F8DBD5; Wed, 22 May 2019 16:24:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 854DF1FF30; Wed, 22 May 2019 16:24:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MGOdYp039740; Wed, 22 May 2019 16:24:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MGOdwc039739; Wed, 22 May 2019 16:24:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905221624.x4MGOdwc039739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 May 2019 16:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348113 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF95F8DBD5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:24:40 -0000 Author: asomers Date: Wed May 22 16:24:39 2019 New Revision: 348113 URL: https://svnweb.freebsd.org/changeset/base/348113 Log: Update VFS_FHTOVP(9) with the flags argument Revison 222167 added a new argument to VFS_FHTOVP. This revision updates the man page to match. Reviewed by: rmacklem MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20323 Modified: head/share/man/man9/VFS_FHTOVP.9 Modified: head/share/man/man9/VFS_FHTOVP.9 ============================================================================== --- head/share/man/man9/VFS_FHTOVP.9 Wed May 22 15:56:41 2019 (r348112) +++ head/share/man/man9/VFS_FHTOVP.9 Wed May 22 16:24:39 2019 (r348113) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2010 +.Dd May 19, 2019 .Dt VFS_FHTOVP 9 .Os .Sh NAME @@ -39,18 +39,26 @@ .In sys/mount.h .In sys/vnode.h .Ft int -.Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "struct vnode **vpp" +.Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "int flags" "struct vnode **vpp" .Sh DESCRIPTION The .Fn VFS_FHTOVP macro is used by the NFS server to turn an NFS filehandle into a vnode. .Pp The arguments it expects are: -.Bl -tag -width vpp +.Bl -tag -width flags .It Fa mp The file system. .It Fa fhp The filehandle to convert. +.It Fa flags +Additional locking flags to pass through to +.Xr vget 9 . +File systems are allowed to ignore +.Ar flags +and use +.Dv LK_EXCLUSIVE +instead. .It Fa vpp Return parameter for the new locked vnode. .El From owner-svn-src-all@freebsd.org Wed May 22 16:34:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B8D15B0CC2 for ; Wed, 22 May 2019 16:34:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47AC68E0D7 for ; Wed, 22 May 2019 16:34:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1558542877; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=eGVD4eJ0vEOuVcVPInoGhTe1u0NJnbawFa5mQjiuyETobt40HUiUCTzzUkrrajbjdXrXqoWcNGgi8 oJSqciF3udT5uCN8gR/qsLX0utEPmYAivoMzcxVFmzVoER5hl3Tqtpz2etujpabanvKdl2ZCNqFBjY mP0JVtRqpi8mrPs1lFPnh6nwsTrOv191A3cOcsjc7eCTK2G7ASkKeaKGFgcg+lRlNb/AZN2GlwyssA MLTnBTy7s2vj8/28OmCcc78LU8xC8qoklIcey7jIIRNq9/ZjnIfkIT51gz4OHSKQxbu9pTvTbyiNhV MzpMnC6cqXIU8D3VhFHAd/QpGSY9NnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=OFYVDxmTS1Agp5uPaYVuBEM6pNwW3QOXB/ZgPplSxkQ=; b=nf9hcB0RaCzQo4it3kOedEDxhRiex5bc93vG2r89UVByzZoQ3lxovvuS3EXx+4PqOru5aPbCvvzrm Xzxk08IuCKp9YYIJpwwNUt50Pf8SxSTbnEpNeE75dUH7aKkmrVfzNsio0FSFyAlQwHNfcjT+FqValY vPTtmfu7mjn0kaBPCIuMP8ET1242ffT59osI7HAMgO3W2YHUISUpi4EnBGeYFNHnZ3TALrxCV/FO2V GdM8c6ti1MfGt4Uv8maV9ckqZvpcYQXOPjbp3HR8XCa7/raXQtC4BqvsCepP/NLPu0URMeq3PXmsBW 9ar4+AxHpyWPP6bUcezHtCM/7zn3Jtw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=OFYVDxmTS1Agp5uPaYVuBEM6pNwW3QOXB/ZgPplSxkQ=; b=p0Ia1r+BTaTM67+Rh/82P1NDSnize8UQ3ynFIxSoNaCH0D+psh8Eatih7OyFqWz2tsyijM7i4uEAL fNWoS0C0+SIGBrXnOmvg0vh9RczfYLt+EXjCBqBa/Qnm9KyupniK7Db9ENZRRd4EsVrO6ud8Ks8Avk FG8e3CyLOB7XuWI80nNyWsludyZW1uJhz7hew0nCYarTBEQq+t/ENhK7u3mQ6hXGZgbzO3Hj+WgNqB ExIIK9J6SD09yjuGb8ZN55y4ojOj25jb7HORlwSi7PODDaJwf3eQcgmuznfAgZpZQw9HgEu7RDMKHy COZYnHZm4BJTu4uUcX3ynOkm4p+yRWQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 7c0a3dbf-7caf-11e9-990f-673a89bc4518 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 7c0a3dbf-7caf-11e9-990f-673a89bc4518; Wed, 22 May 2019 16:34:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4MGYZad006203; Wed, 22 May 2019 10:34:35 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <953361717e24b2e3a6911940881f42dcd05736c0.camel@freebsd.org> Subject: Re: svn commit: r250609 - head/sys/dev/ath From: Ian Lepore To: Alexey Dokuchaev , Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 22 May 2019 10:34:35 -0600 In-Reply-To: <20190522162005.GA82729@FreeBSD.org> References: <201305131903.r4DJ3DHm045333@svn.freebsd.org> <20190522162005.GA82729@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47AC68E0D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:34:45 -0000 On Wed, 2019-05-22 at 16:20 +0000, Alexey Dokuchaev wrote: > On Mon, May 13, 2013 at 07:03:13PM +0000, Adrian Chadd wrote: > > New Revision: 250609 > > URL: http://svnweb.freebsd.org/changeset/base/250609 > > > > Log: > > Since the node state is 100% back under the TX lock, just kill > > the use > > of atomics. > > > > Modified: > > head/sys/dev/ath/if_ath.c > > > > @@ -6140,13 +6133,13 @@ ath_tx_update_tim(struct ath_softc *sc, > > /* > > * Don't bother grabbing the lock unless the queue is > > empty. > > */ > > - if (atomic_load_acq_int(&an->an_swq_depth) != 0) > > + if (&an->an_swq_depth != 0) > > return; > > > > if (an->an_is_powersave && > > an->an_stack_psq == 0 && > > an->an_tim_set == 1 && > > - atomic_load_acq_int(&an->an_swq_depth) == 0) { > > + an->an_swq_depth == 0) { > > PVS Studio complains here: warning: V560 A part of conditional > expression > is always true: an->an_swq_depth == 0. Which probably makes sense > since > you return earlier if it's != 0. > > ./danfe > You're replying to a six year old commit? It doesn't check earlier whether that value is 0, it checks whether the address of that value is 0. That's probably a bug. -- Ian From owner-svn-src-all@freebsd.org Wed May 22 16:36:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D890915B0D5C; Wed, 22 May 2019 16:36:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 761A08E250; Wed, 22 May 2019 16:36:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 67C2418258; Wed, 22 May 2019 16:36:12 +0000 (UTC) Date: Wed, 22 May 2019 16:36:12 +0000 From: Alexey Dokuchaev To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r244943 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 Message-ID: <20190522163612.GA4626@FreeBSD.org> References: <201301020038.r020c1fN074342@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201301020038.r020c1fN074342@svn.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 761A08E250 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:36:13 -0000 On Wed, Jan 02, 2013 at 12:38:01AM +0000, Adrian Chadd wrote: > New Revision: 244943 > URL: http://svnweb.freebsd.org/changeset/base/244943 > > Log: > Bring over the basic spectral scan framework code from Qualcomm Atheros. > > This includes the HAL routines to setup, enable/activate/disable spectral > scan and configure the relevant registers. > > Obtained from: Qualcomm Atheros > > Added: > head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c > > ... > + if (ss->ss_period != HAL_SPECTRAL_PARAM_NOVAL) { > + val &= ~AR_PHY_SPECTRAL_SCAN_PERIOD; > + val |= SM(ss->ss_period, AR_PHY_SPECTRAL_SCAN_PERIOD); > + } > + > + if (ss->ss_period != HAL_SPECTRAL_PARAM_NOVAL) { > + val &= ~AR_PHY_SPECTRAL_SCAN_PERIOD; > + val |= SM(ss->ss_period, AR_PHY_SPECTRAL_SCAN_PERIOD); > + } PVS Studio complains here: warning: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. ./danfe From owner-svn-src-all@freebsd.org Wed May 22 16:37:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A3FA15B0E11; Wed, 22 May 2019 16:37:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5468E3BE; Wed, 22 May 2019 16:37:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2D4F418385; Wed, 22 May 2019 16:37:53 +0000 (UTC) Date: Wed, 22 May 2019 16:37:53 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r250609 - head/sys/dev/ath Message-ID: <20190522163753.GA5149@FreeBSD.org> References: <201305131903.r4DJ3DHm045333@svn.freebsd.org> <20190522162005.GA82729@FreeBSD.org> <953361717e24b2e3a6911940881f42dcd05736c0.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <953361717e24b2e3a6911940881f42dcd05736c0.camel@freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 3D5468E3BE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:37:53 -0000 On Wed, May 22, 2019 at 10:34:35AM -0600, Ian Lepore wrote: > On Wed, 2019-05-22 at 16:20 +0000, Alexey Dokuchaev wrote: > > On Mon, May 13, 2013 at 07:03:13PM +0000, Adrian Chadd wrote: > > > New Revision: 250609 > > > URL: http://svnweb.freebsd.org/changeset/base/250609 > > > > > > Log: > > > Since the node state is 100% back under the TX lock, just kill > > > the use > > > of atomics. > > > > > > Modified: > > > head/sys/dev/ath/if_ath.c > > > > > > @@ -6140,13 +6133,13 @@ ath_tx_update_tim(struct ath_softc *sc, > > > /* > > > * Don't bother grabbing the lock unless the queue is > > > empty. > > > */ > > > - if (atomic_load_acq_int(&an->an_swq_depth) != 0) > > > + if (&an->an_swq_depth != 0) > > > return; > > > > > > if (an->an_is_powersave && > > > an->an_stack_psq == 0 && > > > an->an_tim_set == 1 && > > > - atomic_load_acq_int(&an->an_swq_depth) == 0) { > > > + an->an_swq_depth == 0) { > > > > PVS Studio complains here: warning: V560 A part of conditional > > expression > > is always true: an->an_swq_depth == 0. Which probably makes sense > > since > > you return earlier if it's != 0. > > You're replying to a six year old commit? Yeah, anything wrong with it? > It doesn't check earlier whether that value is 0, it checks whether the > address of that value is 0. That's probably a bug. No, the & is a vestige from the atomic_* conversion, it is not present in current code. The check is still there, however. ./danfe From owner-svn-src-all@freebsd.org Wed May 22 16:49:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF0715B1145; Wed, 22 May 2019 16:49:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6C88E912; Wed, 22 May 2019 16:49:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2f.google.com with SMTP id z4so2448935iol.0; Wed, 22 May 2019 09:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y5d/zsUdRPtDhcymNkvXKaVGvKryaTtYeA7AUlqbrGA=; b=XECWld8v6zMCO7YgGl53PK0E3A0xwCYH4hpYzhBpEd8FPOJ1AFncdMmJmoxflOg/d4 /7TqUt+JFs0Td+z6vuU7WBpl1PaGHPjc7hqi+459V/GfY32IjMlbDjNe3oaJr51p3+ST eqh9X7LxtHw2RXi3AT9bgfbZILEj5qL/2qqdIDGbC+q3pMeYadG91rhArrzViEUM5+uk aM1Oy/i6MZQpknMb7l+TCkOwxq8vqCW9zYoW3R0rMXE/Su0dMuCDg67R6LGe3qpgSSbD GvcgS658FHfGyyltoZr8ySILJKSREU8nxfE77vWC5mhYSABeWuqRne9guR+yQ9Noq4Ie 8ZFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Y5d/zsUdRPtDhcymNkvXKaVGvKryaTtYeA7AUlqbrGA=; b=al/GwAw0wiR76UoYqJyZ8RC3O3Vko4vcgv+XgBscp7b5f44UPd0MH5sNT1S7t01Ub3 8COt04HQvOqp5aVSS8kYSlhSYAea/5fUqgDbZZVz1ZEYjMYX7Zcc2sxldQlyKEf5KQMg wyOtRzWVQ6ufwb4Vd8FBCoaOZmSNdFxapKtbghiysbbm1pgojfUTS57J5tA7tJ7I24sR a2PTcNnDIM+pA8Ma9YiqdnM7FZR0E1HqMZfILFx3zgDaTvqNbi1fYHbhmzeIM9b3W+PM 0nSZZ5UOy5g4Yf2LvZUim/fAPi209JRGVrpVhxu8+Y6wNKTOKTT8FhtT6VCMp3MHmZgl S07g== X-Gm-Message-State: APjAAAWE36HeK5ByJZUG4nwfnYVvxvjn5ZkL0ppkL3SGdINnWiUOSXYC PPJSUfQt3+x6quHiLkH4Pp1c1vo3 X-Google-Smtp-Source: APXvYqwvtguJg8t6N4P3PqH2iwXwDNMjNi+vB7o9MNN0c+oVPIkS8okBlv9FWBiQUb1Ve6XjQu6WrA== X-Received: by 2002:a5e:8513:: with SMTP id i19mr30472602ioj.119.1558543761884; Wed, 22 May 2019 09:49:21 -0700 (PDT) Received: from spy (cs-auth-dc-129-97-60-193.dynamic.uwaterloo.ca. [129.97.60.193]) by smtp.gmail.com with ESMTPSA id y99sm3022842ita.23.2019.05.22.09.49.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2019 09:49:21 -0700 (PDT) Sender: Mark Johnston Date: Wed, 22 May 2019 12:49:19 -0400 From: Mark Johnston To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348090 - in head/libexec/bootpd: . bootpgw Message-ID: <20190522164919.GC5125@spy> References: <20190522151116.GB5125@spy> <201905221548.x4MFmAIF085473@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905221548.x4MFmAIF085473@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 1A6C88E912 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:49:23 -0000 On Wed, May 22, 2019 at 08:48:10AM -0700, Rodney W. Grimes wrote: > > On Tue, May 21, 2019 at 09:25:23PM -0700, Rodney W. Grimes wrote: > > To be honest I have no desire to spend more time on bootpd than I > > already have. You are welcome to improve the usage formatting if > > you like. > > omg, really? Old "folke lore" You touched, you own it. I own plenty of things already. > If I didnt have to go through bde and/or phk I would of just gone > and commited the clean up. Ok, that's something for you to figure out. > I have handed you the diff. > > Perhaps a phab review before would of made this less painfull. > And perhaps a phab review once an issue had been raised would > of been really less painful. There was a phab review for the original change, and I fixed an issue that was introduced by that change. I think that's sufficient. From owner-svn-src-all@freebsd.org Wed May 22 16:59:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F297E15B1667; Wed, 22 May 2019 16:59:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 977158F02B; Wed, 22 May 2019 16:59:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4CE2045B; Wed, 22 May 2019 16:59:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MGxN4p055454; Wed, 22 May 2019 16:59:23 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MGxNYN055453; Wed, 22 May 2019 16:59:23 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201905221659.x4MGxNYN055453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Wed, 22 May 2019 16:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348114 - head X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 977158F02B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 16:59:24 -0000 Author: zeising (doc,ports committer) Date: Wed May 22 16:59:22 2019 New Revision: 348114 URL: https://svnweb.freebsd.org/changeset/base/348114 Log: Fix ObsoleteFiles after ethernet driver removal Fix OpsoleteFiles.inc after removal of ethernet drivers. The drivers have manual pages, and manual pages are generally stored compressed, with a .gz suffix, but this is not reflected in ObsoleteFiles and make delete-old fails to remove them. Approved by: brooks Sponsored by: B3 Init Differential Revision: https://reviews.freebsd.org/D20351 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed May 22 16:24:39 2019 (r348113) +++ head/ObsoleteFiles.inc Wed May 22 16:59:22 2019 (r348114) @@ -39,31 +39,31 @@ # done # 20190517: Remove obsolete 10 and 10/100 ethernet drivers. -OLD_FILES+=usr/share/man/man4/bm.4 -OLD_FILES+=usr/share/man/man4/cs.4 -OLD_FILES+=usr/share/man/man4/de.4 -OLD_FILES+=usr/share/man/man4/if_de.4 -OLD_FILES+=usr/share/man/man4/ed.4 -OLD_FILES+=usr/share/man/man4/if_ed.4 -OLD_FILES+=usr/share/man/man4/ep.4 -OLD_FILES+=usr/share/man/man4/ex.4 -OLD_FILES+=usr/share/man/man4/fe.4 -OLD_FILES+=usr/share/man/man4/pcn.4 -OLD_FILES+=usr/share/man/man4/if_pcn.4 -OLD_FILES+=usr/share/man/man4/sf.4 -OLD_FILES+=usr/share/man/man4/if_sf.4 -OLD_FILES+=usr/share/man/man4/sn.4 -OLD_FILES+=usr/share/man/man4/if_sn.4 -OLD_FILES+=usr/share/man/man4/tl.4 -OLD_FILES+=usr/share/man/man4/if_tl.4 -OLD_FILES+=usr/share/man/man4/tx.4 -OLD_FILES+=usr/share/man/man4/if_tx.4 -OLD_FILES+=usr/share/man/man4/txp.4 -OLD_FILES+=usr/share/man/man4/if_txp.4 -OLD_FILES+=usr/share/man/man4/vx.4 -OLD_FILES+=usr/share/man/man4/wb.4 -OLD_FILES+=usr/share/man/man4/xe.4 -OLD_FILES+=usr/share/man/man4/if_xe.4 +OLD_FILES+=usr/share/man/man4/bm.4.gz +OLD_FILES+=usr/share/man/man4/cs.4.gz +OLD_FILES+=usr/share/man/man4/de.4.gz +OLD_FILES+=usr/share/man/man4/if_de.4.gz +OLD_FILES+=usr/share/man/man4/ed.4.gz +OLD_FILES+=usr/share/man/man4/if_ed.4.gz +OLD_FILES+=usr/share/man/man4/ep.4.gz +OLD_FILES+=usr/share/man/man4/ex.4.gz +OLD_FILES+=usr/share/man/man4/fe.4.gz +OLD_FILES+=usr/share/man/man4/pcn.4.gz +OLD_FILES+=usr/share/man/man4/if_pcn.4.gz +OLD_FILES+=usr/share/man/man4/sf.4.gz +OLD_FILES+=usr/share/man/man4/if_sf.4.gz +OLD_FILES+=usr/share/man/man4/sn.4.gz +OLD_FILES+=usr/share/man/man4/if_sn.4.gz +OLD_FILES+=usr/share/man/man4/tl.4.gz +OLD_FILES+=usr/share/man/man4/if_tl.4.gz +OLD_FILES+=usr/share/man/man4/tx.4.gz +OLD_FILES+=usr/share/man/man4/if_tx.4.gz +OLD_FILES+=usr/share/man/man4/txp.4.gz +OLD_FILES+=usr/share/man/man4/if_txp.4.gz +OLD_FILES+=usr/share/man/man4/vx.4.gz +OLD_FILES+=usr/share/man/man4/wb.4.gz +OLD_FILES+=usr/share/man/man4/xe.4.gz +OLD_FILES+=usr/share/man/man4/if_xe.4.gz # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. From owner-svn-src-all@freebsd.org Wed May 22 17:40:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B5A415B2FC9; Wed, 22 May 2019 17:40:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6B6A9091C; Wed, 22 May 2019 17:40:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E33020B4E; Wed, 22 May 2019 17:40:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MHesHw077013; Wed, 22 May 2019 17:40:54 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MHesJW077012; Wed, 22 May 2019 17:40:54 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905221740.x4MHesJW077012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Wed, 22 May 2019 17:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348115 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6B6A9091C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 17:40:55 -0000 Author: dougm Date: Wed May 22 17:40:54 2019 New Revision: 348115 URL: https://svnweb.freebsd.org/changeset/base/348115 Log: Passing a parameter to vm_map_entry_resize_free that describes the amount of resizing reduces the number of functions changing the vm_map invariants regarding the max_free field of map entries. Reviewed by: markj (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20356 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 22 16:59:22 2019 (r348114) +++ head/sys/vm/vm_map.c Wed May 22 17:40:54 2019 (r348115) @@ -1251,7 +1251,7 @@ vm_map_entry_unlink(vm_map_t map, * The map must be locked, and leaves it so. */ static void -vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t entry) +vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t entry, size_t grow_amount) { vm_map_entry_t llist, rlist, root; @@ -1262,11 +1262,12 @@ vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t ("vm_map_entry_resize_free: resize_free object not mapped")); vm_map_splay_findnext(root, &rlist); root->right = NULL; + entry->end += grow_amount; map->root = vm_map_splay_merge(root, llist, rlist, root->left, root->right); VM_MAP_ASSERT_CONSISTENT(map); - CTR3(KTR_VM, "vm_map_entry_resize_free: map %p, nentries %d, entry %p", map, - map->nentries, entry); + CTR3(KTR_VM, "vm_map_entry_resize_free: map %p, nentries %d, entry %p", + map, map->nentries, entry); } /* @@ -1486,8 +1487,8 @@ charged: prev_entry)); if ((prev_entry->eflags & MAP_ENTRY_GUARD) == 0) map->size += end - prev_entry->end; - prev_entry->end = end; - vm_map_entry_resize_free(map, prev_entry); + vm_map_entry_resize_free(map, prev_entry, + end - prev_entry->end); vm_map_simplify_entry(map, prev_entry); return (KERN_SUCCESS); } @@ -4314,7 +4315,7 @@ retry: } else { MPASS(gap_entry->start < gap_entry->end - grow_amount); gap_entry->end -= grow_amount; - vm_map_entry_resize_free(map, gap_entry); + vm_map_entry_resize_free(map, gap_entry, -grow_amount); gap_deleted = false; } rv = vm_map_insert(map, NULL, 0, grow_start, @@ -4327,10 +4328,9 @@ retry: gap_end, VM_PROT_NONE, VM_PROT_NONE, MAP_CREATE_GUARD | MAP_CREATE_STACK_GAP_DN); MPASS(rv1 == KERN_SUCCESS); - } else { - gap_entry->end += grow_amount; - vm_map_entry_resize_free(map, gap_entry); - } + } else + vm_map_entry_resize_free(map, gap_entry, + grow_amount); } } else { grow_start = stack_entry->end; @@ -4349,9 +4349,8 @@ retry: vm_map_entry_delete(map, gap_entry); else gap_entry->start += grow_amount; - stack_entry->end += grow_amount; map->size += grow_amount; - vm_map_entry_resize_free(map, stack_entry); + vm_map_entry_resize_free(map, stack_entry, grow_amount); rv = KERN_SUCCESS; } else rv = KERN_FAILURE; From owner-svn-src-all@freebsd.org Wed May 22 17:42:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 022FC15B3243; Wed, 22 May 2019 17:42:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F71290D92; Wed, 22 May 2019 17:42:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D5720CC7; Wed, 22 May 2019 17:42:23 +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 x4MHgN5q081073; Wed, 22 May 2019 17:42:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MHgNjK081072; Wed, 22 May 2019 17:42:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905221742.x4MHgNjK081072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 22 May 2019 17:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348116 - in stable/12: lib/libomp tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12: lib/libomp tools/build/mk X-SVN-Commit-Revision: 348116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F71290D92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 17:42:24 -0000 Author: dim Date: Wed May 22 17:42:22 2019 New Revision: 348116 URL: https://svnweb.freebsd.org/changeset/base/348116 Log: MFC r347978: Fix OptionalObsoleteFiles copy/paste mistake from r345236, which connected libomp to the build. The comparison should not have been against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously. MFC r347979: To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC does not ship a -lomp symlink. Also update OptionalObsoleteFiles for this, and add 32-bit variants while here. Submitted by: jbeich PR: 237975 Modified: stable/12/lib/libomp/Makefile stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libomp/Makefile ============================================================================== --- stable/12/lib/libomp/Makefile Wed May 22 17:40:54 2019 (r348115) +++ stable/12/lib/libomp/Makefile Wed May 22 17:42:22 2019 (r348116) @@ -68,4 +68,6 @@ VERSION_MAP= ${OMPSRC}/exports_so.txt LIBADD+= pthread LIBADD+= m +SYMLINKS+= ${SHLIB_NAME} ${LIBDIR}/libgomp.so + .include Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed May 22 17:40:54 2019 (r348115) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed May 22 17:42:22 2019 (r348116) @@ -2739,12 +2739,16 @@ OLD_FILES+=usr/include/omp.h .endif OLD_FILES+=usr/lib/libgcov.a OLD_FILES+=usr/lib/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib/libgomp.so +.endif OLD_LIBS+=usr/lib/libgomp.so.1 OLD_FILES+=usr/lib/libgomp_p.a OLD_FILES+=usr/lib32/libgcov.a OLD_FILES+=usr/lib32/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib32/libgomp.so +.endif OLD_LIBS+=usr/lib32/libgomp.so.1 OLD_FILES+=usr/lib32/libgomp_p.a OLD_FILES+=usr/libexec/cc1 @@ -7193,11 +7197,14 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz OLD_FILES+=usr/share/man/man8/ntptime.8.gz .endif -.if ${MK_OPENSSH} == no +.if ${MK_OPENMP} == no .if ${MK_GCC} == no OLD_FILES+=usr/include/omp.h +OLD_LIBS+=usr/lib/libgomp.so +OLD_LIBS+=usr/lib32/libgomp.so .endif OLD_LIBS+=usr/lib/libomp.so +OLD_LIBS+=usr/lib32/libomp.so .endif .if ${MK_OPENSSH} == no From owner-svn-src-all@freebsd.org Wed May 22 18:06:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E68A15B3BEB; Wed, 22 May 2019 18:06:01 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60AE391C95; Wed, 22 May 2019 18:06:00 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f46.google.com with SMTP id c17so2394729lfi.2; Wed, 22 May 2019 11:06:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=aSH3gpOzyygIRBq1AQTfexx6/3vze+bj5jdXTWx5Qv8=; b=i4ywK6vpfy5ZGQhzz0jZAFOODBRNPgrfI8/qNqMJWdIDbTDZmBjldlucKSpKUtzTVa I7dY9fI4L1lTTwkpUDi7IPThUL5G5Up9vB08HLLy2OFPOiq4gfG0dqhiD1Ef8r6gi1aV rmnO77tFeeRipu+xYml6REoc+ddE8HR1mh+JJuNwksP9qt5aQYB6JZ9op4pBVaZxZ9Kq 0MZa+me5jAuSQDY9Qj0coGLAlHiTtvF7xYthIo8gQeGcdVbgFmQqIEEpMMRArFCoE1qo wBhlPbGxy82phjlseQBdsFunO9iKt0bFI7xBuVua74YH+I3riMT63Pn7/X+oYXr40lYJ Vm4g== X-Gm-Message-State: APjAAAXaaiMwPsNwtNidbWb2xHUI1zJCtrkJ2Xn7nMO4y1A5CW3RlHKj tlIf16lqHz1oW96/uJZO/OJIhYq0 X-Google-Smtp-Source: APXvYqxkhfbg7PKSHWdPl1BJGRzWcTkykbAFbGl+ZBrn5vBSNcIiQHkhPBoJuFt/GRWfp1qr98hLiw== X-Received: by 2002:a19:c20e:: with SMTP id l14mr378114lfc.5.1558545001829; Wed, 22 May 2019 10:10:01 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a25sm5499023lfc.28.2019.05.22.10.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 10:10:00 -0700 (PDT) Subject: Re: svn commit: r348109 - in head/sys/x86: include x86 To: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905221344.x4MDiGGV056469@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> Date: Wed, 22 May 2019 20:09:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201905221344.x4MDiGGV056469@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 60AE391C95 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 18:06:01 -0000 On 22/05/2019 16:44, Andrew Gallatin wrote: > This is needed for AMD SMCA processors, as SMCA uses different > MSR address for access MCA banks. Just curious, what is SMCA? -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed May 22 18:43:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 605B615B48E0; Wed, 22 May 2019 18:43:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED3FF93054; Wed, 22 May 2019 18:43:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C712521716; Wed, 22 May 2019 18:43:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MIhmAT012838; Wed, 22 May 2019 18:43:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MIhmh1012837; Wed, 22 May 2019 18:43:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905221843.x4MIhmh1012837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 May 2019 18:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED3FF93054 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 18:43:49 -0000 Author: mav Date: Wed May 22 18:43:48 2019 New Revision: 348117 URL: https://svnweb.freebsd.org/changeset/base/348117 Log: Allocate buffers smaller then ABD chunk size as linear. This allows to reduce memory waste by letting UMA to put multiple small buffers into one memory page slab. The page sharing means that UMA may not be able to free memory page when some of buffers are freed, but alternatively memory used by that buffer would just be wasted from the beginning. This change follows alike change in ZoL, but unlike Linux (according to my understanding of it from comments) FreeBSD never shares slabs bigger then one memory page, so this should be even less invasive then there. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 17:42:22 2019 (r348116) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 18:43:48 2019 (r348117) @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) abd_t * abd_alloc(size_t size, boolean_t is_metadata) { - if (!zfs_abd_scatter_enabled) + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) return (abd_alloc_linear(size, is_metadata)); VERIFY3U(size, <=, SPA_MAXBLOCKSIZE); From owner-svn-src-all@freebsd.org Wed May 22 19:18:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 421DC15B518C; Wed, 22 May 2019 19:18:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6BEA9422D; Wed, 22 May 2019 19:18:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f173.google.com with SMTP id g24so5192390iti.5; Wed, 22 May 2019 12:18: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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=w1vP32h/tsy3+a1r63ikP9RHtnUJVthhBDds06CkFvM=; b=bcOGHP/Lnv3npZpn5mBCq8tqL1ULclaHdBanvatIPGRUDpa216ldvd9ivJRDr3WN+O acz2HpJTxjXIKOwQbbNi2nq8vMbxkVp699F2GsajHWsi6HsLPUHZYJCRsP4BuknZ08Xf 9ks3zXf5McQzr+cl7YTUo1jmzm20+8keEyF8tTx3RKAo0DpEafvmE5T3C3AZnarGUT1o OlTnsFtv9LupYrEy4332rZEUnf1LEmIHidcNF1kWZ1uXXq0Rl8XdgO2d1tCZk55OhWdm +zLYGZKlZ46KvLvStbB4G0B9Xs6nlt4qWgsj5s6Ruambm/MfiuUrF8uKEUayge7B6Nh0 ledA== X-Gm-Message-State: APjAAAV+vGw/3y5bkR1QJagKgCFvRuee+pJQcK7D6rKrZHPYjTmVUCzx NNQrKuJsmm+mJ3hI8OHTiwhJadfO X-Google-Smtp-Source: APXvYqyRynb+bJD5xSTtz1K8dnhoaFTLMHlRtlH5AyCpQFcfJnJ7+b7wnTVoQJCG7rleU0zwPU4oVA== X-Received: by 2002:a24:ac49:: with SMTP id m9mr10561471iti.174.1558552361082; Wed, 22 May 2019 12:12:41 -0700 (PDT) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com. [209.85.166.45]) by smtp.gmail.com with ESMTPSA id e22sm8206178ioe.45.2019.05.22.12.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 12:12:40 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id q21so2760936iog.13; Wed, 22 May 2019 12:12:40 -0700 (PDT) X-Received: by 2002:a6b:c411:: with SMTP id y17mr18796171ioa.265.1558552360073; Wed, 22 May 2019 12:12:40 -0700 (PDT) MIME-Version: 1.0 References: <201905221344.x4MDiGGV056469@repo.freebsd.org> <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> In-Reply-To: <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 22 May 2019 12:12:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348109 - in head/sys/x86: include x86 To: Andriy Gapon Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C6BEA9422D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:18:20 -0000 On Wed, May 22, 2019 at 11:06 AM Andriy Gapon wrote: > > On 22/05/2019 16:44, Andrew Gallatin wrote: > > This is needed for AMD SMCA processors, as SMCA uses different > > MSR address for access MCA banks. > > Just curious, what is SMCA? Scalable MCA. It's a set of AMD Fam17h MCA extensions. Best, Conrad From owner-svn-src-all@freebsd.org Wed May 22 19:39:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F27B915B5A19; Wed, 22 May 2019 19:39:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C4C795271; Wed, 22 May 2019 19:39:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64C7C21FAB; Wed, 22 May 2019 19:39:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MJdu4H039747; Wed, 22 May 2019 19:39:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MJduJa039745; Wed, 22 May 2019 19:39:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905221939.x4MJduJa039745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 22 May 2019 19:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348118 - in stable/11: lib/libomp tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: lib/libomp tools/build/mk X-SVN-Commit-Revision: 348118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C4C795271 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:39:57 -0000 Author: dim Date: Wed May 22 19:39:55 2019 New Revision: 348118 URL: https://svnweb.freebsd.org/changeset/base/348118 Log: MFC r347978: Fix OptionalObsoleteFiles copy/paste mistake from r345236, which connected libomp to the build. The comparison should not have been against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously. MFC r347979: To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC does not ship a -lomp symlink. Also update OptionalObsoleteFiles for this, and add 32-bit variants while here. Approved by: re (gjb) Submitted by: jbeich PR: 237975 Modified: stable/11/lib/libomp/Makefile stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libomp/Makefile ============================================================================== --- stable/11/lib/libomp/Makefile Wed May 22 18:43:48 2019 (r348117) +++ stable/11/lib/libomp/Makefile Wed May 22 19:39:55 2019 (r348118) @@ -68,4 +68,6 @@ VERSION_MAP= ${OMPSRC}/exports_so.txt LIBADD+= pthread LIBADD+= m +SYMLINKS+= ${SHLIB_NAME} ${LIBDIR}/libgomp.so + .include Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed May 22 18:43:48 2019 (r348117) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed May 22 19:39:55 2019 (r348118) @@ -2434,12 +2434,16 @@ OLD_FILES+=usr/include/omp.h .endif OLD_FILES+=usr/lib/libgcov.a OLD_FILES+=usr/lib/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib/libgomp.so +.endif OLD_LIBS+=usr/lib/libgomp.so.1 OLD_FILES+=usr/lib/libgomp_p.a OLD_FILES+=usr/lib32/libgcov.a OLD_FILES+=usr/lib32/libgomp.a +.if ${MK_OPENMP} == no OLD_FILES+=usr/lib32/libgomp.so +.endif OLD_LIBS+=usr/lib32/libgomp.so.1 OLD_FILES+=usr/lib32/libgomp_p.a OLD_FILES+=usr/libexec/cc1 @@ -6847,11 +6851,14 @@ OLD_FILES+=usr/share/man/man8/ntpq.8.gz OLD_FILES+=usr/share/man/man8/ntptime.8.gz .endif -.if ${MK_OPENSSH} == no +.if ${MK_OPENMP} == no .if ${MK_GCC} == no OLD_FILES+=usr/include/omp.h +OLD_LIBS+=usr/lib/libgomp.so +OLD_LIBS+=usr/lib32/libgomp.so .endif OLD_LIBS+=usr/lib/libomp.so +OLD_LIBS+=usr/lib32/libomp.so .endif .if ${MK_OPENSSH} == no From owner-svn-src-all@freebsd.org Wed May 22 19:49:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845F515B5D91; Wed, 22 May 2019 19:49:19 +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 1704B95AB0; Wed, 22 May 2019 19:49:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1hTXEh-0005e0-10; Wed, 22 May 2019 22:49:15 +0300 Date: Wed, 22 May 2019 22:49:14 +0300 From: Slawa Olhovchenkov To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190522194914.GF47119@zxy.spb.ru> References: <201905221843.x4MIhmh1012837@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905221843.x4MIhmh1012837@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-Rspamd-Queue-Id: 1704B95AB0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:49:19 -0000 On Wed, May 22, 2019 at 06:43:48PM +0000, Alexander Motin wrote: > Author: mav > Date: Wed May 22 18:43:48 2019 > New Revision: 348117 > URL: https://svnweb.freebsd.org/changeset/base/348117 > > Log: > Allocate buffers smaller then ABD chunk size as linear. > > This allows to reduce memory waste by letting UMA to put multiple small > buffers into one memory page slab. The page sharing means that UMA > may not be able to free memory page when some of buffers are freed, but > alternatively memory used by that buffer would just be wasted from the > beginning. > > This change follows alike change in ZoL, but unlike Linux (according to > my understanding of it from comments) FreeBSD never shares slabs bigger > then one memory page, so this should be even less invasive then there. > > MFC after: 2 weeks > Sponsored by: iXsystems, Inc. > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 17:42:22 2019 (r348116) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 18:43:48 2019 (r348117) > @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) > abd_t * > abd_alloc(size_t size, boolean_t is_metadata) > { > - if (!zfs_abd_scatter_enabled) > + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) > return (abd_alloc_linear(size, is_metadata)); may be `size < zfs_abd_chunk_size`? > VERIFY3U(size, <=, SPA_MAXBLOCKSIZE); > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Wed May 22 19:56:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B49415B5FF7; Wed, 22 May 2019 19:56:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0DBD96120; Wed, 22 May 2019 19:56:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C940C1456C; Wed, 22 May 2019 19:56:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347961 - head To: Alexey Dokuchaev , Renato Botelho Cc: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905181936.x4IJaNir001183@repo.freebsd.org> <47ad59b3-5adf-20bf-5dcc-23da82610cea@FreeBSD.org> <20190522124822.GA99369@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 22 May 2019 12:56:26 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190522124822.GA99369@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A0DBD96120 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:56:30 -0000 On 5/22/19 5:48 AM, Alexey Dokuchaev wrote: > On Wed, May 22, 2019 at 09:42:29AM -0300, Renato Botelho wrote: >> On 18/05/19 16:36, Brad Davis wrote: >>> New Revision: 347961 >>> URL: https://svnweb.freebsd.org/changeset/base/347961 >>> >>> Log: >>> Add note to UPDATING for users of mergemaster after the move of >>> master.passwd and group in r347638. >>> >>> Approved by: allanjude (mentor) >>> >>> Modified: >>> head/UPDATING >>> >>> +20190517: >>> + For users of mergemaster, after recent changes to locations of >>> + master.passwd and group in the source tree mergemaster needs to be >>> + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster >>> + and run `make install'. >>> + >> >> etcupdate is installing group and master.passwd to /lib/libc/gen. It >> seems wrong. >> >> root@x230:/usr/src # etcupdate -p >> A /lib/libc/gen/group >> A /lib/libc/gen/master.passwd > > *facepalm* > > Let me ask again: why these files were moved out of their perfectly > (and likely the only) reasonable location (etc/) under some cryptic > libc/gen/ which not only makes little sense per se, but also breaks > mergemaster(8) and similar tools? Because bmake doesn't support .PATH? Oh wait... -- John Baldwin From owner-svn-src-all@freebsd.org Wed May 22 19:59:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E7315B6099; Wed, 22 May 2019 19:59:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BE249634E; Wed, 22 May 2019 19:59:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id ECC191456D; Wed, 22 May 2019 19:59:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348109 - in head/sys/x86: include x86 To: cem@freebsd.org, Andriy Gapon Cc: src-committers , svn-src-all , svn-src-head References: <201905221344.x4MDiGGV056469@repo.freebsd.org> <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <32532943-6b1a-71cc-1d95-f180927eb187@FreeBSD.org> Date: Wed, 22 May 2019 12:59:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8BE249634E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 19:59:21 -0000 On 5/22/19 12:12 PM, Conrad Meyer wrote: > On Wed, May 22, 2019 at 11:06 AM Andriy Gapon wrote: >> >> On 22/05/2019 16:44, Andrew Gallatin wrote: >>> This is needed for AMD SMCA processors, as SMCA uses different >>> MSR address for access MCA banks. >> >> Just curious, what is SMCA? > > Scalable MCA. It's a set of AMD Fam17h MCA extensions. How is it different aside from using different MSR numbers (which seems a bit gratuitous if that is really all the change is). -- John Baldwin From owner-svn-src-all@freebsd.org Wed May 22 20:01:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6890715B62A1; Wed, 22 May 2019 20:01:01 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E88D7966AF; Wed, 22 May 2019 20:01:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb43.google.com with SMTP id a3so1349371ybr.6; Wed, 22 May 2019 13:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G6npryVKK5D7IkZfTDykEfevA4OCojq3SvA97yern14=; b=VjACRsXVLdoFFxt++Qo0NdURv5sd4iYnOU5FArRARHa/a8qGe2Xk91j0rbbhjx+et5 DMC+7HoVnxA48WunKQP4DKwd2sjE9hoIvnDzjDGXwybKieZPn2cf8EIfkDtAoU0uNZCl KehC/lpKTsbVSwNjNlTaOKdWVVFLy5KkgnYrOcMyfHs3548SMjgsAGOLVBFjuGTED6UC xyaiAKsHXxdQVFpM1qaKoQmM2icgaAiDRIH1Y2h85z9TrRbWz5xCO2NYwCJXTZexczGi +AVa9YrrjKh69jfTz68ba/jqPH7Z7oSjzuAl11dwF5+Rk4aW8dyX/EyeMlsegE8toB1e VAhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=G6npryVKK5D7IkZfTDykEfevA4OCojq3SvA97yern14=; b=B72RIkqeCfKO3WdmmWPlJHlhB0DIdAzXTz8J6NKbMVS0H4oxS3eiQ9vVVgTamDb/ba 4weIFrd6jablXDmdiyXLVaBMrSbH4h+5AowQOEJ8gxa4jpwBTEkPxvextBXmsQ4jtTKh mjgd9zh2HKzm7wr1j9IJBHUxvvDGcAyl/OkinL5g/mUR4TvCnWrBbILfFSuH7dgFST4B qfBtUeE2+/oa0WZmgY2judZc7w1HH6lYbpCVKPNetW4Zw8Cha6zLwIiRDcbXmPYGcBLO Gzww0SqQOfxrazEBhpBbORiMm5xRiioLyQFa094a7ruA00T+fVkyKj4fSLsF9J2I8OGE 2DzQ== X-Gm-Message-State: APjAAAWkx0beuqvc+ucy7oZ1PmtXAi/5ND5PMud3Bq12rUNVsBPDkpal YFFB/LqNVMf119XtmwSsHjbJbajpGJs= X-Google-Smtp-Source: APXvYqyZqfcTubcWrLtyh8o+uhVcN2J1UiHl6YFjoznvKAvTCcLIxLaePKFZhYfIi5X2FDy9Kt9PMw== X-Received: by 2002:a25:f506:: with SMTP id a6mr11738898ybe.33.1558555259937; Wed, 22 May 2019 13:00:59 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id a69sm1253054ywa.84.2019.05.22.13.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 13:00:59 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r348117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905221843.x4MIhmh1012837@repo.freebsd.org> <20190522194914.GF47119@zxy.spb.ru> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <4766287e-283a-775d-9e8e-4d0442d802f3@FreeBSD.org> Date: Wed, 22 May 2019 16:00:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190522194914.GF47119@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E88D7966AF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 20:01:01 -0000 On 22.05.2019 15:49, Slawa Olhovchenkov wrote: > On Wed, May 22, 2019 at 06:43:48PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Wed May 22 18:43:48 2019 >> New Revision: 348117 >> URL: https://svnweb.freebsd.org/changeset/base/348117 >> >> Log: >> Allocate buffers smaller then ABD chunk size as linear. >> >> This allows to reduce memory waste by letting UMA to put multiple small >> buffers into one memory page slab. The page sharing means that UMA >> may not be able to free memory page when some of buffers are freed, but >> alternatively memory used by that buffer would just be wasted from the >> beginning. >> >> This change follows alike change in ZoL, but unlike Linux (according to >> my understanding of it from comments) FreeBSD never shares slabs bigger >> then one memory page, so this should be even less invasive then there. >> >> MFC after: 2 weeks >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 17:42:22 2019 (r348116) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 18:43:48 2019 (r348117) >> @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) >> abd_t * >> abd_alloc(size_t size, boolean_t is_metadata) >> { >> - if (!zfs_abd_scatter_enabled) >> + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) >> return (abd_alloc_linear(size, is_metadata)); > > may be `size < zfs_abd_chunk_size`? Why? It should be the same from memory usage, but I see theoretical benefits from having linear buffer with one page rather then scatter list with one page. Plus ZoL also had there `size <= PAGESIZE`. -- Alexander Motin From owner-svn-src-all@freebsd.org Wed May 22 20:34:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC56915B6AAD; Wed, 22 May 2019 20:34:26 +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 6DF00976CD; Wed, 22 May 2019 20:34:26 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1hTXwO-0005vI-PJ; Wed, 22 May 2019 23:34:24 +0300 Date: Wed, 22 May 2019 23:34:24 +0300 From: Slawa Olhovchenkov To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190522203424.GC2161@zxy.spb.ru> References: <201905221843.x4MIhmh1012837@repo.freebsd.org> <20190522194914.GF47119@zxy.spb.ru> <4766287e-283a-775d-9e8e-4d0442d802f3@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4766287e-283a-775d-9e8e-4d0442d802f3@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-Rspamd-Queue-Id: 6DF00976CD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.944,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 20:34:27 -0000 On Wed, May 22, 2019 at 04:00:58PM -0400, Alexander Motin wrote: > On 22.05.2019 15:49, Slawa Olhovchenkov wrote: > > On Wed, May 22, 2019 at 06:43:48PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Wed May 22 18:43:48 2019 > >> New Revision: 348117 > >> URL: https://svnweb.freebsd.org/changeset/base/348117 > >> > >> Log: > >> Allocate buffers smaller then ABD chunk size as linear. > >> > >> This allows to reduce memory waste by letting UMA to put multiple small > >> buffers into one memory page slab. The page sharing means that UMA > >> may not be able to free memory page when some of buffers are freed, but > >> alternatively memory used by that buffer would just be wasted from the > >> beginning. > >> > >> This change follows alike change in ZoL, but unlike Linux (according to > >> my understanding of it from comments) FreeBSD never shares slabs bigger > >> then one memory page, so this should be even less invasive then there. > >> > >> MFC after: 2 weeks > >> Sponsored by: iXsystems, Inc. > >> > >> Modified: > >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c > >> > >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c > >> ============================================================================== > >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 17:42:22 2019 (r348116) > >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 18:43:48 2019 (r348117) > >> @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) > >> abd_t * > >> abd_alloc(size_t size, boolean_t is_metadata) > >> { > >> - if (!zfs_abd_scatter_enabled) > >> + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) > >> return (abd_alloc_linear(size, is_metadata)); > > > > may be `size < zfs_abd_chunk_size`? > > Why? It should be the same from memory usage, but I see theoretical > benefits from having linear buffer with one page rather then scatter > list with one page. Plus ZoL also had there `size <= PAGESIZE`. May be malloc() for page size more effictive? Not sure. Less overhead for kegs and etc. From owner-svn-src-all@freebsd.org Wed May 22 20:48:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E944915B6D63; Wed, 22 May 2019 20:48:36 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 581D497E75; Wed, 22 May 2019 20:48:36 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb42.google.com with SMTP id a21so1391337ybg.9; Wed, 22 May 2019 13:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ps08Je2LxRAAc2g1TRftceYXyGVuoaLm+xsAB1n7sdg=; b=j0Nkg9+mCMjgCxX/AIm0bv0xuNFDTW1U/1gV3UWsXg6pHC4KzeQInVW/JAAnxzLWso zcZ/m4F5Zmh5j2o3v8F61faZ3Qbj81jj+9v1FqR5oi/SNBOFSj+xGQ8CRzXMayW3cC/U 67qGjetTqv5t8S38SR8d+sgHKd5jjNpt+trVKO1pk1UJg4E9F7jevbrZb8B2kqeuTf03 LTXYLrbkeVB4hjPnAWbrYNOHX3XvrHVb7fMpyX8/G3fvQrjCnEMNOAcqiFr/o/s4EVIY x/MsCoDcmZLZX65z+lpsLNC7HGp+yh634rO+NBd25lOkKHq6LQjfsboZ6lVGbKNdaDWx 9Zow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ps08Je2LxRAAc2g1TRftceYXyGVuoaLm+xsAB1n7sdg=; b=pQavRIE7kIWFfOBCEuFI52+lOSno25hRk7idkAUboAcBEk5gMukp6IOuvqKyAwSDfL gnOdMWUpb5hFpn7mLH9wZ00t9A+/6QBAwEug+10Hr3mcxTra0R65pzulGt3tJz/LOwcO HWYGgJ1zpc7Ahmj+SksuHjDsUrRgtnxuRREccJctGrIWIN/4QwxSXY1cj2UiXTPQftau rBd2UuV9HUVHhRDbzoxEFfBfkrjSv67USrrrRbFWJsHav8KaMmg5BWZWnI9yxOht6oC9 F/+/WD2ZCGni0J9vPMFfRY67ootpTMA2zCDFSYUuExfwd5WT3ZkKHK8KrqmXEeo6sIgE Pv3Q== X-Gm-Message-State: APjAAAUqrCuhRC8el/Lo0GEa+zEuSmjU8Z0k0NNdmPqa1HHYWCBV4Tql Xc5pk3LmSgAkjIg53RgnuuDF0tO6Ixc= X-Google-Smtp-Source: APXvYqy1W+7CbARV/X5bmqWHfXn6fJo7K0oUqA/oIKerznl6tIWbpcc48RYsP0HKK2cN6U/6vjalTw== X-Received: by 2002:a25:7642:: with SMTP id r63mr11058504ybc.253.1558558115236; Wed, 22 May 2019 13:48:35 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id o1sm5288711ywo.79.2019.05.22.13.48.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 13:48:34 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r348117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905221843.x4MIhmh1012837@repo.freebsd.org> <20190522194914.GF47119@zxy.spb.ru> <4766287e-283a-775d-9e8e-4d0442d802f3@FreeBSD.org> <20190522203424.GC2161@zxy.spb.ru> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: Date: Wed, 22 May 2019 16:48:34 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190522203424.GC2161@zxy.spb.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 581D497E75 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 20:48:37 -0000 On 22.05.2019 16:34, Slawa Olhovchenkov wrote: > On Wed, May 22, 2019 at 04:00:58PM -0400, Alexander Motin wrote: > >> On 22.05.2019 15:49, Slawa Olhovchenkov wrote: >>> On Wed, May 22, 2019 at 06:43:48PM +0000, Alexander Motin wrote: >>>> Author: mav >>>> Date: Wed May 22 18:43:48 2019 >>>> New Revision: 348117 >>>> URL: https://svnweb.freebsd.org/changeset/base/348117 >>>> >>>> Log: >>>> Allocate buffers smaller then ABD chunk size as linear. >>>> >>>> This allows to reduce memory waste by letting UMA to put multiple small >>>> buffers into one memory page slab. The page sharing means that UMA >>>> may not be able to free memory page when some of buffers are freed, but >>>> alternatively memory used by that buffer would just be wasted from the >>>> beginning. >>>> >>>> This change follows alike change in ZoL, but unlike Linux (according to >>>> my understanding of it from comments) FreeBSD never shares slabs bigger >>>> then one memory page, so this should be even less invasive then there. >>>> >>>> MFC after: 2 weeks >>>> Sponsored by: iXsystems, Inc. >>>> >>>> Modified: >>>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c >>>> >>>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c >>>> ============================================================================== >>>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 17:42:22 2019 (r348116) >>>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed May 22 18:43:48 2019 (r348117) >>>> @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) >>>> abd_t * >>>> abd_alloc(size_t size, boolean_t is_metadata) >>>> { >>>> - if (!zfs_abd_scatter_enabled) >>>> + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) >>>> return (abd_alloc_linear(size, is_metadata)); >>> >>> may be `size < zfs_abd_chunk_size`? >> >> Why? It should be the same from memory usage, but I see theoretical >> benefits from having linear buffer with one page rather then scatter >> list with one page. Plus ZoL also had there `size <= PAGESIZE`. > > May be malloc() for page size more effictive? Not sure. > Less overhead for kegs and etc. malloc()'s up to 64KB are also backed by UMA. May be it could be optimized on platforms with direct map, and may be after 12 VM subsystem would not be too shocked, but on platforms without direct map requests going around UMA causes huge TLB shootdown on free(). Thinking again, I see one benefit of allocating 4KB buffers not as linear but as ABD -- using same ABD UMA zone for both 4KB and above should improve its caching efficiency. On the other side I already saw lock congestion on UMA locks there, so there may be trade-off. -- Alexander Motin From owner-svn-src-all@freebsd.org Wed May 22 20:58:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7DF15B729E; Wed, 22 May 2019 20:58:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3D0869DCC; Wed, 22 May 2019 20:58:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id m141so6000574ita.3; Wed, 22 May 2019 13:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=ik3HDrh3fYm3DQLPV1hOOTZw57v3p5y7adNAhdsQ1zc=; b=QmyHsAlgEvge79CGfsMwcudHzAP+SUzVs1iLLYlhOcMgMuysdJ7lMmjwG57nYK/FMW 2tKWUtrypYu8wt3P89oedBx07Wz2zt96VESrfCP2TPO56T7y55pzwliqFKkwhAka0XPX vkZb7RqyoUO1Dl1w49eDQpHbnBBOCT4m42lOk2g4rznpsYAh+0kIOTzXtqQmfeWx+Hro zulERlb8MftIMiZPOeAE+ZgzCBaZNz0A3n5MnV5B8hfz+Y9HmJ7tjUEJwlfYAJ1/fOAF HD/XcmV+uRXccARVewSUDxcK6ecV5mRCnze8dKHCwVeHmgXVBsnKz7RLZlpZXsXNaNB1 TtTw== X-Gm-Message-State: APjAAAX5v7f1TVdkvbkoqxSzu5DFoGHNamQTcpFFU+cT1iB1P04samf7 0ZUmMTYJLJTX3A76PDEfPz28rBwa X-Google-Smtp-Source: APXvYqy6PjP+fYPYTg32dLwEX2XLH8BSvBCTLMN6kdKUNp5Od4B42oug8Gc45bRz7pO3hoIyU1vAvw== X-Received: by 2002:a02:6a28:: with SMTP id l40mr54910321jac.25.1558556750674; Wed, 22 May 2019 13:25:50 -0700 (PDT) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com. [209.85.166.179]) by smtp.gmail.com with ESMTPSA id w4sm7888019iob.46.2019.05.22.13.25.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 13:25:50 -0700 (PDT) Received: by mail-it1-f179.google.com with SMTP id g24so5547380iti.5; Wed, 22 May 2019 13:25:50 -0700 (PDT) X-Received: by 2002:a24:e3cb:: with SMTP id d194mr10757695ith.100.1558556750240; Wed, 22 May 2019 13:25:50 -0700 (PDT) MIME-Version: 1.0 References: <201905221344.x4MDiGGV056469@repo.freebsd.org> <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> <32532943-6b1a-71cc-1d95-f180927eb187@FreeBSD.org> In-Reply-To: <32532943-6b1a-71cc-1d95-f180927eb187@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 22 May 2019 13:25:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348109 - in head/sys/x86: include x86 To: John Baldwin Cc: Andriy Gapon , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: B3D0869DCC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 20:58:02 -0000 On Wed, May 22, 2019 at 12:59 PM John Baldwin wrote: > On 5/22/19 12:12 PM, Conrad Meyer wrote: > > On Wed, May 22, 2019 at 11:06 AM Andriy Gapon wrote: > >> > >> On 22/05/2019 16:44, Andrew Gallatin wrote: > >>> This is needed for AMD SMCA processors, as SMCA uses different > >>> MSR address for access MCA banks. > >> > >> Just curious, what is SMCA? > > > > Scalable MCA. It's a set of AMD Fam17h MCA extensions. > > How is it different aside from using different MSR numbers (which seems > a bit gratuitous if that is really all the change is). > > -- > John Baldwin > It adds new MSRs as well, though those are not present in this first change. And adds some information not representable in the =E2=80=9Clegacy= =E2=80=9D MSRs. Some more detail can be found in the linux patches, eg https://lore.kernel.org/patchwork/patch/655889/ . From owner-svn-src-all@freebsd.org Wed May 22 21:06:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FADF15B7779; Wed, 22 May 2019 21:06:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E165F6A7AC; Wed, 22 May 2019 21:06:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCEBA22F14; Wed, 22 May 2019 21:06:10 +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 x4ML6AZ9087363; Wed, 22 May 2019 21:06:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ML6Avj087361; Wed, 22 May 2019 21:06:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905222106.x4ML6Avj087361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 22 May 2019 21:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348120 - head/usr.sbin/i2c X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/i2c X-SVN-Commit-Revision: 348120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E165F6A7AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:06:11 -0000 Author: ian Date: Wed May 22 21:06:10 2019 New Revision: 348120 URL: https://svnweb.freebsd.org/changeset/base/348120 Log: Add a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers. Some i2c controller hardware does not provide a way to do individual START, REPEAT-START and STOP actions on the i2c bus. Instead, they can only do a complete transfer as a single operation. Typically they can do either START-data-STOP or START-data-REPEATSTART-data-STOP. In the i2c driver framework, this corresponds to the iicbus_transfer method. In the userland interface they are initiated with the I2CRDWR ioctl command. These changes add a new 'tr' mode which can be specified with the '-m' command line option. This mode should work on all hardware; when an i2c controller driver doesn't directly support the iicbus_transfer method, code in the i2c driver framework uses the lower-level START/REPEAT/STOP methods to implement the transfer. After this new mode has gotten some testing on various hardware, the 'tr' mode should probably become the new default mode. PR: 189914 Modified: head/usr.sbin/i2c/i2c.8 head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Wed May 22 19:49:25 2019 (r348119) +++ head/usr.sbin/i2c/i2c.8 Wed May 22 21:06:10 2019 (r348120) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd May 22, 2019 .Dt I2C 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl w Ar 0|8|16 .Op Fl o Ar offset .Op Fl c Ar count -.Op Fl m Ar ss|rs|no +.Op Fl m Ar tr|ss|rs|no .Op Fl b .Op Fl v .Nm @@ -72,10 +72,29 @@ number of bytes to transfer (dec). transfer direction: r - read, w - write. .It Fl f Ar device I2C bus to use (default is /dev/iic0). -.It Fl m Ar ss|rs|no +.It Fl m Ar tr|ss|rs|no addressing mode, i.e., I2C bus operations performed after the offset for the transfer has been written to the device and before the actual read/write -operation. rs - repeated start; ss - stop start; no - none. +operation. +.Bl -tag -compact -offset indent +.It Va tr +complete-transfer +.It Va ss +stop then start +.It Va rs +repeated start +.It Va no +none +.El +Some I2C bus hardware does not provide control over the individual start, +repeat-start, and stop operations. +Such hardware can only perform a complete transfer of the offset and the +data as a single operation. +The +.Va tr +mode creates control structures describing the transfer and submits them +to the driver as a single complete transaction. +This mode works on all types of I2C hardware. .It Fl n Ar skip_addr skip address - address(es) to be skipped during bus scan. There are two ways to specify addresses to ignore: by range 'a..b' or Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Wed May 22 19:49:25 2019 (r348119) +++ head/usr.sbin/i2c/i2c.c Wed May 22 21:06:10 2019 (r348120) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #define I2C_MODE_NONE 1 #define I2C_MODE_STOP_START 2 #define I2C_MODE_REPEATED_START 3 +#define I2C_MODE_TRANSFER 4 struct options { int width; @@ -73,7 +74,7 @@ usage(void) { fprintf(stderr, "usage: %s -a addr [-f device] [-d [r|w]] [-o offset] " - "[-w [0|8|16]] [-c count] [-m [ss|rs|no]] [-b] [-v]\n", + "[-w [0|8|16]] [-c count] [-m [tr|ss|rs|no]] [-b] [-v]\n", getprogname()); fprintf(stderr, " %s -s [-f device] [-n skip_addr] -v\n", getprogname()); @@ -297,24 +298,9 @@ static int i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) { struct iiccmd cmd; - int ch, i, error, fd, bufsize; + int error, fd, bufsize; char *err_msg, *buf; - /* - * Read data to be written to the chip from stdin - */ - if (i2c_opt.verbose && !i2c_opt.binary) - fprintf(stderr, "Enter %u bytes of data: ", i2c_opt.count); - - for (i = 0; i < i2c_opt.count; i++) { - ch = getchar(); - if (ch == EOF) { - free(i2c_buf); - err(1, "not enough data, exiting\n"); - } - i2c_buf[i] = ch; - } - fd = open(dev, O_RDWR); if (fd == -1) { free(i2c_buf); @@ -558,6 +544,72 @@ err2: return (1); } +/* + * i2c_rdwr_transfer() - use I2CRDWR to conduct a complete i2c transfer. + * + * Some i2c hardware is unable to provide direct control over START, REPEAT- + * START, and STOP operations. Such hardware can only perform a complete + * START--STOP or START--REPEAT-START--STOP sequence as a + * single operation. The driver framework refers to this sequence as a + * "transfer" so we call it "transfer mode". We assemble either one or two + * iic_msg structures to describe the IO operations, and hand them off to the + * driver to be handled as a single transfer. + */ +static int +i2c_rdwr_transfer(char *dev, struct options i2c_opt, char *i2c_buf) +{ + struct iic_msg msgs[2]; + struct iic_rdwr_data xfer; + int fd, i; + union { + uint8_t buf[2]; + uint8_t off8; + uint16_t off16; + } off; + + i = 0; + if (i2c_opt.width > 0) { + msgs[i].flags = IIC_M_WR | IIC_M_NOSTOP; + msgs[i].slave = i2c_opt.addr; + msgs[i].buf = off.buf; + if (i2c_opt.width == 8) { + off.off8 = (uint8_t)i2c_opt.off; + msgs[i].len = 1; + } else { + off.off16 = (uint16_t)i2c_opt.off; + msgs[i].len = 2; + } + ++i; + } + + /* + * If the transfer direction is write and we did a write of the offset + * above, then we need to elide the start; this transfer is just more + * writing that follows the one started above. For a read, we always do + * a start; if we did an offset write above it'll be a repeat-start + * because of the NOSTOP flag used above. + */ + if (i2c_opt.dir == 'w') + msgs[i].flags = IIC_M_WR | (i > 0) ? IIC_M_NOSTART : 0; + else + msgs[i].flags = IIC_M_RD; + msgs[i].slave = i2c_opt.addr; + msgs[i].len = i2c_opt.count; + msgs[i].buf = i2c_buf; + ++i; + + xfer.msgs = msgs; + xfer.nmsgs = i; + + if ((fd = open(dev, O_RDWR)) == -1) + err(1, "open(%s) failed", dev); + if (ioctl(fd, I2CRDWR, &xfer) == -1 ) + err(1, "ioctl(I2CRDWR) failed"); + close(fd); + + return (0); +} + int main(int argc, char** argv) { @@ -620,6 +672,8 @@ main(int argc, char** argv) i2c_opt.mode = I2C_MODE_STOP_START; else if (!strcmp(optarg, "rs")) i2c_opt.mode = I2C_MODE_REPEATED_START; + else if (!strcmp(optarg, "tr")) + i2c_opt.mode = I2C_MODE_TRANSFER; else usage(); break; @@ -687,19 +741,33 @@ main(int argc, char** argv) if (i2c_buf == NULL) err(1, "data malloc"); + /* + * For a write, read the data to be written to the chip from stdin. + */ if (i2c_opt.dir == 'w') { - error = i2c_write(dev, i2c_opt, i2c_buf); - if (error) { - free(i2c_buf); - return (1); + if (i2c_opt.verbose && !i2c_opt.binary) + fprintf(stderr, "Enter %u bytes of data: ", + i2c_opt.count); + for (i = 0; i < i2c_opt.count; i++) { + ch = getchar(); + if (ch == EOF) { + free(i2c_buf); + err(1, "not enough data, exiting\n"); + } + i2c_buf[i] = ch; } } - if (i2c_opt.dir == 'r') { + + if (i2c_opt.mode == I2C_MODE_TRANSFER) + error = i2c_rdwr_transfer(dev, i2c_opt, i2c_buf); + else if (i2c_opt.dir == 'w') + error = i2c_write(dev, i2c_opt, i2c_buf); + else error = i2c_read(dev, i2c_opt, i2c_buf); - if (error) { - free(i2c_buf); - return (1); - } + + if (error != 0) { + free(i2c_buf); + return (1); } if (i2c_opt.verbose) From owner-svn-src-all@freebsd.org Wed May 22 21:06:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D392415B779E; Wed, 22 May 2019 21:06:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 2E2A36A8A7; Wed, 22 May 2019 21:06:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4ML6IH4086720; Wed, 22 May 2019 14:06:18 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4ML6Idr086719; Wed, 22 May 2019 14:06:18 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905222106.x4ML6Idr086719@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347961 - head In-Reply-To: To: John Baldwin Date: Wed, 22 May 2019 14:06:18 -0700 (PDT) CC: Alexey Dokuchaev , Renato Botelho , Brad Davis , 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-Rspamd-Queue-Id: 2E2A36A8A7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:06:28 -0000 > On 5/22/19 5:48 AM, Alexey Dokuchaev wrote: > > On Wed, May 22, 2019 at 09:42:29AM -0300, Renato Botelho wrote: > >> On 18/05/19 16:36, Brad Davis wrote: > >>> New Revision: 347961 > >>> URL: https://svnweb.freebsd.org/changeset/base/347961 > >>> > >>> Log: > >>> Add note to UPDATING for users of mergemaster after the move of > >>> master.passwd and group in r347638. > >>> > >>> Approved by: allanjude (mentor) > >>> > >>> Modified: > >>> head/UPDATING > >>> > >>> +20190517: > >>> + For users of mergemaster, after recent changes to locations of > >>> + master.passwd and group in the source tree mergemaster needs to be > >>> + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster > >>> + and run `make install'. > >>> + > >> > >> etcupdate is installing group and master.passwd to /lib/libc/gen. It > >> seems wrong. > >> > >> root@x230:/usr/src # etcupdate -p > >> A /lib/libc/gen/group > >> A /lib/libc/gen/master.passwd > > > > *facepalm* > > > > Let me ask again: why these files were moved out of their perfectly > > (and likely the only) reasonable location (etc/) under some cryptic > > libc/gen/ which not only makes little sense per se, but also breaks > > mergemaster(8) and similar tools? > > Because bmake doesn't support .PATH? Oh wait... I spoke long ago when this whole "rip etc/ apart" started, and objected repeatedly and was shot down. I even asked for a "complete plan" and was more or less told this is by design of pkg base. Let me speak to "by design", the BSD source tree is, by design, to reflect the installed location of a file with very rare exception to that design. The .mk system by design is written with this assumption in mind as well. The above artifact is by that design. Attempts to alter such by design behavior has problems, some of which are now, repeatedly showing there ugly head. .PATH could of easily been used, as well as cd ${SRCTOP}/etc && make FOOCONF to implement exactly what was done without ANY file moves. Oh, wait that was pointed out, I belive twice, maybe 3 times, and by some experts on the .mk system as well. sjg (bmake maintainr) and bdrewery (one of our .mk system experts) have both pushed back on these changes. Good luck with supporting this so not by design package system if it requires this to be operable. Also good luck maintaining any of the ${DESTDIR}/etc files as now no one knows how to find them in the source tree. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed May 22 21:14:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7FA515B7BDB; Wed, 22 May 2019 21:14:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (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 BC63B6B08A; Wed, 22 May 2019 21:14:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id TYZUhwlrvo7SQTYZVhqn0J; Wed, 22 May 2019 15:14:50 -0600 X-Authority-Analysis: v=2.3 cv=Go88BX9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=E5NmQfObTbMA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=rS252y2yb20N6vKSIvAA:9 a=QEXdDO2ut3YA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-9b917f0ce39da6e6.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 1317A9A6; Wed, 22 May 2019 14:14:47 -0700 (PDT) Date: Wed, 22 May 2019 14:14:23 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <201905222106.x4ML6Idr086719@gndrsh.dnsmgr.net> References: <201905222106.x4ML6Idr086719@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r347961 - head To: rgrimes@freebsd.org, "Rodney W. Grimes" , John Baldwin CC: Alexey Dokuchaev , Renato Botelho , Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfNmx3tJar3EXRIpb8E+REui3Tw4YmhOs3QMg+2EvgKaPu0watjA5kcAtZu+e1bbvkWtTgEncO3hPntU8P5HWmeX3EXHpba1t+M6sNcx4ZLqETLiKqrEH VArbJFOY1CLSjw4+lIW/9AH/hqEtxBtV1FIsRARp14Jojg76V2ta+JtNDDDowz7YZUE2yLa+mVgMXRO0i82EKya2hNGObB+M2KP1HR1wvoEbF87OPqe/QULN avBOYbqjzQAauJ4Z+wP5vQ/9fa6tupaqc2SCMEj5QbHAaIqh6N8Kz0JgePsXGHfvDrJscMp7mSdn/dMdtufWI9GJGqA4QbrauFF5PwVI1UExPv6pllJiAmtl 9lot1u3SUjWhRuf8bSMomzmT6hRDoI5Ft8gi+ovB5piG02ant9AqGG0I75fZkOlkIrD3V9CgeKcUpcb2NQ472hwIUhkt8A== X-Rspamd-Queue-Id: BC63B6B08A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:14:59 -0000 On May 22, 2019 2:06:18 PM PDT, "Rodney W=2E Grimes" wrote: >> On 5/22/19 5:48 AM, Alexey Dokuchaev wrote: >> > On Wed, May 22, 2019 at 09:42:29AM -0300, Renato Botelho wrote: >> >> On 18/05/19 16:36, Brad Davis wrote: >> >>> New Revision: 347961 >> >>> URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/347961 >> >>> >> >>> Log: >> >>> Add note to UPDATING for users of mergemaster after the move of >> >>> master=2Epasswd and group in r347638=2E >> >>> =20 >> >>> Approved by: allanjude (mentor) >> >>> >> >>> Modified: >> >>> head/UPDATING >> >>> >> >>> +20190517: >> >>> + For users of mergemaster, after recent changes to locations of >> >>> + master=2Epasswd and group in the source tree mergemaster needs to >be >> >>> + updated=2E Before running `mergemaster -p', cd to >usr=2Esbin/mergemaster >> >>> + and run `make install'=2E >> >>> + >> >> >> >> etcupdate is installing group and master=2Epasswd to /lib/libc/gen= =2E=20 >It >> >> seems wrong=2E >> >> >> >> root@x230:/usr/src # etcupdate -p >> >> A /lib/libc/gen/group >> >> A /lib/libc/gen/master=2Epasswd >> >=20 >> > *facepalm* >> >=20 >> > Let me ask again: why these files were moved out of their perfectly >> > (and likely the only) reasonable location (etc/) under some cryptic >> > libc/gen/ which not only makes little sense per se, but also breaks >> > mergemaster(8) and similar tools? >>=20 >> Because bmake doesn't support =2EPATH? Oh wait=2E=2E=2E > >I spoke long ago when this whole "rip etc/ apart" started, and objected >repeatedly and was shot down=2E I even asked for a "complete plan" and >was more or less told this is by design of pkg base=2E > >Let me speak to "by design", the BSD source tree is, by design, to >reflect the installed location of a file with very rare exception >to that design=2E The =2Emk system by design is written with this >assumption in mind as well=2E The above artifact is by that design=2E > >Attempts to alter such by design behavior has problems, some of >which are now, repeatedly showing there ugly head=2E > >=2EPATH could of easily been used, >as well as cd ${SRCTOP}/etc && make FOOCONF >to implement exactly what was done without ANY file moves=2E >Oh, wait that was pointed out, I belive twice, maybe 3 times, >and by some experts on the =2Emk system as well=2E > >sjg (bmake maintainr) and bdrewery (one of our =2Emk system experts) >have both pushed back on these changes=2E > >Good luck with supporting this so not by design package system >if it requires this to be operable=2E Also good luck maintaining >any of the ${DESTDIR}/etc files as now no one knows how to >find them in the source tree=2E > >> John Baldwin I couldn't have said this better, my sentiments exactly=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-all@freebsd.org Wed May 22 21:20:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20CB515B7DA0; Wed, 22 May 2019 21:20:17 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAD826B55C; Wed, 22 May 2019 21:20:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B98623107; Wed, 22 May 2019 21:20:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MLKGut093249; Wed, 22 May 2019 21:20:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MLKGHl093247; Wed, 22 May 2019 21:20:16 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201905222120.x4MLKGHl093247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 22 May 2019 21:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348121 - in head/sys: net netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net netinet6 X-SVN-Commit-Revision: 348121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BAD826B55C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:20:17 -0000 Author: melifaro Date: Wed May 22 21:20:15 2019 New Revision: 348121 URL: https://svnweb.freebsd.org/changeset/base/348121 Log: Fix gateway setup for the interface routes. Currently rinit1() and its IPv6 counterpart nd6_prefix_onlink_rtrequest() uses dummy null_sdl gateway address during route insertion and change it afterwards. This behaviour brings complications to the routing stack and the users of its upcoming notification system. This change fixes both rinit1() and nd6_prefix_onlink_rtrequest() by filling in proper gateway in the beginning. It does not change any of the userland notifications as in both cases, they happen after the insertion and fixup process (rt_newaddrmsg_fib() and nd6_rtmsg()). MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20328 Modified: head/sys/net/route.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed May 22 21:06:10 2019 (r348120) +++ head/sys/net/route.c Wed May 22 21:20:15 2019 (r348121) @@ -1995,7 +1995,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi char tempbuf[_SOCKADDR_TMPSIZE]; int didwork = 0; int a_failure = 0; - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + struct sockaddr_dl *sdl = NULL; struct rib_head *rnh; if (flags & RTF_HOST) { @@ -2046,7 +2046,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi rt_maskedcopy(dst, (struct sockaddr *)tempbuf, netmask); dst = (struct sockaddr *)tempbuf; } - } + } else if (cmd == RTM_ADD) { + sdl = (struct sockaddr_dl *)tempbuf; + bzero(sdl, sizeof(struct sockaddr_dl)); + sdl->sdl_family = AF_LINK; + sdl->sdl_len = sizeof(struct sockaddr_dl); + sdl->sdl_type = ifa->ifa_ifp->if_type; + sdl->sdl_index = ifa->ifa_ifp->if_index; + } /* * Now go through all the requested tables (fibs) and do the * requested action. Realistically, this will either be fib 0 @@ -2109,8 +2116,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi * doing this for compatibility reasons */ if (cmd == RTM_ADD) - info.rti_info[RTAX_GATEWAY] = - (struct sockaddr *)&null_sdl; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)sdl; else info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; @@ -2137,15 +2143,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi rt->rt_ifa = ifa; } #endif - /* - * doing this for compatibility reasons - */ - if (cmd == RTM_ADD) { - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = - rt->rt_ifp->if_index; - } RT_ADDREF(rt); RT_UNLOCK(rt); rt_newaddrmsg_fib(cmd, ifa, error, rt, fibnum); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Wed May 22 21:06:10 2019 (r348120) +++ head/sys/netinet6/nd6_rtr.c Wed May 22 21:20:15 2019 (r348121) @@ -1894,8 +1894,7 @@ restart: static int nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, struct ifaddr *ifa) { - static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; - struct rib_head *rnh; + struct sockaddr_dl sdl; struct rtentry *rt; struct sockaddr_in6 mask6; u_long rtflags; @@ -1910,6 +1909,12 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru mask6.sin6_addr = pr->ndpr_mask; rtflags = (ifa->ifa_flags & ~IFA_RTSELF) | RTF_UP; + bzero(&sdl, sizeof(struct sockaddr_dl)); + sdl.sdl_len = sizeof(struct sockaddr_dl); + sdl.sdl_family = AF_LINK; + sdl.sdl_type = ifa->ifa_ifp->if_type; + sdl.sdl_index = ifa->ifa_ifp->if_index; + if(V_rt_add_addr_allfibs) { fibnum = 0; maxfib = rt_numfibs; @@ -1922,26 +1927,13 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru rt = NULL; error = in6_rtrequest(RTM_ADD, - (struct sockaddr *)&pr->ndpr_prefix, ifa->ifa_addr, + (struct sockaddr *)&pr->ndpr_prefix, (struct sockaddr *)&sdl, (struct sockaddr *)&mask6, rtflags, &rt, fibnum); if (error == 0) { KASSERT(rt != NULL, ("%s: in6_rtrequest return no " "error(%d) but rt is NULL, pr=%p, ifa=%p", __func__, error, pr, ifa)); - - rnh = rt_tables_get_rnh(rt->rt_fibnum, AF_INET6); - /* XXX what if rhn == NULL? */ - RIB_WLOCK(rnh); RT_LOCK(rt); - if (rt_setgate(rt, rt_key(rt), - (struct sockaddr *)&null_sdl) == 0) { - struct sockaddr_dl *dl; - - dl = (struct sockaddr_dl *)rt->rt_gateway; - dl->sdl_type = rt->rt_ifp->if_type; - dl->sdl_index = rt->rt_ifp->if_index; - } - RIB_WUNLOCK(rnh); nd6_rtmsg(RTM_ADD, rt); RT_UNLOCK(rt); pr->ndpr_stateflags |= NDPRF_ONLINK; From owner-svn-src-all@freebsd.org Wed May 22 21:47:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B59B15B86F4; Wed, 22 May 2019 21:47:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6F846C6EC; Wed, 22 May 2019 21:47:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9364D2365F; Wed, 22 May 2019 21:47:18 +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 x4MLlIa5009344; Wed, 22 May 2019 21:47:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MLlItj009343; Wed, 22 May 2019 21:47:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905222147.x4MLlItj009343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 22 May 2019 21:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348122 - in head/libexec: rc/rc.d save-entropy X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/libexec: rc/rc.d save-entropy X-SVN-Commit-Revision: 348122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6F846C6EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:47:19 -0000 Author: cem Date: Wed May 22 21:47:17 2019 New Revision: 348122 URL: https://svnweb.freebsd.org/changeset/base/348122 Log: save-entropy(8), rc.d/random: Set nodump flag Tag saved entropy files as "nodump," to signal that the files should not be backed up by dump(8) or other automated backup software that honors the file flag. Do not produce an error if the target file resides on a filesystem that does not support file flags (e.g., msdos /boot). Reviewed by: delphij Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20358 Modified: head/libexec/rc/rc.d/random head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/rc/rc.d/random ============================================================================== --- head/libexec/rc/rc.d/random Wed May 22 21:20:15 2019 (r348121) +++ head/libexec/rc/rc.d/random Wed May 22 21:47:17 2019 (r348122) @@ -25,6 +25,7 @@ save_dev_random() for f ; do debug "saving entropy to $f" dd if=/dev/random of="$f" bs=4096 count=1 status=none && + ( chflags nodump "$f" 2>/dev/null || : ) && chmod 600 "$f" && fsync "$f" "$(dirname "$f")" done @@ -99,7 +100,7 @@ random_stop() [Nn][Oo]) ;; *) - echo -n 'Writing entropy file:' + echo -n 'Writing entropy file: ' rm -f ${entropy_file} 2> /dev/null oumask=`umask` umask 077 @@ -118,12 +119,7 @@ random_stop() warn 'write failed (read-only fs?)' ;; *) - dd if=/dev/random of=${entropy_file_confirmed} \ - bs=4096 count=1 2> /dev/null || - warn 'write failed (unwriteable file or full fs?)' - fsync "${entropy_file_confirmed}" \ - "$(dirname "${entropy_file_confirmed}")" \ - 2> /dev/null + save_dev_random "${entropy_file_confirmed}" echo '.' ;; esac @@ -134,7 +130,7 @@ random_stop() [Nn][Oo]) ;; *) - echo -n 'Writing early boot entropy file:' + echo -n 'Writing early boot entropy file: ' rm -f ${entropy_boot_file} 2> /dev/null oumask=`umask` umask 077 @@ -146,12 +142,7 @@ random_stop() warn 'write failed (read-only fs?)' ;; *) - dd if=/dev/random of=${entropy_boot_file_confirmed} \ - bs=4096 count=1 2> /dev/null || - warn 'write failed (unwriteable file or full fs?)' - fsync "${entropy_boot_file_confirmed}" \ - "$(dirname "${entropy_boot_file_confirmed}")" \ - 2> /dev/null + save_dev_random "${entropy_boot_file_confirmed}" echo '.' ;; esac Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Wed May 22 21:20:15 2019 (r348121) +++ head/libexec/save-entropy/save-entropy.sh Wed May 22 21:47:17 2019 (r348122) @@ -90,6 +90,7 @@ while [ ${n} -ge 1 ]; do done dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null +chflags nodump saved-entropy.1 2>/dev/null || : fsync saved-entropy.1 "." exit 0 From owner-svn-src-all@freebsd.org Wed May 22 21:47:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A4E15B8727; Wed, 22 May 2019 21:47:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E69516C7E3; Wed, 22 May 2019 21:47:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCBAB23662; Wed, 22 May 2019 21:47:26 +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 x4MLlQoN009394; Wed, 22 May 2019 21:47:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MLlQ5u009393; Wed, 22 May 2019 21:47:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905222147.x4MLlQ5u009393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 22 May 2019 21:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348123 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 348123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E69516C7E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:47:31 -0000 Author: ian Date: Wed May 22 21:47:26 2019 New Revision: 348123 URL: https://svnweb.freebsd.org/changeset/base/348123 Log: Add pnp info to the imx_i2c driver. Modified: head/sys/arm/freescale/imx/imx_i2c.c Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Wed May 22 21:47:17 2019 (r348122) +++ head/sys/arm/freescale/imx/imx_i2c.c Wed May 22 21:47:26 2019 (r348123) @@ -194,6 +194,7 @@ DRIVER_MODULE(imx_i2c, simplebus, i2c_driver, i2c_devc DRIVER_MODULE(ofw_iicbus, imx_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); MODULE_DEPEND(imx_i2c, iicbus, 1, 1, 1); MODULE_DEPEND(imx_i2c, ofw_iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); static phandle_t i2c_get_node(device_t bus, device_t dev) From owner-svn-src-all@freebsd.org Wed May 22 21:52:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E8D15B89E1; Wed, 22 May 2019 21:52:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f181.google.com (mail-it1-f181.google.com [209.85.166.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A26CE6CDEE; Wed, 22 May 2019 21:52:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f181.google.com with SMTP id h20so6232687itk.4; Wed, 22 May 2019 14:52:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=jqA1L3zQXMVzh4JGM08R8YGQRXvBD+wJnU6/1d1ZL0c=; b=reuLKbSl7cwoNZ+tL3oYDuo6XtyFXsqkxB6sxM3zn6OU7ag8Mlb+Jwamx5hOsgNjQH aOrw4PIk+B6/X82bbuy59StTTVRsfnjGiqrm4H/2V06gmsEphZcnwMV9Abawm4wNl5g8 f92PgzXS8YNg0I+7nYPapM51VwoPCWpLyVkvLC9DpcJ0FelOInhWsSwUXFRgwyz9RjHD uLwD9FTnIwIxjniRogrFNDNhc6WCh5gtr4RnovWmT205wMoRuH9gQBT4+n0ZOXIP4s7l NAvZVtaQ5CKN0FcHzzAsxv4gYM2hQNT7cd08uo+M8eXwrzqycvB6Vv9GOg6ihUuL+tjW 4Ogw== X-Gm-Message-State: APjAAAUqyUpuu7OdfK6618OrYrmZP8cdm8Anfo7o9ZP1txDCFQHAT5kk LddCPFVDdxiA/fxaFdaULPZ05qki X-Google-Smtp-Source: APXvYqznPyGwei/e/yKvhNTTHTi/wb0WnOkMfeN0BmrJHEuuT2i92aVt9ltqUglNpmDFl2Hx+l0NwQ== X-Received: by 2002:a24:c241:: with SMTP id i62mr9964591itg.21.1558561971125; Wed, 22 May 2019 14:52:51 -0700 (PDT) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id w139sm3926576ita.43.2019.05.22.14.52.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 14:52:50 -0700 (PDT) Received: by mail-it1-f170.google.com with SMTP id m3so6265126itl.1; Wed, 22 May 2019 14:52:50 -0700 (PDT) X-Received: by 2002:a24:47cc:: with SMTP id t195mr10061944itb.117.1558561970599; Wed, 22 May 2019 14:52:50 -0700 (PDT) MIME-Version: 1.0 References: <201905160109.x4G19DhY080690@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 22 May 2019 14:52:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen To: Brad Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: A26CE6CDEE X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.181 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.78 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[181.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.79)[ip: (-8.15), ipnet: 209.85.128.0/17(-3.46), asn: 15169(-2.28), country: US(-0.06)]; RWL_MAILSPIKE_POSSIBLE(0.00)[181.166.85.209.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 21:52:54 -0000 Hi Brad, Ping. It's still broken. Can you revert this please? Thanks, Conrad On Thu, May 16, 2019 at 8:05 AM Conrad Meyer wrote: > > Hi Brad, > > Can you revert this? It seems to break every config-management tool > we have (mergemaster, etcupdate, beinstall ...). > > Additionally, I don't believe this move has been justified =E2=80=94 the = cons > seem to outweigh the pros, if there are any. I skimmed the > differential and it was not immediately obvious what the benefit was. > The commit message describes what was changed, but not *why* you > thought it was a good idea. > > Thanks, > Conrad > > On Wed, May 15, 2019 at 6:09 PM Brad Davis wrote: > > > > Author: brd > > Date: Thu May 16 01:09:13 2019 > > New Revision: 347638 > > URL: https://svnweb.freebsd.org/changeset/base/347638 > > > > Log: > > Move master.passwd and group to lib/libc/gen/ > > > > libc was picked as the destination location for these because of the = syscalls > > that use these files as the lowest level place they are referenced. > > > > Approved by: will (mentor), rgrimes, manu > > Differential Revision: https://reviews.freebsd.org/D16728 > > > > Added: > > head/lib/libc/gen/group > > - copied unchanged from r347637, head/etc/group > > head/lib/libc/gen/master.passwd > > - copied unchanged from r347637, head/etc/master.passwd > > Deleted: > > head/etc/group > > head/etc/master.passwd > > Modified: > > head/Makefile.inc1 > > head/etc/Makefile > > head/lib/libc/gen/Makefile.inc > > > > Modified: head/Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Thu May 16 00:53:54 2019 (r347637) > > +++ head/Makefile.inc1 Thu May 16 01:09:13 2019 (r347638) > > @@ -871,8 +871,8 @@ DB_FROM_SRC=3D yes > > .endif > > > > .if defined(DB_FROM_SRC) > > -INSTALLFLAGS+=3D -N ${.CURDIR}/etc > > -MTREEFLAGS+=3D -N ${.CURDIR}/etc > > +INSTALLFLAGS+=3D -N ${.CURDIR}/lib/libc/gen > > +MTREEFLAGS+=3D -N ${.CURDIR}/lib/libc/gen > > .endif > > _INSTALL_DDIR=3D ${DESTDIR}/${DISTDIR} > > INSTALL_DDIR=3D ${_INSTALL_DDIR:S://:/:g:C:/$::} > > > > Modified: head/etc/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/etc/Makefile Thu May 16 00:53:54 2019 (r347637) > > +++ head/etc/Makefile Thu May 16 01:09:13 2019 (r347638) > > @@ -15,7 +15,6 @@ SUBDIR+=3Dsendmail > > .endif > > > > BIN1=3D \ > > - group \ > > login.access \ > > rc.bsdextended \ > > rc.firewall \ > > @@ -65,21 +64,7 @@ distribution: > > .endif > > cd ${.CURDIR}; \ > > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > > - ${BIN1} ${DESTDIR}/etc; \ > > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ > > - master.passwd ${DESTDIR}/etc; > > - > > -.if ${MK_TCSH} =3D=3D "no" > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > -.endif > > - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > -.if defined(NO_ROOT) > > - ( \ > > - echo "./etc/passwd type=3Dfile mode=3D0644 uname=3Droot= gname=3Dwheel"; \ > > - echo "./etc/pwd.db type=3Dfile mode=3D0644 uname=3Droot= gname=3Dwheel"; \ > > - echo "./etc/spwd.db type=3Dfile mode=3D0600 uname=3Droo= t gname=3Dwheel"; \ > > - ) | ${METALOG.add} > > -.endif > > + ${BIN1} ${DESTDIR}/etc > > ${_+_}cd ${.CURDIR}/gss; ${MAKE} install > > ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install > > ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap > > > > Modified: head/lib/libc/gen/Makefile.inc > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/lib/libc/gen/Makefile.inc Thu May 16 00:53:54 2019 = (r347637) > > +++ head/lib/libc/gen/Makefile.inc Thu May 16 01:09:13 2019 = (r347638) > > @@ -4,7 +4,8 @@ > > # machine-independent gen sources > > .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen > > > > -CONFS=3D shells > > +CONFS+=3D group master.passwd shells > > +CONFSMODE_master.passwd=3D 600 > > > > SRCS+=3D __getosreldate.c \ > > __pthread_mutex_init_calloc_cb_stub.c \ > > @@ -543,3 +544,16 @@ MLINKS+=3Dvis.3 nvis.3 \ > > vis.3 svis.3 > > > > MLINKS+=3Dwordexp.3 wordfree.3 > > + > > +afterinstallconfig: > > +.if ${MK_TCSH} =3D=3D "no" > > + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > +.endif > > + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > +.if defined(NO_ROOT) && defined(METALOG) > > + ( \ > > + echo "./etc/pwd.db type=3Dfile mode=3D0644 uname=3Droot= gname=3Dwheel"; \ > > + echo "./etc/spwd.db type=3Dfile mode=3D0600 uname=3Droo= t gname=3Dwheel"; \ > > + echo "./etc/passwd type=3Dfile mode=3D0644 uname=3Droot= gname=3Dwheel"; \ > > + ) | cat -l >> ${METALOG} > > +.endif > > > > Copied: head/lib/libc/gen/group (from r347637, head/etc/group) > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/lib/libc/gen/group Thu May 16 01:09:13 2019 (r34763= 8, copy of r347637, head/etc/group) > > @@ -0,0 +1,36 @@ > > +# $FreeBSD$ > > +# > > +wheel:*:0:root > > +daemon:*:1: > > +kmem:*:2: > > +sys:*:3: > > +tty:*:4: > > +operator:*:5:root > > +mail:*:6: > > +bin:*:7: > > +news:*:8: > > +man:*:9: > > +games:*:13: > > +ftp:*:14: > > +staff:*:20: > > +sshd:*:22: > > +smmsp:*:25: > > +mailnull:*:26: > > +guest:*:31: > > +video:*:44: > > +bind:*:53: > > +unbound:*:59: > > +proxy:*:62: > > +authpf:*:63: > > +_pflogd:*:64: > > +_dhcp:*:65: > > +uucp:*:66: > > +dialer:*:68: > > +network:*:69: > > +audit:*:77: > > +www:*:80: > > +ntpd:*:123: > > +_ypldap:*:160: > > +hast:*:845: > > +nogroup:*:65533: > > +nobody:*:65534: > > > > Copied: head/lib/libc/gen/master.passwd (from r347637, head/etc/master.= passwd) > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019 = (r347638, copy of r347637, head/etc/master.passwd) > > @@ -0,0 +1,28 @@ > > +# $FreeBSD$ > > +# > > +root::0:0::0:0:Charlie &:/root:/bin/csh > > +toor:*:0:0::0:0:Bourne-again Superuser:/root: > > +daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nolog= in > > +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin > > +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin > > +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin > > +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin > > +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin > > +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin > > +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin > > +smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/u= sr/sbin/nologin > > +mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbi= n/nologin > > +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin > > +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nolog= in > > +proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/no= login > > +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin > > +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin > > +uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/li= bexec/uucp/uucico > > +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin > > +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/s= bin/nologin > > +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin > > +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin > > +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/= nologin > > +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologi= n > > +nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nol= ogin > > From owner-svn-src-all@freebsd.org Wed May 22 22:34:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B661158F877; Wed, 22 May 2019 22:34:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECFD56E25E; Wed, 22 May 2019 22:34:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACAA623ECD; Wed, 22 May 2019 22:34:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MMYZ8u035655; Wed, 22 May 2019 22:34:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MMYZho035654; Wed, 22 May 2019 22:34:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905222234.x4MMYZho035654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 May 2019 22:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348124 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 348124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECFD56E25E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 22:34:36 -0000 Author: kevans Date: Wed May 22 22:34:35 2019 New Revision: 348124 URL: https://svnweb.freebsd.org/changeset/base/348124 Log: MFC r347578: tun/tap: Defer clearing if_softc until after if_detach (Commit massaged to match stable structure; tun and tap have been merged in head) r346670 added an sx to close a race between the ifioctl handler and interface destruction. Unfortunately, it clears if_softc immediately after the interface is closed, but before if_detach has been invoked. Any time before detachment, an interface that's part of a bridge may still receive traffic that's pushed through tunstart/tunstart_l2 and promptly lead to a panic because if_softc is now NULL. Fix it by deferring the clearing of if_softc until after the interface has detached and thus been removed from the bridge. if_softc still gets cleared in case another thread has already entered the ioctl handler before it's replaced with ifdead_ioctl. Modified: stable/12/sys/net/if_tap.c stable/12/sys/net/if_tun.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_tap.c ============================================================================== --- stable/12/sys/net/if_tap.c Wed May 22 21:47:26 2019 (r348123) +++ stable/12/sys/net/if_tap.c Wed May 22 22:34:35 2019 (r348124) @@ -223,15 +223,17 @@ tap_destroy(struct tap_softc *tp) struct ifnet *ifp = tp->tap_ifp; CURVNET_SET(ifp->if_vnet); - sx_xlock(&tap_ioctl_sx); - ifp->if_softc = NULL; - sx_xunlock(&tap_ioctl_sx); destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); knlist_clear(&tp->tap_rsel.si_note, 0); knlist_destroy(&tp->tap_rsel.si_note); ether_ifdetach(ifp); + + sx_xlock(&tap_ioctl_sx); + ifp->if_softc = NULL; + sx_xunlock(&tap_ioctl_sx); + if_free(ifp); mtx_destroy(&tp->tap_mtx); Modified: stable/12/sys/net/if_tun.c ============================================================================== --- stable/12/sys/net/if_tun.c Wed May 22 21:47:26 2019 (r348123) +++ stable/12/sys/net/if_tun.c Wed May 22 22:34:35 2019 (r348124) @@ -278,13 +278,15 @@ tun_destroy(struct tun_softc *tp) mtx_unlock(&tp->tun_mtx); CURVNET_SET(TUN2IFP(tp)->if_vnet); - sx_xlock(&tun_ioctl_sx); - TUN2IFP(tp)->if_softc = NULL; - sx_xunlock(&tun_ioctl_sx); dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); + + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); + free_unr(tun_unrhdr, TUN2IFP(tp)->if_dunit); if_free(TUN2IFP(tp)); destroy_dev(dev); From owner-svn-src-all@freebsd.org Wed May 22 22:55:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41EFF1590125; Wed, 22 May 2019 22:55:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC12F6ED2F; Wed, 22 May 2019 22:55:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEA5024255; Wed, 22 May 2019 22:55:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MMtRVJ045762; Wed, 22 May 2019 22:55:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MMtR99045761; Wed, 22 May 2019 22:55:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905222255.x4MMtR99045761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 May 2019 22:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348125 - stable/12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libbe X-SVN-Commit-Revision: 348125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC12F6ED2F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 22:55:28 -0000 Author: kevans Date: Wed May 22 22:55:27 2019 New Revision: 348125 URL: https://svnweb.freebsd.org/changeset/base/348125 Log: MFC r347640: libbe(3): Descend into children of datasets w/ mountpoint=none These datasets will generally be canmount=noauto,mountpoint=none (e.g. zroot/var) but have children that may need to be mounted. Instead of skipping that segment for no good reason, descend. Modified: stable/12/lib/libbe/be_access.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Wed May 22 22:34:35 2019 (r348124) +++ stable/12/lib/libbe/be_access.c Wed May 22 22:55:27 2019 (r348125) @@ -99,13 +99,12 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (strcmp("none", zfs_mnt) == 0) { /* * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root... that's less - * than stellar and not entirely sure what to do with that. - * For now, we won't treat it as an error condition -- we just - * won't mount it, and we'll continue on. + * we're at the root. If we're not at the root, we're likely + * at some intermediate dataset (e.g. zroot/var) that will have + * children that may need to be mounted. */ if (info->depth > 0) - return (0); + goto skipmount; snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); } else { @@ -136,6 +135,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (!info->deepmount) return (0); +skipmount: ++info->depth; err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); --info->depth; From owner-svn-src-all@freebsd.org Wed May 22 22:56:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6061F15901B9; Wed, 22 May 2019 22:56:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE6FA6EE53; Wed, 22 May 2019 22:56:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A056B24257; Wed, 22 May 2019 22:56:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MMu5bM045836; Wed, 22 May 2019 22:56:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MMu5x5045834; Wed, 22 May 2019 22:56:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905222256.x4MMu5x5045834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 May 2019 22:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348126 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 348126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE6FA6EE53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 22:56:06 -0000 Author: kevans Date: Wed May 22 22:56:05 2019 New Revision: 348126 URL: https://svnweb.freebsd.org/changeset/base/348126 Log: MFC r347578: tun/tap: Defer clearing if_softc until after if_detach (Commit massaged to match stable structure; tun and tap have been merged in head) r346670 added an sx to close a race between the ifioctl handler and interface destruction. Unfortunately, it clears if_softc immediately after the interface is closed, but before if_detach has been invoked. Any time before detachment, an interface that's part of a bridge may still receive traffic that's pushed through tunstart/tunstart_l2 and promptly lead to a panic because if_softc is now NULL. Fix it by deferring the clearing of if_softc until after the interface has detached and thus been removed from the bridge. if_softc still gets cleared in case another thread has already entered the ioctl handler before it's replaced with ifdead_ioctl. Approved by: re (kib) Modified: stable/11/sys/net/if_tap.c stable/11/sys/net/if_tun.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_tap.c ============================================================================== --- stable/11/sys/net/if_tap.c Wed May 22 22:55:27 2019 (r348125) +++ stable/11/sys/net/if_tap.c Wed May 22 22:56:05 2019 (r348126) @@ -223,15 +223,17 @@ tap_destroy(struct tap_softc *tp) struct ifnet *ifp = tp->tap_ifp; CURVNET_SET(ifp->if_vnet); - sx_xlock(&tap_ioctl_sx); - ifp->if_softc = NULL; - sx_xunlock(&tap_ioctl_sx); destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); knlist_clear(&tp->tap_rsel.si_note, 0); knlist_destroy(&tp->tap_rsel.si_note); ether_ifdetach(ifp); + + sx_xlock(&tap_ioctl_sx); + ifp->if_softc = NULL; + sx_xunlock(&tap_ioctl_sx); + if_free(ifp); mtx_destroy(&tp->tap_mtx); Modified: stable/11/sys/net/if_tun.c ============================================================================== --- stable/11/sys/net/if_tun.c Wed May 22 22:55:27 2019 (r348125) +++ stable/11/sys/net/if_tun.c Wed May 22 22:56:05 2019 (r348126) @@ -278,13 +278,15 @@ tun_destroy(struct tun_softc *tp) mtx_unlock(&tp->tun_mtx); CURVNET_SET(TUN2IFP(tp)->if_vnet); - sx_xlock(&tun_ioctl_sx); - TUN2IFP(tp)->if_softc = NULL; - sx_xunlock(&tun_ioctl_sx); dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); + + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); + free_unr(tun_unrhdr, TUN2IFP(tp)->if_dunit); if_free(TUN2IFP(tp)); destroy_dev(dev); From owner-svn-src-all@freebsd.org Wed May 22 23:07:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32F515906C8; Wed, 22 May 2019 23:07:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 980316F72E; Wed, 22 May 2019 23:07:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72C0D24436; Wed, 22 May 2019 23:07:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MN7ebd051861; Wed, 22 May 2019 23:07:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MN7ewC051860; Wed, 22 May 2019 23:07:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905222307.x4MN7ewC051860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 May 2019 23:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348127 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 348127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 980316F72E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:07:41 -0000 Author: kevans Date: Wed May 22 23:07:40 2019 New Revision: 348127 URL: https://svnweb.freebsd.org/changeset/base/348127 Log: bectl(8): add description for create subcommand In commit r345845, a portion of documentation for the create subcommand was removed. Specifically, for creating a snapshot of an existing boot environment. bectl even has a test-case for this functionality. Removing the sub-command description was discussed in PR 235850. This patch brings back the second "create" description that was originally in place. Albeit, with a few wording/clarifying changes. Submitted by: Rob Fairbanks Reviewed by: kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20249 Modified: head/sbin/bectl/bectl.8 Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Wed May 22 22:56:05 2019 (r348126) +++ head/sbin/bectl/bectl.8 Wed May 22 23:07:40 2019 (r348127) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2019 +.Dd May 12, 2019 .Dt BECTL 8 .Os .Sh NAME @@ -35,6 +35,10 @@ .Op Fl e Brq Ar nonActiveBe | Ar beName Ns Cm @ Ns Ar snapshot .Ar newBeName .Nm +.Cm create +.Op Fl r +.Ar beName@snapshot +.Nm .Cm destroy .Op Fl \&Fo .Ar beName Ns Op Cm @ Ns Ar snapshot @@ -120,6 +124,20 @@ Otherwise, the new environment will be created from th If .Nm is creating from another boot environment, a snapshot of that boot environment will be created to clone from. +.It Xo +.Cm create +.Op Fl r +.Ar beName@snapshot +.Xc +Create a snapshot of the boot environment named +.Ar beName . +.Pp +If the +.Fl r +flag is given, a recursive snapshot of the boot environment will be created. +A snapshot is created for each descendant dataset of the boot environment. +.Pp +No new boot environment is created with this command. .It Xo .Cm destroy .Op Fl \&Fo From owner-svn-src-all@freebsd.org Wed May 22 23:11:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95471590821; Wed, 22 May 2019 23:11:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67D126F99D; Wed, 22 May 2019 23:11:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 416C02447E; Wed, 22 May 2019 23:11:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MNBHGR053628; Wed, 22 May 2019 23:11:17 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNBH7h053627; Wed, 22 May 2019 23:11:17 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905222311.x4MNBH7h053627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Wed, 22 May 2019 23:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348128 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67D126F99D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:11:18 -0000 Author: dougm Date: Wed May 22 23:11:16 2019 New Revision: 348128 URL: https://svnweb.freebsd.org/changeset/base/348128 Log: Cleanups made necessary by r348115, or reactions to it: 1. Change size_t to vm_size_t in some places. 2. Rename vm_map_entry_resize_free to drop the _free part. 3. Fix whitespace errors. 4. Fix screwups in patch-conflict-management that left out important changes related to growing and shrinking objects. Reviewed by: alc Approved by: kib (mentor) Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 22 23:07:40 2019 (r348127) +++ head/sys/vm/vm_map.c Wed May 22 23:11:16 2019 (r348128) @@ -1241,17 +1241,15 @@ vm_map_entry_unlink(vm_map_t map, } /* - * vm_map_entry_resize_free: + * vm_map_entry_resize: * - * Recompute the amount of free space following a modified vm_map_entry - * and propagate those values up the tree. Call this function after - * resizing a map entry in-place by changing the end value, without a - * call to vm_map_entry_link() or _unlink(). + * Resize a vm_map_entry, recompute the amount of free space that + * follows it and propagate that value up the tree. * * The map must be locked, and leaves it so. */ static void -vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t entry, size_t grow_amount) +vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry, vm_size_t grow_amount) { vm_map_entry_t llist, rlist, root; @@ -1259,15 +1257,15 @@ vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t root = map->root; root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); KASSERT(root != NULL, - ("vm_map_entry_resize_free: resize_free object not mapped")); + ("%s: resize object not mapped", __func__)); vm_map_splay_findnext(root, &rlist); root->right = NULL; entry->end += grow_amount; map->root = vm_map_splay_merge(root, llist, rlist, root->left, root->right); VM_MAP_ASSERT_CONSISTENT(map); - CTR3(KTR_VM, "vm_map_entry_resize_free: map %p, nentries %d, entry %p", - map, map->nentries, entry); + CTR4(KTR_VM, "%s: map %p, nentries %d, entry %p", + _func__, map, map->nentries, entry); } /* @@ -1487,7 +1485,7 @@ charged: prev_entry)); if ((prev_entry->eflags & MAP_ENTRY_GUARD) == 0) map->size += end - prev_entry->end; - vm_map_entry_resize_free(map, prev_entry, + vm_map_entry_resize(map, prev_entry, end - prev_entry->end); vm_map_simplify_entry(map, prev_entry); return (KERN_SUCCESS); @@ -4168,7 +4166,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma struct vmspace *vm; struct ucred *cred; vm_offset_t gap_end, gap_start, grow_start; - size_t grow_amount, guard, max_grow; + vm_size_t grow_amount, guard, max_grow; rlim_t lmemlim, stacklim, vmemlim; int rv, rv1; bool gap_deleted, grow_down, is_procstack; @@ -4314,8 +4312,7 @@ retry: gap_deleted = true; } else { MPASS(gap_entry->start < gap_entry->end - grow_amount); - gap_entry->end -= grow_amount; - vm_map_entry_resize_free(map, gap_entry, -grow_amount); + vm_map_entry_resize(map, gap_entry, -grow_amount); gap_deleted = false; } rv = vm_map_insert(map, NULL, 0, grow_start, @@ -4329,7 +4326,7 @@ retry: MAP_CREATE_GUARD | MAP_CREATE_STACK_GAP_DN); MPASS(rv1 == KERN_SUCCESS); } else - vm_map_entry_resize_free(map, gap_entry, + vm_map_entry_resize(map, gap_entry, grow_amount); } } else { @@ -4344,13 +4341,16 @@ retry: vm_object_coalesce(stack_entry->object.vm_object, stack_entry->offset, (vm_size_t)(stack_entry->end - stack_entry->start), - (vm_size_t)grow_amount, cred != NULL)) { - if (gap_entry->start + grow_amount == gap_entry->end) + grow_amount, cred != NULL)) { + if (gap_entry->start + grow_amount == gap_entry->end) { vm_map_entry_delete(map, gap_entry); - else + vm_map_entry_resize(map, stack_entry, + grow_amount); + } else { gap_entry->start += grow_amount; + stack_entry->end += grow_amount; + } map->size += grow_amount; - vm_map_entry_resize_free(map, stack_entry, grow_amount); rv = KERN_SUCCESS; } else rv = KERN_FAILURE; From owner-svn-src-all@freebsd.org Wed May 22 23:19:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4564B1590C43; Wed, 22 May 2019 23:19:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA43E6FF6D; Wed, 22 May 2019 23:19:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8168224603; Wed, 22 May 2019 23:19:21 +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 x4MNJLSI057227; Wed, 22 May 2019 23:19:21 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNJKBG057223; Wed, 22 May 2019 23:19:20 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905222319.x4MNJKBG057223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 22 May 2019 23:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348129 - in stable/12/lib/libsecureboot: . h tests X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/lib/libsecureboot: . h tests X-SVN-Commit-Revision: 348129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA43E6FF6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:19:22 -0000 Author: sjg Date: Wed May 22 23:19:20 2019 New Revision: 348129 URL: https://svnweb.freebsd.org/changeset/base/348129 Log: libsecureboot: allow control of when pseudo pcr is updated During boot we only want to measure things which *must* be verified - this should provide more deterministic ordering. MFC r347981 Reviewed by: stevek Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D20297 Modified: stable/12/lib/libsecureboot/h/libsecureboot.h stable/12/lib/libsecureboot/tests/tvo.c stable/12/lib/libsecureboot/vepcr.c stable/12/lib/libsecureboot/verify_file.c Modified: stable/12/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- stable/12/lib/libsecureboot/h/libsecureboot.h Wed May 22 23:11:16 2019 (r348128) +++ stable/12/lib/libsecureboot/h/libsecureboot.h Wed May 22 23:19:20 2019 (r348129) @@ -81,6 +81,8 @@ unsigned char *verify_asc(const char *, int); /* OpenP void ve_pcr_init(void); void ve_pcr_update(unsigned char *, size_t); ssize_t ve_pcr_get(unsigned char *, size_t); +int ve_pcr_updating_get(void); +void ve_pcr_updating_set(int); /* flags for verify_{asc,sig,signed} */ #define VEF_VERBOSE 1 Modified: stable/12/lib/libsecureboot/tests/tvo.c ============================================================================== --- stable/12/lib/libsecureboot/tests/tvo.c Wed May 22 23:11:16 2019 (r348128) +++ stable/12/lib/libsecureboot/tests/tvo.c Wed May 22 23:19:20 2019 (r348129) @@ -74,6 +74,9 @@ main(int argc, char *argv[]) } } +#ifdef VE_PCR_SUPPORT + ve_pcr_updating_set(1); +#endif ve_self_tests(); for ( ; optind < argc; optind++) { @@ -176,6 +179,10 @@ main(int argc, char *argv[]) } } } +#ifdef VE_PCR_SUPPORT + verify_pcr_export(); + printf("pcr=%s\n", getenv("loader.ve.pcr")); +#endif return (0); } Modified: stable/12/lib/libsecureboot/vepcr.c ============================================================================== --- stable/12/lib/libsecureboot/vepcr.c Wed May 22 23:11:16 2019 (r348128) +++ stable/12/lib/libsecureboot/vepcr.c Wed May 22 23:19:20 2019 (r348129) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); static const br_hash_class *pcr_md = NULL; static br_hash_compat_context pcr_ctx; static size_t pcr_hlen = 0; +static int pcr_updating; /** * @brief initialize pcr context @@ -53,18 +54,37 @@ static size_t pcr_hlen = 0; void ve_pcr_init(void) { + pcr_updating = 0; pcr_hlen = br_sha256_SIZE; pcr_md = &br_sha256_vtable; pcr_md->init(&pcr_ctx.vtable); } /** + * @brief get pcr_updating state + */ +int +ve_pcr_updating_get(void) +{ + return (pcr_updating); +} + +/** + * @brief set pcr_updating state + */ +void +ve_pcr_updating_set(int updating) +{ + pcr_updating = updating; +} + +/** * @brief update pcr context */ void ve_pcr_update(unsigned char *data, size_t dlen) { - if (pcr_md) + if (pcr_updating != 0 && pcr_md != NULL) pcr_md->update(&pcr_ctx.vtable, data, dlen); } Modified: stable/12/lib/libsecureboot/verify_file.c ============================================================================== --- stable/12/lib/libsecureboot/verify_file.c Wed May 22 23:11:16 2019 (r348128) +++ stable/12/lib/libsecureboot/verify_file.c Wed May 22 23:19:20 2019 (r348129) @@ -340,6 +340,14 @@ verify_file(int fd, const char *filename, off_t off, i if (rc != VE_FINGERPRINT_WRONG && loaded_manifests) { if (severity <= VE_GUESS) severity = severity_guess(filename); +#ifdef VE_PCR_SUPPORT + /* + * Only update pcr with things that must verify + * these tend to be processed in a more deterministic + * order, which makes our pseudo pcr more useful. + */ + ve_pcr_updating_set((severity == VE_MUST)); +#endif if ((rc = verify_fd(fd, filename, off, &st)) >= 0) { if (verbose || severity > VE_WANT) { #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0 From owner-svn-src-all@freebsd.org Wed May 22 23:22:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E5C41590F13; Wed, 22 May 2019 23:22:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13BED703B3; Wed, 22 May 2019 23:22:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6AC8247A6; Wed, 22 May 2019 23:22:36 +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 x4MNMa3K062096; Wed, 22 May 2019 23:22:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNMa75062095; Wed, 22 May 2019 23:22:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905222322.x4MNMa75062095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 22 May 2019 23:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348130 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 348130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13BED703B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:22:37 -0000 Author: cem Date: Wed May 22 23:22:36 2019 New Revision: 348130 URL: https://svnweb.freebsd.org/changeset/base/348130 Log: Decode and name additional x86 feature bits These are all enumerated in Intel's ISA extension reference, 37th ed. Sponsored by: Dell EMC Isilon Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed May 22 23:19:20 2019 (r348129) +++ head/sys/x86/include/specialreg.h Wed May 22 23:22:36 2019 (r348130) @@ -433,29 +433,41 @@ /* * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info */ -#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 -#define CPUID_STDEXT2_UMIP 0x00000004 -#define CPUID_STDEXT2_PKU 0x00000008 -#define CPUID_STDEXT2_OSPKE 0x00000010 -#define CPUID_STDEXT2_WAITPKG 0x00000020 -#define CPUID_STDEXT2_GFNI 0x00000100 -#define CPUID_STDEXT2_RDPID 0x00400000 -#define CPUID_STDEXT2_CLDEMOTE 0x02000000 -#define CPUID_STDEXT2_MOVDIRI 0x08000000 +#define CPUID_STDEXT2_PREFETCHWT1 0x00000001 +#define CPUID_STDEXT2_AVX512VBMI 0x00000002 +#define CPUID_STDEXT2_UMIP 0x00000004 +#define CPUID_STDEXT2_PKU 0x00000008 +#define CPUID_STDEXT2_OSPKE 0x00000010 +#define CPUID_STDEXT2_WAITPKG 0x00000020 +#define CPUID_STDEXT2_AVX512VBMI2 0x00000040 +#define CPUID_STDEXT2_GFNI 0x00000100 +#define CPUID_STDEXT2_VAES 0x00000200 +#define CPUID_STDEXT2_VPCLMULQDQ 0x00000400 +#define CPUID_STDEXT2_AVX512VNNI 0x00000800 +#define CPUID_STDEXT2_AVX512BITALG 0x00001000 +#define CPUID_STDEXT2_AVX512VPOPCNTDQ 0x00004000 +#define CPUID_STDEXT2_RDPID 0x00400000 +#define CPUID_STDEXT2_CLDEMOTE 0x02000000 +#define CPUID_STDEXT2_MOVDIRI 0x08000000 #define CPUID_STDEXT2_MOVDIRI64B 0x10000000 -#define CPUID_STDEXT2_SGXLC 0x40000000 +#define CPUID_STDEXT2_ENQCMD 0x20000000 +#define CPUID_STDEXT2_SGXLC 0x40000000 /* * CPUID instruction 7 Structured Extended Features, leaf 0 edx info */ -#define CPUID_STDEXT3_MD_CLEAR 0x00000400 -#define CPUID_STDEXT3_TSXFA 0x00002000 -#define CPUID_STDEXT3_IBPB 0x04000000 -#define CPUID_STDEXT3_STIBP 0x08000000 -#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 -#define CPUID_STDEXT3_ARCH_CAP 0x20000000 -#define CPUID_STDEXT3_CORE_CAP 0x40000000 -#define CPUID_STDEXT3_SSBD 0x80000000 +#define CPUID_STDEXT3_AVX5124VNNIW 0x00000004 +#define CPUID_STDEXT3_AVX5124FMAPS 0x00000008 +#define CPUID_STDEXT3_AVX512VP2INTERSECT 0x00000100 +#define CPUID_STDEXT3_MD_CLEAR 0x00000400 +#define CPUID_STDEXT3_TSXFA 0x00002000 +#define CPUID_STDEXT3_PCONFIG 0x00040000 +#define CPUID_STDEXT3_IBPB 0x04000000 +#define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 +#define CPUID_STDEXT3_ARCH_CAP 0x20000000 +#define CPUID_STDEXT3_CORE_CAP 0x40000000 +#define CPUID_STDEXT3_SSBD 0x80000000 /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed May 22 23:19:20 2019 (r348129) +++ head/sys/x86/x86/identcpu.c Wed May 22 23:22:36 2019 (r348130) @@ -983,11 +983,18 @@ printcpuinfo(void) "\004PKU" "\005OSPKE" "\006WAITPKG" + "\007AVX512VBMI2" "\011GFNI" + "\012VAES" + "\013VPCLMULQDQ" + "\014AVX512VNNI" + "\015AVX512BITALG" + "\016AVX512VPOPCNTDQ" "\027RDPID" "\032CLDEMOTE" "\034MOVDIRI" "\035MOVDIRI64B" + "\036ENQCMD" "\037SGXLC" ); } @@ -996,8 +1003,12 @@ printcpuinfo(void) printf("\n Structured Extended Features3=0x%b", cpu_stdext_feature3, "\020" + "\003AVX512_4VNNIW" + "\004AVX512_4FMAPS" + "\011AVX512VP2INTERSECT" "\013MD_CLEAR" "\016TSXFA" + "\023PCONFIG" "\033IBPB" "\034STIBP" "\035L1DFL" From owner-svn-src-all@freebsd.org Wed May 22 23:23:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D49E31590FA8; Wed, 22 May 2019 23:23:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7850D70527; Wed, 22 May 2019 23:23: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5238C247A7; Wed, 22 May 2019 23:23:17 +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 x4MNNHS6062176; Wed, 22 May 2019 23:23:17 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNNH5v062175; Wed, 22 May 2019 23:23:17 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905222323.x4MNNH5v062175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 22 May 2019 23:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348131 - stable/12/lib/libsecureboot/openpgp X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: stable/12/lib/libsecureboot/openpgp X-SVN-Commit-Revision: 348131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7850D70527 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:23:18 -0000 Author: sjg Date: Wed May 22 23:23:16 2019 New Revision: 348131 URL: https://svnweb.freebsd.org/changeset/base/348131 Log: load_key_buf do not free data from dearmor The data returned by dearmor is referenced by the key leave it alone! MFC r347980 Reviewed by: stevek Modified: stable/12/lib/libsecureboot/openpgp/opgp_key.c stable/12/lib/libsecureboot/openpgp/opgp_sig.c Modified: stable/12/lib/libsecureboot/openpgp/opgp_key.c ============================================================================== --- stable/12/lib/libsecureboot/openpgp/opgp_key.c Wed May 22 23:22:36 2019 (r348130) +++ stable/12/lib/libsecureboot/openpgp/opgp_key.c Wed May 22 23:23:16 2019 (r348131) @@ -168,6 +168,7 @@ load_key_buf(unsigned char *buf, size_t nbytes) initialize(); if (!(buf[0] & OPENPGP_TAG_ISTAG)) { + /* Note: we do *not* free data */ data = dearmor((char *)buf, nbytes, &nbytes); ptr = data; } else @@ -190,7 +191,6 @@ load_key_buf(unsigned char *buf, size_t nbytes) } } } - free(data); return (key); } @@ -209,8 +209,10 @@ openpgp_trust_add(OpenPGP_key *key) LIST_INIT(&trust_list); } - if (key) + if (key) { + DEBUG_PRINTF(2, ("openpgp_trust_add(%s)\n", key->id)); LIST_INSERT_HEAD(&trust_list, key, entries); + } } /** @@ -296,6 +298,7 @@ load_key_id(const char *keyID) if (!key) key = load_trusted_key_id(keyID); #endif + DEBUG_PRINTF(2, ("load_key_id(%s): %s\n", keyID, key ? "found" : "nope")); return (key); } Modified: stable/12/lib/libsecureboot/openpgp/opgp_sig.c ============================================================================== --- stable/12/lib/libsecureboot/openpgp/opgp_sig.c Wed May 22 23:22:36 2019 (r348130) +++ stable/12/lib/libsecureboot/openpgp/opgp_sig.c Wed May 22 23:23:16 2019 (r348131) @@ -318,6 +318,7 @@ openpgp_verify(const char *filename, sdata = ddata = dearmor((char *)sdata, sbytes, &sbytes); ptr = sdata; rc = decode_packet(2, &ptr, sbytes, (decoder_t)decode_sig, sig); + DEBUG_PRINTF(2, ("rc=%d keyID=%s\n", rc, sig->key_id ? sig->key_id : "?")); if (rc == 0 && sig->key_id) { key = load_key_id(sig->key_id); if (!key) { From owner-svn-src-all@freebsd.org Wed May 22 23:34:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071041591577; Wed, 22 May 2019 23:34:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A307E70D76; Wed, 22 May 2019 23:34:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7930F24948; Wed, 22 May 2019 23:34:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4MNYfU0067677; Wed, 22 May 2019 23:34:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4MNYfdg067676; Wed, 22 May 2019 23:34:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905222334.x4MNYfdg067676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 May 2019 23:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348133 - stable/11/lib/libbe X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libbe X-SVN-Commit-Revision: 348133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A307E70D76 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 23:34:42 -0000 Author: kevans Date: Wed May 22 23:34:41 2019 New Revision: 348133 URL: https://svnweb.freebsd.org/changeset/base/348133 Log: MFC r347640: libbe(3): Descend into children of datasets w/ mountpoint=none These datasets will generally be canmount=noauto,mountpoint=none (e.g. zroot/var) but have children that may need to be mounted. Instead of skipping that segment for no good reason, descend. Approved by: re (kib) Modified: stable/11/lib/libbe/be_access.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Wed May 22 23:30:51 2019 (r348132) +++ stable/11/lib/libbe/be_access.c Wed May 22 23:34:41 2019 (r348133) @@ -99,13 +99,12 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (strcmp("none", zfs_mnt) == 0) { /* * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root... that's less - * than stellar and not entirely sure what to do with that. - * For now, we won't treat it as an error condition -- we just - * won't mount it, and we'll continue on. + * we're at the root. If we're not at the root, we're likely + * at some intermediate dataset (e.g. zroot/var) that will have + * children that may need to be mounted. */ if (info->depth > 0) - return (0); + goto skipmount; snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); } else { @@ -136,6 +135,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (!info->deepmount) return (0); +skipmount: ++info->depth; err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); --info->depth; From owner-svn-src-all@freebsd.org Thu May 23 00:55:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FA71593176; Thu, 23 May 2019 00:55:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94EC073118; Thu, 23 May 2019 00:55:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1172571D; Thu, 23 May 2019 00:55:35 +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 x4N0tZhM009514; Thu, 23 May 2019 00:55:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N0tS6H009477; Thu, 23 May 2019 00:55:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230055.x4N0tS6H009477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 00:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348136 - in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/inc... X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/include/gtest contrib/google... X-SVN-Commit-Revision: 348136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94EC073118 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 00:55:36 -0000 Author: ngie Date: Thu May 23 00:55:28 2019 New Revision: 348136 URL: https://svnweb.freebsd.org/changeset/base/348136 Log: MFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346574,r346576: r345203: Initial googlemock/googletest integration into the build/FreeBSD test suite This initial integration takes googlemock/googletest release 1.8.1, integrates the library, tests, and sample unit tests into the build. googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`. `MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when built with a C++11 capable toolchain. Google tests can be specified via the `GTESTS` variable, which, in comparison with the other test drivers, is more simplified/streamlined, as Googletest only supports C++ tests; not raw C or shell tests (C tests can be written in C++ using the standard embedding methods). No dependent libraries are assumed for the tests. One must specify `gmock`, `gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program. More information about googlemock and googletest can be found on the Googletest [project page](https://github.com/google/googletest), and the [GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md) and [GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs) docs. These tests are originally integrated into the build as plain driver tests, but will be natively integrated into Kyua in a later version. Known issues/Errata: * [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172) r345205: Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite This change integrates the unit tests for zfsd into the test suite using the integration method described in r345203. This change removes the `LOCALBASE` includes added for the port version of googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS` defines, which are included in the `GTEST_CXXFLAGS` variable, as part of r345203. r345353 (by asomers): googletest: backport GTEST_SKIP to googletest 1.8.1 This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and 59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to our included version of googletest, which is based on 1.8.1. It adds the GTEST_SKIP feature, which is very useful for a project like FreeBSD where some tests depend on particular system configurations. Obtained from: github.com/google/googletest r345645: Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS This makes it easier for googletest users to leverage googletest, instead of forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in unnecessary duplication). I will be following this up with a more proper fix in src.libnames.mk, as src.libnames.mk should be automatically adding this directory to CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result in mismatches between base-provided private library's and ports-provided library's headers. While here, tweak the comment to clarify what the intent is behind spamming CXXFLAGS. r345708: Standardize `-std=c++* as `CXXSTD` CXXSTD was added as the C++ analogue to CSTD. CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++. This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203. As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`. Notes: This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc. Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example: Before this commit: ``` CXXFLAGS+= -std=c++14 ``` After this commit: ``` CXXSTD= c++14 ``` Relnotes: yes Tested with: make tinderbox r345709: Allow users to override CSTD/CXXSTD on a per-prog basis The current logic for CSTD/CXXSTD requires homogenity as far as the supported C/C++ standards, which is a sensible default. However, when dealing with differing versions of C++, some code may compile with C++11, but not C++17 (for instance). So in order to avoid having people convert over their code to the new standard, give the users the ability to specify the standard on a per-program basis. This will allow a user to override the supporting standard for a set of programs, mixing C++11 with C++14 (for instance). Approved by: emaste (mentor) r345735: Allow programs to set `NO_SHARED` on a per-PROG basis This is particularly useful when installing programs for tests that need to be linked statically, e.g., mini-me from capsicum-test, which is linked statically to avoid the dynamic library lookup in the upstream project. r345770: Import proof-of-concept for handling `GTEST_SKIP()` in `Environment::SetUp` Per the upstream pull-request [1]: ``` gtest prior to this change would completely ignore `GTEST_SKIP()` if called in `Environment::SetUp()`, instead of bailing out early, unlike `Test::SetUp()`, which would cause the tests themselves to be skipped. The only way (prior to this change) to skip the tests would be to trigger a fatal error via `GTEST_FAIL()`. Desirable behavior, in this case, when dealing with `Environment::SetUp()` is to check for prerequisites on a system (example, kernel supports a particular featureset, e.g., capsicum), and skip the tests. The alternatives prior to this change would be undesirable: - Failing sends the wrong message to the test user, as the result of the tests is indeterminate, not failed. - Having to add per-test class abstractions that override `SetUp()` to test for the capsicum feature set, then skip all of the tests in their respective SetUp fixtures, would be a lot of human and computational work; checking for the feature would need to be done for all of the tests, instead of once for all of the tests. For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`, by not executing the testcases, is the most desirable solution. In order to properly diagnose what happened when running the tests if they are skipped, print out the diagnostics in an ad hoc manner. Update the documentation to note this change and integrate a new test, gtest_skip_in_environment_setup_test, into the test suite. This change addresses #2189. Signed-off-by: Enji Cooper ``` The goal with my merging in this change is to avoid requiring extensive refactoring/retesting of test suites when ensuring prerequisites are met, e.g., checking for a CAPABILITIES-enabled kernel before running capsicum-test (see D19758 for more details). The proof-of-concept is being imported before accepted by the upstream project due to the fact that the upstream project is undergoing a potential development freeze and the maintainers aren't responding to my PR. 1. https://github.com/google/googletest/pull/2203 r346574: Rework CXXSTD setting via r345708 This change allows the user to once again override the C++ standard, restoring high-level pre-r345708 behavior. This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11 capable compiler, e.g., g++ 4.2.1, as the library supported being built with older C++ standards. r346576: Fix up CXXSTD support originally added in r345708 r345708 worked for the base system, but unfortunately, caused a lot of disruption for third-party packages that relied on C++, since bsd.sys.mk is used by applications outside the base system. The defaults picked didn't match the compiler's defaults and broke some builds that didn't specify a standard, as well as some that overrode the value by setting `-std=gnu++14` (for example) manually. This change takes a more relaxed approach to appending `-std=${CXXSTD}` to CXXFLAGS, by only doing so when the value is specified, as opposed to overriding the standard set by an end-user. This avoids the need for having to bake NOP default into bsd.sys.mk for supported compiler-toolchain versions. In order to make this change possible, add CXXSTD to Makefile snippets which relied on the default value (c++11) added in r345708. Added: stable/12/contrib/googletest/ - copied from r345203, head/contrib/googletest/ stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc - copied unchanged from r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc - copied unchanged from r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc stable/12/lib/googletest/ - copied from r345203, head/lib/googletest/ stable/12/share/examples/tests/tests/googletest/ - copied from r345203, head/share/examples/tests/tests/googletest/ stable/12/share/mk/googletest.test.inc.mk - copied, changed from r345203, head/share/mk/googletest.test.inc.mk stable/12/share/mk/googletest.test.mk - copied unchanged from r345203, head/share/mk/googletest.test.mk stable/12/tools/build/options/WITHOUT_GOOGLETEST - copied unchanged from r345203, head/tools/build/options/WITHOUT_GOOGLETEST Modified: stable/12/cddl/usr.sbin/zfsd/Makefile stable/12/cddl/usr.sbin/zfsd/Makefile.common stable/12/cddl/usr.sbin/zfsd/tests/Makefile stable/12/contrib/googletest/googletest/CMakeLists.txt stable/12/contrib/googletest/googletest/Makefile.am stable/12/contrib/googletest/googletest/docs/advanced.md stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h stable/12/contrib/googletest/googletest/include/gtest/gtest.h stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h stable/12/contrib/googletest/googletest/src/gtest-test-part.cc stable/12/contrib/googletest/googletest/src/gtest.cc stable/12/contrib/googletest/googletest/test/BUILD.bazel stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc stable/12/contrib/googletest/googletest/test/gtest_all_test.cc stable/12/contrib/mandoc/lib.in stable/12/etc/mtree/BSD.tests.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/Makefile stable/12/lib/clang/llvm.build.mk stable/12/lib/googletest/gtest_main/tests/Makefile stable/12/lib/libc++/Makefile stable/12/lib/libc++experimental/Makefile stable/12/lib/libc++fs/Makefile stable/12/lib/libc/tests/stdlib/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/lib/libcxxrt/Makefile stable/12/lib/libgcc_eh/Makefile.inc stable/12/lib/libomp/Makefile stable/12/lib/ofed/libibnetdisc/Makefile stable/12/share/examples/tests/tests/Makefile stable/12/share/mk/Makefile stable/12/share/mk/bsd.README stable/12/share/mk/bsd.progs.mk stable/12/share/mk/bsd.sys.mk stable/12/share/mk/bsd.test.mk stable/12/share/mk/src.libnames.mk stable/12/share/mk/src.opts.mk stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptodevh.py stable/12/tests/sys/opencrypto/cryptotest.py stable/12/tests/sys/opencrypto/runtests.sh stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/dtc/Makefile stable/12/usr.sbin/pmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -1,12 +1,13 @@ # $FreeBSD$ +.include + .include "Makefile.common" PROG_CXX= zfsd MAN= zfsd.8 -.include +HAS_TESTS= +SUBDIR.${MK_GOOGLETEST}+= tests -# The unittests require devel/googletest and devel/googlemock from ports. -# Don't automatically build them. -SUBDIR= +.include Modified: stable/12/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:44:01 2019 (r348135) +++ stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:55:28 2019 (r348136) @@ -28,12 +28,11 @@ INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/li INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} -DPADD= ${LIBDEVDCTL} ${LIBZFS} ${LIBZFS_CORE} ${LIBUTIL} ${LIBGEOM} \ - ${LIBBSDXML} ${LIBSBUF} ${LIBNVPAIR} ${LIBUUTIL} -LIBADD= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil +LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil cscope: find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ Modified: stable/12/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -3,30 +3,12 @@ .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR:H} -PLAIN_TESTS_CXX= zfsd_unittest -SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} -SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc -SRCS= +GTESTS= zfsd_unittest -# Use #include in test programs. -INCFLAGS+= -I${.CURDIR:H:H} +SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} +SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc +.undef SRCS -.if defined(DESTDIR) || defined(SYSROOT) -INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include -LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \ - -L${SYSROOT:U${DESTDIR}}/usr/lib -.endif - -# Googletest options -INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread -LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread -LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a - -# GoogleMock options -LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a - -# Googlemock fails if we don't have this line -# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J -CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD +LIBADD.zfsd_unittest+= gmock_main .include Modified: stable/12/contrib/googletest/googletest/CMakeLists.txt ============================================================================== --- head/contrib/googletest/googletest/CMakeLists.txt Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/CMakeLists.txt Thu May 23 00:55:28 2019 (r348136) @@ -217,6 +217,8 @@ if (gtest_build_tests) test/gtest-typed-test2_test.cc) cxx_test(gtest_unittest gtest_main) cxx_test(gtest-unittest-api_test gtest) + cxx_test(gtest_skip_in_environment_setup_test gtest_main) + cxx_test(gtest_skip_test gtest_main) ############################################################ # C++ tests built with non-standard compiler flags. Modified: stable/12/contrib/googletest/googletest/Makefile.am ============================================================================== --- head/contrib/googletest/googletest/Makefile.am Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/Makefile.am Thu May 23 00:55:28 2019 (r348136) @@ -290,6 +290,12 @@ test_gtest_all_test_SOURCES = test/gtest_all_test.cc test_gtest_all_test_LDADD = lib/libgtest_main.la \ lib/libgtest.la +TESTS += test/gtest_skip_in_environment_setup_test +check_PROGRAMS += test/gtest_skip_in_environment_setup_test +test_gtest_skip_in_environment_setup_test_SOURCES = test/gtest_skip_in_environment_setup_test.cc +test_gtest_skip_in_environment_setup_test_LDADD= lib/libgtest_main.la \ + lib/libgtest.la + # Tests that fused gtest files compile and work. FUSED_GTEST_SRC = \ fused-src/gtest/gtest-all.cc \ Modified: stable/12/contrib/googletest/googletest/docs/advanced.md ============================================================================== --- head/contrib/googletest/googletest/docs/advanced.md Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/docs/advanced.md Thu May 23 00:55:28 2019 (r348136) @@ -1289,8 +1289,10 @@ Environment* AddGlobalTestEnvironment(Environment* env ``` Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of -the environment object, then runs the tests if there was no fatal failures, and -finally calls `TearDown()` of the environment object. +each environment object, then runs the tests if none of the environments +reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` +always calls `TearDown()` with each environment object, regardless of whether +or not the tests were run. It's OK to register multiple environment objects. In this case, their `SetUp()` will be called in the order they are registered, and their `TearDown()` will be Modified: stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/gtest-test-part.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h Thu May 23 00:55:28 2019 (r348136) @@ -53,7 +53,8 @@ class GTEST_API_ TestPartResult { enum Type { kSuccess, // Succeeded. kNonFatalFailure, // Failed but the test can continue. - kFatalFailure // Failed and the test should be terminated. + kFatalFailure, // Failed and the test should be terminated. + kSkip // Skipped. }; // C'tor. TestPartResult does NOT have a default constructor. @@ -89,17 +90,20 @@ class GTEST_API_ TestPartResult { // Gets the message associated with the test part. const char* message() const { return message_.c_str(); } + // Returns true iff the test part was skipped. + bool skipped() const { return type_ == kSkip; } + // Returns true iff the test part passed. bool passed() const { return type_ == kSuccess; } - // Returns true iff the test part failed. - bool failed() const { return type_ != kSuccess; } - // Returns true iff the test part non-fatally failed. bool nonfatally_failed() const { return type_ == kNonFatalFailure; } // Returns true iff the test part fatally failed. bool fatally_failed() const { return type_ == kFatalFailure; } + + // Returns true iff the test part failed. + bool failed() const { return fatally_failed() || nonfatally_failed(); } private: Type type_; Modified: stable/12/contrib/googletest/googletest/include/gtest/gtest.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/gtest.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/gtest.h Thu May 23 00:55:28 2019 (r348136) @@ -440,6 +440,9 @@ class GTEST_API_ Test { // Returns true iff the current test has a non-fatal failure. static bool HasNonfatalFailure(); + // Returns true iff the current test was skipped. + static bool IsSkipped(); + // Returns true iff the current test has a (either fatal or // non-fatal) failure. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } @@ -574,8 +577,11 @@ class GTEST_API_ TestResult { int test_property_count() const; // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } + bool Passed() const { return !Skipped() && !Failed(); } + // Returns true iff the test was skipped. + bool Skipped() const; + // Returns true iff the test failed. bool Failed() const; @@ -854,6 +860,9 @@ class GTEST_API_ TestCase { // Gets the number of successful tests in this test case. int successful_test_count() const; + // Gets the number of skipped tests in this test case. + int skipped_test_count() const; + // Gets the number of failed tests in this test case. int failed_test_count() const; @@ -936,6 +945,11 @@ class GTEST_API_ TestCase { return test_info->should_run() && test_info->result()->Passed(); } + // Returns true iff test skipped. + static bool TestSkipped(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Skipped(); + } + // Returns true iff test failed. static bool TestFailed(const TestInfo* test_info) { return test_info->should_run() && test_info->result()->Failed(); @@ -1258,6 +1272,9 @@ class GTEST_API_ UnitTest { // Gets the number of successful tests. int successful_test_count() const; + // Gets the number of skipped tests. + int skipped_test_count() const; + // Gets the number of failed tests. int failed_test_count() const; @@ -1834,6 +1851,11 @@ class TestWithParam : public Test, public WithParamInt }; // Macros for indicating success/failure in test code. + +// Skips test in runtime. +// Skipping test aborts current function. +// Skipped tests are neither successful nor failed. +#define GTEST_SKIP() GTEST_SKIP_("Skipped") // ADD_FAILURE unconditionally adds a failure to the current test. // SUCCEED generates a success - it doesn't automatically make the Modified: stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h Thu May 23 00:55:28 2019 (r348136) @@ -1208,7 +1208,10 @@ class NativeArray { #define GTEST_SUCCESS_(message) \ GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) -// Suppress MSVC warning 4702 (unreachable code) for the code following +#define GTEST_SKIP_(message) \ + return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip) + +// Suppress MSVC warning 4072 (unreachable code) for the code following // statement if it returns or throws (or doesn't return or throw in some // situations). #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ Modified: stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h ============================================================================== --- head/contrib/googletest/googletest/src/gtest-internal-inl.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h Thu May 23 00:55:28 2019 (r348136) @@ -544,6 +544,9 @@ class GTEST_API_ UnitTestImpl { // Gets the number of successful tests. int successful_test_count() const; + // Gets the number of skipped tests. + int skipped_test_count() const; + // Gets the number of failed tests. int failed_test_count() const; Modified: stable/12/contrib/googletest/googletest/src/gtest-test-part.cc ============================================================================== --- head/contrib/googletest/googletest/src/gtest-test-part.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest-test-part.cc Thu May 23 00:55:28 2019 (r348136) @@ -47,12 +47,16 @@ std::string TestPartResult::ExtractSummary(const char* // Prints a TestPartResult object. std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { - return os - << result.file_name() << ":" << result.line_number() << ": " - << (result.type() == TestPartResult::kSuccess ? "Success" : - result.type() == TestPartResult::kFatalFailure ? "Fatal failure" : - "Non-fatal failure") << ":\n" - << result.message() << std::endl; + return os << result.file_name() << ":" << result.line_number() << ": " + << (result.type() == TestPartResult::kSuccess + ? "Success" + : result.type() == TestPartResult::kSkip + ? "Skipped" + : result.type() == TestPartResult::kFatalFailure + ? "Fatal failure" + : "Non-fatal failure") + << ":\n" + << result.message() << std::endl; } // Appends a TestPartResult to the array. Modified: stable/12/contrib/googletest/googletest/src/gtest.cc ============================================================================== --- head/contrib/googletest/googletest/src/gtest.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest.cc Thu May 23 00:55:28 2019 (r348136) @@ -796,6 +796,11 @@ int UnitTestImpl::successful_test_count() const { return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count); } +// Gets the number of skipped tests. +int UnitTestImpl::skipped_test_count() const { + return SumOverTestCaseList(test_cases_, &TestCase::skipped_test_count); +} + // Gets the number of failed tests. int UnitTestImpl::failed_test_count() const { return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count); @@ -2207,6 +2212,16 @@ void TestResult::Clear() { elapsed_time_ = 0; } +// Returns true off the test part was skipped. +static bool TestPartSkipped(const TestPartResult& result) { + return result.skipped(); +} + +// Returns true iff the test was skipped. +bool TestResult::Skipped() const { + return !Failed() && CountIf(test_part_results_, TestPartSkipped) > 0; +} + // Returns true iff the test failed. bool TestResult::Failed() const { for (int i = 0; i < total_part_count(); ++i) { @@ -2511,8 +2526,9 @@ void Test::Run() { internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); impl->os_stack_trace_getter()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()"); - // We will run the test only if SetUp() was successful. - if (!HasFatalFailure()) { + // We will run the test only if SetUp() was successful and didn't call + // GTEST_SKIP(). + if (!HasFatalFailure() && !IsSkipped()) { impl->os_stack_trace_getter()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported( this, &Test::TestBody, "the test body"); @@ -2537,6 +2553,11 @@ bool Test::HasNonfatalFailure() { HasNonfatalFailure(); } +// Returns true iff the current test was skipped. +bool Test::IsSkipped() { + return internal::GetUnitTestImpl()->current_test_result()->Skipped(); +} + // class TestInfo // Constructs a TestInfo object. It assumes ownership of the test factory @@ -2685,9 +2706,10 @@ void TestInfo::Run() { factory_, &internal::TestFactoryBase::CreateTest, "the test fixture's constructor"); - // Runs the test if the constructor didn't generate a fatal failure. + // Runs the test if the constructor didn't generate a fatal failure or invoke + // GTEST_SKIP(). // Note that the object will not be null - if (!Test::HasFatalFailure()) { + if (!Test::HasFatalFailure() && !Test::IsSkipped()) { // This doesn't throw as all user code that can throw are wrapped into // exception handling code. test->Run(); @@ -2715,6 +2737,11 @@ int TestCase::successful_test_count() const { return CountIf(test_info_list_, TestPassed); } +// Gets the number of successful tests in this test case. +int TestCase::skipped_test_count() const { + return CountIf(test_info_list_, TestSkipped); +} + // Gets the number of failed tests in this test case. int TestCase::failed_test_count() const { return CountIf(test_info_list_, TestFailed); @@ -2866,6 +2893,8 @@ static std::string FormatTestCaseCount(int test_case_c // between the two when viewing the test result. static const char * TestPartResultTypeToString(TestPartResult::Type type) { switch (type) { + case TestPartResult::kSkip: + return "Skipped"; case TestPartResult::kSuccess: return "Success"; @@ -3119,6 +3148,7 @@ class PrettyUnitTestResultPrinter : public TestEventLi private: static void PrintFailedTests(const UnitTest& unit_test); + static void PrintSkippedTests(const UnitTest& unit_test); }; // Fired before each iteration of tests starts. @@ -3187,18 +3217,25 @@ void PrettyUnitTestResultPrinter::OnTestStart(const Te // Called after an assertion failure. void PrettyUnitTestResultPrinter::OnTestPartResult( const TestPartResult& result) { - // If the test part succeeded, we don't need to do anything. - if (result.type() == TestPartResult::kSuccess) - return; - - // Print failure message from the assertion (e.g. expected this and got that). - PrintTestPartResult(result); - fflush(stdout); + switch (result.type()) { + // If the test part succeeded, or was skipped, + // we don't need to do anything. + case TestPartResult::kSkip: + case TestPartResult::kSuccess: + return; + default: + // Print failure message from the assertion + // (e.g. expected this and got that). + PrintTestPartResult(result); + fflush(stdout); + } } void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) { if (test_info.result()->Passed()) { ColoredPrintf(COLOR_GREEN, "[ OK ] "); + } else if (test_info.result()->Skipped()) { + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); } else { ColoredPrintf(COLOR_RED, "[ FAILED ] "); } @@ -3248,7 +3285,7 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(con } for (int j = 0; j < test_case.total_test_count(); ++j) { const TestInfo& test_info = *test_case.GetTestInfo(j); - if (!test_info.should_run() || test_info.result()->Passed()) { + if (!test_info.should_run() || !test_info.result()->Failed()) { continue; } ColoredPrintf(COLOR_RED, "[ FAILED ] "); @@ -3259,6 +3296,30 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(con } } +// Internal helper for printing the list of skipped tests. +void PrettyUnitTestResultPrinter::PrintSkippedTests(const UnitTest& unit_test) { + const int skipped_test_count = unit_test.skipped_test_count(); + if (skipped_test_count == 0) { + return; + } + + for (int i = 0; i < unit_test.total_test_case_count(); ++i) { + const TestCase& test_case = *unit_test.GetTestCase(i); + if (!test_case.should_run() || (test_case.skipped_test_count() == 0)) { + continue; + } + for (int j = 0; j < test_case.total_test_count(); ++j) { + const TestInfo& test_info = *test_case.GetTestInfo(j); + if (!test_info.should_run() || !test_info.result()->Skipped()) { + continue; + } + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); + printf("%s.%s", test_case.name(), test_info.name()); + printf("\n"); + } + } +} + void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, int /*iteration*/) { ColoredPrintf(COLOR_GREEN, "[==========] "); @@ -3273,6 +3334,13 @@ void PrettyUnitTestResultPrinter::OnTestIterationEnd(c ColoredPrintf(COLOR_GREEN, "[ PASSED ] "); printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str()); + const int skipped_test_count = unit_test.skipped_test_count(); + if (skipped_test_count > 0) { + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); + printf("%s, listed below:\n", FormatTestCount(skipped_test_count).c_str()); + PrintSkippedTests(unit_test); + } + int num_failures = unit_test.failed_test_count(); if (!unit_test.Passed()) { const int failed_test_count = unit_test.failed_test_count(); @@ -4540,6 +4608,11 @@ int UnitTest::successful_test_count() const { return impl()->successful_test_count(); } +// Gets the number of skipped tests. +int UnitTest::skipped_test_count() const { + return impl()->skipped_test_count(); +} + // Gets the number of failed tests. int UnitTest::failed_test_count() const { return impl()->failed_test_count(); } @@ -4660,7 +4733,8 @@ void UnitTest::AddTestPartResult( impl_->GetTestPartResultReporterForCurrentThread()-> ReportTestPartResult(result); - if (result_type != TestPartResult::kSuccess) { + if (result_type != TestPartResult::kSuccess && + result_type != TestPartResult::kSkip) { // gtest_break_on_failure takes precedence over // gtest_throw_on_failure. This allows a user to set the latter // in the code (perhaps in order to use Google Test assertions @@ -5169,9 +5243,23 @@ bool UnitTestImpl::RunAllTests() { ForEach(environments_, SetUpEnvironment); repeater->OnEnvironmentsSetUpEnd(*parent_); - // Runs the tests only if there was no fatal failure during global - // set-up. - if (!Test::HasFatalFailure()) { + // Runs the tests only if there was no fatal failure or skip triggered + // during global set-up. + if (Test::IsSkipped()) { + // Emit diagnostics when global set-up calls skip, as it will not be + // emitted by default. + TestResult& test_result = + *internal::GetUnitTestImpl()->current_test_result(); + for (int j = 0; j < test_result.total_part_count(); ++j) { + const TestPartResult& test_part_result = + test_result.GetTestPartResult(j); + if (test_part_result.type() == TestPartResult::kSkip) { + const std::string& result = test_part_result.message(); + printf("%s\n", result.c_str()); + } + } + fflush(stdout); + } else if (!Test::HasFatalFailure()) { for (int test_index = 0; test_index < total_test_case_count(); test_index++) { GetMutableTestCase(test_index)->Run(); Modified: stable/12/contrib/googletest/googletest/test/BUILD.bazel ============================================================================== --- head/contrib/googletest/googletest/test/BUILD.bazel Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/BUILD.bazel Thu May 23 00:55:28 2019 (r348136) @@ -311,6 +311,13 @@ cc_binary( deps = ["//:gtest"], ) +cc_test( + name = "gtest_skip_in_environment_setup_test", + size = "small", + srcs = ["gtest_skip_in_environment_setup_test.cc"], + deps = ["//:gtest_main"], +) + py_test( name = "googletest-list-tests-unittest", size = "small", Modified: stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-test-part-test.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc Thu May 23 00:55:28 2019 (r348136) @@ -46,9 +46,10 @@ class TestPartResultTest : public Test { TestPartResultTest() : r1_(TestPartResult::kSuccess, "foo/bar.cc", 10, "Success!"), r2_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure!"), - r3_(TestPartResult::kFatalFailure, NULL, -1, "Failure!") {} + r3_(TestPartResult::kFatalFailure, nullptr, -1, "Failure!"), + r4_(TestPartResult::kSkip, "foo/bar.cc", 2, "Skipped!") {} - TestPartResult r1_, r2_, r3_; + TestPartResult r1_, r2_, r3_, r4_; }; @@ -79,6 +80,7 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_FALSE(success.failed()); EXPECT_FALSE(success.nonfatally_failed()); EXPECT_FALSE(success.fatally_failed()); + EXPECT_FALSE(success.skipped()); const TestPartResult nonfatal_failure(TestPartResult::kNonFatalFailure, "file.cc", @@ -88,6 +90,7 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_TRUE(nonfatal_failure.failed()); EXPECT_TRUE(nonfatal_failure.nonfatally_failed()); EXPECT_FALSE(nonfatal_failure.fatally_failed()); + EXPECT_FALSE(nonfatal_failure.skipped()); const TestPartResult fatal_failure(TestPartResult::kFatalFailure, "file.cc", @@ -97,6 +100,14 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_TRUE(fatal_failure.failed()); EXPECT_FALSE(fatal_failure.nonfatally_failed()); EXPECT_TRUE(fatal_failure.fatally_failed()); + EXPECT_FALSE(fatal_failure.skipped()); + + const TestPartResult skip(TestPartResult::kSkip, "file.cc", 42, "message"); + EXPECT_FALSE(skip.passed()); + EXPECT_FALSE(skip.failed()); + EXPECT_FALSE(skip.nonfatally_failed()); + EXPECT_FALSE(skip.fatally_failed()); + EXPECT_TRUE(skip.skipped()); } // Tests TestPartResult::type(). @@ -104,23 +115,27 @@ TEST_F(TestPartResultTest, type) { EXPECT_EQ(TestPartResult::kSuccess, r1_.type()); EXPECT_EQ(TestPartResult::kNonFatalFailure, r2_.type()); EXPECT_EQ(TestPartResult::kFatalFailure, r3_.type()); + EXPECT_EQ(TestPartResult::kSkip, r4_.type()); } // Tests TestPartResult::file_name(). TEST_F(TestPartResultTest, file_name) { EXPECT_STREQ("foo/bar.cc", r1_.file_name()); EXPECT_STREQ(NULL, r3_.file_name()); + EXPECT_STREQ("foo/bar.cc", r4_.file_name()); } // Tests TestPartResult::line_number(). TEST_F(TestPartResultTest, line_number) { EXPECT_EQ(10, r1_.line_number()); EXPECT_EQ(-1, r2_.line_number()); + EXPECT_EQ(2, r4_.line_number()); } // Tests TestPartResult::message(). TEST_F(TestPartResultTest, message) { EXPECT_STREQ("Success!", r1_.message()); + EXPECT_STREQ("Skipped!", r4_.message()); } // Tests TestPartResult::passed(). @@ -128,6 +143,7 @@ TEST_F(TestPartResultTest, Passed) { EXPECT_TRUE(r1_.passed()); EXPECT_FALSE(r2_.passed()); EXPECT_FALSE(r3_.passed()); + EXPECT_FALSE(r4_.passed()); } // Tests TestPartResult::failed(). @@ -135,13 +151,23 @@ TEST_F(TestPartResultTest, Failed) { EXPECT_FALSE(r1_.failed()); EXPECT_TRUE(r2_.failed()); EXPECT_TRUE(r3_.failed()); + EXPECT_FALSE(r4_.failed()); } +// Tests TestPartResult::failed(). +TEST_F(TestPartResultTest, Skipped) { + EXPECT_FALSE(r1_.skipped()); + EXPECT_FALSE(r2_.skipped()); + EXPECT_FALSE(r3_.skipped()); + EXPECT_TRUE(r4_.skipped()); +} + // Tests TestPartResult::fatally_failed(). TEST_F(TestPartResultTest, FatallyFailed) { EXPECT_FALSE(r1_.fatally_failed()); EXPECT_FALSE(r2_.fatally_failed()); EXPECT_TRUE(r3_.fatally_failed()); + EXPECT_FALSE(r4_.fatally_failed()); } // Tests TestPartResult::nonfatally_failed(). @@ -149,6 +175,7 @@ TEST_F(TestPartResultTest, NonfatallyFailed) { EXPECT_FALSE(r1_.nonfatally_failed()); EXPECT_TRUE(r2_.nonfatally_failed()); EXPECT_FALSE(r3_.nonfatally_failed()); + EXPECT_FALSE(r4_.nonfatally_failed()); } // Tests the TestPartResultArray class. Modified: stable/12/contrib/googletest/googletest/test/gtest_all_test.cc ============================================================================== --- head/contrib/googletest/googletest/test/gtest_all_test.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/gtest_all_test.cc Thu May 23 00:55:28 2019 (r348136) @@ -37,10 +37,11 @@ #include "test/googletest-message-test.cc" #include "test/googletest-options-test.cc" #include "test/googletest-port-test.cc" -#include "test/gtest_pred_impl_unittest.cc" -#include "test/gtest_prod_test.cc" #include "test/googletest-test-part-test.cc" -#include "test/gtest-typed-test_test.cc" #include "test/gtest-typed-test2_test.cc" +#include "test/gtest-typed-test_test.cc" +#include "test/gtest_pred_impl_unittest.cc" +#include "test/gtest_prod_test.cc" +#include "test/gtest_skip_test.cc" #include "test/gtest_unittest.cc" #include "test/production.cc" Copied: stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc (from r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc Thu May 23 00:55:28 2019 (r348136, copy of r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc) @@ -0,0 +1,60 @@ +// Copyright 2019, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// This test verifies that skipping in the environment results in the +// testcases being skipped. +// +// This is a reproduction case for +// https://github.com/google/googletest/issues/2189 . + +#include +#include + +class SetupEnvironment : public testing::Environment { +public: + void SetUp() override { + GTEST_SKIP() << "Skipping the entire environment"; + } +}; + +TEST(Test, AlwaysPasses) { + EXPECT_EQ(true, true); +} + +TEST(Test, AlwaysFails) { + EXPECT_EQ(true, false); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + + testing::AddGlobalTestEnvironment(new SetupEnvironment()); + + return (RUN_ALL_TESTS()); +} Copied: stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc (from r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc Thu May 23 00:55:28 2019 (r348136, copy of r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc) @@ -0,0 +1,55 @@ +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: arseny.aprelev@gmail.com (Arseny Aprelev) +// + +#include "gtest/gtest.h" + +using ::testing::Test; + +TEST(SkipTest, DoesSkip) { + GTEST_SKIP(); + EXPECT_EQ(0, 1); +} + +class Fixture : public Test { + protected: + void SetUp() override { + GTEST_SKIP() << "skipping all tests for this fixture"; + } +}; + +TEST_F(Fixture, SkipsOneTest) { + EXPECT_EQ(5, 7); +} + +TEST_F(Fixture, SkipsAnotherTest) { + EXPECT_EQ(99, 100); +} Modified: stable/12/contrib/mandoc/lib.in ============================================================================== --- stable/12/contrib/mandoc/lib.in Thu May 23 00:44:01 2019 (r348135) +++ stable/12/contrib/mandoc/lib.in Thu May 23 00:55:28 2019 (r348136) @@ -62,7 +62,9 @@ LINE("libfsid", "Filesystem Identification Library (l LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") +LINE("libgmock", "GoogleMock library (libgmock, \\-lgmock)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") +LINE("libgtest", "GoogleTest library (libgtest, \\-lgtest)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:44:01 2019 (r348135) +++ stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:55:28 2019 (r348136) @@ -270,6 +270,16 @@ test-programs .. .. + googletest + gmock + .. + gmock_main + .. + gtest + .. + gtest_main + .. + .. libarchive .. libbe @@ -423,6 +433,8 @@ examples tests atf + .. + googletest .. plain .. Modified: stable/12/etc/mtree/BSD.usr.dist ============================================================================== --- stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:44:01 2019 (r348135) +++ stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:55:28 2019 (r348136) @@ -13,6 +13,18 @@ .. event .. + gmock + internal + custom + .. + .. + .. + gtest + internal + custom + .. + .. + .. sqlite3 .. ucl Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -170,6 +170,7 @@ _libcplusplus+= libc++fs .endif SUBDIR.${MK_EFI}+= libefivar +SUBDIR.${MK_GOOGLETEST}+= googletest SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/clang/llvm.build.mk Thu May 23 00:55:28 2019 (r348136) @@ -101,7 +101,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXFLAGS+= -std=c++11 +CXXSTD?= c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: stable/12/lib/googletest/gtest_main/tests/Makefile ============================================================================== --- head/lib/googletest/gtest_main/tests/Makefile Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/lib/googletest/gtest_main/tests/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -18,6 +18,8 @@ GTESTS+= gtest_prod_test GTESTS+= gtest_sole_header_test GTESTS+= googletest-test-part-test GTESTS+= gtest-typed-test_test +GTESTS+= gtest_skip_test +GTESTS+= gtest_skip_in_environment_setup_test GTESTS+= gtest_unittest CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include Modified: stable/12/lib/libc++/Makefile ============================================================================== --- stable/12/lib/libc++/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libc++/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -76,9 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD?= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: stable/12/lib/libc++experimental/Makefile ============================================================================== --- stable/12/lib/libc++experimental/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libc++experimental/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -20,8 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD?= c++14 .include Modified: stable/12/lib/libc++fs/Makefile ============================================================================== --- stable/12/lib/libc++fs/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libc++fs/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -22,8 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD?= c++14 .include Modified: stable/12/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -49,8 +49,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 -CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +CXXSTD.cxa_thread_atexit_test= c++11 +CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: stable/12/lib/libclang_rt/Makefile.inc ============================================================================== --- stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:55:28 2019 (r348136) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 Modified: stable/12/lib/libcxxrt/Makefile ============================================================================== --- stable/12/lib/libcxxrt/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libcxxrt/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -22,9 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD?= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: stable/12/lib/libgcc_eh/Makefile.inc ============================================================================== --- stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:55:28 2019 (r348136) @@ -27,10 +27,8 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif CXXFLAGS+= -fno-rtti +CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: stable/12/lib/libomp/Makefile ============================================================================== --- stable/12/lib/libomp/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/libomp/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden -CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: stable/12/lib/ofed/libibnetdisc/Makefile ============================================================================== --- stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -32,7 +32,7 @@ CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband .if ${COMPILER_FEATURES:Mc++11} -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 .endif VERSION_MAP= ${_spath}/libibnetdisc.map Modified: stable/12/share/examples/tests/tests/Makefile ============================================================================== --- stable/12/share/examples/tests/tests/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/share/examples/tests/tests/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # Directory into which the Kyuafile provided by this directory will be # installed. # @@ -20,6 +22,10 @@ TESTS_SUBDIRS+= atf TESTS_SUBDIRS+= plain TESTS_SUBDIRS+= tap + +.if ${MK_GOOGLETEST} != no +TESTS_SUBDIRS+= googletest +.endif # We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile # for us based on the contents of the TESTS_SUBDIRS line above. The Modified: stable/12/share/mk/Makefile ============================================================================== --- stable/12/share/mk/Makefile Thu May 23 00:44:01 2019 (r348135) +++ stable/12/share/mk/Makefile Thu May 23 00:55:28 2019 (r348136) @@ -73,6 +73,8 @@ FILESDIR= ${BINDIR}/mk *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 23 00:59:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0696315932ED; Thu, 23 May 2019 00:59:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5A1C732C6; Thu, 23 May 2019 00:59: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F21725725; Thu, 23 May 2019 00:59: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 x4N0xBtT009753; Thu, 23 May 2019 00:59:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N0x5Vx009724; Thu, 23 May 2019 00:59:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230059.x4N0x5Vx009724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 00:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348137 - in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/mandoc etc/mtree lib lib/clang lib/googletest lib/libc++ lib/libc++experimental lib/libc++... X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/mandoc etc/mtree lib lib/clang lib/googletest lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib ... X-SVN-Commit-Revision: 348137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5A1C732C6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 00:59:12 -0000 Author: ngie Date: Thu May 23 00:59:05 2019 New Revision: 348137 URL: https://svnweb.freebsd.org/changeset/base/348137 Log: Revert r348136 I accidentally committed some unrelated local changes to `.../tests/sys/opencrypto` along with this MFC set. Deleted: stable/12/contrib/googletest/ stable/12/lib/googletest/ stable/12/share/examples/tests/tests/googletest/ stable/12/share/mk/googletest.test.inc.mk stable/12/share/mk/googletest.test.mk stable/12/tools/build/options/WITHOUT_GOOGLETEST Modified: stable/12/cddl/usr.sbin/zfsd/Makefile stable/12/cddl/usr.sbin/zfsd/Makefile.common stable/12/cddl/usr.sbin/zfsd/tests/Makefile stable/12/contrib/mandoc/lib.in stable/12/etc/mtree/BSD.tests.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/Makefile stable/12/lib/clang/llvm.build.mk stable/12/lib/libc++/Makefile stable/12/lib/libc++experimental/Makefile stable/12/lib/libc++fs/Makefile stable/12/lib/libc/tests/stdlib/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/lib/libcxxrt/Makefile stable/12/lib/libgcc_eh/Makefile.inc stable/12/lib/libomp/Makefile stable/12/lib/ofed/libibnetdisc/Makefile stable/12/share/examples/tests/tests/Makefile stable/12/share/mk/Makefile stable/12/share/mk/bsd.README stable/12/share/mk/bsd.progs.mk stable/12/share/mk/bsd.sys.mk stable/12/share/mk/bsd.test.mk stable/12/share/mk/src.libnames.mk stable/12/share/mk/src.opts.mk stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptodevh.py stable/12/tests/sys/opencrypto/cryptotest.py stable/12/tests/sys/opencrypto/runtests.sh stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/dtc/Makefile stable/12/usr.sbin/pmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -1,13 +1,12 @@ # $FreeBSD$ -.include - .include "Makefile.common" PROG_CXX= zfsd MAN= zfsd.8 -HAS_TESTS= -SUBDIR.${MK_GOOGLETEST}+= tests - .include + +# The unittests require devel/googletest and devel/googlemock from ports. +# Don't automatically build them. +SUBDIR= Modified: stable/12/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:59:05 2019 (r348137) @@ -28,11 +28,12 @@ INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/li INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} -LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil +DPADD= ${LIBDEVDCTL} ${LIBZFS} ${LIBZFS_CORE} ${LIBUTIL} ${LIBGEOM} \ + ${LIBBSDXML} ${LIBSBUF} ${LIBNVPAIR} ${LIBUUTIL} +LIBADD= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil cscope: find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ Modified: stable/12/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -3,12 +3,30 @@ .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR:H} -GTESTS= zfsd_unittest +PLAIN_TESTS_CXX= zfsd_unittest +SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} +SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc +SRCS= -SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} -SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc -.undef SRCS +# Use #include in test programs. +INCFLAGS+= -I${.CURDIR:H:H} -LIBADD.zfsd_unittest+= gmock_main +.if defined(DESTDIR) || defined(SYSROOT) +INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include +LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \ + -L${SYSROOT:U${DESTDIR}}/usr/lib +.endif + +# Googletest options +INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread +LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread +LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a + +# GoogleMock options +LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a + +# Googlemock fails if we don't have this line +# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J +CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD .include Modified: stable/12/contrib/mandoc/lib.in ============================================================================== --- stable/12/contrib/mandoc/lib.in Thu May 23 00:55:28 2019 (r348136) +++ stable/12/contrib/mandoc/lib.in Thu May 23 00:59:05 2019 (r348137) @@ -62,9 +62,7 @@ LINE("libfsid", "Filesystem Identification Library (l LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") -LINE("libgmock", "GoogleMock library (libgmock, \\-lgmock)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") -LINE("libgtest", "GoogleTest library (libgtest, \\-lgtest)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:55:28 2019 (r348136) +++ stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:59:05 2019 (r348137) @@ -270,16 +270,6 @@ test-programs .. .. - googletest - gmock - .. - gmock_main - .. - gtest - .. - gtest_main - .. - .. libarchive .. libbe @@ -433,8 +423,6 @@ examples tests atf - .. - googletest .. plain .. Modified: stable/12/etc/mtree/BSD.usr.dist ============================================================================== --- stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:55:28 2019 (r348136) +++ stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:59:05 2019 (r348137) @@ -13,18 +13,6 @@ .. event .. - gmock - internal - custom - .. - .. - .. - gtest - internal - custom - .. - .. - .. sqlite3 .. ucl Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -170,7 +170,6 @@ _libcplusplus+= libc++fs .endif SUBDIR.${MK_EFI}+= libefivar -SUBDIR.${MK_GOOGLETEST}+= googletest SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/clang/llvm.build.mk Thu May 23 00:59:05 2019 (r348137) @@ -101,7 +101,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXSTD?= c++11 +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: stable/12/lib/libc++/Makefile ============================================================================== --- stable/12/lib/libc++/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -76,7 +76,9 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD?= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: stable/12/lib/libc++experimental/Makefile ============================================================================== --- stable/12/lib/libc++experimental/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++experimental/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -20,6 +20,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD?= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: stable/12/lib/libc++fs/Makefile ============================================================================== --- stable/12/lib/libc++fs/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++fs/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -22,6 +22,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD?= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: stable/12/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -49,8 +49,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXSTD.cxa_thread_atexit_test= c++11 -CXXSTD.cxa_thread_atexit_nothr_test= c++11 +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: stable/12/lib/libclang_rt/Makefile.inc ============================================================================== --- stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:59:05 2019 (r348137) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 Modified: stable/12/lib/libcxxrt/Makefile ============================================================================== --- stable/12/lib/libcxxrt/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libcxxrt/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -22,7 +22,9 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD?= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/Version.map .include Modified: stable/12/lib/libgcc_eh/Makefile.inc ============================================================================== --- stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:59:05 2019 (r348137) @@ -27,8 +27,10 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif CXXFLAGS+= -fno-rtti -CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: stable/12/lib/libomp/Makefile ============================================================================== --- stable/12/lib/libomp/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libomp/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: stable/12/lib/ofed/libibnetdisc/Makefile ============================================================================== --- stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -32,7 +32,7 @@ CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband .if ${COMPILER_FEATURES:Mc++11} -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 .endif VERSION_MAP= ${_spath}/libibnetdisc.map Modified: stable/12/share/examples/tests/tests/Makefile ============================================================================== --- stable/12/share/examples/tests/tests/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/examples/tests/tests/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - # Directory into which the Kyuafile provided by this directory will be # installed. # @@ -22,10 +20,6 @@ TESTS_SUBDIRS+= atf TESTS_SUBDIRS+= plain TESTS_SUBDIRS+= tap - -.if ${MK_GOOGLETEST} != no -TESTS_SUBDIRS+= googletest -.endif # We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile # for us based on the contents of the TESTS_SUBDIRS line above. The Modified: stable/12/share/mk/Makefile ============================================================================== --- stable/12/share/mk/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -73,8 +73,6 @@ FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" FILES+= atf.test.mk -FILES+= googletest.test.inc.mk -FILES+= googletest.test.mk FILES+= plain.test.mk FILES+= suite.test.mk FILES+= tap.test.mk Modified: stable/12/share/mk/bsd.README ============================================================================== --- stable/12/share/mk/bsd.README Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.README Thu May 23 00:59:05 2019 (r348137) @@ -649,8 +649,6 @@ ATF_TESTS_CXX The names of the ATF C++ test programs t ATF_TESTS_SH The names of the ATF sh test programs to build. -GTESTS The names of the GoogleTest test programs to build. - KYUAFILE If 'auto' (the default), generate a Kyuafile out of the test programs defined in the Makefile. If 'yes', then a manually-crafted Kyuafile must be supplied with the Modified: stable/12/share/mk/bsd.progs.mk ============================================================================== --- stable/12/share/mk/bsd.progs.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.progs.mk Thu May 23 00:59:05 2019 (r348137) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_SHARED NO_WERROR PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ + PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: stable/12/share/mk/bsd.sys.mk ============================================================================== --- stable/12/share/mk/bsd.sys.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.sys.mk Thu May 23 00:59:05 2019 (r348137) @@ -24,11 +24,6 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD - -.if !empty(CXXSTD) -CXXFLAGS+= -std=${CXXSTD} -.endif - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: stable/12/share/mk/bsd.test.mk ============================================================================== --- stable/12/share/mk/bsd.test.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.test.mk Thu May 23 00:59:05 2019 (r348137) @@ -63,7 +63,6 @@ _TESTS= # Pull in the definitions of all supported test interfaces. .include -.include .include .include Modified: stable/12/share/mk/src.libnames.mk ============================================================================== --- stable/12/share/mk/src.libnames.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/src.libnames.mk Thu May 23 00:59:05 2019 (r348137) @@ -18,10 +18,6 @@ _PRIVATELIBS= \ bsdstat \ devdctl \ event \ - gmock \ - gtest \ - gmock_main \ - gtest_main \ heimipcc \ heimipcs \ ifconfig \ @@ -304,10 +300,6 @@ _DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c -_DP_gtest= pthread -_DP_gmock= gtest -_DP_gmock_main= gmock -_DP_gtest_main= gtest _DP_devstat= kvm _DP_pam= radius tacplus opie md util .if ${MK_KERBEROS} != "no" @@ -385,15 +377,6 @@ LIBATF_CXX= ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf- LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ -LIBGMOCK= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock.a -LIBGMOCK_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock_main.a -LIBGTEST= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest.a -LIBGTEST_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest_main.a -LDADD_gmock= -lprivategmock -LDADD_gtest= -lprivategtest -LDADD_gmock_main= -lprivategmock_main -LDADD_gtest_main= -lprivategtest_main - .for _l in ${_PRIVATELIBS} LIB${_l:tu}?= ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a .endfor @@ -430,15 +413,6 @@ LDADD_${_l}+= ${LDADD_${_d}} DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} -DPADD_gmock+= ${DPADD_gtest} -LDADD_gmock+= ${LDADD_gtest} - -DPADD_gmock_main+= ${DPADD_gmock} -LDADD_gmock_main+= ${LDADD_gmock} - -DPADD_gtest_main+= ${DPADD_gtest} -LDADD_gtest_main+= ${LDADD_gtest} - # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. _BADLDADD= .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} @@ -577,10 +551,6 @@ LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind LIBATF_CDIR= ${OBJTOP}/lib/atf/libatf-c LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf-c++ -LIBGMOCKDIR= ${OBJTOP}/lib/googletest/gmock -LIBGMOCK_MAINDIR= ${OBJTOP}/lib/googletest/gmock_main -LIBGTESTDIR= ${OBJTOP}/lib/googletest/gtest -LIBGTEST_MAINDIR= ${OBJTOP}/lib/googletest/gtest_main LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias LIBBLACKLISTDIR= ${OBJTOP}/lib/libblacklist LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/src.opts.mk Thu May 23 00:59:05 2019 (r348137) @@ -108,7 +108,6 @@ __DEFAULT_YES_OPTIONS = \ GDB \ GNU_DIFF \ GNU_GREP \ - GOOGLETEST \ GPIO \ HAST \ HTML \ @@ -435,7 +434,6 @@ MK_${var}:= no # Order is somewhat important. # .if !${COMPILER_FEATURES:Mc++11} -MK_GOOGLETEST:= no MK_LLVM_LIBUNWIND:= no .endif @@ -518,10 +516,6 @@ MK_FREEBSD_UPDATE:= no .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no -.endif - -.if ${MK_TESTS_SUPPORT} == "no" -MK_GOOGLETEST:= no .endif .if ${MK_ZONEINFO} == "no" Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 00:55:28 2019 (r348136) +++ stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 00:59:05 2019 (r348137) @@ -3,7 +3,6 @@ # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney # All rights reserved. -# Copyright 2019 Enji Cooper # # This software was developed by John-Mark Gurney under # the sponsorship from the FreeBSD Foundation. @@ -33,85 +32,76 @@ from __future__ import print_function import array -import binascii +import dpkt from fcntl import ioctl import os -import random import signal from struct import pack as _pack -import sys -import time -import dpkt - from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] class FindOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('crid', 'i', 0), - ('name', '32s', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('crid', 'i', 0), + ('name', '32s', 0), + ) class SessionOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ) class SessionOp2(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ('crid', 'i', 0), - ('pad0', 'i', 0), - ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ('crid', 'i', 0), + ('pad0', 'i', 0), + ('pad1', 'i', 0), + ('pad2', 'i', 0), + ('pad3', 'i', 0), + ) class CryptOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('mac', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('mac', 'P', 0), + ('iv', 'P', 0), + ) class CryptAEAD(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('aadlen', 'I', 0), - ('ivlen', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('aad', 'P', 0), - ('tag', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('aadlen', 'I', 0), + ('ivlen', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('aad', 'P', 0), + ('tag', 'P', 0), + ('iv', 'P', 0), + ) # h2py.py can't handle multiarg macros CRIOGET = 3221513060 @@ -126,595 +116,445 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - buf = array.array('I', [0]) - fd = os.open('/dev/crypto', os.O_RDWR) - try: - ioctl(fd, CRIOGET, buf, 1) - finally: - os.close(fd) + fd = os.open('/dev/crypto', os.O_RDWR) + buf = array.array('I', [0]) + ioctl(fd, CRIOGET, buf, 1) + os.close(fd) - return buf[0] + return buf[0] _cryptodev = _getdev() -def str_to_ascii(val): - if sys.version_info[0] >= 3: - if isinstance(val, str): - return val.encode("ascii") - return val - def _findop(crid, name): - fop = FindOp() - fop.crid = crid - fop.name = str_to_ascii(name) - s = array.array('B', fop.pack_hdr()) - ioctl(_cryptodev, CIOCFINDDEV, s, 1) - fop.unpack(s) + fop = FindOp() + fop.crid = crid + fop.name = name + s = array.array('B', fop.pack_hdr()) + ioctl(_cryptodev, CIOCFINDDEV, s, 1) + fop.unpack(s) - try: - idx = fop.name.index(b'\x00') - name = fop.name[:idx] - except ValueError: - name = fop.name + try: + idx = fop.name.index('\x00') + name = fop.name[:idx] + except ValueError: + name = fop.name - return fop.crid, name + return fop.crid, name -def array_tobytes(array_obj): - if sys.version_info[:2] >= (3, 2): - return array_obj.tobytes() - return array_obj.tostring() - class Crypto: - @staticmethod - def findcrid(name): - return _findop(-1, name)[0] + @staticmethod + def findcrid(name): + return _findop(-1, name)[0] - @staticmethod - def getcridname(crid): - return _findop(crid, '')[1] + @staticmethod + def getcridname(crid): + return _findop(crid, '')[1] - def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): - self._ses = None - self._maclen = maclen - ses = SessionOp2() - ses.cipher = cipher - ses.mac = mac + def __init__(self, cipher=0, key=None, mac=0, mackey=None, + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE): + self._ses = None + ses = SessionOp2() + ses.cipher = cipher + ses.mac = mac - if key is not None: - ses.keylen = len(key) - k = array.array('B', key) - ses.key = k.buffer_info()[0] - else: - self.key = None + if key is not None: + ses.keylen = len(key) + k = array.array('B', key) + ses.key = k.buffer_info()[0] + else: + self.key = None - if mackey is not None: - ses.mackeylen = len(mackey) - mk = array.array('B', mackey) - ses.mackey = mk.buffer_info()[0] + if mackey is not None: + ses.mackeylen = len(mackey) + mk = array.array('B', mackey) + ses.mackey = mk.buffer_info()[0] + self._maclen = 16 # parameterize? + else: + self._maclen = None - if not cipher and not mac: - raise ValueError('one of cipher or mac MUST be specified.') - ses.crid = crid - #print(ses) - s = array.array('B', ses.pack_hdr()) - #print(s) - ioctl(_cryptodev, CIOCGSESSION2, s, 1) - ses.unpack(s) + if not cipher and not mac: + raise ValueError('one of cipher or mac MUST be specified.') + ses.crid = crid + #print(ses) + s = array.array('B', ses.pack_hdr()) + #print(s) + ioctl(_cryptodev, CIOCGSESSION2, s, 1) + ses.unpack(s) - self._ses = ses.ses + self._ses = ses.ses - def __del__(self): - if self._ses is None: - return + def __del__(self): + if self._ses is None: + return - try: - ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) - except TypeError: - pass - self._ses = None + try: + ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) + except TypeError: + pass + self._ses = None - def _doop(self, op, src, iv): - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(src) - s = array.array('B', src) - cop.src = cop.dst = s.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', str_to_ascii(iv)) - cop.iv = ivbuf.buffer_info()[0] + def _doop(self, op, src, iv): + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(src) + s = array.array('B', src) + cop.src = cop.dst = s.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', iv) + cop.iv = ivbuf.buffer_info()[0] - cop_b = bytes(cop) - #print('cop:', cop_b) - ioctl(_cryptodev, CIOCCRYPT, cop_b) + #print('cop:', cop) + ioctl(_cryptodev, CIOCCRYPT, str(cop)) - s = array_tobytes(s) - if self._maclen is not None: - return s, array_tobytes(m) + s = s.tostring() + if self._maclen is not None: + return s, m.tostring() - return s + return s - def _doaead(self, op, src, aad, iv, tag=None): - caead = CryptAEAD() - caead.ses = self._ses - caead.op = op - caead.flags = CRD_F_IV_EXPLICIT - caead.flags = 0 - caead.len = len(src) - src = str_to_ascii(src) - s = array.array("B", src) - caead.src = caead.dst = s.buffer_info()[0] - caead.aadlen = len(aad) - aad = str_to_ascii(aad) - saad = array.array('B', aad) - caead.aad = saad.buffer_info()[0] + def _doaead(self, op, src, aad, iv, tag=None): + caead = CryptAEAD() + caead.ses = self._ses + caead.op = op + caead.flags = CRD_F_IV_EXPLICIT + caead.flags = 0 + caead.len = len(src) + s = array.array('B', src) + caead.src = caead.dst = s.buffer_info()[0] + caead.aadlen = len(aad) + saad = array.array('B', aad) + caead.aad = saad.buffer_info()[0] - if self._maclen is None: - raise ValueError('must have a tag length') + if self._maclen is None: + raise ValueError('must have a tag length') - if tag is None: - tag = array.array('B', [0] * self._maclen) - else: - assert len(tag) == self._maclen, \ + if tag is None: + tag = array.array('B', [0] * self._maclen) + else: + assert len(tag) == self._maclen, \ '%d != %d' % (len(tag), self._maclen) - tag = str_to_ascii(tag) - tag = array.array('B', tag) + tag = array.array('B', tag) - caead.tag = tag.buffer_info()[0] + caead.tag = tag.buffer_info()[0] - ivbuf = array.array('B', iv) - caead.ivlen = len(iv) - caead.iv = ivbuf.buffer_info()[0] + ivbuf = array.array('B', iv) + caead.ivlen = len(iv) + caead.iv = ivbuf.buffer_info()[0] - caead_b = bytes(caead) - ioctl(_cryptodev, CIOCCRYPTAEAD, caead_b) + ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) - s = array_tobytes(s) + s = s.tostring() - return s, array_tobytes(tag) + return s, tag.tostring() - def perftest(self, op, size, timeo=3): - inp = array.array('B', (random.randint(0, 255) for x in range(size))) - out = array.array('B', str_to_ascii(inp)) + def perftest(self, op, size, timeo=3): + import random + import time - # prep ioctl - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(inp) - s = array.array('B', str_to_ascii(inp)) - cop.src = s.buffer_info()[0] - cop.dst = out.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', (random.randint(0, 255) for x in range(16))) - cop.iv = ivbuf.buffer_info()[0] + inp = array.array('B', (random.randint(0, 255) for x in xrange(size))) + out = array.array('B', inp) - exit = [ False ] - def alarmhandle(a, b, exit=exit): - exit[0] = True + # prep ioctl + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(inp) + s = array.array('B', inp) + cop.src = s.buffer_info()[0] + cop.dst = out.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16))) + cop.iv = ivbuf.buffer_info()[0] - oldalarm = signal.signal(signal.SIGALRM, alarmhandle) - signal.alarm(timeo) + exit = [ False ] + def alarmhandle(a, b, exit=exit): + exit[0] = True - start = time.time() - reps = 0 - cop_b = bytes(cop) - while not exit[0]: - ioctl(_cryptodev, CIOCCRYPT, cop_b) - reps += 1 + oldalarm = signal.signal(signal.SIGALRM, alarmhandle) + signal.alarm(timeo) - end = time.time() + start = time.time() + reps = 0 + while not exit[0]: + ioctl(_cryptodev, CIOCCRYPT, str(cop)) + reps += 1 - signal.signal(signal.SIGALRM, oldalarm) + end = time.time() - print('time:', end - start) - print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) + signal.signal(signal.SIGALRM, oldalarm) - def encrypt(self, data, iv, aad=None): - if aad is None: - return self._doop(COP_ENCRYPT, data, iv) - else: - return self._doaead(COP_ENCRYPT, data, aad, - iv) + print('time:', end - start) + print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) - def decrypt(self, data, iv, aad=None, tag=None): - if aad is None: - return self._doop(COP_DECRYPT, data, iv) - else: - return self._doaead(COP_DECRYPT, data, aad, - iv, tag=tag) + def encrypt(self, data, iv, aad=None): + if aad is None: + return self._doop(COP_ENCRYPT, data, iv) + else: + return self._doaead(COP_ENCRYPT, data, aad, + iv) + def decrypt(self, data, iv, aad=None, tag=None): + if aad is None: + return self._doop(COP_DECRYPT, data, iv) + else: + return self._doaead(COP_DECRYPT, data, aad, + iv, tag=tag) + class MismatchError(Exception): - pass + pass class KATParser: - def __init__(self, fname, fields): - self.fields = set(fields) - self._pending = None - self.fname = fname - self.fp = None + def __init__(self, fname, fields): + self.fp = open(fname) + self.fields = set(fields) + self._pending = None - def __enter__(self): - self.fp = open(self.fname) - return self + def __iter__(self): + while True: + didread = False + if self._pending is not None: + i = self._pending + self._pending = None + else: + i = self.fp.readline() + didread = True - def __exit__(self, exc_type, exc_value, exc_tb): - if self.fp is not None: - self.fp.close() + if didread and not i: + return - def __iter__(self): - return self + if (i and i[0] == '#') or not i.strip(): + continue + if i[0] == '[': + yield i[1:].split(']', 1)[0], self.fielditer() + else: + raise ValueError('unknown line: %r' % repr(i)) - def __next__(self): - while True: - didread = False - if self._pending is not None: - i = self._pending - self._pending = None - else: - i = self.fp.readline() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 23 01:09:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF175159370A; Thu, 23 May 2019 01:09:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B18EF737FA; Thu, 23 May 2019 01:09:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73653258D2; Thu, 23 May 2019 01:09:17 +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 x4N19HEg015404; Thu, 23 May 2019 01:09:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N19A1r015367; Thu, 23 May 2019 01:09:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230109.x4N19A1r015367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 01:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348138 - in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/inc... X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/include/gtest contrib/google... X-SVN-Commit-Revision: 348138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B18EF737FA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:09:18 -0000 Author: ngie Date: Thu May 23 01:09:10 2019 New Revision: 348138 URL: https://svnweb.freebsd.org/changeset/base/348138 Log: MFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346081,r346270,r346574,r346576: r345203: Initial googlemock/googletest integration into the build/FreeBSD test suite This initial integration takes googlemock/googletest release 1.8.1, integrates the library, tests, and sample unit tests into the build. googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`. `MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when built with a C++11 capable toolchain. Google tests can be specified via the `GTESTS` variable, which, in comparison with the other test drivers, is more simplified/streamlined, as Googletest only supports C++ tests; not raw C or shell tests (C tests can be written in C++ using the standard embedding methods). No dependent libraries are assumed for the tests. One must specify `gmock`, `gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program. More information about googlemock and googletest can be found on the Googletest [project page](https://github.com/google/googletest), and the [GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md) and [GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs) docs. These tests are originally integrated into the build as plain driver tests, but will be natively integrated into Kyua in a later version. Known issues/Errata: * [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172) r345205: Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite This change integrates the unit tests for zfsd into the test suite using the integration method described in r345203. This change removes the `LOCALBASE` includes added for the port version of googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS` defines, which are included in the `GTEST_CXXFLAGS` variable, as part of r345203. r345353 (by asomers): googletest: backport GTEST_SKIP to googletest 1.8.1 This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and 59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to our included version of googletest, which is based on 1.8.1. It adds the GTEST_SKIP feature, which is very useful for a project like FreeBSD where some tests depend on particular system configurations. Obtained from: github.com/google/googletest r345645: Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS This makes it easier for googletest users to leverage googletest, instead of forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in unnecessary duplication). I will be following this up with a more proper fix in src.libnames.mk, as src.libnames.mk should be automatically adding this directory to CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result in mismatches between base-provided private library's and ports-provided library's headers. While here, tweak the comment to clarify what the intent is behind spamming CXXFLAGS. r345708: Standardize `-std=c++* as `CXXSTD` CXXSTD was added as the C++ analogue to CSTD. CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++. This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203. As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`. Notes: This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc. Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example: Before this commit: ``` CXXFLAGS+= -std=c++14 ``` After this commit: ``` CXXSTD= c++14 ``` Relnotes: yes Tested with: make tinderbox r345709: Allow users to override CSTD/CXXSTD on a per-prog basis The current logic for CSTD/CXXSTD requires homogenity as far as the supported C/C++ standards, which is a sensible default. However, when dealing with differing versions of C++, some code may compile with C++11, but not C++17 (for instance). So in order to avoid having people convert over their code to the new standard, give the users the ability to specify the standard on a per-program basis. This will allow a user to override the supporting standard for a set of programs, mixing C++11 with C++14 (for instance). Apprved by: emaste (mentor) r345735: Allow programs to set `NO_SHARED` on a per-PROG basis This is particularly useful when installing programs for tests that need to be linked statically, e.g., mini-me from capsicum-test, which is linked statically to avoid the dynamic library lookup in the upstream project. r345770: Import proof-of-concept for handling `GTEST_SKIP()` in `Environment::SetUp` Per the upstream pull-request [1]: ``` gtest prior to this change would completely ignore `GTEST_SKIP()` if called in `Environment::SetUp()`, instead of bailing out early, unlike `Test::SetUp()`, which would cause the tests themselves to be skipped. The only way (prior to this change) to skip the tests would be to trigger a fatal error via `GTEST_FAIL()`. Desirable behavior, in this case, when dealing with `Environment::SetUp()` is to check for prerequisites on a system (example, kernel supports a particular featureset, e.g., capsicum), and skip the tests. The alternatives prior to this change would be undesirable: - Failing sends the wrong message to the test user, as the result of the tests is indeterminate, not failed. - Having to add per-test class abstractions that override `SetUp()` to test for the capsicum feature set, then skip all of the tests in their respective SetUp fixtures, would be a lot of human and computational work; checking for the feature would need to be done for all of the tests, instead of once for all of the tests. For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`, by not executing the testcases, is the most desirable solution. In order to properly diagnose what happened when running the tests if they are skipped, print out the diagnostics in an ad hoc manner. Update the documentation to note this change and integrate a new test, gtest_skip_in_environment_setup_test, into the test suite. This change addresses #2189. Signed-off-by: Enji Cooper ``` The goal with my merging in this change is to avoid requiring extensive refactoring/retesting of test suites when ensuring prerequisites are met, e.g., checking for a CAPABILITIES-enabled kernel before running capsicum-test (see D19758 for more details). The proof-of-concept is being imported before accepted by the upstream project due to the fact that the upstream project is undergoing a potential development freeze and the maintainers aren't responding to my PR. 1. https://github.com/google/googletest/pull/2203 r346081 (by trasz): Make zfsd(8) build obey CFLAGS. Obtained from: CheriBSD r346270 (by trasz): Drop -g from CFLAGS for zfsd(8). No idea why it was ever there. r346574: Rework CXXSTD setting via r345708 This change allows the user to once again override the C++ standard, restoring high-level pre-r345708 behavior. This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11 capable compiler, e.g., g++ 4.2.1, as the library supported being built with older C++ standards. r346576: Fix up CXXSTD support originally added in r345708 r345708 worked for the base system, but unfortunately, caused a lot of disruption for third-party packages that relied on C++, since bsd.sys.mk is used by applications outside the base system. The defaults picked didn't match the compiler's defaults and broke some builds that didn't specify a standard, as well as some that overrode the value by setting `-std=gnu++14` (for example) manually. This change takes a more relaxed approach to appending `-std=${CXXSTD}` to CXXFLAGS, by only doing so when the value is specified, as opposed to overriding the standard set by an end-user. This avoids the need for having to bake NOP default into bsd.sys.mk for supported compiler-toolchain versions. In order to make this change possible, add CXXSTD to Makefile snippets which relied on the default value (c++11) added in r345708. Added: stable/12/contrib/googletest/ - copied from r345203, head/contrib/googletest/ stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc - copied unchanged from r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc - copied unchanged from r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc stable/12/lib/googletest/ - copied from r345203, head/lib/googletest/ stable/12/share/examples/tests/tests/googletest/ - copied from r345203, head/share/examples/tests/tests/googletest/ stable/12/share/mk/googletest.test.inc.mk - copied, changed from r345203, head/share/mk/googletest.test.inc.mk stable/12/share/mk/googletest.test.mk - copied unchanged from r345203, head/share/mk/googletest.test.mk stable/12/tools/build/options/WITHOUT_GOOGLETEST - copied unchanged from r345203, head/tools/build/options/WITHOUT_GOOGLETEST Modified: stable/12/cddl/usr.sbin/zfsd/Makefile stable/12/cddl/usr.sbin/zfsd/Makefile.common stable/12/cddl/usr.sbin/zfsd/tests/Makefile stable/12/contrib/googletest/googletest/CMakeLists.txt stable/12/contrib/googletest/googletest/Makefile.am stable/12/contrib/googletest/googletest/docs/advanced.md stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h stable/12/contrib/googletest/googletest/include/gtest/gtest.h stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h stable/12/contrib/googletest/googletest/src/gtest-test-part.cc stable/12/contrib/googletest/googletest/src/gtest.cc stable/12/contrib/googletest/googletest/test/BUILD.bazel stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc stable/12/contrib/googletest/googletest/test/gtest_all_test.cc stable/12/contrib/mandoc/lib.in stable/12/etc/mtree/BSD.tests.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/Makefile stable/12/lib/clang/llvm.build.mk stable/12/lib/googletest/gtest_main/tests/Makefile stable/12/lib/libc++/Makefile stable/12/lib/libc++experimental/Makefile stable/12/lib/libc++fs/Makefile stable/12/lib/libc/tests/stdlib/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/lib/libcxxrt/Makefile stable/12/lib/libgcc_eh/Makefile.inc stable/12/lib/libomp/Makefile stable/12/lib/ofed/libibnetdisc/Makefile stable/12/share/examples/tests/tests/Makefile stable/12/share/mk/Makefile stable/12/share/mk/bsd.README stable/12/share/mk/bsd.progs.mk stable/12/share/mk/bsd.sys.mk stable/12/share/mk/bsd.test.mk stable/12/share/mk/src.libnames.mk stable/12/share/mk/src.opts.mk stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/dtc/Makefile stable/12/usr.sbin/pmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -1,12 +1,13 @@ # $FreeBSD$ +.include + .include "Makefile.common" PROG_CXX= zfsd MAN= zfsd.8 -.include +HAS_TESTS= +SUBDIR.${MK_GOOGLETEST}+= tests -# The unittests require devel/googletest and devel/googlemock from ports. -# Don't automatically build them. -SUBDIR= +.include Modified: stable/12/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:59:05 2019 (r348137) +++ stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 01:09:10 2019 (r348138) @@ -28,12 +28,11 @@ INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/li INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin -CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} +CFLAGS+= -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} -DPADD= ${LIBDEVDCTL} ${LIBZFS} ${LIBZFS_CORE} ${LIBUTIL} ${LIBGEOM} \ - ${LIBBSDXML} ${LIBSBUF} ${LIBNVPAIR} ${LIBUUTIL} -LIBADD= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil +LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil cscope: find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ Modified: stable/12/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -3,30 +3,12 @@ .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR:H} -PLAIN_TESTS_CXX= zfsd_unittest -SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} -SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc -SRCS= +GTESTS= zfsd_unittest -# Use #include in test programs. -INCFLAGS+= -I${.CURDIR:H:H} +SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} +SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc +.undef SRCS -.if defined(DESTDIR) || defined(SYSROOT) -INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include -LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \ - -L${SYSROOT:U${DESTDIR}}/usr/lib -.endif - -# Googletest options -INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread -LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread -LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a - -# GoogleMock options -LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a - -# Googlemock fails if we don't have this line -# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J -CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD +LIBADD.zfsd_unittest+= gmock_main .include Modified: stable/12/contrib/googletest/googletest/CMakeLists.txt ============================================================================== --- head/contrib/googletest/googletest/CMakeLists.txt Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/CMakeLists.txt Thu May 23 01:09:10 2019 (r348138) @@ -217,6 +217,8 @@ if (gtest_build_tests) test/gtest-typed-test2_test.cc) cxx_test(gtest_unittest gtest_main) cxx_test(gtest-unittest-api_test gtest) + cxx_test(gtest_skip_in_environment_setup_test gtest_main) + cxx_test(gtest_skip_test gtest_main) ############################################################ # C++ tests built with non-standard compiler flags. Modified: stable/12/contrib/googletest/googletest/Makefile.am ============================================================================== --- head/contrib/googletest/googletest/Makefile.am Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/Makefile.am Thu May 23 01:09:10 2019 (r348138) @@ -290,6 +290,12 @@ test_gtest_all_test_SOURCES = test/gtest_all_test.cc test_gtest_all_test_LDADD = lib/libgtest_main.la \ lib/libgtest.la +TESTS += test/gtest_skip_in_environment_setup_test +check_PROGRAMS += test/gtest_skip_in_environment_setup_test +test_gtest_skip_in_environment_setup_test_SOURCES = test/gtest_skip_in_environment_setup_test.cc +test_gtest_skip_in_environment_setup_test_LDADD= lib/libgtest_main.la \ + lib/libgtest.la + # Tests that fused gtest files compile and work. FUSED_GTEST_SRC = \ fused-src/gtest/gtest-all.cc \ Modified: stable/12/contrib/googletest/googletest/docs/advanced.md ============================================================================== --- head/contrib/googletest/googletest/docs/advanced.md Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/docs/advanced.md Thu May 23 01:09:10 2019 (r348138) @@ -1289,8 +1289,10 @@ Environment* AddGlobalTestEnvironment(Environment* env ``` Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of -the environment object, then runs the tests if there was no fatal failures, and -finally calls `TearDown()` of the environment object. +each environment object, then runs the tests if none of the environments +reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` +always calls `TearDown()` with each environment object, regardless of whether +or not the tests were run. It's OK to register multiple environment objects. In this case, their `SetUp()` will be called in the order they are registered, and their `TearDown()` will be Modified: stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/gtest-test-part.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/gtest-test-part.h Thu May 23 01:09:10 2019 (r348138) @@ -53,7 +53,8 @@ class GTEST_API_ TestPartResult { enum Type { kSuccess, // Succeeded. kNonFatalFailure, // Failed but the test can continue. - kFatalFailure // Failed and the test should be terminated. + kFatalFailure, // Failed and the test should be terminated. + kSkip // Skipped. }; // C'tor. TestPartResult does NOT have a default constructor. @@ -89,17 +90,20 @@ class GTEST_API_ TestPartResult { // Gets the message associated with the test part. const char* message() const { return message_.c_str(); } + // Returns true iff the test part was skipped. + bool skipped() const { return type_ == kSkip; } + // Returns true iff the test part passed. bool passed() const { return type_ == kSuccess; } - // Returns true iff the test part failed. - bool failed() const { return type_ != kSuccess; } - // Returns true iff the test part non-fatally failed. bool nonfatally_failed() const { return type_ == kNonFatalFailure; } // Returns true iff the test part fatally failed. bool fatally_failed() const { return type_ == kFatalFailure; } + + // Returns true iff the test part failed. + bool failed() const { return fatally_failed() || nonfatally_failed(); } private: Type type_; Modified: stable/12/contrib/googletest/googletest/include/gtest/gtest.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/gtest.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/gtest.h Thu May 23 01:09:10 2019 (r348138) @@ -440,6 +440,9 @@ class GTEST_API_ Test { // Returns true iff the current test has a non-fatal failure. static bool HasNonfatalFailure(); + // Returns true iff the current test was skipped. + static bool IsSkipped(); + // Returns true iff the current test has a (either fatal or // non-fatal) failure. static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } @@ -574,8 +577,11 @@ class GTEST_API_ TestResult { int test_property_count() const; // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } + bool Passed() const { return !Skipped() && !Failed(); } + // Returns true iff the test was skipped. + bool Skipped() const; + // Returns true iff the test failed. bool Failed() const; @@ -854,6 +860,9 @@ class GTEST_API_ TestCase { // Gets the number of successful tests in this test case. int successful_test_count() const; + // Gets the number of skipped tests in this test case. + int skipped_test_count() const; + // Gets the number of failed tests in this test case. int failed_test_count() const; @@ -936,6 +945,11 @@ class GTEST_API_ TestCase { return test_info->should_run() && test_info->result()->Passed(); } + // Returns true iff test skipped. + static bool TestSkipped(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Skipped(); + } + // Returns true iff test failed. static bool TestFailed(const TestInfo* test_info) { return test_info->should_run() && test_info->result()->Failed(); @@ -1258,6 +1272,9 @@ class GTEST_API_ UnitTest { // Gets the number of successful tests. int successful_test_count() const; + // Gets the number of skipped tests. + int skipped_test_count() const; + // Gets the number of failed tests. int failed_test_count() const; @@ -1834,6 +1851,11 @@ class TestWithParam : public Test, public WithParamInt }; // Macros for indicating success/failure in test code. + +// Skips test in runtime. +// Skipping test aborts current function. +// Skipped tests are neither successful nor failed. +#define GTEST_SKIP() GTEST_SKIP_("Skipped") // ADD_FAILURE unconditionally adds a failure to the current test. // SUCCEED generates a success - it doesn't automatically make the Modified: stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h ============================================================================== --- head/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/include/gtest/internal/gtest-internal.h Thu May 23 01:09:10 2019 (r348138) @@ -1208,7 +1208,10 @@ class NativeArray { #define GTEST_SUCCESS_(message) \ GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) -// Suppress MSVC warning 4702 (unreachable code) for the code following +#define GTEST_SKIP_(message) \ + return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip) + +// Suppress MSVC warning 4072 (unreachable code) for the code following // statement if it returns or throws (or doesn't return or throw in some // situations). #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ Modified: stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h ============================================================================== --- head/contrib/googletest/googletest/src/gtest-internal-inl.h Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest-internal-inl.h Thu May 23 01:09:10 2019 (r348138) @@ -544,6 +544,9 @@ class GTEST_API_ UnitTestImpl { // Gets the number of successful tests. int successful_test_count() const; + // Gets the number of skipped tests. + int skipped_test_count() const; + // Gets the number of failed tests. int failed_test_count() const; Modified: stable/12/contrib/googletest/googletest/src/gtest-test-part.cc ============================================================================== --- head/contrib/googletest/googletest/src/gtest-test-part.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest-test-part.cc Thu May 23 01:09:10 2019 (r348138) @@ -47,12 +47,16 @@ std::string TestPartResult::ExtractSummary(const char* // Prints a TestPartResult object. std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { - return os - << result.file_name() << ":" << result.line_number() << ": " - << (result.type() == TestPartResult::kSuccess ? "Success" : - result.type() == TestPartResult::kFatalFailure ? "Fatal failure" : - "Non-fatal failure") << ":\n" - << result.message() << std::endl; + return os << result.file_name() << ":" << result.line_number() << ": " + << (result.type() == TestPartResult::kSuccess + ? "Success" + : result.type() == TestPartResult::kSkip + ? "Skipped" + : result.type() == TestPartResult::kFatalFailure + ? "Fatal failure" + : "Non-fatal failure") + << ":\n" + << result.message() << std::endl; } // Appends a TestPartResult to the array. Modified: stable/12/contrib/googletest/googletest/src/gtest.cc ============================================================================== --- head/contrib/googletest/googletest/src/gtest.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/src/gtest.cc Thu May 23 01:09:10 2019 (r348138) @@ -796,6 +796,11 @@ int UnitTestImpl::successful_test_count() const { return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count); } +// Gets the number of skipped tests. +int UnitTestImpl::skipped_test_count() const { + return SumOverTestCaseList(test_cases_, &TestCase::skipped_test_count); +} + // Gets the number of failed tests. int UnitTestImpl::failed_test_count() const { return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count); @@ -2207,6 +2212,16 @@ void TestResult::Clear() { elapsed_time_ = 0; } +// Returns true off the test part was skipped. +static bool TestPartSkipped(const TestPartResult& result) { + return result.skipped(); +} + +// Returns true iff the test was skipped. +bool TestResult::Skipped() const { + return !Failed() && CountIf(test_part_results_, TestPartSkipped) > 0; +} + // Returns true iff the test failed. bool TestResult::Failed() const { for (int i = 0; i < total_part_count(); ++i) { @@ -2511,8 +2526,9 @@ void Test::Run() { internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); impl->os_stack_trace_getter()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()"); - // We will run the test only if SetUp() was successful. - if (!HasFatalFailure()) { + // We will run the test only if SetUp() was successful and didn't call + // GTEST_SKIP(). + if (!HasFatalFailure() && !IsSkipped()) { impl->os_stack_trace_getter()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported( this, &Test::TestBody, "the test body"); @@ -2537,6 +2553,11 @@ bool Test::HasNonfatalFailure() { HasNonfatalFailure(); } +// Returns true iff the current test was skipped. +bool Test::IsSkipped() { + return internal::GetUnitTestImpl()->current_test_result()->Skipped(); +} + // class TestInfo // Constructs a TestInfo object. It assumes ownership of the test factory @@ -2685,9 +2706,10 @@ void TestInfo::Run() { factory_, &internal::TestFactoryBase::CreateTest, "the test fixture's constructor"); - // Runs the test if the constructor didn't generate a fatal failure. + // Runs the test if the constructor didn't generate a fatal failure or invoke + // GTEST_SKIP(). // Note that the object will not be null - if (!Test::HasFatalFailure()) { + if (!Test::HasFatalFailure() && !Test::IsSkipped()) { // This doesn't throw as all user code that can throw are wrapped into // exception handling code. test->Run(); @@ -2715,6 +2737,11 @@ int TestCase::successful_test_count() const { return CountIf(test_info_list_, TestPassed); } +// Gets the number of successful tests in this test case. +int TestCase::skipped_test_count() const { + return CountIf(test_info_list_, TestSkipped); +} + // Gets the number of failed tests in this test case. int TestCase::failed_test_count() const { return CountIf(test_info_list_, TestFailed); @@ -2866,6 +2893,8 @@ static std::string FormatTestCaseCount(int test_case_c // between the two when viewing the test result. static const char * TestPartResultTypeToString(TestPartResult::Type type) { switch (type) { + case TestPartResult::kSkip: + return "Skipped"; case TestPartResult::kSuccess: return "Success"; @@ -3119,6 +3148,7 @@ class PrettyUnitTestResultPrinter : public TestEventLi private: static void PrintFailedTests(const UnitTest& unit_test); + static void PrintSkippedTests(const UnitTest& unit_test); }; // Fired before each iteration of tests starts. @@ -3187,18 +3217,25 @@ void PrettyUnitTestResultPrinter::OnTestStart(const Te // Called after an assertion failure. void PrettyUnitTestResultPrinter::OnTestPartResult( const TestPartResult& result) { - // If the test part succeeded, we don't need to do anything. - if (result.type() == TestPartResult::kSuccess) - return; - - // Print failure message from the assertion (e.g. expected this and got that). - PrintTestPartResult(result); - fflush(stdout); + switch (result.type()) { + // If the test part succeeded, or was skipped, + // we don't need to do anything. + case TestPartResult::kSkip: + case TestPartResult::kSuccess: + return; + default: + // Print failure message from the assertion + // (e.g. expected this and got that). + PrintTestPartResult(result); + fflush(stdout); + } } void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) { if (test_info.result()->Passed()) { ColoredPrintf(COLOR_GREEN, "[ OK ] "); + } else if (test_info.result()->Skipped()) { + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); } else { ColoredPrintf(COLOR_RED, "[ FAILED ] "); } @@ -3248,7 +3285,7 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(con } for (int j = 0; j < test_case.total_test_count(); ++j) { const TestInfo& test_info = *test_case.GetTestInfo(j); - if (!test_info.should_run() || test_info.result()->Passed()) { + if (!test_info.should_run() || !test_info.result()->Failed()) { continue; } ColoredPrintf(COLOR_RED, "[ FAILED ] "); @@ -3259,6 +3296,30 @@ void PrettyUnitTestResultPrinter::PrintFailedTests(con } } +// Internal helper for printing the list of skipped tests. +void PrettyUnitTestResultPrinter::PrintSkippedTests(const UnitTest& unit_test) { + const int skipped_test_count = unit_test.skipped_test_count(); + if (skipped_test_count == 0) { + return; + } + + for (int i = 0; i < unit_test.total_test_case_count(); ++i) { + const TestCase& test_case = *unit_test.GetTestCase(i); + if (!test_case.should_run() || (test_case.skipped_test_count() == 0)) { + continue; + } + for (int j = 0; j < test_case.total_test_count(); ++j) { + const TestInfo& test_info = *test_case.GetTestInfo(j); + if (!test_info.should_run() || !test_info.result()->Skipped()) { + continue; + } + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); + printf("%s.%s", test_case.name(), test_info.name()); + printf("\n"); + } + } +} + void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, int /*iteration*/) { ColoredPrintf(COLOR_GREEN, "[==========] "); @@ -3273,6 +3334,13 @@ void PrettyUnitTestResultPrinter::OnTestIterationEnd(c ColoredPrintf(COLOR_GREEN, "[ PASSED ] "); printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str()); + const int skipped_test_count = unit_test.skipped_test_count(); + if (skipped_test_count > 0) { + ColoredPrintf(COLOR_GREEN, "[ SKIPPED ] "); + printf("%s, listed below:\n", FormatTestCount(skipped_test_count).c_str()); + PrintSkippedTests(unit_test); + } + int num_failures = unit_test.failed_test_count(); if (!unit_test.Passed()) { const int failed_test_count = unit_test.failed_test_count(); @@ -4540,6 +4608,11 @@ int UnitTest::successful_test_count() const { return impl()->successful_test_count(); } +// Gets the number of skipped tests. +int UnitTest::skipped_test_count() const { + return impl()->skipped_test_count(); +} + // Gets the number of failed tests. int UnitTest::failed_test_count() const { return impl()->failed_test_count(); } @@ -4660,7 +4733,8 @@ void UnitTest::AddTestPartResult( impl_->GetTestPartResultReporterForCurrentThread()-> ReportTestPartResult(result); - if (result_type != TestPartResult::kSuccess) { + if (result_type != TestPartResult::kSuccess && + result_type != TestPartResult::kSkip) { // gtest_break_on_failure takes precedence over // gtest_throw_on_failure. This allows a user to set the latter // in the code (perhaps in order to use Google Test assertions @@ -5169,9 +5243,23 @@ bool UnitTestImpl::RunAllTests() { ForEach(environments_, SetUpEnvironment); repeater->OnEnvironmentsSetUpEnd(*parent_); - // Runs the tests only if there was no fatal failure during global - // set-up. - if (!Test::HasFatalFailure()) { + // Runs the tests only if there was no fatal failure or skip triggered + // during global set-up. + if (Test::IsSkipped()) { + // Emit diagnostics when global set-up calls skip, as it will not be + // emitted by default. + TestResult& test_result = + *internal::GetUnitTestImpl()->current_test_result(); + for (int j = 0; j < test_result.total_part_count(); ++j) { + const TestPartResult& test_part_result = + test_result.GetTestPartResult(j); + if (test_part_result.type() == TestPartResult::kSkip) { + const std::string& result = test_part_result.message(); + printf("%s\n", result.c_str()); + } + } + fflush(stdout); + } else if (!Test::HasFatalFailure()) { for (int test_index = 0; test_index < total_test_case_count(); test_index++) { GetMutableTestCase(test_index)->Run(); Modified: stable/12/contrib/googletest/googletest/test/BUILD.bazel ============================================================================== --- head/contrib/googletest/googletest/test/BUILD.bazel Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/BUILD.bazel Thu May 23 01:09:10 2019 (r348138) @@ -311,6 +311,13 @@ cc_binary( deps = ["//:gtest"], ) +cc_test( + name = "gtest_skip_in_environment_setup_test", + size = "small", + srcs = ["gtest_skip_in_environment_setup_test.cc"], + deps = ["//:gtest_main"], +) + py_test( name = "googletest-list-tests-unittest", size = "small", Modified: stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-test-part-test.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/googletest-test-part-test.cc Thu May 23 01:09:10 2019 (r348138) @@ -46,9 +46,10 @@ class TestPartResultTest : public Test { TestPartResultTest() : r1_(TestPartResult::kSuccess, "foo/bar.cc", 10, "Success!"), r2_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure!"), - r3_(TestPartResult::kFatalFailure, NULL, -1, "Failure!") {} + r3_(TestPartResult::kFatalFailure, nullptr, -1, "Failure!"), + r4_(TestPartResult::kSkip, "foo/bar.cc", 2, "Skipped!") {} - TestPartResult r1_, r2_, r3_; + TestPartResult r1_, r2_, r3_, r4_; }; @@ -79,6 +80,7 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_FALSE(success.failed()); EXPECT_FALSE(success.nonfatally_failed()); EXPECT_FALSE(success.fatally_failed()); + EXPECT_FALSE(success.skipped()); const TestPartResult nonfatal_failure(TestPartResult::kNonFatalFailure, "file.cc", @@ -88,6 +90,7 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_TRUE(nonfatal_failure.failed()); EXPECT_TRUE(nonfatal_failure.nonfatally_failed()); EXPECT_FALSE(nonfatal_failure.fatally_failed()); + EXPECT_FALSE(nonfatal_failure.skipped()); const TestPartResult fatal_failure(TestPartResult::kFatalFailure, "file.cc", @@ -97,6 +100,14 @@ TEST_F(TestPartResultTest, ResultAccessorsWork) { EXPECT_TRUE(fatal_failure.failed()); EXPECT_FALSE(fatal_failure.nonfatally_failed()); EXPECT_TRUE(fatal_failure.fatally_failed()); + EXPECT_FALSE(fatal_failure.skipped()); + + const TestPartResult skip(TestPartResult::kSkip, "file.cc", 42, "message"); + EXPECT_FALSE(skip.passed()); + EXPECT_FALSE(skip.failed()); + EXPECT_FALSE(skip.nonfatally_failed()); + EXPECT_FALSE(skip.fatally_failed()); + EXPECT_TRUE(skip.skipped()); } // Tests TestPartResult::type(). @@ -104,23 +115,27 @@ TEST_F(TestPartResultTest, type) { EXPECT_EQ(TestPartResult::kSuccess, r1_.type()); EXPECT_EQ(TestPartResult::kNonFatalFailure, r2_.type()); EXPECT_EQ(TestPartResult::kFatalFailure, r3_.type()); + EXPECT_EQ(TestPartResult::kSkip, r4_.type()); } // Tests TestPartResult::file_name(). TEST_F(TestPartResultTest, file_name) { EXPECT_STREQ("foo/bar.cc", r1_.file_name()); EXPECT_STREQ(NULL, r3_.file_name()); + EXPECT_STREQ("foo/bar.cc", r4_.file_name()); } // Tests TestPartResult::line_number(). TEST_F(TestPartResultTest, line_number) { EXPECT_EQ(10, r1_.line_number()); EXPECT_EQ(-1, r2_.line_number()); + EXPECT_EQ(2, r4_.line_number()); } // Tests TestPartResult::message(). TEST_F(TestPartResultTest, message) { EXPECT_STREQ("Success!", r1_.message()); + EXPECT_STREQ("Skipped!", r4_.message()); } // Tests TestPartResult::passed(). @@ -128,6 +143,7 @@ TEST_F(TestPartResultTest, Passed) { EXPECT_TRUE(r1_.passed()); EXPECT_FALSE(r2_.passed()); EXPECT_FALSE(r3_.passed()); + EXPECT_FALSE(r4_.passed()); } // Tests TestPartResult::failed(). @@ -135,13 +151,23 @@ TEST_F(TestPartResultTest, Failed) { EXPECT_FALSE(r1_.failed()); EXPECT_TRUE(r2_.failed()); EXPECT_TRUE(r3_.failed()); + EXPECT_FALSE(r4_.failed()); } +// Tests TestPartResult::failed(). +TEST_F(TestPartResultTest, Skipped) { + EXPECT_FALSE(r1_.skipped()); + EXPECT_FALSE(r2_.skipped()); + EXPECT_FALSE(r3_.skipped()); + EXPECT_TRUE(r4_.skipped()); +} + // Tests TestPartResult::fatally_failed(). TEST_F(TestPartResultTest, FatallyFailed) { EXPECT_FALSE(r1_.fatally_failed()); EXPECT_FALSE(r2_.fatally_failed()); EXPECT_TRUE(r3_.fatally_failed()); + EXPECT_FALSE(r4_.fatally_failed()); } // Tests TestPartResult::nonfatally_failed(). @@ -149,6 +175,7 @@ TEST_F(TestPartResultTest, NonfatallyFailed) { EXPECT_FALSE(r1_.nonfatally_failed()); EXPECT_TRUE(r2_.nonfatally_failed()); EXPECT_FALSE(r3_.nonfatally_failed()); + EXPECT_FALSE(r4_.nonfatally_failed()); } // Tests the TestPartResultArray class. Modified: stable/12/contrib/googletest/googletest/test/gtest_all_test.cc ============================================================================== --- head/contrib/googletest/googletest/test/gtest_all_test.cc Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/contrib/googletest/googletest/test/gtest_all_test.cc Thu May 23 01:09:10 2019 (r348138) @@ -37,10 +37,11 @@ #include "test/googletest-message-test.cc" #include "test/googletest-options-test.cc" #include "test/googletest-port-test.cc" -#include "test/gtest_pred_impl_unittest.cc" -#include "test/gtest_prod_test.cc" #include "test/googletest-test-part-test.cc" -#include "test/gtest-typed-test_test.cc" #include "test/gtest-typed-test2_test.cc" +#include "test/gtest-typed-test_test.cc" +#include "test/gtest_pred_impl_unittest.cc" +#include "test/gtest_prod_test.cc" +#include "test/gtest_skip_test.cc" #include "test/gtest_unittest.cc" #include "test/production.cc" Copied: stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc (from r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc Thu May 23 01:09:10 2019 (r348138, copy of r345770, head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc) @@ -0,0 +1,60 @@ +// Copyright 2019, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// This test verifies that skipping in the environment results in the +// testcases being skipped. +// +// This is a reproduction case for +// https://github.com/google/googletest/issues/2189 . + +#include +#include + +class SetupEnvironment : public testing::Environment { +public: + void SetUp() override { + GTEST_SKIP() << "Skipping the entire environment"; + } +}; + +TEST(Test, AlwaysPasses) { + EXPECT_EQ(true, true); +} + +TEST(Test, AlwaysFails) { + EXPECT_EQ(true, false); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + + testing::AddGlobalTestEnvironment(new SetupEnvironment()); + + return (RUN_ALL_TESTS()); +} Copied: stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc (from r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/googletest/googletest/test/gtest_skip_test.cc Thu May 23 01:09:10 2019 (r348138, copy of r345353, head/contrib/googletest/googletest/test/gtest_skip_test.cc) @@ -0,0 +1,55 @@ +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: arseny.aprelev@gmail.com (Arseny Aprelev) +// + +#include "gtest/gtest.h" + +using ::testing::Test; + +TEST(SkipTest, DoesSkip) { + GTEST_SKIP(); + EXPECT_EQ(0, 1); +} + +class Fixture : public Test { + protected: + void SetUp() override { + GTEST_SKIP() << "skipping all tests for this fixture"; + } +}; + +TEST_F(Fixture, SkipsOneTest) { + EXPECT_EQ(5, 7); +} + +TEST_F(Fixture, SkipsAnotherTest) { + EXPECT_EQ(99, 100); +} Modified: stable/12/contrib/mandoc/lib.in ============================================================================== --- stable/12/contrib/mandoc/lib.in Thu May 23 00:59:05 2019 (r348137) +++ stable/12/contrib/mandoc/lib.in Thu May 23 01:09:10 2019 (r348138) @@ -62,7 +62,9 @@ LINE("libfsid", "Filesystem Identification Library (l LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") +LINE("libgmock", "GoogleMock library (libgmock, \\-lgmock)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") +LINE("libgtest", "GoogleTest library (libgtest, \\-lgtest)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:59:05 2019 (r348137) +++ stable/12/etc/mtree/BSD.tests.dist Thu May 23 01:09:10 2019 (r348138) @@ -270,6 +270,16 @@ test-programs .. .. + googletest + gmock + .. + gmock_main + .. + gtest + .. + gtest_main + .. + .. libarchive .. libbe @@ -423,6 +433,8 @@ examples tests atf + .. + googletest .. plain .. Modified: stable/12/etc/mtree/BSD.usr.dist ============================================================================== --- stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:59:05 2019 (r348137) +++ stable/12/etc/mtree/BSD.usr.dist Thu May 23 01:09:10 2019 (r348138) @@ -13,6 +13,18 @@ .. event .. + gmock + internal + custom + .. + .. + .. + gtest + internal + custom + .. + .. + .. sqlite3 .. ucl Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -170,6 +170,7 @@ _libcplusplus+= libc++fs .endif SUBDIR.${MK_EFI}+= libefivar +SUBDIR.${MK_GOOGLETEST}+= googletest SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/clang/llvm.build.mk Thu May 23 01:09:10 2019 (r348138) @@ -101,7 +101,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXFLAGS+= -std=c++11 +CXXSTD?= c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: stable/12/lib/googletest/gtest_main/tests/Makefile ============================================================================== --- head/lib/googletest/gtest_main/tests/Makefile Fri Mar 15 21:43:52 2019 (r345203) +++ stable/12/lib/googletest/gtest_main/tests/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -18,6 +18,8 @@ GTESTS+= gtest_prod_test GTESTS+= gtest_sole_header_test GTESTS+= googletest-test-part-test GTESTS+= gtest-typed-test_test +GTESTS+= gtest_skip_test +GTESTS+= gtest_skip_in_environment_setup_test GTESTS+= gtest_unittest CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include Modified: stable/12/lib/libc++/Makefile ============================================================================== --- stable/12/lib/libc++/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libc++/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -76,9 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD?= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: stable/12/lib/libc++experimental/Makefile ============================================================================== --- stable/12/lib/libc++experimental/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libc++experimental/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -20,8 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD?= c++14 .include Modified: stable/12/lib/libc++fs/Makefile ============================================================================== --- stable/12/lib/libc++fs/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libc++fs/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -22,8 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD?= c++14 .include Modified: stable/12/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -49,8 +49,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 -CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +CXXSTD.cxa_thread_atexit_test= c++11 +CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: stable/12/lib/libclang_rt/Makefile.inc ============================================================================== --- stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libclang_rt/Makefile.inc Thu May 23 01:09:10 2019 (r348138) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 Modified: stable/12/lib/libcxxrt/Makefile ============================================================================== --- stable/12/lib/libcxxrt/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libcxxrt/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -22,9 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD?= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: stable/12/lib/libgcc_eh/Makefile.inc ============================================================================== --- stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 01:09:10 2019 (r348138) @@ -27,10 +27,8 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif CXXFLAGS+= -fno-rtti +CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: stable/12/lib/libomp/Makefile ============================================================================== --- stable/12/lib/libomp/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/libomp/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden -CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: stable/12/lib/ofed/libibnetdisc/Makefile ============================================================================== --- stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -32,7 +32,7 @@ CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband .if ${COMPILER_FEATURES:Mc++11} -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 .endif VERSION_MAP= ${_spath}/libibnetdisc.map Modified: stable/12/share/examples/tests/tests/Makefile ============================================================================== --- stable/12/share/examples/tests/tests/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/share/examples/tests/tests/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # Directory into which the Kyuafile provided by this directory will be # installed. # @@ -20,6 +22,10 @@ TESTS_SUBDIRS+= atf TESTS_SUBDIRS+= plain TESTS_SUBDIRS+= tap + +.if ${MK_GOOGLETEST} != no +TESTS_SUBDIRS+= googletest +.endif # We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile # for us based on the contents of the TESTS_SUBDIRS line above. The Modified: stable/12/share/mk/Makefile ============================================================================== --- stable/12/share/mk/Makefile Thu May 23 00:59:05 2019 (r348137) +++ stable/12/share/mk/Makefile Thu May 23 01:09:10 2019 (r348138) @@ -73,6 +73,8 @@ FILESDIR= ${BINDIR}/mk *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 23 01:13:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144401593A58; Thu, 23 May 2019 01:13:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADE5B73C40; Thu, 23 May 2019 01:13: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DFCB25A7D; Thu, 23 May 2019 01:13: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 x4N1DCOq020397; Thu, 23 May 2019 01:13:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N1DCbF020396; Thu, 23 May 2019 01:13:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230113.x4N1DCbF020396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 01:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348139 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 348139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADE5B73C40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:13:13 -0000 Author: ngie Date: Thu May 23 01:13:12 2019 New Revision: 348139 URL: https://svnweb.freebsd.org/changeset/base/348139 Log: Regenerate src.conf(5) after r348138 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Thu May 23 01:09:10 2019 (r348138) +++ stable/12/share/man/man5/src.conf.5 Thu May 23 01:13:12 2019 (r348139) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd March 29, 2019 +.Dd May 22, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -384,10 +384,6 @@ is set explicitly) (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) -.It Va WITHOUT_LLVM_TARGET_RISCV -(unless -.Va WITH_LLVM_TARGET_RISCV -is set explicitly) .It Va WITHOUT_LLVM_TARGET_SPARC (unless .Va WITH_LLVM_TARGET_SPARC @@ -822,6 +818,11 @@ Set to not build GNU Set this option to include GNU extensions in .Xr bsdgrep 1 by linking against libgnuregex. +.It Va WITHOUT_GOOGLETEST +Set to neither build nor install +.Lb libgmock , +.Lb libgtest , +and dependent tests. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 @@ -1198,20 +1199,11 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. -.It Va WITHOUT_LLVM_TARGET_RISCV -Set to not build LLVM target support for RISC-V. -The -.Va LLVM_TARGET_ALL -option should be used rather than this in most cases. -.Pp -This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64. .It Va WITH_LLVM_TARGET_RISCV Set to build LLVM target support for RISC-V. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. -.Pp .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1816,6 +1808,10 @@ When set, it enforces these options: When set, these options are also in effect: .Pp .Bl -inset -compact +.It Va WITHOUT_GOOGLETEST +(unless +.Va WITH_GOOGLETEST +is set explicitly) .It Va WITHOUT_TESTS_SUPPORT (unless .Va WITH_TESTS_SUPPORT @@ -1823,6 +1819,12 @@ is set explicitly) .El .It Va WITHOUT_TESTS_SUPPORT Set to disables the build of all test-related dependencies, including ATF. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_GOOGLETEST +.El .It Va WITHOUT_TEXTPROC Set to not build programs used for text processing. From owner-svn-src-all@freebsd.org Thu May 23 01:25:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80AF71593EE3; Thu, 23 May 2019 01:25:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1A4747F2; Thu, 23 May 2019 01:25:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFB9E25C31; Thu, 23 May 2019 01:25:35 +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 x4N1PZlh025999; Thu, 23 May 2019 01:25:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N1PYOr025994; Thu, 23 May 2019 01:25:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905230125.x4N1PYOr025994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 23 May 2019 01:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348140 - in stable/12: . tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: . tests/sys/opencrypto X-SVN-Commit-Revision: 348140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E1A4747F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:25:36 -0000 Author: ngie Date: Thu May 23 01:25:34 2019 New Revision: 348140 URL: https://svnweb.freebsd.org/changeset/base/348140 Log: MFC r346431,r347417,r348019: r346431 (by lwhsu): Specify using Python2, these .py files have not been converted to use Python3 yet, but the default Python version in ports has been switched to 3. r347417: Refactor tests/sys/opencrypto/runtests * Convert from plain to TAP for slightly improved introspection when skipping the tests due to requirements not being met. * Test for the net/py-dpkt (origin) package being required when running the tests, instead of relying on a copy of the dpkt.py module from 2014. This enables the tests to work with py3. Subsequently, remove `tests/sys/opencrypto/dpkt.py(c)?` via `make delete-old`. * Parameterize out `python2` as `$PYTHON`. PR: 237403 r348019: Allow the end-user to pass along arguments to cryptotest.py via `$CRYPTOTEST_ARGS` This allows someone to use `-v` to dump out standard output. Deleted: stable/12/tests/sys/opencrypto/dpkt.py Modified: stable/12/ObsoleteFiles.inc stable/12/tests/sys/opencrypto/Makefile stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptotest.py stable/12/tests/sys/opencrypto/runtests.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Thu May 23 01:13:12 2019 (r348139) +++ stable/12/ObsoleteFiles.inc Thu May 23 01:25:34 2019 (r348140) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190509: tests/sys/opencrypto requires the net/py-dpkt package. +OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py +OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc # 20190412: new libc++ import which bumps version from 7.0.1 to 8.0.0. OLD_FILES+=usr/include/c++/v1/experimental/dynarray # 20190412: new clang import which bumps version from 7.0.1 to 8.0.0. Modified: stable/12/tests/sys/opencrypto/Makefile ============================================================================== --- stable/12/tests/sys/opencrypto/Makefile Thu May 23 01:13:12 2019 (r348139) +++ stable/12/tests/sys/opencrypto/Makefile Thu May 23 01:25:34 2019 (r348140) @@ -12,12 +12,12 @@ CFLAGS.poly1305_test.c += -I${SRCTOP}/sys/opencrypto ATF_TESTS_C+= blake2_test poly1305_test -PLAIN_TESTS_SH= runtests +TAP_TESTS_SH+= runtests -TEST_METADATA.runtests+= required_programs="python" +TEST_METADATA.runtests+= required_programs="python2" TEST_METADATA.runtests+= required_user="root" -PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py +PYMODULES= cryptodev.py cryptodevh.py cryptotest.py ${PACKAGE}FILES+= ${PYMODULES} Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 01:13:12 2019 (r348139) +++ stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 01:25:34 2019 (r348140) @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/local/bin/python2 # # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 01:13:12 2019 (r348139) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 01:25:34 2019 (r348140) @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/local/bin/python2 # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. Modified: stable/12/tests/sys/opencrypto/runtests.sh ============================================================================== --- stable/12/tests/sys/opencrypto/runtests.sh Thu May 23 01:13:12 2019 (r348139) +++ stable/12/tests/sys/opencrypto/runtests.sh Thu May 23 01:25:34 2019 (r348140) @@ -29,13 +29,18 @@ # $FreeBSD$ # -set -ex +: ${PYTHON=python2} if [ ! -d /usr/local/share/nist-kat ]; then - echo 'Skipping, nist-kat package not installed for test vectors.' + echo "1..0 # SKIP: nist-kat package not installed for test vectors" exit 0 fi +if ! $PYTHON -c "from dpkt import dpkt"; then + echo "1..0 # SKIP: py-dpkt package not installed" + exit 0 +fi + loaded_modules= cleanup_tests() { @@ -43,6 +48,10 @@ cleanup_tests() set +e + if [ -n "$oldcdas" ]; then + sysctl "$oldcdas" 2>/dev/null + fi + # Unload modules in reverse order for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do kldunload $loaded_module @@ -52,15 +61,28 @@ trap cleanup_tests EXIT INT TERM for required_module in nexus/aesni cryptodev; do if ! kldstat -q -m $required_module; then - kldload ${required_module#nexus/} + module_to_load=${required_module#nexus/} + if ! kldload ${module_to_load}; then + echo "1..0 # SKIP: could not load ${module_to_load}" + exit 0 + fi loaded_modules="$loaded_modules $required_module" fi done -# Run software crypto test -oldcdas=$(sysctl -e kern.cryptodevallowsoft) -sysctl kern.cryptodevallowsoft=1 +cdas_sysctl=kern.cryptodevallowsoft +if ! oldcdas=$(sysctl -e $cdas_sysctl); then + echo "1..0 # SKIP: could not resolve sysctl: $cdas_sysctl" + exit 0 +fi +if ! sysctl $cdas_sysctl=1; then + echo "1..0 # SKIP: could not enable /dev/crypto access via $cdas_sysctl sysctl." + exit 0 +fi -python $(dirname $0)/cryptotest.py - -sysctl "$oldcdas" +echo "1..1" +if "$PYTHON" $(dirname $0)/cryptotest.py $CRYPTOTEST_ARGS; then + echo "ok 1" +else + echo "not ok 1" +fi From owner-svn-src-all@freebsd.org Thu May 23 01:41:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD26E159425E; Thu, 23 May 2019 01:41:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B0274F4B; Thu, 23 May 2019 01:41:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5038425F61; Thu, 23 May 2019 01:41:50 +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 x4N1foFo034144; Thu, 23 May 2019 01:41:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N1fow7034143; Thu, 23 May 2019 01:41:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905230141.x4N1fow7034143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 01:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348141 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 348141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B0274F4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:41:51 -0000 Author: ian Date: Thu May 23 01:41:49 2019 New Revision: 348141 URL: https://svnweb.freebsd.org/changeset/base/348141 Log: Handle the driftfile option correctly when ntpd_flags is empty. The logic I originally wrote to detect whether a driftfile option was in the set of flags was based on the result of removing the pattern *flag* being an empty string. That didn't handle the case where the string was empty to begin with. Doh! So now it also specifically checks for an empty string. The result of the bad check was that ntpd would run without a driftfile, but it would do so only if it was running as root instead of the non-priveleged ntpd user, which isn't a typical case. Ntpd runs fine without a driftfile, although it does take it longer to stabilize the clock frequency at startup. Reported by: avg@ Pointy hat: ian@ MFC after: some testing Modified: head/libexec/rc/rc.d/ntpd Modified: head/libexec/rc/rc.d/ntpd ============================================================================== --- head/libexec/rc/rc.d/ntpd Thu May 23 01:25:34 2019 (r348140) +++ head/libexec/rc/rc.d/ntpd Thu May 23 01:41:49 2019 (r348141) @@ -87,12 +87,14 @@ ntpd_precmd() # Otherwise, figure out what to do about the driftfile option. If set # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. + if can_run_nonroot; then _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" - elif [ -z "${rc_flags##*-f*}" ] || - [ -z "${rc_flags##*--driftfile*}" ] || - grep -q "^[ \t]*driftfile" "${ntpd_config}"; then + elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || + [ -n "${rc_flags}" ] && + ( [ -z "${rc_flags##*-f*}" ] || + [ -z "${rc_flags##*--driftfile*}" ] ); then driftopt="" # admin set the option, we don't need to add it. elif [ -f "${_ntp_old_driftfile}" ]; then driftopt="-f ${_ntp_old_driftfile}" From owner-svn-src-all@freebsd.org Thu May 23 01:45:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9FB215944C8 for ; Thu, 23 May 2019 01:45:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3213B75264 for ; Thu, 23 May 2019 01:45:31 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1558575929; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=rEgQfbBP6MbMFD1IpW1ZzA20JOw0p/R+W0qMIQahNGVVhcTqrDMDZYcGwq7hWLpefK6La4uP/HrVY IRU4CZmX+t0CeUcMZ5kvsB2KBbnKACkom+ZpzPnwrx5j15CxEmf0JkFnB0ryuCiRaVXIDrn+OLanbq FGFHzPwkhuEws6qXIlSdQk52VT9KSYc/YfZMAypbB1BrCM+PxWY0TsbHl52fsopRc2vceZC5mmcBj/ JgipobqFG8DtyWZreiqR14uvwjZ9RGeT5m4UTBoeaLVXFS3z8oSy6yMKggviSTj144qxXfUGrPMJij F26nogJMYWr5q9YH6C8qsharQkLI0rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=u//1ZE3/VLHHKmNPF1z8TdQY4/ZkCPSpblQtxeSWr6w=; b=ishBV7L+sW2/TaH4s1YwMVOaqlQ5aHLRLyaXz2MR6a8nMoJW/dwFpXPZxDhTSKF+gedNkjdSFWto1 zJDdahPIxR4Xf7xSiqfVLh/FOuWXyouclbfqxGfJPq7m9pkXGRxMw81hmoOkr+Vdmc/qNcQkhjM4Iy GLNtP/vgIIcZSjIKZ3w1yCpM/H7hMa0LBYPgsu61i9PHQD/jqC117W4xo9+RJgcJYOQl6mfFnrtkR+ Iu+Q71VA1znZbpUKooUMHzptl4ol99inOTa8ltx12SAw4ha3ilGNlQR51gtlEK2GNkTTqCNHcGsqEM ptYYLLPim+EPcn8Z8K8jYQh8MLIMikw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=u//1ZE3/VLHHKmNPF1z8TdQY4/ZkCPSpblQtxeSWr6w=; b=i2c6YBOjeH1BaAYr/g+ofUFqpYvdjcdC5UVJjqy3EYA8cJMsJMx2w4LCWBoNDfjPWFltO3OLhaomq shmvalP711gVlYlDXyOopVGfbIiPYBTq+J5d6+S1rY68BxUu80zEygp8T3l41YvDIZkqBM7lLCzw0i 2PAPa61Ger/QyIpvPBQvbZLVdl2O3cvBS9TIt+ktPFSkrkKvBqhhNldxo3Xw8PuHhkZDCVqD+BRB3R SUMK5btsMHE9Fmtjaaeez/TzK+AiX6HUaLfJ0TiFXDb0u6CHgndRGqVf2qc8/h3p+IdIz0fnWfOyM9 7iod66BAsBmkFY0MJWKSJdMHMxV79pg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 703b0d09-7cfc-11e9-990f-673a89bc4518 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 703b0d09-7cfc-11e9-990f-673a89bc4518; Thu, 23 May 2019 01:45:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4N1jQcd008425; Wed, 22 May 2019 19:45:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <64935b6f3beef7bde7a32b359187d998a480f258.camel@freebsd.org> Subject: Re: svn commit: r336547 - in head/etc: defaults rc.d From: Ian Lepore To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 22 May 2019 19:45:26 -0600 In-Reply-To: <6b966875-23f5-28cf-9e65-7c30974eef05@FreeBSD.org> References: <201807201359.w6KDxT1p087000@repo.freebsd.org> <6b966875-23f5-28cf-9e65-7c30974eef05@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3213B75264 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:45:32 -0000 On Wed, 2019-05-22 at 14:40 +0300, Andriy Gapon wrote: > Something I've just noticed about this commit: > > On 20/07/2018 16:59, Ian Lepore wrote: > > Author: ian > > Date: Fri Jul 20 13:59:29 2018 > > New Revision: 336547 > > URL: https://svnweb.freebsd.org/changeset/base/336547 > > > > Log: > > Automatically run ntpd as non-root when possible. > > [snip] > > > +ntpd_precmd() > > +{ > > + local driftopt > > + > > + # If we can run as a non-root user, switch uid to ntpd and use > > the > > + # new default location for the driftfile inside the ntpd-owned > > dir. > > + # Otherwise, figure out what to do about the driftfile > > option. If set > > + # by the admin, we don't add the option. If the file exists in > > the old > > + # default location we use that, else we use the new default > > location. > > + if can_run_nonroot; then > > + _user="ntpd" > > + driftopt="-f ${_ntp_default_driftfile}" > > + elif [ -z "${rc_flags##*-f*}" ] || > > + [ -z "${rc_flags##*--driftfile*}" ] || > > It seems that the two checks above produce a false positive if > rc_flags is empty > already. And that's the case on a system that I recently brought up > (very > recent CURRENT via source install). /etc/defaults/rc.conf has > ntpd_flags="". > As a result ntpd is started without the drift file option. > And the stock /etc/ntp.conf also does not have the directive. > Doh! I use that pattern-removal technique all the time at $work, I wonder how many times I've committed this mistake and just haven't been burned by it yet? Good catch, should be fixed by r348141. I'm curious though... it can only hit this condition if can_run_nonroot returns false, and it shouldn't do so on a freshly-installed system. The idea was to make it run non-priv out of the box and only run as root if the admin had done something non-standard. Does it make sense to you that it was running as root on your system? Like have you customized ntp.conf to add some file-related commands? -- Ian From owner-svn-src-all@freebsd.org Thu May 23 01:49:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD19E15945EC; Thu, 23 May 2019 01:49:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69A33754E2; Thu, 23 May 2019 01:49:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FC5925F95; Thu, 23 May 2019 01:49:09 +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 x4N1n9Vg036792; Thu, 23 May 2019 01:49:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N1n9pO036791; Thu, 23 May 2019 01:49:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905230149.x4N1n9pO036791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 01:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348143 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 348143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69A33754E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 01:49:10 -0000 Author: ian Date: Thu May 23 01:49:08 2019 New Revision: 348143 URL: https://svnweb.freebsd.org/changeset/base/348143 Log: Remove accidentally-added blank line; the style throughout this file is to use no whitespace between a comment block and the code it describes. Modified: head/libexec/rc/rc.d/ntpd Modified: head/libexec/rc/rc.d/ntpd ============================================================================== --- head/libexec/rc/rc.d/ntpd Thu May 23 01:48:07 2019 (r348142) +++ head/libexec/rc/rc.d/ntpd Thu May 23 01:49:08 2019 (r348143) @@ -87,7 +87,6 @@ ntpd_precmd() # Otherwise, figure out what to do about the driftfile option. If set # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. - if can_run_nonroot; then _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" From owner-svn-src-all@freebsd.org Thu May 23 02:10:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCD3E1594B81; Thu, 23 May 2019 02:10:42 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E85875E2E; Thu, 23 May 2019 02:10:42 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AF6726404; Thu, 23 May 2019 02:10:42 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N2AgNd047913; Thu, 23 May 2019 02:10:42 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N2AgEe047912; Thu, 23 May 2019 02:10:42 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905230210.x4N2AgEe047912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 23 May 2019 02:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348144 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E85875E2E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 02:10:43 -0000 Author: dougm Date: Thu May 23 02:10:41 2019 New Revision: 348144 URL: https://svnweb.freebsd.org/changeset/base/348144 Log: Fix typo from r348128: _func__ -> __func__ Reported by: LINT Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu May 23 01:49:08 2019 (r348143) +++ head/sys/vm/vm_map.c Thu May 23 02:10:41 2019 (r348144) @@ -1265,7 +1265,7 @@ vm_map_entry_resize(vm_map_t map, vm_map_entry_t entry root->left, root->right); VM_MAP_ASSERT_CONSISTENT(map); CTR4(KTR_VM, "%s: map %p, nentries %d, entry %p", - _func__, map, map->nentries, entry); + __func__, map, map->nentries, entry); } /* From owner-svn-src-all@freebsd.org Thu May 23 02:12:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87BA1594C02; Thu, 23 May 2019 02:12:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB887604B; Thu, 23 May 2019 02:12:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 596102646B; Thu, 23 May 2019 02:12:01 +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 x4N2C1G3052192; Thu, 23 May 2019 02:12:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N2C1W6052191; Thu, 23 May 2019 02:12:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905230212.x4N2C1W6052191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 02:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348145 - stable/12/tools/boot X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/tools/boot X-SVN-Commit-Revision: 348145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FB887604B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 02:12:02 -0000 Author: ian Date: Thu May 23 02:12:00 2019 New Revision: 348145 URL: https://svnweb.freebsd.org/changeset/base/348145 Log: MFC r346652-r346654 r346652: Complain and exit the script if the 'make install' phase fails. Also, there is no need to install any debug files. r346653: The zfs module has grown a dependency on zcl_nfs4.ko, so copy it into all the test images. r346654: For the geli-gpt-zfs test images, both bios and uefi flavors, add a dummy ufs partition as p2, and put the zfs partition at p3, to test the ability of the zfs probe code to find a zfs pool on something other than the first partition. Modified: stable/12/tools/boot/rootgen.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/boot/rootgen.sh ============================================================================== --- stable/12/tools/boot/rootgen.sh Thu May 23 02:10:41 2019 (r348144) +++ stable/12/tools/boot/rootgen.sh Thu May 23 02:12:00 2019 (r348145) @@ -130,6 +130,7 @@ mk_nogeli_gpt_zfs_legacy() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -168,6 +169,7 @@ mk_nogeli_gpt_zfs_uefi() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -207,6 +209,7 @@ mk_nogeli_gpt_zfs_both() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -288,6 +291,7 @@ mk_nogeli_mbr_zfs_legacy() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -329,6 +333,7 @@ mk_nogeli_mbr_zfs_uefi() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -370,6 +375,7 @@ mk_nogeli_mbr_zfs_both() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -501,15 +507,20 @@ mk_geli_gpt_zfs_legacy() { bios=$7 pool=geli-gpt-zfs-legacy - dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 )) + # Note that in this flavor we create an empty p2 ufs partition, and put + # the bootable zfs stuff on p3, just to test the ability of the zfs probe + # probe routines to find a pool on a partition other than the first one. + + dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 )) md=$(mdconfig -f ${img}) gpart create -s gpt ${md} gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k + gpart add -t freebsd-ufs -s 100m ${md} gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 - echo ${passphrase} | geli attach -j - ${md}p2 - zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 + zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need @@ -520,6 +531,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko @@ -529,7 +541,7 @@ EOF zpool set bootfs=${pool}/ROOT/default ${pool} zpool set autoexpand=on ${pool} zpool export ${pool} - geli detach ${md}p2 + geli detach ${md}p3 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md} mdconfig -d -u ${md} } @@ -544,15 +556,20 @@ mk_geli_gpt_zfs_uefi() { bios=$7 pool=geli-gpt-zfs-uefi - dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 )) + # Note that in this flavor we create an empty p2 ufs partition, and put + # the bootable zfs stuff on p3, just to test the ability of the zfs probe + # probe routines to find a pool on a partition other than the first one. + + dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 )) md=$(mdconfig -f ${img}) gpart create -s gpt ${md} gpart add -t efi -s 800k -a 4k ${md} + gpart add -t freebsd-ufs -s 100m ${md} gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 - echo ${passphrase} | geli attach -j - ${md}p2 - zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 + zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need @@ -563,6 +580,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko @@ -572,7 +590,7 @@ EOF zpool set bootfs=${pool}/ROOT/default ${pool} zpool set autoexpand=on ${pool} zpool export ${pool} - geli detach ${md}p2 + geli detach ${md}p3 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md} mdconfig -d -u ${md} } @@ -607,6 +625,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko @@ -803,7 +822,11 @@ EOF # XXX cp /boot/device.hints ${DESTDIR}/boot/device.hints # Assume we're already built -make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes +make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes WITHOUT_DEBUG_FILES=yes +if [ $? -ne 0 ]; then + echo "make install failed" + exit 1 +fi # Copy init, /bin/sh, minimal libraries and testing /etc/rc mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin \ ${DESTDIR}/lib ${DESTDIR}/libexec \ From owner-svn-src-all@freebsd.org Thu May 23 03:40:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC9B215971A0; Thu, 23 May 2019 03:40:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E77780888; Thu, 23 May 2019 03:40:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F3B272B8; Thu, 23 May 2019 03:40:49 +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 x4N3enTn096135; Thu, 23 May 2019 03:40:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N3entC096134; Thu, 23 May 2019 03:40:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905230340.x4N3entC096134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 23 May 2019 03:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348146 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 348146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E77780888 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 03:40:50 -0000 Author: jhibbits Date: Thu May 23 03:40:48 2019 New Revision: 348146 URL: https://svnweb.freebsd.org/changeset/base/348146 Log: powerpc/booke: It helps to set variables before using them Actually set the source and destination VA's before using them. Fixes a bizarre panic on 32-bit Book-E. Not sure why this wasn't caught by the compiler. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu May 23 02:12:00 2019 (r348145) +++ head/sys/powerpc/booke/pmap.c Thu May 23 03:40:48 2019 (r348146) @@ -3043,11 +3043,12 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); #else + sva = copy_page_src_va; + dva = copy_page_dst_va; + mtx_lock(©_page_mutex); mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); - sva = copy_page_src_va; - dva = copy_page_dst_va; memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); From owner-svn-src-all@freebsd.org Thu May 23 03:47:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BA1315974B4; Thu, 23 May 2019 03:47:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D729D80D6F; Thu, 23 May 2019 03:47:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B138427487; Thu, 23 May 2019 03:47:25 +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 x4N3lPsj000342; Thu, 23 May 2019 03:47:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N3lPFY000341; Thu, 23 May 2019 03:47:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905230347.x4N3lPFY000341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 23 May 2019 03:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348147 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 348147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D729D80D6F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 03:47:26 -0000 Author: jhibbits Date: Thu May 23 03:47:25 2019 New Revision: 348147 URL: https://svnweb.freebsd.org/changeset/base/348147 Log: powerpc/mpc85xx: Use the proper (EREF) form of writing to DBCR0 DBCR0, according to the Freescale EREF, is guaranteed to be updated, and changes take effect, after an isync plus change of MSR[DE] from 0 to 1. Otherwise it's guaranteed to be updated "eventually". Use the expected synchronization sequence to write it for resetting. This prevents "Reset failed" from being printed immediately before the CPU resets. MFC after: 2 weeks Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Thu May 23 03:40:48 2019 (r348146) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Thu May 23 03:47:25 2019 (r348147) @@ -517,15 +517,14 @@ mpc85xx_reset(platform_t plat) */ ccsr_write4(OCP85XX_RSTCR, 2); - /* Clear DBCR0, disables debug interrupts and events. */ - mtspr(SPR_DBCR0, 0); + mtmsr(mfmsr() & ~PSL_DE); + + /* Enable debug interrupts and issue reset. */ + mtspr(SPR_DBCR0, DBCR0_IDM | DBCR0_RST_SYSTEM); __asm __volatile("isync"); /* Enable Debug Interrupts in MSR. */ mtmsr(mfmsr() | PSL_DE); - - /* Enable debug interrupts and issue reset. */ - mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); printf("Reset failed...\n"); while (1) From owner-svn-src-all@freebsd.org Thu May 23 05:17:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6E11598FC3; Thu, 23 May 2019 05:17:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 775AF8341F; Thu, 23 May 2019 05:17:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 470D43ED; Thu, 23 May 2019 05:17:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N5HJYW047286; Thu, 23 May 2019 05:17:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N5HJba047285; Thu, 23 May 2019 05:17:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905230517.x4N5HJba047285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 23 May 2019 05:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348148 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 348148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 775AF8341F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 05:17:20 -0000 Author: delphij Date: Thu May 23 05:17:18 2019 New Revision: 348148 URL: https://svnweb.freebsd.org/changeset/base/348148 Log: Delete unneeded #include from sys/mips. PR: 229763 Submitted by: Yoshihiro Ota Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20190 Modified: head/sys/mips/mips/elf_trampoline.c Modified: head/sys/mips/mips/elf_trampoline.c ============================================================================== --- head/sys/mips/mips/elf_trampoline.c Thu May 23 03:47:25 2019 (r348147) +++ head/sys/mips/mips/elf_trampoline.c Thu May 23 05:17:18 2019 (r348148) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_global.h" -#include #include #include #include From owner-svn-src-all@freebsd.org Thu May 23 05:32:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D95159A5FE; Thu, 23 May 2019 05:32:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0351183C0D; Thu, 23 May 2019 05:32:03 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id h11so4230004ljb.2; Wed, 22 May 2019 22:32:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KEaN0BsOASP6aMMB1ueI1/nRGE5tEStYjZPt0kbJ6zE=; b=dbWp4EpbexCxfV9FxOlB5tUvQ4gRpFWLij0F7gwVjyZ+VyEGjdhtYsVh5rl/wxBeOR 1NEE9t5u/J4kFQMHvFzmZcRzqeuIKy9mjJ7qIQMkQ0LAZyhFqgk6rUmAuAyodW264bcw P0AIf31y2RjKWSin6tvMcsocKgmgJZCZqTG9hyXRkTlv/T+CkJYUeVApNDpmEU9izgX3 7dpJIJgCCjtQQ2OjoTTDWruzczO5BMyrr7iepZtD5Gg6uNlX93tKzPBSZv1vX0DmwCi1 4FxmIVYGnMf+ZnisTgpZ707pM9MVOFbw6ueUx/V9ESsjrgl2HcnvfrNAtuLrbmDpX/hm GhMA== X-Gm-Message-State: APjAAAXqqOoRQjOOkWl+HBtwvRjXuAbFS/l6/ALIP7m1DVLpOR2/9yrn NYosQ/Jgf5nO83cfF2ixzhyM+LkE X-Google-Smtp-Source: APXvYqyJJHrRFg9SH2Kp+Zz5tu/HmOXo67IsFrplgNGEmQmy+6A36b68YhquLGI3KR6XupeCtnLMPw== X-Received: by 2002:a2e:4246:: with SMTP id p67mr34089367lja.44.1558589045455; Wed, 22 May 2019 22:24:05 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id o76sm5927190lfo.7.2019.05.22.22.24.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 22:24:04 -0700 (PDT) Subject: Re: svn commit: r336547 - in head/etc: defaults rc.d To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807201359.w6KDxT1p087000@repo.freebsd.org> <6b966875-23f5-28cf-9e65-7c30974eef05@FreeBSD.org> <64935b6f3beef7bde7a32b359187d998a480f258.camel@freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <123a85ed-8eff-a841-bec5-9af8e01b4b67@FreeBSD.org> Date: Thu, 23 May 2019 08:24:03 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <64935b6f3beef7bde7a32b359187d998a480f258.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0351183C0D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 05:32:11 -0000 On 23/05/2019 04:45, Ian Lepore wrote: > Doh! I use that pattern-removal technique all the time at $work, I > wonder how many times I've committed this mistake and just haven't been > burned by it yet? > > Good catch, should be fixed by r348141. Thank you! > I'm curious though... it can only hit this condition if can_run_nonroot > returns false, and it shouldn't do so on a freshly-installed system. > The idea was to make it run non-priv out of the box and only run as > root if the admin had done something non-standard. Does it make sense > to you that it was running as root on your system? Like have you > customized ntp.conf to add some file-related commands? I think that it could be because of a customer kernel without MAC. I'll consider adding it. -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu May 23 05:49:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4184159A903; Thu, 23 May 2019 05:49:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4913284269; Thu, 23 May 2019 05:49:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00DEA8FF; Thu, 23 May 2019 05:49:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N5nij6063050; Thu, 23 May 2019 05:49:44 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N5nigC063045; Thu, 23 May 2019 05:49:44 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905230549.x4N5nigC063045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 23 May 2019 05:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348149 - in stable/12: contrib/zlib lib/libz stand/libsa usr.bin/minigzip X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12: contrib/zlib lib/libz stand/libsa usr.bin/minigzip X-SVN-Commit-Revision: 348149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4913284269 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 05:49:46 -0000 Author: delphij Date: Thu May 23 05:49:43 2019 New Revision: 348149 URL: https://svnweb.freebsd.org/changeset/base/348149 Log: MFC r347244: Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel. This is a prerequisite of unifying kernel zlib instances. Submitted by: Yoshihiro Ota Added: - copied from r347244, head/sys/contrib/zlib/ Directory Properties: stable/12/sys/contrib/zlib/ (props changed) Deleted: stable/12/contrib/zlib/ Modified: stable/12/lib/libz/FREEBSD-upgrade stable/12/lib/libz/Makefile stable/12/stand/libsa/Makefile stable/12/usr.bin/minigzip/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/12/lib/libz/FREEBSD-upgrade Thu May 23 05:17:18 2019 (r348148) +++ stable/12/lib/libz/FREEBSD-upgrade Thu May 23 05:49:43 2019 (r348149) @@ -8,7 +8,7 @@ benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. 2) Import onto the vendor area. - 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + 3) Merge the vendor tree to sys/contrib/zlib, which contains a stripped down version of upstream source, resolve any conflicts. 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we have the required changes. Test universe and commit them. Modified: stable/12/lib/libz/Makefile ============================================================================== --- stable/12/lib/libz/Makefile Thu May 23 05:17:18 2019 (r348148) +++ stable/12/lib/libz/Makefile Thu May 23 05:49:43 2019 (r348149) @@ -8,7 +8,7 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 -ZLIBSRC= ${SRCTOP}/contrib/zlib +ZLIBSRC= ${SRCTOP}/sys/contrib/zlib .PATH: ${ZLIBSRC} Modified: stable/12/stand/libsa/Makefile ============================================================================== --- stable/12/stand/libsa/Makefile Thu May 23 05:17:18 2019 (r348148) +++ stable/12/stand/libsa/Makefile Thu May 23 05:49:43 2019 (r348149) @@ -99,8 +99,8 @@ CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS SRCS+=bzlib.c crctable.c decompress.c huffman.c randtable.c # decompression functionality from zlib -.PATH: ${SRCTOP}/contrib/zlib -CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib +.PATH: ${SRCTOP}/sys/contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib SRCS+= adler32.c crc32.c SRCS+= infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/12/usr.bin/minigzip/Makefile ============================================================================== --- stable/12/usr.bin/minigzip/Makefile Thu May 23 05:17:18 2019 (r348148) +++ stable/12/usr.bin/minigzip/Makefile Thu May 23 05:49:43 2019 (r348149) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${SRCTOP}/contrib/zlib/test +SRCDIR= ${SRCTOP}/sys/contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-all@freebsd.org Thu May 23 06:54:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CB24159ED24; Thu, 23 May 2019 06:54:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 306CE86178; Thu, 23 May 2019 06:54:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16E6614D9; Thu, 23 May 2019 06:54:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4N6rxfZ099383; Thu, 23 May 2019 06:53:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N6rxE5099382; Thu, 23 May 2019 06:53:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905230653.x4N6rxE5099382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 06:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348150 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 348150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 306CE86178 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 06:54:00 -0000 Author: manu Date: Thu May 23 06:53:59 2019 New Revision: 348150 URL: https://svnweb.freebsd.org/changeset/base/348150 Log: pkgbase: Remove etc/zfs from being packaged This is an empty directory and it cause a FreeBSD-zfs package to be created when we don't need one. Reviewed by: bapt Modified: head/libexec/rc/rc.d/Makefile Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Thu May 23 05:49:43 2019 (r348149) +++ head/libexec/rc/rc.d/Makefile Thu May 23 06:53:59 2019 (r348150) @@ -327,9 +327,6 @@ ZFS+= zfsbe ZFS+= zfsd ZFS+= zvol ZFSPACKAGE= zfs -DIRS+= ETC_ZFS -ETC_ZFS= /etc/zfs -ETC_ZFSPACKAGE= zfs .endif .for fg in ${CONFGROUPS} From owner-svn-src-all@freebsd.org Thu May 23 07:03:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CED7159F0D9 for ; Thu, 23 May 2019 07:03:51 +0000 (UTC) (envelope-from harris@writeroutreach.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE921866A1 for ; Thu, 23 May 2019 07:03:49 +0000 (UTC) (envelope-from harris@writeroutreach.com) Received: by mail-wm1-x341.google.com with SMTP id z23so471340wma.4 for ; Thu, 23 May 2019 00:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=writeroutreach-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:reply-to:to:subject:content-transfer-encoding :date:message-id; bh=IagbPn088gqfSfcbR4IOtdxBeB54tN5CMFIE1MLB4sI=; b=oOn1S7DtwFrqRk4ii/oJmK2oXWC2doP9KeLY1bZTc0J0FZa0DWeahVyBvwKsdE/liw nVuhIR5z6fKOChxG1ux5os+nBq9hyBQUSg+3quNPAXrqu4eNBEZ6MaRBeDTUTRxbKrEy IM4ILsRb43A1cjsvmPbgLT5xDoxj3ISuCil2GD0Fy8sYApXviCdYLwL8re6DQxSO9hzs IUfCo/YmdVFMKj11lL8+mhW7JaagOjFPRiu9idbjgRAE00LnMdQT2+uJbKZUrNBGRsCC /WV1ouDjAwajq2JuSr82jlicWqyjoVUa7qUP6Fk3oImMassuCWa0eqf/u7Avzm+Y//V0 OcuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:reply-to:to:subject :content-transfer-encoding:date:message-id; bh=IagbPn088gqfSfcbR4IOtdxBeB54tN5CMFIE1MLB4sI=; b=ExO5+sxUxjIuMBLKeTUNkTl0ornWpBgxb8RulUzgwTBeifnlyRqICcQ/66gVS0Ux94 J/hg88IdEUZPgeW63I4WiKBPeiCOnjnSuomMgSagFS7Gp6c563rb6ISvZ/NOhIeCzD9e xTZXMJ8J2mEv8KEWpiuGU/S4teGacfVCT+ucBPBBF/67q5aSVn9B7Uv6hHUYzZv7Zhqr wSg4XlgXfZDX/Uy2t4e7VzlOqJPHRytorG2QxrxUYyz3TMfAEO3AQnlwWroYGZ6106yI 75zafKgFwS/STKxvytbu92w+VcMsQOmphUoVN3dPboyYXXaS4B6K8KsWJZny+tQR0pip C4zQ== X-Gm-Message-State: APjAAAUHVn3HsuSE5Vs70AVxgHPG6d0/R5iNcPbiYS5vwAVJuEqZLybF A+Ozu5HU7/QY2IDDEVr0CID9j1GAjoc= X-Google-Smtp-Source: APXvYqwSgPO4dagqjmkX8TjZZ1qgbpnDV4GeRD86OVxA53tj3fEKi5P9kYcBXzW7Bvj3fKTWlIsvOg== X-Received: by 2002:a1c:a804:: with SMTP id r4mr10303740wme.21.1558595028529; Thu, 23 May 2019 00:03:48 -0700 (PDT) Received: from 72.255.54.232 ([72.255.54.232]) by smtp.gmail.com with ESMTPSA id t6sm15881009wmt.34.2019.05.23.00.03.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 00:03:47 -0700 (PDT) MIME-Version: 1.0 From: "Harris" Reply-To: harris@writeroutreach.com To: svn-src-all@freebsd.org Subject: Paid Guest Posting Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Mailer: Smart_Send_3_1_6 Date: Thu, 23 May 2019 12:03:22 +0500 Message-ID: <136044106874961794014624@DESKTOP-O7KVLJL> X-Antivirus: AVG (VPS 190522-4, 22/05/2019), Outbound message X-Antivirus-Status: Clean X-Rspamd-Queue-Id: DE921866A1 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=writeroutreach-com.20150623.gappssmtp.com header.s=20150623 header.b=oOn1S7Dt; spf=pass (mx1.freebsd.org: domain of harris@writeroutreach.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=harris@writeroutreach.com X-Spamd-Result: default: False [-0.44 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[harris@writeroutreach.com]; R_MISSING_CHARSET(2.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[writeroutreach-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; NEURAL_HAM_SHORT(-0.68)[-0.675,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-0.26)[ip: (3.22), ipnet: 2a00:1450::/32(-2.20), asn: 15169(-2.28), country: US(-0.06)]; RECEIVED_SPAMHAUS_PBL(0.00)[232.54.255.72.zen.spamhaus.org : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[writeroutreach-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.995,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[writeroutreach.com]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[1.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 07:03:51 -0000 Good day, I hope that this mail finds you well. The reason for this mail is to inquire if you are interested in hosting a s= ponsored or guest blog post on your unique website? Currently, we are searching for clients that are willing be get paid to hos= t these relevant blog posts. Our content is guaranteed to be of the highest= -quality and will be embedded with a Do-follow link that is completely rele= vant to your specific website. We are an agency that is seeking to find and nurture a long-term and sustai= nable working relationship, which will be beneficial to all parties involve= d. Please would you let me know how much you will be charging per post, and if= payment via either PayPal or Payoneer would suit you once the article has = been published. I thank you for your time and look forward to our future correspondence. Best Regards --- This email has been checked for viruses by AVG. https://www.avg.com From owner-svn-src-all@freebsd.org Thu May 23 07:59:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12DF815A129A; Thu, 23 May 2019 07:59:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC86387D7B; Thu, 23 May 2019 07:59:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 863451F0C; Thu, 23 May 2019 07:59:16 +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 x4N7xG97031377; Thu, 23 May 2019 07:59:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4N7xGc9031376; Thu, 23 May 2019 07:59:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905230759.x4N7xGc9031376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 07:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348151 - head/usr.sbin/etcupdate X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/etcupdate X-SVN-Commit-Revision: 348151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC86387D7B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 07:59:17 -0000 Author: manu Date: Thu May 23 07:59:16 2019 New Revision: 348151 URL: https://svnweb.freebsd.org/changeset/base/348151 Log: etcupdate: Fix -p after the move of the passwd related files Since PREWORLD_FILES only contain files that needs to be copied into /etc copy directly those files there. Reported by: many Modified: head/usr.sbin/etcupdate/etcupdate.sh Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 06:53:59 2019 (r348150) +++ head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 07:59:16 2019 (r348151) @@ -196,9 +196,9 @@ build_tree() # Build a limited tree that only contains files that are # crucial to installworld. for file in $PREWORLD_FILES; do - dir=`dirname /$file` - mkdir -p $1/$dir >&3 2>&1 || return 1 - cp -p $SRCDIR/$file $1/$file || return 1 + name=$(basename $file) + mkdir -p $1/etc >&3 2>&1 || return 1 + cp -p $SRCDIR/$file etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && From owner-svn-src-all@freebsd.org Thu May 23 11:06:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6807615A699A; Thu, 23 May 2019 11:06:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF5D28E46F; Thu, 23 May 2019 11:06:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4B9741B9; Thu, 23 May 2019 11:06:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NB6cVi032259; Thu, 23 May 2019 11:06:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NB6cbq032258; Thu, 23 May 2019 11:06:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905231106.x4NB6cbq032258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 May 2019 11:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348152 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 348152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF5D28E46F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 11:06:39 -0000 Author: avg Date: Thu May 23 11:06:38 2019 New Revision: 348152 URL: https://svnweb.freebsd.org/changeset/base/348152 Log: Add USB ID for CP2112 This is a curious small widget for which I might write a driver. It is bridge between USB HID interface and I2C interface plus some GPIO pins. MFC after: 2 weeks Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu May 23 07:59:16 2019 (r348151) +++ head/sys/dev/usb/usbdevs Thu May 23 11:06:38 2019 (r348152) @@ -4342,6 +4342,7 @@ product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone +product SILABS CP2112 0xea90 CP2112 HID USB-to-SMBus Bridge with GPIO product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 product SILABS USBPULSE100 0xf003 USBpulse100 From owner-svn-src-all@freebsd.org Thu May 23 11:15:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501A015A6D31; Thu, 23 May 2019 11:15:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12CA8EA60; Thu, 23 May 2019 11:15:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7E07435E; Thu, 23 May 2019 11:15:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NBFMmN037565; Thu, 23 May 2019 11:15:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NBFMSu037564; Thu, 23 May 2019 11:15:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905231115.x4NBFMSu037564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 May 2019 11:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348153 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 348153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E12CA8EA60 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 11:15:23 -0000 Author: avg Date: Thu May 23 11:15:22 2019 New Revision: 348153 URL: https://svnweb.freebsd.org/changeset/base/348153 Log: gpioled: add a new hint for initial state hint.gpioled.%d.state determines the initial state of the LED when the driver takes control over it: 0 - the LED is off 1 - the LED is on -1 - the LED is kept as it was While here, add a module version declaration. MFC after: 2 weks Modified: head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Thu May 23 11:06:38 2019 (r348152) +++ head/sys/dev/gpio/gpioled.c Thu May 23 11:15:22 2019 (r348153) @@ -115,6 +115,8 @@ gpioled_attach(device_t dev) name = NULL; resource_int_value(device_get_name(dev), device_get_unit(dev), "invert", &sc->sc_invert); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "state", &state); sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name : device_get_nameunit(dev), state); @@ -155,3 +157,4 @@ static driver_t gpioled_driver = { DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0); MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); +MODULE_VERSION(gpioled, 1); From owner-svn-src-all@freebsd.org Thu May 23 11:21:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FCE15A70C5; Thu, 23 May 2019 11:21:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7B18EE8D; Thu, 23 May 2019 11:21:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FD6F43B0; Thu, 23 May 2019 11:21:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NBLREK039508; Thu, 23 May 2019 11:21:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NBLR64039507; Thu, 23 May 2019 11:21:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905231121.x4NBLR64039507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 May 2019 11:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348154 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A7B18EE8D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 11:21:28 -0000 Author: avg Date: Thu May 23 11:21:27 2019 New Revision: 348154 URL: https://svnweb.freebsd.org/changeset/base/348154 Log: gpioled: update the manual page after r348153 MFC after: 2 weeks Modified: head/share/man/man4/gpioled.4 Modified: head/share/man/man4/gpioled.4 ============================================================================== --- head/share/man/man4/gpioled.4 Thu May 23 11:15:22 2019 (r348153) +++ head/share/man/man4/gpioled.4 Thu May 23 11:21:27 2019 (r348154) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2016 +.Dd May 23, 2019 .Dt GPIOLED 4 .Os .Sh NAME @@ -73,6 +73,10 @@ Please note that this mask should only ever have one b (any other bits - i.e., pins - will be ignored). .It Va hint.gpioled.%d.invert If set to 1, the pin will be set to 0 to light the LED, and 1 to clear it. +.It Va hint.gpioled.%d.state +The initial state of the LED when driver takes control over. +If set to 1 or 0, the LED will be on or off correspondingly. +If set to -1 the LED will be kept in its original state. .El .Pp On a From owner-svn-src-all@freebsd.org Thu May 23 11:33:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD0C215A7370; Thu, 23 May 2019 11:33:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3548F4CE; Thu, 23 May 2019 11:33:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f178.google.com with SMTP id r76so5088464lja.12; Thu, 23 May 2019 04:33:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3SBepJ2bhT3IQ9Qg+FL0zrRy73xC6GajSxUywWFqj9g=; b=DjM/2zd5dc2GeNIvq/LmLI6VPLAGJlcnMedegMd3A3d/hZzSJ3YpcOg7CvemAc+Y2u A+lW9Sjtbs9C1/yPb4vkDBgQlTqaVZRHeyywE5qrlZxy+VSyaE87SpuIZL/850JcJ6NW 6KyQlU6GVkCr5JZqPWttlBTx1PdJ0/FszCFd1jzy6YdSdKJvx+Lw4C0oqnfh3jesbejq SPnvaVGx41hYqX9aNZcZUJjPBil4aFJfPWKbuHJjFFNWJaP7lHCrlIEBOY0x8xu3RqOB u4QxKT+KnMzYxQtsjWNRx6DkV2wq5dtMmqzAdxeH7xjXLXXiNNqrwJ+ikpmyfzI5E7OK lKMA== X-Gm-Message-State: APjAAAUAqi01FHiCUrC55xuSRI6RA+A3Aqu5CDLvnOLWxo6kCedMK9Ec 3sT6SQ91c/qNgBQxSB8/crL3I+xr X-Google-Smtp-Source: APXvYqwmtGk+EAQBNZDp1dO0E/hF/5HMmF7nmlwyuZYAb++ckSb/OBWmoHUbXTM4NO6DvmuT1fc4NQ== X-Received: by 2002:a2e:8516:: with SMTP id j22mr18672091lji.119.1558611183527; Thu, 23 May 2019 04:33:03 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id d5sm1907372ljl.59.2019.05.23.04.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 04:33:02 -0700 (PDT) Subject: Re: svn commit: r348153 - head/sys/dev/gpio To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905231115.x4NBFMSu037564@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <2da5318e-ad03-6b20-950c-d43289bd8608@FreeBSD.org> Date: Thu, 23 May 2019 14:33:01 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201905231115.x4NBFMSu037564@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3E3548F4CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 11:33:12 -0000 On 23/05/2019 14:15, Andriy Gapon wrote: > Author: avg > Date: Thu May 23 11:15:22 2019 > New Revision: 348153 > URL: https://svnweb.freebsd.org/changeset/base/348153 > > Log: > gpioled: add a new hint for initial state > > hint.gpioled.%d.state determines the initial state of the LED when the > driver takes control over it: > 0 - the LED is off > 1 - the LED is on > -1 - the LED is kept as it was > > While here, add a module version declaration. By the way, can anyone suggest a mechanism to set device properties like this one _programmatically_ ? I am thinking of a case where I know exactly how everything is wired on a platform. And there is no FDT or alike support for it. And hints are not possible to set up correctly (e.g., bus numbers may float). So, I want to create a gpioled child on a specific bus and I want to set some properties for the device. Of course, I can probably do something like kern_setenv("hints.foo.X.bar", ...) using the child's name and unit number. But that feels a bit cumbersome. And this question is not about gpioled specifically. IVARs is definitely not the right mechanism, because it is about bus-specific properties of devices on the bus. So, it is not aware of properties specific to an individual device (or rather its driver). > Modified: > head/sys/dev/gpio/gpioled.c > > Modified: head/sys/dev/gpio/gpioled.c > ============================================================================== > --- head/sys/dev/gpio/gpioled.c Thu May 23 11:06:38 2019 (r348152) > +++ head/sys/dev/gpio/gpioled.c Thu May 23 11:15:22 2019 (r348153) > @@ -115,6 +115,8 @@ gpioled_attach(device_t dev) > name = NULL; > resource_int_value(device_get_name(dev), > device_get_unit(dev), "invert", &sc->sc_invert); > + resource_int_value(device_get_name(dev), > + device_get_unit(dev), "state", &state); > > sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name : > device_get_nameunit(dev), state); > @@ -155,3 +157,4 @@ static driver_t gpioled_driver = { > > DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0); > MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); > +MODULE_VERSION(gpioled, 1); > -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu May 23 11:35:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA0ED15A742E; Thu, 23 May 2019 11:35:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 577578F643; Thu, 23 May 2019 11:35:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D40B46DA; Thu, 23 May 2019 11:35:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NBZ1Pp047965; Thu, 23 May 2019 11:35:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NBZ14x047964; Thu, 23 May 2019 11:35:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905231135.x4NBZ14x047964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 May 2019 11:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348155 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 577578F643 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 11:35:02 -0000 Author: avg Date: Thu May 23 11:35:00 2019 New Revision: 348155 URL: https://svnweb.freebsd.org/changeset/base/348155 Log: gpioled: fix the manual page update in r348154 MFC after: 2 weeks Modified: head/share/man/man4/gpioled.4 Modified: head/share/man/man4/gpioled.4 ============================================================================== --- head/share/man/man4/gpioled.4 Thu May 23 11:21:27 2019 (r348154) +++ head/share/man/man4/gpioled.4 Thu May 23 11:35:00 2019 (r348155) @@ -74,9 +74,9 @@ Please note that this mask should only ever have one b .It Va hint.gpioled.%d.invert If set to 1, the pin will be set to 0 to light the LED, and 1 to clear it. .It Va hint.gpioled.%d.state -The initial state of the LED when driver takes control over. +The initial state of the LED when the driver takes control over it. If set to 1 or 0, the LED will be on or off correspondingly. -If set to -1 the LED will be kept in its original state. +If set to -1, the LED will be kept in its original state. .El .Pp On a From owner-svn-src-all@freebsd.org Thu May 23 12:25:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4484A15A901D; Thu, 23 May 2019 12:25:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDA9A6A394; Thu, 23 May 2019 12:25:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB8CA4F1C; Thu, 23 May 2019 12:25:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NCP4dw073856; Thu, 23 May 2019 12:25:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCP4vK073854; Thu, 23 May 2019 12:25:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231225.x4NCP4vK073854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 12:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348156 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 348156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDA9A6A394 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:25:05 -0000 Author: kib Date: Thu May 23 12:25:03 2019 New Revision: 348156 URL: https://svnweb.freebsd.org/changeset/base/348156 Log: Make pack_kinfo() available for external callers. Reviewed by: jilles, tmunro Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20258 Modified: head/sys/kern/kern_descrip.c head/sys/sys/user.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu May 23 11:35:00 2019 (r348155) +++ head/sys/kern/kern_descrip.c Thu May 23 12:25:03 2019 (r348156) @@ -3409,7 +3409,7 @@ xlate_fflags(int fflags) } /* Trim unused data from kf_path by truncating the structure size. */ -static void +void pack_kinfo(struct kinfo_file *kif) { Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu May 23 11:35:00 2019 (r348155) +++ head/sys/sys/user.h Thu May 23 12:25:03 2019 (r348156) @@ -608,6 +608,7 @@ int kern_proc_vmmap_out(struct proc *p, struct sbuf *s int flags); int vntype_to_kinfo(int vtype); +void pack_kinfo(struct kinfo_file *kif); #endif /* !_KERNEL */ #endif From owner-svn-src-all@freebsd.org Thu May 23 12:27:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3801015A90D9; Thu, 23 May 2019 12:27:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C92F46A611; Thu, 23 May 2019 12:27:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1FFC4F3C; Thu, 23 May 2019 12:27:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NCRjSW074012; Thu, 23 May 2019 12:27:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCRjIK074011; Thu, 23 May 2019 12:27:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231227.x4NCRjIK074011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 12:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348157 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C92F46A611 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:27:46 -0000 Author: kib Date: Thu May 23 12:27:45 2019 New Revision: 348157 URL: https://svnweb.freebsd.org/changeset/base/348157 Log: Report ref count of the backing object as st_nlink for posix shm fd. Unless there are transient references to the object, the ref count is equal to the number of the shared memory segment mappings plus one. Reviewed by: jilles, tmunro Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20258 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu May 23 12:25:03 2019 (r348156) +++ head/sys/kern/uipc_shm.c Thu May 23 12:27:45 2019 (r348157) @@ -419,6 +419,7 @@ shm_stat(struct file *fp, struct stat *sb, struct ucre mtx_unlock(&shm_timestamp_lock); sb->st_dev = shm_dev_ino; sb->st_ino = shmfd->shm_ino; + sb->st_nlink = shmfd->shm_object->ref_count; return (0); } From owner-svn-src-all@freebsd.org Thu May 23 12:35:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5066815A931C; Thu, 23 May 2019 12:35:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2F156AA71; Thu, 23 May 2019 12:35:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B07B650DB; Thu, 23 May 2019 12:35:40 +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 x4NCZesi079159; Thu, 23 May 2019 12:35:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCZegC079158; Thu, 23 May 2019 12:35:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231235.x4NCZegC079158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 12:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348158 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2F156AA71 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:35:41 -0000 Author: kib Date: Thu May 23 12:35:40 2019 New Revision: 348158 URL: https://svnweb.freebsd.org/changeset/base/348158 Log: Add a kern.ipc.posix_shm_list sysctl. The sysctl provides the listing on named linked posix shared memory segments existing in the system. Reuse shm_fill_kinfo() for filling individual struct kinfo_file. Remove unneeded lock around reading of shmfd->shm_mode. Reviewed by: jilles, tmunro Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20258 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu May 23 12:27:45 2019 (r348157) +++ head/sys/kern/uipc_shm.c Thu May 23 12:35:40 2019 (r348158) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1101,34 +1102,89 @@ shm_unmap(struct file *fp, void *mem, size_t size) } static int -shm_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) +shm_fill_kinfo_locked(struct shmfd *shmfd, struct kinfo_file *kif, bool list) { const char *path, *pr_path; - struct shmfd *shmfd; size_t pr_pathlen; + bool visible; + sx_assert(&shm_dict_lock, SA_LOCKED); kif->kf_type = KF_TYPE_SHM; - shmfd = fp->f_data; - - mtx_lock(&shm_timestamp_lock); - kif->kf_un.kf_file.kf_file_mode = S_IFREG | shmfd->shm_mode; /* XXX */ - mtx_unlock(&shm_timestamp_lock); + kif->kf_un.kf_file.kf_file_mode = S_IFREG | shmfd->shm_mode; kif->kf_un.kf_file.kf_file_size = shmfd->shm_size; if (shmfd->shm_path != NULL) { - sx_slock(&shm_dict_lock); if (shmfd->shm_path != NULL) { path = shmfd->shm_path; pr_path = curthread->td_ucred->cr_prison->pr_path; if (strcmp(pr_path, "/") != 0) { /* Return the jail-rooted pathname. */ pr_pathlen = strlen(pr_path); - if (strncmp(path, pr_path, pr_pathlen) == 0 && - path[pr_pathlen] == '/') + visible = strncmp(path, pr_path, pr_pathlen) + == 0 && path[pr_pathlen] == '/'; + if (list && !visible) + return (EPERM); + if (visible) path += pr_pathlen; } strlcpy(kif->kf_path, path, sizeof(kif->kf_path)); } - sx_sunlock(&shm_dict_lock); } return (0); } + +static int +shm_fill_kinfo(struct file *fp, struct kinfo_file *kif, + struct filedesc *fdp __unused) +{ + int res; + + sx_slock(&shm_dict_lock); + res = shm_fill_kinfo_locked(fp->f_data, kif, false); + sx_sunlock(&shm_dict_lock); + return (res); +} + +static int +sysctl_posix_shm_list(SYSCTL_HANDLER_ARGS) +{ + struct shm_mapping *shmm; + struct sbuf sb; + struct kinfo_file kif; + u_long i; + ssize_t curlen; + int error, error2; + + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_file) * 5, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); + curlen = 0; + error = 0; + sx_slock(&shm_dict_lock); + for (i = 0; i < shm_hash + 1; i++) { + LIST_FOREACH(shmm, &shm_dictionary[i], sm_link) { + error = shm_fill_kinfo_locked(shmm->sm_shmfd, + &kif, true); + if (error == EPERM) + continue; + if (error != 0) + break; + pack_kinfo(&kif); + if (req->oldptr != NULL && + kif.kf_structsize + curlen > req->oldlen) + break; + error = sbuf_bcat(&sb, &kif, kif.kf_structsize) == 0 ? + 0 : ENOMEM; + if (error != 0) + break; + curlen += kif.kf_structsize; + } + } + sx_sunlock(&shm_dict_lock); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + +SYSCTL_PROC(_kern_ipc, OID_AUTO, posix_shm_list, + CTLFLAG_RD | CTLFLAG_MPSAFE | CTLTYPE_OPAQUE, + NULL, 0, sysctl_posix_shm_list, "", + "POSIX SHM list"); From owner-svn-src-all@freebsd.org Thu May 23 12:51:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979FE15A9861; Thu, 23 May 2019 12:51:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35ECD6B207; Thu, 23 May 2019 12:51:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D22FE5408; Thu, 23 May 2019 12:51:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NCpDab084742; Thu, 23 May 2019 12:51:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCpDeT084740; Thu, 23 May 2019 12:51:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905231251.x4NCpDeT084740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 May 2019 12:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348159 - head/sys/dev/mrsas X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/mrsas X-SVN-Commit-Revision: 348159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35ECD6B207 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:51:14 -0000 Author: avg Date: Thu May 23 12:51:13 2019 New Revision: 348159 URL: https://svnweb.freebsd.org/changeset/base/348159 Log: add mrsas_shutdown method It should be safer to flush controller and disk caches on the shutdown. And to gracefully shut down the controller as well. It seems that the Linux driver has been doing that for a long time. Discussed with: scottl Reviewed by: imp, Sumit Saxena (both earlier version) MFC after: 3 weeks Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D19817 Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Thu May 23 12:35:40 2019 (r348158) +++ head/sys/dev/mrsas/mrsas.c Thu May 23 12:51:13 2019 (r348159) @@ -1182,6 +1182,39 @@ mrsas_detach(device_t dev) return (0); } +static int +mrsas_shutdown(device_t dev) +{ + struct mrsas_softc *sc; + int i; + + sc = device_get_softc(dev); + sc->remove_in_progress = 1; + if (panicstr == NULL) { + if (sc->ocr_thread_active) + wakeup(&sc->ocr_chan); + i = 0; + while (sc->reset_in_progress && i < 15) { + i++; + if ((i % MRSAS_RESET_NOTICE_INTERVAL) == 0) { + mrsas_dprint(sc, MRSAS_INFO, + "[%2d]waiting for OCR to be finished " + "from %s\n", i, __func__); + } + pause("mr_shutdown", hz); + } + if (sc->reset_in_progress) { + mrsas_dprint(sc, MRSAS_INFO, + "gave up waiting for OCR to be finished\n"); + } + } + + mrsas_flush_cache(sc); + mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); + mrsas_disable_intr(sc); + return (0); +} + /* * mrsas_free_mem: Frees allocated memory * input: Adapter instance soft state @@ -5028,6 +5061,7 @@ static device_method_t mrsas_methods[] = { DEVMETHOD(device_probe, mrsas_probe), DEVMETHOD(device_attach, mrsas_attach), DEVMETHOD(device_detach, mrsas_detach), + DEVMETHOD(device_shutdown, mrsas_shutdown), DEVMETHOD(device_suspend, mrsas_suspend), DEVMETHOD(device_resume, mrsas_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), From owner-svn-src-all@freebsd.org Thu May 23 12:51:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88BD15A9888; Thu, 23 May 2019 12:51:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 506E86B355; Thu, 23 May 2019 12:51:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9B75421; Thu, 23 May 2019 12:51:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NCpTcf085524; Thu, 23 May 2019 12:51:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCpTxb085523; Thu, 23 May 2019 12:51:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231251.x4NCpTxb085523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 12:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348160 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 348160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 506E86B355 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:51:30 -0000 Author: kib Date: Thu May 23 12:51:29 2019 New Revision: 348160 URL: https://svnweb.freebsd.org/changeset/base/348160 Log: MFC r347692: Remove more dead definitions from rtld_malloc.c after r347019. Modified: stable/12/libexec/rtld-elf/rtld_malloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 23 12:51:13 2019 (r348159) +++ stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 23 12:51:29 2019 (r348160) @@ -81,17 +81,13 @@ union overhead { } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index -#define ov_rmagic ovu.ovu_rmagic -#define ov_size ovu.ovu_size }; static void morecore(int bucket); static int morepages(int n); static int findbucket(union overhead *freep, int srchlen); - #define MAGIC 0xef /* magic # on accounting info */ -#define RMAGIC 0x5555 /* magic # on range info */ /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The From owner-svn-src-all@freebsd.org Thu May 23 12:52:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC89615A991F; Thu, 23 May 2019 12:52:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1EF6B574; Thu, 23 May 2019 12:52:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4039B545E; Thu, 23 May 2019 12:52:20 +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 x4NCqKu4088785; Thu, 23 May 2019 12:52:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NCqKiL088784; Thu, 23 May 2019 12:52:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231252.x4NCqKiL088784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 12:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348161 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 348161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D1EF6B574 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 12:52:21 -0000 Author: kib Date: Thu May 23 12:52:19 2019 New Revision: 348161 URL: https://svnweb.freebsd.org/changeset/base/348161 Log: MFC r347693: rtld_malloc.c: cleanup morepages(). Modified: stable/12/libexec/rtld-elf/rtld_malloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 23 12:51:29 2019 (r348160) +++ stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 23 12:52:19 2019 (r348161) @@ -345,12 +345,11 @@ findbucket(union overhead *freep, int srchlen) static int morepages(int n) { - int fd = -1; - int offset; + caddr_t addr; + int offset; if (pagepool_end - pagepool_start > pagesz) { - caddr_t addr = (caddr_t) - (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); + addr = (caddr_t)roundup2((long)pagepool_start, pagesz); if (munmap(addr, pagepool_end - addr) != 0) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": " @@ -360,20 +359,21 @@ morepages(int n) } } - offset = (long)pagepool_start - ((long)pagepool_start & ~(pagesz - 1)); + offset = (long)pagepool_start - rounddown2((long)pagepool_start, + pagesz); - if ((pagepool_start = mmap(0, n * pagesz, - PROT_READ|PROT_WRITE, - MAP_ANON|MAP_PRIVATE, fd, 0)) == (caddr_t)-1) { + pagepool_start = mmap(0, n * pagesz, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); + if (pagepool_start == MAP_FAILED) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": morepages: " "cannot mmap anonymous memory: %s\n", rtld_strerror(errno)); #endif - return 0; + return (0); } pagepool_end = pagepool_start + n * pagesz; pagepool_start += offset; - return n; + return (n); } From owner-svn-src-all@freebsd.org Thu May 23 13:03:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C67E415A9CEB; Thu, 23 May 2019 13:03:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B11E6BC2E; Thu, 23 May 2019 13:03:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E1CD5613; Thu, 23 May 2019 13:03:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ND3A6r094805; Thu, 23 May 2019 13:03:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ND3AXD094804; Thu, 23 May 2019 13:03:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231303.x4ND3AXD094804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 13:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348162 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 348162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B11E6BC2E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 13:03:12 -0000 Author: kib Date: Thu May 23 13:03:10 2019 New Revision: 348162 URL: https://svnweb.freebsd.org/changeset/base/348162 Log: MFC r347694: subr_turnstile: Extract some common code to a helper. Modified: stable/12/sys/kern/subr_turnstile.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_turnstile.c ============================================================================== --- stable/12/sys/kern/subr_turnstile.c Thu May 23 12:52:19 2019 (r348161) +++ stable/12/sys/kern/subr_turnstile.c Thu May 23 13:03:10 2019 (r348162) @@ -897,6 +897,24 @@ turnstile_broadcast(struct turnstile *ts, int queue) } } +static u_char +turnstile_calc_unlend_prio_locked(struct thread *td) +{ + struct turnstile *nts; + u_char cp, pri; + + THREAD_LOCK_ASSERT(td, MA_OWNED); + mtx_assert(&td_contested_lock, MA_OWNED); + + pri = PRI_MAX; + LIST_FOREACH(nts, &td->td_contested, ts_link) { + cp = turnstile_first_waiter(nts)->td_priority; + if (cp < pri) + pri = cp; + } + return (pri); +} + /* * Wakeup all threads on the pending list and adjust the priority of the * current thread appropriately. This must be called with the turnstile @@ -906,9 +924,8 @@ void turnstile_unpend(struct turnstile *ts) { TAILQ_HEAD( ,thread) pending_threads; - struct turnstile *nts; struct thread *td; - u_char cp, pri; + u_char pri; MPASS(ts != NULL); mtx_assert(&ts->ts_lock, MA_OWNED); @@ -932,7 +949,6 @@ turnstile_unpend(struct turnstile *ts) * priority however. */ td = curthread; - pri = PRI_MAX; thread_lock(td); mtx_lock_spin(&td_contested_lock); /* @@ -946,11 +962,7 @@ turnstile_unpend(struct turnstile *ts) ts->ts_owner = NULL; LIST_REMOVE(ts, ts_link); } - LIST_FOREACH(nts, &td->td_contested, ts_link) { - cp = turnstile_first_waiter(nts)->td_priority; - if (cp < pri) - pri = cp; - } + pri = turnstile_calc_unlend_prio_locked(td); mtx_unlock_spin(&td_contested_lock); sched_unlend_prio(td, pri); thread_unlock(td); @@ -991,7 +1003,7 @@ void turnstile_disown(struct turnstile *ts) { struct thread *td; - u_char cp, pri; + u_char pri; MPASS(ts != NULL); mtx_assert(&ts->ts_lock, MA_OWNED); @@ -1017,15 +1029,10 @@ turnstile_disown(struct turnstile *ts) * priority however. */ td = curthread; - pri = PRI_MAX; thread_lock(td); mtx_unlock_spin(&ts->ts_lock); mtx_lock_spin(&td_contested_lock); - LIST_FOREACH(ts, &td->td_contested, ts_link) { - cp = turnstile_first_waiter(ts)->td_priority; - if (cp < pri) - pri = cp; - } + pri = turnstile_calc_unlend_prio_locked(td); mtx_unlock_spin(&td_contested_lock); sched_unlend_prio(td, pri); thread_unlock(td); From owner-svn-src-all@freebsd.org Thu May 23 13:05:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 691E215A9DDD; Thu, 23 May 2019 13:05:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8166BDE5; Thu, 23 May 2019 13:05:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D671F5615; Thu, 23 May 2019 13:05:47 +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 x4ND5lY6094983; Thu, 23 May 2019 13:05:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ND5lqq094982; Thu, 23 May 2019 13:05:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231305.x4ND5lqq094982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 13:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348163 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 348163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B8166BDE5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 13:05:48 -0000 Author: kib Date: Thu May 23 13:05:47 2019 New Revision: 348163 URL: https://svnweb.freebsd.org/changeset/base/348163 Log: MFC r347698: amd64 pmap: sysctl vm.pmap.pcid_save_cnt should be read-only. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Thu May 23 13:03:10 2019 (r348162) +++ stable/12/sys/amd64/amd64/pmap.c Thu May 23 13:05:47 2019 (r348163) @@ -466,7 +466,7 @@ pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) } return (sysctl_handle_64(oidp, &res, 0, req)); } -SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RW | +SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, pmap_pcid_save_cnt_proc, "QU", "Count of saved TLB context on switch"); From owner-svn-src-all@freebsd.org Thu May 23 14:02:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89A2415AB8F0; Thu, 23 May 2019 14:02:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC2B6DB48; Thu, 23 May 2019 14:02:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B2D603D; Thu, 23 May 2019 14:02:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NE2dgE026049; Thu, 23 May 2019 14:02:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NE2dQk026048; Thu, 23 May 2019 14:02:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231402.x4NE2dQk026048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 14:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348164 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 348164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FC2B6DB48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:02:40 -0000 Author: ian Date: Thu May 23 14:02:39 2019 New Revision: 348164 URL: https://svnweb.freebsd.org/changeset/base/348164 Log: Mark i2c slave devices busy while they own the bus. Many i2c slave drivers are in modules that can be unloaded. If they detach while IO is in progress the bus would be hung forever. Conversely, lower-layer drivers (iicbus and the hardware driver) also live in modules and other kinds of bad things happen if they get detached while IO is in progress. Because device_busy() propagates up to parents, marking the slave device busy while it owns the bus solves both kinds of problems that come with detaching i2c devices while IO is in progress. Modified: head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Thu May 23 13:05:47 2019 (r348163) +++ head/sys/dev/iicbus/iiconf.c Thu May 23 14:02:39 2019 (r348164) @@ -128,6 +128,12 @@ iicbus_request_bus(device_t bus, device_t dev, int how ++sc->owncount; if (sc->owner == NULL) { sc->owner = dev; + /* + * Mark the device busy while it owns the bus, to + * prevent detaching the device, bus, or hardware + * controller, until ownership is relinquished. + */ + device_busy(dev); /* * Drop the lock around the call to the bus driver, it * should be allowed to sleep in the IIC_WAIT case. @@ -177,6 +183,7 @@ iicbus_release_bus(device_t bus, device_t dev) IICBUS_LOCK(sc); sc->owner = NULL; wakeup_one(sc); + device_unbusy(dev); } IICBUS_UNLOCK(sc); return (0); From owner-svn-src-all@freebsd.org Thu May 23 14:05:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71D6C15AB9C4; Thu, 23 May 2019 14:05:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 133616DD0C; Thu, 23 May 2019 14:05:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E03846048; Thu, 23 May 2019 14:05:42 +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 x4NE5gXJ026231; Thu, 23 May 2019 14:05:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NE5gXP026230; Thu, 23 May 2019 14:05:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231405.x4NE5gXP026230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 14:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348165 - head/usr.sbin/etcupdate X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/etcupdate X-SVN-Commit-Revision: 348165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 133616DD0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:05:43 -0000 Author: manu Date: Thu May 23 14:05:42 2019 New Revision: 348165 URL: https://svnweb.freebsd.org/changeset/base/348165 Log: etcupdate: Add missing directory when building the tree Missed in 348151 Reported by: lwshu, ci Modified: head/usr.sbin/etcupdate/etcupdate.sh Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 14:02:39 2019 (r348164) +++ head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 14:05:42 2019 (r348165) @@ -198,7 +198,7 @@ build_tree() for file in $PREWORLD_FILES; do name=$(basename $file) mkdir -p $1/etc >&3 2>&1 || return 1 - cp -p $SRCDIR/$file etc/$name || return 1 + cp -p $SRCDIR/$file $1/etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && From owner-svn-src-all@freebsd.org Thu May 23 14:10:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC9E315ABBFA; Thu, 23 May 2019 14:10:41 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.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 5F7616E042; Thu, 23 May 2019 14:10:41 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id A0F2C270021A; Thu, 23 May 2019 10:10:33 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu A0F2C270021A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1558620633; bh=o7Eg5q7rHihN6xqLFPDbYZaOtN8Sqn59U8+KOedF9KA=; h=Subject:To:From:Date:From; b=lAt8FYnhMgp7rn7p7+fGk2zIRzPvc/Ltm5Dm424+Cbyt6O1vw7wqdaehCLf+HbgFX +UtSdSGuU3DshPZIc3giXEmd23VJusEid+O61YWE0j/T18EiPwBfCwi9bLFGdXQmBQ 8RAT02XUtk35u1498WVMARQixD0L1WNUaewdD67W5x2jPwA26dXZ0h6GkKvZiImHEV O+eB0dv1AGTnHm3xz87P4B2XLPnQu+vp4EKeNM18T30YyMwt3tNQXrUyj97R29/WnQ RjQIwIXM7MnItFbFUR6LtijQvhq3PUGeRFpF8xOnq8d2BIVKG++9VOq25sMSW0yNmI aZ+8NISbHIFGQ== Subject: Re: svn commit: r348109 - in head/sys/x86: include x86 To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905221344.x4MDiGGV056469@repo.freebsd.org> <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> From: Andrew Gallatin Message-ID: <8f14727a-6e38-59fa-77f2-ce3aef18c0ed@cs.duke.edu> Date: Thu, 23 May 2019 10:10:31 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <00116a41-d811-cda9-304e-589738c54508@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5F7616E042 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:10:41 -0000 On 2019-05-22 13:09, Andriy Gapon wrote: > On 22/05/2019 16:44, Andrew Gallatin wrote: >> This is needed for AMD SMCA processors, as SMCA uses different >> MSR address for access MCA banks. > > Just curious, what is SMCA? > > " Scalable Machine Check Architecture " See https://www.nextplatform.com/2017/07/12/heart-amds-epyc-comeback-infinity-fabric/ Drew From owner-svn-src-all@freebsd.org Thu May 23 14:21:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E69815AC04F; Thu, 23 May 2019 14:21:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A01726E6A7; Thu, 23 May 2019 14:21:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D48863AA; Thu, 23 May 2019 14:21:23 +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 x4NELNYm032689; Thu, 23 May 2019 14:21:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NELN71032688; Thu, 23 May 2019 14:21:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231421.x4NELN71032688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 14:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348166 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 348166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A01726E6A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:21:24 -0000 Author: ian Date: Thu May 23 14:21:23 2019 New Revision: 348166 URL: https://svnweb.freebsd.org/changeset/base/348166 Log: Release the bus-recovery gpio pins in detach(), so that unload then reload of the module works without "pin already allocated" errors. Modified: head/sys/arm/freescale/imx/imx_i2c.c Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Thu May 23 14:05:42 2019 (r348165) +++ head/sys/arm/freescale/imx/imx_i2c.c Thu May 23 14:21:23 2019 (r348166) @@ -469,6 +469,10 @@ i2c_detach(device_t dev) if (sc->iicbus != NULL) device_delete_child(dev, sc->iicbus); + /* Release bus-recover pins; gpio_pin_release() handles NULL args. */ + gpio_pin_release(sc->rb_sclpin); + gpio_pin_release(sc->rb_sdapin); + if (sc->res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); From owner-svn-src-all@freebsd.org Thu May 23 14:33:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1845915AC756; Thu, 23 May 2019 14:33:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7206F104; Thu, 23 May 2019 14:33:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89DB765C1; Thu, 23 May 2019 14:33:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NEX2Q3042026; Thu, 23 May 2019 14:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NEX2QF042023; Thu, 23 May 2019 14:33:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231433.x4NEX2QF042023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 14:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348167 - in head/usr.bin: . posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/usr.bin: . posixshmcontrol X-SVN-Commit-Revision: 348167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE7206F104 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:33:03 -0000 Author: kib Date: Thu May 23 14:33:01 2019 New Revision: 348167 URL: https://svnweb.freebsd.org/changeset/base/348167 Log: Add posixshmcontrol(1), an utility to manipulate posix shared memory segments. See usage for the command line structure. Man page will come shortly. Reviewed by: jilles, tmunro Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20258 Added: head/usr.bin/posixshmcontrol/ head/usr.bin/posixshmcontrol/Makefile (contents, props changed) head/usr.bin/posixshmcontrol/posixshmcontrol.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu May 23 14:21:23 2019 (r348166) +++ head/usr.bin/Makefile Thu May 23 14:33:01 2019 (r348167) @@ -114,6 +114,7 @@ SUBDIR= alias \ patch \ pathchk \ perror \ + posixshmcontrol \ pr \ printenv \ printf \ Added: head/usr.bin/posixshmcontrol/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/posixshmcontrol/Makefile Thu May 23 14:33:01 2019 (r348167) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= posixshmcontrol +LIBADD= util +WARNS?= 6 +MAN= + +.include Added: head/usr.bin/posixshmcontrol/posixshmcontrol.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.c Thu May 23 14:33:01 2019 (r348167) @@ -0,0 +1,480 @@ +/*- + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void +usage(void) +{ + + fprintf(stderr, "Usage:\n" + "posixshmcontrol create [-m ] ...\n" + "posixshmcontrol rm ...\n" + "posixshmcontrol ls [-h] [-n]\n" + "posixshmcontrol dump ...\n" + "posixshmcontrol stat [-h] [-n] ...\n" + "posixshmcontrol truncate [-s ] ...\n"); +} + +static int +create_one_shm(const char *path, long mode) +{ + int fd; + + fd = shm_open(path, O_RDWR | O_CREAT, mode); + if (fd == -1) { + warn("create %s", path); + return (1); + } + close(fd); + return (0); +} + +static int +create_shm(int argc, char **argv) +{ + char *end; + long mode; + int c, i, ret, ret1; + + mode = 0600; + while ((c = getopt(argc, argv, "m:")) != -1) { + switch (c) { + case 'm': + errno = 0; + mode = strtol(optarg, &end, 0); + if (mode == 0 && errno != 0) + err(1, "mode:"); + if (*end != '\0') + errx(1, "non-integer mode"); + break; + case '?': + default: + usage(); + return (2); + } + } + + argc -= optind; + argv += optind; + ret = 0; + for (i = 0; i < argc; i++) { + ret1 = create_one_shm(argv[i], mode); + if (ret1 != 0 && ret == 0) + ret = ret1; + } + return (ret); +} + +static int +delete_one_shm(const char *path) +{ + int error, ret; + + error = shm_unlink(path); + if (error != 0) { + warn("unlink of %s failed", path); + ret = 1; + } else { + ret = 0; + } + return (ret); +} + +static int +delete_shm(int argc, char **argv) +{ + int i, ret, ret1; + + ret = 0; + for (i = 1; i < argc; i++) { + ret1 = delete_one_shm(argv[i]); + if (ret1 != 0 && ret == 0) + ret = ret1; + } + return (ret); +} + +static const char listmib[] = "kern.ipc.posix_shm_list"; + +static void +shm_decode_mode(mode_t m, char *str) +{ + int i; + + i = 0; + str[i++] = (m & S_IRUSR) != 0 ? 'r' : '-'; + str[i++] = (m & S_IWUSR) != 0 ? 'w' : '-'; + str[i++] = (m & S_IXUSR) != 0 ? 'x' : '-'; + str[i++] = (m & S_IRGRP) != 0 ? 'r' : '-'; + str[i++] = (m & S_IWGRP) != 0 ? 'w' : '-'; + str[i++] = (m & S_IXGRP) != 0 ? 'x' : '-'; + str[i++] = (m & S_IROTH) != 0 ? 'r' : '-'; + str[i++] = (m & S_IWOTH) != 0 ? 'w' : '-'; + str[i++] = (m & S_IXOTH) != 0 ? 'x' : '-'; + str[i] = '\0'; +} + +static int +list_shm(int argc, char **argv) +{ + char *buf, *bp, sizebuf[8], str[10], c; + const struct kinfo_file *kif; + struct stat st; + int error, fd, mib[3], ret; + size_t len, miblen; + bool hsize, uname; + + hsize = false; + uname = true; + + while ((c = getopt(argc, argv, "hn")) != -1) { + switch (c) { + case 'h': + hsize = true; + break; + case 'n': + uname = false; + break; + default: + usage(); + return (2); + } + } + if (argc != optind) { + usage(); + return (2); + } + + miblen = nitems(mib); + error = sysctlnametomib(listmib, mib, &miblen); + if (error == -1) { + warn("cannot translate %s", listmib); + return (1); + } + len = 0; + error = sysctl(mib, miblen, NULL, &len, NULL, 0); + if (error == -1) { + warn("cannot get %s length", listmib); + return (1); + } + len = len * 4 / 3; + buf = malloc(len); + if (buf == NULL) { + warn("malloc"); + return (1); + } + error = sysctl(mib, miblen, buf, &len, NULL, 0); + if (error != 0) { + warn("reading %s", listmib); + ret = 1; + goto out; + } + ret = 0; + printf("MODE \tOWNER\tGROUP\tSIZE\tPATH\n"); + for (bp = buf; bp < buf + len; bp += kif->kf_structsize) { + kif = (const struct kinfo_file *)(void *)bp; + if (kif->kf_structsize == 0) + break; + fd = shm_open(kif->kf_path, O_RDONLY, 0); + if (fd == -1) { + warn("open %s", kif->kf_path); + ret = 1; + continue; + } + error = fstat(fd, &st); + close(fd); + if (error != 0) { + warn("stat %s", kif->kf_path); + ret = 1; + continue; + } + shm_decode_mode(kif->kf_un.kf_file.kf_file_mode, str); + printf("%s\t", str); + if (uname) { + printf("%s\t%s\t", user_from_uid(st.st_uid, 0), + group_from_gid(st.st_gid, 0)); + } else { + printf("%d\t%d\t", st.st_uid, st.st_gid); + } + if (hsize) { + humanize_number(sizebuf, sizeof(sizebuf), + kif->kf_un.kf_file.kf_file_size, "", HN_AUTOSCALE, + HN_NOSPACE); + printf("%s\t", sizebuf); + } else { + printf("%jd\t", + (uintmax_t)kif->kf_un.kf_file.kf_file_size); + } + printf("%s\n", kif->kf_path); + } +out: + free(buf); + return (ret); +} + +static int +read_one_shm(const char *path) +{ + char buf[4096]; + ssize_t size, se; + int fd, ret; + + ret = 1; + fd = shm_open(path, O_RDONLY, 0); + if (fd == -1) { + warn("open %s", path); + goto out; + } + for (;;) { + size = read(fd, buf, sizeof(buf)); + if (size > 0) { + se = fwrite(buf, 1, size, stdout); + if (se < size) { + warnx("short write to stdout"); + goto out; + } + } + if (size == (ssize_t)sizeof(buf)) + continue; + if (size >= 0 && size < (ssize_t)sizeof(buf)) { + ret = 0; + goto out; + } + warn("read from %s", path); + goto out; + } +out: + close(fd); + return (ret); +} + +static int +read_shm(int argc, char **argv) +{ + int i, ret, ret1; + + ret = 0; + for (i = 1; i < argc; i++) { + ret1 = read_one_shm(argv[i]); + if (ret1 != 0 && ret == 0) + ret = ret1; + } + return (ret); +} + +static int +stat_one_shm(const char *path, bool hsize, bool uname) +{ + char sizebuf[8]; + struct stat st; + int error, fd, ret; + + fd = shm_open(path, O_RDONLY, 0); + if (fd == -1) { + warn("open %s", path); + return (1); + } + ret = 0; + error = fstat(fd, &st); + if (error == -1) { + warn("stat %s", path); + ret = 1; + } else { + printf("path\t%s\n", path); + printf("inode\t%jd\n", (uintmax_t)st.st_ino); + printf("mode\t%#o\n", st.st_mode); + printf("nlink\t%jd\n", (uintmax_t)st.st_nlink); + if (uname) { + printf("owner\t%s\n", user_from_uid(st.st_uid, 0)); + printf("group\t%s\n", group_from_gid(st.st_gid, 0)); + } else { + printf("uid\t%d\n", st.st_uid); + printf("gid\t%d\n", st.st_gid); + } + if (hsize) { + humanize_number(sizebuf, sizeof(sizebuf), + st.st_size, "", HN_AUTOSCALE, HN_NOSPACE); + printf("size\t%s\n", sizebuf); + } else { + printf("size\t%jd\n", (uintmax_t)st.st_size); + } + printf("atime\t%ld.%09ld\n", (long)st.st_atime, + (long)st.st_atim.tv_nsec); + printf("mtime\t%ld.%09ld\n", (long)st.st_mtime, + (long)st.st_mtim.tv_nsec); + printf("ctime\t%ld.%09ld\n", (long)st.st_ctime, + (long)st.st_ctim.tv_nsec); + printf("birth\t%ld.%09ld\n", (long)st.st_birthtim.tv_sec, + (long)st.st_birthtim.tv_nsec); + } + close(fd); + return (ret); +} + +static int +stat_shm(int argc, char **argv) +{ + int c, i, ret, ret1; + bool hsize, uname; + + hsize = false; + uname = true; + + while ((c = getopt(argc, argv, "hn")) != -1) { + switch (c) { + case 'h': + hsize = true; + break; + case 'n': + uname = false; + break; + default: + usage(); + return (2); + } + } + argc -= optind; + argv += optind; + + ret = 0; + for (i = 0; i < argc; i++) { + ret1 = stat_one_shm(argv[i], hsize, uname); + if (ret1 != 0 && ret == 0) + ret = ret1; + } + return (ret); +} + +static int +truncate_one_shm(const char *path, uint64_t newsize) +{ + int error, fd, ret; + + ret = 0; + fd = shm_open(path, O_RDWR, 0); + if (fd == -1) { + warn("open %s", path); + return (1); + } + error = ftruncate(fd, newsize); + if (error == -1) { + warn("truncate %s", path); + ret = 1; + } + close(fd); + return (ret); +} + +static int +truncate_shm(int argc, char **argv) +{ + uint64_t newsize; + int c, i, ret, ret1; + + newsize = 0; + while ((c = getopt(argc, argv, "s:")) != -1) { + switch (c) { + case 's': + if (expand_number(optarg, &newsize) == -1) + err(1, "size:"); + break; + case '?': + default: + return (2); + } + } + + argc -= optind; + argv += optind; + ret = 0; + for (i = 0; i < argc; i++) { + ret1 = truncate_one_shm(argv[i], newsize); + if (ret1 != 0 && ret == 0) + ret = ret1; + } + return (ret); +} + +struct opmode { + const char *cmd; + int (*impl)(int argc, char **argv); +}; + +static const struct opmode opmodes[] = { + { .cmd = "create", .impl = create_shm}, + { .cmd = "rm", .impl = delete_shm, }, + { .cmd = "ls", .impl = list_shm }, + { .cmd = "dump", .impl = read_shm, }, + { .cmd = "stat", .impl = stat_shm, }, + { .cmd = "truncate", .impl = truncate_shm, }, +}; + +int +main(int argc, char *argv[]) +{ + const struct opmode *opmode; + int i, ret; + + ret = 0; + opmode = NULL; + + if (argc < 2) { + usage(); + exit(2); + } + for (i = 0; i < (int)nitems(opmodes); i++) { + if (strcmp(argv[1], opmodes[i].cmd) == 0) { + opmode = &opmodes[i]; + break; + } + } + if (opmode == NULL) { + usage(); + exit(2); + } + ret = opmode->impl(argc - 1, argv + 1); + exit(ret); +} From owner-svn-src-all@freebsd.org Thu May 23 14:40:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6545C15ACAED; Thu, 23 May 2019 14:40:29 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 CE1726F5B5; Thu, 23 May 2019 14:40:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4NEeQIW090578; Thu, 23 May 2019 07:40:26 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4NEeQ7L090577; Thu, 23 May 2019 07:40:26 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905231440.x4NEeQ7L090577@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348167 - in head/usr.bin: . posixshmcontrol In-Reply-To: <201905231433.x4NEX2QF042023@repo.freebsd.org> To: Konstantin Belousov Date: Thu, 23 May 2019 07:40:26 -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-Rspamd-Queue-Id: CE1726F5B5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:40:29 -0000 > Author: kib > Date: Thu May 23 14:33:01 2019 > New Revision: 348167 > URL: https://svnweb.freebsd.org/changeset/base/348167 > > Log: > Add posixshmcontrol(1), an utility to manipulate posix shared memory segments. > > See usage for the command line structure. Man page will come shortly. > > Reviewed by: jilles, tmunro > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D20258 > > Added: > head/usr.bin/posixshmcontrol/ > head/usr.bin/posixshmcontrol/Makefile (contents, props changed) > head/usr.bin/posixshmcontrol/posixshmcontrol.c (contents, props changed) > Modified: > head/usr.bin/Makefile Can someone extract the usage: and slap a template man page up so that apropos can at least locate this command? Thanks, Rod > + fprintf(stderr, "Usage:\n" > + "posixshmcontrol create [-m ] ...\n" > + "posixshmcontrol rm ...\n" > + "posixshmcontrol ls [-h] [-n]\n" > + "posixshmcontrol dump ...\n" > + "posixshmcontrol stat [-h] [-n] ...\n" > + "posixshmcontrol truncate [-s ] ...\n"); -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 23 14:58:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DEC815AD27E; Thu, 23 May 2019 14:58:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03E156FFC0; Thu, 23 May 2019 14:58:54 +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 x4NEwk2u041404 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 17:58:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4NEwk2u041404 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4NEwkv1041403; Thu, 23 May 2019 17:58:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 23 May 2019 17:58:45 +0300 From: Konstantin Belousov To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348167 - in head/usr.bin: . posixshmcontrol Message-ID: <20190523145845.GH2748@kib.kiev.ua> References: <201905231433.x4NEX2QF042023@repo.freebsd.org> <201905231440.x4NEeQ7L090577@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905231440.x4NEeQ7L090577@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 14:58:56 -0000 On Thu, May 23, 2019 at 07:40:26AM -0700, Rodney W. Grimes wrote: > > Author: kib > > Date: Thu May 23 14:33:01 2019 > > New Revision: 348167 > > URL: https://svnweb.freebsd.org/changeset/base/348167 > > > > Log: > > Add posixshmcontrol(1), an utility to manipulate posix shared memory segments. > > > > See usage for the command line structure. Man page will come shortly. > > > > Reviewed by: jilles, tmunro > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D20258 > > > > Added: > > head/usr.bin/posixshmcontrol/ > > head/usr.bin/posixshmcontrol/Makefile (contents, props changed) > > head/usr.bin/posixshmcontrol/posixshmcontrol.c (contents, props changed) > > Modified: > > head/usr.bin/Makefile > > Can someone extract the usage: and slap a template man page > up so that apropos can at least locate this command? I do not think it is needed. I will write the manual page after the utility sit in HEAD for some time, to be sure that the cli interface is not changing. From owner-svn-src-all@freebsd.org Thu May 23 15:00:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AEE715AD350; Thu, 23 May 2019 15:00:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D267D70156; Thu, 23 May 2019 15:00:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA4566983; Thu, 23 May 2019 15:00:15 +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 x4NF0FsZ052948; Thu, 23 May 2019 15:00:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NF0FNI052947; Thu, 23 May 2019 15:00:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905231500.x4NF0FNI052947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 May 2019 15:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348168 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D267D70156 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:00:16 -0000 Author: kib Date: Thu May 23 15:00:15 2019 New Revision: 348168 URL: https://svnweb.freebsd.org/changeset/base/348168 Log: Use int for the getopt() result. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.c Thu May 23 14:33:01 2019 (r348167) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.c Thu May 23 15:00:15 2019 (r348168) @@ -160,10 +160,10 @@ shm_decode_mode(mode_t m, char *str) static int list_shm(int argc, char **argv) { - char *buf, *bp, sizebuf[8], str[10], c; + char *buf, *bp, sizebuf[8], str[10]; const struct kinfo_file *kif; struct stat st; - int error, fd, mib[3], ret; + int c, error, fd, mib[3], ret; size_t len, miblen; bool hsize, uname; From owner-svn-src-all@freebsd.org Thu May 23 15:01:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AC015AD3C3; Thu, 23 May 2019 15:01:11 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 3C43A70328; Thu, 23 May 2019 15:01:10 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4NF163a090747; Thu, 23 May 2019 08:01:06 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4NF16FX090746; Thu, 23 May 2019 08:01:06 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905231501.x4NF16FX090746@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348167 - in head/usr.bin: . posixshmcontrol In-Reply-To: <20190523145845.GH2748@kib.kiev.ua> To: Konstantin Belousov Date: Thu, 23 May 2019 08:01:06 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 3C43A70328 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:01:11 -0000 > On Thu, May 23, 2019 at 07:40:26AM -0700, Rodney W. Grimes wrote: > > > Author: kib > > > Date: Thu May 23 14:33:01 2019 > > > New Revision: 348167 > > > URL: https://svnweb.freebsd.org/changeset/base/348167 > > > > > > Log: > > > Add posixshmcontrol(1), an utility to manipulate posix shared memory segments. > > > > > > See usage for the command line structure. Man page will come shortly. > > > > > > Reviewed by: jilles, tmunro > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D20258 > > > > > > Added: > > > head/usr.bin/posixshmcontrol/ > > > head/usr.bin/posixshmcontrol/Makefile (contents, props changed) > > > head/usr.bin/posixshmcontrol/posixshmcontrol.c (contents, props changed) > > > Modified: > > > head/usr.bin/Makefile > > > > Can someone extract the usage: and slap a template man page > > up so that apropos can at least locate this command? > > I do not think it is needed. I will write the manual page after the > utility sit in HEAD for some time, to be sure that the cli interface > is not changing. Oh, ok, great, if your going to write a man page everyone else can ignore my comment! Thanks for the utility too, it was surely needed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 23 15:47:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51AFE15AE46E; Thu, 23 May 2019 15:47:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC87871D58; Thu, 23 May 2019 15:47:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C70FE7206; Thu, 23 May 2019 15:47:30 +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 x4NFlUjS078743; Thu, 23 May 2019 15:47:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NFlUfE078741; Thu, 23 May 2019 15:47:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231547.x4NFlUfE078741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 15:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348169 - in head/sys/dev: iicbus ofw X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/dev: iicbus ofw X-SVN-Commit-Revision: 348169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC87871D58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:47:31 -0000 Author: ian Date: Thu May 23 15:47:30 2019 New Revision: 348169 URL: https://svnweb.freebsd.org/changeset/base/348169 Log: Define macros making it easier to define bus-specific pnpinfo for FDT systems. Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO() macro makes it easier to define new FDT-based pnpinfo for busses other than simplebus. Differential Revision: https://reviews.freebsd.org/D20382 Modified: head/sys/dev/iicbus/iicbus.h head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Thu May 23 15:00:15 2019 (r348168) +++ head/sys/dev/iicbus/iicbus.h Thu May 23 15:47:30 2019 (r348169) @@ -72,6 +72,12 @@ IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) #define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) +#ifdef FDT +#define IICBUS_FDT_PNPINFO(t) FDTCOMPAT_PNP_INFO(t, iicbus) +#else +#define IICBUS_FDT_PNPINFO(t) +#endif + int iicbus_generic_intr(device_t dev, int event, char *buf); void iicbus_init_frequency(device_t dev, u_int bus_freq); Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Thu May 23 15:00:15 2019 (r348168) +++ head/sys/dev/ofw/ofw_bus_subr.h Thu May 23 15:47:30 2019 (r348169) @@ -65,9 +65,11 @@ struct intr_map_data_fdt { }; #endif -#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" -#define SIMPLEBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0])); +#define FDTCOMPAT_PNP_DESCR "Z:compat;P:#;" +#define FDTCOMPAT_PNP_INFO(t, busname) \ + MODULE_PNP_INFO(FDTCOMPAT_PNP_DESCR, busname, t, t, sizeof(t) / sizeof(t[0])); + +#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus) /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); From owner-svn-src-all@freebsd.org Thu May 23 15:51:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1C115AE706; Thu, 23 May 2019 15:51:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89BC5720C8; Thu, 23 May 2019 15:51:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41A0B726B; Thu, 23 May 2019 15:51:52 +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 x4NFpqRP082111; Thu, 23 May 2019 15:51:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NFpq0i082110; Thu, 23 May 2019 15:51:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231551.x4NFpq0i082110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 15:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348170 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 348170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89BC5720C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:51:53 -0000 Author: ian Date: Thu May 23 15:51:51 2019 New Revision: 348170 URL: https://svnweb.freebsd.org/changeset/base/348170 Log: Add pnpinfo for icee(4) on fdt systems. Modified: head/sys/dev/iicbus/icee.c Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Thu May 23 15:47:30 2019 (r348169) +++ head/sys/dev/iicbus/icee.c Thu May 23 15:51:51 2019 (r348170) @@ -392,3 +392,4 @@ static devclass_t icee_devclass; DRIVER_MODULE(icee, iicbus, icee_driver, icee_devclass, 0, 0); MODULE_VERSION(icee, 1); MODULE_DEPEND(icee, iicbus, 1, 1, 1); +IICBUS_FDT_PNPINFO(compat_data); From owner-svn-src-all@freebsd.org Thu May 23 15:53:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E62615AE7AB; Thu, 23 May 2019 15:53:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40AEB723DF; Thu, 23 May 2019 15:53:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C24773AA; Thu, 23 May 2019 15:53:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NFrfZw084002; Thu, 23 May 2019 15:53:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NFrfAC084001; Thu, 23 May 2019 15:53:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905231553.x4NFrfAC084001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 May 2019 15:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348171 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40AEB723DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:53:42 -0000 Author: imp Date: Thu May 23 15:53:41 2019 New Revision: 348171 URL: https://svnweb.freebsd.org/changeset/base/348171 Log: Add warning that the PNP info has to follow the module declaration. Due to how the linker.hints file is laid out, we'll associate the pnp info with the wrong module if the module declaration comes after the pnp info. Until that limiation is removed, we need to have this ordering. Ideally, we'd also enforce the ordering somehow, but I've come up with no way to do that yet... Modified: head/share/man/man9/MODULE_PNP_INFO.9 Modified: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- head/share/man/man9/MODULE_PNP_INFO.9 Thu May 23 15:51:51 2019 (r348170) +++ head/share/man/man9/MODULE_PNP_INFO.9 Thu May 23 15:53:41 2019 (r348171) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2018 +.Dd May 23, 2019 .Dt MODULE_PNP_INFO 9 .Os .Sh NAME @@ -196,6 +196,14 @@ MODULE_PNP_INFO("U16:device;D:#;T:vendor=0x1234", pci, .Ed .El .\" +.Sh BUGS +The +.Nm +macro must follow +.Dv DRIVER_MODULE +invocations due to limitations in the +.Dv linker.hints +file format. .Sh SEE ALSO .Xr devmatch 8 , .Xr DRIVER_MODULE 9 , From owner-svn-src-all@freebsd.org Thu May 23 15:59:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286EE15AE88F; Thu, 23 May 2019 15:59:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F7572644; Thu, 23 May 2019 15:59:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9062773DA; Thu, 23 May 2019 15:59:51 +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 x4NFxpbo084317; Thu, 23 May 2019 15:59:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NFxoQ2084314; Thu, 23 May 2019 15:59:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231559.x4NFxoQ2084314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 15:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348172 - in head/sys/dev: flash spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/dev: flash spibus X-SVN-Commit-Revision: 348172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1F7572644 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 15:59:52 -0000 Author: ian Date: Thu May 23 15:59:50 2019 New Revision: 348172 URL: https://svnweb.freebsd.org/changeset/base/348172 Log: Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO(). Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be other kinds of pnpinfo for other (non-fdt) bus attachments. Modified: head/sys/dev/flash/at45d.c head/sys/dev/flash/mx25l.c head/sys/dev/spibus/spi.h Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Thu May 23 15:53:41 2019 (r348171) +++ head/sys/dev/flash/at45d.c Thu May 23 15:59:50 2019 (r348172) @@ -606,6 +606,6 @@ DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devcl MODULE_DEPEND(at45d, spibus, 1, 1, 1); #ifdef FDT MODULE_DEPEND(at45d, fdt_slicer, 1, 1, 1); -SPIBUS_PNP_INFO(compat_data); +SPIBUS_FDT_PNP_INFO(compat_data); #endif Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Thu May 23 15:53:41 2019 (r348171) +++ head/sys/dev/flash/mx25l.c Thu May 23 15:59:50 2019 (r348172) @@ -686,5 +686,5 @@ DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devcl MODULE_DEPEND(mx25l, spibus, 1, 1, 1); #ifdef FDT MODULE_DEPEND(mx25l, fdt_slicer, 1, 1, 1); -SPIBUS_PNP_INFO(compat_data); +SPIBUS_FDT_PNP_INFO(compat_data); #endif Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Thu May 23 15:53:41 2019 (r348171) +++ head/sys/dev/spibus/spi.h Thu May 23 15:59:50 2019 (r348172) @@ -41,6 +41,8 @@ struct spi_command { #define SPI_CHIP_SELECT_HIGH 0x1 /* Chip select high (else low) */ -#define SPIBUS_PNP_DESCR "Z:compat;P:#;" -#define SPIBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0])); +#ifdef FDT +#define SPIBUS_FDT_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, spibus) +#else +#define SPIBUS_FDT_PNP_INFO(t) +#endif From owner-svn-src-all@freebsd.org Thu May 23 16:03:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D08F115AEAEF; Thu, 23 May 2019 16:03:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B9D72B10; Thu, 23 May 2019 16:03:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4867C7598; Thu, 23 May 2019 16:03:31 +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 x4NG3Vpe089278; Thu, 23 May 2019 16:03:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NG3U44089276; Thu, 23 May 2019 16:03:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231603.x4NG3U44089276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 16:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348173 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 348173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B9D72B10 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 16:03:32 -0000 Author: ian Date: Thu May 23 16:03:30 2019 New Revision: 348173 URL: https://svnweb.freebsd.org/changeset/base/348173 Log: Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO. Modified: head/sys/dev/iicbus/icee.c head/sys/dev/iicbus/iicbus.h Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Thu May 23 15:59:50 2019 (r348172) +++ head/sys/dev/iicbus/icee.c Thu May 23 16:03:30 2019 (r348173) @@ -392,4 +392,4 @@ static devclass_t icee_devclass; DRIVER_MODULE(icee, iicbus, icee_driver, icee_devclass, 0, 0); MODULE_VERSION(icee, 1); MODULE_DEPEND(icee, iicbus, 1, 1, 1); -IICBUS_FDT_PNPINFO(compat_data); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Thu May 23 15:59:50 2019 (r348172) +++ head/sys/dev/iicbus/iicbus.h Thu May 23 16:03:30 2019 (r348173) @@ -73,9 +73,9 @@ IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) #ifdef FDT -#define IICBUS_FDT_PNPINFO(t) FDTCOMPAT_PNP_INFO(t, iicbus) +#define IICBUS_FDT_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, iicbus) #else -#define IICBUS_FDT_PNPINFO(t) +#define IICBUS_FDT_PNP_INFO(t) #endif int iicbus_generic_intr(device_t dev, int event, char *buf); From owner-svn-src-all@freebsd.org Thu May 23 16:05:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BED6F15AEB94; Thu, 23 May 2019 16:05:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62B4172CCC; Thu, 23 May 2019 16:05:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38E6D759D; Thu, 23 May 2019 16:05:48 +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 x4NG5mmC089417; Thu, 23 May 2019 16:05:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NG5lRm089414; Thu, 23 May 2019 16:05:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905231605.x4NG5lRm089414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 23 May 2019 16:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348174 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 348174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62B4172CCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 16:05:49 -0000 Author: tuexen Date: Thu May 23 16:05:47 2019 New Revision: 348174 URL: https://svnweb.freebsd.org/changeset/base/348174 Log: MFC r347975: Improve input validation for the IPPROTO_SCTP level socket options SCTP_CONNECT_X and SCTP_CONNECT_X_DELAYED. MFC r347976: Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state. This issue was found by running syzkaller. Approved by: re (gjb@) Modified: stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c stable/11/sys/netinet/sctputil.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Thu May 23 16:03:30 2019 (r348173) +++ stable/11/sys/netinet/sctp_usrreq.c Thu May 23 16:05:47 2019 (r348174) @@ -1352,13 +1352,12 @@ static int sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval, size_t optsize, void *p, int delay) { - int error = 0; + int error; int creat_lock_on = 0; struct sctp_tcb *stcb = NULL; struct sockaddr *sa; unsigned int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr; uint32_t vrf_id; - int bad_addresses = 0; sctp_assoc_t *a_id; SCTPDBG(SCTP_DEBUG_PCB1, "Connectx called\n"); @@ -1397,17 +1396,12 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb totaddrp = (unsigned int *)optval; totaddr = *totaddrp; sa = (struct sockaddr *)(totaddrp + 1); - stcb = sctp_connectx_helper_find(inp, sa, &totaddr, &num_v4, &num_v6, &error, (unsigned int)(optsize - sizeof(int)), &bad_addresses); - if ((stcb != NULL) || bad_addresses) { + error = sctp_connectx_helper_find(inp, sa, totaddr, &num_v4, &num_v6, (unsigned int)(optsize - sizeof(int))); + if (error != 0) { /* Already have or am bring up an association */ SCTP_ASOC_CREATE_UNLOCK(inp); creat_lock_on = 0; - if (stcb) - SCTP_TCB_UNLOCK(stcb); - if (bad_addresses == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); - error = EALREADY; - } + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); goto out_now; } #ifdef INET6 @@ -5338,10 +5332,11 @@ sctp_setopt(struct socket *so, int optname, void *optv net->dest_state &= ~SCTP_ADDR_NOHB; } if (paddrp->spp_flags & SPP_HB_DEMAND) { - /* on demand HB */ - sctp_send_hb(stcb, net, SCTP_SO_LOCKED); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { + sctp_send_hb(stcb, net, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); + } } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Thu May 23 16:03:30 2019 (r348173) +++ stable/11/sys/netinet/sctputil.c Thu May 23 16:05:47 2019 (r348174) @@ -6387,30 +6387,33 @@ out_now: return (added); } -struct sctp_tcb * +int sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - unsigned int *totaddr, - unsigned int *num_v4, unsigned int *num_v6, int *error, - unsigned int limit, int *bad_addr) + unsigned int totaddr, + unsigned int *num_v4, unsigned int *num_v6, + unsigned int limit) { struct sockaddr *sa; - struct sctp_tcb *stcb = NULL; + struct sctp_tcb *stcb; unsigned int incr, at, i; at = 0; sa = addr; - *error = *num_v6 = *num_v4 = 0; + *num_v6 = *num_v4 = 0; /* account and validate addresses */ - for (i = 0; i < *totaddr; i++) { + if (totaddr == 0) { + return (EINVAL); + } + for (i = 0; i < totaddr; i++) { + if (at + sizeof(struct sockaddr) > limit) { + return (EINVAL); + } switch (sa->sa_family) { #ifdef INET case AF_INET: incr = (unsigned int)sizeof(struct sockaddr_in); if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } (*num_v4) += 1; break; @@ -6423,46 +6426,34 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, stru sin6 = (struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { /* Must be non-mapped for connectx */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } incr = (unsigned int)sizeof(struct sockaddr_in6); if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + return (EINVAL); } (*num_v6) += 1; break; } #endif default: - *totaddr = i; - incr = 0; - /* we are done */ - break; + return (EINVAL); } - if (i == *totaddr) { - break; + if ((at + incr) > limit) { + return (EINVAL); } SCTP_INP_INCR_REF(inp); stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb != NULL) { - /* Already have or am bring up an association */ - return (stcb); + SCTP_TCB_UNLOCK(stcb); + return (EALREADY); } else { SCTP_INP_DECR_REF(inp); } - if ((at + incr) > limit) { - *totaddr = i; - break; - } + at += incr; sa = (struct sockaddr *)((caddr_t)sa + incr); } - return ((struct sctp_tcb *)NULL); + return (0); } /* Modified: stable/11/sys/netinet/sctputil.h ============================================================================== --- stable/11/sys/netinet/sctputil.h Thu May 23 16:03:30 2019 (r348173) +++ stable/11/sys/netinet/sctputil.h Thu May 23 16:05:47 2019 (r348174) @@ -209,10 +209,9 @@ int sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr, int totaddr, int *error); -struct sctp_tcb * -sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, - unsigned int *totaddr, unsigned int *num_v4, unsigned int *num_v6, - int *error, unsigned int limit, int *bad_addr); +int +sctp_connectx_helper_find(struct sctp_inpcb *, struct sockaddr *, + unsigned int, unsigned int *, unsigned int *, unsigned int); int sctp_is_there_an_abort_here(struct mbuf *, int, uint32_t *); #ifdef INET6 From owner-svn-src-all@freebsd.org Thu May 23 17:18:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A30215B01D7; Thu, 23 May 2019 17:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 100C075692; Thu, 23 May 2019 17:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C27D08276; Thu, 23 May 2019 17:18:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NHImkN026423; Thu, 23 May 2019 17:18:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHImrT026422; Thu, 23 May 2019 17:18:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905231718.x4NHImrT026422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 May 2019 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348175 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 348175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 100C075692 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.935,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:18:49 -0000 Author: imp Date: Thu May 23 17:18:48 2019 New Revision: 348175 URL: https://svnweb.freebsd.org/changeset/base/348175 Log: Implement "VARS_ONLY=1" via special command line args Add -v to print TYPE REVISION BRANCH RELEASE VERSION RELDATE variables Add -V var to print var's value Both of these in ${var}="${val}" format suitable for eval $(sh newvers.sh -v) in shell scripts / makefiles. Add -c to print the copyright / license comment text only. Document these, and remove soon-to-be obsolete comment. Minor code motion as well bunded here to put functions after VARS_ONLY and command line argument parsing. Differential Revision: https://reviews.freebsd.org/D19849 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu May 23 16:05:47 2019 (r348174) +++ head/sys/conf/newvers.sh Thu May 23 17:18:48 2019 (r348175) @@ -34,25 +34,105 @@ # Command line options: # -# -r Reproducible build. Do not embed directory names, user -# names, time stamps or other dynamic information into -# the output file. This is intended to allow two builds -# done at different times and even by different people on -# different hosts to produce identical output. +# -c Print the copyright / license statement as a C comment and exit # -# -R Reproducible build if the tree represents an unmodified -# checkout from a version control system. Metadata is -# included if the tree is modified. +# -r Reproducible build. Do not embed directory names, user names, +# time stamps or other dynamic information into the output file. +# This is intended to allow two builds done at different times +# and even by different people on different hosts to produce +# identical output. +# +# -R Reproducible build if the tree represents an unmodified +# checkout from a version control system. Metadata is included +# if the tree is modified. +# +# -V var Print ${var}="${val-of-var}" and exit +# +# -v Print TYPE REVISION BRANCH RELEASE VERSION RELDATE variabkes +# like the -V command +# -# Note: usr.sbin/amd/include/newvers.sh assumes all variable assignments of -# upper case variables starting in column 1 are on one line w/o continuation. - TYPE="FreeBSD" REVISION="13.0" BRANCH=${BRANCH_OVERRIDE:-CURRENT} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" +if [ -z "${SYSDIR}" ]; then + SYSDIR=$(dirname $0)/.. +fi + +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) + +if [ -r "${SYSDIR}/../COPYRIGHT" ]; then + year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) +else + year=$(date +%Y) +fi +# look for copyright template +b=share/examples/etc/bsd-style-copyright +for bsd_copyright in $b ../$b ../../$b ../../../$b /usr/src/$b /usr/$b +do + if [ -r "$bsd_copyright" ]; then + COPYRIGHT=$(sed \ + -e "s/\[year\]/1992-$year/" \ + -e 's/\[your name here\]\.* /The FreeBSD Project./' \ + -e 's/\[your name\]\.*/The FreeBSD Project./' \ + -e '/\[id for your version control system, if any\]/d' \ + $bsd_copyright) + break + fi +done + +# no copyright found, use a dummy +if [ -z "$COPYRIGHT" ]; then + COPYRIGHT="/*- + * Copyright (c) 1992-$year The FreeBSD Project. + * + */" +fi + +# add newline +COPYRIGHT="$COPYRIGHT +" + +include_metadata=true +while getopts crRvV: opt; do + case "$opt" in + c) + echo "$COPYRIGHT" + exit 0 + ;; + r) + include_metadata= + ;; + R) + if [ -z "${modified}" ]; then + include_metadata= + fi + ;; + v) + # Only put variables that are single lines here. + for v in TYPE REVISION BRANCH RELEASE VERSION RELDATE; do + eval val=\$${v} + echo ${v}=\"${val}\" + done + exit 0 + ;; + V) + v=$OPTARG + eval val=\$${v} + echo ${v}=\"${val}\" + exit 0 + ;; + esac +done +shift $((OPTIND - 1)) + +# VARS_ONLY means no files should be generated, this is just being +# included. +[ -n "$VARS_ONLY" ] && return 0 + # # findvcs dir # Looks up directory dir at world root and up the filesystem @@ -103,49 +183,6 @@ git_tree_modified() return 1 } - -if [ -z "${SYSDIR}" ]; then - SYSDIR=$(dirname $0)/.. -fi - -RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) - -if [ -r "${SYSDIR}/../COPYRIGHT" ]; then - year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) -else - year=$(date +%Y) -fi -# look for copyright template -b=share/examples/etc/bsd-style-copyright -for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b -do - if [ -r "$bsd_copyright" ]; then - COPYRIGHT=$(sed \ - -e "s/\[year\]/1992-$year/" \ - -e 's/\[your name here\]\.* /The FreeBSD Project./' \ - -e 's/\[your name\]\.*/The FreeBSD Project./' \ - -e '/\[id for your version control system, if any\]/d' \ - $bsd_copyright) - break - fi -done - -# no copyright found, use a dummy -if [ -z "$COPYRIGHT" ]; then - COPYRIGHT="/*- - * Copyright (c) 1992-$year The FreeBSD Project. - * - */" -fi - -# add newline -COPYRIGHT="$COPYRIGHT -" - -# VARS_ONLY means no files should be generated, this is just being -# included. -[ -n "$VARS_ONLY" ] && return 0 - LC_ALL=C; export LC_ALL if [ ! -r version ] then @@ -274,20 +311,6 @@ if [ -n "$hg_cmd" ] ; then hg=" ${hg}" fi fi - -include_metadata=true -while getopts rR opt; do - case "$opt" in - r) - include_metadata= - ;; - R) - if [ -z "${modified}" ]; then - include_metadata= - fi - esac -done -shift $((OPTIND - 1)) if [ -z "${include_metadata}" ]; then VERINFO="${VERSION}${svn}${git}${hg} ${i}" From owner-svn-src-all@freebsd.org Thu May 23 17:19:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C7A15B0203; Thu, 23 May 2019 17:19:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0627577D; Thu, 23 May 2019 17:18:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A752B827C; Thu, 23 May 2019 17:18:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NHIuw7026478; Thu, 23 May 2019 17:18:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHIuQF026477; Thu, 23 May 2019 17:18:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905231718.x4NHIuQF026477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 May 2019 17:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348176 - head/usr.sbin/amd/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/amd/include X-SVN-Commit-Revision: 348176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A0627577D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:19:00 -0000 Author: imp Date: Thu May 23 17:18:56 2019 New Revision: 348176 URL: https://svnweb.freebsd.org/changeset/base/348176 Log: Convert amd newvers to using newvers.sh -v. Rather than the tedious and error-prone grep of sys/conf/newvers.sh, use the new -v arg to dig out the data that's desired. Differential Revision: https://reviews.freebsd.org/D19849 Modified: head/usr.sbin/amd/include/newvers.sh Modified: head/usr.sbin/amd/include/newvers.sh ============================================================================== --- head/usr.sbin/amd/include/newvers.sh Thu May 23 17:18:48 2019 (r348175) +++ head/usr.sbin/amd/include/newvers.sh Thu May 23 17:18:56 2019 (r348176) @@ -5,7 +5,7 @@ # if [ -e $1 ]; then - eval `LC_ALL=C egrep '^[A-Z]+=' $1 | grep -v COPYRIGHT` + eval $(sh $1 -v) OS=`echo ${TYPE} | LC_ALL=C tr 'A-Z' 'a-z'` echo '/* Define name and version of host machine (eg. solaris2.5.1) */' echo "#define HOST_OS \"${OS}${REVISION}\"" From owner-svn-src-all@freebsd.org Thu May 23 17:19:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8494D15B020B; Thu, 23 May 2019 17:19:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B63D7579D; Thu, 23 May 2019 17:19:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC1CB827D; Thu, 23 May 2019 17:19:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NHJ0AG026536; Thu, 23 May 2019 17:19:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHJ0UK026535; Thu, 23 May 2019 17:19:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905231719.x4NHJ0UK026535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 May 2019 17:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348177 - head/bin/freebsd-version X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/bin/freebsd-version X-SVN-Commit-Revision: 348177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B63D7579D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:19:01 -0000 Author: imp Date: Thu May 23 17:19:00 2019 New Revision: 348177 URL: https://svnweb.freebsd.org/changeset/base/348177 Log: Convert freebsd-version to using -v newvers.sh has supported a variable setting only mode, use that in preference to grep to future proof this script from changes there. Differential Revision: https://reviews.freebsd.org/D19849 Modified: head/bin/freebsd-version/Makefile Modified: head/bin/freebsd-version/Makefile ============================================================================== --- head/bin/freebsd-version/Makefile Thu May 23 17:18:56 2019 (r348176) +++ head/bin/freebsd-version/Makefile Thu May 23 17:19:00 2019 (r348177) @@ -7,7 +7,7 @@ CLEANFILES = freebsd-version freebsd-version.sh NEWVERS = ${SRCTOP}/sys/conf/newvers.sh freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS} - eval $$(egrep '^(TYPE|REVISION|BRANCH)=' ${NEWVERS}) ; \ + eval $$(sh ${NEWVERS} -v); \ if ! sed -e "\ s/@@TYPE@@/$${TYPE}/g; \ s/@@REVISION@@/$${REVISION}/g; \ From owner-svn-src-all@freebsd.org Thu May 23 17:19:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4020815B0246; Thu, 23 May 2019 17:19:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D97A57585D; Thu, 23 May 2019 17:19:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB04C827E; Thu, 23 May 2019 17:19:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NHJ5YZ026590; Thu, 23 May 2019 17:19:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHJ5K5026589; Thu, 23 May 2019 17:19:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905231719.x4NHJ5K5026589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 May 2019 17:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348178 - head/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 348178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D97A57585D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:19:08 -0000 Author: imp Date: Thu May 23 17:19:05 2019 New Revision: 348178 URL: https://svnweb.freebsd.org/changeset/base/348178 Log: Move to using newvers -c instead of VARS_ONLY=1 Use newvers.sh -c to get the copyright, and newvers.sh -V RELDATE to get the release date. Differential Revision: https://reviews.freebsd.org/D19849 Modified: head/include/mk-osreldate.sh Modified: head/include/mk-osreldate.sh ============================================================================== --- head/include/mk-osreldate.sh Thu May 23 17:19:00 2019 (r348177) +++ head/include/mk-osreldate.sh Thu May 23 17:19:05 2019 (r348178) @@ -38,8 +38,8 @@ trap "rm -f $tmpfile" EXIT ${ECHO} creating osreldate.h from newvers.sh set +e -VARS_ONLY=1 -. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1 +COPYRIGHT=$(sh ${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh} -c) || exit 1 +eval $(sh ${NEWVERS_SH} -V RELDATE) || exit 1 set -e cat > $tmpfile < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175DE15B0754; Thu, 23 May 2019 17:34:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0BF5762AB; Thu, 23 May 2019 17:34:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705AE85D9; Thu, 23 May 2019 17:34:34 +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 x4NHYY12037057; Thu, 23 May 2019 17:34:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHYYTC037056; Thu, 23 May 2019 17:34:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231734.x4NHYYTC037056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 17:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348179 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 348179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0BF5762AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:34:35 -0000 Author: manu Date: Thu May 23 17:34:33 2019 New Revision: 348179 URL: https://svnweb.freebsd.org/changeset/base/348179 Log: allwinner: aw_ccu: Add some debug printfs (disabled by default) Also print information about setting frequency at boot under bootverbose Modified: head/sys/arm/allwinner/clkng/aw_ccung.c Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Thu May 23 17:19:05 2019 (r348178) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Thu May 23 17:34:33 2019 (r348179) @@ -64,6 +64,12 @@ __FBSDID("$FreeBSD$"); #include "clkdev_if.h" #include "hwreset_if.h" +#if 0 +#define dprintf(format, arg...) device_printf(dev, "%s: " format, __func__, arg) +#else +#define dprintf(format, arg...) +#endif + static struct resource_spec aw_ccung_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { -1, 0 } @@ -78,6 +84,7 @@ aw_ccung_write_4(device_t dev, bus_addr_t addr, uint32 struct aw_ccung_softc *sc; sc = device_get_softc(dev); + dprintf("offset=%lx write %x\n", addr, val); CCU_WRITE4(sc, addr, val); return (0); } @@ -90,6 +97,7 @@ aw_ccung_read_4(device_t dev, bus_addr_t addr, uint32_ sc = device_get_softc(dev); *val = CCU_READ4(sc, addr); + dprintf("offset=%lx Read %x\n", addr, *val); return (0); } @@ -101,6 +109,7 @@ aw_ccung_modify_4(device_t dev, bus_addr_t addr, uint3 sc = device_get_softc(dev); + dprintf("offset=%lx clr: %x set: %x\n", addr, clr, set); reg = CCU_READ4(sc, addr); reg &= ~clr; reg |= set; @@ -117,6 +126,7 @@ aw_ccung_reset_assert(device_t dev, intptr_t id, bool sc = device_get_softc(dev); + dprintf("%sassert reset id %ld\n", reset ? "" : "De", id); if (id >= sc->nresets || sc->resets[id].offset == 0) return (0); @@ -224,6 +234,11 @@ aw_ccung_init_clocks(struct aw_ccung_softc *sc) } } if (sc->clk_init[i].default_freq != 0) { + if (bootverbose) + device_printf(sc->dev, + "Setting freq %ju for %s\n", + sc->clk_init[i].default_freq, + sc->clk_init[i].name); error = clknode_set_freq(clknode, sc->clk_init[i].default_freq, 0 , 0); if (error != 0) { From owner-svn-src-all@freebsd.org Thu May 23 17:35:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41DA815B07DE; Thu, 23 May 2019 17:35:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDC00764E2; Thu, 23 May 2019 17:35:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FF2F85E1; Thu, 23 May 2019 17:35:41 +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 x4NHZfxZ037293; Thu, 23 May 2019 17:35:41 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHZedG037286; Thu, 23 May 2019 17:35:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231735.x4NHZedG037286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 17:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348180 - in head/sys: arm/allwinner arm/allwinner/clkng conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/allwinner/clkng conf X-SVN-Commit-Revision: 348180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDC00764E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:35:42 -0000 Author: manu Date: Thu May 23 17:35:40 2019 New Revision: 348180 URL: https://svnweb.freebsd.org/changeset/base/348180 Log: arm: allwinner: clk: Add new clock aw_clk_frac Add a clock driver for clock that can either be used in integer mode with one N factor and one M divider or in fractional mode where the output frequency is chosen between two predifined output. Added: head/sys/arm/allwinner/clkng/aw_clk_frac.c (contents, props changed) head/sys/arm/allwinner/clkng/aw_clk_frac.h (contents, props changed) Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/files.allwinner head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Thu May 23 17:34:33 2019 (r348179) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Thu May 23 17:35:40 2019 (r348180) @@ -305,6 +305,9 @@ aw_ccung_attach(device_t dev) aw_clk_prediv_mux_register(sc->clkdom, sc->clks[i].clk.prediv_mux); break; + case AW_CLK_FRAC: + aw_clk_frac_register(sc->clkdom, sc->clks[i].clk.frac); + break; } } Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Thu May 23 17:34:33 2019 (r348179) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Thu May 23 17:35:40 2019 (r348180) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ enum aw_ccung_clk_type { AW_CLK_NKMP, AW_CLK_NM, AW_CLK_PREDIV_MUX, + AW_CLK_FRAC, }; struct aw_ccung_clk { @@ -57,6 +59,7 @@ struct aw_ccung_clk { struct aw_clk_nkmp_def *nkmp; struct aw_clk_nm_def *nm; struct aw_clk_prediv_mux_def *prediv_mux; + struct aw_clk_frac_def *frac; } clk; }; Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Thu May 23 17:34:33 2019 (r348179) +++ head/sys/arm/allwinner/clkng/aw_clk.h Thu May 23 17:35:40 2019 (r348180) @@ -309,6 +309,38 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .flags = _flags | AW_CLK_HAS_UPDATE, \ } +#define FRAC_CLK(_clkname, _id, _name, _pnames, \ + _offset, \ + _nshift, _nwidth, _nvalue, _nflags, \ + _mshift, _mwidth, _mvalue, _mflags, \ + _gate_shift, _lock_shift,_lock_retries, \ + _flags, _freq0, _freq1, _mode_sel, _freq_sel) \ + static struct aw_clk_frac_def _clkname = { \ + .clkdef = { \ + .id = _id, \ + .name = _name, \ + .parent_names = _pnames, \ + .parent_cnt = nitems(_pnames), \ + }, \ + .offset = _offset, \ + .n.shift = _nshift, \ + .n.width = _nwidth, \ + .n.value = _nvalue, \ + .n.flags = _nflags, \ + .m.shift = _mshift, \ + .m.width = _mwidth, \ + .m.value = _mvalue, \ + .m.flags = _mflags, \ + .gate_shift = _gate_shift, \ + .lock_shift = _lock_shift, \ + .lock_retries = _lock_retries, \ + .flags = _flags | AW_CLK_HAS_FRAC, \ + .frac.freq0 = _freq0, \ + .frac.freq1 = _freq1, \ + .frac.mode_sel = _mode_sel, \ + .frac.freq_sel = _freq_sel, \ + } + #define NM_CLK(_clkname, _id, _name, _pnames, \ _offset, \ _nshift, _nwidth, _nvalue, _nflags, \ Added: head/sys/arm/allwinner/clkng/aw_clk_frac.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_frac.c Thu May 23 17:35:40 2019 (r348180) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +#include "clkdev_if.h" + +/* + * clknode for clocks matching the formula : + * + * clk = (24Mhz * n) / m in integer mode + * clk = frac_out1 or frac_out2 in fractional mode + * + */ + +struct aw_clk_frac_sc { + uint32_t offset; + + struct aw_clk_factor m; + struct aw_clk_factor n; + struct aw_clk_frac frac; + + uint32_t mux_shift; + uint32_t mux_mask; + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int +aw_clk_frac_init(struct clknode *clk, device_t dev) +{ + struct aw_clk_frac_sc *sc; + uint32_t val, idx; + + sc = clknode_get_softc(clk); + + idx = 0; + if ((sc->flags & AW_CLK_HAS_MUX) != 0) { + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + idx = (val & sc->mux_mask) >> sc->mux_shift; + } + + clknode_init_parent_idx(clk, idx); + return (0); +} + +static int +aw_clk_frac_set_gate(struct clknode *clk, bool enable) +{ + struct aw_clk_frac_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_GATE) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + if (enable) + val |= (1 << sc->gate_shift); + else + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +aw_clk_frac_set_mux(struct clknode *clk, int index) +{ + struct aw_clk_frac_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_MUX) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + val &= ~sc->mux_mask; + val |= index << sc->mux_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static uint64_t +aw_clk_frac_find_best(struct aw_clk_frac_sc *sc, uint64_t fparent, uint64_t *fout, + uint32_t *factor_n, uint32_t *factor_m) +{ + uint64_t cur, best; + uint32_t m, n, max_m, max_n, min_m, min_n; + + *factor_n = *factor_m = 0; + best = cur = 0; + + max_m = aw_clk_factor_get_max(&sc->m); + max_n = aw_clk_factor_get_max(&sc->n); + min_m = aw_clk_factor_get_min(&sc->m); + min_n = aw_clk_factor_get_min(&sc->n); + + for (n = min_n; n <= max_n; n++) { + for (m = min_m; m <= max_m; m++) { + cur = fparent * n / m; + if ((*fout - cur) < (*fout - best)) { + best = cur; + *factor_n = n; + *factor_m = m; + } + if (best == *fout) + return (best); + } + } + + return (best); +} + +static int +aw_clk_frac_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct aw_clk_frac_sc *sc; + uint64_t cur, best, best_frac; + uint32_t val, m, n, best_m, best_n; + int retry; + + sc = clknode_get_softc(clk); + + best = best_frac = cur = 0; + + if (*fout == sc->frac.freq0) + best = best_frac = sc->frac.freq0; + else if (*fout == sc->frac.freq1) + best = best_frac = sc->frac.freq1; + else + best = aw_clk_frac_find_best(sc, fparent, fout, + &best_n, &best_m); + + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + if ((best < *fout) && + ((flags & CLK_SET_ROUND_DOWN) == 0)) { + *stop = 1; + return (ERANGE); + } + if ((best > *fout) && + ((flags & CLK_SET_ROUND_UP) == 0)) { + *stop = 1; + return (ERANGE); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + /* Disable clock during freq changes */ + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + + if (best_frac != 0) { + val &= ~sc->frac.mode_sel; + /* M should be 0 per the manual */ + val &= ~sc->m.mask; + if (best_frac == sc->frac.freq0) + val &= ~sc->frac.freq_sel; + else + val |= sc->frac.freq_sel; + } else { + val |= sc->frac.mode_sel; /* Select integer mode */ + n = aw_clk_factor_get_value(&sc->n, best_n); + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->n.mask; + val &= ~sc->m.mask; + val |= n << sc->n.shift; + val |= m << sc->m.shift; + } + + /* Write the clock changes */ + WRITE4(clk, sc->offset, val); + + /* Enable clock now that we've change it */ + val |= 1 << sc->gate_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + for (retry = 0; retry < sc->lock_retries; retry++) { + READ4(clk, sc->offset, &val); + if ((val & (1 << sc->lock_shift)) != 0) + break; + DELAY(1000); + } + + *fout = best; + *stop = 1; + + return (0); +} + +static int +aw_clk_frac_recalc(struct clknode *clk, uint64_t *freq) +{ + struct aw_clk_frac_sc *sc; + uint32_t val, m, n; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + if ((val & sc->frac.mode_sel) == 0) { + if (val & sc->frac.freq_sel) + *freq = sc->frac.freq1; + else + *freq = sc->frac.freq0; + } else { + m = aw_clk_get_factor(val, &sc->m); + n = aw_clk_get_factor(val, &sc->n); + + *freq = *freq * n / m; + } + + return (0); +} + +static clknode_method_t aw_frac_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_clk_frac_init), + CLKNODEMETHOD(clknode_set_gate, aw_clk_frac_set_gate), + CLKNODEMETHOD(clknode_set_mux, aw_clk_frac_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, aw_clk_frac_recalc), + CLKNODEMETHOD(clknode_set_freq, aw_clk_frac_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(aw_frac_clknode, aw_frac_clknode_class, aw_frac_clknode_methods, + sizeof(struct aw_clk_frac_sc), clknode_class); + +int +aw_clk_frac_register(struct clkdom *clkdom, struct aw_clk_frac_def *clkdef) +{ + struct clknode *clk; + struct aw_clk_frac_sc *sc; + + clk = clknode_create(clkdom, &aw_frac_clknode_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->offset = clkdef->offset; + + sc->m.shift = clkdef->m.shift; + sc->m.width = clkdef->m.width; + sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; + sc->m.value = clkdef->m.value; + sc->m.flags = clkdef->m.flags; + + sc->n.shift = clkdef->n.shift; + sc->n.width = clkdef->n.width; + sc->n.mask = ((1 << sc->n.width) - 1) << sc->n.shift; + sc->n.value = clkdef->n.value; + sc->n.flags = clkdef->n.flags; + + sc->frac.freq0 = clkdef->frac.freq0; + sc->frac.freq1 = clkdef->frac.freq1; + sc->frac.mode_sel = 1 << clkdef->frac.mode_sel; + sc->frac.freq_sel = 1 << clkdef->frac.freq_sel; + + sc->mux_shift = clkdef->mux_shift; + sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; + + sc->gate_shift = clkdef->gate_shift; + + sc->lock_shift = clkdef->lock_shift; + sc->lock_retries = clkdef->lock_retries; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} Added: head/sys/arm/allwinner/clkng/aw_clk_frac.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_frac.h Thu May 23 17:35:40 2019 (r348180) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __AW_CLK_FRAC_H__ +#define __AW_CLK_FRAC_H__ + +#include + +struct aw_clk_frac_def { + struct clknode_init_def clkdef; + uint32_t offset; + + struct aw_clk_factor m; + struct aw_clk_factor n; + struct aw_clk_frac frac; + + uint32_t mux_shift; + uint32_t mux_width; + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +int aw_clk_frac_register(struct clkdom *clkdom, struct aw_clk_frac_def *clkdef); + +#endif /* __AW_CLK_FRAC_H__ */ Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu May 23 17:34:33 2019 (r348179) +++ head/sys/arm/allwinner/files.allwinner Thu May 23 17:35:40 2019 (r348180) @@ -36,6 +36,7 @@ arm/allwinner/aw_ccu.c standard arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard +arm/allwinner/clkng/aw_clk_frac.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard arm/allwinner/clkng/aw_clk_nm.c standard arm/allwinner/clkng/aw_clk_prediv_mux.c standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu May 23 17:34:33 2019 (r348179) +++ head/sys/conf/files.arm64 Thu May 23 17:35:40 2019 (r348180) @@ -49,6 +49,7 @@ arm/allwinner/if_awg.c optional awg ext_resources sys # Allwinner clock driver arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt From owner-svn-src-all@freebsd.org Thu May 23 17:36:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8F7C15B0833; Thu, 23 May 2019 17:36:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7992A765FE; Thu, 23 May 2019 17:36:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55CE385E2; Thu, 23 May 2019 17:36:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NHaKUY037365; Thu, 23 May 2019 17:36:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHaJLK037362; Thu, 23 May 2019 17:36:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231736.x4NHaJLK037362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 17:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348181 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 348181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7992A765FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:36:21 -0000 Author: manu Date: Thu May 23 17:36:19 2019 New Revision: 348181 URL: https://svnweb.freebsd.org/changeset/base/348181 Log: arm: allwinner: clk: Use the new frac clock Some clocks used the NM type but this clock is for the ones with the formula "clk = clkin / n / m" and not "clk = clkin * n / m" Use the new frac clock for them. Modified: head/sys/arm/allwinner/clkng/ccu_a10.c head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_h3.c Modified: head/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a10.c Thu May 23 17:35:40 2019 (r348180) +++ head/sys/arm/allwinner/clkng/ccu_a10.c Thu May 23 17:36:19 2019 (r348181) @@ -212,7 +212,7 @@ NKMP_CLK(pll_core_clk, 0, 0, /* lock */ AW_CLK_HAS_GATE); /* flags */ -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_parents, /* name, parents */ 0x10, /* offset */ @@ -231,7 +231,7 @@ FIXED_CLK(pll_video0_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_parents, /* name, parents */ 0x30, /* offset */ @@ -537,8 +537,8 @@ static struct aw_ccung_clk a10_ccu_clks[] = { { .type = AW_CLK_NM, .clk.nm = &ahb_clk}, { .type = AW_CLK_NM, .clk.nm = &apb0_clk}, { .type = AW_CLK_NM, .clk.nm = &apb1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &ms_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Thu May 23 17:35:40 2019 (r348180) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Thu May 23 17:36:19 2019 (r348181) @@ -293,7 +293,7 @@ FIXED_CLK(pll_audio_8x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_parents, /* name, parents */ 0x10, /* offset */ @@ -314,7 +314,7 @@ FIXED_CLK(pll_video0_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_parents, /* name, parents */ 0x18, /* offset */ @@ -360,7 +360,7 @@ FIXED_CLK(pll_periph_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_parents, /* name, parents */ 0x30, /* offset */ @@ -381,7 +381,7 @@ FIXED_CLK(pll_video1_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_parents, /* name, parents */ 0x38, /* offset */ @@ -405,7 +405,7 @@ NKMP_CLK(pll_mipi_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -NM_CLK_WITH_FRAC(pll9_clk, +FRAC_CLK(pll9_clk, CLK_PLL9, /* id */ "pll9", pll_parents, /* name, parents */ 0x44, /* offset */ @@ -416,7 +416,7 @@ NM_CLK_WITH_FRAC(pll9_clk, 270000000, 297000000, /* freq0, freq1 */ 24, 25); /* mode sel, freq sel */ -NM_CLK_WITH_FRAC(pll10_clk, +FRAC_CLK(pll10_clk, CLK_PLL10, /* id */ "pll10", pll_parents, /* name, parents */ 0x48, /* offset */ @@ -869,12 +869,12 @@ static struct aw_ccung_clk a31_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_mipi_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll9_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll10_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll9_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll10_clk}, { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand0_clk}, { .type = AW_CLK_NM, .clk.nm = &nand1_clk}, Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Thu May 23 17:35:40 2019 (r348180) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Thu May 23 17:36:19 2019 (r348181) @@ -279,7 +279,7 @@ FIXED_CLK(pll_audio_8x_clk, 0); /* flags */ static const char *pll_video0_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_video0_parents, /* name, parents */ 0x10, /* offset */ @@ -300,7 +300,7 @@ FIXED_CLK(pll_video0_2x_clk, 0); /* flags */ static const char *pll_ve_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ @@ -370,7 +370,7 @@ FIXED_CLK(pll_periph1_clk, 0); /* flags */ static const char *pll_video1_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_video1_parents, /* name, parents */ 0x30, /* offset */ @@ -382,7 +382,7 @@ NM_CLK_WITH_FRAC(pll_video1_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_gpu_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ @@ -396,7 +396,7 @@ NM_CLK_WITH_FRAC(pll_gpu_clk, /* PLL MIPI is missing */ static const char *pll_hsic_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_hsic_clk, +FRAC_CLK(pll_hsic_clk, CLK_PLL_HSIC, /* id */ "pll_hsic", pll_hsic_parents, /* name, parents */ 0x44, /* offset */ @@ -408,7 +408,7 @@ NM_CLK_WITH_FRAC(pll_hsic_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_de_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_de_clk, +FRAC_CLK(pll_de_clk, CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ @@ -723,16 +723,18 @@ NM_CLK(gpu_clk, static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_cpux_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_audio_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr0_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph0_2x_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_2x_clk}, - { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + /* PLL_MIPI */ + { .type = AW_CLK_FRAC, .clk.frac = &pll_hsic_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_de_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_de_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_hsic_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Thu May 23 17:35:40 2019 (r348180) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Thu May 23 17:36:19 2019 (r348181) @@ -297,7 +297,7 @@ FIXED_CLK(pll_audio_8x_clk, 0); /* flags */ static const char *pll_video_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video_clk, +FRAC_CLK(pll_video_clk, CLK_PLL_VIDEO, /* id */ "pll_video", pll_video_parents, /* name, parents */ 0x10, /* offset */ @@ -309,7 +309,7 @@ NM_CLK_WITH_FRAC(pll_video_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_ve_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ @@ -357,7 +357,7 @@ FIXED_CLK(pll_periph0_2x_clk, 0); /* flags */ static const char *pll_gpu_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ @@ -382,7 +382,7 @@ NKMP_CLK(pll_periph1_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ static const char *pll_de_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_de_clk, +FRAC_CLK(pll_de_clk, CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ @@ -684,10 +684,10 @@ static struct aw_ccung_clk h3_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph0_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_de_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_de_clk}, { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, From owner-svn-src-all@freebsd.org Thu May 23 17:36:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 573B115B08B1; Thu, 23 May 2019 17:36:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F304676774; Thu, 23 May 2019 17:36:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6A8B85E3; Thu, 23 May 2019 17:36:56 +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 x4NHaujo037439; Thu, 23 May 2019 17:36:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NHaufm037436; Thu, 23 May 2019 17:36:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231736.x4NHaufm037436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 17:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348182 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 348182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F304676774 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:36:57 -0000 Author: manu Date: Thu May 23 17:36:55 2019 New Revision: 348182 URL: https://svnweb.freebsd.org/changeset/base/348182 Log: arm: allwinner: Remove frac mode from NM clk We have a correct clock type aw_clk_frac now for this. Modified: head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/aw_clk_nm.c head/sys/arm/allwinner/clkng/aw_clk_nm.h Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Thu May 23 17:36:19 2019 (r348181) +++ head/sys/arm/allwinner/clkng/aw_clk.h Thu May 23 17:36:55 2019 (r348182) @@ -64,7 +64,6 @@ struct aw_clk_init { #define AW_CLK_HAS_MUX 0x0004 #define AW_CLK_REPARENT 0x0008 #define AW_CLK_SCALE_CHANGE 0x0010 -#define AW_CLK_HAS_FRAC 0x0020 #define AW_CLK_HAS_UPDATE 0x0040 #define AW_CLK_HAS_PREDIV 0x0080 @@ -334,7 +333,7 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .gate_shift = _gate_shift, \ .lock_shift = _lock_shift, \ .lock_retries = _lock_retries, \ - .flags = _flags | AW_CLK_HAS_FRAC, \ + .flags = _flags, \ .frac.freq0 = _freq0, \ .frac.freq1 = _freq1, \ .frac.mode_sel = _mode_sel, \ @@ -368,38 +367,6 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .mux_width = _mux_width, \ .gate_shift = _gate_shift, \ .flags = _flags, \ - } - -#define NM_CLK_WITH_FRAC(_clkname, _id, _name, _pnames, \ - _offset, \ - _nshift, _nwidth, _nvalue, _nflags, \ - _mshift, _mwidth, _mvalue, _mflags, \ - _gate_shift, _lock_shift,_lock_retries, \ - _flags, _freq0, _freq1, _mode_sel, _freq_sel) \ - static struct aw_clk_nm_def _clkname = { \ - .clkdef = { \ - .id = _id, \ - .name = _name, \ - .parent_names = _pnames, \ - .parent_cnt = nitems(_pnames), \ - }, \ - .offset = _offset, \ - .n.shift = _nshift, \ - .n.width = _nwidth, \ - .n.value = _nvalue, \ - .n.flags = _nflags, \ - .m.shift = _mshift, \ - .m.width = _mwidth, \ - .m.value = _mvalue, \ - .m.flags = _mflags, \ - .gate_shift = _gate_shift, \ - .lock_shift = _lock_shift, \ - .lock_retries = _lock_retries, \ - .flags = _flags | AW_CLK_HAS_FRAC, \ - .frac.freq0 = _freq0, \ - .frac.freq1 = _freq1, \ - .frac.mode_sel = _mode_sel, \ - .frac.freq_sel = _freq_sel, \ } #define PREDIV_CLK(_clkname, _id, _name, _pnames, \ Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Thu May 23 17:36:19 2019 (r348181) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Thu May 23 17:36:55 2019 (r348182) @@ -53,7 +53,6 @@ struct aw_clk_nm_sc { struct aw_clk_factor m; struct aw_clk_factor n; struct aw_clk_factor prediv; - struct aw_clk_frac frac; uint32_t mux_shift; uint32_t mux_mask; @@ -182,13 +181,13 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare struct aw_clk_nm_sc *sc; struct clknode *p_clk; const char **p_names; - uint64_t cur, best, best_frac; + uint64_t cur, best; uint32_t val, m, n, best_m, best_n; int p_idx, best_parent, retry; sc = clknode_get_softc(clk); - best = best_frac = cur = 0; + best = cur = 0; best_parent = 0; if ((sc->flags & AW_CLK_REPARENT) != 0) { @@ -210,13 +209,8 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare p_clk = clknode_get_parent(clk); clknode_get_freq(p_clk, &fparent); } else { - if (sc->flags & AW_CLK_HAS_FRAC && - (*fout == sc->frac.freq0 || *fout == sc->frac.freq1)) - best = best_frac = *fout; - - if (best == 0) - best = aw_clk_nm_find_best(sc, fparent, fout, - &best_n, &best_m); + best = aw_clk_nm_find_best(sc, fparent, fout, + &best_n, &best_m); } if ((flags & CLK_SET_DRYRUN) != 0) { @@ -242,20 +236,12 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); - if (best_frac != 0) { - val &= ~sc->frac.mode_sel; - if (best_frac == sc->frac.freq0) - val &= ~sc->frac.freq_sel; - else - val |= sc->frac.freq_sel; - } else { - n = aw_clk_factor_get_value(&sc->n, best_n); - m = aw_clk_factor_get_value(&sc->m, best_m); - val &= ~sc->n.mask; - val &= ~sc->m.mask; - val |= n << sc->n.shift; - val |= m << sc->m.shift; - } + n = aw_clk_factor_get_value(&sc->n, best_n); + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->n.mask; + val &= ~sc->m.mask; + val |= n << sc->n.shift; + val |= m << sc->m.shift; WRITE4(clk, sc->offset, val); DEVICE_UNLOCK(clk); @@ -287,25 +273,14 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq) READ4(clk, sc->offset, &val); DEVICE_UNLOCK(clk); - if (sc->flags & AW_CLK_HAS_FRAC && ((val & sc->frac.mode_sel) == 0)) { - if (val & sc->frac.freq_sel) - *freq = sc->frac.freq1; - else - *freq = sc->frac.freq0; - } else { - m = aw_clk_get_factor(val, &sc->m); - n = aw_clk_get_factor(val, &sc->n); - if (sc->flags & AW_CLK_HAS_PREDIV) - prediv = aw_clk_get_factor(val, &sc->prediv); - else - prediv = 1; + m = aw_clk_get_factor(val, &sc->m); + n = aw_clk_get_factor(val, &sc->n); + if (sc->flags & AW_CLK_HAS_PREDIV) + prediv = aw_clk_get_factor(val, &sc->prediv); + else + prediv = 1; - /* For FRAC NM the formula is freq_parent * n / m */ - if (sc->flags & AW_CLK_HAS_FRAC) - *freq = *freq * n / m; - else - *freq = *freq / prediv / n / m; - } + *freq = *freq / prediv / n / m; return (0); } @@ -360,11 +335,6 @@ aw_clk_nm_register(struct clkdom *clkdom, struct aw_cl else sc->prediv.cond_mask = clkdef->prediv.cond_mask; sc->prediv.cond_value = clkdef->prediv.cond_value; - - sc->frac.freq0 = clkdef->frac.freq0; - sc->frac.freq1 = clkdef->frac.freq1; - sc->frac.mode_sel = 1 << clkdef->frac.mode_sel; - sc->frac.freq_sel = 1 << clkdef->frac.freq_sel; sc->mux_shift = clkdef->mux_shift; sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.h Thu May 23 17:36:19 2019 (r348181) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.h Thu May 23 17:36:55 2019 (r348182) @@ -38,7 +38,6 @@ struct aw_clk_nm_def { struct aw_clk_factor m; struct aw_clk_factor n; struct aw_clk_factor prediv; - struct aw_clk_frac frac; uint32_t mux_shift; uint32_t mux_width; From owner-svn-src-all@freebsd.org Thu May 23 17:46:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B824C15B0BF2; Thu, 23 May 2019 17:46:29 +0000 (UTC) (envelope-from kp@krion.cc) Received: from krion.cc (krion.cc [148.251.235.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53D7976F5C; Thu, 23 May 2019 17:46:29 +0000 (UTC) (envelope-from kp@krion.cc) Date: Thu, 23 May 2019 19:46:21 +0200 From: Kirill Ponomarev To: Brad Davis Cc: svn-src-head , svn-src-all , src-committers , Conrad Meyer Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen Message-ID: <20190523174621.GE5335@krion.cc> References: <201905160109.x4G19DhY080690@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dFWYt1i2NyOo1oI9" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 53D7976F5C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:46:29 -0000 --dFWYt1i2NyOo1oI9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05/22, Conrad Meyer wrote: > Hi Brad, >=20 > Ping. It's still broken. Can you revert this please? Please, revert these changes, it's still broken here as well. --dFWYt1i2NyOo1oI9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJCHRFhEAQujKni1pDyI9/LMCykUFAlzm3G0ACgkQDyI9/LMC ykUDRwf+M/BsGugGoZw534OHX64bh/AZ3Wel/c4Jn7otoU4QtBKZ8uJvQ9ZV8QaC qf+fKUOQ8rBanQAL0na5K6LkJEQH3u7SsMYJf9X48uXlAtrh51wNrKRPCUkE131y luuaYyCFlBOcndM+Kh7e/42fq4rtZ7cmw6MzOJ0E1fF6L7knf2/QyyJNbKrxauMr xXDIMAHL8P8N5MGoAXH3psisMYjiCZHjVP6Z+8Qkj0dcr/y0cQqc6uz7H38y14s1 VBjK1iJx+Kfm0iVYlKNb+dSNi1gcs74I7TUKOFAFfixpf1jmB/AeAZtdud5/uZWH m8dOpoe6AepgxScJPFLT0Jijpgi+wQ== =SgO7 -----END PGP SIGNATURE----- --dFWYt1i2NyOo1oI9-- From owner-svn-src-all@freebsd.org Thu May 23 17:50:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EA0415B0DF8; Thu, 23 May 2019 17:50:59 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0AEC7727C; Thu, 23 May 2019 17:50:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 2BFB13C0182; Thu, 23 May 2019 17:50:52 +0000 (UTC) Date: Thu, 23 May 2019 17:50:52 +0000 From: Brooks Davis To: Kirill Ponomarev Cc: Brad Davis , svn-src-head , svn-src-all , src-committers , Conrad Meyer Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen Message-ID: <20190523175052.GA79329@spindle.one-eyed-alien.net> References: <201905160109.x4G19DhY080690@repo.freebsd.org> <20190523174621.GE5335@krion.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <20190523174621.GE5335@krion.cc> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: F0AEC7727C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.75 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; NEURAL_HAM_SHORT(-0.77)[-0.765,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 17:50:59 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2019 at 07:46:21PM +0200, Kirill Ponomarev wrote: > On 05/22, Conrad Meyer wrote: > > Hi Brad, > >=20 > > Ping. It's still broken. Can you revert this please? >=20 > Please, revert these changes, it's still broken here as well. In addition the in-tree breakage for updates, the broke external update systems and image building systems. I don't care what mechanism is used (.PATH, ${SRCTOP}, something to tag the files in the src/etc Makefile), but moving these files is unacceptable and should be reverted. -- Brooks --jI8keyz6grp/JLjh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJc5t17AAoJEKzQXbSebgfAifwIAJjsUcjoBXLzP2mSMBeBGV6X 6ZPZKLkcSdgNQL+EG2GY4DuTYDwfmdW1qP+souRuVfXrRs/8ecHwXvLxqoFC8dNV puKV9889mUy34PBJUsjNjjV/6XtMt9dzW2zUEW/Au3uZ9xKdIqo9EjBL542og8hQ CB1igTd6ApPDVPaZGmZd9pmLLF5ENpsjev6l586Me4eUERKpp2gbZMWrMS9OOUgK 7iR+bFOwLc0K52MjuK7jCYLMZrFA9hk+J3FQCxlrVXNBaa0is3fhD/XhTOVS3WTb wmNTnjHUr3X4ne4lHJDJa1mEInmo2mOGAymbVbx1a2NF9MgEhELj2N1elZju6zE= =4S/r -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh-- From owner-svn-src-all@freebsd.org Thu May 23 18:06:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B48B15B150B; Thu, 23 May 2019 18:06:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 DCB8277E6E; Thu, 23 May 2019 18:06:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4NI6XqW091593; Thu, 23 May 2019 11:06:33 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4NI6Xq0091592; Thu, 23 May 2019 11:06:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905231806.x4NI6Xq0091592@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen In-Reply-To: <20190523175052.GA79329@spindle.one-eyed-alien.net> To: Brooks Davis Date: Thu, 23 May 2019 11:06:33 -0700 (PDT) CC: Kirill Ponomarev , Brad Davis , svn-src-head , svn-src-all , src-committers , Conrad Meyer 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-Rspamd-Queue-Id: DCB8277E6E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.907,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:06:36 -0000 -- Start of PGP signed section. > On Thu, May 23, 2019 at 07:46:21PM +0200, Kirill Ponomarev wrote: > > On 05/22, Conrad Meyer wrote: > > > Hi Brad, > > > > > > Ping. It's still broken. Can you revert this please? > > > > Please, revert these changes, it's still broken here as well. > > In addition the in-tree breakage for updates, the broke external update > systems and image building systems. I don't care what mechanism is > used (.PATH, ${SRCTOP}, something to tag the files in the src/etc > Makefile), but moving these files is unacceptable and should be > reverted. I may have another, temporary solution/sugestion. First revert this, then add a comment that while the pkgbase work is sorted out that these files live in 2 places and you must commit 2 both if you have to touch one of them. Then svn cp the files to the new location. Everyone happy with that temporary, hackash, work around so that both groups can move forward while all the sharp pointy sticks are cleaned up? Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 23 18:07:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 797D615B15EB; Thu, 23 May 2019 18:07:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA1680022; Thu, 23 May 2019 18:07:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id D59EA1E7F8; Thu, 23 May 2019 18:07:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 6B767957AB; Thu, 23 May 2019 20:07:36 +0200 (CEST) Date: Thu, 23 May 2019 20:07:36 +0200 From: Baptiste Daroussin To: Brooks Davis Cc: Kirill Ponomarev , svn-src-head , svn-src-all , src-committers , Brad Davis , Conrad Meyer Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen Message-ID: <20190523180735.xrsjwhls3gaiqyk5@ivaldir.net> References: <201905160109.x4G19DhY080690@repo.freebsd.org> <20190523174621.GE5335@krion.cc> <20190523175052.GA79329@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ngugdkyogeqgs5vh" Content-Disposition: inline In-Reply-To: <20190523175052.GA79329@spindle.one-eyed-alien.net> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 1DA1680022 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:07:38 -0000 --ngugdkyogeqgs5vh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2019 at 05:50:52PM +0000, Brooks Davis wrote: > On Thu, May 23, 2019 at 07:46:21PM +0200, Kirill Ponomarev wrote: > > On 05/22, Conrad Meyer wrote: > > > Hi Brad, > > >=20 > > > Ping. It's still broken. Can you revert this please? > >=20 > > Please, revert these changes, it's still broken here as well. >=20 > In addition the in-tree breakage for updates, the broke external update > systems and image building systems. I don't care what mechanism is > used (.PATH, ${SRCTOP}, something to tag the files in the src/etc > Makefile), but moving these files is unacceptable and should be > reverted. >=20 > -- Brooks So before everyone goes further, manu and I are working on a version that should please everyone, and allow to revert any changes to mergemaster and etcupdate. Best regards, Bapt --ngugdkyogeqgs5vh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlzm4WQACgkQY4mL3PG3 Plo8TxAAxxCu0amHj7tNt6vUzezGq30Ur7xwIiAxNQYuCVGrIpVNPOUFzP104U2b hIipLo6DaR8fPeDEOUQdJ165U6NFomPpiRPXpgJpTHgU6awDqu/msDOy4xlk1CA/ HkxqgDNuhV3vuyA6o1F2NSs9qH2+nfFz9AWxaHqZWLx+fFo0Hb9RcrfkcHJGjmNl HGu41cFGTXQWHPm+TwUpzRBl1VyBqLPNn5BgaeD+CNK/js/oj09n/R8IcZXLRp2z d04LaRL+Bh5N8hUbfhaM+vqdIc10khetFA0lzaJDGIh0d22Ym54cPIUzO0p7+RSO 6dCAFpKmS/ZbrmTUiyRruDTklcnOcwvelKoW0lHFQ3ykqvCuq8ipy5KiY7wINQJi T/yfpFVWnAPSAM9gXbOJXBp1iDGudAxkXbD74phB3aoxrOlNlxyIJEfDcH0bjDVs q0XPbfE3c7IKxfO1YNyFfQoba2xtjfGthi0FJhllwbdR1kBHQbwurw9r67oCAV3o 3zQqL4Z9UlYcA3ALTL2lNu0VnOM8c1aV3PX1RV4VbFkJAis80KH0wg41pNeDzVMJ x6pkUITzcqU5kCrYuM2Og4ig3U3EXqd6d3nQw792f4rbyDWZ5ZFe2DQgxvTRlx2v IVhysgEyHq68j9dqDhWhtSTroYW6zZ2n+cTQpb2KzgVUSPifQi0= =/JJ8 -----END PGP SIGNATURE----- --ngugdkyogeqgs5vh-- From owner-svn-src-all@freebsd.org Thu May 23 18:19:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AA3515B199A; Thu, 23 May 2019 18:19:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C005180634; Thu, 23 May 2019 18:19:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93D358CB5; Thu, 23 May 2019 18:19:57 +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 x4NIJv0b058473; Thu, 23 May 2019 18:19:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NIJvI3058472; Thu, 23 May 2019 18:19:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231819.x4NIJvI3058472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 18:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348183 - head/sys/dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 348183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C005180634 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:19:58 -0000 Author: ian Date: Thu May 23 18:19:56 2019 New Revision: 348183 URL: https://svnweb.freebsd.org/changeset/base/348183 Log: Add pnpinfo. Modified: head/sys/dev/iicbus/twsi/a10_twsi.c head/sys/dev/iicbus/twsi/mv_twsi.c Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Thu May 23 17:36:55 2019 (r348182) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Thu May 23 18:19:56 2019 (r348183) @@ -152,3 +152,4 @@ EARLY_DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driv EARLY_DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/twsi/mv_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/mv_twsi.c Thu May 23 17:36:55 2019 (r348182) +++ head/sys/dev/iicbus/twsi/mv_twsi.c Thu May 23 18:19:56 2019 (r348183) @@ -125,6 +125,7 @@ static devclass_t mv_twsi_devclass; DRIVER_MODULE(twsi, simplebus, mv_twsi_driver, mv_twsi_devclass, 0, 0); DRIVER_MODULE(iicbus, twsi, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(twsi, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); static phandle_t mv_twsi_get_node(device_t bus, device_t dev) From owner-svn-src-all@freebsd.org Thu May 23 18:24:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38FA15B1CFA; Thu, 23 May 2019 18:24:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D2580C65; Thu, 23 May 2019 18:24:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3873B8E56; Thu, 23 May 2019 18:24:29 +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 x4NIOSc9063368; Thu, 23 May 2019 18:24:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NIORuu063362; Thu, 23 May 2019 18:24:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905231824.x4NIORuu063362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 23 May 2019 18:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348184 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 348184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46D2580C65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:24:29 -0000 Author: ian Date: Thu May 23 18:24:27 2019 New Revision: 348184 URL: https://svnweb.freebsd.org/changeset/base/348184 Log: Add pnpinfo to all i2c drivers that have FDT compat data. Modified: head/sys/dev/iicbus/ds1307.c head/sys/dev/iicbus/ds13rtc.c head/sys/dev/iicbus/isl12xx.c head/sys/dev/iicbus/nxprtc.c head/sys/dev/iicbus/rtc8583.c head/sys/dev/iicbus/sy8106a.c head/sys/dev/iicbus/syr827.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/ds1307.c Thu May 23 18:24:27 2019 (r348184) @@ -435,3 +435,4 @@ static devclass_t ds1307_devclass; DRIVER_MODULE(ds1307, iicbus, ds1307_driver, ds1307_devclass, NULL, NULL); MODULE_VERSION(ds1307, 1); MODULE_DEPEND(ds1307, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(ds1307_compat_data); Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/ds13rtc.c Thu May 23 18:24:27 2019 (r348184) @@ -617,3 +617,4 @@ static devclass_t ds13rtc_devclass; DRIVER_MODULE(ds13rtc, iicbus, ds13rtc_driver, ds13rtc_devclass, NULL, NULL); MODULE_VERSION(ds13rtc, 1); MODULE_DEPEND(ds13rtc, iicbus, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/isl12xx.c ============================================================================== --- head/sys/dev/iicbus/isl12xx.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/isl12xx.c Thu May 23 18:24:27 2019 (r348184) @@ -356,3 +356,4 @@ static devclass_t isl12xx_devclass; DRIVER_MODULE(isl12xx, iicbus, isl12xx_driver, isl12xx_devclass, NULL, NULL); MODULE_VERSION(isl12xx, 1); MODULE_DEPEND(isl12xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/nxprtc.c Thu May 23 18:24:27 2019 (r348184) @@ -826,3 +826,4 @@ static devclass_t nxprtc_devclass; DRIVER_MODULE(nxprtc, iicbus, nxprtc_driver, nxprtc_devclass, NULL, NULL); MODULE_VERSION(nxprtc, 1); MODULE_DEPEND(nxprtc, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/rtc8583.c ============================================================================== --- head/sys/dev/iicbus/rtc8583.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/rtc8583.c Thu May 23 18:24:27 2019 (r348184) @@ -300,3 +300,4 @@ static devclass_t rtc8583_devclass; DRIVER_MODULE(rtc8583, iicbus, rtc8583_driver, rtc8583_devclass, NULL, NULL); MODULE_VERSION(rtc8583, 1); MODULE_DEPEND(rtc8583, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/sy8106a.c ============================================================================== --- head/sys/dev/iicbus/sy8106a.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/sy8106a.c Thu May 23 18:24:27 2019 (r348184) @@ -300,3 +300,4 @@ EARLY_DRIVER_MODULE(sy8106a, iicbus, sy8106a_driver, s BUS_PASS_RESOURCE); MODULE_VERSION(sy8106a, 1); MODULE_DEPEND(sy8106a, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(compat_data); Modified: head/sys/dev/iicbus/syr827.c ============================================================================== --- head/sys/dev/iicbus/syr827.c Thu May 23 18:19:56 2019 (r348183) +++ head/sys/dev/iicbus/syr827.c Thu May 23 18:24:27 2019 (r348184) @@ -352,3 +352,4 @@ EARLY_DRIVER_MODULE(syr827, iicbus, syr827_driver, syr BUS_PASS_RESOURCE); MODULE_VERSION(syr827, 1); MODULE_DEPEND(syr827, iicbus, 1, 1, 1); +IICBUS_FDT_PNP_INFO(compat_data); From owner-svn-src-all@freebsd.org Thu May 23 18:37:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE41C15B219E; Thu, 23 May 2019 18:37:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6C6814C3; Thu, 23 May 2019 18:37:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EC249028; Thu, 23 May 2019 18:37:07 +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 x4NIb79m069043; Thu, 23 May 2019 18:37:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NIb5Jj069036; Thu, 23 May 2019 18:37:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201905231837.x4NIb5Jj069036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 23 May 2019 18:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348185 - in head: . etc lib/libc/gen usr.sbin/etcupdate usr.sbin/mergemaster X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . etc lib/libc/gen usr.sbin/etcupdate usr.sbin/mergemaster X-SVN-Commit-Revision: 348185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F6C6814C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:37:07 -0000 Author: bapt Date: Thu May 23 18:37:05 2019 New Revision: 348185 URL: https://svnweb.freebsd.org/changeset/base/348185 Log: Move back group, master.passwd and shells to etc directory Use the .PATH mechanism instead so keep installing them from lib/libc/gen While here revert 347961 and 347893 which are no longer needed Discussed with: manu Tested by: manu ok manu@ Added: head/etc/group - copied unchanged from r348184, head/lib/libc/gen/group head/etc/master.passwd - copied unchanged from r348184, head/lib/libc/gen/master.passwd head/etc/shells - copied unchanged from r348184, head/lib/libc/gen/shells Deleted: head/lib/libc/gen/group head/lib/libc/gen/master.passwd head/lib/libc/gen/shells Modified: head/UPDATING head/lib/libc/gen/Makefile.inc head/usr.sbin/etcupdate/etcupdate.sh head/usr.sbin/mergemaster/mergemaster.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu May 23 18:24:27 2019 (r348184) +++ head/UPDATING Thu May 23 18:37:05 2019 (r348185) @@ -31,12 +31,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20190517: - For users of mergemaster, after recent changes to locations of - master.passwd and group in the source tree mergemaster needs to be - updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster - and run `make install'. - 20190513: User-wired pages now have their own counter, vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed Copied: head/etc/group (from r348184, head/lib/libc/gen/group) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/group Thu May 23 18:37:05 2019 (r348185, copy of r348184, head/lib/libc/gen/group) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +wheel:*:0:root +daemon:*:1: +kmem:*:2: +sys:*:3: +tty:*:4: +operator:*:5:root +mail:*:6: +bin:*:7: +news:*:8: +man:*:9: +games:*:13: +ftp:*:14: +staff:*:20: +sshd:*:22: +smmsp:*:25: +mailnull:*:26: +guest:*:31: +video:*:44: +bind:*:53: +unbound:*:59: +proxy:*:62: +authpf:*:63: +_pflogd:*:64: +_dhcp:*:65: +uucp:*:66: +dialer:*:68: +network:*:69: +audit:*:77: +www:*:80: +ntpd:*:123: +_ypldap:*:160: +hast:*:845: +nogroup:*:65533: +nobody:*:65534: Copied: head/etc/master.passwd (from r348184, head/lib/libc/gen/master.passwd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/master.passwd Thu May 23 18:37:05 2019 (r348185, copy of r348184, head/lib/libc/gen/master.passwd) @@ -0,0 +1,28 @@ +# $FreeBSD$ +# +root::0:0::0:0:Charlie &:/root:/bin/csh +toor:*:0:0::0:0:Bourne-again Superuser:/root: +daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin +mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin +proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin +uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin +nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Copied: head/etc/shells (from r348184, head/lib/libc/gen/shells) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/shells Thu May 23 18:37:05 2019 (r348185, copy of r348184, head/lib/libc/gen/shells) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# List of acceptable shells for chpass(1). +# Ftpd will not allow users to connect who are not using +# one of these shells. + +/bin/sh +/bin/csh +/bin/tcsh Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu May 23 18:24:27 2019 (r348184) +++ head/lib/libc/gen/Makefile.inc Thu May 23 18:37:05 2019 (r348185) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen ${SRCTOP}/etc CONFS+= group master.passwd shells CONFSMODE_master.passwd= 600 Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 18:24:27 2019 (r348184) +++ head/usr.sbin/etcupdate/etcupdate.sh Thu May 23 18:37:05 2019 (r348185) @@ -1737,9 +1737,7 @@ WARNINGS=$WORKDIR/warnings EDITOR=${EDITOR:-/usr/bin/vi} # Files that need to be updated before installworld. -PREWORLD_FILES="lib/libc/gen/master.passwd lib/libc/gen/group" -# If on an older tree, use it instead. Delete after 13.0. -[ -f ${SRCDIR}/etc/master.passwd ] && PREWORLD_FILES="etc/master.passwd etc/group" +PREWORLD_FILES="etc/master.passwd etc/group" # Handle command-specific argument processing such as complaining # about unsupported options. Since the configuration file is always Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu May 23 18:24:27 2019 (r348184) +++ head/usr.sbin/mergemaster/mergemaster.sh Thu May 23 18:37:05 2019 (r348185) @@ -669,12 +669,9 @@ case "${RERUN}" in ;; *) # Only set up files that are crucial to {build|install}world - { MM_PASSDIR="${SOURCEDIR}/lib/libc/gen" - # If on an older tree, use it instead. Delete after 13.0. - [ -f ${SOURCEDIR}/etc/master.passwd ] && MM_PASSDIR="${SOURCEDIR}/etc" - mkdir -p ${TEMPROOT}/etc && - cp -p ${MM_PASSDIR}/master.passwd ${TEMPROOT}/etc && - install -p -o root -g wheel -m 0644 ${MM_PASSDIR}/group ${TEMPROOT}/etc;} || + { mkdir -p ${TEMPROOT}/etc && + cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && + install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; From owner-svn-src-all@freebsd.org Thu May 23 18:44:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5418015B24CB; Thu, 23 May 2019 18:44:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B1B81AE7; Thu, 23 May 2019 18:44:48 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id A3CDF3C0182; Thu, 23 May 2019 18:44:47 +0000 (UTC) Date: Thu, 23 May 2019 18:44:47 +0000 From: Brooks Davis To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348185 - in head: . etc lib/libc/gen usr.sbin/etcupdate usr.sbin/mergemaster Message-ID: <20190523184447.GB79329@spindle.one-eyed-alien.net> References: <201905231837.x4NIb5Jj069036@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline In-Reply-To: <201905231837.x4NIb5Jj069036@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: C3B1B81AE7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:44:49 -0000 --ZoaI/ZTpAVc4A5k6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2019 at 06:37:05PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Thu May 23 18:37:05 2019 > New Revision: 348185 > URL: https://svnweb.freebsd.org/changeset/base/348185 >=20 > Log: > Move back group, master.passwd and shells to etc directory > =20 > Use the .PATH mechanism instead so keep installing them from lib/libc/g= en > =20 > While here revert 347961 and 347893 which are no longer needed Thanks, this should let us revert path changes in our build tools. -- Brooks --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJc5uoeAAoJEKzQXbSebgfAdqoH/jFjri20coHP9V1arnHet51p 0axk5ZukwqnP2VQ+noLUbxs+HEqwGRsLtCXbIPsduI4UWh/Kg0/b4+gqwPIoR5+x jC4y9GPBIQ91vdwMqAZYaduKFDzXVIpKHN+z8P3UsKW0/kkAfQzlJ3M+q9LPjvbv JYuTMOTuLoPbHl0NbyqAcrWYrim2IwBFBQBtit9vnemp80CW3R5cbr4zVQFKG6Nn FWRZ0m6xEedmm2SgE2qLftMNsT7PiKFidAAHb7dXXHwnBC1e0dWMhE/PMTqKiyOo 29Lom3ad+d3PBBPFsiVACoiz5pa2ULtl3nuHpYt1bk0rYaQoTnj514ILdLI0hB8= =Ahaw -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6-- From owner-svn-src-all@freebsd.org Thu May 23 18:48:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DAF15B2694; Thu, 23 May 2019 18:48:48 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B090481E51; Thu, 23 May 2019 18:48:47 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8768991D5; Thu, 23 May 2019 18:48:47 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NImlkQ074576; Thu, 23 May 2019 18:48:47 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NImljq074575; Thu, 23 May 2019 18:48:47 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905231848.x4NImljq074575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 23 May 2019 18:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348186 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 348186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B090481E51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:48:48 -0000 Author: rgrimes Date: Thu May 23 18:48:46 2019 New Revision: 348186 URL: https://svnweb.freebsd.org/changeset/base/348186 Log: MFC: r347960: bhyve virtio needs barriers Under certain tight race conditions, we found that the lack of a memory barrier in bhyve's virtio handling causes it to miss a NO_NOTIFY state transition on block devices, resulting in guest stall. The investigation is recorded in OS-7613. As part of the examination into bhyve's use of barriers, one other section was found to be problematic, but only on non-x86 ISAs with less strict memory ordering. That was addressed in this patch as well, although it was not at all a problem on x86. PR: 231117 Submitted by: Patrick Mooney Reviewed by: jhb, kib, rgrimes Approved by: jhb Differential Revision: https://reviews.freebsd.org/D19501 Modified: stable/12/usr.sbin/bhyve/virtio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/12/usr.sbin/bhyve/virtio.c Thu May 23 18:37:05 2019 (r348185) +++ stable/12/usr.sbin/bhyve/virtio.c Thu May 23 18:48:46 2019 (r348186) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Chris Torek * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -422,6 +425,12 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint vue = &vuh->vu_ring[uidx++ & mask]; vue->vu_idx = idx; vue->vu_tlen = iolen; + + /* + * Ensure the used descriptor is visible before updating the index. + * This is necessary on ISAs with memory ordering less strict than x86. + */ + atomic_thread_fence_rel(); vuh->vu_idx = uidx; } @@ -459,6 +468,13 @@ vq_endchains(struct vqueue_info *vq, int used_all_avai vs = vq->vq_vs; old_idx = vq->vq_save_used; vq->vq_save_used = new_idx = vq->vq_used->vu_idx; + + /* + * Use full memory barrier between vu_idx store from preceding + * vq_relchain() call and the loads from VQ_USED_EVENT_IDX() or + * va_flags below. + */ + atomic_thread_fence_seq_cst(); if (used_all_avail && (vs->vs_negotiated_caps & VIRTIO_F_NOTIFY_ON_EMPTY)) intr = 1; From owner-svn-src-all@freebsd.org Thu May 23 18:55:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0538615B29B0; Thu, 23 May 2019 18:55:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F75982437; Thu, 23 May 2019 18:55:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75F8F9388; Thu, 23 May 2019 18:55:48 +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 x4NItmIf079708; Thu, 23 May 2019 18:55:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NItmKO079707; Thu, 23 May 2019 18:55:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201905231855.x4NItmKO079707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 23 May 2019 18:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348187 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F75982437 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:55:49 -0000 Author: bapt Date: Thu May 23 18:55:48 2019 New Revision: 348187 URL: https://svnweb.freebsd.org/changeset/base/348187 Log: Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185 Reported by: lwhsu Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 23 18:48:46 2019 (r348186) +++ head/Makefile.inc1 Thu May 23 18:55:48 2019 (r348187) @@ -871,8 +871,8 @@ DB_FROM_SRC= yes .endif .if defined(DB_FROM_SRC) -INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen -MTREEFLAGS+= -N ${.CURDIR}/lib/libc/gen +INSTALLFLAGS+= -N ${.CURDIR}/etc +MTREEFLAGS+= -N ${.CURDIR}/etc .endif _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} From owner-svn-src-all@freebsd.org Thu May 23 18:58:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9D515B2A59; Thu, 23 May 2019 18:58:07 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13654825B3; Thu, 23 May 2019 18:58:07 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2395938C; Thu, 23 May 2019 18:58:06 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NIw6xc079848; Thu, 23 May 2019 18:58:06 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NIw6fQ079847; Thu, 23 May 2019 18:58:06 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905231858.x4NIw6fQ079847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 23 May 2019 18:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348188 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 348188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13654825B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 18:58:07 -0000 Author: rgrimes Date: Thu May 23 18:58:06 2019 New Revision: 348188 URL: https://svnweb.freebsd.org/changeset/base/348188 Log: MFC: r347960: bhyve virtio needs barriers Under certain tight race conditions, we found that the lack of a memory barrier in bhyve's virtio handling causes it to miss a NO_NOTIFY state transition on block devices, resulting in guest stall. The investigation is recorded in OS-7613. As part of the examination into bhyve's use of barriers, one other section was found to be problematic, but only on non-x86 ISAs with less strict memory ordering. That was addressed in this patch as well, although it was not at all a problem on x86. PR: 231117 Submitted by: Patrick Mooney Reviewed by: jhb, kib, rgrimes Approved by: re (gjb), jhb Differential Revision: https://reviews.freebsd.org/D19501 Modified: stable/11/usr.sbin/bhyve/virtio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/11/usr.sbin/bhyve/virtio.c Thu May 23 18:55:48 2019 (r348187) +++ stable/11/usr.sbin/bhyve/virtio.c Thu May 23 18:58:06 2019 (r348188) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Chris Torek * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -422,6 +425,12 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint vue = &vuh->vu_ring[uidx++ & mask]; vue->vu_idx = idx; vue->vu_tlen = iolen; + + /* + * Ensure the used descriptor is visible before updating the index. + * This is necessary on ISAs with memory ordering less strict than x86. + */ + atomic_thread_fence_rel(); vuh->vu_idx = uidx; } @@ -459,6 +468,13 @@ vq_endchains(struct vqueue_info *vq, int used_all_avai vs = vq->vq_vs; old_idx = vq->vq_save_used; vq->vq_save_used = new_idx = vq->vq_used->vu_idx; + + /* + * Use full memory barrier between vu_idx store from preceding + * vq_relchain() call and the loads from VQ_USED_EVENT_IDX() or + * va_flags below. + */ + atomic_thread_fence_seq_cst(); if (used_all_avail && (vs->vs_negotiated_caps & VIRTIO_F_NOTIFY_ON_EMPTY)) intr = 1; From owner-svn-src-all@freebsd.org Thu May 23 19:12:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D49115B324B; Thu, 23 May 2019 19:12:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C454A832A6; Thu, 23 May 2019 19:12:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10B496EF; Thu, 23 May 2019 19:12:47 +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 x4NJClu9090277; Thu, 23 May 2019 19:12:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJClgh090276; Thu, 23 May 2019 19:12:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905231912.x4NJClgh090276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 19:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348189 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C454A832A6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:12:48 -0000 Author: jhb Date: Thu May 23 19:12:47 2019 New Revision: 348189 URL: https://svnweb.freebsd.org/changeset/base/348189 Log: MFC 346419: Sync cryptographic algorithm constants with current cryptodev.h. Modified: stable/12/tests/sys/opencrypto/cryptodevh.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptodevh.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodevh.py Thu May 23 18:58:06 2019 (r348188) +++ stable/12/tests/sys/opencrypto/cryptodevh.py Thu May 23 19:12:47 2019 (r348189) @@ -197,7 +197,19 @@ CRYPTO_AES_NIST_GCM_16 = 25 CRYPTO_AES_128_NIST_GMAC = 26 CRYPTO_AES_192_NIST_GMAC = 27 CRYPTO_AES_256_NIST_GMAC = 28 -CRYPTO_ALGORITHM_MAX = 28 +CRYPTO_BLAKE2B = 29 +CRYPTO_BLAKE2S = 30 +CRYPTO_CHACHA20 = 31 +CRYPTO_SHA2_224_HMAC = 32 +CRYPTO_RIPEMD160 = 33 +CRYPTO_SHA2_224 = 34 +CRYPTO_SHA2_256 = 35 +CRYPTO_SHA2_384 = 36 +CRYPTO_SHA2_512 = 37 +CRYPTO_POLY1305 = 38 +CRYPTO_AES_CCM_CBC_MAC = 39 +CRYPTO_AES_CCM_16 = 40 +CRYPTO_ALGORITHM_MAX = 40 CRYPTO_ALG_FLAG_SUPPORTED = 0x01 CRYPTO_ALG_FLAG_RNG_ENABLE = 0x02 CRYPTO_ALG_FLAG_DSA_SHA = 0x04 From owner-svn-src-all@freebsd.org Thu May 23 19:13:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4B015B32B1; Thu, 23 May 2019 19:13:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3F5883409; Thu, 23 May 2019 19:13:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54BC96F0; Thu, 23 May 2019 19:13:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NJDcAk090378; Thu, 23 May 2019 19:13:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJDc1M090377; Thu, 23 May 2019 19:13:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905231913.x4NJDc1M090377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 19:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348190 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3F5883409 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:13:39 -0000 Author: jhb Date: Thu May 23 19:13:38 2019 New Revision: 348190 URL: https://svnweb.freebsd.org/changeset/base/348190 Log: MFC 346421: Test SHA2-224-HMAC now that OCF supports it. Modified: stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:12:47 2019 (r348189) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:13:38 2019 (r348190) @@ -279,11 +279,8 @@ def GenTestCase(cname): alg = cryptodev.CRYPTO_SHA1_HMAC blocksize = 64 elif hashlen == 28: - # Cryptodev doesn't support SHA-224 - # Slurp remaining input in section - for data in lines: - continue - continue + alg = cryptodev.CRYPTO_SHA2_224_HMAC + blocksize = 64 elif hashlen == 32: alg = cryptodev.CRYPTO_SHA2_256_HMAC blocksize = 64 From owner-svn-src-all@freebsd.org Thu May 23 19:18:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C09115B3398; Thu, 23 May 2019 19:18:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 406F4836BE; Thu, 23 May 2019 19:18:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DC1F96FA; Thu, 23 May 2019 19:18:22 +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 x4NJIMx2090629; Thu, 23 May 2019 19:18:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJILg7090628; Thu, 23 May 2019 19:18:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905231918.x4NJILg7090628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 19:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348191 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 406F4836BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:18:22 -0000 Author: jhb Date: Thu May 23 19:18:21 2019 New Revision: 348191 URL: https://svnweb.freebsd.org/changeset/base/348191 Log: MFC 346614: Skip tests with missing test vectors instead of failing. This copes more gracefully when older version of the nist-kat package are intalled that don't have newer test vectors such as CCM or plain SHA. If the nist-kat package is not installed at all, this still fails with an error. Modified: stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:13:38 2019 (r348190) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:18:21 2019 (r348191) @@ -42,7 +42,9 @@ from glob import iglob katdir = '/usr/local/share/nist-kat' def katg(base, glob): - assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'" + assert os.path.exists(katdir), "Please 'pkg install nist-kat'" + if not os.path.exists(os.path.join(katdir, base)): + raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] From owner-svn-src-all@freebsd.org Thu May 23 19:19:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C40AB15B3402; Thu, 23 May 2019 19:19:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CE6C8380B; Thu, 23 May 2019 19:19:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A41F96FB; Thu, 23 May 2019 19:19:10 +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 x4NJJAR5090723; Thu, 23 May 2019 19:19:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJJArd090722; Thu, 23 May 2019 19:19:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905231919.x4NJJArd090722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 19:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348192 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CE6C8380B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:19:11 -0000 Author: jhb Date: Thu May 23 19:19:09 2019 New Revision: 348192 URL: https://svnweb.freebsd.org/changeset/base/348192 Log: MFC 346615: Use more descriptive algorithm names in skip messages. Modified: stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:18:21 2019 (r348191) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:19:09 2019 (r348192) @@ -61,17 +61,17 @@ def GenTestCase(cname): ############### ##### AES ##### ############### - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-XTS on %s' % (cname)) def test_xts(self): for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'): self.runXTS(i, cryptodev.CRYPTO_AES_XTS) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-CBC on %s' % (cname)) def test_cbc(self): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-GCM on %s' % (cname)) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): self.runGCM(i, 'ENCRYPT') @@ -265,7 +265,7 @@ def GenTestCase(cname): #for i in iglob('SHA1*'): # self.runSHA(i) - @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) + @unittest.skipIf(cname not in shamodules, 'skipping SHA-HMAC on %s' % str(cname)) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): self.runSHA1HMAC(i) From owner-svn-src-all@freebsd.org Thu May 23 19:20:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 422FF15B34BB; Thu, 23 May 2019 19:20:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA56683AAB; Thu, 23 May 2019 19:20:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8FAD9715; Thu, 23 May 2019 19:20:37 +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 x4NJKbFn091049; Thu, 23 May 2019 19:20:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJKbNi091047; Thu, 23 May 2019 19:20:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905231920.x4NJKbNi091047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 19:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348193 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA56683AAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:20:38 -0000 Author: jhb Date: Thu May 23 19:20:37 2019 New Revision: 348193 URL: https://svnweb.freebsd.org/changeset/base/348193 Log: MFC 346616: Run the plain SHA digest tests from NIST. Pass in an explicit digest length to the Crypto constructor since it was assuming only sessions with a MAC key would have a MAC. Passing an explicit size allows us to test the full digest in HMAC tests as well. Modified: stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 19:19:09 2019 (r348192) +++ stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 19:20:37 2019 (r348193) @@ -151,8 +151,9 @@ class Crypto: return _findop(crid, '')[1] def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE): + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): self._ses = None + self._maclen = maclen ses = SessionOp2() ses.cipher = cipher ses.mac = mac @@ -168,9 +169,6 @@ class Crypto: ses.mackeylen = len(mackey) mk = array.array('B', mackey) ses.mackey = mk.buffer_info()[0] - self._maclen = 16 # parameterize? - else: - self._maclen = None if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:19:09 2019 (r348192) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 19:20:37 2019 (r348193) @@ -114,7 +114,8 @@ def GenTestCase(cname): c = Crypto(cryptodev.CRYPTO_AES_NIST_GCM_16, cipherkey, mac=self._gmacsizes[len(cipherkey)], - mackey=cipherkey, crid=crid) + mackey=cipherkey, crid=crid, + maclen=16) except EnvironmentError, e: # Can't test algorithms the driver does not support. if e.errno != errno.EOPNOTSUPP: @@ -260,11 +261,55 @@ def GenTestCase(cname): ############### @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) def test_sha(self): - # SHA not available in software - pass - #for i in iglob('SHA1*'): - # self.runSHA(i) + for i in katg('shabytetestvectors', 'SHA*Msg.rsp'): + self.runSHA(i) + def runSHA(self, fname): + # Skip SHA512_(224|256) tests + if fname.find('SHA512_') != -1: + return + + for hashlength, lines in cryptodev.KATParser(fname, + [ 'Len', 'Msg', 'MD' ]): + # E.g., hashlength will be "L=20" (bytes) + hashlen = int(hashlength.split("=")[1]) + + if hashlen == 20: + alg = cryptodev.CRYPTO_SHA1 + elif hashlen == 28: + alg = cryptodev.CRYPTO_SHA2_224 + elif hashlen == 32: + alg = cryptodev.CRYPTO_SHA2_256 + elif hashlen == 48: + alg = cryptodev.CRYPTO_SHA2_384 + elif hashlen == 64: + alg = cryptodev.CRYPTO_SHA2_512 + else: + # Skip unsupported hashes + # Slurp remaining input in section + for data in lines: + continue + continue + + for data in lines: + msg = data['Msg'].decode('hex') + msg = msg[:int(data['Len'])] + md = data['MD'].decode('hex') + + try: + c = Crypto(mac=alg, crid=crid, + maclen=hashlen) + except EnvironmentError, e: + # Can't test hashes the driver does not support. + if e.errno != errno.EOPNOTSUPP: + raise + continue + + _, r = c.encrypt(msg, iv="") + + self.assertEqual(r, md, "Actual: " + \ + repr(r.encode("hex")) + " Expected: " + repr(data) + " on " + cname) + @unittest.skipIf(cname not in shamodules, 'skipping SHA-HMAC on %s' % str(cname)) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): @@ -310,7 +355,7 @@ def GenTestCase(cname): try: c = Crypto(mac=alg, mackey=key, - crid=crid) + crid=crid, maclen=hashlen) except EnvironmentError, e: # Can't test hashes the driver does not support. if e.errno != errno.EOPNOTSUPP: @@ -319,13 +364,8 @@ def GenTestCase(cname): _, r = c.encrypt(msg, iv="") - # A limitation in cryptodev.py means we - # can only store MACs up to 16 bytes. - # That's good enough to validate the - # correct behavior, more or less. - maclen = min(tlen, 16) - self.assertEqual(r[:maclen], mac[:maclen], "Actual: " + \ - repr(r[:maclen].encode("hex")) + " Expected: " + repr(data)) + self.assertEqual(r[:tlen], mac, "Actual: " + \ + repr(r.encode("hex")) + " Expected: " + repr(data)) return GendCryptoTestCase From owner-svn-src-all@freebsd.org Thu May 23 19:26:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9B5115B36BE; Thu, 23 May 2019 19:26:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D75583FFC; Thu, 23 May 2019 19:26:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45FBF98B4; Thu, 23 May 2019 19:26:51 +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 x4NJQpLt096317; Thu, 23 May 2019 19:26:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJQodS096314; Thu, 23 May 2019 19:26:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905231926.x4NJQodS096314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 19:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348194 - in head/stand: common fdt X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/stand: common fdt X-SVN-Commit-Revision: 348194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D75583FFC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:26:52 -0000 Author: manu Date: Thu May 23 19:26:50 2019 New Revision: 348194 URL: https://svnweb.freebsd.org/changeset/base/348194 Log: loader: Add pnp functions for autoloading modules based on linker.hints This adds some new commands to loader : - pnpmatch This takes a pnpinfo string as argument and tries to find a kernel module associated with it. -v and -d option are available and are the same as in devmatch (v is verbose, d dumps the hints). - pnpload This takes a pnpinfo string as argument and tries to load a kernel module associated with it. - pnpautoload This will attempt to load every kernel module for each buses. Each buses are probed, the probe function will generate pnpinfo string and load kernel module associated with it if it exists. Only simplebus for FDT system is implemented for now. Since we need the dtb and overlays to be applied before searching the tree fdt_devmatch_next will load and apply the dtb + overlays. All the pnp parsing code comes from devmatch and is the same at 99%. Reviewed by: imp, kevans Differential Revision: https://reviews.freebsd.org/D19498 Modified: head/stand/common/module.c head/stand/fdt/fdt_loader_cmd.c head/stand/fdt/fdt_platform.h Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Thu May 23 19:20:37 2019 (r348193) +++ head/stand/common/module.c Thu May 23 19:26:50 2019 (r348194) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(LOADER_FDT_SUPPORT) +#include +#endif + #include "bootstrap.h" #define MDIR_REMOVED 0x0001 @@ -52,18 +56,18 @@ struct moduledir { STAILQ_ENTRY(moduledir) d_link; }; -static int file_load(char *, vm_offset_t, struct preloaded_file **); -static int file_load_dependencies(struct preloaded_file *); -static char * file_search(const char *, char **); -static struct kernel_module *file_findmodule(struct preloaded_file *, char *, - struct mod_depend *); -static int file_havepath(const char *); -static char *mod_searchmodule(char *, struct mod_depend *); -static void file_insert_tail(struct preloaded_file *); -static void file_remove(struct preloaded_file *); -struct file_metadata *metadata_next(struct file_metadata *, int); -static void moduledir_readhints(struct moduledir *); -static void moduledir_rebuild(void); +static int file_load(char *filename, vm_offset_t dest, struct preloaded_file **result); +static int file_load_dependencies(struct preloaded_file *base_mod); +static char * file_search(const char *name, char **extlist); +static struct kernel_module * file_findmodule(struct preloaded_file *fp, char *modname, struct mod_depend *verinfo); +static int file_havepath(const char *name); +static char *mod_searchmodule(char *name, struct mod_depend *verinfo); +static char * mod_searchmodule_pnpinfo(const char *bus, const char *pnpinfo); +static void file_insert_tail(struct preloaded_file *mp); +static void file_remove(struct preloaded_file *fp); +struct file_metadata* metadata_next(struct file_metadata *base_mp, int type); +static void moduledir_readhints(struct moduledir *mdp); +static void moduledir_rebuild(void); /* load address should be tweaked by first module loaded (kernel) */ static vm_offset_t loadaddr = 0; @@ -344,6 +348,187 @@ command_lsmod(int argc, char *argv[]) return(CMD_OK); } +COMMAND_SET(pnpmatch, "pnpmatch", "list matched modules based on pnpinfo", command_pnpmatch); + +static int pnp_all_flag = 0; +static int pnp_dump_flag = 0; +static int pnp_unbound_flag = 0; +static int pnp_verbose_flag = 0; + +static int +command_pnpmatch(int argc, char *argv[]) +{ + char *module; + int ch; + + pnp_verbose_flag = 0; + pnp_dump_flag = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "vd")) != -1) { + switch(ch) { + case 'v': + pnp_verbose_flag = 1; + break; + case 'd': + pnp_dump_flag = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return(CMD_OK); + } + } + argv += (optind - 1); + argc -= (optind - 1); + + module = mod_searchmodule_pnpinfo(argv[1], argv[2]); + if (module) + printf("Matched module: %s\n", module); + else if(argv[1]) + printf("No module matches %s\n", argv[1]); + + return (CMD_OK); +} + +COMMAND_SET(pnpload, "pnpload", "load matched modules based on pnpinfo", command_pnpload); + +static int +command_pnpload(int argc, char *argv[]) +{ + char *module; + int ch, error; + + pnp_verbose_flag = 0; + pnp_dump_flag = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "vd")) != -1) { + switch(ch) { + case 'v': + pnp_verbose_flag = 1; + break; + case 'd': + pnp_dump_flag = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return(CMD_OK); + } + } + argv += (optind - 1); + argc -= (optind - 1); + + if (argc != 2) + return (CMD_ERROR); + + module = mod_searchmodule_pnpinfo(argv[1], argv[2]); + + error = mod_load(module, NULL, 0, NULL); + if (error == EEXIST) { + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", argv[1]); + return (CMD_WARN); + } + + return (error == 0 ? CMD_OK : CMD_CRIT); +} + +#if defined(LOADER_FDT_SUPPORT) +static void +pnpautoload_simplebus(void) { + const char *pnpstring; + const char *compatstr; + char *pnpinfo = NULL; + char *module; + int tag = 0, len, pnplen; + int error; + + while (1) { + pnpstring = fdt_devmatch_next(&tag, &len); + if (pnpstring == NULL) + return; + + compatstr = pnpstring; + for (pnplen = 0; pnplen != len; compatstr = pnpstring + pnplen) { + pnplen += strlen(compatstr) + 1; + asprintf(&pnpinfo, "compat=%s", compatstr); + + module = mod_searchmodule_pnpinfo("simplebus", pnpinfo); + if (module) { + error = mod_loadkld(module, 0, NULL); + if (error) + printf("Cannot load module %s\n", module); + break; + } + } + free(pnpinfo); + free(module); + } +} +#endif + +struct pnp_bus { + const char *name; + void (*load)(void); +}; + +struct pnp_bus pnp_buses[] = { +#if defined(LOADER_FDT_SUPPORT) + {"simplebus", pnpautoload_simplebus}, +#endif +}; + +COMMAND_SET(pnpautoload, "pnpautoload", "auto load modules based on pnpinfo", command_pnpautoload); + +static int +command_pnpautoload(int argc, char *argv[]) +{ + int i; + int verbose; + int ch, error, match; + + pnp_verbose_flag = 0; + pnp_dump_flag = 0; + verbose = 0; + optind = 1; + optreset = 1; + match = 0; + while ((ch = getopt(argc, argv, "v")) != -1) { + switch(ch) { + case 'v': + verbose = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return(CMD_OK); + } + } + argv += (optind - 1); + argc -= (optind - 1); + + if (argc > 2) + return (CMD_ERROR); + + for (i = 0; i < nitems(pnp_buses); i++) { + if (argc == 2 && strcmp(argv[1], pnp_buses[i].name) != 0) { + if (verbose) + printf("Skipping bus %s\n", pnp_buses[i].name); + continue; + } + if (verbose) + printf("Autoloading modules for simplebus\n"); + pnp_buses[i].load(); + match = 1; + } + if (match == 0) + printf("Unsupported bus %s\n", argv[1]); + + return (CMD_OK); +} + /* * File level interface, functions file_* */ @@ -908,6 +1093,284 @@ bad: return result; } +static int +getint(void **ptr) +{ + int *p = *ptr; + int rv; + + p = (int *)roundup2((intptr_t)p, sizeof(int)); + rv = *p++; + *ptr = p; + return rv; +} + +static void +getstr(void **ptr, char *val) +{ + int *p = *ptr; + char *c = (char *)p; + int len = *(uint8_t *)c; + + memcpy(val, c + 1, len); + val[len] = 0; + c += len + 1; + *ptr = (void *)c; +} + +static int +pnpval_as_int(const char *val, const char *pnpinfo) +{ + int rv; + char key[256]; + char *cp; + + if (pnpinfo == NULL) + return -1; + + cp = strchr(val, ';'); + key[0] = ' '; + if (cp == NULL) + strlcpy(key + 1, val, sizeof(key) - 1); + else { + memcpy(key + 1, val, cp - val); + key[cp - val + 1] = '\0'; + } + strlcat(key, "=", sizeof(key)); + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) + rv = strtol(pnpinfo + strlen(key + 1), NULL, 0); + else { + cp = strstr(pnpinfo, key); + if (cp == NULL) + rv = -1; + else + rv = strtol(cp + strlen(key), NULL, 0); + } + return rv; +} + +static void +quoted_strcpy(char *dst, const char *src) +{ + char q = ' '; + + if (*src == '\'' || *src == '"') + q = *src++; + while (*src && *src != q) + *dst++ = *src++; // XXX backtick quoting + *dst++ = '\0'; + // XXX overflow +} + +static char * +pnpval_as_str(const char *val, const char *pnpinfo) +{ + static char retval[256]; + char key[256]; + char *cp; + + if (pnpinfo == NULL) { + *retval = '\0'; + return retval; + } + + cp = strchr(val, ';'); + key[0] = ' '; + if (cp == NULL) + strlcpy(key + 1, val, sizeof(key) - 1); + else { + memcpy(key + 1, val, cp - val); + key[cp - val + 1] = '\0'; + } + strlcat(key, "=", sizeof(key)); + if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0) + quoted_strcpy(retval, pnpinfo + strlen(key + 1)); + else { + cp = strstr(pnpinfo, key); + if (cp == NULL) + strcpy(retval, "MISSING"); + else + quoted_strcpy(retval, cp + strlen(key)); + } + return retval; +} + +static char * +devmatch_search_hints(struct moduledir *mdp, const char *bus, const char *dev, const char *pnpinfo) +{ + char val1[256], val2[256]; + int ival, len, ents, i, notme, mask, bit, v, found; + void *ptr, *walker, *hints_end; + char *lastmod = NULL, *cp, *s; + + moduledir_readhints(mdp); + found = 0; + if (mdp->d_hints == NULL) + goto bad; + walker = mdp->d_hints; + hints_end = walker + mdp->d_hintsz; + while (walker < hints_end && !found) { + len = getint(&walker); + ival = getint(&walker); + ptr = walker; + switch (ival) { + case MDT_VERSION: + getstr(&ptr, val1); + ival = getint(&ptr); + getstr(&ptr, val2); + if (pnp_dump_flag || pnp_verbose_flag) + printf("Version: if %s.%d kmod %s\n", val1, ival, val2); + break; + case MDT_MODULE: + getstr(&ptr, val1); + getstr(&ptr, val2); + if (lastmod) + free(lastmod); + lastmod = strdup(val2); + if (pnp_dump_flag || pnp_verbose_flag) + printf("module %s in %s\n", val1, val1); + break; + case MDT_PNP_INFO: + if (!pnp_dump_flag && !pnp_unbound_flag && lastmod && strcmp(lastmod, "kernel") == 0) + break; + getstr(&ptr, val1); + getstr(&ptr, val2); + ents = getint(&ptr); + if (pnp_dump_flag || pnp_verbose_flag) + printf("PNP info for bus %s format %s %d entries (%s)\n", + val1, val2, ents, lastmod); + if (strcmp(val1, "usb") == 0) { + if (pnp_verbose_flag) + printf("Treating usb as uhub -- bug in source table still?\n"); + strcpy(val1, "uhub"); + } + if (bus && strcmp(val1, bus) != 0) { + if (pnp_verbose_flag) + printf("Skipped because table for bus %s, looking for %s\n", + val1, bus); + break; + } + for (i = 0; i < ents; i++) { + if (pnp_verbose_flag) + printf("---------- Entry %d ----------\n", i); + if (pnp_dump_flag) + printf(" "); + cp = val2; + notme = 0; + mask = -1; + bit = -1; + do { + switch (*cp) { + /* All integer fields */ + case 'I': + case 'J': + case 'G': + case 'L': + case 'M': + ival = getint(&ptr); + if (pnp_dump_flag) { + printf("%#x:", ival); + break; + } + if (bit >= 0 && ((1 << bit) & mask) == 0) + break; + v = pnpval_as_int(cp + 2, pnpinfo); + if (pnp_verbose_flag) + printf("Matching %s (%c) table=%#x tomatch=%#x\n", + cp + 2, *cp, v, ival); + switch (*cp) { + case 'J': + if (ival == -1) + break; + /*FALLTHROUGH*/ + case 'I': + if (v != ival) + notme++; + break; + case 'G': + if (v < ival) + notme++; + break; + case 'L': + if (v > ival) + notme++; + break; + case 'M': + mask = ival; + break; + } + break; + /* String fields */ + case 'D': + case 'Z': + getstr(&ptr, val1); + if (pnp_dump_flag) { + printf("'%s':", val1); + break; + } + if (*cp == 'D') + break; + s = pnpval_as_str(cp + 2, pnpinfo); + if (strcmp(s, val1) != 0) + notme++; + break; + /* Key override fields, required to be last in the string */ + case 'T': + /* + * This is imperfect and only does one key and will be redone + * to be more general for multiple keys. Currently, nothing + * does that. + */ + if (pnp_dump_flag) /* No per-row data stored */ + break; + if (cp[strlen(cp) - 1] == ';') /* Skip required ; at end */ + cp[strlen(cp) - 1] = '\0'; /* in case it's not there */ + if ((s = strstr(pnpinfo, cp + 2)) == NULL) + notme++; + else if (s > pnpinfo && s[-1] != ' ') + notme++; + break; + default: + printf("Unknown field type %c\n:", *cp); + break; + } + bit++; + cp = strchr(cp, ';'); + if (cp) + cp++; + } while (cp && *cp); + if (pnp_dump_flag) + printf("\n"); + else if (!notme) { + if (!pnp_unbound_flag) { + if (pnp_verbose_flag) + printf("Matches --- %s ---\n", lastmod); + } + found++; + } + } + break; + default: + break; + } + walker = (void *)(len - sizeof(int) + (intptr_t)walker); + } + if (pnp_unbound_flag && found == 0 && *pnpinfo) { + if (pnp_verbose_flag) + printf("------------------------- "); + printf("%s on %s pnpinfo %s", *dev ? dev : "unattached", bus, pnpinfo); + if (pnp_verbose_flag) + printf(" -------------------------"); + printf("\n"); + } + if (found != 0) + return (lastmod); + free(lastmod); + +bad: + return (NULL); +} + /* * Attempt to locate the file containing the module (name) */ @@ -924,6 +1387,26 @@ mod_searchmodule(char *name, struct mod_depend *verinf result = NULL; STAILQ_FOREACH(mdp, &moduledir_list, d_link) { result = mod_search_hints(mdp, name, verinfo); + if (result) + break; + } + + return(result); +} + +static char * +mod_searchmodule_pnpinfo(const char *bus, const char *pnpinfo) +{ + struct moduledir *mdp; + char *result; + + moduledir_rebuild(); + /* + * Now we ready to lookup module in the given directories + */ + result = NULL; + STAILQ_FOREACH(mdp, &moduledir_list, d_link) { + result = devmatch_search_hints(mdp, bus, NULL, pnpinfo); if (result) break; } Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Thu May 23 19:20:37 2019 (r348193) +++ head/stand/fdt/fdt_loader_cmd.c Thu May 23 19:26:50 2019 (r348194) @@ -67,6 +67,8 @@ static struct fdt_header *fdt_to_load = NULL; static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; +/* Have we loaded all the needed overlays */ +static int fdt_overlays_applied = 0; static int fdt_load_dtb(vm_offset_t va); static void fdt_print_overlay_load_error(int err, const char *filename); @@ -439,6 +441,9 @@ fdt_apply_overlays() if ((fdtp == NULL) || (fdtp_size == 0)) return; + if (fdt_overlays_applied) + return; + max_overlay_size = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { if (max_overlay_size < fp->f_size) @@ -507,6 +512,7 @@ fdt_apply_overlays() fdtp_size = current_fdtp_size; } free(overlay); + fdt_overlays_applied = 1; } int @@ -1858,4 +1864,66 @@ fdt_cmd_nyi(int argc, char *argv[]) printf("command not yet implemented\n"); return (CMD_ERROR); +} + +const char * +fdt_devmatch_next(int *tag, int *compatlen) +{ + const struct fdt_property *p; + const struct fdt_property *status; + int o, len = -1; + static int depth = 0; + + if (fdtp == NULL) { + fdt_setup_fdtp(); + fdt_apply_overlays(); + } + + if (*tag != 0) { + o = *tag; + /* We are at the end of the DTB */ + if (o < 0) + return (NULL); + } else { + o = fdt_path_offset(fdtp, "/"); + if (o < 0) { + printf("Can't find dtb\n"); + return (NULL); + } + depth = 0; + } + + /* Find the next node with a compatible property */ + while (1) { + p = NULL; + if (o >= 0 && depth >= 0) { + /* skip disabled nodes */ + status = fdt_get_property(fdtp, o, "status", &len); + if (len > 0) { + if (strcmp(status->data, "disabled") == 0) { + o = fdt_next_node(fdtp, o, &depth); + if (o < 0) /* End of tree */ + return (NULL); + continue; + } + } + + p = fdt_get_property(fdtp, o, "compatible", &len); + } + if (p) + break; + o = fdt_next_node(fdtp, o, &depth); + if (o < 0) /* End of tree */ + return (NULL); + } + + /* Prepare next node for next call */ + o = fdt_next_node(fdtp, o, &depth); + *tag = o; + + if (len >= 0) { + *compatlen = len; + return (p->data); + } + return (NULL); } Modified: head/stand/fdt/fdt_platform.h ============================================================================== --- head/stand/fdt/fdt_platform.h Thu May 23 19:20:37 2019 (r348193) +++ head/stand/fdt/fdt_platform.h Thu May 23 19:26:50 2019 (r348194) @@ -55,4 +55,7 @@ int fdt_platform_load_dtb(void); void fdt_platform_load_overlays(void); void fdt_platform_fixups(void); +/* Devmatch/pnp function */ +const char *fdt_devmatch_next(int *tag, int *compatlen); + #endif /* FDT_PLATFORM_H */ From owner-svn-src-all@freebsd.org Thu May 23 19:55:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A6A415B4244; Thu, 23 May 2019 19:55:55 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E66D985400; Thu, 23 May 2019 19:55:54 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7A649DEC; Thu, 23 May 2019 19:55:54 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NJtsTW011790; Thu, 23 May 2019 19:55:54 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NJtrpO011784; Thu, 23 May 2019 19:55:53 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201905231955.x4NJtrpO011784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Thu, 23 May 2019 19:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348195 - in head/sys: conf dev/uart X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: in head/sys: conf dev/uart X-SVN-Commit-Revision: 348195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E66D985400 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 19:55:55 -0000 Author: cperciva Date: Thu May 23 19:55:53 2019 New Revision: 348195 URL: https://svnweb.freebsd.org/changeset/base/348195 Log: Use ACPI SPCR on x86 This takes the SPCR code currently in uart_cpu_arm64.c, moves it into a new uart_cpu_acpi.c (with some associated refactoring), and uses it from both arm64 and x86. An SPCR serial port address AccessWidth field value of 0 ("reserved") is now treated as 1 ("byte access") in order to work around a buggy SPCR table on Amazon EC2 i3.metal instances. Reviewed by: manu, Greg V MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D20357 Added: head/sys/dev/uart/uart_cpu_acpi.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/uart/uart_cpu_acpi.h head/sys/dev/uart/uart_cpu_arm64.c head/sys/dev/uart/uart_cpu_x86.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 23 19:26:50 2019 (r348194) +++ head/sys/conf/files Thu May 23 19:55:53 2019 (r348195) @@ -3164,6 +3164,7 @@ dev/uart/uart_bus_pci.c optional uart pci dev/uart/uart_bus_puc.c optional uart puc dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart +dev/uart/uart_cpu_acpi.c optional uart acpi dev/uart/uart_dbg.c optional uart gdb dev/uart/uart_dev_msm.c optional uart uart_msm fdt dev/uart/uart_dev_mvebu.c optional uart uart_mvebu Added: head/sys/dev/uart/uart_cpu_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_cpu_acpi.c Thu May 23 19:55:53 2019 (r348195) @@ -0,0 +1,167 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2019 Colin Percival + * 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 + +#include +#include +#include + +extern bus_space_tag_t uart_bus_space_io; +extern bus_space_tag_t uart_bus_space_mem; + +static struct acpi_uart_compat_data * +uart_cpu_acpi_scan(uint8_t interface_type) +{ + struct acpi_uart_compat_data **cd, *curcd; + int i; + + SET_FOREACH(cd, uart_acpi_class_and_device_set) { + curcd = *cd; + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) + return (&curcd[i]); + } + } + + SET_FOREACH(cd, uart_acpi_class_set) { + curcd = *cd; + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) + return (&curcd[i]); + } + } + + return (NULL); +} + +int +uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) +{ + vm_paddr_t spcr_physaddr; + ACPI_TABLE_SPCR *spcr; + struct acpi_uart_compat_data *cd; + struct uart_class *class; + int error = ENXIO; + + /* SPCR only tells us about consoles. */ + if (devtype != UART_DEV_CONSOLE) + return (error); + + /* Look for the SPCR table. */ + spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); + if (spcr_physaddr == 0) + return (error); + spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); + if (spcr == NULL) { + printf("Unable to map the SPCR table!\n"); + return (error); + } + + /* Search for information about this SPCR interface type. */ + cd = uart_cpu_acpi_scan(spcr->InterfaceType); + if (cd == NULL) + goto out; + class = cd->cd_class; + + /* Fill in some fixed details. */ + di->bas.chan = 0; + di->bas.rclk = 0; + di->databits = 8; + di->stopbits = 1; + di->parity = UART_PARITY_NONE; + di->ops = uart_getops(class); + + /* Fill in details from SPCR table. */ + switch (spcr->SerialPort.SpaceId) { + case 0: + di->bas.bst = uart_bus_space_mem; + break; + case 1: + di->bas.bst = uart_bus_space_io; + break; + default: + printf("UART in unrecognized address space: %d!\n", + (int)spcr->SerialPort.SpaceId); + goto out; + } + if (spcr->SerialPort.AccessWidth == 0) + di->bas.regshft = 0; + else + di->bas.regshft = spcr->SerialPort.AccessWidth - 1; + di->bas.regiowidth = spcr->SerialPort.BitWidth / 8; + switch (spcr->BaudRate) { + case 0: + /* Special value; means "keep current value unchanged". */ + di->baudrate = 0; + break; + case 3: + di->baudrate = 9600; + break; + case 4: + di->baudrate = 19200; + break; + case 6: + di->baudrate = 57600; + break; + case 7: + di->baudrate = 115200; + break; + default: + printf("SPCR has reserved BaudRate value: %d!\n", + (int)spcr->BaudRate); + goto out; + } + + /* Apply device tweaks. */ + if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == + UART_F_IGNORE_SPCR_REGSHFT) { + di->bas.regshft = cd->cd_regshft; + } + + /* Create a bus space handle. */ + error = bus_space_map(di->bas.bst, spcr->SerialPort.Address, + uart_getrange(class), 0, &di->bas.bsh); + +out: + acpi_unmap_table(spcr); + return (error); +} Modified: head/sys/dev/uart/uart_cpu_acpi.h ============================================================================== --- head/sys/dev/uart/uart_cpu_acpi.h Thu May 23 19:26:50 2019 (r348194) +++ head/sys/dev/uart/uart_cpu_acpi.h Thu May 23 19:55:53 2019 (r348195) @@ -66,4 +66,7 @@ SET_DECLARE(uart_acpi_class_set, struct acpi_uart_comp #define UART_ACPI_CLASS(data) \ DATA_SET(uart_acpi_class_set, data) +/* Try to initialize UART device from SPCR data. */ +int uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di); + #endif /* _DEV_UART_CPU_ACPI_H_ */ Modified: head/sys/dev/uart/uart_cpu_arm64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_arm64.c Thu May 23 19:26:50 2019 (r348194) +++ head/sys/dev/uart/uart_cpu_arm64.c Thu May 23 19:55:53 2019 (r348195) @@ -80,97 +80,6 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } -#ifdef DEV_ACPI -static struct acpi_uart_compat_data * -uart_cpu_acpi_scan(uint8_t interface_type) -{ - struct acpi_uart_compat_data **cd, *curcd; - int i; - - SET_FOREACH(cd, uart_acpi_class_and_device_set) { - curcd = *cd; - for (i = 0; curcd[i].cd_hid != NULL; i++) { - if (curcd[i].cd_port_subtype == interface_type) - return (&curcd[i]); - } - } - - SET_FOREACH(cd, uart_acpi_class_set) { - curcd = *cd; - for (i = 0; curcd[i].cd_hid != NULL; i++) { - if (curcd[i].cd_port_subtype == interface_type) - return (&curcd[i]); - } - } - - return (NULL); -} - -static int -uart_cpu_acpi_probe(struct uart_class **classp, bus_space_tag_t *bst, - bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp, - u_int *iowidthp) -{ - struct acpi_uart_compat_data *cd; - ACPI_TABLE_SPCR *spcr; - vm_paddr_t spcr_physaddr; - int err; - - err = ENXIO; - spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); - if (spcr_physaddr == 0) - return (ENXIO); - - spcr = acpi_map_table(spcr_physaddr, ACPI_SIG_SPCR); - - cd = uart_cpu_acpi_scan(spcr->InterfaceType); - if (cd == NULL) - goto out; - - switch(spcr->BaudRate) { - case 0: - /* - * A BaudRate of 0 is a special value which means not to - * change the rate that's already programmed. - */ - *baud = 0; - break; - case 3: - *baud = 9600; - break; - case 4: - *baud = 19200; - break; - case 6: - *baud = 57600; - break; - case 7: - *baud = 115200; - break; - default: - goto out; - } - - err = acpi_map_addr(&spcr->SerialPort, bst, bsh, PAGE_SIZE); - if (err != 0) - goto out; - - *classp = cd->cd_class; - *rclk = 0; - *shiftp = spcr->SerialPort.AccessWidth - 1; - *iowidthp = spcr->SerialPort.BitWidth / 8; - - if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == - UART_F_IGNORE_SPCR_REGSHFT) { - *shiftp = cd->cd_regshft; - } - -out: - acpi_unmap_table(spcr); - return (err); -} -#endif - int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { @@ -186,14 +95,16 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) if (err == 0) return (0); +#ifdef DEV_ACPI + /* Check if SPCR can tell us what console to use. */ + if (uart_cpu_acpi_spcr(devtype, di) == 0) + return (0); +#endif + if (devtype != UART_DEV_CONSOLE) return (ENXIO); err = ENXIO; -#ifdef DEV_ACPI - err = uart_cpu_acpi_probe(&class, &bst, &bsh, &br, &rclk, &shift, - &iowidth); -#endif #ifdef FDT if (err != 0) { err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, Modified: head/sys/dev/uart/uart_cpu_x86.c ============================================================================== --- head/sys/dev/uart/uart_cpu_x86.c Thu May 23 19:26:50 2019 (r348194) +++ head/sys/dev/uart/uart_cpu_x86.c Thu May 23 19:55:53 2019 (r348195) @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_acpi.h" + #include __FBSDID("$FreeBSD$"); @@ -37,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO; bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM; @@ -61,6 +64,12 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) /* Check the environment. */ if (uart_getenv(devtype, di, class) == 0) return (0); + +#ifdef DEV_ACPI + /* Check if SPCR can tell us what console to use. */ + if (uart_cpu_acpi_spcr(devtype, di) == 0) + return (0); +#endif /* * Scan the hints. We only try units 0 to 3 (inclusive). This From owner-svn-src-all@freebsd.org Thu May 23 20:04:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA92915B44D0; Thu, 23 May 2019 20:04:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA6E8592F; Thu, 23 May 2019 20:04:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BD9B9F95; Thu, 23 May 2019 20:04:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NK4NGC017171; Thu, 23 May 2019 20:04:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NK4NpG017170; Thu, 23 May 2019 20:04:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905232004.x4NK4NpG017170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 23 May 2019 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348196 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EA6E8592F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 20:04:24 -0000 Author: manu Date: Thu May 23 20:04:22 2019 New Revision: 348196 URL: https://svnweb.freebsd.org/changeset/base/348196 Log: loader: Remove unused variable Reported by: lwshu, ci@ Modified: head/stand/common/module.c Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Thu May 23 19:55:53 2019 (r348195) +++ head/stand/common/module.c Thu May 23 20:04:22 2019 (r348196) @@ -487,7 +487,7 @@ command_pnpautoload(int argc, char *argv[]) { int i; int verbose; - int ch, error, match; + int ch, match; pnp_verbose_flag = 0; pnp_dump_flag = 0; From owner-svn-src-all@freebsd.org Thu May 23 20:12:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C6215B47D5; Thu, 23 May 2019 20:12:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1C0985E19; Thu, 23 May 2019 20:12:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EA9FA14A; Thu, 23 May 2019 20:12:25 +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 x4NKCPac022120; Thu, 23 May 2019 20:12:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NKCOWT022116; Thu, 23 May 2019 20:12:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905232012.x4NKCOWT022116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 23 May 2019 20:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348197 - in head: sbin/decryptcore sbin/dumpon sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/decryptcore sbin/dumpon sys/kern sys/sys X-SVN-Commit-Revision: 348197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1C0985E19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 20:12:26 -0000 Author: cem Date: Thu May 23 20:12:24 2019 New Revision: 348197 URL: https://svnweb.freebsd.org/changeset/base/348197 Log: EKCD: Add Chacha20 encryption mode Add Chacha20 mode to Encrypted Kernel Crash Dumps. Chacha20 does not require messages to be multiples of block size, so it is valid to use the cipher on non-block-sized messages without the explicit padding AES-CBC would require. Therefore, allow use with simultaneous dump compression. (Continue to disallow use of AES-CBC EKCD with compression.) dumpon(8) gains a -C cipher flag to select between chacha and aes-cbc. It defaults to chacha if no -C option is provided. The man page documents this behavior. Relnotes: sure Sponsored by: Dell EMC Isilon Modified: head/sbin/decryptcore/decryptcore.c head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c head/sys/kern/kern_shutdown.c head/sys/sys/kerneldump.h Modified: head/sbin/decryptcore/decryptcore.c ============================================================================== --- head/sbin/decryptcore/decryptcore.c Thu May 23 20:04:22 2019 (r348196) +++ head/sbin/decryptcore/decryptcore.c Thu May 23 20:12:24 2019 (r348197) @@ -119,7 +119,8 @@ static bool decrypt(int ofd, const char *privkeyfile, const char *keyfile, const char *input) { - uint8_t buf[KERNELDUMP_BUFFER_SIZE], key[KERNELDUMP_KEY_MAX_SIZE]; + uint8_t buf[KERNELDUMP_BUFFER_SIZE], key[KERNELDUMP_KEY_MAX_SIZE], + chachaiv[4 * 4]; EVP_CIPHER_CTX *ctx; const EVP_CIPHER *cipher; FILE *fp; @@ -207,6 +208,9 @@ decrypt(int ofd, const char *privkeyfile, const char * case KERNELDUMP_ENC_AES_256_CBC: cipher = EVP_aes_256_cbc(); break; + case KERNELDUMP_ENC_CHACHA20: + cipher = EVP_chacha20(); + break; default: pjdlog_error("Invalid encryption algorithm."); goto failed; @@ -222,7 +226,23 @@ decrypt(int ofd, const char *privkeyfile, const char * RSA_free(privkey); privkey = NULL; - EVP_DecryptInit_ex(ctx, cipher, NULL, key, kdk->kdk_iv); + if (kdk->kdk_encryption == KERNELDUMP_ENC_CHACHA20) { + /* + * OpenSSL treats the IV as 4 little-endian 32 bit integers. + * + * The first two represent a 64-bit counter, where the low half + * is the first 32-bit word. + * + * Start at counter block zero... + */ + memset(chachaiv, 0, 4 * 2); + /* + * And use the IV specified by the dump. + */ + memcpy(&chachaiv[4 * 2], kdk->kdk_iv, 4 * 2); + EVP_DecryptInit_ex(ctx, cipher, NULL, key, chachaiv); + } else + EVP_DecryptInit_ex(ctx, cipher, NULL, key, kdk->kdk_iv); EVP_CIPHER_CTX_set_padding(ctx, 0); explicit_bzero(key, sizeof(key)); Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Thu May 23 20:04:22 2019 (r348196) +++ head/sbin/dumpon/dumpon.8 Thu May 23 20:12:24 2019 (r348197) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 21, 2019 +.Dd May 23, 2019 .Dt DUMPON 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Op Fl i Ar index .Op Fl r .Op Fl v +.Op Fl C Ar cipher .Op Fl k Ar pubkey .Op Fl Z .Op Fl z @@ -47,6 +48,7 @@ .Op Fl i Ar index .Op Fl r .Op Fl v +.Op Fl C Ar cipher .Op Fl k Ar pubkey .Op Fl Z .Op Fl z @@ -129,6 +131,14 @@ The goal of the mechanism is to provide confidentialit The .Va pubkey file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl C Ar cipher +Select the symmetric algorithm used for encrypted kernel crash dump. +The default is +.Dq chacha20 +but +.Dq aes256-cbc +is also available. +(AES256-CBC mode does not work in conjunction with compression.) .It Fl l List the currently configured dump device(s), or /dev/null if no devices are configured. @@ -420,10 +430,6 @@ requires the .Dv GZIO option. .Sh BUGS -It is currently not possible to configure both compression and encryption. -The encrypted dump format assumes that the kernel dump size is a multiple -of the cipher block size, which may not be true when the dump is compressed. -.Pp Netdump only supports IPv4 at this time. .Sh SECURITY CONSIDERATIONS The current encrypted kernel core dump scheme does not provide integrity nor Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Thu May 23 20:04:22 2019 (r348196) +++ head/sbin/dumpon/dumpon.c Thu May 23 20:12:24 2019 (r348197) @@ -276,7 +276,16 @@ genkey(const char *pubkeyfile, struct diocskerneldump_ if (kdap->kda_encryptedkey == NULL) err(1, "Unable to allocate encrypted key"); - kdap->kda_encryption = KERNELDUMP_ENC_AES_256_CBC; + /* + * If no cipher was specified, choose a reasonable default. + */ + if (kdap->kda_encryption == KERNELDUMP_ENC_NONE) + kdap->kda_encryption = KERNELDUMP_ENC_CHACHA20; + else if (kdap->kda_encryption == KERNELDUMP_ENC_AES_256_CBC && + kdap->kda_compression != KERNELDUMP_COMP_NONE) + errx(EX_USAGE, "Unpadded AES256-CBC mode cannot be used " + "with compression."); + arc4random_buf(kdap->kda_key, sizeof(kdap->kda_key)); if (RSA_public_encrypt(sizeof(kdap->kda_key), kdap->kda_key, kdap->kda_encryptedkey, pubkey, @@ -378,7 +387,7 @@ main(int argc, char *argv[]) struct diocskerneldump_arg ndconf, *kdap; struct addrinfo hints, *res; const char *dev, *pubkeyfile, *server, *client, *gateway; - int ch, error, fd; + int ch, error, fd, cipher; bool gzip, list, netdump, zstd, insert, rflag; uint8_t ins_idx; @@ -387,9 +396,21 @@ main(int argc, char *argv[]) pubkeyfile = NULL; server = client = gateway = NULL; ins_idx = KDA_APPEND; + cipher = KERNELDUMP_ENC_NONE; - while ((ch = getopt(argc, argv, "c:g:i:k:lrs:vZz")) != -1) + while ((ch = getopt(argc, argv, "C:c:g:i:k:lrs:vZz")) != -1) switch ((char)ch) { + case 'C': + if (strcasecmp(optarg, "chacha") == 0 || + strcasecmp(optarg, "chacha20") == 0) + cipher = KERNELDUMP_ENC_CHACHA20; + else if (strcasecmp(optarg, "aes-cbc") == 0 || + strcasecmp(optarg, "aes256-cbc") == 0) + cipher = KERNELDUMP_ENC_AES_256_CBC; + else + errx(EX_USAGE, "Unrecognized cipher algorithm " + "'%s'", optarg); + break; case 'c': client = optarg; break; @@ -451,7 +472,10 @@ main(int argc, char *argv[]) if (argc != 1) usage(); -#ifndef HAVE_CRYPTO +#ifdef HAVE_CRYPTO + if (cipher != KERNELDUMP_ENC_NONE && pubkeyfile == NULL) + errx(EX_USAGE, "-C option requires a public key file."); +#else if (pubkeyfile != NULL) errx(EX_UNAVAILABLE,"Unable to use the public key." " Recompile dumpon with OpenSSL support."); @@ -526,8 +550,10 @@ main(int argc, char *argv[]) } #ifdef HAVE_CRYPTO - if (pubkeyfile != NULL) + if (pubkeyfile != NULL) { + kdap->kda_encryption = cipher; genkey(pubkeyfile, kdap); + } #endif error = ioctl(fd, DIOCSKERNELDUMP, kdap); if (error != 0) Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu May 23 20:04:22 2019 (r348196) +++ head/sys/kern/kern_shutdown.c Thu May 23 20:12:24 2019 (r348197) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -180,8 +181,16 @@ MALLOC_DEFINE(M_EKCD, "ekcd", "Encrypted kernel crash struct kerneldumpcrypto { uint8_t kdc_encryption; uint8_t kdc_iv[KERNELDUMP_IV_MAX_SIZE]; - keyInstance kdc_ki; - cipherInstance kdc_ci; + union { + struct { + keyInstance aes_ki; + cipherInstance aes_ci; + } u_aes; + struct chacha_ctx u_chacha; + } u; +#define kdc_ki u.u_aes.aes_ki +#define kdc_ci u.u_aes.aes_ci +#define kdc_chacha u.u_chacha uint32_t kdc_dumpkeysize; struct kerneldumpkey kdc_dumpkey[]; }; @@ -1024,6 +1033,9 @@ kerneldumpcrypto_create(size_t blocksize, uint8_t encr if (rijndael_makeKey(&kdc->kdc_ki, DIR_ENCRYPT, 256, key) <= 0) goto failed; break; + case KERNELDUMP_ENC_CHACHA20: + chacha_keysetup(&kdc->kdc_chacha, key, 256); + break; default: goto failed; } @@ -1072,6 +1084,9 @@ kerneldumpcrypto_init(struct kerneldumpcrypto *kdc) goto out; } break; + case KERNELDUMP_ENC_CHACHA20: + chacha_ivsetup(&kdc->kdc_chacha, kdc->kdc_iv, NULL); + break; default: error = EINVAL; goto out; @@ -1208,11 +1223,12 @@ dumper_insert(const struct dumperinfo *di_template, co } if (kda->kda_compression != KERNELDUMP_COMP_NONE) { /* - * We currently can't support simultaneous encryption and - * compression because our only encryption mode is an unpadded - * block cipher, go figure. This is low hanging fruit to fix. + * We can't support simultaneous unpadded block cipher + * encryption and compression because there is no guarantee the + * length of the compressed result is exactly a multiple of the + * cipher block size. */ - if (kda->kda_encryption != KERNELDUMP_ENC_NONE) { + if (kda->kda_encryption == KERNELDUMP_ENC_AES_256_CBC) { error = EOPNOTSUPP; goto cleanup; } @@ -1367,6 +1383,9 @@ dump_encrypt(struct kerneldumpcrypto *kdc, uint8_t *bu buf + size - 16 /* IV size for AES-256-CBC */) <= 0) { return (EIO); } + break; + case KERNELDUMP_ENC_CHACHA20: + chacha_encrypt_bytes(&kdc->kdc_chacha, buf, buf, size); break; default: return (EINVAL); Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Thu May 23 20:04:22 2019 (r348196) +++ head/sys/sys/kerneldump.h Thu May 23 20:12:24 2019 (r348197) @@ -63,6 +63,7 @@ #define KERNELDUMP_ENC_NONE 0 #define KERNELDUMP_ENC_AES_256_CBC 1 +#define KERNELDUMP_ENC_CHACHA20 2 #define KERNELDUMP_BUFFER_SIZE 4096 #define KERNELDUMP_IV_MAX_SIZE 32 From owner-svn-src-all@freebsd.org Thu May 23 20:18:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D5E15B4BB5; Thu, 23 May 2019 20:18:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6251686190; Thu, 23 May 2019 20:18:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B63AA163; Thu, 23 May 2019 20:18:47 +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 x4NKIlBr022448; Thu, 23 May 2019 20:18:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NKIl5q022447; Thu, 23 May 2019 20:18:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905232018.x4NKIl5q022447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 23 May 2019 20:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348198 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 348198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6251686190 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 20:18:47 -0000 Author: cem Date: Thu May 23 20:18:46 2019 New Revision: 348198 URL: https://svnweb.freebsd.org/changeset/base/348198 Log: uart_cpu_acpi: Fix GCC build break from r348195 extern declarations are redundant with those in uart_cpu.h, which this file includes. X-MFC-with: r348195 Modified: head/sys/dev/uart/uart_cpu_acpi.c Modified: head/sys/dev/uart/uart_cpu_acpi.c ============================================================================== --- head/sys/dev/uart/uart_cpu_acpi.c Thu May 23 20:12:24 2019 (r348197) +++ head/sys/dev/uart/uart_cpu_acpi.c Thu May 23 20:18:46 2019 (r348198) @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern bus_space_tag_t uart_bus_space_io; -extern bus_space_tag_t uart_bus_space_mem; - static struct acpi_uart_compat_data * uart_cpu_acpi_scan(uint8_t interface_type) { From owner-svn-src-all@freebsd.org Thu May 23 21:02:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C8B615B5A96; Thu, 23 May 2019 21:02:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A735987EE6; Thu, 23 May 2019 21:02:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 857ACAA72; Thu, 23 May 2019 21:02:28 +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 x4NL2SWo049072; Thu, 23 May 2019 21:02:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NL2RDC049069; Thu, 23 May 2019 21:02:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905232102.x4NL2RDC049069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 23 May 2019 21:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348199 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 348199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A735987EE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:02:29 -0000 Author: cem Date: Thu May 23 21:02:27 2019 New Revision: 348199 URL: https://svnweb.freebsd.org/changeset/base/348199 Log: random(4): deduplicate explicit_bzero() in harvest Pull the responsibility for zeroing events, which is general to any conceivable implementation of a random device algorithm, out of the algorithm-specific Fortuna code and into the callers. Most callers indirect through random_fortuna_process_event(), so add the logic there. Most callers already explicitly bzeroed the events they provided, so the logic in Fortuna was mostly redundant. Add one missing bzero in randomdev_accumulate(). Also, remove a redundant bzero in the same function -- randomdev_hash_finish() is obliged to bzero the hash state. Reviewed by: delphij Approved by: secteam(delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20318 Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/random_harvestq.c head/sys/dev/random/randomdev.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Thu May 23 20:18:46 2019 (r348198) +++ head/sys/dev/random/fortuna.c Thu May 23 21:02:27 2019 (r348199) @@ -254,7 +254,6 @@ random_fortuna_process_event(struct harvest_event *eve fortuna_state.fs_pool[pl].fsp_length = MIN(RANDOM_FORTUNA_MAXPOOLSIZE, fortuna_state.fs_pool[pl].fsp_length + sizeof(event->he_somecounter) + event->he_size); - explicit_bzero(event, sizeof(*event)); RANDOM_RESEED_UNLOCK(); } Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Thu May 23 20:18:46 2019 (r348198) +++ head/sys/dev/random/random_harvestq.c Thu May 23 21:02:27 2019 (r348199) @@ -163,6 +163,7 @@ random_harvestq_fast_process_event(struct harvest_even #if defined(RANDOM_LOADABLE) RANDOM_CONFIG_S_UNLOCK(); #endif + explicit_bzero(event, sizeof(*event)); } static void @@ -437,7 +438,6 @@ random_harvestq_prime(void *unused __unused) harvest_context.hc_destination[RANDOM_CACHED]++; memcpy(event.he_entropy, data + i, sizeof(event.he_entropy)); random_harvestq_fast_process_event(&event); - explicit_bzero(&event, sizeof(event)); } explicit_bzero(data, size); if (bootverbose) @@ -540,7 +540,6 @@ random_harvest_direct_(const void *entropy, u_int size event.he_destination = harvest_context.hc_destination[origin]++; memcpy(event.he_entropy, entropy, size); random_harvestq_fast_process_event(&event); - explicit_bzero(&event, sizeof(event)); } void Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Thu May 23 20:18:46 2019 (r348198) +++ head/sys/dev/random/randomdev.c Thu May 23 21:02:27 2019 (r348199) @@ -321,7 +321,6 @@ randomdev_accumulate(uint8_t *buf, u_int count) timestamp = (uint32_t)get_cyclecount(); randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp)); randomdev_hash_finish(&hash, entropy_data); - explicit_bzero(&hash, sizeof(hash)); for (i = 0; i < RANDOM_KEYSIZE_WORDS; i += sizeof(event.he_entropy)/sizeof(event.he_entropy[0])) { event.he_somecounter = (uint32_t)get_cyclecount(); event.he_size = sizeof(event.he_entropy); @@ -330,6 +329,7 @@ randomdev_accumulate(uint8_t *buf, u_int count) memcpy(event.he_entropy, entropy_data + i, sizeof(event.he_entropy)); p_random_alg_context->ra_event_processor(&event); } + explicit_bzero(&event, sizeof(event)); explicit_bzero(entropy_data, sizeof(entropy_data)); } From owner-svn-src-all@freebsd.org Thu May 23 21:05:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25F4815B5BA8; Thu, 23 May 2019 21:05:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA0F4880C4; Thu, 23 May 2019 21:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90105AA89; Thu, 23 May 2019 21:05: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 x4NL55g7049237; Thu, 23 May 2019 21:05:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NL550G049236; Thu, 23 May 2019 21:05:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232105.x4NL550G049236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 21:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348200 - stable/12/sys/dev/cxgbe/crypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 348200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA0F4880C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:05:06 -0000 Author: jhb Date: Thu May 23 21:05:05 2019 New Revision: 348200 URL: https://svnweb.freebsd.org/changeset/base/348200 Log: MFC 346648: Fix requests for "plain" SHA digests of an empty buffer. To workaround limitations in the crypto engine, empty buffers are handled by manually constructing the final length block as the payload passed to the crypto engine and disabling the normal "final" handling. For HMAC this length block should hold the length of a single block since the hash is actually the hash of the IPAD digest, but for "plain" SHA the length should be zero instead. Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu May 23 21:02:27 2019 (r348199) +++ stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu May 23 21:05:05 2019 (r348200) @@ -537,8 +537,9 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, dst = (char *)(crwr + 1) + kctx_len + DUMMY_BYTES; if (crd->crd_len == 0) { dst[0] = 0x80; - *(uint64_t *)(dst + axf->blocksize - sizeof(uint64_t)) = - htobe64(axf->blocksize << 3); + if (s->mode == HMAC) + *(uint64_t *)(dst + axf->blocksize - sizeof(uint64_t)) = + htobe64(axf->blocksize << 3); } else if (imm_len != 0) crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip, crd->crd_len, dst); From owner-svn-src-all@freebsd.org Thu May 23 21:23:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F53B15B6395; Thu, 23 May 2019 21:23:22 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7D388E46; Thu, 23 May 2019 21:23:21 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 156BBAE0F; Thu, 23 May 2019 21:23:21 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NLNLok061413; Thu, 23 May 2019 21:23:21 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NLNJg9061403; Thu, 23 May 2019 21:23:19 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905232123.x4NLNJg9061403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 23 May 2019 21:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348201 - in stable/11: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable/11: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Commit-Revision: 348201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE7D388E46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:23:22 -0000 Author: rgrimes Date: Thu May 23 21:23:18 2019 New Revision: 348201 URL: https://svnweb.freebsd.org/changeset/base/348201 Log: MFC: r332298,333712,334199,334216,334219 bhyve cpu topology Approved by: re (gjb), bde/phk (mentor, implicit) Modified: stable/11/lib/libvmmapi/vmmapi.c stable/11/lib/libvmmapi/vmmapi.h stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/include/vmm_dev.h stable/11/sys/amd64/vmm/vmm.c stable/11/sys/amd64/vmm/vmm_dev.c stable/11/sys/amd64/vmm/x86.c stable/11/usr.sbin/bhyve/bhyve.8 stable/11/usr.sbin/bhyve/bhyverun.c stable/11/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/11/lib/libvmmapi/vmmapi.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/lib/libvmmapi/vmmapi.c Thu May 23 21:23:18 2019 (r348201) @@ -1417,6 +1417,38 @@ vm_restart_instruction(void *arg, int vcpu) } int +vm_set_topology(struct vmctx *ctx, + uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus) +{ + struct vm_cpu_topology topology; + + bzero(&topology, sizeof (struct vm_cpu_topology)); + topology.sockets = sockets; + topology.cores = cores; + topology.threads = threads; + topology.maxcpus = maxcpus; + return (ioctl(ctx->fd, VM_SET_TOPOLOGY, &topology)); +} + +int +vm_get_topology(struct vmctx *ctx, + uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus) +{ + struct vm_cpu_topology topology; + int error; + + bzero(&topology, sizeof (struct vm_cpu_topology)); + error = ioctl(ctx->fd, VM_GET_TOPOLOGY, &topology); + if (error == 0) { + *sockets = topology.sockets; + *cores = topology.cores; + *threads = topology.threads; + *maxcpus = topology.maxcpus; + } + return (error); +} + +int vm_get_device_fd(struct vmctx *ctx) { @@ -1443,7 +1475,7 @@ vm_get_ioctls(size_t *len) VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, - VM_RESTART_INSTRUCTION }; + VM_RESTART_INSTRUCTION, VM_SET_TOPOLOGY, VM_GET_TOPOLOGY }; if (len == NULL) { cmds = malloc(sizeof(vm_ioctl_cmds)); Modified: stable/11/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/11/lib/libvmmapi/vmmapi.h Thu May 23 21:05:05 2019 (r348200) +++ stable/11/lib/libvmmapi/vmmapi.h Thu May 23 21:23:18 2019 (r348201) @@ -209,6 +209,12 @@ int vm_active_cpus(struct vmctx *ctx, cpuset_t *cpus); int vm_suspended_cpus(struct vmctx *ctx, cpuset_t *cpus); int vm_activate_cpu(struct vmctx *ctx, int vcpu); +/* CPU topology */ +int vm_set_topology(struct vmctx *ctx, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus); +int vm_get_topology(struct vmctx *ctx, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus); + /* * FreeBSD specific APIs */ Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Thu May 23 21:05:05 2019 (r348200) +++ stable/11/sys/amd64/include/vmm.h Thu May 23 21:23:18 2019 (r348201) @@ -184,6 +184,10 @@ int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); +void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus); +int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus); /* * APIs that modify the guest memory map require all vcpus to be frozen. Modified: stable/11/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/11/sys/amd64/include/vmm_dev.h Thu May 23 21:05:05 2019 (r348200) +++ stable/11/sys/amd64/include/vmm_dev.h Thu May 23 21:23:18 2019 (r348201) @@ -216,6 +216,13 @@ struct vm_rtc_data { uint8_t value; }; +struct vm_cpu_topology { + uint16_t sockets; + uint16_t cores; + uint16_t threads; + uint16_t maxcpus; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -271,6 +278,10 @@ enum { IOCNUM_GET_X2APIC_STATE = 61, IOCNUM_GET_HPET_CAPABILITIES = 62, + /* CPU Topology */ + IOCNUM_SET_TOPOLOGY = 63, + IOCNUM_GET_TOPOLOGY = 64, + /* legacy interrupt injection */ IOCNUM_ISA_ASSERT_IRQ = 80, IOCNUM_ISA_DEASSERT_IRQ = 81, @@ -360,6 +371,10 @@ enum { _IOWR('v', IOCNUM_GET_X2APIC_STATE, struct vm_x2apic) #define VM_GET_HPET_CAPABILITIES \ _IOR('v', IOCNUM_GET_HPET_CAPABILITIES, struct vm_hpet_cap) +#define VM_SET_TOPOLOGY \ + _IOW('v', IOCNUM_SET_TOPOLOGY, struct vm_cpu_topology) +#define VM_GET_TOPOLOGY \ + _IOR('v', IOCNUM_GET_TOPOLOGY, struct vm_cpu_topology) #define VM_GET_GPA_PMAP \ _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) #define VM_GLA2GPA \ Modified: stable/11/sys/amd64/vmm/vmm.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/sys/amd64/vmm/vmm.c Thu May 23 21:23:18 2019 (r348201) @@ -163,6 +163,11 @@ struct vm { struct vmspace *vmspace; /* (o) guest's address space */ char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */ struct vcpu vcpu[VM_MAXCPU]; /* (i) guest vcpus */ + /* The following describe the vm cpu topology */ + uint16_t sockets; /* (o) num of sockets */ + uint16_t cores; /* (o) num of cores/socket */ + uint16_t threads; /* (o) num of threads/core */ + uint16_t maxcpus; /* (o) max pluggable cpus */ }; static int vmm_initialized; @@ -423,6 +428,12 @@ vm_init(struct vm *vm, bool create) vcpu_init(vm, i, create); } +/* + * The default CPU topology is a single thread per package. + */ +u_int cores_per_package = 1; +u_int threads_per_core = 1; + int vm_create(const char *name, struct vm **retvm) { @@ -448,10 +459,41 @@ vm_create(const char *name, struct vm **retvm) vm->vmspace = vmspace; mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); + vm->sockets = 1; + vm->cores = cores_per_package; /* XXX backwards compatibility */ + vm->threads = threads_per_core; /* XXX backwards compatibility */ + vm->maxcpus = 0; /* XXX not implemented */ + vm_init(vm, true); *retvm = vm; return (0); +} + +void +vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus) +{ + *sockets = vm->sockets; + *cores = vm->cores; + *threads = vm->threads; + *maxcpus = vm->maxcpus; +} + +int +vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus) +{ + if (maxcpus != 0) + return (EINVAL); /* XXX remove when supported */ + if ((sockets * cores * threads) > VM_MAXCPU) + return (EINVAL); + /* XXX need to check sockets * cores * threads == vCPU, how? */ + vm->sockets = sockets; + vm->cores = cores; + vm->threads = threads; + vm->maxcpus = maxcpus; + return(0); } static void Modified: stable/11/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_dev.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/sys/amd64/vmm/vmm_dev.c Thu May 23 21:23:18 2019 (r348201) @@ -314,6 +314,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct vm_rtc_time *rtctime; struct vm_rtc_data *rtcdata; struct vm_memmap *mm; + struct vm_cpu_topology *topology; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -640,6 +641,17 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da break; case VM_RESTART_INSTRUCTION: error = vm_restart_instruction(sc->vm, vcpu); + break; + case VM_SET_TOPOLOGY: + topology = (struct vm_cpu_topology *)data; + error = vm_set_topology(sc->vm, topology->sockets, + topology->cores, topology->threads, topology->maxcpus); + break; + case VM_GET_TOPOLOGY: + topology = (struct vm_cpu_topology *)data; + vm_get_topology(sc->vm, &topology->sockets, &topology->cores, + &topology->threads, &topology->maxcpus); + error = 0; break; default: error = ENOTTY; Modified: stable/11/sys/amd64/vmm/x86.c ============================================================================== --- stable/11/sys/amd64/vmm/x86.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/sys/amd64/vmm/x86.c Thu May 23 21:23:18 2019 (r348201) @@ -58,16 +58,15 @@ static uint64_t bhyve_xcpuids; SYSCTL_ULONG(_hw_vmm, OID_AUTO, bhyve_xcpuids, CTLFLAG_RW, &bhyve_xcpuids, 0, "Number of times an unknown cpuid leaf was accessed"); -/* - * The default CPU topology is a single thread per package. - */ -static u_int threads_per_core = 1; +#if __FreeBSD_version < 1200060 /* Remove after 11 EOL helps MFCing */ +extern u_int threads_per_core; SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, threads_per_core, CTLFLAG_RDTUN, &threads_per_core, 0, NULL); -static u_int cores_per_package = 1; +extern u_int cores_per_package; SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, cores_per_package, CTLFLAG_RDTUN, &cores_per_package, 0, NULL); +#endif static int cpuid_leaf_b = 1; SYSCTL_INT(_hw_vmm_topology, OID_AUTO, cpuid_leaf_b, CTLFLAG_RDTUN, @@ -93,6 +92,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, int error, enable_invpcid, level, width, x2apic_id; unsigned int func, regs[4], logical_cpus; enum x2apic_state x2apic_state; + uint16_t cores, maxcpus, sockets, threads; VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx); @@ -140,11 +140,11 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * * However this matches the logical cpus as * advertised by leaf 0x1 and will work even - * if the 'threads_per_core' tunable is set - * incorrectly on an AMD host. + * if threads is set incorrectly on an AMD host. */ - logical_cpus = threads_per_core * - cores_per_package; + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + logical_cpus = threads * cores; regs[2] = logical_cpus - 1; } break; @@ -303,7 +303,9 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, */ regs[3] |= (CPUID_MCA | CPUID_MCE | CPUID_MTRR); - logical_cpus = threads_per_core * cores_per_package; + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + logical_cpus = threads * cores; regs[1] &= ~CPUID_HTT_CORES; regs[1] |= (logical_cpus & 0xff) << 16; regs[3] |= CPUID_HTT; @@ -313,8 +315,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, cpuid_count(*eax, *ecx, regs); if (regs[0] || regs[1] || regs[2] || regs[3]) { + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); regs[0] &= 0x3ff; - regs[0] |= (cores_per_package - 1) << 26; + regs[0] |= (cores - 1) << 26; /* * Cache topology: * - L1 and L2 are shared only by the logical @@ -322,10 +326,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * - L3 and above are shared by all logical * processors in the package. */ - logical_cpus = threads_per_core; + logical_cpus = threads; level = (regs[0] >> 5) & 0x7; if (level >= 3) - logical_cpus *= cores_per_package; + logical_cpus *= cores; regs[0] |= (logical_cpus - 1) << 14; } break; @@ -387,16 +391,17 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, /* * Processor topology enumeration */ + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); if (*ecx == 0) { - logical_cpus = threads_per_core; + logical_cpus = threads; width = log2(logical_cpus); level = CPUID_TYPE_SMT; x2apic_id = vcpu_id; } if (*ecx == 1) { - logical_cpus = threads_per_core * - cores_per_package; + logical_cpus = threads * cores; width = log2(logical_cpus); level = CPUID_TYPE_CORE; x2apic_id = vcpu_id; Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Thu May 23 21:05:05 2019 (r348200) +++ stable/11/usr.sbin/bhyve/bhyve.8 Thu May 23 21:23:18 2019 (r348201) @@ -33,7 +33,16 @@ .Sh SYNOPSIS .Nm .Op Fl abehuwxACHPSWY -.Op Fl c Ar numcpus +.Oo +.Fl c\~ Ns +.Oo +.Op Ar cpus= Ns +.Ar numcpus Ns +.Oc Ns +.Op Ar ,sockets=n Ns +.Op Ar ,cores=n Ns +.Op Ar ,threads=n +.Oc .Op Fl g Ar gdbport .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t @@ -77,9 +86,30 @@ Enable a low-level console device supported by kernels compiled with .Cd "device bvmconsole" . This option will be deprecated in a future version. -.It Fl c Ar numcpus -Number of guest virtual CPUs. -The default is 1 and the maximum is 16. +.It Fl c Op Ar setting ... +Number of guest virtual CPUs +and/or the CPU topology. +The default value for each of +.Ar numcpus , +.Ar sockets , +.Ar cores , +and +.Ar threads +is 1. +The current maximum number of guest virtual CPUs is 16. +If +.Ar numcpus +is not specified then it will be calculated from the other arguments. +The topology must be consistent in that the +.Ar numcpus +must equal the product of +.Ar sockets , +.Ar cores , +and +.Ar threads . +If a +.Ar setting +is specified more than once the last one has precedence. .It Fl C Include guest memory in core file. .It Fl e Modified: stable/11/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/11/usr.sbin/bhyve/bhyverun.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/usr.sbin/bhyve/bhyverun.c Thu May 23 21:23:18 2019 (r348201) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifndef WITHOUT_CAPSICUM #include #include @@ -163,6 +164,8 @@ extern int vmexit_task_switch(struct vmctx *, struct v char *vmname; int guest_ncpus; +uint16_t cores, maxcpus, sockets, threads; + char *guest_uuid_str; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; @@ -207,11 +210,13 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-abehuwxACHPSWY] [-c vcpus] [-g ] [-l ]\n" + "Usage: %s [-abehuwxACHPSWY]\n" + " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" + " %*s [-g ] [-l ]\n" " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" - " -c: # cpus (default 1)\n" + " -c: number of cpus and/or topology specification\n" " -C: include guest memory in core file\n" " -e: exit on unhandled I/O access\n" " -g: gdb port\n" @@ -229,7 +234,8 @@ usage(int code) " -W: force virtio to use single-vector MSI\n" " -x: local apic is in x2APIC mode\n" " -Y: disable MPtable generation\n", - progname, (int)strlen(progname), ""); + progname, (int)strlen(progname), "", (int)strlen(progname), "", + (int)strlen(progname), ""); exit(code); } @@ -271,7 +277,95 @@ bhyve_caph_limit_stdoe(void) #endif +/* + * XXX This parser is known to have the following issues: + * 1. It accepts null key=value tokens ",,". + * 2. It accepts whitespace after = and before value. + * 3. Values out of range of INT are silently wrapped. + * 4. It doesn't check non-final values. + * 5. The apparently bogus limits of UINT16_MAX are for future expansion. + * + * The acceptance of a null specification ('-c ""') is by design to match the + * manual page syntax specification, this results in a topology of 1 vCPU. + */ static int +topology_parse(const char *opt) +{ + uint64_t ncpus; + int c, chk, n, s, t, tmp; + char *cp, *str; + bool ns, scts; + + c = 1, n = 1, s = 1, t = 1; + ns = false, scts = false; + str = strdup(opt); + if (str == NULL) + goto out; + + while ((cp = strsep(&str, ",")) != NULL) { + if (sscanf(cp, "%i%n", &tmp, &chk) == 1) { + n = tmp; + ns = true; + } else if (sscanf(cp, "cpus=%i%n", &tmp, &chk) == 1) { + n = tmp; + ns = true; + } else if (sscanf(cp, "sockets=%i%n", &tmp, &chk) == 1) { + s = tmp; + scts = true; + } else if (sscanf(cp, "cores=%i%n", &tmp, &chk) == 1) { + c = tmp; + scts = true; + } else if (sscanf(cp, "threads=%i%n", &tmp, &chk) == 1) { + t = tmp; + scts = true; +#ifdef notyet /* Do not expose this until vmm.ko implements it */ + } else if (sscanf(cp, "maxcpus=%i%n", &tmp, &chk) == 1) { + m = tmp; +#endif + /* Skip the empty argument case from -c "" */ + } else if (cp[0] == '\0') + continue; + else + goto out; + /* Any trailing garbage causes an error */ + if (cp[chk] != '\0') + goto out; + } + free(str); + str = NULL; + + /* + * Range check 1 <= n <= UINT16_MAX all values + */ + if (n < 1 || s < 1 || c < 1 || t < 1 || + n > UINT16_MAX || s > UINT16_MAX || c > UINT16_MAX || + t > UINT16_MAX) + return (-1); + + /* If only the cpus was specified, use that as sockets */ + if (!scts) + s = n; + /* + * Compute sockets * cores * threads avoiding overflow + * The range check above insures these are 16 bit values + * If n was specified check it against computed ncpus + */ + ncpus = (uint64_t)s * c * t; + if (ncpus > UINT16_MAX || (ns && n != ncpus)) + return (-1); + + guest_ncpus = ncpus; + sockets = s; + cores = c; + threads = t; + return(0); + +out: + free(str); + return (-1); +} + +static int pincpu_parse(const char *opt) { int vcpu, pcpu; @@ -899,6 +993,9 @@ do_open(const char *vmname) exit(4); } } + error = vm_set_topology(ctx, sockets, cores, threads, maxcpus); + if (error) + errx(EX_OSERR, "vm_set_topology"); return (ctx); } @@ -917,6 +1014,8 @@ main(int argc, char *argv[]) progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; + sockets = cores = threads = 1; + maxcpus = 0; memsize = 256 * MB; mptgen = 1; rtc_localtime = 1; @@ -941,7 +1040,10 @@ main(int argc, char *argv[]) } break; case 'c': - guest_ncpus = atoi(optarg); + if (topology_parse(optarg) != 0) { + errx(EX_USAGE, "invalid cpu topology " + "'%s'", optarg); + } break; case 'C': memflags |= VM_MEM_F_INCORE; @@ -1018,11 +1120,6 @@ main(int argc, char *argv[]) vmname = argv[0]; ctx = do_open(vmname); - - if (guest_ncpus < 1) { - fprintf(stderr, "Invalid guest vCPUs (%d)\n", guest_ncpus); - exit(1); - } max_vcpus = num_vcpus_allowed(ctx); if (guest_ncpus > max_vcpus) { Modified: stable/11/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- stable/11/usr.sbin/bhyvectl/bhyvectl.c Thu May 23 21:05:05 2019 (r348200) +++ stable/11/usr.sbin/bhyvectl/bhyvectl.c Thu May 23 21:23:18 2019 (r348201) @@ -191,7 +191,8 @@ usage(bool cpu_intel) " [--get-msr-bitmap]\n" " [--get-msr-bitmap-address]\n" " [--get-guest-sysenter]\n" - " [--get-exit-reason]\n", + " [--get-exit-reason]\n" + " [--get-cpu-topology]\n", progname); if (cpu_intel) { @@ -285,6 +286,7 @@ static int set_x2apic_state, get_x2apic_state; enum x2apic_state x2apic_state; static int unassign_pptdev, bus, slot, func; static int run; +static int get_cpu_topology; /* * VMCB specific. @@ -1456,6 +1458,7 @@ setup_options(bool cpu_intel) { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, { "get-intinfo", NO_ARG, &get_intinfo, 1 }, + { "get-cpu-topology", NO_ARG, &get_cpu_topology, 1 }, }; const struct option intel_opts[] = { @@ -2310,6 +2313,14 @@ main(int argc, char *argv[]) printf("%-40s\t%ld\n", desc, stats[i]); } } + } + + if (!error && (get_cpu_topology || get_all)) { + uint16_t sockets, cores, threads, maxcpus; + + vm_get_topology(ctx, &sockets, &cores, &threads, &maxcpus); + printf("cpu_topology:\tsockets=%hu, cores=%hu, threads=%hu, " + "maxcpus=%hu\n", sockets, cores, threads, maxcpus); } if (!error && run) { From owner-svn-src-all@freebsd.org Thu May 23 21:52:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CE515B6EF7; Thu, 23 May 2019 21:52:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37BD48A2FE; Thu, 23 May 2019 21:52:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D7C5B352; Thu, 23 May 2019 21:52:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NLqOWc077671; Thu, 23 May 2019 21:52:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NLqOJV077670; Thu, 23 May 2019 21:52:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232152.x4NLqOJV077670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 21:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348202 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 348202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37BD48A2FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:52:25 -0000 Author: jhb Date: Thu May 23 21:52:24 2019 New Revision: 348202 URL: https://svnweb.freebsd.org/changeset/base/348202 Log: MFC 346649: Don't panic for empty CCM requests. A request to encrypt an empty payload without any AAD is unusual, but it is defined behavior. Removing this assertion removes a panic and instead returns the correct tag for an empty buffer. Modified: stable/12/sys/opencrypto/cbc_mac.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/opencrypto/cbc_mac.c ============================================================================== --- stable/12/sys/opencrypto/cbc_mac.c Thu May 23 21:23:18 2019 (r348201) +++ stable/12/sys/opencrypto/cbc_mac.c Thu May 23 21:52:24 2019 (r348202) @@ -82,9 +82,6 @@ AES_CBC_MAC_Reinit(struct aes_cbc_mac_ctx *ctx, const uint8_t *bp = b0, flags = 0; uint8_t L = 0; uint64_t dataLength = ctx->cryptDataLength; - - KASSERT(ctx->authDataLength != 0 || ctx->cryptDataLength != 0, - ("Auth Data and Data lengths cannot both be 0")); KASSERT(nonceLen >= 7 && nonceLen <= 13, ("nonceLen must be between 7 and 13 bytes")); From owner-svn-src-all@freebsd.org Thu May 23 21:58:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D060615B7109; Thu, 23 May 2019 21:57:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2DD8A7C4; Thu, 23 May 2019 21:57:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49EA2B36E; Thu, 23 May 2019 21:57:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NLvxEn078382; Thu, 23 May 2019 21:57:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NLvwEZ078381; Thu, 23 May 2019 21:57:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232157.x4NLvwEZ078381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 21:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348203 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 348203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F2DD8A7C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 21:58:00 -0000 Author: jhb Date: Thu May 23 21:57:58 2019 New Revision: 348203 URL: https://svnweb.freebsd.org/changeset/base/348203 Log: MFC 346617: Test the AES-CCM test vectors from the NIST Known Answer Tests. The CCM test vectors use a slightly different file format in that there are global key-value pairs as well as section key-value pairs that need to be used in each test. In addition, the sections can set multiple key-value pairs in the section name. The CCM KAT parser class is an iterator that returns a dictionary once per test where the dictionary contains all of the relevant key-value pairs for a given test (global, section name, section, test-specific). Note that all of the CCM decrypt tests use nonce and tag lengths that are not supported by OCF (OCF only supports a 12 byte nonce and 16 byte tag), so none of the decryption vectors are actually tested. Modified: stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 21:52:24 2019 (r348202) +++ stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 21:57:58 2019 (r348203) @@ -381,6 +381,112 @@ class KATParser: yield values +# The CCM files use a bit of a different syntax that doesn't quite fit +# the generic KATParser. In particular, some keys are set globally at +# the start of the file, and some are set globally at the start of a +# section. +class KATCCMParser: + def __init__(self, fname): + self.fp = open(fname) + self._pending = None + self.read_globals() + + def read_globals(self): + self.global_values = {} + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return + + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + + v = v.strip() + + if f in self.global_values: + raise ValueError('already present: %r' % repr(f)) + self.global_values[f] = v + + def read_section_values(self, kwpairs): + self.section_values = self.global_values.copy() + for pair in kwpairs.split(', '): + f, v = pair.split(' = ') + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v + + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return + + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + + if f == 'Count': + self._pending = line + return + + v = v.strip() + + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v + + def __iter__(self): + while True: + if self._pending: + line = self._pending + self._pending = None + else: + line = self.fp.readline() + if not line: + return + + if (line and line[0] == '#') or not line.strip(): + continue + + if line[0] == '[': + section = line[1:].split(']', 1)[0] + self.read_section_values(section) + continue + + values = self.section_values.copy() + + while True: + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + v = v.strip() + + if f in values: + raise ValueError('already present: %r' % repr(f)) + values[f] = v + line = self.fp.readline().strip() + if not line: + break + + yield values + + def _spdechex(s): return ''.join(s.split()).decode('hex') Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 21:52:24 2019 (r348202) +++ stable/12/tests/sys/opencrypto/cryptotest.py Thu May 23 21:57:58 2019 (r348203) @@ -71,6 +71,14 @@ def GenTestCase(cname): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-CCM on %s' % (cname)) + def test_ccm(self): + for i in katg('ccmtestvectors', 'V*.rsp'): + self.runCCMEncrypt(i) + + for i in katg('ccmtestvectors', 'D*.rsp'): + self.runCCMDecrypt(i) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-GCM on %s' % (cname)) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): @@ -219,6 +227,93 @@ def GenTestCase(cname): raise continue self.assertEqual(r, ct) + + def runCCMEncrypt(self, fname): + for data in cryptodev.KATCCMParser(fname): + Nlen = int(data['Nlen']) + if Nlen != 12: + # OCF only supports 12 byte IVs + continue + key = data['Key'].decode('hex') + nonce = data['Nonce'].decode('hex') + Alen = int(data['Alen']) + if Alen != 0: + aad = data['Adata'].decode('hex') + else: + aad = None + payload = data['Payload'].decode('hex') + ct = data['CT'].decode('hex') + + try: + c = Crypto(crid=crid, + cipher=cryptodev.CRYPTO_AES_CCM_16, + key=key, + mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, + mackey=key, maclen=16) + r, tag = Crypto.encrypt(c, payload, + nonce, aad) + except EnvironmentError, e: + if e.errno != errno.EOPNOTSUPP: + raise + continue + + out = r + tag + self.assertEqual(out, ct, + "Count " + data['Count'] + " Actual: " + \ + repr(out.encode("hex")) + " Expected: " + \ + repr(data) + " on " + cname) + + def runCCMDecrypt(self, fname): + # XXX: Note that all of the current CCM + # decryption test vectors use IV and tag sizes + # that aren't supported by OCF none of the + # tests are actually ran. + for data in cryptodev.KATCCMParser(fname): + Nlen = int(data['Nlen']) + if Nlen != 12: + # OCF only supports 12 byte IVs + continue + Tlen = int(data['Tlen']) + if Tlen != 16: + # OCF only supports 16 byte tags + continue + key = data['Key'].decode('hex') + nonce = data['Nonce'].decode('hex') + Alen = int(data['Alen']) + if Alen != 0: + aad = data['Adata'].decode('hex') + else: + aad = None + ct = data['CT'].decode('hex') + tag = ct[-16:] + ct = ct[:-16] + + try: + c = Crypto(crid=crid, + cipher=cryptodev.CRYPTO_AES_CCM_16, + key=key, + mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, + mackey=key, maclen=16) + except EnvironmentError, e: + if e.errno != errno.EOPNOTSUPP: + raise + continue + + if data['Result'] == 'Fail': + self.assertRaises(IOError, + c.decrypt, payload, nonce, aad, tag) + else: + r = Crypto.decrypt(c, payload, nonce, + aad, tag) + + payload = data['Payload'].decode('hex') + Plen = int(data('Plen')) + payload = payload[:plen] + self.assertEqual(r, payload, + "Count " + data['Count'] + \ + " Actual: " + repr(r.encode("hex")) + \ + " Expected: " + repr(data) + \ + " on " + cname) ############### ##### DES ##### From owner-svn-src-all@freebsd.org Thu May 23 22:01:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34FA215B72A7; Thu, 23 May 2019 22:01:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE65C8AD33; Thu, 23 May 2019 22:01:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A81DFB3A1; Thu, 23 May 2019 22:01:05 +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 x4NM15D1079227; Thu, 23 May 2019 22:01:05 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NM15Af079226; Thu, 23 May 2019 22:01:05 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905232201.x4NM15Af079226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 23 May 2019 22:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348204 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE65C8AD33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:01:06 -0000 Author: jkim Date: Thu May 23 22:01:05 2019 New Revision: 348204 URL: https://svnweb.freebsd.org/changeset/base/348204 Log: Remove yet another unused variable. Modified: head/stand/common/module.c Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Thu May 23 21:57:58 2019 (r348203) +++ head/stand/common/module.c Thu May 23 22:01:05 2019 (r348204) @@ -350,7 +350,6 @@ command_lsmod(int argc, char *argv[]) COMMAND_SET(pnpmatch, "pnpmatch", "list matched modules based on pnpinfo", command_pnpmatch); -static int pnp_all_flag = 0; static int pnp_dump_flag = 0; static int pnp_unbound_flag = 0; static int pnp_verbose_flag = 0; From owner-svn-src-all@freebsd.org Thu May 23 22:06:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CE115B76F4; Thu, 23 May 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 391FD8B8F4; Thu, 23 May 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F8CCB53B; Thu, 23 May 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4NM6v3I085247; Thu, 23 May 2019 22:06:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NM6vQt085245; Thu, 23 May 2019 22:06:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232206.x4NM6vQt085245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 22:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348205 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 348205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 391FD8B8F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:06:58 -0000 Author: jhb Date: Thu May 23 22:06:57 2019 New Revision: 348205 URL: https://svnweb.freebsd.org/changeset/base/348205 Log: Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. All of these algorithms are either explicitly marked MUST NOT, or they are implicitly MUST NOTs by virtue of not being included in IETF's list of protocols at all despite having assignments from IANA. Specifically, this adds warnings for the following ciphers: - des-cbc - blowfish-cbc - cast128-cbc - des-deriv - des-32iv - camellia-cbc Warnings for the following authentication algorithms are also added: - hmac-md5 - keyed-md5 - keyed-sha1 - hmac-ripemd160 Reviewed by: cem, gnn MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20340 Modified: head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Thu May 23 22:01:05 2019 (r348204) +++ head/sys/netipsec/xform_ah.c Thu May 23 22:06:57 2019 (r348205) @@ -108,6 +108,8 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_ah, IPSECCTL_STATS, sta #endif static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */ +static struct timeval md5warn, ripewarn, kpdkmd5warn, kpdksha1warn; +static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; static int ah_input_cb(struct cryptop*); static int ah_output_cb(struct cryptop*); @@ -184,6 +186,26 @@ ah_init0(struct secasvar *sav, struct xformsw *xsp, st __func__, sav->alg_auth)); return EINVAL; } + + switch (sav->alg_auth) { + case SADB_AALG_MD5HMAC: + if (ratecheck(&md5warn, &warninterval)) + gone_in(13, "MD5-HMAC authenticator for IPsec"); + break; + case SADB_X_AALG_RIPEMD160HMAC: + if (ratecheck(&ripewarn, &warninterval)) + gone_in(13, "RIPEMD160-HMAC authenticator for IPsec"); + break; + case SADB_X_AALG_MD5: + if (ratecheck(&kpdkmd5warn, &warninterval)) + gone_in(13, "Keyed-MD5 authenticator for IPsec"); + break; + case SADB_X_AALG_SHA: + if (ratecheck(&kpdksha1warn, &warninterval)) + gone_in(13, "Keyed-SHA1 authenticator for IPsec"); + break; + } + /* * Verify the replay state block allocation is consistent with * the protocol type. We check here so we can make assumptions Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Thu May 23 22:01:05 2019 (r348204) +++ head/sys/netipsec/xform_esp.c Thu May 23 22:06:57 2019 (r348205) @@ -94,6 +94,9 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_esp, IPSECCTL_STATS, st struct espstat, espstat, "ESP statistics (struct espstat, netipsec/esp_var.h"); +static struct timeval deswarn, blfwarn, castwarn, camelliawarn; +static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; + static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); @@ -156,6 +159,26 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) __func__)); return EINVAL; } + + switch (sav->alg_enc) { + case SADB_EALG_DESCBC: + if (ratecheck(&deswarn, &warninterval)) + gone_in(13, "DES cipher for IPsec"); + break; + case SADB_X_EALG_BLOWFISHCBC: + if (ratecheck(&blfwarn, &warninterval)) + gone_in(13, "Blowfish cipher for IPsec"); + break; + case SADB_X_EALG_CAST128CBC: + if (ratecheck(&castwarn, &warninterval)) + gone_in(13, "CAST cipher for IPsec"); + break; + case SADB_X_EALG_CAMELLIACBC: + if (ratecheck(&camelliawarn, &warninterval)) + gone_in(13, "Camellia cipher for IPsec"); + break; + } + /* subtract off the salt, RFC4106, 8.1 and RFC3686, 5.1 */ keylen = _KEYLEN(sav->key_enc) - SAV_ISCTRORGCM(sav) * 4; if (txform->minkey > keylen || keylen > txform->maxkey) { From owner-svn-src-all@freebsd.org Thu May 23 22:08:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3466615B782E; Thu, 23 May 2019 22:08:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D086C8BCCB; Thu, 23 May 2019 22:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2FA90801; Thu, 23 May 2019 22:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348185 - in head: . etc lib/libc/gen usr.sbin/etcupdate usr.sbin/mergemaster To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905231837.x4NIb5Jj069036@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <9315313a-6a35-05b9-d319-f48eb9ba8088@FreeBSD.org> Date: Thu, 23 May 2019 15:08:31 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905231837.x4NIb5Jj069036@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D086C8BCCB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:08:36 -0000 On 5/23/19 11:37 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Thu May 23 18:37:05 2019 > New Revision: 348185 > URL: https://svnweb.freebsd.org/changeset/base/348185 > > Log: > Move back group, master.passwd and shells to etc directory > > Use the .PATH mechanism instead so keep installing them from lib/libc/gen > > While here revert 347961 and 347893 which are no longer needed > > Discussed with: manu > Tested by: manu > ok manu@ Thank you. -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 23 22:10:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BFB15B79A2; Thu, 23 May 2019 22:10:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E4158C138; Thu, 23 May 2019 22:10:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 9847F802; Thu, 23 May 2019 22:10:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348205 - head/sys/netipsec From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905232206.x4NM6vQt085245@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <7e3ef228-f9a7-5bd5-1826-5408eb368a71@FreeBSD.org> Date: Thu, 23 May 2019 15:10:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905232206.x4NM6vQt085245@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2E4158C138 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:10:44 -0000 On 5/23/19 3:06 PM, John Baldwin wrote: > Author: jhb > Date: Thu May 23 22:06:57 2019 > New Revision: 348205 > URL: https://svnweb.freebsd.org/changeset/base/348205 > > Log: > Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. > > All of these algorithms are either explicitly marked MUST NOT, or they > are implicitly MUST NOTs by virtue of not being included in IETF's > list of protocols at all despite having assignments from IANA. > > Specifically, this adds warnings for the following ciphers: > - des-cbc > - blowfish-cbc > - cast128-cbc > - des-deriv > - des-32iv > - camellia-cbc > > Warnings for the following authentication algorithms are also added: > - hmac-md5 > - keyed-md5 > - keyed-sha1 > - hmac-ripemd160 > > Reviewed by: cem, gnn > MFC after: 3 days > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D20340 The quick turnaround time is so that these warnings can be MFC'd. I will wait a while to see how that fairs before pulling the plug on removing actual functionality in head. -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 23 22:31:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2415C15B8038; Thu, 23 May 2019 22:31:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C05BE8D5A8; Thu, 23 May 2019 22:31:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0019B93F; Thu, 23 May 2019 22:31:56 +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 x4NMVue4098830; Thu, 23 May 2019 22:31:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NMVuM1098826; Thu, 23 May 2019 22:31:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232231.x4NMVuM1098826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 22:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348206 - in head: lib/geom/eli sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/geom/eli sys/geom/eli X-SVN-Commit-Revision: 348206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C05BE8D5A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:31:57 -0000 Author: jhb Date: Thu May 23 22:31:55 2019 New Revision: 348206 URL: https://svnweb.freebsd.org/changeset/base/348206 Log: Add deprecation warnings for weaker algorithms to geli(4). - Triple DES has been formally deprecated in Kerberos (RFC 8429) and is soon to be deprecated in IPsec (RFC 8221). - Blowfish is deprecated. FreeBSD doesn't support its successor (Twofish). - MD5 is generally considered a weak digest that has known attacks. geli refuses to create new volumes using these algorithms via 'geli init'. It also warns when attaching to existing volumes or creating temporary volumes via 'geli onetime' . The plan is to fully remove support for these algorithms in FreeBSD 13. Note that none of these algorithms have ever been the default algorithm used by geli(8). Users would have had to explicitly select these algorithms when creating volumes in the past. Reviewed by: cem, delphij MFC after: 3 days Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20344 Modified: head/lib/geom/eli/geli.8 head/lib/geom/eli/geom_eli.c head/sys/geom/eli/g_eli.c Modified: head/lib/geom/eli/geli.8 ============================================================================== --- head/lib/geom/eli/geli.8 Thu May 23 22:06:57 2019 (r348205) +++ head/lib/geom/eli/geli.8 Thu May 23 22:31:55 2019 (r348206) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2019 +.Dd May 23, 2019 .Dt GELI 8 .Os .Sh NAME @@ -901,6 +901,18 @@ specified in .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. +.Sh DEPRECATION NOTICE +Support for the +.Nm Blowfish-CBC +and +.Nm 3DES-CBC +cryptographic algorithms and +.Nm HMAC/MD5 +authentication algorithm will be removed in +.Fx 13.0 . +New volumes cannot be created using these algorithms. +Existing volumes should be migrated to a new volume that uses +non-deprecated algorithms. .Sh EXAMPLES Initialize a provider which is going to be encrypted with a passphrase and random data from a file on the user's pen drive. @@ -1134,7 +1146,7 @@ utility appeared in .Fx 6.0 . Support for the .Nm Camellia -block cipher is implemented by Yoshisato Yanagisawa in +block cipher was implemented by Yoshisato Yanagisawa in .Fx 7.0 . .Pp Highest Modified: head/lib/geom/eli/geom_eli.c ============================================================================== --- head/lib/geom/eli/geom_eli.c Thu May 23 22:06:57 2019 (r348205) +++ head/lib/geom/eli/geom_eli.c Thu May 23 22:31:55 2019 (r348206) @@ -805,6 +805,22 @@ eli_init(struct gctl_req *req) return; } } + if (md.md_flags & G_ELI_FLAG_AUTH) { + switch (md.md_aalgo) { + case CRYPTO_MD5_HMAC: + gctl_error(req, + "The %s authentication algorithm is deprecated.", + g_eli_algo2str(md.md_aalgo)); + return; + } + } + switch (md.md_ealgo) { + case CRYPTO_3DES_CBC: + case CRYPTO_BLF_CBC: + gctl_error(req, "The %s encryption algorithm is deprecated.", + g_eli_algo2str(md.md_aalgo)); + return; + } val = gctl_get_intmax(req, "keylen"); md.md_keylen = val; md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen); Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu May 23 22:06:57 2019 (r348205) +++ head/sys/geom/eli/g_eli.c Thu May 23 22:31:55 2019 (r348206) @@ -960,8 +960,25 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, G_ELI_DEBUG(0, "Device %s created.", pp->name); G_ELI_DEBUG(0, "Encryption: %s %u", g_eli_algo2str(sc->sc_ealgo), sc->sc_ekeylen); - if (sc->sc_flags & G_ELI_FLAG_AUTH) + switch (sc->sc_ealgo) { + case CRYPTO_3DES_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with 3des"); + break; + case CRYPTO_BLF_CBC: + gone_in(13, + "support for GEOM_ELI volumes encrypted with blowfish"); + break; + } + if (sc->sc_flags & G_ELI_FLAG_AUTH) { G_ELI_DEBUG(0, " Integrity: %s", g_eli_algo2str(sc->sc_aalgo)); + switch (sc->sc_aalgo) { + case CRYPTO_MD5_HMAC: + gone_in(13, + "support for GEOM_ELI volumes authenticated with hmac/md5"); + break; + } + } G_ELI_DEBUG(0, " Crypto: %s", sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); From owner-svn-src-all@freebsd.org Thu May 23 22:49:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75E0015B85CF; Thu, 23 May 2019 22:49:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18E748DC56; Thu, 23 May 2019 22:49:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E49C4BE01; Thu, 23 May 2019 22:49:03 +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 x4NMn3Kc008276; Thu, 23 May 2019 22:49:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NMn3Zp008275; Thu, 23 May 2019 22:49:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905232249.x4NMn3Zp008275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 23 May 2019 22:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348207 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18E748DC56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 22:49:04 -0000 Author: jkim Date: Thu May 23 22:49:03 2019 New Revision: 348207 URL: https://svnweb.freebsd.org/changeset/base/348207 Log: Initialize a variable to fix build with GCC. Modified: head/stand/common/module.c Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Thu May 23 22:31:55 2019 (r348206) +++ head/stand/common/module.c Thu May 23 22:49:03 2019 (r348207) @@ -440,7 +440,7 @@ pnpautoload_simplebus(void) { const char *pnpstring; const char *compatstr; char *pnpinfo = NULL; - char *module; + char *module = NULL; int tag = 0, len, pnplen; int error; From owner-svn-src-all@freebsd.org Thu May 23 23:37:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF0015B92B1; Thu, 23 May 2019 23:37:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDFF8F6AB; Thu, 23 May 2019 23:37:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28CFBC656; Thu, 23 May 2019 23:37:12 +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 x4NNbC7u035098; Thu, 23 May 2019 23:37:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4NNbBQ5035096; Thu, 23 May 2019 23:37:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905232337.x4NNbBQ5035096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 May 2019 23:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348210 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/include X-SVN-Commit-Revision: 348210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDFF8F6AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2019 23:37:13 -0000 Author: jhb Date: Thu May 23 23:37:11 2019 New Revision: 348210 URL: https://svnweb.freebsd.org/changeset/base/348210 Log: Add a constant for the LS config MSR on AMD CPUs. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19506 Modified: head/sys/amd64/amd64/initcpu.c head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu May 23 23:06:26 2019 (r348209) +++ head/sys/amd64/amd64/initcpu.c Thu May 23 23:37:11 2019 (r348210) @@ -124,9 +124,9 @@ init_amd(void) */ if (CPUID_TO_FAMILY(cpu_id) == 0x16 && CPUID_TO_MODEL(cpu_id) <= 0xf) { if ((cpu_feature2 & CPUID2_HV) == 0) { - msr = rdmsr(0xc0011020); + msr = rdmsr(MSR_LS_CFG); msr |= (uint64_t)1 << 15; - wrmsr(0xc0011020, msr); + wrmsr(MSR_LS_CFG, msr); } } @@ -139,9 +139,9 @@ init_amd(void) wrmsr(0xc0011029, msr); /* 1033 */ - msr = rdmsr(0xc0011020); + msr = rdmsr(MSR_LS_CFG); msr |= 0x10; - wrmsr(0xc0011020, msr); + wrmsr(MSR_LS_CFG, msr); /* 1049 */ msr = rdmsr(0xc0011028); @@ -149,9 +149,9 @@ init_amd(void) wrmsr(0xc0011028, msr); /* 1095 */ - msr = rdmsr(0xc0011020); + msr = rdmsr(MSR_LS_CFG); msr |= 0x200000000000000; - wrmsr(0xc0011020, msr); + wrmsr(MSR_LS_CFG, msr); } /* Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu May 23 23:06:26 2019 (r348209) +++ head/sys/x86/include/specialreg.h Thu May 23 23:37:11 2019 (r348210) @@ -1098,6 +1098,7 @@ #define MSR_VM_HSAVE_PA 0xc0010117 /* SVM: host save area address */ #define MSR_AMD_CPUID07 0xc0011002 /* CPUID 07 %ebx override */ #define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ +#define MSR_LS_CFG 0xc0011020 #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ /* MSR_VM_CR related */ From owner-svn-src-all@freebsd.org Fri May 24 00:00:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BFDF15B9BAA; Fri, 24 May 2019 00:00:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0DBC69A86; Fri, 24 May 2019 00:00:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA0F9CA58; Fri, 24 May 2019 00:00:29 +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 x4O00TDv046334; Fri, 24 May 2019 00:00:29 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O00T9h046333; Fri, 24 May 2019 00:00:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905240000.x4O00T9h046333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 24 May 2019 00:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348211 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 348211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0DBC69A86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:00:30 -0000 Author: gjb Date: Fri May 24 00:00:29 2019 New Revision: 348211 URL: https://svnweb.freebsd.org/changeset/base/348211 Log: Update stable/11 to BETA1 as part of the 11.3-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu May 23 23:37:11 2019 (r348210) +++ stable/11/sys/conf/newvers.sh Fri May 24 00:00:29 2019 (r348211) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="PRERELEASE" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 24 00:34:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F2C158FBB5; Fri, 24 May 2019 00:34:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC936B24A; Fri, 24 May 2019 00:34:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A787D129; Fri, 24 May 2019 00:34:14 +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 x4O0YDai067415; Fri, 24 May 2019 00:34:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O0YD5B067410; Fri, 24 May 2019 00:34:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905240034.x4O0YD5B067410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 May 2019 00:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348212 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DC936B24A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:34:14 -0000 Author: jhb Date: Fri May 24 00:34:13 2019 New Revision: 348212 URL: https://svnweb.freebsd.org/changeset/base/348212 Log: Add support for writing to guest memory in the debug server. - Add a write_mem counterpart to read_mem to handle writes to MMIO. - Add support for the GDB 'M' packet to write bytes to the guest's memory. For MMIO writes, attempt to batch writes up into words. This is imprecise, but if you write a single 2 or 4-byte aligned word, it should be treated as a single MMIO write operation. - While here, tidy up the parsing of the 'm' command used for reading memory to match 'M'. Reviewed by: markj, Scott Phillips MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20307 Modified: head/usr.sbin/bhyve/gdb.c head/usr.sbin/bhyve/mem.c head/usr.sbin/bhyve/mem.h Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Fri May 24 00:00:29 2019 (r348211) +++ head/usr.sbin/bhyve/gdb.c Fri May 24 00:34:13 2019 (r348212) @@ -767,15 +767,24 @@ gdb_read_mem(const uint8_t *data, size_t len) bool started; int error; + /* Skip 'm' */ + data += 1; + len -= 1; + + /* Parse and consume address. */ cp = memchr(data, ',', len); - if (cp == NULL) { + if (cp == NULL || cp == data) { send_error(EINVAL); return; } - gva = parse_integer(data + 1, cp - (data + 1)); - resid = parse_integer(cp + 1, len - (cp + 1 - data)); - started = false; + gva = parse_integer(data, cp - data); + len -= (cp - data) + 1; + data += (cp - data) + 1; + /* Parse length. */ + resid = parse_integer(data, len); + + started = false; while (resid > 0) { error = guest_vaddr2paddr(cur_vcpu, gva, &gpa); if (error == -1) { @@ -861,6 +870,119 @@ gdb_read_mem(const uint8_t *data, size_t len) finish_packet(); } +static void +gdb_write_mem(const uint8_t *data, size_t len) +{ + uint64_t gpa, gva, val; + uint8_t *cp; + size_t resid, todo, bytes; + int error; + + /* Skip 'M' */ + data += 1; + len -= 1; + + /* Parse and consume address. */ + cp = memchr(data, ',', len); + if (cp == NULL || cp == data) { + send_error(EINVAL); + return; + } + gva = parse_integer(data, cp - data); + len -= (cp - data) + 1; + data += (cp - data) + 1; + + /* Parse and consume length. */ + cp = memchr(data, ':', len); + if (cp == NULL || cp == data) { + send_error(EINVAL); + return; + } + resid = parse_integer(data, cp - data); + len -= (cp - data) + 1; + data += (cp - data) + 1; + + /* Verify the available bytes match the length. */ + if (len != resid * 2) { + send_error(EINVAL); + return; + } + + while (resid > 0) { + error = guest_vaddr2paddr(cur_vcpu, gva, &gpa); + if (error == -1) { + send_error(errno); + return; + } + if (error == 0) { + send_error(EFAULT); + return; + } + + /* Write bytes to current page. */ + todo = getpagesize() - gpa % getpagesize(); + if (todo > resid) + todo = resid; + + cp = paddr_guest2host(ctx, gpa, todo); + if (cp != NULL) { + /* + * If this page is guest RAM, write it a byte + * at a time. + */ + while (todo > 0) { + assert(len >= 2); + *cp = parse_byte(data); + data += 2; + len -= 2; + cp++; + gpa++; + gva++; + resid--; + todo--; + } + } else { + /* + * If this page isn't guest RAM, try to handle + * it via MMIO. For MMIO requests, use + * aligned writes of words when possible. + */ + while (todo > 0) { + if (gpa & 1 || todo == 1) { + bytes = 1; + val = parse_byte(data); + } else if (gpa & 2 || todo == 2) { + bytes = 2; + val = parse_byte(data) | + (parse_byte(data + 2) << 8); + } else { + bytes = 4; + val = parse_byte(data) | + (parse_byte(data + 2) << 8) | + (parse_byte(data + 4) << 16) | + (parse_byte(data + 6) << 24); + } + error = write_mem(ctx, cur_vcpu, gpa, val, + bytes); + if (error == 0) { + gpa += bytes; + gva += bytes; + resid -= bytes; + todo -= bytes; + data += 2 * bytes; + len -= 2 * bytes; + } else { + send_error(EFAULT); + return; + } + } + } + assert(resid == 0 || gpa % getpagesize() == 0); + } + assert(len == 0); + send_ok(); +} + static bool command_equals(const uint8_t *data, size_t len, const char *cmd) { @@ -1000,6 +1122,9 @@ handle_command(const uint8_t *data, size_t len) case 'm': gdb_read_mem(data, len); break; + case 'M': + gdb_write_mem(data, len); + break; case 'T': { int tid; @@ -1035,7 +1160,6 @@ handle_command(const uint8_t *data, size_t len) finish_packet(); break; case 'G': /* TODO */ - case 'M': /* TODO */ case 'v': /* Handle 'vCont' */ /* 'vCtrlC' */ Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Fri May 24 00:00:29 2019 (r348211) +++ head/usr.sbin/bhyve/mem.c Fri May 24 00:34:13 2019 (r348212) @@ -251,30 +251,43 @@ emulate_mem(struct vmctx *ctx, int vcpu, uint64_t padd return (access_memory(ctx, vcpu, paddr, emulate_mem_cb, &ema)); } -struct read_mem_args { - uint64_t *rval; +struct rw_mem_args { + uint64_t *val; int size; + int operation; }; static int -read_mem_cb(struct vmctx *ctx, int vcpu, uint64_t paddr, struct mem_range *mr, +rw_mem_cb(struct vmctx *ctx, int vcpu, uint64_t paddr, struct mem_range *mr, void *arg) { - struct read_mem_args *rma; + struct rw_mem_args *rma; rma = arg; - return (mr->handler(ctx, vcpu, MEM_F_READ, paddr, rma->size, - rma->rval, mr->arg1, mr->arg2)); + return (mr->handler(ctx, vcpu, rma->operation, paddr, rma->size, + rma->val, mr->arg1, mr->arg2)); } int read_mem(struct vmctx *ctx, int vcpu, uint64_t gpa, uint64_t *rval, int size) { - struct read_mem_args rma; + struct rw_mem_args rma; - rma.rval = rval; + rma.val = rval; rma.size = size; - return (access_memory(ctx, vcpu, gpa, read_mem_cb, &rma)); + rma.operation = MEM_F_READ; + return (access_memory(ctx, vcpu, gpa, rw_mem_cb, &rma)); +} + +int +write_mem(struct vmctx *ctx, int vcpu, uint64_t gpa, uint64_t wval, int size) +{ + struct rw_mem_args rma; + + rma.val = &wval; + rma.size = size; + rma.operation = MEM_F_WRITE; + return (access_memory(ctx, vcpu, gpa, rw_mem_cb, &rma)); } static int Modified: head/usr.sbin/bhyve/mem.h ============================================================================== --- head/usr.sbin/bhyve/mem.h Fri May 24 00:00:29 2019 (r348211) +++ head/usr.sbin/bhyve/mem.h Fri May 24 00:34:13 2019 (r348212) @@ -61,5 +61,7 @@ int read_mem(struct vmctx *ctx, int vcpu, uint64_t gpa int register_mem(struct mem_range *memp); int register_mem_fallback(struct mem_range *memp); int unregister_mem(struct mem_range *memp); +int write_mem(struct vmctx *ctx, int vcpu, uint64_t gpa, uint64_t wval, + int size); #endif /* _MEM_H_ */ From owner-svn-src-all@freebsd.org Fri May 24 00:44:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97D6615911F9; Fri, 24 May 2019 00:44:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A8246B7C8; Fri, 24 May 2019 00:44:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 193CAD2E2; Fri, 24 May 2019 00:44:32 +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 x4O0iVYe072856; Fri, 24 May 2019 00:44:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O0iVsV072853; Fri, 24 May 2019 00:44:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905240044.x4O0iVsV072853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 May 2019 00:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348213 - in stable/12/sys/dev/cxgbe: crypto tom X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: crypto tom X-SVN-Commit-Revision: 348213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A8246B7C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:44:32 -0000 Author: jhb Date: Fri May 24 00:44:31 2019 New Revision: 348213 URL: https://svnweb.freebsd.org/changeset/base/348213 Log: MFC 340486: Consolidate on a single set of constants for SCMD fields. Both ccr(4) and the TOE TLS code had separate sets of constants for fields in SCMD messages. Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c stable/12/sys/dev/cxgbe/crypto/t4_crypto.h stable/12/sys/dev/cxgbe/tom/t4_tls.c stable/12/sys/dev/cxgbe/tom/t4_tls.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Fri May 24 00:34:13 2019 (r348212) +++ stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Fri May 24 00:44:31 2019 (r348213) @@ -444,10 +444,10 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, if (s->mode == HMAC) { use_opad = 1; - hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; + hmac_ctrl = SCMD_HMAC_CTRL_NO_TRUNC; } else { use_opad = 0; - hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; + hmac_ctrl = SCMD_HMAC_CTRL_NOP; } /* PADs must be 128-bit aligned. */ @@ -513,8 +513,8 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | - V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_NOP) | V_SCMD_AUTH_MODE(s->hmac.auth_mode) | V_SCMD_HMAC_CTRL(hmac_ctrl)); crwr->sec_cpl.ivgen_hdrlen = htobe32( @@ -683,11 +683,11 @@ ccr_blkcipher(struct ccr_softc *sc, struct ccr_session /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | - V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_NOP) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NOP) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_NOP) | + V_SCMD_HMAC_CTRL(SCMD_HMAC_CTRL_NOP) | V_SCMD_IV_SIZE(s->blkcipher.iv_len / 2) | V_SCMD_NUM_IVS(0)); crwr->sec_cpl.ivgen_hdrlen = htobe32( @@ -761,12 +761,12 @@ ccr_hmac_ctrl(unsigned int hashsize, unsigned int auth { if (authsize == 10) - return (CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366); + return (SCMD_HMAC_CTRL_TRUNC_RFC4366); if (authsize == 12) - return (CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT); + return (SCMD_HMAC_CTRL_IPSEC_96BIT); if (authsize == hashsize / 2) - return (CHCR_SCMD_HMAC_CTRL_DIV2); - return (CHCR_SCMD_HMAC_CTRL_NO_TRUNC); + return (SCMD_HMAC_CTRL_DIV2); + return (SCMD_HMAC_CTRL_NO_TRUNC); } static int @@ -1019,7 +1019,7 @@ ccr_authenc(struct ccr_softc *sc, struct ccr_session * hmac_ctrl = ccr_hmac_ctrl(axf->hashsize, hash_size_in_response); crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_AUTH_SEQ_CTRL(op_type == CHCR_ENCRYPT_OP ? 1 : 0) | V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | @@ -1362,11 +1362,11 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, s hmac_ctrl = ccr_hmac_ctrl(AES_GMAC_HASH_LEN, hash_size_in_response); crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | - V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | V_SCMD_ENC_DEC_CTRL(op_type) | V_SCMD_CIPH_AUTH_SEQ_CTRL(op_type == CHCR_ENCRYPT_OP ? 1 : 0) | - V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_AES_GCM) | - V_SCMD_AUTH_MODE(CHCR_SCMD_AUTH_MODE_GHASH) | + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_AES_GCM) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_GHASH) | V_SCMD_HMAC_CTRL(hmac_ctrl) | V_SCMD_IV_SIZE(iv_len / 2) | V_SCMD_NUM_IVS(0)); @@ -1928,8 +1928,8 @@ ccr_newsession(device_t dev, crypto_session_t cses, st cipher = NULL; hash = NULL; auth_hash = NULL; - auth_mode = CHCR_SCMD_AUTH_MODE_NOP; - cipher_mode = CHCR_SCMD_CIPHER_MODE_NOP; + auth_mode = SCMD_AUTH_MODE_NOP; + cipher_mode = SCMD_CIPH_MODE_NOP; iv_len = 0; mk_size = 0; partial_digest_len = 0; @@ -1955,35 +1955,35 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: auth_hash = &auth_hash_hmac_sha1; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; + auth_mode = SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; break; case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: auth_hash = &auth_hash_hmac_sha2_224; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; + auth_mode = SCMD_AUTH_MODE_SHA224; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA256; + auth_mode = SCMD_AUTH_MODE_SHA256; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: auth_hash = &auth_hash_hmac_sha2_384; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_384; + auth_mode = SCMD_AUTH_MODE_SHA512_384; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: auth_hash = &auth_hash_hmac_sha2_512; - auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_512; + auth_mode = SCMD_AUTH_MODE_SHA512_512; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; @@ -1991,7 +1991,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: gcm_hash = true; - auth_mode = CHCR_SCMD_AUTH_MODE_GHASH; + auth_mode = SCMD_AUTH_MODE_GHASH; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; break; } @@ -2014,19 +2014,19 @@ ccr_newsession(device_t dev, crypto_session_t cses, st cipher = c; switch (c->cri_alg) { case CRYPTO_AES_CBC: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_CBC; + cipher_mode = SCMD_CIPH_MODE_AES_CBC; iv_len = AES_BLOCK_LEN; break; case CRYPTO_AES_ICM: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_CTR; + cipher_mode = SCMD_CIPH_MODE_AES_CTR; iv_len = AES_BLOCK_LEN; break; case CRYPTO_AES_NIST_GCM_16: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_GCM; + cipher_mode = SCMD_CIPH_MODE_AES_GCM; iv_len = AES_GCM_IV_LEN; break; case CRYPTO_AES_XTS: - cipher_mode = CHCR_SCMD_CIPHER_MODE_AES_XTS; + cipher_mode = SCMD_CIPH_MODE_AES_XTS; iv_len = AES_BLOCK_LEN; break; } @@ -2041,7 +2041,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); } } - if (gcm_hash != (cipher_mode == CHCR_SCMD_CIPHER_MODE_AES_GCM)) + if (gcm_hash != (cipher_mode == SCMD_CIPH_MODE_AES_GCM)) return (EINVAL); if (hash == NULL && cipher == NULL) return (EINVAL); Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.h ============================================================================== --- stable/12/sys/dev/cxgbe/crypto/t4_crypto.h Fri May 24 00:34:13 2019 (r348212) +++ stable/12/sys/dev/cxgbe/crypto/t4_crypto.h Fri May 24 00:44:31 2019 (r348213) @@ -132,36 +132,41 @@ struct phys_sge_pairs { #define CHCR_ENCRYPT_OP 0 #define CHCR_DECRYPT_OP 1 -#define CHCR_SCMD_PROTO_VERSION_GENERIC 4 +#define SCMD_ENCDECCTRL_ENCRYPT 0 +#define SCMD_ENCDECCTRL_DECRYPT 1 -#define CHCR_SCMD_CIPHER_MODE_NOP 0 -#define CHCR_SCMD_CIPHER_MODE_AES_CBC 1 -#define CHCR_SCMD_CIPHER_MODE_AES_GCM 2 -#define CHCR_SCMD_CIPHER_MODE_AES_CTR 3 -#define CHCR_SCMD_CIPHER_MODE_GENERIC_AES 4 -#define CHCR_SCMD_CIPHER_MODE_AES_XTS 6 -#define CHCR_SCMD_CIPHER_MODE_AES_CCM 7 +#define SCMD_PROTO_VERSION_TLS_1_2 0 +#define SCMD_PROTO_VERSION_TLS_1_1 1 +#define SCMD_PROTO_VERSION_GENERIC 4 -#define CHCR_SCMD_AUTH_MODE_NOP 0 -#define CHCR_SCMD_AUTH_MODE_SHA1 1 -#define CHCR_SCMD_AUTH_MODE_SHA224 2 -#define CHCR_SCMD_AUTH_MODE_SHA256 3 -#define CHCR_SCMD_AUTH_MODE_GHASH 4 -#define CHCR_SCMD_AUTH_MODE_SHA512_224 5 -#define CHCR_SCMD_AUTH_MODE_SHA512_256 6 -#define CHCR_SCMD_AUTH_MODE_SHA512_384 7 -#define CHCR_SCMD_AUTH_MODE_SHA512_512 8 -#define CHCR_SCMD_AUTH_MODE_CBCMAC 9 -#define CHCR_SCMD_AUTH_MODE_CMAC 10 +#define SCMD_CIPH_MODE_NOP 0 +#define SCMD_CIPH_MODE_AES_CBC 1 +#define SCMD_CIPH_MODE_AES_GCM 2 +#define SCMD_CIPH_MODE_AES_CTR 3 +#define SCMD_CIPH_MODE_GENERIC_AES 4 +#define SCMD_CIPH_MODE_AES_XTS 6 +#define SCMD_CIPH_MODE_AES_CCM 7 -#define CHCR_SCMD_HMAC_CTRL_NOP 0 -#define CHCR_SCMD_HMAC_CTRL_NO_TRUNC 1 -#define CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366 2 -#define CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT 3 -#define CHCR_SCMD_HMAC_CTRL_PL1 4 -#define CHCR_SCMD_HMAC_CTRL_PL2 5 -#define CHCR_SCMD_HMAC_CTRL_PL3 6 -#define CHCR_SCMD_HMAC_CTRL_DIV2 7 +#define SCMD_AUTH_MODE_NOP 0 +#define SCMD_AUTH_MODE_SHA1 1 +#define SCMD_AUTH_MODE_SHA224 2 +#define SCMD_AUTH_MODE_SHA256 3 +#define SCMD_AUTH_MODE_GHASH 4 +#define SCMD_AUTH_MODE_SHA512_224 5 +#define SCMD_AUTH_MODE_SHA512_256 6 +#define SCMD_AUTH_MODE_SHA512_384 7 +#define SCMD_AUTH_MODE_SHA512_512 8 +#define SCMD_AUTH_MODE_CBCMAC 9 +#define SCMD_AUTH_MODE_CMAC 10 + +#define SCMD_HMAC_CTRL_NOP 0 +#define SCMD_HMAC_CTRL_NO_TRUNC 1 +#define SCMD_HMAC_CTRL_TRUNC_RFC4366 2 +#define SCMD_HMAC_CTRL_IPSEC_96BIT 3 +#define SCMD_HMAC_CTRL_PL1 4 +#define SCMD_HMAC_CTRL_PL2 5 +#define SCMD_HMAC_CTRL_PL3 6 +#define SCMD_HMAC_CTRL_DIV2 7 /* This are not really mac key size. They are intermediate values * of sha engine and its size Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.c Fri May 24 00:34:13 2019 (r348212) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.c Fri May 24 00:44:31 2019 (r348213) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include "common/common.h" #include "common/t4_tcb.h" +#include "crypto/t4_crypto.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.h ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.h Fri May 24 00:34:13 2019 (r348212) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.h Fri May 24 00:44:31 2019 (r348213) @@ -249,16 +249,6 @@ enum { CH_MK_SIZE_NOP, }; -#define SCMD_ENCDECCTRL_ENCRYPT 0 -#define SCMD_ENCDECCTRL_DECRYPT 1 - -#define SCMD_CIPH_MODE_NOP 0 -#define SCMD_CIPH_MODE_AES_CBC 1 -#define SCMD_CIPH_MODE_AES_GCM 2 -#define SCMD_CIPH_MODE_AES_CTR 3 -#define SCMD_CIPH_MODE_AES_GEN 4 -#define SCMD_CIPH_MODE_AES_CCM 7 - struct tls_scmd { __be32 seqno_numivs; __be32 ivgen_hdrlen; From owner-svn-src-all@freebsd.org Fri May 24 00:51:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 859171591324; Fri, 24 May 2019 00:51:31 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 DAD946BB47; Fri, 24 May 2019 00:51:30 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4O0pS8s093117; Thu, 23 May 2019 17:51:28 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4O0pSI3093116; Thu, 23 May 2019 17:51:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905240051.x4O0pSI3093116@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348205 - head/sys/netipsec In-Reply-To: <201905232206.x4NM6vQt085245@repo.freebsd.org> To: John Baldwin Date: Thu, 23 May 2019 17:51:28 -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-Rspamd-Queue-Id: DAD946BB47 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:51:31 -0000 > Author: jhb > Date: Thu May 23 22:06:57 2019 > New Revision: 348205 > URL: https://svnweb.freebsd.org/changeset/base/348205 > > Log: > Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. > > All of these algorithms are either explicitly marked MUST NOT, or they > are implicitly MUST NOTs by virtue of not being included in IETF's > list of protocols at all despite having assignments from IANA. Can you provide me these specific ones and I'll investigate the Ietf datatracker and IANA documents and see if I can get the long story. Ie what IANA assignments are you refering to that do not appear in RFC, it may simply be the case there is a final RFC that says "new foo are assigned numbers by IANA and no RFC is needed" That is how port numbers and other such things just are, there is not a RFC for everything! > Specifically, this adds warnings for the following ciphers: > - des-cbc > - blowfish-cbc > - cast128-cbc > - des-deriv > - des-32iv > - camellia-cbc > > Warnings for the following authentication algorithms are also added: > - hmac-md5 > - keyed-md5 > - keyed-sha1 > - hmac-ripemd160 > > Reviewed by: cem, gnn > MFC after: 3 days > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D20340 > > Modified: > head/sys/netipsec/xform_ah.c > head/sys/netipsec/xform_esp.c > > Modified: head/sys/netipsec/xform_ah.c > ============================================================================== > --- head/sys/netipsec/xform_ah.c Thu May 23 22:01:05 2019 (r348204) > +++ head/sys/netipsec/xform_ah.c Thu May 23 22:06:57 2019 (r348205) > @@ -108,6 +108,8 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_ah, IPSECCTL_STATS, sta > #endif > > static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */ > +static struct timeval md5warn, ripewarn, kpdkmd5warn, kpdksha1warn; > +static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; > > static int ah_input_cb(struct cryptop*); > static int ah_output_cb(struct cryptop*); > @@ -184,6 +186,26 @@ ah_init0(struct secasvar *sav, struct xformsw *xsp, st > __func__, sav->alg_auth)); > return EINVAL; > } > + > + switch (sav->alg_auth) { > + case SADB_AALG_MD5HMAC: > + if (ratecheck(&md5warn, &warninterval)) > + gone_in(13, "MD5-HMAC authenticator for IPsec"); > + break; > + case SADB_X_AALG_RIPEMD160HMAC: > + if (ratecheck(&ripewarn, &warninterval)) > + gone_in(13, "RIPEMD160-HMAC authenticator for IPsec"); > + break; > + case SADB_X_AALG_MD5: > + if (ratecheck(&kpdkmd5warn, &warninterval)) > + gone_in(13, "Keyed-MD5 authenticator for IPsec"); > + break; > + case SADB_X_AALG_SHA: > + if (ratecheck(&kpdksha1warn, &warninterval)) > + gone_in(13, "Keyed-SHA1 authenticator for IPsec"); > + break; > + } > + > /* > * Verify the replay state block allocation is consistent with > * the protocol type. We check here so we can make assumptions > > Modified: head/sys/netipsec/xform_esp.c > ============================================================================== > --- head/sys/netipsec/xform_esp.c Thu May 23 22:01:05 2019 (r348204) > +++ head/sys/netipsec/xform_esp.c Thu May 23 22:06:57 2019 (r348205) > @@ -94,6 +94,9 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_esp, IPSECCTL_STATS, st > struct espstat, espstat, > "ESP statistics (struct espstat, netipsec/esp_var.h"); > > +static struct timeval deswarn, blfwarn, castwarn, camelliawarn; > +static struct timeval warninterval = { .tv_sec = 1, .tv_usec = 0 }; > + > static int esp_input_cb(struct cryptop *op); > static int esp_output_cb(struct cryptop *crp); > > @@ -156,6 +159,26 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) > __func__)); > return EINVAL; > } > + > + switch (sav->alg_enc) { > + case SADB_EALG_DESCBC: > + if (ratecheck(&deswarn, &warninterval)) > + gone_in(13, "DES cipher for IPsec"); > + break; > + case SADB_X_EALG_BLOWFISHCBC: > + if (ratecheck(&blfwarn, &warninterval)) > + gone_in(13, "Blowfish cipher for IPsec"); > + break; > + case SADB_X_EALG_CAST128CBC: > + if (ratecheck(&castwarn, &warninterval)) > + gone_in(13, "CAST cipher for IPsec"); > + break; > + case SADB_X_EALG_CAMELLIACBC: > + if (ratecheck(&camelliawarn, &warninterval)) > + gone_in(13, "Camellia cipher for IPsec"); > + break; > + } > + > /* subtract off the salt, RFC4106, 8.1 and RFC3686, 5.1 */ > keylen = _KEYLEN(sav->key_enc) - SAV_ISCTRORGCM(sav) * 4; > if (txform->minkey > keylen || keylen > txform->maxkey) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 24 00:53:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B3521591573; Fri, 24 May 2019 00:53:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 BEE586BD7E; Fri, 24 May 2019 00:53:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4O0rF3W093134; Thu, 23 May 2019 17:53:15 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4O0rFxp093133; Thu, 23 May 2019 17:53:15 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905240053.x4O0rFxp093133@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348205 - head/sys/netipsec In-Reply-To: <7e3ef228-f9a7-5bd5-1826-5408eb368a71@FreeBSD.org> To: John Baldwin Date: Thu, 23 May 2019 17:53:15 -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-Rspamd-Queue-Id: BEE586BD7E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.975,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 00:53:18 -0000 > On 5/23/19 3:06 PM, John Baldwin wrote: > > Author: jhb > > Date: Thu May 23 22:06:57 2019 > > New Revision: 348205 > > URL: https://svnweb.freebsd.org/changeset/base/348205 > > > > Log: > > Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. > > > > All of these algorithms are either explicitly marked MUST NOT, or they > > are implicitly MUST NOTs by virtue of not being included in IETF's > > list of protocols at all despite having assignments from IANA. > > > > Specifically, this adds warnings for the following ciphers: > > - des-cbc > > - blowfish-cbc > > - cast128-cbc > > - des-deriv > > - des-32iv > > - camellia-cbc > > > > Warnings for the following authentication algorithms are also added: > > - hmac-md5 > > - keyed-md5 > > - keyed-sha1 > > - hmac-ripemd160 > > > > Reviewed by: cem, gnn > > MFC after: 3 days > > Sponsored by: Chelsio Communications > > Differential Revision: https://reviews.freebsd.org/D20340 > > The quick turnaround time is so that these warnings can be MFC'd. I will wait a > while to see how that fairs before pulling the plug on removing actual functionality > in head. Are you targeting this at 11.3, which if your not I would encourage you to do as the earlier on this type stuff the better. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 24 01:13:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BD11591DDE; Fri, 24 May 2019 01:13:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B7766C730; Fri, 24 May 2019 01:13:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E1BD1E90; Fri, 24 May 2019 01:13:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348205 - head/sys/netipsec To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905240051.x4O0pSI3093116@gndrsh.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <2ccc4dd0-19d4-981e-82cb-c6fcab355eda@FreeBSD.org> Date: Thu, 23 May 2019 18:12:59 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905240051.x4O0pSI3093116@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B7766C730 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:13:02 -0000 On 5/23/19 5:51 PM, Rodney W. Grimes wrote: >> Author: jhb >> Date: Thu May 23 22:06:57 2019 >> New Revision: 348205 >> URL: https://svnweb.freebsd.org/changeset/base/348205 >> >> Log: >> Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. >> >> All of these algorithms are either explicitly marked MUST NOT, or they >> are implicitly MUST NOTs by virtue of not being included in IETF's >> list of protocols at all despite having assignments from IANA. > > Can you provide me these specific ones and I'll investigate > the Ietf datatracker and IANA documents and see if I can > get the long story. Ie what IANA assignments are you refering > to that do not appear in RFC, it may simply be the case there > is a final RFC that says "new foo are assigned numbers by IANA > and no RFC is needed" That is how port numbers and other > such things just are, there is not a RFC for everything! I suggest you start by reading RFC 8221 to get an understanding for why the commit log uses the language it does. >> Specifically, this adds warnings for the following ciphers: >> - des-cbc >> - blowfish-cbc >> - cast128-cbc >> - des-deriv >> - des-32iv >> - camellia-cbc The RFC explicitly lists all DES variants and blowfish as MUST NOT in the table in section 5. As far as I can tell, the draft document for CAST expired in 1997: https://tools.ietf.org/html/draft-ietf-ipsec-esp-cast-128-cbc-00 As noted in the review comments, Camellia is the only one of these ciphers that might be worth retaining if there are actual users. It is in theory comparable to AES, but it is not widely used. In addition, whereas with AES we support AEAD modes such as AES-GCM and AES-CCM (though we do not currently support AES-CCM with IPsec), for Camellia we only support CBC. I believe there are specs for CCM and GCM modes for Camellia but no one has implemented them. In terms of algorithm diversity, it would be better to expend effort on supporting chacha20 + poly1035-hmac (as RFC 8221 suggests since these are now a SHOULD) rather than Camellia. >> Warnings for the following authentication algorithms are also added: >> - hmac-md5 >> - keyed-md5 >> - keyed-sha1 >> - hmac-ripemd160 hmac-md5 and keyed-md5 are both MUST NOT in 8221. The Internet (google) doesn't seem to think that keyed-sha1 even exists, so I wonder if it's a local invention in FreeBSD. sha1 is MUST- in 8221 so we probably should be removing it soon, but this change does not do that. ripemd160 is a more obscure hash that is more like sha1 than the sha2 variants. RFC 6071 states that you can't use ripemd with IKE due to no IANA number which would seem to preclude its use in any "real" deployments (and 6071 is already 8 years old). -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 24 01:13:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 786431591E3D; Fri, 24 May 2019 01:13:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17FFE6C864; Fri, 24 May 2019 01:13:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 701EA1E91; Fri, 24 May 2019 01:13:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348205 - head/sys/netipsec To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905240053.x4O0rFxp093133@gndrsh.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <72b76588-8983-9274-1e49-38ef1d809ac8@FreeBSD.org> Date: Thu, 23 May 2019 18:13:36 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905240053.x4O0rFxp093133@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 17FFE6C864 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:13:38 -0000 On 5/23/19 5:53 PM, Rodney W. Grimes wrote: >> On 5/23/19 3:06 PM, John Baldwin wrote: >>> Author: jhb >>> Date: Thu May 23 22:06:57 2019 >>> New Revision: 348205 >>> URL: https://svnweb.freebsd.org/changeset/base/348205 >>> >>> Log: >>> Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. >>> >>> All of these algorithms are either explicitly marked MUST NOT, or they >>> are implicitly MUST NOTs by virtue of not being included in IETF's >>> list of protocols at all despite having assignments from IANA. >>> >>> Specifically, this adds warnings for the following ciphers: >>> - des-cbc >>> - blowfish-cbc >>> - cast128-cbc >>> - des-deriv >>> - des-32iv >>> - camellia-cbc >>> >>> Warnings for the following authentication algorithms are also added: >>> - hmac-md5 >>> - keyed-md5 >>> - keyed-sha1 >>> - hmac-ripemd160 >>> >>> Reviewed by: cem, gnn >>> MFC after: 3 days >>> Sponsored by: Chelsio Communications >>> Differential Revision: https://reviews.freebsd.org/D20340 >> >> The quick turnaround time is so that these warnings can be MFC'd. I will wait a >> while to see how that fairs before pulling the plug on removing actual functionality >> in head. > > Are you targeting this at 11.3, which if your not I would encourage you > to do as the earlier on this type stuff the better. Yes, the 3 days for both this and geli is purely for the sake of 11.3. -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 24 01:28:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CD9E15922C1; Fri, 24 May 2019 01:28:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE48C6CDE7; Fri, 24 May 2019 01:28:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AC06D9AA; Fri, 24 May 2019 01:28:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O1S7Fv093660; Fri, 24 May 2019 01:28:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O1S77N093659; Fri, 24 May 2019 01:28:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905240128.x4O1S77N093659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 May 2019 01:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348215 - head/lib/libjail X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libjail X-SVN-Commit-Revision: 348215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE48C6CDE7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:28:08 -0000 Author: kevans Date: Fri May 24 01:28:07 2019 New Revision: 348215 URL: https://svnweb.freebsd.org/changeset/base/348215 Log: jail_getid(3): validate jid string input Currently, if jail_getid(3) is passed in a numeric string, it assumes that this is a jid string and passes it back converted to an int without checking that it's a valid/existing jid. This breaks consumers that might use jail_getid(3) to see if it can trivially grab a jid from a name if that name happens to be numeric but not actually the name/jid of the jail. Instead of returning -1 for the jail not existing, it'll return the int version of the input and the consumer will not fallback to trying other methods. Pass the numeric input to jail_get(2) as the jid for validation, rather than the name. This works well- the kernel enforces that jid=name if name is numeric, so doing the safe thing and checking numeric input as a jid will still DTRT based on the description of jail_getid. Reported by: Wes Maag Reviewed by: jamie, Wes Maag MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20388 Modified: head/lib/libjail/jail_getid.c Modified: head/lib/libjail/jail_getid.c ============================================================================== --- head/lib/libjail/jail_getid.c Fri May 24 00:56:50 2019 (r348214) +++ head/lib/libjail/jail_getid.c Fri May 24 01:28:07 2019 (r348215) @@ -53,13 +53,18 @@ jail_getid(const char *name) struct iovec jiov[4]; jid = strtoul(name, &ep, 10); - if (*name && !*ep) - return jid; - jiov[0].iov_base = __DECONST(char *, "name"); - jiov[0].iov_len = sizeof("name"); - jiov[1].iov_len = strlen(name) + 1; - jiov[1].iov_base = alloca(jiov[1].iov_len); - strcpy(jiov[1].iov_base, name); + if (*name && !*ep) { + jiov[0].iov_base = __DECONST(char *, "jid"); + jiov[0].iov_len = sizeof("jid"); + jiov[1].iov_base = &jid; + jiov[1].iov_len = sizeof(jid); + } else { + jiov[0].iov_base = __DECONST(char *, "name"); + jiov[0].iov_len = sizeof("name"); + jiov[1].iov_len = strlen(name) + 1; + jiov[1].iov_base = alloca(jiov[1].iov_len); + strcpy(jiov[1].iov_base, name); + } jiov[2].iov_base = __DECONST(char *, "errmsg"); jiov[2].iov_len = sizeof("errmsg"); jiov[3].iov_base = jail_errmsg; From owner-svn-src-all@freebsd.org Fri May 24 01:34:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683921592591; Fri, 24 May 2019 01:34:42 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 951B36D278; Fri, 24 May 2019 01:34:32 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4O1YUl5093318; Thu, 23 May 2019 18:34:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4O1YUbA093317; Thu, 23 May 2019 18:34:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905240134.x4O1YUbA093317@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348205 - head/sys/netipsec In-Reply-To: <2ccc4dd0-19d4-981e-82cb-c6fcab355eda@FreeBSD.org> To: John Baldwin Date: Thu, 23 May 2019 18:34:30 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 951B36D278 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:34:42 -0000 > On 5/23/19 5:51 PM, Rodney W. Grimes wrote: > >> Author: jhb > >> Date: Thu May 23 22:06:57 2019 > >> New Revision: 348205 > >> URL: https://svnweb.freebsd.org/changeset/base/348205 > >> > >> Log: > >> Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. > >> > >> All of these algorithms are either explicitly marked MUST NOT, or they > >> are implicitly MUST NOTs by virtue of not being included in IETF's > >> list of protocols at all despite having assignments from IANA. > > > > Can you provide me these specific ones and I'll investigate > > the Ietf datatracker and IANA documents and see if I can > > get the long story. Ie what IANA assignments are you refering > > to that do not appear in RFC, it may simply be the case there > > is a final RFC that says "new foo are assigned numbers by IANA > > and no RFC is needed" That is how port numbers and other > > such things just are, there is not a RFC for everything! > > I suggest you start by reading RFC 8221 to get an understanding for > why the commit log uses the language it does. I understand the language, I want to know which IANA assigned numbers entries are at issue here without having to recreate that list from your commit and RFC 8221. I have 0 issue with the deprecation as it stands, and am wanting to see why this issue in the Ietf/IANA documentation exists. > >> Specifically, this adds warnings for the following ciphers: > >> - des-cbc > >> - blowfish-cbc > >> - cast128-cbc > >> - des-deriv > >> - des-32iv > >> - camellia-cbc > > The RFC explicitly lists all DES variants and blowfish as MUST NOT in > the table in section 5. As far as I can tell, the draft document for > CAST expired in 1997: > > https://tools.ietf.org/html/draft-ietf-ipsec-esp-cast-128-cbc-00 Well at least 00 expired, the problem here is that this is attempting to track things in the wrong direction, and it may of totally changed name shapes so is hard to find in the data tracker. I did confirm that this document pretty much died at submission. > As noted in the review comments, Camellia is the only one of these > ciphers that might be worth retaining if there are actual users. > It is in theory comparable to AES, but it is not widely used. > In addition, whereas with AES we support AEAD modes such as AES-GCM > and AES-CCM (though we do not currently support AES-CCM with IPsec), > for Camellia we only support CBC. I believe there are specs for > CCM and GCM modes for Camellia but no one has implemented them. > In terms of algorithm diversity, it would be better to expend > effort on supporting chacha20 + poly1035-hmac (as RFC 8221 suggests > since these are now a SHOULD) rather than Camellia. > > >> Warnings for the following authentication algorithms are also added: > >> - hmac-md5 > >> - keyed-md5 > >> - keyed-sha1 > >> - hmac-ripemd160 > > hmac-md5 and keyed-md5 are both MUST NOT in 8221. The Internet (google) > doesn't seem to think that keyed-sha1 even exists, so I wonder if it's > a local invention in FreeBSD. sha1 is MUST- in 8221 so we probably > should be removing it soon, but this change does not do that. > ripemd160 is a more obscure hash that is more like sha1 than the sha2 > variants. RFC 6071 states that you can't use ripemd with IKE due to no > IANA number which would seem to preclude its use in any "real" > deployments (and 6071 is already 8 years old). I did not need that info, just a list of IANA assigned numbers of things you can not find in RFC/Ietf documents. I'll do the leg work from the other side and if Ietf/Iana documents need fixed I'll get that in process. > -- > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 24 01:43:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06939159293C; Fri, 24 May 2019 01:43:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96C636D70B; Fri, 24 May 2019 01:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84B9BDD0A; Fri, 24 May 2019 01:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O1hTn7003856; Fri, 24 May 2019 01:43:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O1hTu6003855; Fri, 24 May 2019 01:43:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905240143.x4O1hTu6003855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 24 May 2019 01:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348216 - head/sys/dev/aac X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/aac X-SVN-Commit-Revision: 348216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96C636D70B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:43:30 -0000 Author: imp Date: Fri May 24 01:43:29 2019 New Revision: 348216 URL: https://svnweb.freebsd.org/changeset/base/348216 Log: Make uniqueifier match the module definition. Modified: head/sys/dev/aac/aac_pci.c Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Fri May 24 01:28:07 2019 (r348215) +++ head/sys/dev/aac/aac_pci.c Fri May 24 01:43:29 2019 (r348216) @@ -494,7 +494,7 @@ static driver_t aacch_driver = { static devclass_t aacch_devclass; DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); -MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aac, +MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aacch, aac_identifiers, nitems(aac_identifiers) - 1); static int From owner-svn-src-all@freebsd.org Fri May 24 01:43:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C3215929A1; Fri, 24 May 2019 01:43:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF4AB6D7EB; Fri, 24 May 2019 01:43:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 415FFDD0D; Fri, 24 May 2019 01:43:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O1haUl003913; Fri, 24 May 2019 01:43:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O1hZ0J003912; Fri, 24 May 2019 01:43:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905240143.x4O1hZ0J003912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 24 May 2019 01:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348217 - in head/sys/mips: atheros/ar531x mips X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/mips: atheros/ar531x mips X-SVN-Commit-Revision: 348217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF4AB6D7EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:43:40 -0000 Author: imp Date: Fri May 24 01:43:35 2019 New Revision: 348217 URL: https://svnweb.freebsd.org/changeset/base/348217 Log: Display CPU model in dmesg on mips targets Also, save the CPU model for atheros ar531x boards. Submitted by: Hiroki Mori Differential Revision: https://reviews.freebsd.org/D20371 Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/mips/machdep.c Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Fri May 24 01:43:29 2019 (r348216) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Fri May 24 01:43:35 2019 (r348217) @@ -146,6 +146,8 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_ "Board revision"); #endif +extern char cpu_model[]; + void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) @@ -259,6 +261,8 @@ platform_start(__register_t a0 __unused, __register_t printf(" a1 = %08x\n", a1); printf(" a2 = %08x\n", a2); printf(" a3 = %08x\n", a3); + + strcpy(cpu_model, ar5315_get_system_type()); /* * XXX this code is very redboot specific. Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Fri May 24 01:43:29 2019 (r348216) +++ head/sys/mips/mips/machdep.c Fri May 24 01:43:35 2019 (r348217) @@ -186,6 +186,8 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; + printf("CPU model: %s\n", cpu_model); + printf("real memory = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem), ptoa((uintmax_t)realmem) / 1024); From owner-svn-src-all@freebsd.org Fri May 24 01:51:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57E071592E0B; Fri, 24 May 2019 01:51:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECC506DC0C; Fri, 24 May 2019 01:51:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8EA5DD7B; Fri, 24 May 2019 01:51:58 +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 x4O1pwVo007529; Fri, 24 May 2019 01:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O1pwci007528; Fri, 24 May 2019 01:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905240151.x4O1pwci007528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 24 May 2019 01:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348218 - stable/12/sys/powerpc/aim X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/aim X-SVN-Commit-Revision: 348218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECC506DC0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:51:59 -0000 Author: jhibbits Date: Fri May 24 01:51:58 2019 New Revision: 348218 URL: https://svnweb.freebsd.org/changeset/base/348218 Log: MFC r347463: powerpc: Initialize the Hardware Interrupt Offset Register (HIOR) earlier for ppc970 Since we now have a much larger KVA on powerpc64, it's possible to get SLB traps earlier in boot, possibly even before the HIOR is properly configured for us. Move the HIOR setup to immediately after reset, so that we use our exception handlers instead of Open Firmware's. PR: 233863 Modified: stable/12/sys/powerpc/aim/mp_cpudep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/12/sys/powerpc/aim/mp_cpudep.c Fri May 24 01:43:35 2019 (r348217) +++ stable/12/sys/powerpc/aim/mp_cpudep.c Fri May 24 01:51:58 2019 (r348218) @@ -68,6 +68,10 @@ cpudep_ap_early_bootstrap(void) case IBM970: case IBM970FX: case IBM970MP: + /* Set HIOR to 0 */ + __asm __volatile("mtspr 311,%0" :: "r"(0)); + powerpc_sync(); + /* Restore HID4 and HID5, which are necessary for the MMU */ #ifdef __powerpc64__ @@ -307,10 +311,6 @@ cpudep_ap_setup() case IBM970: case IBM970FX: case IBM970MP: - /* Set HIOR to 0 */ - __asm __volatile("mtspr 311,%0" :: "r"(0)); - powerpc_sync(); - /* * The 970 has strange rules about how to update HID registers. * See Table 2-3, 970MP manual From owner-svn-src-all@freebsd.org Fri May 24 01:53:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073A31592F29; Fri, 24 May 2019 01:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A06D6DF15; Fri, 24 May 2019 01:53:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76C26DEB5; Fri, 24 May 2019 01:53:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O1rjx7009417; Fri, 24 May 2019 01:53:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O1rjxA009416; Fri, 24 May 2019 01:53:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905240153.x4O1rjxA009416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 May 2019 01:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348219 - head/sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl/tests X-SVN-Commit-Revision: 348219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A06D6DF15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 01:53:46 -0000 Author: kevans Date: Fri May 24 01:53:45 2019 New Revision: 348219 URL: https://svnweb.freebsd.org/changeset/base/348219 Log: bectl(8): Add a test for jail/unjail of numeric BE names Fixed by r348215, bectl ujail first attempts the trivial fetch of a jid by passing the first argument to 'ujail' to jail_getid(3) in case a jid/name have been passed in instead of a BE name. For numerically named BEs, this was doing the wrong thing: instead of failing to locate the jid specified and falling back to mountpath search, jail_getid(3) would return the input as-is. While here, I've fixed bectl_jail_cleanup which still used a hard-coded pool name that was overlooked w.r.t. other work that was in-flight around the same time. MFC after: 3 days Modified: head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Fri May 24 01:51:58 2019 (r348218) +++ head/sbin/bectl/tests/bectl_test.sh Fri May 24 01:53:45 2019 (r348219) @@ -294,9 +294,16 @@ bectl_jail_body() atf_check cp /rescue/rescue ${root}/rescue/rescue atf_check bectl -r ${zpool}/ROOT umount default - # Prepare a second boot environment + # Prepare some more boot environments atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT create -e default target + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT create -e default 1234 + # Attempt to unjail a BE with numeric name; jail_getid at one point + # did not validate that the input was a valid jid before returning the + # jid. + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b 1234 + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail 1234 + # When a jail name is not explicit, it should match the jail id. atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b -o jid=233637 default atf_check -o inline:"233637\n" -s exit:0 -x "jls -j 233637 name" @@ -340,9 +347,10 @@ bectl_jail_body() # attempts to destroy the zpool. bectl_jail_cleanup() { - for bootenv in "default" "target"; do + zpool=$(get_zpool_name) + for bootenv in "default" "target" "1234"; do # mountpoint of the boot environment - mountpoint="$(bectl -r bectl_test/ROOT list -H | grep ${bootenv} | awk '{print $3}')" + mountpoint="$(bectl -r ${zpool}/ROOT list -H | grep ${bootenv} | awk '{print $3}')" # see if any jail paths match the boot environment mountpoint jailid="$(jls | grep ${mountpoint} | awk '{print $1}')" @@ -353,7 +361,7 @@ bectl_jail_cleanup() jail -r ${jailid} done; - bectl_cleanup $(get_zpool_name) + bectl_cleanup ${zpool} } atf_init_test_cases() From owner-svn-src-all@freebsd.org Fri May 24 02:10:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5803159358F; Fri, 24 May 2019 02:10:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D716E575; Fri, 24 May 2019 02:10:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 452A2E09E; Fri, 24 May 2019 02:10:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O2AHi3014736; Fri, 24 May 2019 02:10:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O2AGLJ014733; Fri, 24 May 2019 02:10:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905240210.x4O2AGLJ014733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 May 2019 02:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348220 - vendor-sys/libfdt/dist X-SVN-Group: vendor-sys X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor-sys/libfdt/dist X-SVN-Commit-Revision: 348220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68D716E575 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 02:10:18 -0000 Author: kevans Date: Fri May 24 02:10:16 2019 New Revision: 348220 URL: https://svnweb.freebsd.org/changeset/base/348220 Log: Import libfdt from dtc 1.5.0 Modified: vendor-sys/libfdt/dist/Makefile.libfdt vendor-sys/libfdt/dist/fdt_addresses.c vendor-sys/libfdt/dist/libfdt.h Modified: vendor-sys/libfdt/dist/Makefile.libfdt ============================================================================== --- vendor-sys/libfdt/dist/Makefile.libfdt Fri May 24 01:53:45 2019 (r348219) +++ vendor-sys/libfdt/dist/Makefile.libfdt Fri May 24 02:10:16 2019 (r348220) @@ -9,3 +9,7 @@ LIBFDT_VERSION = version.lds LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \ fdt_addresses.c fdt_overlay.c LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o) + +libfdt_clean: + @$(VECHO) CLEAN "(libfdt)" + rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%) Modified: vendor-sys/libfdt/dist/fdt_addresses.c ============================================================================== --- vendor-sys/libfdt/dist/fdt_addresses.c Fri May 24 01:53:45 2019 (r348219) +++ vendor-sys/libfdt/dist/fdt_addresses.c Fri May 24 02:10:16 2019 (r348220) @@ -64,7 +64,7 @@ static int fdt_cells(const void *fdt, int nodeoffset, c = fdt_getprop(fdt, nodeoffset, name, &len); if (!c) - return 2; + return len; if (len != sizeof(*c)) return -FDT_ERR_BADNCELLS; @@ -78,10 +78,20 @@ static int fdt_cells(const void *fdt, int nodeoffset, int fdt_address_cells(const void *fdt, int nodeoffset) { - return fdt_cells(fdt, nodeoffset, "#address-cells"); + int val; + + val = fdt_cells(fdt, nodeoffset, "#address-cells"); + if (val == -FDT_ERR_NOTFOUND) + return 2; + return val; } int fdt_size_cells(const void *fdt, int nodeoffset) { - return fdt_cells(fdt, nodeoffset, "#size-cells"); + int val; + + val = fdt_cells(fdt, nodeoffset, "#size-cells"); + if (val == -FDT_ERR_NOTFOUND) + return 1; + return val; } Modified: vendor-sys/libfdt/dist/libfdt.h ============================================================================== --- vendor-sys/libfdt/dist/libfdt.h Fri May 24 01:53:45 2019 (r348219) +++ vendor-sys/libfdt/dist/libfdt.h Fri May 24 02:10:16 2019 (r348220) @@ -163,18 +163,26 @@ uint32_t fdt_next_tag(const void *fdt, int offset, int static inline uint32_t fdt32_ld(const fdt32_t *p) { - fdt32_t v; + const uint8_t *bp = (const uint8_t *)p; - memcpy(&v, p, sizeof(v)); - return fdt32_to_cpu(v); + return ((uint32_t)bp[0] << 24) + | ((uint32_t)bp[1] << 16) + | ((uint32_t)bp[2] << 8) + | bp[3]; } static inline uint64_t fdt64_ld(const fdt64_t *p) { - fdt64_t v; + const uint8_t *bp = (const uint8_t *)p; - memcpy(&v, p, sizeof(v)); - return fdt64_to_cpu(v); + return ((uint64_t)bp[0] << 56) + | ((uint64_t)bp[1] << 48) + | ((uint64_t)bp[2] << 40) + | ((uint64_t)bp[3] << 32) + | ((uint64_t)bp[4] << 24) + | ((uint64_t)bp[5] << 16) + | ((uint64_t)bp[6] << 8) + | bp[7]; } /**********************************************************************/ @@ -219,7 +227,7 @@ int fdt_next_subnode(const void *fdt, int offset); * ... * } * - * if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) { + * if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) { * Error handling * } * @@ -558,7 +566,7 @@ int fdt_next_property_offset(const void *fdt, int offs * ... * } * - * if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) { + * if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) { * Error handling * } * @@ -661,7 +669,7 @@ static inline struct fdt_property *fdt_get_property_w( /** * fdt_getprop_by_offset - retrieve the value of a property at a given offset * @fdt: pointer to the device tree blob - * @ffset: offset of the property to read + * @offset: offset of the property to read * @namep: pointer to a string variable (will be overwritten) or NULL * @lenp: pointer to an integer variable (will be overwritten) or NULL * @@ -1145,7 +1153,7 @@ int fdt_address_cells(const void *fdt, int nodeoffset) * * returns: * 0 <= n < FDT_MAX_NCELLS, on success - * 2, if the node has no #size-cells property + * 1, if the node has no #size-cells property * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid * #size-cells property * -FDT_ERR_BADMAGIC, From owner-svn-src-all@freebsd.org Fri May 24 02:10:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD4815935FB; Fri, 24 May 2019 02:10:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2EC6E6D3; Fri, 24 May 2019 02:10:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40B96E0C0; Fri, 24 May 2019 02:10:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O2Aqwu015522; Fri, 24 May 2019 02:10:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O2AqbP015521; Fri, 24 May 2019 02:10:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905240210.x4O2AqbP015521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 May 2019 02:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348221 - vendor-sys/libfdt/1.5.0 X-SVN-Group: vendor-sys X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor-sys/libfdt/1.5.0 X-SVN-Commit-Revision: 348221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E2EC6E6D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 02:10:53 -0000 Author: kevans Date: Fri May 24 02:10:51 2019 New Revision: 348221 URL: https://svnweb.freebsd.org/changeset/base/348221 Log: Tag libfdt 1.5.0 Added: vendor-sys/libfdt/1.5.0/ - copied from r348220, vendor-sys/libfdt/dist/ From owner-svn-src-all@freebsd.org Fri May 24 02:44:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5791594414; Fri, 24 May 2019 02:44:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9183D6F925; Fri, 24 May 2019 02:44:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AD85E796; Fri, 24 May 2019 02:44:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O2iGsQ035559; Fri, 24 May 2019 02:44:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O2iGqI035558; Fri, 24 May 2019 02:44:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905240244.x4O2iGqI035558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 24 May 2019 02:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348222 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 348222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9183D6F925 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 02:44:17 -0000 Author: delphij Date: Fri May 24 02:44:15 2019 New Revision: 348222 URL: https://svnweb.freebsd.org/changeset/base/348222 Log: cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe. For older versions of zlib, dummy was a workaround for compilers that do not handle opaque type definition well; on FreeBSD, it's representing a value that is not really useful for monitoring purposes, and the field would be gone in newer zlib versions. PR: 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D20222 Modified: head/sys/opencrypto/cryptodeflate.c Modified: head/sys/opencrypto/cryptodeflate.c ============================================================================== --- head/sys/opencrypto/cryptodeflate.c Fri May 24 02:10:51 2019 (r348221) +++ head/sys/opencrypto/cryptodeflate.c Fri May 24 02:44:15 2019 (r348222) @@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DECLARE(opencrypto); SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, "int", "u_int32_t"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, - "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, - "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE6(opencrypto, deflate, deflate_global, bad, + "int", "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE6(opencrypto, deflate, deflate_global, iter, + "int", "int", "int", "int", "int", "int"); SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, "int", "u_int32_t"); @@ -105,8 +105,8 @@ deflate_global(data, size, decomp, out) bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i), M_CRYPTO_DATA, M_NOWAIT); if (bufp == NULL) { - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__, 0, 0); + SDT_PROBE6(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__, 0, 0, 0); goto bad2; } bufp->next = NULL; @@ -125,8 +125,8 @@ deflate_global(data, size, decomp, out) deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); if (error != Z_OK) { - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, - decomp, error, __LINE__, 0, 0); + SDT_PROBE6(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, 0, 0, 0); goto bad; } @@ -134,24 +134,14 @@ deflate_global(data, size, decomp, out) error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : deflate(&zbuf, Z_FINISH); if (error != Z_OK && error != Z_STREAM_END) { - /* - * Unfortunately we are limited to 5 arguments, - * thus use two probes. - */ - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + SDT_PROBE6(opencrypto, deflate, deflate_global, bad, decomp, error, __LINE__, - zbuf.avail_in, zbuf.avail_out); - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, - decomp, error, __LINE__, - zbuf.state->dummy, zbuf.total_out); + zbuf.avail_in, zbuf.avail_out, zbuf.total_out); goto bad; } - SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + SDT_PROBE6(opencrypto, deflate, deflate_global, iter, decomp, error, __LINE__, - zbuf.avail_in, zbuf.avail_out); - SDT_PROBE5(opencrypto, deflate, deflate_global, iter, - decomp, error, __LINE__, - zbuf.state->dummy, zbuf.total_out); + zbuf.avail_in, zbuf.avail_out, zbuf.total_out); if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { /* Done. */ break; @@ -165,8 +155,8 @@ deflate_global(data, size, decomp, out) p = malloc(sizeof(*p) + (size_t)(size * i), M_CRYPTO_DATA, M_NOWAIT); if (p == NULL) { - SDT_PROBE5(opencrypto, deflate, deflate_global, - bad, decomp, 0, __LINE__, 0, 0); + SDT_PROBE6(opencrypto, deflate, deflate_global, + bad, decomp, 0, __LINE__, 0, 0, 0); goto bad; } p->next = NULL; @@ -177,16 +167,9 @@ deflate_global(data, size, decomp, out) zbuf.avail_out = bufp->size; } else { /* Unexpect result. */ - /* - * Unfortunately we are limited to 5 arguments, - * thus, again, use two probes. - */ - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + SDT_PROBE6(opencrypto, deflate, deflate_global, bad, decomp, error, __LINE__, - zbuf.avail_in, zbuf.avail_out); - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, - decomp, error, __LINE__, - zbuf.state->dummy, zbuf.total_out); + zbuf.avail_in, zbuf.avail_out, zbuf.total_out); goto bad; } } @@ -195,8 +178,8 @@ deflate_global(data, size, decomp, out) *out = malloc(result, M_CRYPTO_DATA, M_NOWAIT); if (*out == NULL) { - SDT_PROBE5(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__, 0, 0); + SDT_PROBE6(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__, 0, 0, 0); goto bad; } if (decomp) From owner-svn-src-all@freebsd.org Fri May 24 04:15:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5C961596B1B; Fri, 24 May 2019 04:15:40 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60A2F727B2; Fri, 24 May 2019 04:15:40 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A181F832; Fri, 24 May 2019 04:15:40 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O4FeIb084591; Fri, 24 May 2019 04:15:40 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O4Fc85084583; Fri, 24 May 2019 04:15:38 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905240415.x4O4Fc85084583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 24 May 2019 04:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348223 - in stable/12/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable/12/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Commit-Revision: 348223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60A2F727B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 04:15:41 -0000 Author: rgrimes Date: Fri May 24 04:15:38 2019 New Revision: 348223 URL: https://svnweb.freebsd.org/changeset/base/348223 Log: MFC: r346714: Add accessor function for vm->maxcpus Replace most VM_MAXCPU constant useses with an accessor function to vm->maxcpus which for now is initialized and kept at the value of VM_MAXCPUS. This is a rework of Fabian Freyer (fabian.freyer_physik.tu-berlin.de) work from D10070 to adjust it for the cpu topology changes that occured in r332298 Approved by: bde (implicit) Modified: stable/12/sys/amd64/include/vmm.h stable/12/sys/amd64/vmm/amd/svm.c stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/amd64/vmm/io/vlapic.c stable/12/sys/amd64/vmm/vmm.c stable/12/sys/amd64/vmm/vmm_dev.c stable/12/sys/amd64/vmm/vmm_lapic.c stable/12/sys/amd64/vmm/vmm_stat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/vmm.h ============================================================================== --- stable/12/sys/amd64/include/vmm.h Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/include/vmm.h Fri May 24 04:15:38 2019 (r348223) @@ -186,6 +186,7 @@ int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); +uint16_t vm_get_maxcpus(struct vm *vm); void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus); int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, Modified: stable/12/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/12/sys/amd64/vmm/amd/svm.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/amd/svm.c Fri May 24 04:15:38 2019 (r348223) @@ -524,6 +524,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) struct svm_vcpu *vcpu; vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; + uint16_t maxcpus; svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); if (((uintptr_t)svm_sc & PAGE_MASK) != 0) @@ -577,7 +578,8 @@ svm_vminit(struct vm *vm, pmap_t pmap) iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); pml4_pa = svm_sc->nptp; - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(svm_sc->vm); + for (i = 0; i < maxcpus; i++) { vcpu = svm_get_vcpu(svm_sc, i); vcpu->nextrip = ~0; vcpu->lastcpu = NOCPU; Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/intel/vmx.c Fri May 24 04:15:38 2019 (r348223) @@ -943,6 +943,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) struct vmx *vmx; struct vmcs *vmcs; uint32_t exc_bitmap; + uint16_t maxcpus; vmx = malloc(sizeof(struct vmx), M_VMX, M_WAITOK | M_ZERO); if ((uintptr_t)vmx & PAGE_MASK) { @@ -1004,7 +1005,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) KASSERT(error == 0, ("vm_map_mmio(apicbase) error %d", error)); } - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(vm); + for (i = 0; i < maxcpus; i++) { vmcs = &vmx->vmcs[i]; vmcs->identifier = vmx_revision(); error = vmclear(vmcs); @@ -3002,11 +3004,13 @@ vmx_vmcleanup(void *arg) { int i; struct vmx *vmx = arg; + uint16_t maxcpus; if (apic_access_virtualization(vmx, 0)) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); - for (i = 0; i < VM_MAXCPU; i++) + maxcpus = vm_get_maxcpus(vmx->vm); + for (i = 0; i < maxcpus; i++) vpid_free(vmx->state[i].vpid); free(vmx, M_VMX); Modified: stable/12/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/12/sys/amd64/vmm/io/vlapic.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/io/vlapic.c Fri May 24 04:15:38 2019 (r348223) @@ -838,7 +838,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < VM_MAXCPU) + if (vcpuid < vm_get_maxcpus(vm)) CPU_SET(vcpuid, dmask); } else { /* @@ -965,6 +965,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool struct vlapic *vlapic2; struct vm_exit *vmexit; struct LAPIC *lapic; + uint16_t maxcpus; lapic = vlapic->apic_page; lapic->icr_lo &= ~APIC_DELSTAT_PEND; @@ -1026,11 +1027,12 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool return (0); /* handled completely in the kernel */ } + maxcpus = vm_get_maxcpus(vlapic->vm); if (mode == APIC_DELMODE_INIT) { if ((icrval & APIC_LEVEL_MASK) == APIC_LEVEL_DEASSERT) return (0); - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* move from INIT to waiting-for-SIPI state */ @@ -1043,7 +1045,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool } if (mode == APIC_DELMODE_STARTUP) { - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* @@ -1447,7 +1449,8 @@ void vlapic_init(struct vlapic *vlapic) { KASSERT(vlapic->vm != NULL, ("vlapic_init: vm is not initialized")); - KASSERT(vlapic->vcpuid >= 0 && vlapic->vcpuid < VM_MAXCPU, + KASSERT(vlapic->vcpuid >= 0 && + vlapic->vcpuid < vm_get_maxcpus(vlapic->vm), ("vlapic_init: vcpuid is not initialized")); KASSERT(vlapic->apic_page != NULL, ("vlapic_init: apic_page is not " "initialized")); Modified: stable/12/sys/amd64/vmm/vmm.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/vmm.c Fri May 24 04:15:38 2019 (r348223) @@ -276,7 +276,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create) { struct vcpu *vcpu; - KASSERT(vcpu_id >= 0 && vcpu_id < VM_MAXCPU, + KASSERT(vcpu_id >= 0 && vcpu_id < vm->maxcpus, ("vcpu_init: invalid vcpu %d", vcpu_id)); vcpu = &vm->vcpu[vcpu_id]; @@ -315,7 +315,7 @@ vm_exitinfo(struct vm *vm, int cpuid) { struct vcpu *vcpu; - if (cpuid < 0 || cpuid >= VM_MAXCPU) + if (cpuid < 0 || cpuid >= vm->maxcpus) panic("vm_exitinfo: invalid cpuid %d", cpuid); vcpu = &vm->vcpu[cpuid]; @@ -428,7 +428,7 @@ vm_init(struct vm *vm, bool create) vm->suspend = 0; CPU_ZERO(&vm->suspended_cpus); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_init(vm, i, create); } @@ -466,7 +466,7 @@ vm_create(const char *name, struct vm **retvm) vm->sockets = 1; vm->cores = cores_per_package; /* XXX backwards compatibility */ vm->threads = threads_per_core; /* XXX backwards compatibility */ - vm->maxcpus = 0; /* XXX not implemented */ + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ vm_init(vm, true); @@ -484,19 +484,25 @@ vm_get_topology(struct vm *vm, uint16_t *sockets, uint *maxcpus = vm->maxcpus; } +uint16_t +vm_get_maxcpus(struct vm *vm) +{ + return (vm->maxcpus); +} + int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus) { if (maxcpus != 0) return (EINVAL); /* XXX remove when supported */ - if ((sockets * cores * threads) > VM_MAXCPU) + if ((sockets * cores * threads) > vm->maxcpus) return (EINVAL); /* XXX need to check sockets * cores * threads == vCPU, how? */ vm->sockets = sockets; vm->cores = cores; vm->threads = threads; - vm->maxcpus = maxcpus; + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ return(0); } @@ -521,7 +527,7 @@ vm_cleanup(struct vm *vm, bool destroy) vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_cleanup(vm, i, destroy); VMCLEANUP(vm->cookie); @@ -956,9 +962,9 @@ vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, * guaranteed if at least one vcpu is in the VCPU_FROZEN state. */ int state; - KASSERT(vcpuid >= -1 && vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d", + KASSERT(vcpuid >= -1 && vcpuid < vm->maxcpus, ("%s: invalid vcpuid %d", __func__, vcpuid)); - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (vcpuid != -1 && vcpuid != i) continue; state = vcpu_get_state(vm, i, NULL); @@ -1004,7 +1010,7 @@ int vm_get_register(struct vm *vm, int vcpu, int reg, uint64_t *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1019,7 +1025,7 @@ vm_set_register(struct vm *vm, int vcpuid, int reg, ui struct vcpu *vcpu; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1073,7 +1079,7 @@ vm_get_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1086,7 +1092,7 @@ int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1258,7 +1264,7 @@ static void vm_handle_rendezvous(struct vm *vm, int vcpuid) { - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_handle_rendezvous: invalid vcpuid %d", vcpuid)); mtx_lock(&vm->rendezvous_mtx); @@ -1537,7 +1543,7 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *ret /* * Wakeup the other sleeping vcpus and return to userspace. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->suspended_cpus)) { vcpu_notify_event(vm, i, false); } @@ -1579,7 +1585,7 @@ vm_suspend(struct vm *vm, enum vm_suspend_how how) /* * Notify all active vcpus that they are now suspended. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->active_cpus)) vcpu_notify_event(vm, i, false); } @@ -1665,7 +1671,7 @@ vm_run(struct vm *vm, struct vm_run *vmrun) vcpuid = vmrun->cpuid; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (!CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -1766,7 +1772,7 @@ vm_restart_instruction(void *arg, int vcpuid) int error; vm = arg; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1805,7 +1811,7 @@ vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t in struct vcpu *vcpu; int type, vector; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1946,7 +1952,8 @@ vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t * uint64_t info1, info2; int valid; - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); + KASSERT(vcpuid >= 0 && + vcpuid < vm->maxcpus, ("invalid vcpu %d", vcpuid)); vcpu = &vm->vcpu[vcpuid]; @@ -1986,7 +1993,7 @@ vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *in { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2003,7 +2010,7 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vec uint64_t regval; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (vector < 0 || vector >= 32) @@ -2094,7 +2101,7 @@ vm_inject_nmi(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2109,7 +2116,7 @@ vm_nmi_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2122,7 +2129,7 @@ vm_nmi_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2141,7 +2148,7 @@ vm_inject_extint(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2156,7 +2163,7 @@ vm_extint_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2169,7 +2176,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2184,7 +2191,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) int vm_get_capability(struct vm *vm, int vcpu, int type, int *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2196,7 +2203,7 @@ vm_get_capability(struct vm *vm, int vcpu, int type, i int vm_set_capability(struct vm *vm, int vcpu, int type, int val) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2281,7 +2288,7 @@ vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_st int error; struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_set_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2299,7 +2306,7 @@ vcpu_get_state(struct vm *vm, int vcpuid, int *hostcpu struct vcpu *vcpu; enum vcpu_state state; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_get_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2317,7 +2324,7 @@ int vm_activate_cpu(struct vm *vm, int vcpuid) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -2333,12 +2340,12 @@ vm_suspend_cpu(struct vm *vm, int vcpuid) { int i; - if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + if (vcpuid < -1 || vcpuid >= vm->maxcpus) return (EINVAL); if (vcpuid == -1) { vm->debug_cpus = vm->active_cpus; - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->active_cpus)) vcpu_notify_event(vm, i, false); } @@ -2356,7 +2363,7 @@ int vm_resume_cpu(struct vm *vm, int vcpuid) { - if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + if (vcpuid < -1 || vcpuid >= vm->maxcpus) return (EINVAL); if (vcpuid == -1) { @@ -2408,7 +2415,7 @@ vcpu_stats(struct vm *vm, int vcpuid) int vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state *state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); *state = vm->vcpu[vcpuid].x2apic_state; @@ -2419,7 +2426,7 @@ vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2 int vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (state >= X2APIC_STATE_LAST) @@ -2506,7 +2513,7 @@ vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t * Enforce that this function is called without any locks */ WITNESS_WARN(WARN_PANIC, NULL, "vm_smp_rendezvous"); - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_smp_rendezvous: invalid vcpuid %d", vcpuid)); restart: @@ -2536,7 +2543,7 @@ restart: * Wake up any sleeping vcpus and trigger a VM-exit in any running * vcpus so they handle the rendezvous as soon as possible. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &dest)) vcpu_notify_event(vm, i, false); } Modified: stable/12/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm_dev.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/vmm_dev.c Fri May 24 04:15:38 2019 (r348223) @@ -111,7 +111,7 @@ vcpu_lock_one(struct vmmdev_softc *sc, int vcpu) { int error; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(sc->vm)) return (EINVAL); error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); @@ -136,8 +136,10 @@ static int vcpu_lock_all(struct vmmdev_softc *sc) { int error, vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) { + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) { error = vcpu_lock_one(sc, vcpu); if (error) break; @@ -155,8 +157,10 @@ static void vcpu_unlock_all(struct vmmdev_softc *sc) { int vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) vcpu_unlock_one(sc, vcpu); } @@ -191,6 +195,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_paddr_t gpa, maxaddr; void *hpa, *cookie; struct vmmdev_softc *sc; + uint16_t lastcpu; error = vmm_priv_check(curthread->td_ucred); if (error) @@ -203,7 +208,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -222,7 +228,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag * Since this device does not support lseek(2), dd(1) will * read(2) blocks of data to simulate the lseek(2). */ - hpa = vm_gpa_hold(sc->vm, VM_MAXCPU - 1, gpa, c, prot, &cookie); + hpa = vm_gpa_hold(sc->vm, lastcpu, gpa, c, + prot, &cookie); if (hpa == NULL) { if (uio->uio_rw == UIO_READ && gpa < maxaddr) error = uiomove(__DECONST(void *, zero_region), @@ -234,7 +241,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_gpa_release(cookie); } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -437,7 +444,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da * Lock a vcpu to make sure that the memory map cannot be * modified while it is being inspected. */ - vcpu = VM_MAXCPU - 1; + vcpu = vm_get_maxcpus(sc->vm) - 1; error = vcpu_lock_one(sc, vcpu); if (error) goto done; @@ -797,6 +804,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of size_t len; vm_ooffset_t segoff, first, last; int error, found, segid; + uint16_t lastcpu; bool sysmem; error = vmm_priv_check(curthread->td_ucred); @@ -817,7 +825,8 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -846,7 +855,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of error = EINVAL; } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -1045,6 +1054,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of vm_ooffset_t first, last; size_t seglen; int error; + uint16_t lastcpu; bool sysmem; dsc = cdev->si_drv1; @@ -1058,7 +1068,8 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of if ((nprot & PROT_EXEC) || first < 0 || first >= last) return (EINVAL); - error = vcpu_lock_one(dsc->sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(dsc->sc->vm) - 1; + error = vcpu_lock_one(dsc->sc, lastcpu); if (error) return (error); @@ -1066,7 +1077,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of KASSERT(error == 0 && !sysmem && *objp != NULL, ("%s: invalid devmem segment %d", __func__, dsc->segid)); - vcpu_unlock_one(dsc->sc, VM_MAXCPU - 1); + vcpu_unlock_one(dsc->sc, lastcpu); if (seglen >= last) { vm_object_reference(*objp); Modified: stable/12/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm_lapic.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/vmm_lapic.c Fri May 24 04:15:38 2019 (r348223) @@ -56,7 +56,7 @@ lapic_set_intr(struct vm *vm, int cpu, int vector, boo { struct vlapic *vlapic; - if (cpu < 0 || cpu >= VM_MAXCPU) + if (cpu < 0 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); /* @@ -79,7 +79,7 @@ lapic_set_local_intr(struct vm *vm, int cpu, int vecto cpuset_t dmask; int error; - if (cpu < -1 || cpu >= VM_MAXCPU) + if (cpu < -1 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); if (cpu == -1) Modified: stable/12/sys/amd64/vmm/vmm_stat.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm_stat.c Fri May 24 02:44:15 2019 (r348222) +++ stable/12/sys/amd64/vmm/vmm_stat.c Fri May 24 04:15:38 2019 (r348223) @@ -88,7 +88,7 @@ vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *stats; int i; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm)) return (EINVAL); /* Let stats functions update their counters */ From owner-svn-src-all@freebsd.org Fri May 24 05:34:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B61B1598729; Fri, 24 May 2019 05:34:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41CFD74E9A; Fri, 24 May 2019 05:34:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DB3F18594; Fri, 24 May 2019 05:34:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O5YNEx026179; Fri, 24 May 2019 05:34:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O5YL7l026173; Fri, 24 May 2019 05:34:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905240534.x4O5YL7l026173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 24 May 2019 05:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348225 - in head: . stand/i386 stand/i386/kgzldr targets/pseudo/userland targets/pseudo/userland/misc usr.sbin usr.sbin/kgzip X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: . stand/i386 stand/i386/kgzldr targets/pseudo/userland targets/pseudo/userland/misc usr.sbin usr.sbin/kgzip X-SVN-Commit-Revision: 348225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41CFD74E9A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 05:34:23 -0000 Author: delphij Date: Fri May 24 05:34:21 2019 New Revision: 348225 URL: https://svnweb.freebsd.org/changeset/base/348225 Log: Remove kgzip and kgzldr. PR: 183666, 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D20248 Deleted: head/stand/i386/kgzldr/ head/usr.sbin/kgzip/ Modified: head/ObsoleteFiles.inc head/stand/i386/Makefile head/targets/pseudo/userland/Makefile.depend head/targets/pseudo/userland/misc/Makefile.depend head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 24 05:12:43 2019 (r348224) +++ head/ObsoleteFiles.inc Fri May 24 05:34:21 2019 (r348225) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20190523: Remove obsolete kgzip and support files +OLD_FILES+=usr/sbin/kgzip +OLD_FILES+=usr/lib/kgzldr.o +OLD_FILES+=usr/share/man/man8/kgzip.8.gz + # 20190517: Remove obsolete 10 and 10/100 ethernet drivers. OLD_FILES+=usr/share/man/man4/bm.4.gz OLD_FILES+=usr/share/man/man4/cs.4.gz Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Fri May 24 05:12:43 2019 (r348224) +++ head/stand/i386/Makefile Fri May 24 05:34:21 2019 (r348225) @@ -16,10 +16,6 @@ SUBDIR.yes+= loader_simp # special boot programs, 'self-extracting boot2+loader' SUBDIR.yes+= pxeldr -.if ${MACHINE_CPUARCH} == "i386" -SUBDIR.yes+= kgzldr -.endif - SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot .include Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri May 24 05:12:43 2019 (r348224) +++ head/targets/pseudo/userland/Makefile.depend Fri May 24 05:34:21 2019 (r348225) @@ -827,7 +827,6 @@ DIRDEPS.i386= \ usr.sbin/hyperv/tools/kvp \ usr.sbin/hyperv/tools/vss \ usr.sbin/kgmon \ - usr.sbin/kgzip \ usr.sbin/lptcontrol \ usr.sbin/mptable \ usr.sbin/ndiscvt \ Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Fri May 24 05:12:43 2019 (r348224) +++ head/targets/pseudo/userland/misc/Makefile.depend Fri May 24 05:34:21 2019 (r348225) @@ -83,7 +83,7 @@ DIRDEPS+= \ DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi} DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi} -DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} stand/i386/kgzldr +DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} DIRDEPS.powerpc= ${_sys_boot_fdt} stand/libsa32 stand/ofw stand/uboot DIRDEPS.sparc64= stand/ofw ${_sys_boot_zfs} .endif Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Fri May 24 05:12:43 2019 (r348224) +++ head/usr.sbin/Makefile.amd64 Fri May 24 05:34:21 2019 (r348225) @@ -1,6 +1,5 @@ # $FreeBSD$ -# kgzip: builds, but missing support files # mptable: broken (not 64 bit clean) # pnpinfo: crashes (not really useful anyway) .if ${MK_ACPI} != "no" Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri May 24 05:12:43 2019 (r348224) +++ head/usr.sbin/Makefile.i386 Fri May 24 05:34:21 2019 (r348225) @@ -16,7 +16,6 @@ SUBDIR+= cpucontrol SUBDIR+= hyperv .endif SUBDIR+= kgmon -SUBDIR+= kgzip SUBDIR+= lptcontrol SUBDIR+= mptable .if ${MK_NDIS} != "no" From owner-svn-src-all@freebsd.org Fri May 24 05:47:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 422D31598FAA; Fri, 24 May 2019 05:47:17 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB7687576A; Fri, 24 May 2019 05:47:16 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2EB818782; Fri, 24 May 2019 05:47:16 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O5lG4N032013; Fri, 24 May 2019 05:47:16 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O5lG0I032011; Fri, 24 May 2019 05:47:16 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905240547.x4O5lG0I032011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 24 May 2019 05:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348226 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 348226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB7687576A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 05:47:17 -0000 Author: rgrimes Date: Fri May 24 05:47:16 2019 New Revision: 348226 URL: https://svnweb.freebsd.org/changeset/base/348226 Log: MFC: r346717: Make bhyve SMBIOS table topology aware When the CPU Topology was added to bhyve in r332298 the SMBIOS table was missed, this table passes topology information to the system and was still using the old concept of each vCPU is a socket with 1 core and 1 thread. This code did not even try to use the old sysctl information to adjust this data. Correct that by building a proper SMBios table, mapping the > 254 cases to 0 per the SMBios 2.6 specification that is claimed by the structure. Approved by: bde (implicit/mentor) Modified: stable/12/usr.sbin/bhyve/bhyverun.h stable/12/usr.sbin/bhyve/smbiostbl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/12/usr.sbin/bhyve/bhyverun.h Fri May 24 05:34:21 2019 (r348225) +++ stable/12/usr.sbin/bhyve/bhyverun.h Fri May 24 05:47:16 2019 (r348226) @@ -36,6 +36,7 @@ struct vmctx; extern int guest_ncpus; +extern uint16_t cores, sockets, threads; extern char *guest_uuid_str; extern char *vmname; Modified: stable/12/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- stable/12/usr.sbin/bhyve/smbiostbl.c Fri May 24 05:34:21 2019 (r348225) +++ stable/12/usr.sbin/bhyve/smbiostbl.c Fri May 24 05:47:16 2019 (r348226) @@ -636,7 +636,7 @@ smbios_type4_initializer(struct smbios_structure *temp { int i; - for (i = 0; i < guest_ncpus; i++) { + for (i = 0; i < sockets; i++) { struct smbios_table_type4 *type4; char *p; int nstrings, len; @@ -655,6 +655,16 @@ smbios_type4_initializer(struct smbios_structure *temp *(*endaddr) = '\0'; (*endaddr)++; type4->socket = nstrings + 1; + /* Revise cores and threads after update to smbios 3.0 */ + if (cores > 254) + type4->cores = 0; + else + type4->cores = cores; + /* This threads is total threads in a socket */ + if ((cores * threads) > 254) + type4->threads = 0; + else + type4->threads = (cores * threads); curaddr = *endaddr; } From owner-svn-src-all@freebsd.org Fri May 24 06:02:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C46159A621; Fri, 24 May 2019 06:02:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADCC8760C6; Fri, 24 May 2019 06:02:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87F1B18AC6; Fri, 24 May 2019 06:02:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O62ptM042165; Fri, 24 May 2019 06:02:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O62pFK042164; Fri, 24 May 2019 06:02:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905240602.x4O62pFK042164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 May 2019 06:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348227 - head/sys/dev/amdgpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/amdgpio X-SVN-Commit-Revision: 348227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADCC8760C6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 06:02:52 -0000 Author: avg Date: Fri May 24 06:02:51 2019 New Revision: 348227 URL: https://svnweb.freebsd.org/changeset/base/348227 Log: amdgpio: remove new line symbols from pin names That made, for example, gpioc -l output quite hard to read and parse. Also, fix formatting of a nearby statement with too long lines. MFC after: 2 weeks Modified: head/sys/dev/amdgpio/amdgpio.c Modified: head/sys/dev/amdgpio/amdgpio.c ============================================================================== --- head/sys/dev/amdgpio/amdgpio.c Fri May 24 05:47:16 2019 (r348226) +++ head/sys/dev/amdgpio/amdgpio.c Fri May 24 06:02:51 2019 (r348227) @@ -386,7 +386,7 @@ amdgpio_attach(device_t dev) /* Initialize all possible pins to be Invalid */ for (i = 0; i < AMD_GPIO_PINS_MAX ; i++) { snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, - "Unexposed PIN %d\n", i); + "Unexposed PIN %d", i); sc->sc_gpio_pins[i].gp_pin = -1; sc->sc_gpio_pins[i].gp_caps = 0; sc->sc_gpio_pins[i].gp_flags = 0; @@ -396,12 +396,13 @@ amdgpio_attach(device_t dev) for (i = 0; i < AMD_GPIO_PINS_EXPOSED ; i++) { pin = kernzp_pins[i].pin_num; bank = pin/AMD_GPIO_PINS_PER_BANK; - snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s\n", + snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s", AMD_GPIO_PREFIX, bank, kernzp_pins[i].pin_name); sc->sc_gpio_pins[pin].gp_pin = pin; sc->sc_gpio_pins[pin].gp_caps = AMDGPIO_DEFAULT_CAPS; - sc->sc_gpio_pins[pin].gp_flags = (amdgpio_is_pin_output(sc, pin)? - GPIO_PIN_OUTPUT : GPIO_PIN_INPUT); + sc->sc_gpio_pins[pin].gp_flags = + amdgpio_is_pin_output(sc, pin) ? + GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; } sc->sc_busdev = gpiobus_attach_bus(dev); From owner-svn-src-all@freebsd.org Fri May 24 06:06:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAB6159A78E; Fri, 24 May 2019 06:06:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8005876267; Fri, 24 May 2019 06:06:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70E0C18ACA; Fri, 24 May 2019 06:06:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O66geZ042366; Fri, 24 May 2019 06:06:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O66gqw042365; Fri, 24 May 2019 06:06:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905240606.x4O66gqw042365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 May 2019 06:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348228 - head/sys/dev/amdgpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/amdgpio X-SVN-Commit-Revision: 348228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8005876267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 06:06:43 -0000 Author: avg Date: Fri May 24 06:06:42 2019 New Revision: 348228 URL: https://svnweb.freebsd.org/changeset/base/348228 Log: amdgpio: fix reading status of input pins AMD FCH GPIO controller uses different bits for setting the output level and for reporting the input level. MFC after: 2 weeks Modified: head/sys/dev/amdgpio/amdgpio.c Modified: head/sys/dev/amdgpio/amdgpio.c ============================================================================== --- head/sys/dev/amdgpio/amdgpio.c Fri May 24 06:02:51 2019 (r348227) +++ head/sys/dev/amdgpio/amdgpio.c Fri May 24 06:06:42 2019 (r348228) @@ -264,10 +264,17 @@ amdgpio_pin_get(device_t dev, uint32_t pin, unsigned i reg = AMDGPIO_PIN_REGISTER(pin); val = amdgpio_read_4(sc, reg); - if (val & BIT(OUTPUT_VALUE_OFF)) - *value = GPIO_PIN_HIGH; - else - *value = GPIO_PIN_LOW; + if ((sc->sc_gpio_pins[pin].gp_flags & GPIO_PIN_OUTPUT) != 0) { + if (val & BIT(OUTPUT_VALUE_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } else { + if (val & BIT(PIN_STS_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } dprintf("pin %d value 0x%x\n", pin, *value); From owner-svn-src-all@freebsd.org Fri May 24 06:07:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF57C159A80C; Fri, 24 May 2019 06:07:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD25763B2; Fri, 24 May 2019 06:07:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A79318ACB; Fri, 24 May 2019 06:07:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O67Y34042443; Fri, 24 May 2019 06:07:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O67YvI042442; Fri, 24 May 2019 06:07:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905240607.x4O67YvI042442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 May 2019 06:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348229 - head/sys/dev/amdgpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/amdgpio X-SVN-Commit-Revision: 348229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DD25763B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 06:07:35 -0000 Author: avg Date: Fri May 24 06:07:33 2019 New Revision: 348229 URL: https://svnweb.freebsd.org/changeset/base/348229 Log: amdgpio: small formatting cleanup MFC after: 2 weeks Modified: head/sys/dev/amdgpio/amdgpio.c Modified: head/sys/dev/amdgpio/amdgpio.c ============================================================================== --- head/sys/dev/amdgpio/amdgpio.c Fri May 24 06:06:42 2019 (r348228) +++ head/sys/dev/amdgpio/amdgpio.c Fri May 24 06:07:33 2019 (r348229) @@ -352,14 +352,13 @@ amdgpio_probe(device_t dev) { static char *gpio_ids[] = { "AMD0030", "AMDI0030", NULL }; int rv; - + if (acpi_disabled("gpio")) return (ENXIO); rv = ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids, NULL); - if (rv <= 0) device_set_desc(dev, "AMD GPIO Controller"); - + return (rv); } From owner-svn-src-all@freebsd.org Fri May 24 06:27:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11AC7159E1DA; Fri, 24 May 2019 06:27:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F6C76CB6; Fri, 24 May 2019 06:27:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8351E18E31; Fri, 24 May 2019 06:27:12 +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 x4O6RC5i052948; Fri, 24 May 2019 06:27:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O6RCHe052946; Fri, 24 May 2019 06:27:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201905240627.x4O6RCHe052946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 24 May 2019 06:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348230 - in stable/12: share/man/man4 sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet X-SVN-Commit-Revision: 348230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7F6C76CB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 06:27:13 -0000 Author: glebius Date: Fri May 24 06:27:11 2019 New Revision: 348230 URL: https://svnweb.freebsd.org/changeset/base/348230 Log: Merge r344481: Support struct ip_mreqn as argument for IP_ADD_MEMBERSHIP. Legacy support for struct ip_mreq remains in place. The struct ip_mreqn is Linux extension to classic BSD multicast API. It has extra field allowing to specify the interface index explicitly. In Linux it used as argument for IP_MULTICAST_IF and IP_ADD_MEMBERSHIP. FreeBSD kernel also declares this structure and supports it as argument to IP_MULTICAST_IF since r170613. So, we have structure declared but not fully supported, this confused third party application configure scripts. Code handling IP_ADD_MEMBERSHIP was mixed together with code for IP_ADD_SOURCE_MEMBERSHIP. Bringing legacy and new structure support into the mess would made the "argument switcharoo" intolerable, so code was separated into its own switch case clause. Modified: stable/12/share/man/man4/ip.4 stable/12/sys/netinet/in_mcast.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ip.4 ============================================================================== --- stable/12/share/man/man4/ip.4 Fri May 24 06:07:33 2019 (r348229) +++ stable/12/share/man/man4/ip.4 Fri May 24 06:27:11 2019 (r348230) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd February 22, 2019 .Dt IP 4 .Os .Sh NAME @@ -571,32 +571,55 @@ To join a multicast group, use the .Dv IP_ADD_MEMBERSHIP option: .Bd -literal -struct ip_mreq mreq; -setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +struct ip_mreqn mreqn; +setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreqn, sizeof(mreqn)); .Ed .Pp where -.Fa mreq +.Fa mreqn is the following structure: .Bd -literal -struct ip_mreq { +struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ + int imr_ifindex; /* interface index */ } .Ed .Pp -.Va imr_interface -should be set to the -.Tn IP -address of a particular multicast-capable interface if +.Va imr_ifindex +should be set to the index of a particular multicast-capable interface if the host is multihomed. -It may be set to -.Dv INADDR_ANY -to choose the default interface, although this is not recommended; -this is considered to be the first interface corresponding -to the default route. -Otherwise, the first multicast-capable interface -configured in the system will be used. +If +.Va imr_ifindex +is non-zero, value of +.Va imr_interface +is ignored. +Otherwise, if +.Va imr_ifindex +is 0, kernel will use IP address from +.Va imr_interface +to lookup the interface. +Value of +.Va imr_interface +may be set to +.Va INADDR_ANY +to choose the default interface, although this is not recommended; this is +considered to be the first interface corresponding to the default route. +Otherwise, the first multicast-capable interface configured in the system +will be used. +.Pp +Legacy +.Vt "struct ip_mreq" , +that lacks +.Va imr_ifindex +field is also supported by +.Dv IP_ADD_MEMBERSHIP +setsockopt. +In this case kernel would behave as if +.Va imr_ifindex +was set to zero: +.Va imr_interface +will be used to lookup interface. .Pp Prior to .Fx 7.0 , Modified: stable/12/sys/netinet/in_mcast.c ============================================================================== --- stable/12/sys/netinet/in_mcast.c Fri May 24 06:07:33 2019 (r348229) +++ stable/12/sys/netinet/in_mcast.c Fri May 24 06:27:11 2019 (r348230) @@ -2046,40 +2046,49 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt ssa->ss.ss_family = AF_UNSPEC; switch (sopt->sopt_name) { - case IP_ADD_MEMBERSHIP: - case IP_ADD_SOURCE_MEMBERSHIP: { - struct ip_mreq_source mreqs; + case IP_ADD_MEMBERSHIP: { + struct ip_mreqn mreqn; - if (sopt->sopt_name == IP_ADD_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq), - sizeof(struct ip_mreq)); - /* - * Do argument switcharoo from ip_mreq into - * ip_mreq_source to avoid using two instances. - */ - mreqs.imr_interface = mreqs.imr_sourceaddr; - mreqs.imr_sourceaddr.s_addr = INADDR_ANY; - } else if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq_source), - sizeof(struct ip_mreq_source)); - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreqn), sizeof(struct ip_mreqn)); + else + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreq), sizeof(struct ip_mreq)); if (error) return (error); gsa->sin.sin_family = AF_INET; gsa->sin.sin_len = sizeof(struct sockaddr_in); - gsa->sin.sin_addr = mreqs.imr_multiaddr; + gsa->sin.sin_addr = mreqn.imr_multiaddr; + if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) + return (EINVAL); - if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - ssa->sin.sin_family = AF_INET; - ssa->sin.sin_len = sizeof(struct sockaddr_in); - ssa->sin.sin_addr = mreqs.imr_sourceaddr; - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn) && + mreqn.imr_ifindex != 0) + ifp = ifnet_byindex(mreqn.imr_ifindex); + else + ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, + mreqn.imr_address); + break; + } + case IP_ADD_SOURCE_MEMBERSHIP: { + struct ip_mreq_source mreqs; + error = sooptcopyin(sopt, &mreqs, sizeof(struct ip_mreq_source), + sizeof(struct ip_mreq_source)); + if (error) + return (error); + + gsa->sin.sin_family = ssa->sin.sin_family = AF_INET; + gsa->sin.sin_len = ssa->sin.sin_len = + sizeof(struct sockaddr_in); + + gsa->sin.sin_addr = mreqs.imr_multiaddr; if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + + ssa->sin.sin_addr = mreqs.imr_sourceaddr; ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); From owner-svn-src-all@freebsd.org Fri May 24 06:49:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67109159EC96; Fri, 24 May 2019 06:49:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 097C8777EE; Fri, 24 May 2019 06:49:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0D3019182; Fri, 24 May 2019 06:49:47 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O6nlHv063552; Fri, 24 May 2019 06:49:47 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O6nlKZ063551; Fri, 24 May 2019 06:49:47 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905240649.x4O6nlKZ063551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 24 May 2019 06:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348231 - head/lib/geom/eli X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/geom/eli X-SVN-Commit-Revision: 348231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 097C8777EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 06:49:48 -0000 Author: lwhsu Date: Fri May 24 06:49:47 2019 New Revision: 348231 URL: https://svnweb.freebsd.org/changeset/base/348231 Log: Correct the argument passed to g_eli_algo2str() MFC with: r348206 Sponsored by: The FreeBSD Foundation Modified: head/lib/geom/eli/geom_eli.c Modified: head/lib/geom/eli/geom_eli.c ============================================================================== --- head/lib/geom/eli/geom_eli.c Fri May 24 06:27:11 2019 (r348230) +++ head/lib/geom/eli/geom_eli.c Fri May 24 06:49:47 2019 (r348231) @@ -818,7 +818,7 @@ eli_init(struct gctl_req *req) case CRYPTO_3DES_CBC: case CRYPTO_BLF_CBC: gctl_error(req, "The %s encryption algorithm is deprecated.", - g_eli_algo2str(md.md_aalgo)); + g_eli_algo2str(md.md_ealgo)); return; } val = gctl_get_intmax(req, "keylen"); From owner-svn-src-all@freebsd.org Fri May 24 08:40:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C61315A36E6; Fri, 24 May 2019 08:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F97582B78; Fri, 24 May 2019 08:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DCC81A43A; Fri, 24 May 2019 08:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O8ebme022194; Fri, 24 May 2019 08:40:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O8ebk4022176; Fri, 24 May 2019 08:40:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905240840.x4O8ebk4022176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 May 2019 08:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348232 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 348232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F97582B78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 08:40:38 -0000 Author: ae Date: Fri May 24 08:40:37 2019 New Revision: 348232 URL: https://svnweb.freebsd.org/changeset/base/348232 Log: MFC r347383: In mld_v2_cancel_link_timers() check number of references and disconnect inm before releasing the last reference. This fixes possible panics and assertion. PR: 237329 Reviewed by: mmacy Modified: stable/12/sys/netinet6/mld6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/mld6.c ============================================================================== --- stable/12/sys/netinet6/mld6.c Fri May 24 06:49:47 2019 (r348231) +++ stable/12/sys/netinet6/mld6.c Fri May 24 08:40:37 2019 (r348232) @@ -1704,6 +1704,8 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) * version, we need to release the final * reference held for issuing the INCLUDE {}. */ + if (inm->in6m_refcount == 1) + in6m_disconnect_locked(&inmh, inm); in6m_rele_locked(&inmh, inm); /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: From owner-svn-src-all@freebsd.org Fri May 24 08:42:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 953BA15A3976; Fri, 24 May 2019 08:42:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0F282FCF; Fri, 24 May 2019 08:42:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C111A5E9; Fri, 24 May 2019 08:42:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O8gZZ4026798; Fri, 24 May 2019 08:42:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O8gYRa026791; Fri, 24 May 2019 08:42:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905240842.x4O8gYRa026791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 May 2019 08:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348233 - in stable/12: sbin/ifconfig share/man/man4 sys/modules/if_gre sys/net sys/netinet sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: sbin/ifconfig share/man/man4 sys/modules/if_gre sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 348233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E0F282FCF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 08:42:36 -0000 Author: ae Date: Fri May 24 08:42:34 2019 New Revision: 348233 URL: https://svnweb.freebsd.org/changeset/base/348233 Log: MFC r346630: Add GRE-in-UDP encapsulation support as defined in RFC8086. This GRE-in-UDP encapsulation allows the UDP source port field to be used as an entropy field for load-balancing of GRE traffic in transit networks. Also most of multiqueue network cards are able distribute incoming UDP datagrams to different NIC queues, while very little are able do this for GRE packets. When an administrator enables UDP encapsulation with command `ifconfig gre0 udpencap`, the driver creates kernel socket, that binds to tunnel source address and after udp_set_kernel_tunneling() starts receiving of all UDP packets destined to 4754 port. Each kernel socket maintains list of tunnels with different destination addresses. Thus when several tunnels use the same source address, they all handled by single socket. The IP[V6]_BINDANY socket option is used to be able bind socket to source address even if it is not yet available in the system. This may happen on system boot, when gre(4) interface is created before source address become available. The encapsulation and sending of packets is done directly from gre(4) into ip[6]_output() without using sockets. Reviewed by: eugen Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19921 Modified: stable/12/sbin/ifconfig/ifgre.c stable/12/share/man/man4/gre.4 stable/12/sys/modules/if_gre/Makefile stable/12/sys/net/if_gre.c stable/12/sys/net/if_gre.h stable/12/sys/netinet/ip_gre.c stable/12/sys/netinet6/ip6_gre.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifgre.c ============================================================================== --- stable/12/sbin/ifconfig/ifgre.c Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sbin/ifconfig/ifgre.c Fri May 24 08:42:34 2019 (r348233) @@ -44,15 +44,16 @@ __FBSDID("$FreeBSD$"); #include "ifconfig.h" -#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ" +#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ\03UDPENCAP" static void gre_status(int s); static void gre_status(int s) { - uint32_t opts = 0; + uint32_t opts, port; + opts = 0; ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GREGKEY, &ifr) == 0) if (opts != 0) @@ -60,6 +61,11 @@ gre_status(int s) opts = 0; if (ioctl(s, GREGOPTS, &ifr) != 0 || opts == 0) return; + + port = 0; + ifr.ifr_data = (caddr_t)&port; + if (ioctl(s, GREGPORT, &ifr) == 0 && port != 0) + printf("\tudpport: %u\n", port); printb("\toptions", opts, GREBITS); putchar('\n'); } @@ -77,6 +83,18 @@ setifgrekey(const char *val, int dummy __unused, int s } static void +setifgreport(const char *val, int dummy __unused, int s, + const struct afswtch *afp) +{ + uint32_t udpport = strtol(val, NULL, 0); + + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + ifr.ifr_data = (caddr_t)&udpport; + if (ioctl(s, GRESPORT, (caddr_t)&ifr) < 0) + warn("ioctl (set udpport)"); +} + +static void setifgreopts(const char *val, int d, int s, const struct afswtch *afp) { uint32_t opts; @@ -101,10 +119,13 @@ setifgreopts(const char *val, int d, int s, const stru static struct cmd gre_cmds[] = { DEF_CMD_ARG("grekey", setifgrekey), + DEF_CMD_ARG("udpport", setifgreport), DEF_CMD("enable_csum", GRE_ENABLE_CSUM, setifgreopts), DEF_CMD("-enable_csum",-GRE_ENABLE_CSUM,setifgreopts), DEF_CMD("enable_seq", GRE_ENABLE_SEQ, setifgreopts), DEF_CMD("-enable_seq",-GRE_ENABLE_SEQ, setifgreopts), + DEF_CMD("udpencap", GRE_UDPENCAP, setifgreopts), + DEF_CMD("-udpencap",-GRE_UDPENCAP, setifgreopts), }; static struct afswtch af_gre = { .af_name = "af_gre", Modified: stable/12/share/man/man4/gre.4 ============================================================================== --- stable/12/share/man/man4/gre.4 Fri May 24 08:40:37 2019 (r348232) +++ stable/12/share/man/man4/gre.4 Fri May 24 08:42:34 2019 (r348233) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2015 +.Dd April 24, 2019 .Dt GRE 4 .Os .Sh NAME @@ -89,7 +89,45 @@ A value of 0 disables the key option. Enables checksum calculation for outgoing packets. .It Ar enable_seq Enables use of sequence number field in the GRE header for outgoing packets. +.It Ar udpencap +Enables UDP-in-GRE encapsulation (see the +.Sx GRE-IN-UDP ENCAPSULATION +Section below for details). +.It Ar udpport +Set the source UDP port for outgoing packets. +A value of 0 disables the persistence of source UDP port for outgoing packets. +See the +.Sx GRE-IN-UDP ENCAPSULATION +Section below for details. .El +.Sh GRE-IN-UDP ENCAPSULATION +The +.Nm +supports GRE in UDP encapsulation as defined in RFC 8086. +A GRE in UDP tunnel offers the possibility of better performance for +load-balancing GRE traffic in transit networks. +Encapsulating GRE in UDP enables use of the UDP source port to provide +entropy to ECMP hashing. +.Pp +The GRE in UDP tunnel uses single value 4754 as UDP destination port. +The UDP source port contains a 14-bit entropy value that is generated +by the encapsulator to identify a flow for the encapsulated packet. +The +.Ar udpport +option can be used to disable this behaviour and use single source UDP +port value. +The value of +.Ar udpport +should be within the ephemeral port range, i.e., 49152 to 65535 by default. +.Pp +Note that a GRE in UDP tunnel is unidirectional; the tunnel traffic is not +expected to be returned back to the UDP source port values used to generate +entropy. +This may impact NAPT (Network Address Port Translator) middleboxes. +If such tunnels are expected to be used on a path with a middlebox, +the tunnel can be configured either to disable use of the UDP source port +for entropy or to enable middleboxes to pass packets with UDP source port +entropy. .Sh EXAMPLES .Bd -literal 192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.* Modified: stable/12/sys/modules/if_gre/Makefile ============================================================================== --- stable/12/sys/modules/if_gre/Makefile Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sys/modules/if_gre/Makefile Fri May 24 08:42:34 2019 (r348233) @@ -5,7 +5,7 @@ SYSDIR?=${SRCTOP}/sys .include "${SYSDIR}/conf/kern.opts.mk" KMOD= if_gre -SRCS= if_gre.c opt_inet.h opt_inet6.h +SRCS= if_gre.c opt_inet.h opt_inet6.h opt_rss.h SRCS.INET= ip_gre.c SRCS.INET6= ip6_gre.c Modified: stable/12/sys/net/if_gre.c ============================================================================== --- stable/12/sys/net/if_gre.c Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sys/net/if_gre.c Fri May 24 08:42:34 2019 (r348233) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #include #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,19 +67,27 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef INET #include #include #include +#ifdef RSS +#include #endif +#endif #ifdef INET6 #include #include #include +#ifdef RSS +#include #endif +#endif #include +#include #include #include @@ -151,6 +161,7 @@ vnet_gre_uninit(const void *unused __unused) #ifdef INET6 in6_gre_uninit(); #endif + /* XXX: epoch_call drain */ } VNET_SYSUNINIT(vnet_gre_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gre_uninit, NULL); @@ -266,6 +277,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GRESKEY: case GRESOPTS: + case GRESPORT: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; if ((error = copyin(ifr_data_get_ptr(ifr), &opt, @@ -281,23 +293,45 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (sc->gre_options == opt) break; + } else if (cmd == GRESPORT) { + if (opt != 0 && (opt < V_ipport_hifirstauto || + opt > V_ipport_hilastauto)) { + error = EINVAL; + break; + } + if (sc->gre_port == opt) + break; + if ((sc->gre_options & GRE_UDPENCAP) == 0) { + /* + * UDP encapsulation is not enabled, thus + * there is no need to reattach softc. + */ + sc->gre_port = opt; + break; + } } switch (sc->gre_family) { #ifdef INET case AF_INET: - in_gre_setopts(sc, cmd, opt); + error = in_gre_setopts(sc, cmd, opt); break; #endif #ifdef INET6 case AF_INET6: - in6_gre_setopts(sc, cmd, opt); + error = in6_gre_setopts(sc, cmd, opt); break; #endif default: + /* + * Tunnel is not yet configured. + * We can just change any parameters. + */ if (cmd == GRESKEY) sc->gre_key = opt; - else + if (cmd == GRESOPTS) sc->gre_options = opt; + if (cmd == GRESPORT) + sc->gre_port = opt; break; } /* @@ -313,6 +347,10 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr), sizeof(sc->gre_options)); break; + case GREGPORT: + error = copyout(&sc->gre_port, ifr_data_get_ptr(ifr), + sizeof(sc->gre_port)); + break; default: error = EINVAL; break; @@ -337,6 +375,7 @@ end: static void gre_delete_tunnel(struct gre_softc *sc) { + struct gre_socket *gs; sx_assert(&gre_ioctl_sx, SA_XLOCKED); if (sc->gre_family != 0) { @@ -346,6 +385,16 @@ gre_delete_tunnel(struct gre_softc *sc) free(sc->gre_hdr, M_GRE); sc->gre_family = 0; } + /* + * If this Tunnel was the last one that could use UDP socket, + * we should unlink socket from hash table and close it. + */ + if ((gs = sc->gre_so) != NULL && CK_LIST_EMPTY(&gs->list)) { + CK_LIST_REMOVE(gs, chain); + soclose(gs->so); + epoch_call(net_epoch_preempt, &gs->epoch_ctx, gre_sofree); + sc->gre_so = NULL; + } GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN); } @@ -372,8 +421,39 @@ gre_hashdestroy(struct gre_list *hash) } void -gre_updatehdr(struct gre_softc *sc, struct grehdr *gh) +gre_sofree(epoch_context_t ctx) { + struct gre_socket *gs; + + gs = __containerof(ctx, struct gre_socket, epoch_ctx); + free(gs, M_GRE); +} + +static __inline uint16_t +gre_cksum_add(uint16_t sum, uint16_t a) +{ + uint16_t res; + + res = sum + a; + return (res + (res < a)); +} + +void +gre_update_udphdr(struct gre_softc *sc, struct udphdr *udp, uint16_t csum) +{ + + sx_assert(&gre_ioctl_sx, SA_XLOCKED); + MPASS(sc->gre_options & GRE_UDPENCAP); + + udp->uh_dport = htons(GRE_UDPPORT); + udp->uh_sport = htons(sc->gre_port); + udp->uh_sum = csum; + udp->uh_ulen = 0; +} + +void +gre_update_hdr(struct gre_softc *sc, struct grehdr *gh) +{ uint32_t *opts; uint16_t flags; @@ -539,6 +619,52 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) *opts = htonl(seq); } +static uint32_t +gre_flowid(struct gre_softc *sc, struct mbuf *m, uint32_t af) +{ + uint32_t flowid; + + if ((sc->gre_options & GRE_UDPENCAP) == 0 || sc->gre_port != 0) + return (0); +#ifndef RSS + switch (af) { +#ifdef INET + case AF_INET: + flowid = mtod(m, struct ip *)->ip_src.s_addr ^ + mtod(m, struct ip *)->ip_dst.s_addr; + break; +#endif +#ifdef INET6 + case AF_INET6: + flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ + mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; + break; +#endif + default: + flowid = 0; + } +#else /* RSS */ + switch (af) { +#ifdef INET + case AF_INET: + flowid = rss_hash_ip4_2tuple(mtod(m, struct ip *)->ip_src, + mtod(m, struct ip *)->ip_dst); + break; +#endif +#ifdef INET6 + case AF_INET6: + flowid = rss_hash_ip6_2tuple( + &mtod(m, struct ip6_hdr *)->ip6_src, + &mtod(m, struct ip6_hdr *)->ip6_dst); + break; +#endif + default: + flowid = 0; + } +#endif + return (flowid); +} + #define MTAG_GRE 1307983903 static int gre_transmit(struct ifnet *ifp, struct mbuf *m) @@ -546,7 +672,8 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; - uint32_t af; + struct udphdr *uh; + uint32_t af, flowid; int error, len; uint16_t proto; @@ -573,6 +700,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) af = m->m_pkthdr.csum_data; BPF_MTAP2(ifp, &af, sizeof(af), m); m->m_flags &= ~(M_BCAST|M_MCAST); + flowid = gre_flowid(sc, m, af); M_SETFIB(m, sc->gre_fibnum); M_PREPEND(m, sc->gre_hlen, M_NOWAIT); if (m == NULL) { @@ -614,6 +742,19 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) error = ENETDOWN; goto drop; } + if (sc->gre_options & GRE_UDPENCAP) { + uh = (struct udphdr *)mtodo(m, len); + uh->uh_sport |= htons(V_ipport_hifirstauto) | + (flowid >> 16) | (flowid & 0xFFFF); + uh->uh_sport = htons(ntohs(uh->uh_sport) % + V_ipport_hilastauto); + uh->uh_ulen = htons(m->m_pkthdr.len - len); + uh->uh_sum = gre_cksum_add(uh->uh_sum, + htons(m->m_pkthdr.len - len + IPPROTO_UDP)); + m->m_pkthdr.csum_flags = sc->gre_csumflags; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + len += sizeof(struct udphdr); + } gh = (struct grehdr *)mtodo(m, len); gh->gre_proto = proto; if (sc->gre_options & GRE_ENABLE_SEQ) @@ -631,7 +772,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) #endif #ifdef INET6 case AF_INET6: - error = in6_gre_output(m, af, sc->gre_hlen); + error = in6_gre_output(m, af, sc->gre_hlen, flowid); break; #endif default: Modified: stable/12/sys/net/if_gre.h ============================================================================== --- stable/12/sys/net/if_gre.h Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sys/net/if_gre.h Fri May 24 08:42:34 2019 (r348233) @@ -53,15 +53,36 @@ struct greip { struct ip gi_ip; struct grehdr gi_gre; } __packed; -#endif +struct greudp { + struct ip gi_ip; + struct udphdr gi_udp; + struct grehdr gi_gre; +} __packed; +#endif /* INET */ + #ifdef INET6 struct greip6 { struct ip6_hdr gi6_ip6; struct grehdr gi6_gre; } __packed; -#endif +struct greudp6 { + struct ip6_hdr gi6_ip6; + struct udphdr gi6_udp; + struct grehdr gi6_gre; +} __packed; +#endif /* INET6 */ + +CK_LIST_HEAD(gre_list, gre_softc); +CK_LIST_HEAD(gre_sockets, gre_socket); +struct gre_socket { + struct socket *so; + struct gre_list list; + CK_LIST_ENTRY(gre_socket) chain; + struct epoch_context epoch_ctx; +}; + struct gre_softc { struct ifnet *gre_ifp; int gre_family; /* AF of delivery header */ @@ -69,22 +90,26 @@ struct gre_softc { uint32_t gre_oseq; uint32_t gre_key; uint32_t gre_options; + uint32_t gre_csumflags; + uint32_t gre_port; u_int gre_fibnum; u_int gre_hlen; /* header size */ union { void *hdr; #ifdef INET - struct greip *gihdr; + struct greip *iphdr; + struct greudp *udphdr; #endif #ifdef INET6 - struct greip6 *gi6hdr; + struct greip6 *ip6hdr; + struct greudp6 *udp6hdr; #endif } gre_uhdr; + struct gre_socket *gre_so; CK_LIST_ENTRY(gre_softc) chain; CK_LIST_ENTRY(gre_softc) srchash; }; -CK_LIST_HEAD(gre_list, gre_softc); MALLOC_DECLARE(M_GRE); #ifndef GRE_HASH_SIZE @@ -98,28 +123,35 @@ MALLOC_DECLARE(M_GRE); #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) #define gre_hdr gre_uhdr.hdr -#define gre_gihdr gre_uhdr.gihdr -#define gre_gi6hdr gre_uhdr.gi6hdr -#define gre_oip gre_gihdr->gi_ip -#define gre_oip6 gre_gi6hdr->gi6_ip6 +#define gre_iphdr gre_uhdr.iphdr +#define gre_ip6hdr gre_uhdr.ip6hdr +#define gre_udphdr gre_uhdr.udphdr +#define gre_udp6hdr gre_uhdr.udp6hdr +#define gre_oip gre_iphdr->gi_ip +#define gre_udp gre_udphdr->gi_udp +#define gre_oip6 gre_ip6hdr->gi6_ip6 +#define gre_udp6 gre_udp6hdr->gi6_udp + struct gre_list *gre_hashinit(void); void gre_hashdestroy(struct gre_list *); int gre_input(struct mbuf *, int, int, void *); -void gre_updatehdr(struct gre_softc *, struct grehdr *); +void gre_update_hdr(struct gre_softc *, struct grehdr *); +void gre_update_udphdr(struct gre_softc *, struct udphdr *, uint16_t); +void gre_sofree(epoch_context_t); void in_gre_init(void); void in_gre_uninit(void); -void in_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in_gre_setopts(struct gre_softc *, u_long, uint32_t); int in_gre_ioctl(struct gre_softc *, u_long, caddr_t); int in_gre_output(struct mbuf *, int, int); void in6_gre_init(void); void in6_gre_uninit(void); -void in6_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in6_gre_setopts(struct gre_softc *, u_long, uint32_t); int in6_gre_ioctl(struct gre_softc *, u_long, caddr_t); -int in6_gre_output(struct mbuf *, int, int); +int in6_gre_output(struct mbuf *, int, int, uint32_t); /* * CISCO uses special type for GRE tunnel created as part of WCCP * connection, while in fact those packets are just IPv4 encapsulated @@ -139,9 +171,15 @@ int in6_gre_output(struct mbuf *, int, int); #define GRESKEY _IOW('i', 108, struct ifreq) #define GREGOPTS _IOWR('i', 109, struct ifreq) #define GRESOPTS _IOW('i', 110, struct ifreq) +#define GREGPORT _IOWR('i', 111, struct ifreq) +#define GRESPORT _IOW('i', 112, struct ifreq) +/* GRE-in-UDP encapsulation destination port as defined in RFC8086 */ +#define GRE_UDPPORT 4754 + #define GRE_ENABLE_CSUM 0x0001 #define GRE_ENABLE_SEQ 0x0002 -#define GRE_OPTMASK (GRE_ENABLE_CSUM|GRE_ENABLE_SEQ) +#define GRE_UDPENCAP 0x0004 +#define GRE_OPTMASK (GRE_ENABLE_CSUM|GRE_ENABLE_SEQ|GRE_UDPENCAP) #endif /* _NET_IF_GRE_H_ */ Modified: stable/12/sys/netinet/ip_gre.c ============================================================================== --- stable/12/sys/netinet/ip_gre.c Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sys/netinet/ip_gre.c Fri May 24 08:42:34 2019 (r348233) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,15 +59,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include +#include #ifdef INET6 #include #endif #include +#include #define GRE_TTL 30 VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; @@ -74,14 +79,22 @@ VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); +struct in_gre_socket { + struct gre_socket base; + in_addr_t addr; +}; +VNET_DEFINE_STATIC(struct gre_sockets *, ipv4_sockets) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv4_srchashtbl) = NULL; +#define V_ipv4_sockets VNET(ipv4_sockets) #define V_ipv4_hashtbl VNET(ipv4_hashtbl) #define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) #define GRE_SRCHASH(src) (V_ipv4_srchashtbl[\ fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) +#define GRE_SOCKHASH(src) (V_ipv4_sockets[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ (sc)->gre_oip.ip_dst.s_addr) @@ -94,17 +107,43 @@ in_gre_hashval(in_addr_t src, in_addr_t dst) return (fnv_32_buf(&dst, sizeof(dst), ret)); } +static struct gre_socket* +in_gre_lookup_socket(in_addr_t addr) +{ + struct gre_socket *gs; + struct in_gre_socket *s; + + CK_LIST_FOREACH(gs, &GRE_SOCKHASH(addr), chain) { + s = __containerof(gs, struct in_gre_socket, base); + if (s->addr == addr) + break; + } + return (gs); +} + static int -in_gre_checkdup(const struct gre_softc *sc, in_addr_t src, in_addr_t dst) +in_gre_checkdup(const struct gre_softc *sc, in_addr_t src, in_addr_t dst, + uint32_t opts) { + struct gre_list *head; struct gre_softc *tmp; + struct gre_socket *gs; if (sc->gre_family == AF_INET && sc->gre_oip.ip_src.s_addr == src && - sc->gre_oip.ip_dst.s_addr == dst) + sc->gre_oip.ip_dst.s_addr == dst && + (sc->gre_options & GRE_UDPENCAP) == (opts & GRE_UDPENCAP)) return (EEXIST); - CK_LIST_FOREACH(tmp, &GRE_HASH(src, dst), chain) { + if (opts & GRE_UDPENCAP) { + gs = in_gre_lookup_socket(src); + if (gs == NULL) + return (0); + head = &gs->list; + } else + head = &GRE_HASH(src, dst); + + CK_LIST_FOREACH(tmp, head, chain) { if (tmp == sc) continue; if (tmp->gre_oip.ip_src.s_addr == src && @@ -181,35 +220,228 @@ in_gre_srcaddr(void *arg __unused, const struct sockad } static void +in_gre_udp_input(struct mbuf *m, int off, struct inpcb *inp, + const struct sockaddr *sa, void *ctx) +{ + struct epoch_tracker et; + struct gre_socket *gs; + struct gre_softc *sc; + in_addr_t dst; + + NET_EPOCH_ENTER(et); + /* + * udp_append() holds reference to inp, it is safe to check + * inp_flags2 without INP_RLOCK(). + * If socket was closed before we have entered NET_EPOCH section, + * INP_FREED flag should be set. Otherwise it should be safe to + * make access to ctx data, because gre_so will be freed by + * gre_sofree() via epoch_call(). + */ + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + NET_EPOCH_EXIT(et); + m_freem(m); + return; + } + + gs = (struct gre_socket *)ctx; + dst = ((const struct sockaddr_in *)sa)->sin_addr.s_addr; + CK_LIST_FOREACH(sc, &gs->list, chain) { + if (sc->gre_oip.ip_dst.s_addr == dst) + break; + } + if (sc != NULL && (GRE2IFP(sc)->if_flags & IFF_UP) != 0){ + gre_input(m, off + sizeof(struct udphdr), IPPROTO_UDP, sc); + NET_EPOCH_EXIT(et); + return; + } + m_freem(m); + NET_EPOCH_EXIT(et); +} + +static int +in_gre_setup_socket(struct gre_softc *sc) +{ + struct sockopt sopt; + struct sockaddr_in sin; + struct in_gre_socket *s; + struct gre_socket *gs; + in_addr_t addr; + int error, value; + + /* + * NOTE: we are protected with gre_ioctl_sx lock. + * + * First check that socket is already configured. + * If so, check that source addres was not changed. + * If address is different, check that there are no other tunnels + * and close socket. + */ + addr = sc->gre_oip.ip_src.s_addr; + gs = sc->gre_so; + if (gs != NULL) { + s = __containerof(gs, struct in_gre_socket, base); + if (s->addr != addr) { + if (CK_LIST_EMPTY(&gs->list)) { + CK_LIST_REMOVE(gs, chain); + soclose(gs->so); + epoch_call(net_epoch_preempt, &gs->epoch_ctx, + gre_sofree); + } + gs = sc->gre_so = NULL; + } + } + + if (gs == NULL) { + /* + * Check that socket for given address is already + * configured. + */ + gs = in_gre_lookup_socket(addr); + if (gs == NULL) { + s = malloc(sizeof(*s), M_GRE, M_WAITOK | M_ZERO); + s->addr = addr; + gs = &s->base; + + error = socreate(sc->gre_family, &gs->so, + SOCK_DGRAM, IPPROTO_UDP, curthread->td_ucred, + curthread); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot create socket: %d\n", error); + free(s, M_GRE); + return (error); + } + + error = udp_set_kernel_tunneling(gs->so, + in_gre_udp_input, NULL, gs); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot set UDP tunneling: %d\n", error); + goto fail; + } + + memset(&sopt, 0, sizeof(sopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = IPPROTO_IP; + sopt.sopt_name = IP_BINDANY; + sopt.sopt_val = &value; + sopt.sopt_valsize = sizeof(value); + value = 1; + error = sosetopt(gs->so, &sopt); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot set IP_BINDANY opt: %d\n", error); + goto fail; + } + + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = addr; + sin.sin_port = htons(GRE_UDPPORT); + error = sobind(gs->so, (struct sockaddr *)&sin, + curthread); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot bind socket: %d\n", error); + goto fail; + } + /* Add socket to the chain */ + CK_LIST_INSERT_HEAD(&GRE_SOCKHASH(addr), gs, chain); + } + } + + /* Add softc to the socket's list */ + CK_LIST_INSERT_HEAD(&gs->list, sc, chain); + sc->gre_so = gs; + return (0); +fail: + soclose(gs->so); + free(s, M_GRE); + return (error); +} + +static int in_gre_attach(struct gre_softc *sc) { + struct grehdr *gh; + int error; - sc->gre_hlen = sizeof(struct greip); + if (sc->gre_options & GRE_UDPENCAP) { + sc->gre_csumflags = CSUM_UDP; + sc->gre_hlen = sizeof(struct greudp); + sc->gre_oip.ip_p = IPPROTO_UDP; + gh = &sc->gre_udphdr->gi_gre; + gre_update_udphdr(sc, &sc->gre_udp, + in_pseudo(sc->gre_oip.ip_src.s_addr, + sc->gre_oip.ip_dst.s_addr, 0)); + } else { + sc->gre_hlen = sizeof(struct greip); + sc->gre_oip.ip_p = IPPROTO_GRE; + gh = &sc->gre_iphdr->gi_gre; + } sc->gre_oip.ip_v = IPVERSION; sc->gre_oip.ip_hl = sizeof(struct ip) >> 2; - sc->gre_oip.ip_p = IPPROTO_GRE; - gre_updatehdr(sc, &sc->gre_gihdr->gi_gre); - CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + gre_update_hdr(sc, gh); + + /* + * If we return error, this means that sc is not linked, + * and caller should reset gre_family and free(sc->gre_hdr). + */ + if (sc->gre_options & GRE_UDPENCAP) { + error = in_gre_setup_socket(sc); + if (error != 0) + return (error); + } else + CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), sc, srchash); + + /* Set IFF_DRV_RUNNING if interface is ready */ + in_gre_set_running(sc); + return (0); } -void +int in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value) { + int error; - MPASS(cmd == GRESKEY || cmd == GRESOPTS); - /* NOTE: we are protected with gre_ioctl_sx lock */ + MPASS(cmd == GRESKEY || cmd == GRESOPTS || cmd == GRESPORT); MPASS(sc->gre_family == AF_INET); + + /* + * If we are going to change encapsulation protocol, do check + * for duplicate tunnels. Return EEXIST here to do not confuse + * user. + */ + if (cmd == GRESOPTS && + (sc->gre_options & GRE_UDPENCAP) != (value & GRE_UDPENCAP) && + in_gre_checkdup(sc, sc->gre_oip.ip_src.s_addr, + sc->gre_oip.ip_dst.s_addr, value) == EADDRNOTAVAIL) + return (EEXIST); + CK_LIST_REMOVE(sc, chain); CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); - if (cmd == GRESKEY) + switch (cmd) { + case GRESKEY: sc->gre_key = value; - else + break; + case GRESOPTS: sc->gre_options = value; - in_gre_attach(sc); + break; + case GRESPORT: + sc->gre_port = value; + break; + } + error = in_gre_attach(sc); + if (error != 0) { + sc->gre_family = 0; + free(sc->gre_hdr, M_GRE); + } + return (error); } int @@ -241,9 +473,10 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gre_hashinit(); V_ipv4_srchashtbl = gre_hashinit(); + V_ipv4_sockets = (struct gre_sockets *)gre_hashinit(); } error = in_gre_checkdup(sc, src->sin_addr.s_addr, - dst->sin_addr.s_addr); + dst->sin_addr.s_addr, sc->gre_options); if (error == EADDRNOTAVAIL) break; if (error == EEXIST) { @@ -251,7 +484,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t error = 0; break; } - ip = malloc(sizeof(struct greip) + 3 * sizeof(uint32_t), + ip = malloc(sizeof(struct greudp) + 3 * sizeof(uint32_t), M_GRE, M_WAITOK | M_ZERO); ip->ip_src.s_addr = src->sin_addr.s_addr; ip->ip_dst.s_addr = dst->sin_addr.s_addr; @@ -267,8 +500,11 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t sc->gre_hdr = ip; sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; - in_gre_attach(sc); - in_gre_set_running(sc); + error = in_gre_attach(sc); + if (error != 0) { + sc->gre_family = 0; + free(sc->gre_hdr, M_GRE); + } break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -354,5 +590,6 @@ in_gre_uninit(void) V_ipv4_hashtbl = NULL; GRE_WAIT(); gre_hashdestroy(V_ipv4_srchashtbl); + gre_hashdestroy((struct gre_list *)V_ipv4_sockets); } } Modified: stable/12/sys/netinet6/ip6_gre.c ============================================================================== --- stable/12/sys/netinet6/ip6_gre.c Fri May 24 08:40:37 2019 (r348232) +++ stable/12/sys/netinet6/ip6_gre.c Fri May 24 08:42:34 2019 (r348233) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,8 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include +#include #include +#include +#include #include #include #include @@ -65,14 +70,22 @@ SYSCTL_DECL(_net_inet6_ip6); SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets"); +struct in6_gre_socket { + struct gre_socket base; + struct in6_addr addr; /* scope zone id is embedded */ +}; +VNET_DEFINE_STATIC(struct gre_sockets *, ipv6_sockets) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv6_srchashtbl) = NULL; +#define V_ipv6_sockets VNET(ipv6_sockets) #define V_ipv6_hashtbl VNET(ipv6_hashtbl) #define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define GRE_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) #define GRE_SRCHASH(src) (V_ipv6_srchashtbl[\ fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) +#define GRE_SOCKHASH(src) (V_ipv6_sockets[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH(&(sc)->gre_oip6.ip6_src,\ &(sc)->gre_oip6.ip6_dst) @@ -85,18 +98,43 @@ in6_gre_hashval(const struct in6_addr *src, const stru return (fnv_32_buf(dst, sizeof(*dst), ret)); } +static struct gre_socket* +in6_gre_lookup_socket(const struct in6_addr *addr) +{ + struct gre_socket *gs; + struct in6_gre_socket *s; + + CK_LIST_FOREACH(gs, &GRE_SOCKHASH(addr), chain) { + s = __containerof(gs, struct in6_gre_socket, base); + if (IN6_ARE_ADDR_EQUAL(&s->addr, addr)) + break; + } + return (gs); +} + static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 24 09:01:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80AEC15A4764; Fri, 24 May 2019 09:01:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224F283F13; Fri, 24 May 2019 09:01:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 489DC1A918; Fri, 24 May 2019 09:01:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4O91thX035191; Fri, 24 May 2019 09:01:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4O91sqx035190; Fri, 24 May 2019 09:01:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905240901.x4O91sqx035190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 May 2019 09:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348234 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 348234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 224F283F13 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 09:01:56 -0000 Author: ae Date: Fri May 24 09:01:54 2019 New Revision: 348234 URL: https://svnweb.freebsd.org/changeset/base/348234 Log: Fix the build. Use NET_EPOCH_ENTER_ET() and NET_EPOCH_EXIT_ET(). This is direct commit to stable/12, since macros are different in stable/12 and head/ branches. Modified: stable/12/sys/netinet/ip_gre.c stable/12/sys/netinet6/ip6_gre.c Modified: stable/12/sys/netinet/ip_gre.c ============================================================================== --- stable/12/sys/netinet/ip_gre.c Fri May 24 08:42:34 2019 (r348233) +++ stable/12/sys/netinet/ip_gre.c Fri May 24 09:01:54 2019 (r348234) @@ -228,7 +228,7 @@ in_gre_udp_input(struct mbuf *m, int off, struct inpcb struct gre_softc *sc; in_addr_t dst; - NET_EPOCH_ENTER(et); + NET_EPOCH_ENTER_ET(et); /* * udp_append() holds reference to inp, it is safe to check * inp_flags2 without INP_RLOCK(). @@ -238,7 +238,7 @@ in_gre_udp_input(struct mbuf *m, int off, struct inpcb * gre_sofree() via epoch_call(). */ if (__predict_false(inp->inp_flags2 & INP_FREED)) { - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); m_freem(m); return; } @@ -251,11 +251,11 @@ in_gre_udp_input(struct mbuf *m, int off, struct inpcb } if (sc != NULL && (GRE2IFP(sc)->if_flags & IFF_UP) != 0){ gre_input(m, off + sizeof(struct udphdr), IPPROTO_UDP, sc); - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); return; } m_freem(m); - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); } static int Modified: stable/12/sys/netinet6/ip6_gre.c ============================================================================== --- stable/12/sys/netinet6/ip6_gre.c Fri May 24 08:42:34 2019 (r348233) +++ stable/12/sys/netinet6/ip6_gre.c Fri May 24 09:01:54 2019 (r348234) @@ -221,7 +221,7 @@ in6_gre_udp_input(struct mbuf *m, int off, struct inpc struct gre_softc *sc; struct sockaddr_in6 dst; - NET_EPOCH_ENTER(et); + NET_EPOCH_ENTER_ET(et); /* * udp_append() holds reference to inp, it is safe to check * inp_flags2 without INP_RLOCK(). @@ -231,7 +231,7 @@ in6_gre_udp_input(struct mbuf *m, int off, struct inpc * gre_sofree() via epoch_call(). */ if (__predict_false(inp->inp_flags2 & INP_FREED)) { - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); m_freem(m); return; } @@ -239,7 +239,7 @@ in6_gre_udp_input(struct mbuf *m, int off, struct inpc gs = (struct gre_socket *)ctx; dst = *(const struct sockaddr_in6 *)sa; if (sa6_embedscope(&dst, 0)) { - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); m_freem(m); return; } @@ -249,11 +249,11 @@ in6_gre_udp_input(struct mbuf *m, int off, struct inpc } if (sc != NULL && (GRE2IFP(sc)->if_flags & IFF_UP) != 0){ gre_input(m, off + sizeof(struct udphdr), IPPROTO_UDP, sc); - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); return; } m_freem(m); - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT_ET(et); } static int From owner-svn-src-all@freebsd.org Fri May 24 09:11:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8729015A4CD8; Fri, 24 May 2019 09:11:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3FF84488; Fri, 24 May 2019 09:11:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1E23EA8; Fri, 24 May 2019 09:11:36 +0000 (UTC) Date: Fri, 24 May 2019 09:11:36 +0000 From: Alexey Dokuchaev To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys Message-ID: <20190524091136.GA80897@FreeBSD.org> References: <201902272256.x1RMutdK085216@repo.freebsd.org> <20190228074750.GA35369@FreeBSD.org> <20190310151140.GB97029@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190310151140.GB97029@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 2C3FF84488 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 09:11:36 -0000 On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > New Revision: 344648 > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > Log: > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > ... > > > Added: > > > head/sys/sys/seqc.h (contents, props changed) > > > Deleted: > > > head/sys/sys/seq.h > > > > Why it was deleted and added as new file instead of being repocopied? > > Retransmit. Ping! ./danfe From owner-svn-src-all@freebsd.org Fri May 24 11:06:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63BD415A7A71; Fri, 24 May 2019 11:06:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0701388802; Fri, 24 May 2019 11:06:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D17DC1BDB7; Fri, 24 May 2019 11:06:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OB6PGr003863; Fri, 24 May 2019 11:06:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OB6PXv003860; Fri, 24 May 2019 11:06:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905241106.x4OB6PXv003860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 May 2019 11:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348235 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 348235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0701388802 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 11:06:26 -0000 Author: ae Date: Fri May 24 11:06:24 2019 New Revision: 348235 URL: https://svnweb.freebsd.org/changeset/base/348235 Log: Add `missing` and `or-flush` options to "ipfw table create" command to simplify firewall reloading. The `missing` option suppresses EEXIST error code, but does check that existing table has the same parameters as new one. The `or-flush` option implies `missing` option and additionally does flush for table if it is already exist. Submitted by: lev MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18339 Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.h head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri May 24 09:01:54 2019 (r348234) +++ head/sbin/ipfw/ipfw.8 Fri May 24 11:06:24 2019 (r348235) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2019 +.Dd May 24, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -2138,7 +2138,7 @@ The following creation options are supported: .Bl -tag -width indent .It Ar create-options : Ar create-option | create-options .It Ar create-option : Cm type Ar table-type | Cm valtype Ar value-mask | Cm algo Ar algo-desc | -.Cm limit Ar number | Cm locked +.Cm limit Ar number | Cm locked | Cm missing | Cm or-flush .It Cm type Table key type. .It Cm valtype @@ -2149,6 +2149,13 @@ Table algorithm to use (see below). Maximum number of items that may be inserted into table. .It Cm locked Restrict any table modifications. +.It Cm missing +Do not fail if table already exists and has exactly same options as new one. +.It Cm or-flush +Flush existing table with same name instead of returning error. +Implies +.Cm missing +so existing table must be compatible with new one. .El .Pp Some of these options may be modified later via Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Fri May 24 09:01:54 2019 (r348234) +++ head/sbin/ipfw/ipfw2.h Fri May 24 11:06:24 2019 (r348235) @@ -264,6 +264,9 @@ enum tokens { TOK_UNLOCK, TOK_VLIST, TOK_OLIST, + TOK_MISSING, + TOK_ORFLUSH, + TOK_OPTIONAL, /* NAT64 tokens */ TOK_NAT64STL, Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Fri May 24 09:01:54 2019 (r348234) +++ head/sbin/ipfw/tables.c Fri May 24 11:06:24 2019 (r348235) @@ -327,6 +327,8 @@ static struct _s_x tablenewcmds[] = { { "algo", TOK_ALGO }, { "limit", TOK_LIMIT }, { "locked", TOK_LOCK }, + { "missing", TOK_MISSING }, + { "or-flush", TOK_ORFLUSH }, { NULL, 0 } }; @@ -389,19 +391,19 @@ table_print_type(char *tbuf, size_t size, uint8_t type * Creates new table * * ipfw table NAME create [ type { addr | iface | number | flow } ] - * [ algo algoname ] + * [ algo algoname ] [missing] [or-flush] */ static void table_create(ipfw_obj_header *oh, int ac, char *av[]) { - ipfw_xtable_info xi; - int error, tcmd, val; + ipfw_xtable_info xi, xie; + int error, missing, orflush, tcmd, val; uint32_t fset, fclear; char *e, *p; char tbuf[128]; + missing = orflush = 0; memset(&xi, 0, sizeof(xi)); - while (ac > 0) { tcmd = get_token(tablenewcmds, *av, "option"); ac--; av++; @@ -457,6 +459,12 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) case TOK_LOCK: xi.flags |= IPFW_TGFLAGS_LOCKED; break; + case TOK_ORFLUSH: + orflush = 1; + /* FALLTHROUGH */ + case TOK_MISSING: + missing = 1; + break; } } @@ -466,8 +474,28 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; - if ((error = table_do_create(oh, &xi)) != 0) + error = table_do_create(oh, &xi); + + if (error == 0) + return; + + if (errno != EEXIST || missing == 0) err(EX_OSERR, "Table creation failed"); + + /* Check that existing table is the same we are trying to create */ + if (table_get_info(oh, &xie) != 0) + err(EX_OSERR, "Existing table check failed"); + + if (xi.limit != xie.limit || xi.type != xie.type || + xi.tflags != xie.tflags || xi.vmask != xie.vmask || ( + xi.algoname[0] != '\0' && strcmp(xi.algoname, + xie.algoname) != 0) || xi.flags != xie.flags) + errx(EX_DATAERR, "The existing table is not compatible " + "with one you are creating."); + + /* Flush existing table if instructed to do so */ + if (orflush != 0 && table_flush(oh) != 0) + err(EX_OSERR, "Table flush on creation failed"); } /* From owner-svn-src-all@freebsd.org Fri May 24 11:45:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80F815A8798; Fri, 24 May 2019 11:45:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD3E89B2D; Fri, 24 May 2019 11:45:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 661D91C475; Fri, 24 May 2019 11:45:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OBjXLD024685; Fri, 24 May 2019 11:45:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OBjXcO024684; Fri, 24 May 2019 11:45:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905241145.x4OBjXcO024684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 May 2019 11:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348236 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 348236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DD3E89B2D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 11:45:34 -0000 Author: ae Date: Fri May 24 11:45:32 2019 New Revision: 348236 URL: https://svnweb.freebsd.org/changeset/base/348236 Log: Restore IPV6_NEXTHOP option support that seem was partially broken since r286195. Do not forget results of route lookup and initialize rt and ifp pointers. PR: 238098 Submitted by: Masse Nicolas MFC after: 1 week Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Fri May 24 11:06:24 2019 (r348235) +++ head/sys/netinet6/in6_src.c Fri May 24 11:45:32 2019 (r348236) @@ -724,6 +724,10 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_p if (ron->ro_rt == NULL || (ron->ro_rt->rt_flags & RTF_GATEWAY) != 0) error = EHOSTUNREACH; + else { + rt = ron->ro_rt; + ifp = rt->rt_ifp; + } goto done; } From owner-svn-src-all@freebsd.org Fri May 24 13:39:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7537A15AC29C; Fri, 24 May 2019 13:39:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AADB8E4B9; Fri, 24 May 2019 13:39:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A2A51D728; Fri, 24 May 2019 13:39:57 +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 x4ODduJP087992; Fri, 24 May 2019 13:39:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ODduju087991; Fri, 24 May 2019 13:39:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905241339.x4ODduju087991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 May 2019 13:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348237 - stable/12/sys/modules X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/modules X-SVN-Commit-Revision: 348237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AADB8E4B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 13:39:57 -0000 Author: emaste Date: Fri May 24 13:39:56 2019 New Revision: 348237 URL: https://svnweb.freebsd.org/changeset/base/348237 Log: MFC r346598: Enable Mellanox drivers (modules) on AArch64 PR: 237055 Submitted by: Greg V Modified: stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Fri May 24 11:45:32 2019 (r348236) +++ stable/12/sys/modules/Makefile Fri May 24 13:39:56 2019 (r348237) @@ -498,7 +498,24 @@ SUBDIR+= fdt SUBDIR+= linprocfs SUBDIR+= linsysfs _ena= ena +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ibcore= ibcore +_ipoib= ipoib +_iser= iser .endif +_mlx4= mlx4 +_mlx5= mlx5 +.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ + defined(ALL_MODULES) +_mlx4en= mlx4en +_mlx5en= mlx5en +.endif +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_mthca= mthca +_mlx4ib= mlx4ib +_mlx5ib= mlx5ib +.endif +.endif .if ${MK_NAND} != "no" || defined(ALL_MODULES) _nandfs= nandfs @@ -606,15 +623,8 @@ _ep= ep _et= et _exca= exca _fe= fe -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ibcore= ibcore -.endif _if_ndis= if_ndis _io= io -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ipoib= ipoib -_iser= iser -.endif _ix= ix _ixv= ixv _linux= linux @@ -687,18 +697,6 @@ _ipwfw= ipwfw _iwifw= iwifw _iwmfw= iwmfw _iwnfw= iwnfw -.endif -_mlx4= mlx4 -_mlx5= mlx5 -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_mlx4en= mlx4en -_mlx5en= mlx5en -.endif -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_mthca= mthca -_mlx4ib= mlx4ib -_mlx5ib= mlx5ib .endif _mly= mly _nfe= nfe From owner-svn-src-all@freebsd.org Fri May 24 14:38:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A046E15ACF86; Fri, 24 May 2019 14:38:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37D278FEC7; Fri, 24 May 2019 14:38:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BDAF1E121; Fri, 24 May 2019 14:38:32 +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 x4OEcVAv019191; Fri, 24 May 2019 14:38:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OEcV46019190; Fri, 24 May 2019 14:38:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905241438.x4OEcV46019190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 May 2019 14:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348238 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 348238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37D278FEC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 14:38:32 -0000 Author: markj Date: Fri May 24 14:38:31 2019 New Revision: 348238 URL: https://svnweb.freebsd.org/changeset/base/348238 Log: MFC r348002: Typo. Modified: stable/12/share/man/man9/DRIVER_MODULE.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- stable/12/share/man/man9/DRIVER_MODULE.9 Fri May 24 13:39:56 2019 (r348237) +++ stable/12/share/man/man9/DRIVER_MODULE.9 Fri May 24 14:38:31 2019 (r348238) @@ -125,7 +125,7 @@ macro allows a driver to be registered for a specific The boot time probe and attach process makes multiple passes over the device tree. Certain critical drivers that provide basic services needed by other -devices are attach during earlier passes. +devices are attached during earlier passes. Most drivers are attached in a final general pass. A driver that attaches during an early pass must register for a specific pass level From owner-svn-src-all@freebsd.org Fri May 24 14:44:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F6715AD4A7; Fri, 24 May 2019 14:44:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41E91685B7; Fri, 24 May 2019 14:44:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 94C7E80AB; Fri, 24 May 2019 14:44:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348205 - head/sys/netipsec To: rgrimes@FreeBSD.org Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201905240134.x4O1YUbA093317@gndrsh.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 24 May 2019 07:44:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905240134.x4O1YUbA093317@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41E91685B7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 14:44:45 -0000 On 5/23/19 6:34 PM, Rodney W. Grimes wrote: > I did not need that info, just a list of IANA assigned numbers > of things you can not find in RFC/Ietf documents. I'll do the > leg work from the other side and if Ietf/Iana documents need > fixed I'll get that in process. Oh, to be clear, that specific language is direct from RFC 8221. For example, in section 5 after the table of encryption algorithms: IANA has allocated codes for cryptographic algorithms that have not been specified by the IETF. Such algorithms are noted as UNSPECIFIED. Usually, the use of these algorithms is limited to specific cases, and the absence of specification makes interoperability difficult for IPsec communications. These algorithms were not mentioned in [RFC7321], and this document clarifies that such algorithms MUST NOT be implemented for IPsec communications. Similarly, IANA also allocated code points for algorithms that are not expected to be used to secure IPsec communications. Such algorithms are noted as non-IPsec. As a result, these algorithms MUST NOT be implemented. Various ciphers that are older, not well tested, and never widely implemented have been changed to MUST NOT. On my (8th?) reading though, it may be that the first paragraph is only applying to the algorithms marked UNSPECIFIED in the earlier table which would cover des-32iv and possibly des-deriv in which case the wording I used in the commit log isn't quite clear. Also, just to make it clear, I don't care about IANA numbers, I was merely referencing the RFC's wording as the "why". -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 24 15:21:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C7EF15AE1DA; Fri, 24 May 2019 15:21:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 033876B394; Fri, 24 May 2019 15:21:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D44C71E858; Fri, 24 May 2019 15:21:23 +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 x4OFLNqk043596; Fri, 24 May 2019 15:21:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OFLNAa043595; Fri, 24 May 2019 15:21:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905241521.x4OFLNAa043595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 May 2019 15:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348239 - in head/tools/tools/nanobsd: dhcpd pcengines X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/tools/tools/nanobsd: dhcpd pcengines X-SVN-Commit-Revision: 348239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 033876B394 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 15:21:24 -0000 Author: emaste Date: Fri May 24 15:21:23 2019 New Revision: 348239 URL: https://svnweb.freebsd.org/changeset/base/348239 Log: nanobsd: exclude .git (and .hg) in the same places we exclude .svn Allow support of other VCSes. Note that two other nanobsd files already had a similar case, excluding .git and .hg in addition to CVS and .svn. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/pcengines/common.conf Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Fri May 24 14:38:31 2019 (r348238) +++ head/tools/tools/nanobsd/dhcpd/common Fri May 24 15:21:23 2019 (r348239) @@ -83,7 +83,7 @@ cust_install_machine_files() { echo "cd ${NANO_CFG_BASE}/Files" cd ${NANO_CFG_BASE}/Files - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.git|\.hg|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} } customize_cmd cust_install_files customize_cmd cust_install_machine_files Modified: head/tools/tools/nanobsd/pcengines/common.conf ============================================================================== --- head/tools/tools/nanobsd/pcengines/common.conf Fri May 24 14:38:31 2019 (r348238) +++ head/tools/tools/nanobsd/pcengines/common.conf Fri May 24 15:21:23 2019 (r348239) @@ -39,7 +39,7 @@ cust_install_machine_files() ( MACHINE_DIR="${NANO_TOOLS}/Files.${NANO_NAME}" if [ -d "${MACHINE_DIR}" ]; then cd ${MACHINE_DIR} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.git|\.hg|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} else echo "${MACHINE_DIR} not found, skipping step" fi From owner-svn-src-all@freebsd.org Fri May 24 15:37:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C21815AE925; Fri, 24 May 2019 15:37:56 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9897E6C269; Fri, 24 May 2019 15:37:55 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EB31EC0E; Fri, 24 May 2019 15:37:55 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OFbtB5052289; Fri, 24 May 2019 15:37:55 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OFbtLN052287; Fri, 24 May 2019 15:37:55 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905241537.x4OFbtLN052287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 24 May 2019 15:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348240 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 348240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9897E6C269 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 15:37:56 -0000 Author: johalun Date: Fri May 24 15:37:54 2019 New Revision: 348240 URL: https://svnweb.freebsd.org/changeset/base/348240 Log: MFC r347837: LinuxKPI: Update access_ok macro for v5.0. Check LINUXKPI_VERSION macro for backwards compatibility. It's recommended to update any drivers that depend on the older KPI so we can deprecate < 5.0 code as we update to newer Linux version. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/uaccess.h stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/uaccess.h Fri May 24 15:21:23 2019 (r348239) +++ stable/12/sys/compat/linuxkpi/common/include/linux/uaccess.h Fri May 24 15:37:54 2019 (r348240) @@ -60,12 +60,17 @@ #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) #define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) -#define access_ok(...) linux_access_ok(__VA_ARGS__) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +#define access_ok(a,b) linux_access_ok(a,b) +#else +#define access_ok(a,b,c) linux_access_ok(b,c) +#endif + extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); extern size_t linux_clear_user(void *uaddr, size_t len); -extern int linux_access_ok(int rw, const void *uaddr, size_t len); +extern int linux_access_ok(const void *uaddr, size_t len); /* * NOTE: Each pagefault_disable() call must have a corresponding Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 24 15:21:23 2019 (r348239) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 24 15:37:54 2019 (r348240) @@ -897,7 +897,7 @@ linux_clear_user(void *_uaddr, size_t _len) } int -linux_access_ok(int rw, const void *uaddr, size_t len) +linux_access_ok(const void *uaddr, size_t len) { uintptr_t saddr; uintptr_t eaddr; From owner-svn-src-all@freebsd.org Fri May 24 15:45:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43DA015AEC8B; Fri, 24 May 2019 15:45:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD7D96C7A0; Fri, 24 May 2019 15:45:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B38211EDB6; Fri, 24 May 2019 15:45:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OFjhdI057403; Fri, 24 May 2019 15:45:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OFjh4N057402; Fri, 24 May 2019 15:45:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905241545.x4OFjh4N057402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 May 2019 15:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348241 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 348241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD7D96C7A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 15:45:44 -0000 Author: markj Date: Fri May 24 15:45:43 2019 New Revision: 348241 URL: https://svnweb.freebsd.org/changeset/base/348241 Log: Modernize the MAKE_JUST_KERNELS hint in the top-level makefile. It doesn't make sense to limit to -j12 anymore, build scalability is better than it used to be. Fold the hint into the description of the universe target. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20342 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri May 24 15:37:54 2019 (r348240) +++ head/Makefile Fri May 24 15:45:43 2019 (r348241) @@ -4,7 +4,8 @@ # The user-driven targets are: # # universe - *Really* build *everything* (buildworld and -# all kernels on all architectures). +# all kernels on all architectures). Define the +# MAKE_JUST_KERNELS variable to only build kernels. # tinderbox - Same as universe, but presents a list of failed build # targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do @@ -45,12 +46,6 @@ # native-xtools-install # - Install the files to the given DESTDIR/NXTP where # NXTP defaults to /nxb-bin. -# -# "quick" way to test all kernel builds: -# _jflag=`sysctl -n hw.ncpu` -# _jflag=$(($_jflag * 2)) -# [ $_jflag -gt 12 ] && _jflag=12 -# make universe -DMAKE_JUST_KERNELS JFLAG=-j${_jflag} # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the From owner-svn-src-all@freebsd.org Fri May 24 16:24:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D625A15AF979; Fri, 24 May 2019 16:24:03 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.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 772896DCF3; Fri, 24 May 2019 16:24:03 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 2C4692700120; Fri, 24 May 2019 12:23:57 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 2C4692700120 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1558715037; bh=LEcK88BpJJ1DDCJJ3aB3HcoPMSIRFtVVhGQRDpporJM=; h=Subject:To:From:Date:From; b=d/dJIVeo1Itd9cqCUSycU8nszmr9pmFJs7SuFo8agSerOVpTB2VUosf1ohNb0aWIA JB3vK+f/fK9zYwYMJhvIB5EGmTcHChXgIy924Ns6aubc45K0eHfJwEj3rVv5AWH+Xw 19Wtgi/jE0N8nrUbK4Gg+DpIp4mCA40czkNIUlDufXief+PLT4L4NAFD9VOaxB0yHO e0Pni1V7PlF+vJ2vKertUslB2qzeiE6AOk1QZkODt1Q9q7Xh6iDt3oEAE1AOxZ9q3p UsGlqs5pXCsrjyQtpseINdjbvgNhuSgjlXDCvkqpBREEYXW3R2DFXX1NT6GacdHhVk ZL0mZ38PxuntQ== Subject: Re: svn commit: r348241 - head To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905241545.x4OFjh4N057402@repo.freebsd.org> From: Andrew Gallatin Message-ID: <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> Date: Fri, 24 May 2019 12:23:56 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905241545.x4OFjh4N057402@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 772896DCF3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.961,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 16:24:04 -0000 On 2019-05-24 11:45, Mark Johnston wrote: > Modernize the MAKE_JUST_KERNELS hint in the top-level makefile. > > It doesn't make sense to limit to -j12 anymore, build scalability > is better than it used to be. Fold the hint into the description > of the universe target. > > Reviewed by: imp Dumb question about this: Will it update toolchains, or just use what can find? Thanks, Drew From owner-svn-src-all@freebsd.org Fri May 24 17:01:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E60E015B025F; Fri, 24 May 2019 17:01:06 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89E2F6EDD0; Fri, 24 May 2019 17:01:06 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ABED1FB15; Fri, 24 May 2019 17:01:06 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OH16VM095141; Fri, 24 May 2019 17:01:06 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OH15dA095138; Fri, 24 May 2019 17:01:05 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905241701.x4OH15dA095138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 24 May 2019 17:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348242 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 348242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89E2F6EDD0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:01:07 -0000 Author: johalun Date: Fri May 24 17:01:05 2019 New Revision: 348242 URL: https://svnweb.freebsd.org/changeset/base/348242 Log: MFC r347852: LinuxKPI: Updates to tasklets for Linux 5.0. DRM drivers expect tasklets to have a counter for enable/disable calls. Also, add a few more tasklet locking functions. MFC also includes powerpc build fix from r347889. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/interrupt.h stable/12/sys/compat/linuxkpi/common/src/linux_tasklet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri May 24 15:45:43 2019 (r348241) +++ stable/12/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri May 24 17:01:05 2019 (r348242) @@ -189,11 +189,14 @@ typedef void tasklet_func_t(unsigned long); struct tasklet_struct { TAILQ_ENTRY(tasklet_struct) entry; tasklet_func_t *func; + /* Our "state" implementation is different. Avoid same name as Linux. */ + volatile u_int tasklet_state; + atomic_t count; unsigned long data; }; #define DECLARE_TASKLET(name, func, data) \ -struct tasklet_struct name = { { NULL, NULL }, func, data } +struct tasklet_struct name = { { NULL, NULL }, func, ATOMIC_INIT(0), data } #define tasklet_hi_schedule(t) tasklet_schedule(t) @@ -203,5 +206,8 @@ extern void tasklet_init(struct tasklet_struct *, task unsigned long data); extern void tasklet_enable(struct tasklet_struct *); extern void tasklet_disable(struct tasklet_struct *); +extern int tasklet_trylock(struct tasklet_struct *); +extern void tasklet_unlock(struct tasklet_struct *); +extern void tasklet_unlock_wait(struct tasklet_struct *ts); #endif /* _LINUX_INTERRUPT_H_ */ Modified: stable/12/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri May 24 15:45:43 2019 (r348241) +++ stable/12/sys/compat/linuxkpi/common/src/linux_tasklet.c Fri May 24 17:01:05 2019 (r348242) @@ -41,20 +41,19 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 -#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ - atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) + atomic_cmpset_int((volatile u_int *)&(ts)->tasklet_state, old, new) #define TASKLET_ST_SET(ts, new) \ - WRITE_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev, new) + WRITE_ONCE(*(volatile u_int *)&(ts)->tasklet_state, new) #define TASKLET_ST_GET(ts) \ - READ_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev) + READ_ONCE(*(volatile u_int *)&(ts)->tasklet_state) struct tasklet_worker { struct mtx mtx; - TAILQ_HEAD(, tasklet_struct) head; + TAILQ_HEAD(tasklet_list, tasklet_struct) head; struct grouptask gtask; } __aligned(CACHE_LINE_SIZE); @@ -68,25 +67,34 @@ tasklet_handler(void *arg) { struct tasklet_worker *tw = (struct tasklet_worker *)arg; struct tasklet_struct *ts; + struct tasklet_struct *last; linux_set_current(curthread); TASKLET_WORKER_LOCK(tw); + last = TAILQ_LAST(&tw->head, tasklet_list); while (1) { ts = TAILQ_FIRST(&tw->head); if (ts == NULL) break; TAILQ_REMOVE(&tw->head, ts, entry); - TASKLET_WORKER_UNLOCK(tw); - do { - /* reset executing state */ - TASKLET_ST_SET(ts, TASKLET_ST_EXEC); + if (!atomic_read(&ts->count)) { + TASKLET_WORKER_UNLOCK(tw); + do { + /* reset executing state */ + TASKLET_ST_SET(ts, TASKLET_ST_EXEC); - ts->func(ts->data); + ts->func(ts->data); - } while (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, TASKLET_ST_IDLE) == 0); - TASKLET_WORKER_LOCK(tw); + } while (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, + TASKLET_ST_IDLE) == 0); + TASKLET_WORKER_LOCK(tw); + } else { + TAILQ_INSERT_TAIL(&tw->head, ts, entry); + } + if (ts == last) + break; } TASKLET_WORKER_UNLOCK(tw); } @@ -140,6 +148,8 @@ tasklet_init(struct tasklet_struct *ts, ts->entry.tqe_next = NULL; ts->func = func; ts->data = data; + atomic_set_int(&ts->tasklet_state, TASKLET_ST_IDLE); + atomic_set(&ts->count, 0); } void @@ -158,6 +168,10 @@ void tasklet_schedule(struct tasklet_struct *ts) { + /* tasklet is paused */ + if (atomic_read(&ts->count)) + return; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, TASKLET_ST_LOOP)) { /* tasklet_handler() will loop */ } else if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_BUSY)) { @@ -201,17 +215,39 @@ tasklet_kill(struct tasklet_struct *ts) void tasklet_enable(struct tasklet_struct *ts) { - (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); + + atomic_dec(&ts->count); } void tasklet_disable(struct tasklet_struct *ts) { - while (1) { - if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) - break; - if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) - break; + + atomic_inc(&ts->count); + tasklet_unlock_wait(ts); +} + +int +tasklet_trylock(struct tasklet_struct *ts) +{ + + return (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_BUSY)); +} + +void +tasklet_unlock(struct tasklet_struct *ts) +{ + + TASKLET_ST_SET(ts, TASKLET_ST_IDLE); +} + +void +tasklet_unlock_wait(struct tasklet_struct *ts) +{ + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "tasklet_kill() can sleep"); + + /* wait until tasklet is no longer busy */ + while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); - } } From owner-svn-src-all@freebsd.org Fri May 24 17:04:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4860415B04C0; Fri, 24 May 2019 17:04:29 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF89F6F09D; Fri, 24 May 2019 17:04:28 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D61FB1FB8F; Fri, 24 May 2019 17:04:28 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OH4SCI099096; Fri, 24 May 2019 17:04:28 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OH4SMV099093; Fri, 24 May 2019 17:04:28 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905241704.x4OH4SMV099093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 24 May 2019 17:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348243 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 348243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF89F6F09D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:04:29 -0000 Author: johalun Date: Fri May 24 17:04:27 2019 New Revision: 348243 URL: https://svnweb.freebsd.org/changeset/base/348243 Log: MFC r347843: LinuxKPI: Add group_leader member to struct task_struct. Assign self as group leader at creation to act as the only member of a new process group. Bump FreeBSD version. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h stable/12/sys/compat/linuxkpi/common/src/linux_current.c stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri May 24 17:01:05 2019 (r348242) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri May 24 17:04:27 2019 (r348243) @@ -80,6 +80,7 @@ struct task_struct { int rcu_recurse; int bsd_interrupt_value; struct work_struct *work; /* current work struct, if set */ + struct task_struct *group_leader; }; #define current ({ \ Modified: stable/12/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_current.c Fri May 24 17:01:05 2019 (r348242) +++ stable/12/sys/compat/linuxkpi/common/src/linux_current.c Fri May 24 17:04:27 2019 (r348243) @@ -67,6 +67,7 @@ linux_alloc_current(struct thread *td, int flags) ts->task_thread = td; ts->comm = td->td_name; ts->pid = td->td_tid; + ts->group_leader = ts; atomic_set(&ts->usage, 1); atomic_set(&ts->state, TASK_RUNNING); init_completion(&ts->parked); Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Fri May 24 17:01:05 2019 (r348242) +++ stable/12/sys/sys/param.h Fri May 24 17:04:27 2019 (r348243) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200510 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200511 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri May 24 17:06:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EBAB15B0700; Fri, 24 May 2019 17:06:11 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA4106F294; Fri, 24 May 2019 17:06:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B41CA1FB91; Fri, 24 May 2019 17:06:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OH6AQW099234; Fri, 24 May 2019 17:06:10 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OH6AWf099233; Fri, 24 May 2019 17:06:10 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905241706.x4OH6AWf099233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 24 May 2019 17:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348244 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 348244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA4106F294 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:06:11 -0000 Author: johalun Date: Fri May 24 17:06:10 2019 New Revision: 348244 URL: https://svnweb.freebsd.org/changeset/base/348244 Log: MFC r347891: LinuxKPI: Add in_task macro. This patch is part of D19565 Reviewed by: hps, bwidawsk Approved by: imp (mentor), hps Obtained from: bwidawsk Modified: stable/12/sys/compat/linuxkpi/common/include/linux/preempt.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/preempt.h Fri May 24 17:04:27 2019 (r348243) +++ stable/12/sys/compat/linuxkpi/common/include/linux/preempt.h Fri May 24 17:06:10 2019 (r348244) @@ -34,6 +34,8 @@ #define in_interrupt() \ (curthread->td_intr_nesting_level || curthread->td_critnest) +#define in_task() (curthread->td_priority >= PI_SOFT) + #define preempt_disable() critical_enter() #define preempt_enable() critical_exit() From owner-svn-src-all@freebsd.org Fri May 24 17:09:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0284015B07C7; Fri, 24 May 2019 17:09:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f177.google.com (mail-it1-f177.google.com [209.85.166.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 911606F473; Fri, 24 May 2019 17:09:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f177.google.com with SMTP id j17so11494598itk.0; Fri, 24 May 2019 10:09:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=6QNHiZtg1UsBwJ4lV01mE0pyWt44GY+cxvwQF+QaLB0=; b=FyDJKE2TBR3XuPAesxnVY5dw65FbLsoGeWpxIJ7To+zIJEaCdblOqvJcMKy82QouFA sutNnKkhBo5h5ltvq7Z7EuEFB8oVNShawFUd1tNtsxXaYZyv1DlB9Sjt8A31KGkDPUxC GLGXJGbmD9778MzNfrslWfFZds1CoEijvakNBIGUCnpDwtwOMvQUHQq5nvvDYH1pBcn+ U90UJjL8RBqQKLIJ/OH/QZpPta55EA9PV9iovbPkOAZail3VZmVlb5LI8GNQM5OOTh7U ZDKEeouFdighNWPjS82hBM8WTi+QqfxsU0Jl2OyWqDrK9xpD4uW6fGuanibE6BOTeql0 0J+w== X-Gm-Message-State: APjAAAV89Pf/j7SrHWoULXw4CgvF0C/gHAhWpRf9yA6YJQCtVf1ezuST n34/JM6o+W0jlMa7ZwI12kWnvfiH X-Google-Smtp-Source: APXvYqwUEUvOsRp8AzMaGttsJedjj5HNnAuA40YXl4fiVL6tywfLmbVxF2co0GetLbiMBd9LzLwwFg== X-Received: by 2002:a24:35d8:: with SMTP id k207mr18127994ita.84.1558717745743; Fri, 24 May 2019 10:09:05 -0700 (PDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com. [209.85.166.50]) by smtp.gmail.com with ESMTPSA id f71sm1604944itc.5.2019.05.24.10.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 10:09:04 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id a17so8313708iot.8; Fri, 24 May 2019 10:09:04 -0700 (PDT) X-Received: by 2002:a05:6602:157:: with SMTP id v23mr13424323iot.80.1558717744154; Fri, 24 May 2019 10:09:04 -0700 (PDT) MIME-Version: 1.0 References: <201905241545.x4OFjh4N057402@repo.freebsd.org> <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> In-Reply-To: <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 24 May 2019 10:08:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r348241 - head To: Andrew Gallatin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 911606F473 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:09:13 -0000 On Fri, May 24, 2019 at 9:24 AM Andrew Gallatin wrote: > Dumb question about this: Will it update toolchains, or just use what > can find? -DMAKE_JUST_KERNELS doesn't touch toolchains. For that, there is the less memorable build step: export NCPU=$((1 * $(sysctl -n hw.ncpu) / 3)); make -sj${NCPU} tinderbox JFLAG=-j${NCPU} UNIVERSE_TARGET=kernel-toolchain -DNO_CLEAN From owner-svn-src-all@freebsd.org Fri May 24 17:14:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9070115B09ED; Fri, 24 May 2019 17:14:08 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 267C76F93B; Fri, 24 May 2019 17:14:08 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 152CE1FD4A; Fri, 24 May 2019 17:14:08 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OHE72b004498; Fri, 24 May 2019 17:14:07 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OHE7iv004497; Fri, 24 May 2019 17:14:07 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905241714.x4OHE7iv004497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 24 May 2019 17:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348245 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 348245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 267C76F93B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:14:08 -0000 Author: johalun Date: Fri May 24 17:14:07 2019 New Revision: 348245 URL: https://svnweb.freebsd.org/changeset/base/348245 Log: MFC r347596: LinuxKPI: Add context member to ww_mutex and bump FreeBSD version. This patch is part of https://reviews.freebsd.org/D19565. Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Fri May 24 17:06:10 2019 (r348244) +++ stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Fri May 24 17:14:07 2019 (r348245) @@ -45,6 +45,7 @@ struct ww_acquire_ctx { struct ww_mutex { struct mutex base; struct cv condvar; + struct ww_acquire_ctx *ctx; }; #define DEFINE_WW_CLASS(name) \ Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Fri May 24 17:06:10 2019 (r348244) +++ stable/12/sys/sys/param.h Fri May 24 17:14:07 2019 (r348245) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200511 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200512 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri May 24 17:19:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3D715B0B1E; Fri, 24 May 2019 17:19:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B06BA6FAF8; Fri, 24 May 2019 17:19:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8620A1FD4F; Fri, 24 May 2019 17:19:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OHJ7FP004742; Fri, 24 May 2019 17:19:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OHJ7DA004740; Fri, 24 May 2019 17:19:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905241719.x4OHJ7DA004740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 May 2019 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348246 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 348246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B06BA6FAF8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:19:08 -0000 Author: kib Date: Fri May 24 17:19:06 2019 New Revision: 348246 URL: https://svnweb.freebsd.org/changeset/base/348246 Log: Fix a corner case in demotion of kernel mappings. It is possible for the kernel mapping to be created with superpage by directly installing pde using pmap_enter_2mpage() without filling the corresponding page table page. This can happen e.g. if the range is already backed by reservation and vm_fault_soft_fast() conditions are satisfied, which was observed on the pipe_map. In this case, demotion must fill the page obtained from the pmap radix, same as if the page is newly allocated. Use PG_PROMOTED bit as an indicator that the page is valid, instead of the wire count of the page table page. Since the PG_PROMOTED bit is set on pde when we leave TLB entries for 4k pages around, which in particular means that the ptes were filled, it provides more correct indicator. Note that pmap_protect_pde() clears PG_PROMOTED, which handles the case when protection was changed on the superpage without adjusting ptes. Reported by: pho In collaboration with: alc Tested by: alc, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20380 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 24 17:14:07 2019 (r348245) +++ head/sys/amd64/amd64/pmap.c Fri May 24 17:19:06 2019 (r348246) @@ -4537,8 +4537,10 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v " in pmap %p", va, pmap); return (FALSE); } - if (va < VM_MAXUSER_ADDRESS) + if (va < VM_MAXUSER_ADDRESS) { + mpte->wire_count = NPTEPG; pmap_resident_count_inc(pmap, 1); + } } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); @@ -4551,12 +4553,12 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v newpte = pmap_swap_pat(pmap, newpte); /* - * If the page table page is new, initialize it. + * If the page table page is not leftover from an earlier promotion, + * initialize it. */ - if (mpte->wire_count == 1) { - mpte->wire_count = NPTEPG; + if ((oldpde & PG_PROMOTED) == 0) pmap_fill_ptp(firstpte, newpte); - } + KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), ("pmap_demote_pde: firstpte and newpte map different physical" " addresses")); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri May 24 17:14:07 2019 (r348245) +++ head/sys/i386/i386/pmap.c Fri May 24 17:19:06 2019 (r348246) @@ -2768,8 +2768,10 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse " in pmap %p", va, pmap); return (FALSE); } - if (pmap != kernel_pmap) + if (pmap != kernel_pmap) { + mpte->wire_count = NPTEPG; pmap->pm_stats.resident_count++; + } } mptepa = VM_PAGE_TO_PHYS(mpte); @@ -2818,12 +2820,12 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse newpte ^= PG_PDE_PAT | PG_PTE_PAT; /* - * If the page table page is new, initialize it. + * If the page table page is not leftover from an earlier promotion, + * initialize it. */ - if (mpte->wire_count == 1) { - mpte->wire_count = NPTEPG; + if ((oldpde & PG_PROMOTED) == 0) pmap_fill_ptp(firstpte, newpte); - } + KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), ("pmap_demote_pde: firstpte and newpte map different physical" " addresses")); From owner-svn-src-all@freebsd.org Fri May 24 17:25:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB94C15B0DD9; Fri, 24 May 2019 17:25:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12e.google.com (mail-it1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E443700ED; Fri, 24 May 2019 17:25:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12e.google.com with SMTP id t184so17042945itf.2; Fri, 24 May 2019 10:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uLnLTCEeh4i+udUvIygQ0IRPFy2XzCWdpIc5F1ixn2s=; b=u8tseB68kLUsJKuO5XQpsuQWYXXpe9f98KU/UVGR8LLZI1n7VV7F+h0zPzVrPEBZbe JlpW8xI11AW3ZIYigeuBML8knMG6tDyTz+3ee/3Xnf6yt0YFUseVvKZil43LJStp+cSB X+6QNz3VWHfwizErS5k6lZMzKaYN0IDA/Izl5EEYQcqVOObszfxe2YRZuTGyuEr/S2o8 OWkTeFa0zI3OhU0t8xjx6vyafLiAYRmybyfTyASKr5aA35gziMTDRRbhFY5BVP87TsA3 TNTXYIfvaXDXgxEkEfsaNNU9iDf7wFp8QKwJ05FA/OZw20mIT3aK8G0IRo88+1NL9ajN UWnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uLnLTCEeh4i+udUvIygQ0IRPFy2XzCWdpIc5F1ixn2s=; b=tXOEgICz76zNRisVAon5xzTM4h0/bpUG8QiFe813Xep68aFx7A9Lz6NXrd6PaErVKT UPWhXqHzIgIZ4Cfp3aHYQwImmXs0eoTjfqKMSb6WX5YlqE0m+Yd5PjwXhlh9sCnV1r+A /U1/qjtP7SZiq3Mo10/MXGPhyMZZcrFoZu6TfpU5YQXBbvtqNFkTHPaNKdcqIuIhwfrF pOn3KKAVPxlxlNYxgAQxh/Zu7qPRlu+ZNN/U+/X7noCelfeiyhqojXlf+peZHAySKjPY vUDGwtbTr12etCRHK0b2n9gE4CWFjUIohkUvSuoMVYRRkUGQDkGU5Klc0rAcuJq/hUC3 Si5g== X-Gm-Message-State: APjAAAUGd758jJzSVP8Kieu9hGk8ni5xNib8oOpgdRAz7AsBjN3F4s/Q /0rrW7h0+0yLJuLcnKXtAaj2cnGu X-Google-Smtp-Source: APXvYqx/FrJ8LWItqGJWeinclwoNLnYrBagfehKwiWjggDXualJBpRhUHu2Cf1sdH9ntPt9a3HX7qw== X-Received: by 2002:a05:6638:6a9:: with SMTP id d9mr33726644jad.21.1558718701308; Fri, 24 May 2019 10:25:01 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id w4sm1133058iob.46.2019.05.24.10.24.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 10:25:00 -0700 (PDT) Sender: Mark Johnston Date: Fri, 24 May 2019 13:24:55 -0400 From: Mark Johnston To: Conrad Meyer Cc: Andrew Gallatin , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r348241 - head Message-ID: <20190524172455.GA92430@raichu> References: <201905241545.x4OFjh4N057402@repo.freebsd.org> <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 5E443700ED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.984,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:25:03 -0000 On Fri, May 24, 2019 at 10:08:53AM -0700, Conrad Meyer wrote: > On Fri, May 24, 2019 at 9:24 AM Andrew Gallatin wrote: > > Dumb question about this: Will it update toolchains, or just use what > > can find? > > -DMAKE_JUST_KERNELS doesn't touch toolchains. For that, there is the > less memorable build step: > > export NCPU=$((1 * $(sysctl -n hw.ncpu) / 3)); make -sj${NCPU} > tinderbox JFLAG=-j${NCPU} UNIVERSE_TARGET=kernel-toolchain -DNO_CLEAN Isn't that basically what the kernel-toolchains target does? From owner-svn-src-all@freebsd.org Fri May 24 17:25:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD3515B0E04; Fri, 24 May 2019 17:25:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7AD70228; Fri, 24 May 2019 17:25:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 51D929393; Fri, 24 May 2019 17:25:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348241 - head To: cem@freebsd.org, Andrew Gallatin Cc: src-committers , svn-src-all , svn-src-head References: <201905241545.x4OFjh4N057402@repo.freebsd.org> <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <57325dfa-7078-84e1-26d0-978e6bff0a28@FreeBSD.org> Date: Fri, 24 May 2019 10:25:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0A7AD70228 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:25:21 -0000 On 5/24/19 10:08 AM, Conrad Meyer wrote: > On Fri, May 24, 2019 at 9:24 AM Andrew Gallatin wrote: >> Dumb question about this: Will it update toolchains, or just use what >> can find? > > -DMAKE_JUST_KERNELS doesn't touch toolchains. For that, there is the > less memorable build step: > > export NCPU=$((1 * $(sysctl -n hw.ncpu) / 3)); make -sj${NCPU} > tinderbox JFLAG=-j${NCPU} UNIVERSE_TARGET=kernel-toolchain -DNO_CLEAN You can spell it slightly shorter as 'make kernel-toolchains' (but still needing -j, etc.) -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 24 17:58:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4989615B1796; Fri, 24 May 2019 17:58:30 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E118B71843; Fri, 24 May 2019 17:58:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B82B22041D; Fri, 24 May 2019 17:58:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OHwTJA025938; Fri, 24 May 2019 17:58:29 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OHwTQj025936; Fri, 24 May 2019 17:58:29 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201905241758.x4OHwTQj025936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 24 May 2019 17:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348247 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 348247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E118B71843 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 17:58:30 -0000 Author: ken Date: Fri May 24 17:58:29 2019 New Revision: 348247 URL: https://svnweb.freebsd.org/changeset/base/348247 Log: Fix FC-Tape bugs caused in part by r345008. The point of r345008 was to reset the Command Reference Number (CRN) in some situations where a device stayed in the topology, but had changed somehow. This can include moving from a switch connection to a direct connection or vice versa, or a device that temporarily goes away and comes back. (e.g. moving to a different switch port) There were a couple of bugs in that change: - We were reporting that a device had not changed whenever the Establish Image Pair bit was not set. That is not quite correct. Instead, if the Establish Image Pair bit stays the same (set or not), the device hasn't changed in that way. - We weren't setting PRLI Word0 in the port database when a new device arrived, so comparisons with the old value for the Establish Image Pair bit weren't really possible. So, make sure PRLI Word0 is set in the port database for new devices. - We were resetting the CRN whenever the Establish Image Pair bit was set for a device, even when the device had stayed the same and the value of the bit hadn't changed. Now, only reset the CRN for devices that have changed, not devices that sayed the same. The result of all of this was that if we had a single FC device on an FC port and it went away and came back, we would wind up correctly resetting the CRN. But, if we had multiple devices connected via a switch, and there was any change in one or more of those devices, all of the devices that stayed the same would also have their CRN values reset. The result, from a user standpoint, is that the tape drives, etc. would all start to time out commands and the initiator would send aborts. sys/dev/isp/isp.c: In isp_pdb_add_update(), look at whether the Establish Image Pair bit has changed as part of the check to determine whether a device is still the same. This was causing erroneous change notifications. Also, when creating a new port database entry, initialize the PRLI Word 0 values. sys/dev/isp/isp_freebsd.c: In isp_async(), in the changed/stayed case, instead of looking at the Establish Image Pair bit to determine whether to reset the CRN, look at the command value. (Changed vs. Stayed.) Only reset the CRN for devices that have changed. Sponsored by: Spectra Logic MFC after: 3 days Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri May 24 17:19:06 2019 (r348246) +++ head/sys/dev/isp/isp.c Fri May 24 17:58:29 2019 (r348247) @@ -3251,7 +3251,8 @@ isp_pdb_add_update(ispsoftc_t *isp, int chan, isp_pdb_ if (lp->portid == pdb->portid && lp->handle == pdb->handle && lp->prli_word3 == pdb->prli_word3 && - ((pdb->prli_word0 & PRLI_WD0_EST_IMAGE_PAIR) == 0)) { + ((pdb->prli_word0 & PRLI_WD0_EST_IMAGE_PAIR) == + (lp->prli_word0 & PRLI_WD0_EST_IMAGE_PAIR))) { if (lp->state != FC_PORTDB_STATE_NEW) lp->state = FC_PORTDB_STATE_VALID; isp_prt(isp, ISP_LOG_SANCFG, @@ -3282,6 +3283,7 @@ isp_pdb_add_update(ispsoftc_t *isp, int chan, isp_pdb_ lp->probational = 0; lp->state = FC_PORTDB_STATE_NEW; lp->portid = lp->new_portid = pdb->portid; + lp->prli_word0 = lp->new_prli_word0 = pdb->prli_word0; lp->prli_word3 = lp->new_prli_word3 = pdb->prli_word3; lp->handle = pdb->handle; lp->port_wwn = wwpn; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri May 24 17:19:06 2019 (r348246) +++ head/sys/dev/isp/isp_freebsd.c Fri May 24 17:58:29 2019 (r348247) @@ -3789,7 +3789,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) xpt_async(AC_CONTRACT, fc->path, &ac); } - if ((lp->new_prli_word0 & PRLI_WD0_EST_IMAGE_PAIR) && + if ((cmd == ISPASYNC_DEV_CHANGED) && (crn_reset_done == 0)) isp_fcp_reset_crn(isp, bus, tgt, /*tgt_set*/ 1); From owner-svn-src-all@freebsd.org Fri May 24 18:41:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8257E15B28B1; Fri, 24 May 2019 18:41:32 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2928C72F8B; Fri, 24 May 2019 18:41:32 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1723120B38; Fri, 24 May 2019 18:41:32 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OIfVs9048527; Fri, 24 May 2019 18:41:31 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OIfVKV048526; Fri, 24 May 2019 18:41:31 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201905241841.x4OIfVKV048526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 24 May 2019 18:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348248 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 348248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2928C72F8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 18:41:32 -0000 Author: luporl Date: Fri May 24 18:41:31 2019 New Revision: 348248 URL: https://svnweb.freebsd.org/changeset/base/348248 Log: Make options MD_ROOT_MEM default on PPC64 Having this option enabled by default on PowerPC64 kernels makes booting ISO images much easier when on PowerNV. With it, the ISO may simply be given to the -i flag of kexec. Better yet, the ISO may be loop mounted on PetitBoot and its kernel may be used to load itself. Without this option, booting ISOs on remote PPC64 machines usually involve preparing a separate kernel, with this option enabled. Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri May 24 17:58:29 2019 (r348247) +++ head/sys/powerpc/conf/GENERIC64 Fri May 24 18:41:31 2019 (r348248) @@ -53,6 +53,7 @@ options UFS_DIRHASH #Improve performance on big dire options UFS_GJOURNAL #Enable gjournal-based UFS journaling options QUOTA #Enable disk quotas for UFS options MD_ROOT #MD is a potential root device +options MD_ROOT_MEM #Enable use of initrd as MD root options NFSCL #Network Filesystem Client options NFSD #Network Filesystem Server options NFSLOCKD #Network Lock Manager From owner-svn-src-all@freebsd.org Fri May 24 19:43:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D3DA15B3ECA; Fri, 24 May 2019 19:43:40 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD86751A5; Fri, 24 May 2019 19:43:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747F0216B0; Fri, 24 May 2019 19:43:39 +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 x4OJhdgD082854; Fri, 24 May 2019 19:43:39 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OJhcWP082851; Fri, 24 May 2019 19:43:38 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905241943.x4OJhcWP082851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 24 May 2019 19:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348249 - in head/stand: . ficl libsa X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/stand: . ficl libsa X-SVN-Commit-Revision: 348249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DD86751A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 19:43:40 -0000 Author: sjg Date: Fri May 24 19:43:38 2019 New Revision: 348249 URL: https://svnweb.freebsd.org/changeset/base/348249 Log: ficl pfopen: verify file If the file is verified - do not allow write otherwise do not allow read. Add O_ACCMODE to stand.h Reviewed by: stevek, mindal_semihalf.com MFC after: 3 days Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D20387 Modified: head/stand/ficl.mk head/stand/ficl/loader.c head/stand/libsa/stand.h Modified: head/stand/ficl.mk ============================================================================== --- head/stand/ficl.mk Fri May 24 18:41:31 2019 (r348248) +++ head/stand/ficl.mk Fri May 24 19:43:38 2019 (r348249) @@ -16,3 +16,7 @@ CFLAGS+= -fPIC CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} CFLAGS+= -DBF_DICTSIZE=15000 + +.if ${MK_LOADER_VERIEXEC} != "no" +CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h +.endif Modified: head/stand/ficl/loader.c ============================================================================== --- head/stand/ficl/loader.c Fri May 24 18:41:31 2019 (r348248) +++ head/stand/ficl/loader.c Fri May 24 19:43:38 2019 (r348249) @@ -502,6 +502,23 @@ static void pfopen(FICL_VM *pVM) /* open the file */ fd = open(name, mode); +#ifdef LOADER_VERIEXEC + if (fd >= 0) { + if (verify_file(fd, name, 0, VE_GUESS) < 0) { + /* not verified writing ok but reading is not */ + if ((mode & O_ACCMODE) != O_WRONLY) { + close(fd); + fd = -1; + } + } else { + /* verified reading ok but writing is not */ + if ((mode & O_ACCMODE) != O_RDONLY) { + close(fd); + fd = -1; + } + } + } +#endif free(name); stackPushINT(pVM->pStack, fd); return; Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Fri May 24 18:41:31 2019 (r348248) +++ head/stand/libsa/stand.h Fri May 24 19:43:38 2019 (r348249) @@ -286,6 +286,7 @@ extern int open(const char *, int); #define O_RDONLY 0x0 #define O_WRONLY 0x1 #define O_RDWR 0x2 +#define O_ACCMODE 0x3 /* NOT IMPLEMENTED */ #define O_CREAT 0x0200 /* create if nonexistent */ #define O_TRUNC 0x0400 /* truncate to zero length */ From owner-svn-src-all@freebsd.org Fri May 24 20:02:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728CB15B41FC; Fri, 24 May 2019 20:02:00 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 109C575A9B; Fri, 24 May 2019 20:02:00 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E24AE219FC; Fri, 24 May 2019 20:01:59 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OK1x74091026; Fri, 24 May 2019 20:01:59 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OK1xA6091025; Fri, 24 May 2019 20:01:59 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <201905242001.x4OK1xA6091025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Fri, 24 May 2019 20:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348250 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 348250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 109C575A9B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:02:00 -0000 Author: pkubaj (ports committer) Date: Fri May 24 20:01:59 2019 New Revision: 348250 URL: https://svnweb.freebsd.org/changeset/base/348250 Log: Add snd_hda(4) to GENERIC64 used by powerpc64. amd64 also has snd_hda(4) in GENERIC. Approved by: jhibbits (src committer), linimon (mentor) Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri May 24 19:43:38 2019 (r348249) +++ head/sys/powerpc/conf/GENERIC64 Fri May 24 20:01:59 2019 (r348250) @@ -246,6 +246,7 @@ device pmu # Sound support device sound # Generic sound driver (required) device snd_ai2s # Apple I2S audio +device snd_hda # Intel High Definition Audio device snd_uaudio # USB Audio # Netmap provides direct access to TX/RX rings on supported NICs From owner-svn-src-all@freebsd.org Fri May 24 20:17:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E45A015B4556; Fri, 24 May 2019 20:17:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79C4D75FC7; Fri, 24 May 2019 20:17:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io1-xd29.google.com with SMTP id q21so8698124iog.13; Fri, 24 May 2019 13:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gE9uKYq5OIQYG/EnZcwocIBTas8VGaSZaHfWk6N2Sro=; b=DuTcSBFbNKFxKER9Az/CF8C7Xd64h2jyMqXgeQxr2stPOUuCzOA2eXEv/9eTkLXB5V gLrwvLvaFI4MbsiU3Duj7XMrDBQ8ZDa8lT5yBWQ8syJouA07xKeLzwbAa0CRKvlymaOq HS1GCQ/yT/uGrttWWJvmQHVxzr5SZS9X+J806ZNJOSA7Y9WsULOsroFPH0xw/JjgNyjt x0Hv8wv/1Bpm9UbRVmvqFwt1fobZvrIyoOTZKWVRel+c5HHQ8hzoetQjmuMYrWal7mMr u/MkDngD1qL7s2DVnJvYC3QRFOlUnZl7jGWa5/uaQ21Ai0Lh+z7fAZM+4VFp/Lz50bjl kvVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gE9uKYq5OIQYG/EnZcwocIBTas8VGaSZaHfWk6N2Sro=; b=WoFFHuUxmtmooznZ9W+8fANuT+xgL8a1Sux6OlxzkQ9hiQu3vfpQZ+vbV1GM/r+km/ uxr/2hBQ9dwZ4/mfaslcWN71jiD43Gni1xSJ6SNbeSLyG2Ix6Fd1uYF1Z4h+1cqQH1lv enawbWzcSODWJTcxNDFvRgxwLTTINljCN9nn1vHwEMJXptRMGjHkHkMBVmucpb998lkD +44Pl35AUbMObTUGUl6KrheRGrXQ6nB/AKJVn9i6ByYYKBZ0wVOhctSfWKtGKXaPpCf2 ojnR+HQx+6wbMuEaLiAbnpk30YbLDhwMr6EPV7pl9xkr5VFhfevnyBb+BSEQhJFX2ZRU 7hYg== X-Gm-Message-State: APjAAAXUJJn6Jf6L3pSzl9MLKcZ8z//vJFIBLpSEaOd8PvelRByk/euh fZdi3R/fRiLA+2FHZ5Bl3hTt3gE+ X-Google-Smtp-Source: APXvYqzrDoX3sh5Tq0wkLT4BGwbHjugM1vALOcV8pjKBAOCONBbmpHujIhuL5gGGCKcSGUvN37si3w== X-Received: by 2002:a6b:bc02:: with SMTP id m2mr1982128iof.25.1558729021118; Fri, 24 May 2019 13:17:01 -0700 (PDT) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id w139sm1739519ita.43.2019.05.24.13.16.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 13:17:00 -0700 (PDT) Date: Fri, 24 May 2019 15:16:51 -0500 From: Justin Hibbits To: Piotr Kubaj Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348250 - head/sys/powerpc/conf Message-ID: <20190524151651.7e6b7f09@titan.knownspace> In-Reply-To: <201905242001.x4OK1xA6091025@repo.freebsd.org> References: <201905242001.x4OK1xA6091025@repo.freebsd.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 79C4D75FC7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:17:03 -0000 On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > Author: pkubaj (ports committer) > Date: Fri May 24 20:01:59 2019 > New Revision: 348250 > URL: https://svnweb.freebsd.org/changeset/base/348250 > > Log: > Add snd_hda(4) to GENERIC64 used by powerpc64. > > amd64 also has snd_hda(4) in GENERIC. > > Approved by: jhibbits (src committer), linimon (mentor) > > Modified: > head/sys/powerpc/conf/GENERIC64 > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Fri May 24 19:43:38 > 2019 (r348249) +++ head/sys/powerpc/conf/GENERIC64 Fri > May 24 20:01:59 2019 (r348250) @@ -246,6 +246,7 @@ > device pmu # Sound support > device sound # Generic sound driver > (required) device snd_ai2s # Apple I2S audio > +device snd_hda # Intel High Definition > Audio device snd_uaudio # USB Audio > > # Netmap provides direct access to TX/RX rings on supported NICs > To note: This was done because there's a strange bug in the snd_hda module, with the hdaa component. For some reason it either doesn't find all the internal components it needs, or something, because there's a NULL dereference when trying to call a kobj method in hdaa_attach(). - Justin From owner-svn-src-all@freebsd.org Fri May 24 20:22:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C2B15B480B; Fri, 24 May 2019 20:22:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1BD576576; Fri, 24 May 2019 20:22:52 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 965D4AA14; Fri, 24 May 2019 20:22:52 +0000 (UTC) Date: Fri, 24 May 2019 20:22:52 +0000 From: Alexey Dokuchaev To: Justin Hibbits Cc: Piotr Kubaj , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r348250 - head/sys/powerpc/conf Message-ID: <20190524202252.GA72774@FreeBSD.org> References: <201905242001.x4OK1xA6091025@repo.freebsd.org> <20190524151651.7e6b7f09@titan.knownspace> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524151651.7e6b7f09@titan.knownspace> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: F1BD576576 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:22:53 -0000 On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > New Revision: 348250 > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > Log: > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > amd64 also has snd_hda(4) in GENERIC. > > > > Modified: > > head/sys/powerpc/conf/GENERIC64 > > ... > > To note: This was done because there's a strange bug in the snd_hda > module, with the hdaa component. For some reason it either doesn't > find all the internal components it needs, or something, because > there's a NULL dereference when trying to call a kobj method in > hdaa_attach(). So this commit essentially masks the real bug somewhere rather than fixing it, is this what you're saying? ./danfe From owner-svn-src-all@freebsd.org Fri May 24 20:27:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A6D415B490F; Fri, 24 May 2019 20:27:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3986676794; Fri, 24 May 2019 20:27:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ECCB21D81; Fri, 24 May 2019 20:27:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OKRq45004498; Fri, 24 May 2019 20:27:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OKRonA004487; Fri, 24 May 2019 20:27:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905242027.x4OKRonA004487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 May 2019 20:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348251 - in head/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs X-SVN-Commit-Revision: 348251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3986676794 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:27:53 -0000 Author: asomers Date: Fri May 24 20:27:50 2019 New Revision: 348251 URL: https://svnweb.freebsd.org/changeset/base/348251 Log: Remove "struct ucred*" argument from vtruncbuf vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever since that function was first added in r34611. Remove it. Also, remove some "struct ucred" arguments from fuse and nfs functions that were only used by vtruncbuf. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20377 Modified: head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/nfsclient/nfs.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_inode.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/ext2fs/ext2_inode.c Fri May 24 20:27:50 2019 (r348251) @@ -356,7 +356,7 @@ ext2_ind_truncate(struct vnode *vp, off_t length, int oip->i_ib[i] = oldblks[EXT2_NDADDR + i]; } oip->i_size = osize; - error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); + error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) allerror = error; vnode_pager_setsize(ovp, length); @@ -530,7 +530,7 @@ ext2_ext_truncate(struct vnode *vp, off_t length, int } oip->i_size = osize; - error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize); + error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); if (error) return (error); Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/fuse/fuse_io.c Fri May 24 20:27:50 2019 (r348251) @@ -389,7 +389,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio if (uio->uio_offset > fvdat->filesize && fuse_data_cache_mode != FUSE_CACHE_UC) { - fuse_vnode_setsize(vp, cred, uio->uio_offset); + fuse_vnode_setsize(vp, uio->uio_offset); fvdat->flag &= ~FN_SIZECHANGE; } } @@ -462,7 +462,7 @@ again: if (bp != NULL) { long save; - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); @@ -490,7 +490,7 @@ again: lbn, on, n, uio, bcount, false); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp && uio->uio_offset + n > fvdat->filesize) { - err = fuse_vnode_setsize(vp, cred, + err = fuse_vnode_setsize(vp, uio->uio_offset + n); if (err) { brelse(bp); Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/fuse/fuse_node.c Fri May 24 20:27:50 2019 (r348251) @@ -408,7 +408,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred } int -fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) +fuse_vnode_setsize(struct vnode *vp, off_t newsize) { struct fuse_vnode_data *fvdat = VTOFUD(vp); off_t oldsize; @@ -421,7 +421,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre fvdat->flag |= FN_SIZECHANGE; if (newsize < oldsize) { - err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); + err = vtruncbuf(vp, newsize, fuse_iosize(vp)); } vnode_pager_setsize(vp, newsize); return err; Modified: head/sys/fs/fuse/fuse_node.h ============================================================================== --- head/sys/fs/fuse/fuse_node.h Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/fuse/fuse_node.h Fri May 24 20:27:50 2019 (r348251) @@ -127,6 +127,6 @@ void fuse_vnode_refreshsize(struct vnode *vp, struct u int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred); -int fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize); +int fuse_vnode_setsize(struct vnode *vp, off_t newsize); #endif /* _FUSE_NODE_H_ */ Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/fuse/fuse_vnops.c Fri May 24 20:27:50 2019 (r348251) @@ -530,7 +530,7 @@ fuse_vnop_getattr(struct vop_getattr_args *ap) fdi.answ)->attr.size; if (fvdat->filesize != new_filesize) { - fuse_vnode_setsize(vp, cred, new_filesize); + fuse_vnode_setsize(vp, new_filesize); fvdat->flag &= ~FN_SIZECHANGE; } } @@ -971,7 +971,7 @@ calldaemon: "%s!\n", __func__, vnode_mount(vp)->mnt_stat.f_mntonname); - (void)fuse_vnode_setsize(vp, cred, fattr->size); + (void)fuse_vnode_setsize(vp, fattr->size); fvdat->flag &= ~FN_SIZECHANGE; } *vpp = vp; @@ -1654,7 +1654,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) out: fdisp_destroy(&fdi); if (!err && sizechanged) { - fuse_vnode_setsize(vp, cred, newsize); + fuse_vnode_setsize(vp, newsize); VTOFUD(vp)->flag &= ~FN_SIZECHANGE; } return err; Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/msdosfs/msdosfs_denode.c Fri May 24 20:27:50 2019 (r348251) @@ -429,7 +429,7 @@ detrunc(struct denode *dep, u_long length, int flags, dep->de_FileSize = length; if (!isadir) dep->de_flag |= DE_UPDATE | DE_MODIFIED; - allerror = vtruncbuf(DETOV(dep), cred, length, pmp->pm_bpcluster); + allerror = vtruncbuf(DETOV(dep), length, pmp->pm_bpcluster); #ifdef MSDOSFS_DEBUG if (allerror) printf("detrunc(): vtruncbuf error %d\n", allerror); Modified: head/sys/fs/nfsclient/nfs.h ============================================================================== --- head/sys/fs/nfsclient/nfs.h Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/nfsclient/nfs.h Fri May 24 20:27:50 2019 (r348251) @@ -91,8 +91,7 @@ enum nfsiod_state { /* * Function prototypes. */ -int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *, - u_quad_t); +int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t); void ncl_doio_directwrite(struct buf *); int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *); int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *); Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/nfsclient/nfs_clbio.c Fri May 24 20:27:50 2019 (r348251) @@ -1832,7 +1832,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre */ int -ncl_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad_t nsize) +ncl_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize) { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; @@ -1854,7 +1854,7 @@ ncl_meta_setsize(struct vnode *vp, struct ucred *cred, * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ - error = vtruncbuf(vp, cred, nsize, biosize); + error = vtruncbuf(vp, nsize, biosize); lbn = nsize / biosize; bufsize = nsize - (lbn * biosize); bp = nfs_getcacheblk(vp, lbn, bufsize, td); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 24 20:27:50 2019 (r348251) @@ -979,8 +979,7 @@ nfs_setattr(struct vop_setattr_args *ap) mtx_lock(&np->n_mtx); tsize = np->n_size; mtx_unlock(&np->n_mtx); - error = ncl_meta_setsize(vp, ap->a_cred, td, - vap->va_size); + error = ncl_meta_setsize(vp, td, vap->va_size); mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { tsize = np->n_size; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/kern/vfs_subr.c Fri May 24 20:27:50 2019 (r348251) @@ -1863,15 +1863,15 @@ again: * sync activity. */ int -vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize) +vtruncbuf(struct vnode *vp, off_t length, int blksize) { struct buf *bp, *nbp; int anyfreed; daddr_t trunclbn; struct bufobj *bo; - CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__, - vp, cred, blksize, (uintmax_t)length); + CTR4(KTR_VFS, "%s: vp %p with block %d:%ju", __func__, + vp, blksize, (uintmax_t)length); /* * Round up to the *next* lbn. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri May 24 20:01:59 2019 (r348250) +++ head/sys/sys/vnode.h Fri May 24 20:27:50 2019 (r348251) @@ -658,8 +658,7 @@ void vgone(struct vnode *vp); void _vhold(struct vnode *, bool); void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); -int vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, - int blksize); +int vtruncbuf(struct vnode *vp, off_t length, int blksize); void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); int vrecycle(struct vnode *vp); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Fri May 24 20:01:59 2019 (r348250) +++ head/sys/ufs/ffs/ffs_inode.c Fri May 24 20:27:50 2019 (r348251) @@ -509,7 +509,7 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = osize; DIP_SET(ip, i_size, osize); - error = vtruncbuf(vp, cred, length, fs->fs_bsize); + error = vtruncbuf(vp, length, fs->fs_bsize); if (error && (allerror == 0)) allerror = error; From owner-svn-src-all@freebsd.org Fri May 24 20:29:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D576715B4A38; Fri, 24 May 2019 20:29:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB4676960; Fri, 24 May 2019 20:29:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x12a.google.com with SMTP id m140so15632466itg.2; Fri, 24 May 2019 13:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IdbtFmNn57k6PHikOarFxmgA6CJXY2FsQWr8DBef3Sk=; b=Dhe+C0nzsyh/MLAfzk+HdkuPvemk2fDt8HrVc0weCqPHafhXY1wniLAt2fYY6r7opL uyOvHhYqGS7LnT4uPS1keQEkQWYe/gAj6NNmHBTXMpV7d+WNgnjh740J5PWiPXifZGqL YlCS3MH14LNm6fco7Pnscvjn7b3qrQsY1aFy05BP6Wy+IhffFfbFPU8mbynezllbUBWs P56dmXnkVIUz2WAI5E2ho/xNPS2+JG7b/lb8hg0DWZnrx0gGSZ5vMbcPujGVw5UJwiZO BpeYD1PvvPw15swgpl+D4udi/dioN8PQH0Y3JLyJh/mkRNibLNIvIBZI14EqAFEYVL7/ 0I+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IdbtFmNn57k6PHikOarFxmgA6CJXY2FsQWr8DBef3Sk=; b=OBjy/s1FTX64wd6L208au+1E4Q8GpTcjLbeXt4NRbe+qqBQWZvIG8m7QlO5JG60PUj YXRqc/kzN+d+KQrf74ctm1ssR6cVtI2dVVvNw0IXjVR1ZuX2k3KtGcicNFl0qWhrHQQz w2K8Ah+0rwitLRUfw6su2vWNhCF0k774rjRn+RjZFJCViK/wZ4oa0BZy4Ba0scg8H5ul Rxtv6KMz2wd9biIDMggDcKRhyu3631/+n0BXmgD/xwvH55vLbNFlDzHcoICDhohv95Au hcH8NcoXKEuwI2Ffi9t3++dAlsyKfb6tUt8U/NcIw/l/uHkeSbQyfARTd7Z5B9MVer7z z8WA== X-Gm-Message-State: APjAAAV0faEcGagUTSCQUEprTjcgF/aoze41zCPI2wzyoWutHJtelahS 1kZ4ohewMg3p4EhJ0e0Yx864EqcItmw= X-Google-Smtp-Source: APXvYqxswZdeAHU6KzFw3GQmiehRHo7UxbSAn1TxQQ0U7obAyAlE9JU7BLeSgI/qr0IKsZATTn52pw== X-Received: by 2002:a02:b47:: with SMTP id 68mr24430096jad.66.1558729792351; Fri, 24 May 2019 13:29:52 -0700 (PDT) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id e2sm1596066ith.39.2019.05.24.13.29.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 13:29:52 -0700 (PDT) Date: Fri, 24 May 2019 15:29:41 -0500 From: Justin Hibbits To: Alexey Dokuchaev Cc: Piotr Kubaj , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r348250 - head/sys/powerpc/conf Message-ID: <20190524152941.40f7e239@titan.knownspace> In-Reply-To: <20190524202252.GA72774@FreeBSD.org> References: <201905242001.x4OK1xA6091025@repo.freebsd.org> <20190524151651.7e6b7f09@titan.knownspace> <20190524202252.GA72774@FreeBSD.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6DB4676960 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:29:54 -0000 On Fri, 24 May 2019 20:22:52 +0000 Alexey Dokuchaev wrote: > On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > > New Revision: 348250 > > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > > > Log: > > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > > > amd64 also has snd_hda(4) in GENERIC. > > > > > > Modified: > > > head/sys/powerpc/conf/GENERIC64 > > > ... > > > > To note: This was done because there's a strange bug in the snd_hda > > module, with the hdaa component. For some reason it either doesn't > > find all the internal components it needs, or something, because > > there's a NULL dereference when trying to call a kobj method in > > hdaa_attach(). > > So this commit essentially masks the real bug somewhere rather than > fixing it, is this what you're saying? > > ./danfe It's a viable workaround to a problem that reaches a wide audience. Since it works built-in, I found it acceptable. I probably should have filed a bug for it a year ago when I hit it and worked around it, but it could also very well be a compiler issue. By the way, it works fine on powerpc (32-bit) loaded as a module. - Justin From owner-svn-src-all@freebsd.org Fri May 24 20:36:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE41715B4E5D; Fri, 24 May 2019 20:36:08 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6290E76ED5; Fri, 24 May 2019 20:36:08 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39DD921F4C; Fri, 24 May 2019 20:36:08 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OKa80D009445; Fri, 24 May 2019 20:36:08 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OKa8t7009444; Fri, 24 May 2019 20:36:08 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201905242036.x4OKa8t7009444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Fri, 24 May 2019 20:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r348252 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 348252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6290E76ED5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 20:36:08 -0000 Author: seanc (ports committer) Date: Fri May 24 20:36:07 2019 New Revision: 348252 URL: https://svnweb.freebsd.org/changeset/base/348252 Log: Release rgrimes@ from mentorship. Discussed with: bde@, phk@ Approved by: core@ Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri May 24 20:27:50 2019 (r348251) +++ svnadmin/conf/mentors Fri May 24 20:36:07 2019 (r348252) @@ -25,7 +25,6 @@ mhorne markj miwi araujo mjoras rstone ram ken Co-mentor: mav -rgrimes phk Co-mentor: bde slavash kib Co-mentor: hselasky slm ken Co-mentor: scottl, ambrisko thj jtl Co-mentor: bz From owner-svn-src-all@freebsd.org Fri May 24 22:11:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2009415B65C2; Fri, 24 May 2019 22:11:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B790481E3D; Fri, 24 May 2019 22:11:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82AF422FF6; Fri, 24 May 2019 22:11:37 +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 x4OMBbp5060451; Fri, 24 May 2019 22:11:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OMBbLc060450; Fri, 24 May 2019 22:11:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905242211.x4OMBbLc060450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 May 2019 22:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348253 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B790481E3D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 22:11:38 -0000 Author: jhb Date: Fri May 24 22:11:37 2019 New Revision: 348253 URL: https://svnweb.freebsd.org/changeset/base/348253 Log: Add initial support for 'qSupported' to the debug server. This doesn't recognize any features yet, but does parse the features string. It advertises an arbitrary packet size of 4k. Reviewed by: markj, Scott Phillips MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20308 Modified: head/usr.sbin/bhyve/gdb.c Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Fri May 24 20:36:07 2019 (r348252) +++ head/usr.sbin/bhyve/gdb.c Fri May 24 22:11:37 2019 (r348253) @@ -993,13 +993,72 @@ command_equals(const uint8_t *data, size_t len, const } static void +check_features(const uint8_t *data, size_t len) +{ + char *feature, *next_feature, *str, *value; + bool supported; + + str = malloc(len + 1); + memcpy(str, data, len); + str[len] = '\0'; + next_feature = str; + + while ((feature = strsep(&next_feature, ";")) != NULL) { + /* + * Null features shouldn't exist, but skip if they + * do. + */ + if (strcmp(feature, "") == 0) + continue; + + /* + * Look for the value or supported / not supported + * flag. + */ + value = strchr(feature, '='); + if (value != NULL) { + *value = '\0'; + value++; + supported = true; + } else { + value = feature + strlen(feature) - 1; + switch (*value) { + case '+': + supported = true; + break; + case '-': + supported = false; + break; + default: + /* + * This is really a protocol error, + * but we just ignore malformed + * features for ease of + * implementation. + */ + continue; + } + value = NULL; + } + + /* No currently supported features. */ + } + free(str); + + start_packet(); + + /* This is an arbitrary limit. */ + append_string("PacketSize=4096"); + finish_packet(); +} + +static void gdb_query(const uint8_t *data, size_t len) { /* * TODO: * - qSearch - * - qSupported */ if (command_equals(data, len, "qAttached")) { start_packet(); @@ -1037,6 +1096,10 @@ gdb_query(const uint8_t *data, size_t len) start_packet(); append_char('l'); finish_packet(); + } else if (command_equals(data, len, "qSupported")) { + data += strlen("qSupported"); + len -= strlen("qSupported"); + check_features(data, len); } else if (command_equals(data, len, "qThreadExtraInfo")) { char buf[16]; int tid; From owner-svn-src-all@freebsd.org Fri May 24 22:30:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DEE715B6A62; Fri, 24 May 2019 22:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1468269C; Fri, 24 May 2019 22:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 177152323A; Fri, 24 May 2019 22:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4OMUjHn067069; Fri, 24 May 2019 22:30:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OMUfMo067047; Fri, 24 May 2019 22:30:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905242230.x4OMUfMo067047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 May 2019 22:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348254 - in head/sys: dev/cxgbe dev/mlx5/mlx5_en kern net net80211 netinet netinet6 netpfil/ipfw sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/mlx5/mlx5_en kern net net80211 netinet netinet6 netpfil/ipfw sys X-SVN-Commit-Revision: 348254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B1468269C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 22:30:45 -0000 Author: jhb Date: Fri May 24 22:30:40 2019 New Revision: 348254 URL: https://svnweb.freebsd.org/changeset/base/348254 Log: Restructure mbuf send tags to provide stronger guarantees. - Perform ifp mismatch checks (to determine if a send tag is allocated for a different ifp than the one the packet is being output on), in ip_output() and ip6_output(). This avoids sending packets with send tags to ifnet drivers that don't support send tags. Since we are now checking for ifp mismatches before invoking if_output, we can now try to allocate a new tag before invoking if_output sending the original packet on the new tag if allocation succeeds. To avoid code duplication for the fragment and unfragmented cases, add ip_output_send() and ip6_output_send() as wrappers around if_output and nd6_output_ifp, respectively. All of the logic for setting send tags and dealing with send tag-related errors is done in these wrapper functions. For pseudo interfaces that wrap other network interfaces (vlan and lagg), wrapper send tags are now allocated so that ip*_output see the wrapper ifp as the ifp in the send tag. The if_transmit routines rewrite the send tags after performing an ifp mismatch check. If an ifp mismatch is detected, the transmit routines fail with EAGAIN. - To provide clearer life cycle management of send tags, especially in the presence of vlan and lagg wrapper tags, add a reference count to send tags managed via m_snd_tag_ref() and m_snd_tag_rele(). Provide a helper function (m_snd_tag_init()) for use by drivers supporting send tags. m_snd_tag_init() takes care of the if_ref on the ifp meaning that code alloating send tags via if_snd_tag_alloc no longer has to manage that manually. Similarly, m_snd_tag_rele drops the refcount on the ifp after invoking if_snd_tag_free when the last reference to a send tag is dropped. This also closes use after free races if there are pending packets in driver tx rings after the socket is closed (e.g. from tcpdrop). In order for m_free to work reliably, add a new CSUM_SND_TAG flag in csum_flags to indicate 'snd_tag' is set (rather than 'rcvif'). Drivers now also check this flag instead of checking snd_tag against NULL. This avoids false positive matches when a forwarded packet has a non-NULL rcvif that was treated as a send tag. - cxgbe was relying on snd_tag_free being called when the inp was detached so that it could kick the firmware to flush any pending work on the flow. This is because the driver doesn't require ACK messages from the firmware for every request, but instead does a kind of manual interrupt coalescing by only setting a flag to request a completion on a subset of requests. If all of the in-flight requests don't have the flag when the tag is detached from the inp, the flow might never return the credits. The current snd_tag_free command issues a flush command to force the credits to return. However, the credit return is what also frees the mbufs, and since those mbufs now hold references on the tag, this meant that snd_tag_free would never be called. To fix, explicitly drop the mbuf's reference on the snd tag when the mbuf is queued in the firmware work queue. This means that once the inp's reference on the tag goes away and all in-flight mbufs have been queued to the firmware, tag's refcount will drop to zero and snd_tag_free will kick in and send the flush request. Note that we need to avoid doing this in the middle of ethofld_tx(), so the driver grabs a temporary reference on the tag around that loop to defer the free to the end of the function in case it sends the last mbuf to the queue after the inp has dropped its reference on the tag. - mlx5 preallocates send tags and was using the ifp pointer even when the send tag wasn't in use. Explicitly use the ifp from other data structures instead. - Sprinkle some assertions in various places to assert that received packets don't have a send tag, and that other places that overwrite rcvif (e.g. 802.11 transmit) don't clobber a send tag pointer. Reviewed by: gallatin, hselasky, rgrimes, ae Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20117 Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/net/bpf.c head/sys/net/if.c head/sys/net/if_ethersubr.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c head/sys/net/netisr.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_wds.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/cxgbe/t4_main.c Fri May 24 22:30:40 2019 (r348254) @@ -2057,13 +2057,8 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) return (rc); } #ifdef RATELIMIT - if (m->m_pkthdr.snd_tag != NULL) { - /* EAGAIN tells the stack we are not the correct interface. */ - if (__predict_false(ifp != m->m_pkthdr.snd_tag->ifp)) { - m_freem(m); - return (EAGAIN); - } - + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { + MPASS(m->m_pkthdr.snd_tag->ifp == ifp); return (ethofld_transmit(ifp, m)); } #endif Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/cxgbe/t4_sched.c Fri May 24 22:30:40 2019 (r348254) @@ -789,7 +789,7 @@ failed: mtx_init(&cst->lock, "cst_lock", NULL, MTX_DEF); mbufq_init(&cst->pending_tx, INT_MAX); mbufq_init(&cst->pending_fwack, INT_MAX); - cst->com.ifp = ifp; + m_snd_tag_init(&cst->com, ifp); cst->flags |= EO_FLOWC_PENDING | EO_SND_TAG_REF; cst->adapter = sc; cst->port_id = pi->port_id; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/cxgbe/t4_sge.c Fri May 24 22:30:40 2019 (r348254) @@ -2325,7 +2325,7 @@ static inline int needs_eo(struct mbuf *m) { - return (m->m_pkthdr.snd_tag != NULL); + return (m->m_pkthdr.csum_flags & CSUM_SND_TAG); } #endif @@ -2539,8 +2539,11 @@ restart: * checksumming is enabled. needs_l4_csum happens to check for all the * right things. */ - if (__predict_false(needs_eo(m0) && !needs_l4_csum(m0))) + if (__predict_false(needs_eo(m0) && !needs_l4_csum(m0))) { + m_snd_tag_rele(m0->m_pkthdr.snd_tag); m0->m_pkthdr.snd_tag = NULL; + m0->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; + } #endif if (!needs_tso(m0) && @@ -5922,6 +5925,21 @@ ethofld_tx(struct cxgbe_snd_tag *cst) cst->tx_nocompl = 0; } (void) mbufq_dequeue(&cst->pending_tx); + + /* + * Drop the mbuf's reference on the tag now rather + * than waiting until m_freem(). This ensures that + * cxgbe_snd_tag_free gets called when the inp drops + * its reference on the tag and there are no more + * mbufs in the pending_tx queue and can flush any + * pending requests. Otherwise if the last mbuf + * doesn't request a completion the etid will never be + * released. + */ + m->m_pkthdr.snd_tag = NULL; + m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; + m_snd_tag_rele(&cst->com); + mbufq_enqueue(&cst->pending_fwack, m); } } @@ -5933,6 +5951,7 @@ ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) int rc; MPASS(m0->m_nextpkt == NULL); + MPASS(m0->m_pkthdr.csum_flags & CSUM_SND_TAG); MPASS(m0->m_pkthdr.snd_tag != NULL); cst = mst_to_cst(m0->m_pkthdr.snd_tag); @@ -5967,8 +5986,18 @@ ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) mbufq_enqueue(&cst->pending_tx, m0); cst->plen += m0->m_pkthdr.len; + /* + * Hold an extra reference on the tag while generating work + * requests to ensure that we don't try to free the tag during + * ethofld_tx() in case we are sending the final mbuf after + * the inp was freed. + */ + m_snd_tag_ref(&cst->com); ethofld_tx(cst); - rc = 0; + mtx_unlock(&cst->lock); + m_snd_tag_rele(&cst->com); + return (0); + done: mtx_unlock(&cst->lock); if (__predict_false(rc != 0)) @@ -6015,7 +6044,6 @@ ethofld_fw4_ack(struct sge_iq *iq, const struct rss_he cst->flags &= ~EO_FLUSH_RPL_PENDING; cst->tx_credits += cpl->credits; -freetag: cxgbe_snd_tag_free_locked(cst); return (0); /* cst is gone. */ } @@ -6033,21 +6061,26 @@ freetag: cst->tx_credits += cpl->credits; MPASS(cst->tx_credits <= cst->tx_total); - m = mbufq_first(&cst->pending_tx); - if (m != NULL && cst->tx_credits >= mbuf_eo_len16(m)) - ethofld_tx(cst); - - if (__predict_false((cst->flags & EO_SND_TAG_REF) == 0) && - cst->ncompl == 0) { - if (cst->tx_credits == cst->tx_total) - goto freetag; - else { - MPASS((cst->flags & EO_FLUSH_RPL_PENDING) == 0); - send_etid_flush_wr(cst); - } + if (cst->flags & EO_SND_TAG_REF) { + /* + * As with ethofld_transmit(), hold an extra reference + * so that the tag is stable across ethold_tx(). + */ + m_snd_tag_ref(&cst->com); + m = mbufq_first(&cst->pending_tx); + if (m != NULL && cst->tx_credits >= mbuf_eo_len16(m)) + ethofld_tx(cst); + mtx_unlock(&cst->lock); + m_snd_tag_rele(&cst->com); + } else { + /* + * There shouldn't be any pending packets if the tag + * was freed by the kernel since any pending packet + * should hold a reference to the tag. + */ + MPASS(mbufq_first(&cst->pending_tx) == NULL); + mtx_unlock(&cst->lock); } - - mtx_unlock(&cst->lock); return (0); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri May 24 22:30:40 2019 (r348254) @@ -1247,7 +1247,7 @@ mlx5e_create_rq(struct mlx5e_channel *c, wq_sz = mlx5_wq_ll_get_size(&rq->wq); - err = -tcp_lro_init_args(&rq->lro, c->tag.m_snd_tag.ifp, TCP_LRO_ENTRIES, wq_sz); + err = -tcp_lro_init_args(&rq->lro, priv->ifp, TCP_LRO_ENTRIES, wq_sz); if (err) goto err_rq_wq_destroy; @@ -1288,7 +1288,7 @@ mlx5e_create_rq(struct mlx5e_channel *c, } } - rq->ifp = c->tag.m_snd_tag.ifp; + rq->ifp = priv->ifp; rq->channel = c; rq->ix = c->ix; @@ -2145,7 +2145,6 @@ mlx5e_open_channel(struct mlx5e_priv *priv, int ix, c->priv = priv; c->ix = ix; /* setup send tag */ - c->tag.m_snd_tag.ifp = priv->ifp; c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; c->mkey_be = cpu_to_be32(priv->mr.key); c->num_tc = priv->num_tc; @@ -3987,6 +3986,8 @@ mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, if (unlikely(pch->sq[0].running == 0)) return (ENXIO); mlx5e_ref_channel(priv); + MPASS(pch->tag.m_snd_tag.refcount == 0); + m_snd_tag_init(&pch->tag.m_snd_tag, ifp); *ppmt = &pch->tag.m_snd_tag; return (0); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Fri May 24 22:30:40 2019 (r348254) @@ -843,7 +843,6 @@ mlx5e_rl_init(struct mlx5e_priv *priv) for (i = 0; i < rl->param.tx_channels_per_worker_def; i++) { struct mlx5e_rl_channel *channel = rlw->channels + i; channel->worker = rlw; - channel->tag.m_snd_tag.ifp = priv->ifp; channel->tag.type = IF_SND_TAG_TYPE_RATE_LIMIT; STAILQ_INSERT_TAIL(&rlw->index_list_head, channel, entry); } @@ -1127,6 +1126,8 @@ mlx5e_rl_snd_tag_alloc(struct ifnet *ifp, } /* store pointer to mbuf tag */ + MPASS(channel->tag.m_snd_tag.refcount == 0); + m_snd_tag_init(&channel->tag.m_snd_tag, ifp); *ppmt = &channel->tag.m_snd_tag; done: return (error); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri May 24 22:30:40 2019 (r348254) @@ -83,10 +83,6 @@ mlx5e_select_queue_by_send_tag(struct ifnet *ifp, stru struct mlx5e_snd_tag *ptag; struct mlx5e_sq *sq; - /* check for route change */ - if (mb->m_pkthdr.snd_tag->ifp != ifp) - return (NULL); - /* get pointer to sendqueue */ ptag = container_of(mb->m_pkthdr.snd_tag, struct mlx5e_snd_tag, m_snd_tag); @@ -609,21 +605,10 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) struct mlx5e_sq *sq; int ret; - if (mb->m_pkthdr.snd_tag != NULL) { + if (mb->m_pkthdr.csum_flags & CSUM_SND_TAG) { + MPASS(mb->m_pkthdr.snd_tag->ifp == ifp); sq = mlx5e_select_queue_by_send_tag(ifp, mb); if (unlikely(sq == NULL)) { - /* Check for route change */ - if (mb->m_pkthdr.snd_tag->ifp != ifp) { - /* Free mbuf */ - m_freem(mb); - - /* - * Tell upper layers about route - * change and to re-transmit this - * packet: - */ - return (EAGAIN); - } goto select_queue; } } else { Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/kern/kern_mbuf.c Fri May 24 22:30:40 2019 (r348254) @@ -46,8 +46,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include + #include #include #include @@ -112,6 +116,10 @@ static quad_t maxmbufmem; /* overall real memory limit SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxmbufmem, 0, "Maximum real memory allocatable to various mbuf types"); +static counter_u64_t snd_tag_count; +SYSCTL_COUNTER_U64(_kern_ipc, OID_AUTO, num_snd_tags, CTLFLAG_RW, + &snd_tag_count, "# of active mbuf send tags"); + /* * tunable_mbinit() has to be run before any mbuf allocations are done. */ @@ -378,6 +386,8 @@ mbuf_init(void *dummy) */ EVENTHANDLER_REGISTER(vm_lowmem, mb_reclaim, NULL, EVENTHANDLER_PRI_FIRST); + + snd_tag_count = counter_u64_alloc(M_WAITOK); } SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); @@ -1148,4 +1158,25 @@ m_freem(struct mbuf *mb) MBUF_PROBE1(m__freem, mb); while (mb != NULL) mb = m_free(mb); +} + +void +m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp) +{ + + if_ref(ifp); + mst->ifp = ifp; + refcount_init(&mst->refcount, 1); + counter_u64_add(snd_tag_count, 1); +} + +void +m_snd_tag_destroy(struct m_snd_tag *mst) +{ + struct ifnet *ifp; + + ifp = mst->ifp; + ifp->if_snd_tag_free(mst); + if_rele(ifp); + counter_u64_add(snd_tag_count, -1); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/kern/uipc_mbuf.c Fri May 24 22:30:40 2019 (r348254) @@ -382,6 +382,10 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from) to->m_pkthdr = from->m_pkthdr; /* especially tags */ SLIST_INIT(&from->m_pkthdr.tags); /* purge tags from src */ from->m_flags &= ~M_PKTHDR; + if (from->m_pkthdr.csum_flags & CSUM_SND_TAG) { + from->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; + from->m_pkthdr.snd_tag = NULL; + } } /* @@ -414,6 +418,8 @@ m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, if ((to->m_flags & M_EXT) == 0) to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; + if (from->m_pkthdr.csum_flags & CSUM_SND_TAG) + m_snd_tag_ref(from->m_pkthdr.snd_tag); SLIST_INIT(&to->m_pkthdr.tags); return (m_tag_copy_chain(to, from, how)); } @@ -924,7 +930,12 @@ m_split(struct mbuf *m0, int len0, int wait) return (NULL); n->m_next = m->m_next; m->m_next = NULL; - n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif; + if (m0->m_pkthdr.csum_flags & CSUM_SND_TAG) { + n->m_pkthdr.snd_tag = + m_snd_tag_ref(m0->m_pkthdr.snd_tag); + n->m_pkthdr.csum_flags |= CSUM_SND_TAG; + } else + n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif; n->m_pkthdr.len = m0->m_pkthdr.len - len0; m0->m_pkthdr.len = len0; return (n); @@ -932,7 +943,12 @@ m_split(struct mbuf *m0, int len0, int wait) n = m_gethdr(wait, m0->m_type); if (n == NULL) return (NULL); - n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif; + if (m0->m_pkthdr.csum_flags & CSUM_SND_TAG) { + n->m_pkthdr.snd_tag = + m_snd_tag_ref(m0->m_pkthdr.snd_tag); + n->m_pkthdr.csum_flags |= CSUM_SND_TAG; + } else + n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif; n->m_pkthdr.len = m0->m_pkthdr.len - len0; m0->m_pkthdr.len = len0; if (m->m_flags & M_EXT) Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/bpf.c Fri May 24 22:30:40 2019 (r348254) @@ -2304,7 +2304,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) int gottime; /* Skip outgoing duplicate packets. */ - if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { + if ((m->m_flags & M_PROMISC) != 0 && m_rcvif(m) == NULL) { m->m_flags &= ~M_PROMISC; return; } @@ -2314,7 +2314,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) NET_EPOCH_ENTER(et); CK_LIST_FOREACH(d, &bp->bif_dlist, bd_next) { - if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) + if (BPF_CHECK_DIRECTION(d, m_rcvif(m), bp->bif_ifp)) continue; counter_u64_add(d->bd_rcount, 1); #ifdef BPF_JITTER Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/if.c Fri May 24 22:30:40 2019 (r348254) @@ -4295,6 +4295,8 @@ if_getsoftc(if_t ifp) void if_setrcvif(struct mbuf *m, if_t ifp) { + + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); m->m_pkthdr.rcvif = (struct ifnet *)ifp; } Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/if_ethersubr.c Fri May 24 22:30:40 2019 (r348254) @@ -816,6 +816,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m) * We will rely on rcvif being set properly in the deferred context, * so assert it is correct here. */ + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch m %p " "rcvif %p ifp %p", __func__, m, m->m_pkthdr.rcvif, ifp)); CURVNET_SET_QUIET(ifp->if_vnet); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/if_lagg.c Fri May 24 22:30:40 2019 (r348254) @@ -95,6 +95,11 @@ static struct { {0, NULL} }; +struct lagg_snd_tag { + struct m_snd_tag com; + struct m_snd_tag *tag; +}; + VNET_DEFINE(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */ #define V_lagg_list VNET(lagg_list) VNET_DEFINE_STATIC(struct mtx, lagg_list_mtx); @@ -134,6 +139,10 @@ static int lagg_ioctl(struct ifnet *, u_long, caddr_t) static int lagg_snd_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); +static int lagg_snd_tag_modify(struct m_snd_tag *, + union if_snd_tag_modify_params *); +static int lagg_snd_tag_query(struct m_snd_tag *, + union if_snd_tag_query_params *); static void lagg_snd_tag_free(struct m_snd_tag *); #endif static int lagg_setmulti(struct lagg_port *); @@ -525,6 +534,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; #ifdef RATELIMIT ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; + ifp->if_snd_tag_modify = lagg_snd_tag_modify; + ifp->if_snd_tag_query = lagg_snd_tag_query; ifp->if_snd_tag_free = lagg_snd_tag_free; #endif ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -1537,63 +1548,126 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data } #ifdef RATELIMIT -static int -lagg_snd_tag_alloc(struct ifnet *ifp, - union if_snd_tag_alloc_params *params, - struct m_snd_tag **ppmt) +static inline struct lagg_snd_tag * +mst_to_lst(struct m_snd_tag *mst) { - struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; + + return (__containerof(mst, struct lagg_snd_tag, com)); +} + +/* + * Look up the port used by a specific flow. This only works for lagg + * protocols with deterministic port mappings (e.g. not roundrobin). + * In addition protocols which use a hash to map flows to ports must + * be configured to use the mbuf flowid rather than hashing packet + * contents. + */ +static struct lagg_port * +lookup_snd_tag_port(struct ifnet *ifp, uint32_t flowid, uint32_t flowtype) +{ + struct lagg_softc *sc; struct lagg_port *lp; struct lagg_lb *lb; uint32_t p; - LAGG_RLOCK(); + sc = ifp->if_softc; + switch (sc->sc_proto) { case LAGG_PROTO_FAILOVER: - lp = lagg_link_active(sc, sc->sc_primary); - break; + return (lagg_link_active(sc, sc->sc_primary)); case LAGG_PROTO_LOADBALANCE: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) { - LAGG_RUNLOCK(); - return (EOPNOTSUPP); - } - p = params->hdr.flowid >> sc->flowid_shift; + flowtype == M_HASHTYPE_NONE) + return (NULL); + p = flowid >> sc->flowid_shift; p %= sc->sc_count; lb = (struct lagg_lb *)sc->sc_psc; lp = lb->lb_ports[p]; - lp = lagg_link_active(sc, lp); - break; + return (lagg_link_active(sc, lp)); case LAGG_PROTO_LACP: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) { - LAGG_RUNLOCK(); - return (EOPNOTSUPP); - } - lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); - break; + flowtype == M_HASHTYPE_NONE) + return (NULL); + return (lacp_select_tx_port_by_hash(sc, flowid)); default: + return (NULL); + } +} + +static int +lagg_snd_tag_alloc(struct ifnet *ifp, + union if_snd_tag_alloc_params *params, + struct m_snd_tag **ppmt) +{ + struct lagg_snd_tag *lst; + struct lagg_softc *sc; + struct lagg_port *lp; + struct ifnet *lp_ifp; + int error; + + sc = ifp->if_softc; + + LAGG_RLOCK(); + lp = lookup_snd_tag_port(ifp, params->hdr.flowid, params->hdr.flowtype); + if (lp == NULL) { LAGG_RUNLOCK(); return (EOPNOTSUPP); } - if (lp == NULL) { + if (lp->lp_ifp == NULL || lp->lp_ifp->if_snd_tag_alloc == NULL) { LAGG_RUNLOCK(); return (EOPNOTSUPP); } - ifp = lp->lp_ifp; + lp_ifp = lp->lp_ifp; + if_ref(lp_ifp); LAGG_RUNLOCK(); - if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || - (ifp->if_capenable & IFCAP_TXRTLMT) == 0) - return (EOPNOTSUPP); - /* forward allocation request */ - return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); + lst = malloc(sizeof(*lst), M_LAGG, M_NOWAIT); + if (lst == NULL) { + if_rele(lp_ifp); + return (ENOMEM); + } + + error = lp_ifp->if_snd_tag_alloc(lp_ifp, params, &lst->tag); + if_rele(lp_ifp); + if (error) { + free(lst, M_LAGG); + return (error); + } + + m_snd_tag_init(&lst->com, ifp); + + *ppmt = &lst->com; + return (0); } +static int +lagg_snd_tag_modify(struct m_snd_tag *mst, + union if_snd_tag_modify_params *params) +{ + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + return (lst->tag->ifp->if_snd_tag_modify(lst->tag, params)); +} + +static int +lagg_snd_tag_query(struct m_snd_tag *mst, + union if_snd_tag_query_params *params) +{ + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + return (lst->tag->ifp->if_snd_tag_query(lst->tag, params)); +} + static void -lagg_snd_tag_free(struct m_snd_tag *tag) +lagg_snd_tag_free(struct m_snd_tag *mst) { - tag->ifp->if_snd_tag_free(tag); + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + m_snd_tag_rele(lst->tag); + free(lst, M_LAGG); } #endif @@ -1720,6 +1794,10 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m) struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; int error; +#ifdef RATELIMIT + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) + MPASS(m->m_pkthdr.snd_tag->ifp == ifp); +#endif LAGG_RLOCK(); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { @@ -1910,6 +1988,21 @@ int lagg_enqueue(struct ifnet *ifp, struct mbuf *m) { +#ifdef RATELIMIT + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { + struct lagg_snd_tag *lst; + struct m_snd_tag *mst; + + mst = m->m_pkthdr.snd_tag; + lst = mst_to_lst(mst); + if (lst->tag->ifp != ifp) { + m_freem(m); + return (EAGAIN); + } + m->m_pkthdr.snd_tag = m_snd_tag_ref(lst->tag); + m_snd_tag_rele(mst); + } +#endif return (ifp->if_transmit)(ifp, m); } Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/if_vlan.c Fri May 24 22:30:40 2019 (r348254) @@ -103,6 +103,20 @@ struct ifvlantrunk { int refcnt; }; +#ifdef RATELIMIT +struct vlan_snd_tag { + struct m_snd_tag com; + struct m_snd_tag *tag; +}; + +static inline struct vlan_snd_tag * +mst_to_vst(struct m_snd_tag *mst) +{ + + return (__containerof(mst, struct vlan_snd_tag, com)); +} +#endif + /* * This macro provides a facility to iterate over every vlan on a trunk with * the assumption that none will be added/removed during iteration. @@ -267,7 +281,11 @@ static int vlan_ioctl(struct ifnet *ifp, u_long cmd, c #ifdef RATELIMIT static int vlan_snd_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); -static void vlan_snd_tag_free(struct m_snd_tag *); +static int vlan_snd_tag_modify(struct m_snd_tag *, + union if_snd_tag_modify_params *); +static int vlan_snd_tag_query(struct m_snd_tag *, + union if_snd_tag_query_params *); +static void vlan_snd_tag_free(struct m_snd_tag *); #endif static void vlan_qflush(struct ifnet *ifp); static int vlan_setflag(struct ifnet *ifp, int flag, int status, @@ -1048,6 +1066,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, si ifp->if_ioctl = vlan_ioctl; #ifdef RATELIMIT ifp->if_snd_tag_alloc = vlan_snd_tag_alloc; + ifp->if_snd_tag_modify = vlan_snd_tag_modify; + ifp->if_snd_tag_query = vlan_snd_tag_query; ifp->if_snd_tag_free = vlan_snd_tag_free; #endif ifp->if_flags = VLAN_IFFLAGS; @@ -1137,6 +1157,26 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m) BPF_MTAP(ifp, m); +#ifdef RATELIMIT + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { + struct vlan_snd_tag *vst; + struct m_snd_tag *mst; + + MPASS(m->m_pkthdr.snd_tag->ifp == ifp); + mst = m->m_pkthdr.snd_tag; + vst = mst_to_vst(mst); + if (vst->tag->ifp != p) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + NET_EPOCH_EXIT(et); + m_freem(m); + return (EAGAIN); + } + + m->m_pkthdr.snd_tag = m_snd_tag_ref(vst->tag); + m_snd_tag_rele(mst); + } +#endif + /* * Do not run parent's if_transmit() if the parent is not up, * or parent's driver will cause a system crash. @@ -1928,18 +1968,71 @@ vlan_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { + struct epoch_tracker et; + struct vlan_snd_tag *vst; + struct ifvlan *ifv; + struct ifnet *parent; + int error; - /* get trunk device */ - ifp = vlan_trunkdev(ifp); - if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) + NET_EPOCH_ENTER(et); + ifv = ifp->if_softc; + if (ifv->ifv_trunk != NULL) + parent = PARENT(ifv); + else + parent = NULL; + if (parent == NULL || parent->if_snd_tag_alloc == NULL) { + NET_EPOCH_EXIT(et); return (EOPNOTSUPP); - /* forward allocation request */ - return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); + } + if_ref(parent); + NET_EPOCH_EXIT(et); + + vst = malloc(sizeof(*vst), M_VLAN, M_NOWAIT); + if (vst == NULL) { + if_rele(parent); + return (ENOMEM); + } + + error = parent->if_snd_tag_alloc(parent, params, &vst->tag); + if_rele(parent); + if (error) { + free(vst, M_VLAN); + return (error); + } + + m_snd_tag_init(&vst->com, ifp); + + *ppmt = &vst->com; + return (0); } +static int +vlan_snd_tag_modify(struct m_snd_tag *mst, + union if_snd_tag_modify_params *params) +{ + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + return (vst->tag->ifp->if_snd_tag_modify(vst->tag, params)); +} + +static int +vlan_snd_tag_query(struct m_snd_tag *mst, + union if_snd_tag_query_params *params) +{ + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + return (vst->tag->ifp->if_snd_tag_query(vst->tag, params)); +} + static void -vlan_snd_tag_free(struct m_snd_tag *tag) +vlan_snd_tag_free(struct m_snd_tag *mst) { - tag->ifp->if_snd_tag_free(tag); + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + m_snd_tag_rele(vst->tag); + free(vst, M_VLAN); } #endif Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net/netisr.c Fri May 24 22:30:40 2019 (r348254) @@ -839,6 +839,7 @@ netisr_select_cpuid(struct netisr_proto *npp, u_int di ("%s: invalid policy %u for %s", __func__, npp->np_policy, npp->np_name)); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); ifp = m->m_pkthdr.rcvif; if (ifp != NULL) *cpuidp = nws_array[(ifp->if_index + source) % nws_count]; Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net80211/ieee80211_hwmp.c Fri May 24 22:30:40 2019 (r348254) @@ -2015,6 +2015,7 @@ done: */ IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, "%s", "queue frame until path found"); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); m->m_pkthdr.rcvif = (void *)(uintptr_t) ieee80211_mac_hash(ic, dest); /* XXX age chosen randomly */ Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net80211/ieee80211_mesh.c Fri May 24 22:30:40 2019 (r348254) @@ -1225,6 +1225,7 @@ mesh_forward(struct ieee80211vap *vap, struct mbuf *m, M_WME_SETAC(mcopy, WME_AC_BE); /* XXX do we know m_nextpkt is NULL? */ + MPASS((mcopy->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); mcopy->m_pkthdr.rcvif = (void *) ni; /* Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net80211/ieee80211_output.c Fri May 24 22:30:40 2019 (r348254) @@ -163,6 +163,7 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, * uses any existing value for rcvif to identify the * interface it (might have been) received on. */ + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); m->m_pkthdr.rcvif = (void *)ni; mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; @@ -528,6 +529,7 @@ ieee80211_raw_output(struct ieee80211vap *vap, struct * that the mbuf has the same node value that * it would if it were going via the normal path. */ + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); m->m_pkthdr.rcvif = (void *)ni; /* Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/net80211/ieee80211_wds.c Fri May 24 22:30:40 2019 (r348254) @@ -299,6 +299,7 @@ ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct continue; } mcopy->m_flags |= M_MCAST; + MPASS((mcopy->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); mcopy->m_pkthdr.rcvif = (void *) ni; err = ieee80211_parent_xmitpkt(ic, mcopy); @@ -332,6 +333,7 @@ ieee80211_dwds_discover(struct ieee80211_node *ni, str * XXX handle overflow? * XXX per/vap beacon interval? */ + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); m->m_pkthdr.rcvif = (void *)(uintptr_t) ieee80211_mac_hash(ic, ni->ni_macaddr); (void) ieee80211_ageq_append(&ic->ic_stageq, m, Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/netinet/in_pcb.c Fri May 24 22:30:40 2019 (r348254) @@ -3274,13 +3274,6 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet * error = EOPNOTSUPP; } else { error = ifp->if_snd_tag_alloc(ifp, ¶ms, &inp->inp_snd_tag); - - /* - * At success increment the refcount on - * the send tag's network interface: - */ - if (error == 0) - if_ref(inp->inp_snd_tag->ifp); } return (error); } @@ -3293,7 +3286,6 @@ void in_pcbdetach_txrtlmt(struct inpcb *inp) { struct m_snd_tag *mst; - struct ifnet *ifp; INP_WLOCK_ASSERT(inp); @@ -3303,19 +3295,7 @@ in_pcbdetach_txrtlmt(struct inpcb *inp) if (mst == NULL) return; - ifp = mst->ifp; - if (ifp == NULL) - return; - - /* - * If the device was detached while we still had reference(s) - * on the ifp, we assume if_snd_tag_free() was replaced with - * stubs. - */ - ifp->if_snd_tag_free(mst); - - /* release reference count on network interface */ - if_rele(ifp); + m_snd_tag_rele(mst); } /* @@ -3359,6 +3339,17 @@ in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet * * variable read itself will be atomic. */ max_pacing_rate = socket->so_max_pacing_rate; + + /* + * If the existing send tag is for the wrong interface due to + * a route change, first drop the existing tag. Set the + * CHANGED flag so that we will keep trying to allocate a new + * tag if we fail to allocate one this time. + */ + if (inp->inp_snd_tag != NULL && inp->inp_snd_tag->ifp != ifp) { + in_pcbdetach_txrtlmt(inp); + inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; + } /* * NOTE: When attaching to a network interface a reference is Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri May 24 22:11:37 2019 (r348253) +++ head/sys/netinet/ip_output.c Fri May 24 22:30:40 2019 (r348254) @@ -204,6 +204,51 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, st return 0; } +static int +ip_output_send(struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, + const struct sockaddr_in *gw, struct route *ro) +{ + struct m_snd_tag *mst; + int error; + + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + mst = NULL; + +#ifdef RATELIMIT + if (inp != NULL) { + if ((inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) != 0 || + (inp->inp_snd_tag != NULL && + inp->inp_snd_tag->ifp != ifp)) + in_pcboutput_txrtlmt(inp, ifp, m); + + if (inp->inp_snd_tag != NULL) + mst = inp->inp_snd_tag; + } +#endif + if (mst != NULL) { + KASSERT(m->m_pkthdr.rcvif == NULL, + ("trying to add a send tag to a forwarded packet")); + if (mst->ifp != ifp) { + error = EAGAIN; + goto done; + } + + /* stamp send tag on mbuf */ + m->m_pkthdr.snd_tag = m_snd_tag_ref(mst); + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; + } + + error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); + +done: + /* Check for route change invalidating send tags. */ +#ifdef RATELIMIT + if (error == EAGAIN) + in_pcboutput_eagain(inp); +#endif + return (error); +} + /* * IP output. The packet in mbuf chain m contains a skeletal IP * header (with len, off, ttl, proto, tos, src, dst). @@ -687,23 +732,7 @@ sendit: */ m_clrprotoflags(m); IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); -#ifdef RATELIMIT - if (inp != NULL) { - if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) - in_pcboutput_txrtlmt(inp, ifp, m); - /* stamp send tag on mbuf */ - m->m_pkthdr.snd_tag = inp->inp_snd_tag; - } else { - m->m_pkthdr.snd_tag = NULL; - } -#endif - error = (*ifp->if_output)(ifp, m, - (const struct sockaddr *)gw, ro); -#ifdef RATELIMIT - /* check for route change */ - if (error == EAGAIN) - in_pcboutput_eagain(inp); -#endif + error = ip_output_send(inp, ifp, m, gw, ro); goto done; } @@ -739,23 +768,7 @@ sendit: IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, mtod(m, struct ip *), NULL); -#ifdef RATELIMIT - if (inp != NULL) { - if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) - in_pcboutput_txrtlmt(inp, ifp, m); - /* stamp send tag on mbuf */ - m->m_pkthdr.snd_tag = inp->inp_snd_tag; - } else { - m->m_pkthdr.snd_tag = NULL; - } -#endif - error = (*ifp->if_output)(ifp, m, - (const struct sockaddr *)gw, ro); -#ifdef RATELIMIT - /* check for route change */ - if (error == EAGAIN) - in_pcboutput_eagain(inp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 24 22:33:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3177915B6C71; Fri, 24 May 2019 22:33:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4BC182B77; Fri, 24 May 2019 22:33:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A254D233E5; Fri, 24 May 2019 22:33:14 +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 x4OMXEjs071845; Fri, 24 May 2019 22:33:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4OMXEAr071844; Fri, 24 May 2019 22:33:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905242233.x4OMXEAr071844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 May 2019 22:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348255 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4BC182B77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 22:33:15 -0000 Author: cem Date: Fri May 24 22:33:14 2019 New Revision: 348255 URL: https://svnweb.freebsd.org/changeset/base/348255 Log: Disable intr_storm_threshold mechanism by default The ixl.4 manual page has documented that the threshold falsely detects interrupt storms on 40Gbit NICs as long ago as 2015, and we have seen similar false positives with the ioat(4) DMA device (which can push GB/s). For example, synthetic load can be generated with tools/tools/ioat 'ioatcontrol 0 200 8192 1 1000' (allocate 200x8kB buffers, generate an interrupt for each one, and do this for 1000 milliseconds). With storm-detection disabled, the Broadwell-EP version of this device is capable of generating ~350k real interrupts per second. The following historical context comes from jhb@: Originally, the threshold worked around incorrect routing of PCI INTx interrupts on single-CPU systems which would end up in a hard hang during boot. Since the threshold was added, our PCI interrupt routing was improved, most PCI interrupts use edge-triggered MSI instead of level-triggered INTx, and typical systems have multiple CPUs available to service interrupts. On the off chance that the threshold is useful in the future, it remains available as a tunable and sysctl. Reviewed by: jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20401 Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Fri May 24 22:30:40 2019 (r348254) +++ head/sys/kern/kern_intr.c Fri May 24 22:33:14 2019 (r348255) @@ -91,7 +91,7 @@ struct proc *intrproc; static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); -static int intr_storm_threshold = 1000; +static int intr_storm_threshold = 0; SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, &intr_storm_threshold, 0, "Number of consecutive interrupts before storm protection is enabled"); From owner-svn-src-all@freebsd.org Fri May 24 23:01:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B23715B7512; Fri, 24 May 2019 23:01:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 043EC83927; Fri, 24 May 2019 23:01:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4ON1ZDJ098366; Fri, 24 May 2019 16:01:35 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4ON1Zju098365; Fri, 24 May 2019 16:01:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905242301.x4ON1Zju098365@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348250 - head/sys/powerpc/conf In-Reply-To: <20190524152941.40f7e239@titan.knownspace> To: Justin Hibbits Date: Fri, 24 May 2019 16:01:35 -0700 (PDT) CC: Alexey Dokuchaev , Piotr Kubaj , 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-Rspamd-Queue-Id: 043EC83927 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:01:44 -0000 > On Fri, 24 May 2019 20:22:52 +0000 > Alexey Dokuchaev wrote: > > > On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > > > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > > > New Revision: 348250 > > > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > > > > > Log: > > > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > > > > > amd64 also has snd_hda(4) in GENERIC. > > > > > > > > Modified: > > > > head/sys/powerpc/conf/GENERIC64 > > > > ... > > > > > > To note: This was done because there's a strange bug in the snd_hda > > > module, with the hdaa component. For some reason it either doesn't > > > find all the internal components it needs, or something, because > > > there's a NULL dereference when trying to call a kobj method in > > > hdaa_attach(). > > > > So this commit essentially masks the real bug somewhere rather than > > fixing it, is this what you're saying? > > > > ./danfe > > It's a viable workaround to a problem that reaches a wide audience. > Since it works built-in, I found it acceptable. I probably should have > filed a bug for it a year ago when I hit it and worked around it, but it > could also very well be a compiler issue. > > By the way, it works fine on powerpc (32-bit) loaded as a module. Please do file a bug report now, please do mark the line in GENERIC64 with a comment XXX This is needed to work around foo so that it is documented why it is there and someone removing it does not go down a rabit hole others have already been down, and so that some day someone may go down that rabbit hole of there own free will and fix this for us. Paving over the top of obscure bugs with a hackish fix is ok, not documenting this state of affairs is not, IMHO. > - Justin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 24 23:07:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4AB15B769C; Fri, 24 May 2019 23:07:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFF5783C80; Fri, 24 May 2019 23:07:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D38323960; Fri, 24 May 2019 23:07:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ON7WYg087712; Fri, 24 May 2019 23:07:32 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ON7WXo087711; Fri, 24 May 2019 23:07:32 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905242307.x4ON7WXo087711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 24 May 2019 23:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348256 - stable/12/sbin/fsck_ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sbin/fsck_ffs X-SVN-Commit-Revision: 348256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFF5783C80 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:07:33 -0000 Author: mckusick Date: Fri May 24 23:07:32 2019 New Revision: 348256 URL: https://svnweb.freebsd.org/changeset/base/348256 Log: MFC of 348074 Rewrite fsck_readdir() and dircheck() for clarity and correctness. Modified: stable/12/sbin/fsck_ffs/dir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/dir.c ============================================================================== --- stable/12/sbin/fsck_ffs/dir.c Fri May 24 22:33:14 2019 (r348255) +++ stable/12/sbin/fsck_ffs/dir.c Fri May 24 23:07:32 2019 (r348256) @@ -61,7 +61,7 @@ static struct dirtemplate dirhead = { }; static int chgino(struct inodesc *); -static int dircheck(struct inodesc *, struct direct *); +static int dircheck(struct inodesc *, struct bufarea *, struct direct *); static int expanddir(union dinode *dp, char *name); static void freedir(ino_t ino, ino_t parent); static struct direct *fsck_readdir(struct inodesc *); @@ -139,78 +139,70 @@ dirscan(struct inodesc *idesc) } /* - * get next entry in a directory. + * Get and verify the next entry in a directory. + * We also verify that if there is another entry in the block that it is + * valid, so if it is not valid it can be subsumed into the current entry. */ static struct direct * fsck_readdir(struct inodesc *idesc) { struct direct *dp, *ndp; struct bufarea *bp; - long size, blksiz, fix, dploc; - int dc; + long size, blksiz, subsume_ndp; + subsume_ndp = 0; blksiz = idesc->id_numfrags * sblock.fs_fsize; + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) + return (NULL); bp = getdirblk(idesc->id_blkno, blksiz); - if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && - idesc->id_loc < blksiz) { - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if ((dc = dircheck(idesc, dp)) > 0) { - if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } - goto dpok; - } - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - dp->d_reclen = DIRBLKSIZ; - dp->d_ino = 0; - dp->d_type = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; - if (fix) - dirty(bp); - idesc->id_loc += DIRBLKSIZ; - idesc->id_filesize -= DIRBLKSIZ; - return (dp); + dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + /* + * Only need to check current entry if it is the first in the + * the block, as later entries will have been checked in the + * previous call to this function. + */ + if (idesc->id_loc % DIRBLKSIZ != 0 || dircheck(idesc, bp, dp) != 0) { + /* + * Current entry is good, update to point at next. + */ + idesc->id_loc += dp->d_reclen; + idesc->id_filesize -= dp->d_reclen; + /* + * If at end of directory block, just return this entry. + */ + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz || + idesc->id_loc % DIRBLKSIZ == 0) + return (dp); + /* + * If the next entry good, return this entry. + */ + ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + if (dircheck(idesc, bp, ndp) != 0) + return (dp); + /* + * The next entry is bad, so subsume it and the remainder + * of this directory block into this entry. + */ + subsume_ndp = 1; } -dpok: - if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) - return NULL; - dploc = idesc->id_loc; - dp = (struct direct *)(bp->b_un.b_buf + dploc); - idesc->id_loc += dp->d_reclen; - idesc->id_filesize -= dp->d_reclen; - if ((idesc->id_loc % DIRBLKSIZ) == 0) - return (dp); - ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { - if ((dc = dircheck(idesc, ndp)) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) - dirty(bp); - } else if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } + /* + * Current or next entry is bad. Zap current entry or + * subsume next entry into current entry as appropriate. + */ + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (NULL); + if (subsume_ndp) { + memset(ndp, 0, size); + dp->d_reclen += size; + } else { + memset(dp, 0, size); + dp->d_reclen = size; } + if (dofix(idesc, "DIRECTORY CORRUPTED")) + dirty(bp); return (dp); } @@ -219,65 +211,80 @@ dpok: * This is a superset of the checks made in the kernel. * Also optionally clears padding and unused directory space. * - * Returns 0 if the entry is bad, 1 if the entry is good and no changes - * were made, and 2 if the entry is good but modified to clear out padding - * and unused space and needs to be written back to disk. + * Returns 0 if the entry is bad, 1 if the entry is good. */ static int -dircheck(struct inodesc *idesc, struct direct *dp) +dircheck(struct inodesc *idesc, struct bufarea *bp, struct direct *dp) { size_t size; char *cp; - u_char type; u_int8_t namlen; int spaceleft, modified, unused; - modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + size = DIRSIZ(0, dp); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || + dp->d_reclen < size || + idesc->id_filesize < size || (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; + modified = 0; if (dp->d_ino == 0) { + if (!zflag || fswritefd < 0) + return (1); /* - * Special case of an unused directory entry. Normally - * the kernel would coalesce unused space with the previous - * entry by extending its d_reclen, but there are situations - * (e.g. fsck) where that doesn't occur. - * If we're clearing out directory cruft (-z flag), then make - * sure this entry gets fully cleared as well. + * Special case of an unused directory entry. Normally only + * occurs at the beginning of a directory block when the block + * contains no entries. Other than the first entry in a + * directory block, the kernel coalesces unused space with + * the previous entry by extending its d_reclen. However, + * when cleaning up a directory, fsck may set d_ino to zero + * in the middle of a directory block. If we're clearing out + * directory cruft (-z flag), then make sure that all directory + * space in entries with d_ino == 0 gets fully cleared. */ - if (zflag && fswritefd >= 0) { - if (dp->d_type != 0) { - dp->d_type = 0; + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + unused = dp->d_reclen - __offsetof(struct direct, d_name); + for (cp = dp->d_name; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; modified = 1; } - if (dp->d_namlen != 0) { - dp->d_namlen = 0; - modified = 1; - } - if (dp->d_name[0] != '\0') { - dp->d_name[0] = '\0'; - modified = 1; - } } - goto good; + if (modified) + dirty(bp); + return (1); } - size = DIRSIZ(0, dp); + /* + * The d_type field should not be tested here. A bad type is an error + * in the entry itself but is not a corruption of the directory + * structure itself. So blowing away all the remaining entries in the + * directory block is inappropriate. Rather the type error should be + * checked in pass1 and fixed there. + * + * The name validation should also be done in pass1 although the + * check to see if the name is longer than fits in the space + * allocated for it (i.e., the *cp != '\0' fails after exiting the + * loop below) then it really is a structural error that requires + * the stronger action taken here. + */ namlen = dp->d_namlen; - type = dp->d_type; - if (dp->d_reclen < size || - idesc->id_filesize < size || - namlen == 0 || - type > 15) + if (namlen == 0 || dp->d_type > 15) goto bad; - for (cp = dp->d_name, size = 0; size < namlen; size++) - if (*cp == '\0' || (*cp++ == '/')) + for (cp = dp->d_name, size = 0; size < namlen; size++) { + if (*cp == '\0' || *cp++ == '/') goto bad; + } if (*cp != '\0') goto bad; - -good: if (zflag && fswritefd >= 0) { /* * Clear unused directory entry space, including the d_name @@ -300,11 +307,9 @@ good: } } - if (modified) { - return 2; - } + if (modified) + dirty(bp); } - return (1); bad: From owner-svn-src-all@freebsd.org Fri May 24 23:21:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E7A915B7A9C for ; Fri, 24 May 2019 23:21:52 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2767C842DA for ; Fri, 24 May 2019 23:21:52 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-lj1-x22f.google.com with SMTP id r76so4562305lja.12 for ; Fri, 24 May 2019 16:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OaRPxNiOZGgeK3Rq556SEPDaQoEviIzR8r/qchDg3MM=; b=YeOKaOABZrHa3DONQMgV7WJttpQNmpbIQaoBQ834xvrwoIb1gmrt62pw4EmEK1OGqV xk7P+OfIU/1Ls1yWj7/46l5n7hIMOqzhKIRQ8WNCgrJn1yiaEzGQJSf1o7UAn0xORihC j+dDXwupjohRUCETysp9y9/9u90SxUe+iFAoRTkmXu3+rjYverqexlkzipvK5rSUeGCj Z7mXUwbWQY2LQWMGnwGMd3g9d+BWXwtFYKpJLianR/0cqWSU6FJ84VGJFyFdzGES5h/Q tooeQEW4zWrISKf4RJvmhbDSLR0yAgcu0poRic8Um3++ehZqjX12bAUGVEYFZSah/qHf iGkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OaRPxNiOZGgeK3Rq556SEPDaQoEviIzR8r/qchDg3MM=; b=Qp+VHoHiXFY9aT5y3maE0EKeVTq8d63eLbkPBuUbWYIAEN+rymoPrNXMkqcpT9uPw0 s8MsnPEFcvollweXI0qGPn/oj17Blw2dZAZHLdorT53/lXu5EJKxvVB3vnTONBLgMLoQ m98ctaMZzy9z/H4eLw84CrQ1X6GmcSmgK1ILyoKseKL8R/nTVHrxCHpf3n6Watraurzy mnnHxeG3ir0rbnpMKuYG9xPvkKOTxIHj57EzR7p65Ilpm0PeWP74ArvUnVD0Q03LSoTU bvqfnnfDpw9xSHNqAYPbszZg8xMn9+k4mM9LaCdebBkfxjrCXaqxdTP6PH+fv3VE7OJ0 51yg== X-Gm-Message-State: APjAAAW4UTXDC0hkNN11vcCNQt4HmRgIWlZLybk2jRe14AFDptN7KWCo k9s4Jo51AXH4rhi5dnoEBQY+GepE+j/rfBUay7E1HQ== X-Google-Smtp-Source: APXvYqyFnx0r5KfvFTzQSTP/J/X5a3UwgK0+LvoxVCrDJWlHM7UKOhR8fipwJT2QJls/NI9z6Id6YMze1XFv8HnT/kc= X-Received: by 2002:a2e:90d1:: with SMTP id o17mr40556440ljg.187.1558740110030; Fri, 24 May 2019 16:21:50 -0700 (PDT) MIME-Version: 1.0 References: <201905242233.x4OMXEAr071844@repo.freebsd.org> In-Reply-To: <201905242233.x4OMXEAr071844@repo.freebsd.org> From: Steven Hartland Date: Sat, 25 May 2019 00:21:39 +0100 Message-ID: Subject: Re: svn commit: r348255 - head/sys/kern To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 2767C842DA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:21:52 -0000 Just wanted to say I really appreciate the details in this commit message. Its often the case the message get overlooked when it comes to the time needed to write a truly useful message to others and this a great example of the quality we should all try to follow. Regards Steve On Fri, 24 May 2019 at 23:33, Conrad Meyer wrote: > Author: cem > Date: Fri May 24 22:33:14 2019 > New Revision: 348255 > URL: https://svnweb.freebsd.org/changeset/base/348255 > > Log: > Disable intr_storm_threshold mechanism by default > > The ixl.4 manual page has documented that the threshold falsely detects > interrupt storms on 40Gbit NICs as long ago as 2015, and we have seen > similar false positives with the ioat(4) DMA device (which can push > GB/s). > > For example, synthetic load can be generated with tools/tools/ioat > 'ioatcontrol 0 200 8192 1 1000' (allocate 200x8kB buffers, generate an > interrupt for each one, and do this for 1000 milliseconds). With > storm-detection disabled, the Broadwell-EP version of this device is > capable > of generating ~350k real interrupts per second. > > The following historical context comes from jhb@: Originally, the > threshold > worked around incorrect routing of PCI INTx interrupts on single-CPU > systems > which would end up in a hard hang during boot. Since the threshold was > added, our PCI interrupt routing was improved, most PCI interrupts use > edge-triggered MSI instead of level-triggered INTx, and typical systems > have > multiple CPUs available to service interrupts. > > On the off chance that the threshold is useful in the future, it remains > available as a tunable and sysctl. > > Reviewed by: jhb > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20401 > > Modified: > head/sys/kern/kern_intr.c > > Modified: head/sys/kern/kern_intr.c > > ============================================================================== > --- head/sys/kern/kern_intr.c Fri May 24 22:30:40 2019 (r348254) > +++ head/sys/kern/kern_intr.c Fri May 24 22:33:14 2019 (r348255) > @@ -91,7 +91,7 @@ struct proc *intrproc; > > static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); > > -static int intr_storm_threshold = 1000; > +static int intr_storm_threshold = 0; > SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, > &intr_storm_threshold, 0, > "Number of consecutive interrupts before storm protection is > enabled"); > > From owner-svn-src-all@freebsd.org Fri May 24 23:26:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DFE215B7B56; Fri, 24 May 2019 23:26:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B142E844DF; Fri, 24 May 2019 23:26:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8564723CAC; Fri, 24 May 2019 23:26:17 +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 x4ONQHUF098387; Fri, 24 May 2019 23:26:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ONQH8N098386; Fri, 24 May 2019 23:26:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905242326.x4ONQH8N098386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 May 2019 23:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348257 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 348257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B142E844DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:26:18 -0000 Author: kib Date: Fri May 24 23:26:17 2019 New Revision: 348257 URL: https://svnweb.freebsd.org/changeset/base/348257 Log: Add PG_PS_PDP_FRAME symbol. Similar to PG_FRAME and PG_PS_FRAME, it denotes the mask of the physical address component of 1G superpage PDP entry. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20386 Modified: head/sys/amd64/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri May 24 23:07:32 2019 (r348256) +++ head/sys/amd64/include/pmap.h Fri May 24 23:26:17 2019 (r348257) @@ -119,6 +119,7 @@ #define PG_PROMOTED X86_PG_AVAIL(54) /* PDE only */ #define PG_FRAME (0x000ffffffffff000ul) #define PG_PS_FRAME (0x000fffffffe00000ul) +#define PG_PS_PDP_FRAME (0x000fffffc0000000ul) /* * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB From owner-svn-src-all@freebsd.org Fri May 24 23:28:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7D415B7C1F; Fri, 24 May 2019 23:28:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 415BD8467A; Fri, 24 May 2019 23:28:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4F223CB3; Fri, 24 May 2019 23:28:12 +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 x4ONSBlB098509; Fri, 24 May 2019 23:28:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ONSB48098508; Fri, 24 May 2019 23:28:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905242328.x4ONSB48098508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 May 2019 23:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348258 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 415BD8467A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:28:12 -0000 Author: kib Date: Fri May 24 23:28:11 2019 New Revision: 348258 URL: https://svnweb.freebsd.org/changeset/base/348258 Log: Fix too loose assert in pmap_large_unmap(). The upper bound for the valid address from the large map used LARGEMAP_MAX_ADDRESS instead of LARGEMAP_MIN_ADDRESS. Provide a function-like macro for proper upper value. Noted by: markj Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20386 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 24 23:26:17 2019 (r348257) +++ head/sys/amd64/amd64/pmap.c Fri May 24 23:28:11 2019 (r348258) @@ -421,6 +421,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags f static vmem_t *large_vmem; static u_int lm_ents; +#define PMAP_LARGEMAP_MAX_ADDRESS() \ + (LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents) int pmap_pcid_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -1060,6 +1062,7 @@ static void pmap_invalidate_pde_page(pmap_t pmap, vm_o pd_entry_t pde); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_large_map_getptp_unlocked(void); +static vm_paddr_t pmap_large_map_kextract(vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); #if VM_NRESERVLEVEL > 0 static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, @@ -2961,6 +2964,9 @@ pmap_kextract(vm_offset_t va) if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { pa = DMAP_TO_PHYS(va); + } else if (LARGEMAP_MIN_ADDRESS <= va && + va < PMAP_LARGEMAP_MAX_ADDRESS()) { + pa = pmap_large_map_kextract(va); } else { pde = *vtopde(va); if (pde & PG_PS) { @@ -8775,6 +8781,39 @@ retry: return ((pt_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pte_index(va)); } +static vm_paddr_t +pmap_large_map_kextract(vm_offset_t va) +{ + pdp_entry_t *pdpe, pdp; + pd_entry_t *pde, pd; + pt_entry_t *pte, pt; + + KASSERT(LARGEMAP_MIN_ADDRESS <= va && va < PMAP_LARGEMAP_MAX_ADDRESS(), + ("not largemap range %#lx", (u_long)va)); + pdpe = pmap_large_map_pdpe(va); + pdp = *pdpe; + KASSERT((pdp & X86_PG_V) != 0, + ("invalid pdp va %#lx pdpe %#lx pdp %#lx", va, + (u_long)pdpe, pdp)); + if ((pdp & X86_PG_PS) != 0) { + KASSERT((amd_feature & AMDID_PAGE1GB) != 0, + ("no 1G pages, va %#lx pdpe %#lx pdp %#lx", va, + (u_long)pdpe, pdp)); + return ((pdp & PG_PS_PDP_FRAME) | (va & PDPMASK)); + } + pde = pmap_pdpe_to_pde(pdpe, va); + pd = *pde; + KASSERT((pd & X86_PG_V) != 0, + ("invalid pd va %#lx pde %#lx pd %#lx", va, (u_long)pde, pd)); + if ((pd & X86_PG_PS) != 0) + return ((pd & PG_PS_FRAME) | (va & PDRMASK)); + pte = pmap_pde_to_pte(pde, va); + pt = *pte; + KASSERT((pt & X86_PG_V) != 0, + ("invalid pte va %#lx pte %#lx pt %#lx", va, (u_long)pte, pt)); + return ((pt & PG_FRAME) | (va & PAGE_MASK)); +} + static int pmap_large_map_getva(vm_size_t len, vm_offset_t align, vm_offset_t phase, vmem_addr_t *vmem_res) @@ -8891,8 +8930,8 @@ pmap_large_unmap(void *svaa, vm_size_t len) return; SLIST_INIT(&spgf); - KASSERT(LARGEMAP_MIN_ADDRESS <= sva && sva + len <= - LARGEMAP_MAX_ADDRESS + NBPML4 * (u_long)lm_ents, + KASSERT(LARGEMAP_MIN_ADDRESS <= sva && + sva + len <= PMAP_LARGEMAP_MAX_ADDRESS(), ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len)); PMAP_LOCK(kernel_pmap); for (va = sva; va < sva + len; va += inc) { From owner-svn-src-all@freebsd.org Fri May 24 23:33:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04AD215B7E78; Fri, 24 May 2019 23:33:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2040884CCF; Fri, 24 May 2019 23:33:11 +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 x4ONX31v026512 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 25 May 2019 02:33:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4ONX31v026512 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4ONX3Vj026511; Sat, 25 May 2019 02:33:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 May 2019 02:33:03 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348258 - head/sys/amd64/amd64 Message-ID: <20190524233303.GS2748@kib.kiev.ua> References: <201905242328.x4ONSB48098508@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905242328.x4ONSB48098508@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2019 23:33:12 -0000 On Fri, May 24, 2019 at 11:28:11PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri May 24 23:28:11 2019 > New Revision: 348258 > URL: https://svnweb.freebsd.org/changeset/base/348258 > > Log: > Fix too loose assert in pmap_large_unmap(). > > The upper bound for the valid address from the large map used > LARGEMAP_MAX_ADDRESS instead of LARGEMAP_MIN_ADDRESS. Provide a > function-like macro for proper upper value. This commit was inadvertently merged with the next one, where the commit message was supposed to be 'Make pmap_kextract() operational over the large map.' Other metadata in the log is correct. I do not want to revert it for re-commit. > > Noted by: markj > Reviewed by: alc, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D20386 > > Modified: > head/sys/amd64/amd64/pmap.c > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Fri May 24 23:26:17 2019 (r348257) > +++ head/sys/amd64/amd64/pmap.c Fri May 24 23:28:11 2019 (r348258) > @@ -421,6 +421,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags f > > static vmem_t *large_vmem; > static u_int lm_ents; > +#define PMAP_LARGEMAP_MAX_ADDRESS() \ > + (LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents) > > int pmap_pcid_enabled = 1; > SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, > @@ -1060,6 +1062,7 @@ static void pmap_invalidate_pde_page(pmap_t pmap, vm_o > pd_entry_t pde); > static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); > static vm_page_t pmap_large_map_getptp_unlocked(void); > +static vm_paddr_t pmap_large_map_kextract(vm_offset_t va); > static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); > #if VM_NRESERVLEVEL > 0 > static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, > @@ -2961,6 +2964,9 @@ pmap_kextract(vm_offset_t va) > > if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { > pa = DMAP_TO_PHYS(va); > + } else if (LARGEMAP_MIN_ADDRESS <= va && > + va < PMAP_LARGEMAP_MAX_ADDRESS()) { > + pa = pmap_large_map_kextract(va); > } else { > pde = *vtopde(va); > if (pde & PG_PS) { > @@ -8775,6 +8781,39 @@ retry: > return ((pt_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pte_index(va)); > } > > +static vm_paddr_t > +pmap_large_map_kextract(vm_offset_t va) > +{ > + pdp_entry_t *pdpe, pdp; > + pd_entry_t *pde, pd; > + pt_entry_t *pte, pt; > + > + KASSERT(LARGEMAP_MIN_ADDRESS <= va && va < PMAP_LARGEMAP_MAX_ADDRESS(), > + ("not largemap range %#lx", (u_long)va)); > + pdpe = pmap_large_map_pdpe(va); > + pdp = *pdpe; > + KASSERT((pdp & X86_PG_V) != 0, > + ("invalid pdp va %#lx pdpe %#lx pdp %#lx", va, > + (u_long)pdpe, pdp)); > + if ((pdp & X86_PG_PS) != 0) { > + KASSERT((amd_feature & AMDID_PAGE1GB) != 0, > + ("no 1G pages, va %#lx pdpe %#lx pdp %#lx", va, > + (u_long)pdpe, pdp)); > + return ((pdp & PG_PS_PDP_FRAME) | (va & PDPMASK)); > + } > + pde = pmap_pdpe_to_pde(pdpe, va); > + pd = *pde; > + KASSERT((pd & X86_PG_V) != 0, > + ("invalid pd va %#lx pde %#lx pd %#lx", va, (u_long)pde, pd)); > + if ((pd & X86_PG_PS) != 0) > + return ((pd & PG_PS_FRAME) | (va & PDRMASK)); > + pte = pmap_pde_to_pte(pde, va); > + pt = *pte; > + KASSERT((pt & X86_PG_V) != 0, > + ("invalid pte va %#lx pte %#lx pt %#lx", va, (u_long)pte, pt)); > + return ((pt & PG_FRAME) | (va & PAGE_MASK)); > +} > + > static int > pmap_large_map_getva(vm_size_t len, vm_offset_t align, vm_offset_t phase, > vmem_addr_t *vmem_res) > @@ -8891,8 +8930,8 @@ pmap_large_unmap(void *svaa, vm_size_t len) > return; > > SLIST_INIT(&spgf); > - KASSERT(LARGEMAP_MIN_ADDRESS <= sva && sva + len <= > - LARGEMAP_MAX_ADDRESS + NBPML4 * (u_long)lm_ents, > + KASSERT(LARGEMAP_MIN_ADDRESS <= sva && > + sva + len <= PMAP_LARGEMAP_MAX_ADDRESS(), > ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len)); > PMAP_LOCK(kernel_pmap); > for (va = sva; va < sva + len; va += inc) { From owner-svn-src-all@freebsd.org Sat May 25 00:07:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2450E15B86C5; Sat, 25 May 2019 00:07:50 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1843859B9; Sat, 25 May 2019 00:07:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B4B924392; Sat, 25 May 2019 00:07:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4P07nOr019188; Sat, 25 May 2019 00:07:49 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P07nfA019187; Sat, 25 May 2019 00:07:49 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905250007.x4P07nfA019187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 25 May 2019 00:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348259 - head/sys/geom/nop X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/geom/nop X-SVN-Commit-Revision: 348259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1843859B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 00:07:50 -0000 Author: mckusick Date: Sat May 25 00:07:49 2019 New Revision: 348259 URL: https://svnweb.freebsd.org/changeset/base/348259 Log: When using the destroy option to shut down a nop GEOM module, I/O operations already in its queue were not being properly drained. The GEOM framework does the queue draining, but the module needs to wait for the draining to happen. The waiting is done by adding a g_nop_providergone() function to wait for the I/O operations to finish up. This change is similar to change -r345758 made to the memory-disk driver. Submitted by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix Modified: head/sys/geom/nop/g_nop.c Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Fri May 24 23:28:11 2019 (r348258) +++ head/sys/geom/nop/g_nop.c Sat May 25 00:07:49 2019 (r348259) @@ -54,17 +54,26 @@ static int g_nop_destroy_geom(struct gctl_req *req, st struct g_geom *gp); static void g_nop_config(struct gctl_req *req, struct g_class *mp, const char *verb); -static void g_nop_dumpconf(struct sbuf *sb, const char *indent, - struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static g_access_t g_nop_access; +static g_dumpconf_t g_nop_dumpconf; +static g_orphan_t g_nop_orphan; +static g_provgone_t g_nop_providergone; +static g_resize_t g_nop_resize; +static g_start_t g_nop_start; struct g_class g_nop_class = { .name = G_NOP_CLASS_NAME, .version = G_VERSION, .ctlreq = g_nop_config, - .destroy_geom = g_nop_destroy_geom + .destroy_geom = g_nop_destroy_geom, + .access = g_nop_access, + .dumpconf = g_nop_dumpconf, + .orphan = g_nop_orphan, + .providergone = g_nop_providergone, + .resize = g_nop_resize, + .start = g_nop_start, }; - static void g_nop_orphan(struct g_consumer *cp) { @@ -320,11 +329,6 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, sc->sc_wrotebytes = 0; mtx_init(&sc->sc_lock, "gnop lock", NULL, MTX_DEF); gp->softc = sc; - gp->start = g_nop_start; - gp->orphan = g_nop_orphan; - gp->resize = g_nop_resize; - gp->access = g_nop_access; - gp->dumpconf = g_nop_dumpconf; newpp = g_new_providerf(gp, "%s", gp->name); newpp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; @@ -357,6 +361,18 @@ fail: return (error); } +static void +g_nop_providergone(struct g_provider *pp) +{ + struct g_geom *gp = pp->geom; + struct g_nop_softc *sc = gp->softc; + + gp->softc = NULL; + free(sc->sc_physpath, M_GEOM); + mtx_destroy(&sc->sc_lock); + g_free(sc); +} + static int g_nop_destroy(struct g_geom *gp, boolean_t force) { @@ -367,7 +383,6 @@ g_nop_destroy(struct g_geom *gp, boolean_t force) sc = gp->softc; if (sc == NULL) return (ENXIO); - free(sc->sc_physpath, M_GEOM); pp = LIST_FIRST(&gp->provider); if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { if (force) { @@ -381,9 +396,6 @@ g_nop_destroy(struct g_geom *gp, boolean_t force) } else { G_NOP_DEBUG(0, "Device %s removed.", gp->name); } - gp->softc = NULL; - mtx_destroy(&sc->sc_lock); - g_free(sc); g_wither_geom(gp, ENXIO); return (0); From owner-svn-src-all@freebsd.org Sat May 25 00:22:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FA5215B8C5D; Sat, 25 May 2019 00:22:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF7586080; Sat, 25 May 2019 00:22:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04489246E1; Sat, 25 May 2019 00:22:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4P0M7i2027599; Sat, 25 May 2019 00:22:07 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P0M77A027598; Sat, 25 May 2019 00:22:07 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905250022.x4P0M77A027598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 25 May 2019 00:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348260 - stable/11/sbin/fsck_ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sbin/fsck_ffs X-SVN-Commit-Revision: 348260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2AF7586080 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 00:22:08 -0000 Author: mckusick Date: Sat May 25 00:22:07 2019 New Revision: 348260 URL: https://svnweb.freebsd.org/changeset/base/348260 Log: MFC of 348074 Rewrite fsck_readdir() and dircheck() for clarity and correctness. Approved by: re (gjb) Modified: stable/11/sbin/fsck_ffs/dir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/dir.c ============================================================================== --- stable/11/sbin/fsck_ffs/dir.c Sat May 25 00:07:49 2019 (r348259) +++ stable/11/sbin/fsck_ffs/dir.c Sat May 25 00:22:07 2019 (r348260) @@ -59,7 +59,7 @@ static struct dirtemplate dirhead = { }; static int chgino(struct inodesc *); -static int dircheck(struct inodesc *, struct direct *); +static int dircheck(struct inodesc *, struct bufarea *, struct direct *); static int expanddir(union dinode *dp, char *name); static void freedir(ino_t ino, ino_t parent); static struct direct *fsck_readdir(struct inodesc *); @@ -137,78 +137,70 @@ dirscan(struct inodesc *idesc) } /* - * get next entry in a directory. + * Get and verify the next entry in a directory. + * We also verify that if there is another entry in the block that it is + * valid, so if it is not valid it can be subsumed into the current entry. */ static struct direct * fsck_readdir(struct inodesc *idesc) { struct direct *dp, *ndp; struct bufarea *bp; - long size, blksiz, fix, dploc; - int dc; + long size, blksiz, subsume_ndp; + subsume_ndp = 0; blksiz = idesc->id_numfrags * sblock.fs_fsize; + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) + return (NULL); bp = getdirblk(idesc->id_blkno, blksiz); - if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && - idesc->id_loc < blksiz) { - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if ((dc = dircheck(idesc, dp)) > 0) { - if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } - goto dpok; - } - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - dp->d_reclen = DIRBLKSIZ; - dp->d_ino = 0; - dp->d_type = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; - if (fix) - dirty(bp); - idesc->id_loc += DIRBLKSIZ; - idesc->id_filesize -= DIRBLKSIZ; - return (dp); + dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + /* + * Only need to check current entry if it is the first in the + * the block, as later entries will have been checked in the + * previous call to this function. + */ + if (idesc->id_loc % DIRBLKSIZ != 0 || dircheck(idesc, bp, dp) != 0) { + /* + * Current entry is good, update to point at next. + */ + idesc->id_loc += dp->d_reclen; + idesc->id_filesize -= dp->d_reclen; + /* + * If at end of directory block, just return this entry. + */ + if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz || + idesc->id_loc % DIRBLKSIZ == 0) + return (dp); + /* + * If the next entry good, return this entry. + */ + ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); + if (dircheck(idesc, bp, ndp) != 0) + return (dp); + /* + * The next entry is bad, so subsume it and the remainder + * of this directory block into this entry. + */ + subsume_ndp = 1; } -dpok: - if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) - return NULL; - dploc = idesc->id_loc; - dp = (struct direct *)(bp->b_un.b_buf + dploc); - idesc->id_loc += dp->d_reclen; - idesc->id_filesize -= dp->d_reclen; - if ((idesc->id_loc % DIRBLKSIZ) == 0) - return (dp); - ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { - if ((dc = dircheck(idesc, ndp)) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) - dirty(bp); - } else if (dc == 2) { - /* - * dircheck() cleared unused directory space. - * Mark the buffer as dirty to write it out. - */ - dirty(bp); - } + /* + * Current or next entry is bad. Zap current entry or + * subsume next entry into current entry as appropriate. + */ + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (NULL); + if (subsume_ndp) { + memset(ndp, 0, size); + dp->d_reclen += size; + } else { + memset(dp, 0, size); + dp->d_reclen = size; } + if (dofix(idesc, "DIRECTORY CORRUPTED")) + dirty(bp); return (dp); } @@ -217,65 +209,80 @@ dpok: * This is a superset of the checks made in the kernel. * Also optionally clears padding and unused directory space. * - * Returns 0 if the entry is bad, 1 if the entry is good and no changes - * were made, and 2 if the entry is good but modified to clear out padding - * and unused space and needs to be written back to disk. + * Returns 0 if the entry is bad, 1 if the entry is good. */ static int -dircheck(struct inodesc *idesc, struct direct *dp) +dircheck(struct inodesc *idesc, struct bufarea *bp, struct direct *dp) { size_t size; char *cp; - u_char type; u_int8_t namlen; int spaceleft, modified, unused; - modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + size = DIRSIZ(0, dp); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || + dp->d_reclen < size || + idesc->id_filesize < size || (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; + modified = 0; if (dp->d_ino == 0) { + if (!zflag || fswritefd < 0) + return (1); /* - * Special case of an unused directory entry. Normally - * the kernel would coalesce unused space with the previous - * entry by extending its d_reclen, but there are situations - * (e.g. fsck) where that doesn't occur. - * If we're clearing out directory cruft (-z flag), then make - * sure this entry gets fully cleared as well. + * Special case of an unused directory entry. Normally only + * occurs at the beginning of a directory block when the block + * contains no entries. Other than the first entry in a + * directory block, the kernel coalesces unused space with + * the previous entry by extending its d_reclen. However, + * when cleaning up a directory, fsck may set d_ino to zero + * in the middle of a directory block. If we're clearing out + * directory cruft (-z flag), then make sure that all directory + * space in entries with d_ino == 0 gets fully cleared. */ - if (zflag && fswritefd >= 0) { - if (dp->d_type != 0) { - dp->d_type = 0; + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + unused = dp->d_reclen - __offsetof(struct direct, d_name); + for (cp = dp->d_name; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; modified = 1; } - if (dp->d_namlen != 0) { - dp->d_namlen = 0; - modified = 1; - } - if (dp->d_name[0] != '\0') { - dp->d_name[0] = '\0'; - modified = 1; - } } - goto good; + if (modified) + dirty(bp); + return (1); } - size = DIRSIZ(0, dp); + /* + * The d_type field should not be tested here. A bad type is an error + * in the entry itself but is not a corruption of the directory + * structure itself. So blowing away all the remaining entries in the + * directory block is inappropriate. Rather the type error should be + * checked in pass1 and fixed there. + * + * The name validation should also be done in pass1 although the + * check to see if the name is longer than fits in the space + * allocated for it (i.e., the *cp != '\0' fails after exiting the + * loop below) then it really is a structural error that requires + * the stronger action taken here. + */ namlen = dp->d_namlen; - type = dp->d_type; - if (dp->d_reclen < size || - idesc->id_filesize < size || - namlen == 0 || - type > 15) + if (namlen == 0 || dp->d_type > 15) goto bad; - for (cp = dp->d_name, size = 0; size < namlen; size++) - if (*cp == '\0' || (*cp++ == '/')) + for (cp = dp->d_name, size = 0; size < namlen; size++) { + if (*cp == '\0' || *cp++ == '/') goto bad; + } if (*cp != '\0') goto bad; - -good: if (zflag && fswritefd >= 0) { /* * Clear unused directory entry space, including the d_name @@ -298,11 +305,9 @@ good: } } - if (modified) { - return 2; - } + if (modified) + dirty(bp); } - return (1); bad: From owner-svn-src-all@freebsd.org Sat May 25 00:38:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6EFB15B8F95; Sat, 25 May 2019 00:38:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 2854F8673C; Sat, 25 May 2019 00:38:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id UKi1h4qaisAGkUKi3hDEoN; Fri, 24 May 2019 18:38:52 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=E5NmQfObTbMA:10 a=ASrO2z8EAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=UEpEsKYdWQD3eQkOumkA:9 a=Rc5TUw_wQp4Z_7gz:21 a=eqxhlmoB-vvMXGhw:21 a=QEXdDO2ut3YA:10 a=i8UNxtqY09YYJATF_ugA:9 a=HIt_kXhqRHWN5h8v:21 a=bn3e2i_yJ9W2f3Ef:21 a=ci6mo512LUvLpNOh:21 a=_W_S_7VecoQA:10 a=hMlqHZxbFqNCaWTKXPQf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [10.224.108.1] (unknown [24.244.23.196]) by spqr.komquats.com (Postfix) with ESMTPSA id B5580CEB; Fri, 24 May 2019 17:38:48 -0700 (PDT) Date: Fri, 24 May 2019 17:38:24 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <201905242233.x4OMXEAr071844@repo.freebsd.org> MIME-Version: 1.0 Subject: Re: svn commit: r348255 - head/sys/kern To: Steven Hartland , Conrad Meyer CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <003FD1FE-C765-4873-A784-D743F6A2156C@cschubert.com> X-CMAE-Envelope: MS4wfFoiywZUpU3etClt8mdHA81u4zTKgAC7wCs3mK9tf20KdMzco07r3xmQL9SdjK18gTjvuEOucZ8f9rwOgk61lAmJNa+w/+l7DIZTKFqMfDIzw6k4kZ14 hebWAjVWuJuWDTrvBUqcM2YW2Wwdt8sv1QtauY3ULpKRkyUmgMSWBbC2tLQQ59zDtZuBulqd0j5B2NNAdoyg8bcQN+GhBH9DVDAjRVrfLsRw2dN1leaDJh+8 GZZ30lY8yWegBmqeTkeeOMYrNOOK/ADlGnJrRs/2CEpORAHuq7X09LbaW6pwKUnUV22X/saf6Pj+HGYMVqdYod5Gog8cB0cq+ZjKIZfbbqI= X-Rspamd-Queue-Id: 2854F8673C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 00:38:56 -0000 +1 -------- Original Message -------- From: Steven Hartland Sent: May 24, 2019 4:21:39 PM PDT To: Conrad Meyer Cc: src-committers@freebsd=2Eorg, svn-src-all@freebsd=2Eorg, svn-src-head@= freebsd=2Eorg Subject: Re: svn commit: r348255 - head/sys/kern Just wanted to say I really appreciate the details in this commit message= =2E Its often the case the message get overlooked when it comes to the time needed to write a truly useful message to others and this a great example of the quality we should all try to follow=2E Regards Steve On Fri, 24 May 2019 at 23:33, Conrad Meyer wrote: > Author: cem > Date: Fri May 24 22:33:14 2019 > New Revision: 348255 > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/348255 > > Log: > Disable intr_storm_threshold mechanism by default > > The ixl=2E4 manual page has documented that the threshold falsely dete= cts > interrupt storms on 40Gbit NICs as long ago as 2015, and we have seen > similar false positives with the ioat(4) DMA device (which can push > GB/s)=2E > > For example, synthetic load can be generated with tools/tools/ioat > 'ioatcontrol 0 200 8192 1 1000' (allocate 200x8kB buffers, generate an > interrupt for each one, and do this for 1000 milliseconds)=2E With > storm-detection disabled, the Broadwell-EP version of this device is > capable > of generating ~350k real interrupts per second=2E > > The following historical context comes from jhb@: Originally, the > threshold > worked around incorrect routing of PCI INTx interrupts on single-CPU > systems > which would end up in a hard hang during boot=2E Since the threshold = was > added, our PCI interrupt routing was improved, most PCI interrupts use > edge-triggered MSI instead of level-triggered INTx, and typical system= s > have > multiple CPUs available to service interrupts=2E > > On the off chance that the threshold is useful in the future, it remai= ns > available as a tunable and sysctl=2E > > Reviewed by: jhb > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews=2Efreebsd=2Eorg/D20401 > > Modified: > head/sys/kern/kern_intr=2Ec > > Modified: head/sys/kern/kern_intr=2Ec > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_intr=2Ec Fri May 24 22:30:40 2019 (r3482= 54) > +++ head/sys/kern/kern_intr=2Ec Fri May 24 22:33:14 2019 (r3482= 55) > @@ -91,7 +91,7 @@ struct proc *intrproc; > > static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); > > -static int intr_storm_threshold =3D 1000; > +static int intr_storm_threshold =3D 0; > SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, > &intr_storm_threshold, 0, > "Number of consecutive interrupts before storm protection is > enabled"); > > --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-all@freebsd.org Sat May 25 01:58:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0CC315BA64E; Sat, 25 May 2019 01:58:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9347988CAB; Sat, 25 May 2019 01:58:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 547D82562A; Sat, 25 May 2019 01:58:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4P1w1Es077029; Sat, 25 May 2019 01:58:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P1w0L6077023; Sat, 25 May 2019 01:58:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905250158.x4P1w0L6077023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 25 May 2019 01:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348261 - in stable/11: contrib/zlib lib/libz stand/libsa usr.bin/minigzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: contrib/zlib lib/libz stand/libsa usr.bin/minigzip X-SVN-Commit-Revision: 348261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9347988CAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 01:58:02 -0000 Author: delphij Date: Sat May 25 01:58:00 2019 New Revision: 348261 URL: https://svnweb.freebsd.org/changeset/base/348261 Log: MFC r347244: Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel. This is a prerequisite of unifying kernel zlib instances. Submitted by: Yoshihiro Ota Approved by: re (kib) Added: - copied from r347244, head/sys/contrib/zlib/ Directory Properties: stable/11/sys/contrib/zlib/ (props changed) Deleted: stable/11/contrib/zlib/ Modified: stable/11/lib/libz/FREEBSD-upgrade stable/11/lib/libz/Makefile stable/11/stand/libsa/Makefile stable/11/usr.bin/minigzip/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/11/lib/libz/FREEBSD-upgrade Sat May 25 00:22:07 2019 (r348260) +++ stable/11/lib/libz/FREEBSD-upgrade Sat May 25 01:58:00 2019 (r348261) @@ -8,7 +8,7 @@ benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. 2) Import onto the vendor area. - 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + 3) Merge the vendor tree to sys/contrib/zlib, which contains a stripped down version of upstream source, resolve any conflicts. 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we have the required changes. Test universe and commit them. Modified: stable/11/lib/libz/Makefile ============================================================================== --- stable/11/lib/libz/Makefile Sat May 25 00:22:07 2019 (r348260) +++ stable/11/lib/libz/Makefile Sat May 25 01:58:00 2019 (r348261) @@ -8,7 +8,7 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 -ZLIBSRC= ${SRCTOP}/contrib/zlib +ZLIBSRC= ${SRCTOP}/sys/contrib/zlib .PATH: ${ZLIBSRC} Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Sat May 25 00:22:07 2019 (r348260) +++ stable/11/stand/libsa/Makefile Sat May 25 01:58:00 2019 (r348261) @@ -99,8 +99,8 @@ CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS SRCS+=bzlib.c crctable.c decompress.c huffman.c randtable.c # decompression functionality from zlib -.PATH: ${SRCTOP}/contrib/zlib -CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib +.PATH: ${SRCTOP}/sys/contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib SRCS+= adler32.c crc32.c SRCS+= infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/11/usr.bin/minigzip/Makefile ============================================================================== --- stable/11/usr.bin/minigzip/Makefile Sat May 25 00:22:07 2019 (r348260) +++ stable/11/usr.bin/minigzip/Makefile Sat May 25 01:58:00 2019 (r348261) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${SRCTOP}/contrib/zlib/test +SRCDIR= ${SRCTOP}/sys/contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-all@freebsd.org Sat May 25 01:59:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D8115BA6FA; Sat, 25 May 2019 01:59:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88A6388E1C; Sat, 25 May 2019 01:59:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 631192562D; Sat, 25 May 2019 01:59:25 +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 x4P1xPHA077153; Sat, 25 May 2019 01:59:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P1xPiV077152; Sat, 25 May 2019 01:59:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905250159.x4P1xPiV077152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 25 May 2019 01:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348262 - head/sys/dev/virtio/pci X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/virtio/pci X-SVN-Commit-Revision: 348262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88A6388E1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 01:59:26 -0000 Author: cem Date: Sat May 25 01:59:24 2019 New Revision: 348262 URL: https://svnweb.freebsd.org/changeset/base/348262 Log: virtio_pci(4): Fix typo in read_ivar method Prior to this revision, vtpci's BUS_READ_IVAR method on VIRTIO_IVAR_SUBVENDOR accidentally returned the PCI subdevice. The typo seems to have been introduced with the original commit adding VIRTIO_IVAR_{{SUB,}DEVICE,{SUB,}VENDOR} to virtio_pci. The commit log and code strongly suggest that the ivar was intended to return the subvendor rather than the subdevice; it was likely just a copy/paste mistake. Go ahead and rectify that. Modified: head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Sat May 25 01:58:00 2019 (r348261) +++ head/sys/dev/virtio/pci/virtio_pci.c Sat May 25 01:59:24 2019 (r348262) @@ -408,7 +408,7 @@ vtpci_read_ivar(device_t dev, device_t child, int inde *result = pci_get_device(dev); break; case VIRTIO_IVAR_SUBVENDOR: - *result = pci_get_subdevice(dev); + *result = pci_get_subvendor(dev); break; default: return (ENOENT); From owner-svn-src-all@freebsd.org Sat May 25 02:41:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E9B15955EC; Sat, 25 May 2019 02:41:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 186E989F84; Sat, 25 May 2019 02:41:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf1-x142.google.com with SMTP id d8so8425431lfb.8; Fri, 24 May 2019 19:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Aq463CB5WCkNULTebLHQFwkUKCD0T5HlnJ314ndE9uY=; b=a1eL4Vw1watZCw/5n2lbmoKatPcBjShoLTl32RBaISJykAuvsLk920QWRFxE2ongaO mgjH5XO7y8ARcHBDEi9ACZsVlzmfAD/cm7tcd0YK6bOBlcwtt757fNqpOwuIoTDgnH0/ 5d8l0BT0dEZcYatW1j89aqf85MTrjk7XOuT5dkiIXSdHRC1lCZnSaEavRezKG5Oz6vhh zivqUTXO0fRVcz7lwZpSSaleFjHGCsfqQgShPQyIWJE6AjtxDhAEIpjJUKOffhDf6dHb ITYI2T8wsujbnqpvWS9kKJRUeSLIDPyFHcSAHrrb4UiYwhshNyp5ERNTodPNVAZy11Pz iDGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Aq463CB5WCkNULTebLHQFwkUKCD0T5HlnJ314ndE9uY=; b=WbnkpEXP6zVxa5GO4Cd5ac7b0XKvAh6Rfbp8Q6REaCD0eVqJoycRsUhrv19l3GyigI DtzgyNXn92Pf25xSx+Na9xOTI9oIXp3R2mjn0cG13nukP7H1Hq4uXfeW7sgL1Y2jo/06 vvSTRsS8fWb0YcPdP9AhC3g6ZrsocuICLYbrLnXibgvpPOakKP9asYOHJ0DAYUx7Nce/ BO/B+ozSXtCXGtgYMymt6jAfpWLyDwgXEQDCKzfEI3T76jFFTFJX6P54P0Q1CJHB+mu7 BWp/oSIXoN6caP6isulbKgh85jshezvDswGhdDZJ/qnfsXzmuhBBsxKjwhKnTr2572vY IjLg== X-Gm-Message-State: APjAAAVetfhXxNGfapVo6llyh6aOb1CsQ9qIKu6f3/zUjcxoNWUGNtOb Ns2kO9B9wOhLlOK+ypB/pG451ZtUcdiegH4dJZj6UA7l X-Google-Smtp-Source: APXvYqwk8bcAgBtCIlEvXESTMLofTQFTnCmtnvVLNkg6o8Bc4ET7kO7wJPULEoSiwBEEydQ00ffFPAsDx6V1m1gxmYA= X-Received: by 2002:a19:f60f:: with SMTP id x15mr1748453lfe.61.1558752080584; Fri, 24 May 2019 19:41:20 -0700 (PDT) MIME-Version: 1.0 References: <20190524152941.40f7e239@titan.knownspace> <201905242301.x4ON1Zju098365@gndrsh.dnsmgr.net> In-Reply-To: <201905242301.x4ON1Zju098365@gndrsh.dnsmgr.net> From: Justin Hibbits Date: Fri, 24 May 2019 21:41:08 -0500 Message-ID: Subject: Re: svn commit: r348250 - head/sys/powerpc/conf To: rgrimes@freebsd.org Cc: Alexey Dokuchaev , Piotr Kubaj , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 186E989F84 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 02:41:24 -0000 On Fri, May 24, 2019 at 6:01 PM Rodney W. Grimes wrote: > > > On Fri, 24 May 2019 20:22:52 +0000 > > Alexey Dokuchaev wrote: > > > > > On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > > > > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > > > > New Revision: 348250 > > > > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > > > > > > > Log: > > > > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > > > > > > > amd64 also has snd_hda(4) in GENERIC. > > > > > > > > > > Modified: > > > > > head/sys/powerpc/conf/GENERIC64 > > > > > ... > > > > > > > > To note: This was done because there's a strange bug in the snd_hda > > > > module, with the hdaa component. For some reason it either doesn't > > > > find all the internal components it needs, or something, because > > > > there's a NULL dereference when trying to call a kobj method in > > > > hdaa_attach(). > > > > > > So this commit essentially masks the real bug somewhere rather than > > > fixing it, is this what you're saying? > > > > > > ./danfe > > > > It's a viable workaround to a problem that reaches a wide audience. > > Since it works built-in, I found it acceptable. I probably should have > > filed a bug for it a year ago when I hit it and worked around it, but it > > could also very well be a compiler issue. > > > > By the way, it works fine on powerpc (32-bit) loaded as a module. > > Please do file a bug report now, please do mark the line in GENERIC64 with > a comment XXX This is needed to work around foo so that it is documented > why it is there and someone removing it does not go down a rabit > hole others have already been down, and so that some day someone > may go down that rabbit hole of there own free will and fix this > for us. > > Paving over the top of obscure bugs with a hackish fix is ok, > not documenting this state of affairs is not, IMHO. > > > - Justin > -- > Rod Grimes rgrimes@freebsd.org Bug filed as kern/238113. I don't think a XXX is necessarily needed in GENERIC64, since it's also parity with GENERIC on amd64. - Justin From owner-svn-src-all@freebsd.org Sat May 25 03:02:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E1C71595E5F; Sat, 25 May 2019 03:02:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 6D7688ACAA; Sat, 25 May 2019 03:02:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4P32Wgd099332; Fri, 24 May 2019 20:02:32 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4P32V8m099331; Fri, 24 May 2019 20:02:31 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905250302.x4P32V8m099331@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348250 - head/sys/powerpc/conf In-Reply-To: To: Justin Hibbits Date: Fri, 24 May 2019 20:02:31 -0700 (PDT) CC: rgrimes@freebsd.org, Alexey Dokuchaev , Piotr Kubaj , svn-src-head , svn-src-all , 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-Rspamd-Queue-Id: 6D7688ACAA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 03:02:36 -0000 > On Fri, May 24, 2019 at 6:01 PM Rodney W. Grimes > wrote: > > > > > On Fri, 24 May 2019 20:22:52 +0000 > > > Alexey Dokuchaev wrote: > > > > > > > On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > > > > > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > > > > > New Revision: 348250 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > > > > > > > > > Log: > > > > > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > > > > > > > > > amd64 also has snd_hda(4) in GENERIC. > > > > > > > > > > > > Modified: > > > > > > head/sys/powerpc/conf/GENERIC64 > > > > > > ... > > > > > > > > > > To note: This was done because there's a strange bug in the snd_hda > > > > > module, with the hdaa component. For some reason it either doesn't > > > > > find all the internal components it needs, or something, because > > > > > there's a NULL dereference when trying to call a kobj method in > > > > > hdaa_attach(). > > > > > > > > So this commit essentially masks the real bug somewhere rather than > > > > fixing it, is this what you're saying? > > > > > > > > ./danfe > > > > > > It's a viable workaround to a problem that reaches a wide audience. > > > Since it works built-in, I found it acceptable. I probably should have > > > filed a bug for it a year ago when I hit it and worked around it, but it > > > could also very well be a compiler issue. > > > > > > By the way, it works fine on powerpc (32-bit) loaded as a module. > > > > Please do file a bug report now, please do mark the line in GENERIC64 with > > a comment XXX This is needed to work around foo so that it is documented > > why it is there and someone removing it does not go down a rabit > > hole others have already been down, and so that some day someone > > may go down that rabbit hole of there own free will and fix this > > for us. > > > > Paving over the top of obscure bugs with a hackish fix is ok, > > not documenting this state of affairs is not, IMHO. > > > > > - Justin > > -- > > Rod Grimes rgrimes@freebsd.org > > Bug filed as kern/238113. I don't think a XXX is necessarily needed > in GENERIC64, since it's also parity with GENERIC on amd64. Does the bug also exist on amd64? > - Justin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 25 03:22:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879CE15965FE; Sat, 25 May 2019 03:22:29 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE0EE8B623; Sat, 25 May 2019 03:22:28 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x241.google.com with SMTP id h19so1879826ljj.4; Fri, 24 May 2019 20:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0rfwTA5D6abBPRymgxWYmeKUyqnokJN3rrRlJ9MjgZs=; b=G/43IcB27uem5CgGaoJ8vBwLZ78C4EISQNkHkkEe5pQiDvfYKrNCaz2+4d+8i+Zmlt W3GWYLPWiW7qW7/e3sCpiQyno+24w3f9U8AADtavp996O3MSaUUnEELKhO3myzAQykHP Ix94lV2f60bAvTERV/E00XY+v/yOIT+iwB+HXAigU2WZ576VL2S3aUTwvTzJiuX0ZOfH c9Y9B25BBo5PF6GoiWvijEi3rhSNDvCWW6ZE9PlafSpt97GxxXv/H9K1zjPbk7tdd7/6 KffJIEq1Qqm6RRth6flKG57PMzyd5Nk1LEoDxxEOyPcVXVx5bm7KfE+k68cGdyDgofHy zxBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0rfwTA5D6abBPRymgxWYmeKUyqnokJN3rrRlJ9MjgZs=; b=FpmL6tkMjU0AShFoGTZu0L//Do4WcX/s8QYXwTAfcyqokM83ilULpb8frvt4AS87qv IXMZ7BG9CKdozwhG0yCO0yrLKAldskeIM10hox3m2qz3MGeOPO4MLwZhRGROoKUlaqc1 /K53Gi3mJUrzoNoc8bC2MsR7B7oGdbaNqeuxNk+BDPYMpoImfwt+299VHv711+KmLORa Fe7vg4CwigNjbfvzc68CgNejN49yXnk6Tn/p6dI2hLB9i/rqRgcaXps1vVVkcobXOHAE b31pYu8whq/XcFipEIr2UcpqHN/1ORDrgebwviV/1c0SXOTH8CyXE8pFZiCZPO/3jodg kwJw== X-Gm-Message-State: APjAAAXQxpAX5qebzATjOMx1umd64kpSDeHRzNNMvb3ZFgnW4CKL5m5Z 2aezXd9V+YD9K2z/aWpiZxV60NG1N/mDaoLMeCyydm0t X-Google-Smtp-Source: APXvYqyGCBJdRGpM8ATb94YcJdnYknqOdoyjQnAwGHK08hr8WzofA49hBG74y01z2FhLw3xKj1lZyaZJ7TjVMxuUVeg= X-Received: by 2002:a2e:8716:: with SMTP id m22mr2512034lji.128.1558754546785; Fri, 24 May 2019 20:22:26 -0700 (PDT) MIME-Version: 1.0 References: <201905250302.x4P32V8m099331@gndrsh.dnsmgr.net> In-Reply-To: <201905250302.x4P32V8m099331@gndrsh.dnsmgr.net> From: Justin Hibbits Date: Fri, 24 May 2019 22:22:13 -0500 Message-ID: Subject: Re: svn commit: r348250 - head/sys/powerpc/conf To: rgrimes@freebsd.org Cc: Alexey Dokuchaev , Piotr Kubaj , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EE0EE8B623 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 03:22:29 -0000 On Fri, May 24, 2019 at 10:02 PM Rodney W. Grimes wrote: > > > On Fri, May 24, 2019 at 6:01 PM Rodney W. Grimes > > wrote: > > > > > > > On Fri, 24 May 2019 20:22:52 +0000 > > > > Alexey Dokuchaev wrote: > > > > > > > > > On Fri, May 24, 2019 at 03:16:51PM -0500, Justin Hibbits wrote: > > > > > > On Fri, 24 May 2019 20:01:59 +0000 (UTC) Piotr Kubaj wrote: > > > > > > > New Revision: 348250 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/348250 > > > > > > > > > > > > > > Log: > > > > > > > Add snd_hda(4) to GENERIC64 used by powerpc64. > > > > > > > > > > > > > > amd64 also has snd_hda(4) in GENERIC. > > > > > > > > > > > > > > Modified: > > > > > > > head/sys/powerpc/conf/GENERIC64 > > > > > > > ... > > > > > > > > > > > > To note: This was done because there's a strange bug in the snd_hda > > > > > > module, with the hdaa component. For some reason it either doesn't > > > > > > find all the internal components it needs, or something, because > > > > > > there's a NULL dereference when trying to call a kobj method in > > > > > > hdaa_attach(). > > > > > > > > > > So this commit essentially masks the real bug somewhere rather than > > > > > fixing it, is this what you're saying? > > > > > > > > > > ./danfe > > > > > > > > It's a viable workaround to a problem that reaches a wide audience. > > > > Since it works built-in, I found it acceptable. I probably should have > > > > filed a bug for it a year ago when I hit it and worked around it, but it > > > > could also very well be a compiler issue. > > > > > > > > By the way, it works fine on powerpc (32-bit) loaded as a module. > > > > > > Please do file a bug report now, please do mark the line in GENERIC64 with > > > a comment XXX This is needed to work around foo so that it is documented > > > why it is there and someone removing it does not go down a rabit > > > hole others have already been down, and so that some day someone > > > may go down that rabbit hole of there own free will and fix this > > > for us. > > > > > > Paving over the top of obscure bugs with a hackish fix is ok, > > > not documenting this state of affairs is not, IMHO. > > > > > > > - Justin > > > -- > > > Rod Grimes rgrimes@freebsd.org > > > > Bug filed as kern/238113. I don't think a XXX is necessarily needed > > in GENERIC64, since it's also parity with GENERIC on amd64. > > Does the bug also exist on amd64? No idea. I don't have any amd64 hardware, and it's been in GENERIC for as long as I know. My unfounded guess is that it doesn't exist on amd64, but someone else would have to confirm that. - Justin From owner-svn-src-all@freebsd.org Sat May 25 04:56:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C52215989F4; Sat, 25 May 2019 04:56:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DED58E48A; Sat, 25 May 2019 04:56:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E70F5275A0; Sat, 25 May 2019 04:56:06 +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 x4P4u6I4072469; Sat, 25 May 2019 04:56:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P4u6Ef072468; Sat, 25 May 2019 04:56:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905250456.x4P4u6Ef072468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 25 May 2019 04:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348267 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 348267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DED58E48A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 04:56:07 -0000 Author: jhibbits Date: Sat May 25 04:56:06 2019 New Revision: 348267 URL: https://svnweb.freebsd.org/changeset/base/348267 Log: powerpc64/pmap: Reapply r334235 to OEA64 pmap, clearing HID0_RADIX This was lost in the re-merger of ISA3 MMU into moea64_native. Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat May 25 04:31:04 2019 (r348266) +++ head/sys/powerpc/aim/moea64_native.c Sat May 25 04:56:06 2019 (r348267) @@ -401,6 +401,12 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); + switch(mfpvr() >> 16) { + case IBMPOWER9: + mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_RADIX); + break; + } + /* * Install kernel SLB entries */ From owner-svn-src-all@freebsd.org Sat May 25 07:26:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BEE15A4B99; Sat, 25 May 2019 07:26:32 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47E4492CF8; Sat, 25 May 2019 07:26:32 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B470F10; Sat, 25 May 2019 07:26:32 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4P7QWlx050354; Sat, 25 May 2019 07:26:32 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4P7QUBd050347; Sat, 25 May 2019 07:26:30 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201905250726.x4P7QUBd050347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Sat, 25 May 2019 07:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348268 - in head/sys: conf crypto/aesni modules/aesni X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head/sys: conf crypto/aesni modules/aesni X-SVN-Commit-Revision: 348268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47E4492CF8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 07:26:33 -0000 Author: sef Date: Sat May 25 07:26:30 2019 New Revision: 348268 URL: https://svnweb.freebsd.org/changeset/base/348268 Log: Add an AESNI-optimized version of the CCM/CBC cryptographic and authentication code. The primary client of this is probably going to be ZFS encryption. Reviewed by: jhb, cem Sponsored by: iXsystems Inc, Kithrup Enterprises Differential Revision: https://reviews.freebsd.org/D19298 Added: head/sys/crypto/aesni/aesni_ccm.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni.h head/sys/crypto/aesni/aesni_wrap.c head/sys/modules/aesni/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat May 25 04:56:06 2019 (r348267) +++ head/sys/conf/files.amd64 Sat May 25 07:26:30 2019 (r348268) @@ -175,6 +175,11 @@ aesni_ghash.o optional aesni \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" +aesni_ccm.o optional aesni \ + dependency "$S/crypto/aesni/aesni_ccm.c" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + no-implicit-rule \ + clean "aesni_ccm.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat May 25 04:56:06 2019 (r348267) +++ head/sys/conf/files.i386 Sat May 25 07:26:30 2019 (r348268) @@ -127,6 +127,11 @@ aesni_ghash.o optional aesni \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" +aesni_ccm.o optional aesni \ + dependency "$S/crypto/aesni/aesni_ccm.c" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + no-implicit-rule \ + clean "aesni_ccm.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Sat May 25 04:56:06 2019 (r348267) +++ head/sys/crypto/aesni/aesni.c Sat May 25 07:26:30 2019 (r348268) @@ -132,9 +132,10 @@ aesni_probe(device_t dev) return (EINVAL); } else if (has_aes && has_sha) device_set_desc(dev, - "AES-CBC,AES-XTS,AES-GCM,AES-ICM,SHA1,SHA256"); + "AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS,SHA1,SHA256"); else if (has_aes) - device_set_desc(dev, "AES-CBC,AES-XTS,AES-GCM,AES-ICM"); + device_set_desc(dev, + "AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS"); else device_set_desc(dev, "SHA1,SHA256"); @@ -194,6 +195,8 @@ aesni_attach(device_t dev) crypto_register(sc->cid, CRYPTO_AES_192_NIST_GMAC, 0, 0); crypto_register(sc->cid, CRYPTO_AES_256_NIST_GMAC, 0, 0); crypto_register(sc->cid, CRYPTO_AES_XTS, 0, 0); + crypto_register(sc->cid, CRYPTO_AES_CCM_16, 0, 0); + crypto_register(sc->cid, CRYPTO_AES_CCM_CBC_MAC, 0, 0); } if (sc->has_sha) { crypto_register(sc->cid, CRYPTO_SHA1, 0, 0); @@ -227,6 +230,7 @@ aesni_newsession(device_t dev, crypto_session_t cses, struct aesni_session *ses; struct cryptoini *encini, *authini; bool gcm_hash, gcm; + bool cbc_hash, ccm; int error; KASSERT(cses != NULL, ("EDOOFUS")); @@ -243,10 +247,17 @@ aesni_newsession(device_t dev, crypto_session_t cses, encini = NULL; gcm = false; gcm_hash = false; + ccm = cbc_hash = false; + for (; cri != NULL; cri = cri->cri_next) { switch (cri->cri_alg) { case CRYPTO_AES_NIST_GCM_16: - gcm = true; + case CRYPTO_AES_CCM_16: + if (cri->cri_alg == CRYPTO_AES_NIST_GCM_16) { + gcm = true; + } else if (cri->cri_alg == CRYPTO_AES_CCM_16) { + ccm = true; + } /* FALLTHROUGH */ case CRYPTO_AES_CBC: case CRYPTO_AES_ICM: @@ -259,6 +270,10 @@ aesni_newsession(device_t dev, crypto_session_t cses, } encini = cri; break; + case CRYPTO_AES_CCM_CBC_MAC: + cbc_hash = true; + authini = cri; + break; case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: @@ -266,7 +281,12 @@ aesni_newsession(device_t dev, crypto_session_t cses, * nothing to do here, maybe in the future cache some * values for GHASH */ + if (authini != NULL) { + CRYPTDEB("authini already set"); + return (EINVAL); + } gcm_hash = true; + authini = cri; break; case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: @@ -296,9 +316,16 @@ unhandled: * GMAC algorithms are only supported with simultaneous GCM. Likewise * GCM is not supported without GMAC. */ - if (gcm_hash != gcm) + if (gcm_hash != gcm) { + CRYPTDEB("gcm_hash != gcm"); return (EINVAL); + } + if (cbc_hash != ccm) { + CRYPTDEB("cbc_hash != ccm"); + return (EINVAL); + } + if (encini != NULL) ses->algo = encini->cri_alg; if (authini != NULL) @@ -339,6 +366,7 @@ aesni_process(device_t dev, struct cryptop *crp, int h for (crd = crp->crp_desc; crd != NULL; crd = crd->crd_next) { switch (crd->crd_alg) { case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: needauth = 1; /* FALLTHROUGH */ case CRYPTO_AES_CBC: @@ -354,6 +382,7 @@ aesni_process(device_t dev, struct cryptop *crp, int h case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: + case CRYPTO_AES_CCM_CBC_MAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224: @@ -648,6 +677,7 @@ aesni_cipher_process(struct aesni_session *ses, struct if (enccrd != NULL) { if ((enccrd->crd_alg == CRYPTO_AES_ICM || + enccrd->crd_alg == CRYPTO_AES_CCM_16 || enccrd->crd_alg == CRYPTO_AES_NIST_GCM_16) && (enccrd->crd_flags & CRD_F_IV_EXPLICIT) == 0) return (EINVAL); @@ -701,8 +731,9 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c int error, ivlen; bool encflag, allocated, authallocated; - KASSERT(ses->algo != CRYPTO_AES_NIST_GCM_16 || authcrd != NULL, - ("AES_NIST_GCM_16 must include MAC descriptor")); + KASSERT((ses->algo != CRYPTO_AES_NIST_GCM_16 && + ses->algo != CRYPTO_AES_CCM_16) || authcrd != NULL, + ("AES_NIST_GCM_16/AES_CCM_16 must include MAC descriptor")); ivlen = 0; authbuf = NULL; @@ -712,7 +743,8 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c return (ENOMEM); authallocated = false; - if (ses->algo == CRYPTO_AES_NIST_GCM_16) { + if (ses->algo == CRYPTO_AES_NIST_GCM_16 || + ses->algo == CRYPTO_AES_CCM_16) { authbuf = aesni_cipher_alloc(authcrd, crp, &authallocated); if (authbuf == NULL) { error = ENOMEM; @@ -738,6 +770,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c ivlen = 8; break; case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: ivlen = 12; /* should support arbitarily larger */ break; } @@ -787,7 +820,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c case CRYPTO_AES_NIST_GCM_16: if (!encflag) crypto_copydata(crp->crp_flags, crp->crp_buf, - authcrd->crd_inject, GMAC_DIGEST_LEN, tag); + authcrd->crd_inject, sizeof(tag), tag); else bzero(tag, sizeof tag); @@ -798,7 +831,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c if (authcrd != NULL) crypto_copyback(crp->crp_flags, crp->crp_buf, - authcrd->crd_inject, GMAC_DIGEST_LEN, tag); + authcrd->crd_inject, sizeof(tag), tag); } else { if (!AES_GCM_decrypt(buf, buf, authbuf, iv, tag, enccrd->crd_len, authcrd->crd_len, ivlen, @@ -806,9 +839,28 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c error = EBADMSG; } break; + case CRYPTO_AES_CCM_16: + if (!encflag) + crypto_copydata(crp->crp_flags, crp->crp_buf, + authcrd->crd_inject, sizeof(tag), tag); + else + bzero(tag, sizeof tag); + if (encflag) { + AES_CCM_encrypt(buf, buf, authbuf, iv, tag, + enccrd->crd_len, authcrd->crd_len, ivlen, + ses->enc_schedule, ses->rounds); + if (authcrd != NULL) + crypto_copyback(crp->crp_flags, crp->crp_buf, + authcrd->crd_inject, sizeof(tag), tag); + } else { + if (!AES_CCM_decrypt(buf, buf, authbuf, iv, tag, + enccrd->crd_len, authcrd->crd_len, ivlen, + ses->enc_schedule, ses->rounds)) + error = EBADMSG; + } + break; } - - if (allocated) + if (allocated && error == 0) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); Modified: head/sys/crypto/aesni/aesni.h ============================================================================== --- head/sys/crypto/aesni/aesni.h Sat May 25 04:56:06 2019 (r348267) +++ head/sys/crypto/aesni/aesni.h Sat May 25 07:26:30 2019 (r348268) @@ -111,6 +111,15 @@ int AES_GCM_decrypt(const unsigned char *in, unsigned const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, const unsigned char *key, int nr); +/* CCM + CBC-MAC functions */ +void AES_CCM_encrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *ivec, + unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, + const unsigned char *key, int nr); +int AES_CCM_decrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *ivec, + const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, + const unsigned char *key, int nr); int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, int keylen); Added: head/sys/crypto/aesni/aesni_ccm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/aesni/aesni_ccm.c Sat May 25 07:26:30 2019 (r348268) @@ -0,0 +1,439 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2018 iXsystems, Inc + * All rights reserved. + * + * This software was developed by John-Mark Gurney under + * the sponsorship of the FreeBSD Foundation and + * Rubicon Communications, LLC (Netgate). + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * + * $FreeBSD$ + * + * This file implements AES-CCM+CBC-MAC, as described + * at https://tools.ietf.org/html/rfc3610, using Intel's + * AES-NI instructions. + * + */ + +#include +#include +#include + +#include +#include +#include +#include +#define AESNI_ENC(d, k, nr) aesni_enc(nr-1, (const __m128i*)k, d) + +#include +#include +#include + +/* + * Encrypt a single 128-bit block after + * doing an xor. This is also used to + * decrypt (yay symmetric encryption). + */ +static inline __m128i +xor_and_encrypt(__m128i a, __m128i b, const unsigned char *k, int nr) +{ + __m128 retval = _mm_xor_si128(a, b); + + retval = AESNI_ENC(retval, k, nr); + return (retval); +} + +/* + * Put value at the end of block, starting at offset. + * (This goes backwards, putting bytes in *until* it + * reaches offset.) + */ +static void +append_int(size_t value, __m128i *block, size_t offset) +{ + int indx = sizeof(*block) - 1; + uint8_t *bp = (uint8_t*)block; + + while (indx > (sizeof(*block) - offset)) { + bp[indx] = value & 0xff; + indx--; + value >>= 8; + } +} + +/* + * Start the CBC-MAC process. This handles the auth data. + */ +static __m128i +cbc_mac_start(const unsigned char *auth_data, size_t auth_len, + const unsigned char *nonce, size_t nonce_len, + const unsigned char *key, int nr, + size_t data_len, size_t tag_len) +{ + __m128i cbc_block, staging_block; + uint8_t *byte_ptr; + /* This defines where the message length goes */ + int L = sizeof(__m128i) - 1 - nonce_len; + + /* + * Set up B0 here. This has the flags byte, + * followed by the nonce, followed by the + * length of the message. + */ + cbc_block = _mm_setzero_si128(); + byte_ptr = (uint8_t*)&cbc_block; + byte_ptr[0] = ((auth_len > 0) ? 1 : 0) * 64 | + (((tag_len - 2) / 2) * 8) | + (L - 1); + bcopy(nonce, byte_ptr + 1, nonce_len); + append_int(data_len, &cbc_block, L+1); + cbc_block = AESNI_ENC(cbc_block, key, nr); + + if (auth_len != 0) { + /* + * We need to start by appending the length descriptor. + */ + uint32_t auth_amt; + size_t copy_amt; + const uint8_t *auth_ptr = auth_data; + + staging_block = _mm_setzero_si128(); + + /* + * The current OCF calling convention means that + * there can never be more than 4g of authentication + * data, so we don't handle the 0xffff case. + */ + KASSERT(auth_len < (1ULL << 32), + ("%s: auth_len (%zu) larger than 4GB", + __FUNCTION__, auth_len)); + + if (auth_len < ((1 << 16) - (1 << 8))) { + /* + * If the auth data length is less than + * 0xff00, we don't need to encode a length + * specifier, just the length of the auth + * data. + */ + be16enc(&staging_block, auth_len); + auth_amt = 2; + } else if (auth_len < (1ULL << 32)) { + /* + * Two bytes for the length prefix, and then + * four bytes for the length. This makes a total + * of 6 bytes to describe the auth data length. + */ + be16enc(&staging_block, 0xfffe); + be32enc((char*)&staging_block + 2, auth_len); + auth_amt = 6; + } else + panic("%s: auth len too large", __FUNCTION__); + + /* + * Need to copy abytes into blocks. The first block is + * already partially filled, by auth_amt, so we need + * to handle that. The last block needs to be zero padded. + */ + copy_amt = MIN(auth_len - auth_amt, + sizeof(staging_block) - auth_amt); + byte_ptr = (uint8_t*)&staging_block; + bcopy(auth_ptr, &byte_ptr[auth_amt], copy_amt); + auth_ptr += copy_amt; + + cbc_block = xor_and_encrypt(cbc_block, staging_block, key, nr); + + while (auth_ptr < auth_data + auth_len) { + copy_amt = MIN((auth_data + auth_len) - auth_ptr, + sizeof(staging_block)); + if (copy_amt < sizeof(staging_block)) + bzero(&staging_block, sizeof(staging_block)); + bcopy(auth_ptr, &staging_block, copy_amt); + cbc_block = xor_and_encrypt(cbc_block, staging_block, + key, nr); + auth_ptr += copy_amt; + } + } + return (cbc_block); +} + +/* + * Implement AES CCM+CBC-MAC encryption and authentication. + * + * A couple of notes: + * The specification allows for a different number of tag lengths; + * however, they're always truncated from 16 bytes, and the tag + * length isn't passed in. (This could be fixed by changing the + * code in aesni.c:aesni_cipher_crypt().) + * Similarly, although the nonce length is passed in, the + * OpenCrypto API that calls us doesn't have a way to set the nonce + * other than by having different crypto algorithm types. As a result, + * this is currently always called with nlen=12; this means that we + * also have a maximum message length of 16 megabytes. And similarly, + * since abytes is limited to a 32 bit value here, the AAD is + * limited to 4 gigabytes or less. + */ +void +AES_CCM_encrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *nonce, + unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, + const unsigned char *key, int nr) +{ + static const int tag_length = 16; /* 128 bits */ + int L; + int counter = 1; /* S0 has 0, S1 has 1 */ + size_t copy_amt, total = 0; + uint8_t *byte_ptr; + __m128i s0, rolling_mac, s_x, staging_block; + + if (nbytes == 0 && abytes == 0) + return; + + /* NIST 800-38c section A.1 says n is [7, 13]. */ + if (nlen < 7 || nlen > 13) + panic("%s: bad nonce length %d", __FUNCTION__, nlen); + + /* + * We need to know how many bytes to use to describe + * the length of the data. Normally, nlen should be + * 12, which leaves us 3 bytes to do that -- 16mbytes of + * data to encrypt. But it can be longer or shorter; + * this impacts the length of the message. + */ + L = sizeof(__m128i) - 1 - nlen; + + /* + * Now, this shouldn't happen, but let's make sure that + * the data length isn't too big. + */ + KASSERT(nbytes <= ((1 << (8 * L)) - 1), + ("%s: nbytes is %u, but length field is %d bytes", + __FUNCTION__, nbytes, L)); + + /* + * Clear out the blocks + */ + s0 = _mm_setzero_si128(); + + rolling_mac = cbc_mac_start(addt, abytes, nonce, nlen, + key, nr, nbytes, tag_length); + + /* s0 has flags, nonce, and then 0 */ + byte_ptr = (uint8_t*)&s0; + byte_ptr[0] = L - 1; /* but the flags byte only has L' */ + bcopy(nonce, &byte_ptr[1], nlen); + + /* + * Now to cycle through the rest of the data. + */ + bcopy(&s0, &s_x, sizeof(s0)); + + while (total < nbytes) { + /* + * Copy the plain-text data into staging_block. + * This may need to be zero-padded. + */ + copy_amt = MIN(nbytes - total, sizeof(staging_block)); + bcopy(in+total, &staging_block, copy_amt); + if (copy_amt < sizeof(staging_block)) { + byte_ptr = (uint8_t*)&staging_block; + bzero(&byte_ptr[copy_amt], + sizeof(staging_block) - copy_amt); + } + rolling_mac = xor_and_encrypt(rolling_mac, staging_block, + key, nr); + /* Put the counter into the s_x block */ + append_int(counter++, &s_x, L+1); + /* Encrypt that */ + __m128i X = AESNI_ENC(s_x, key, nr); + /* XOR the plain-text with the encrypted counter block */ + staging_block = _mm_xor_si128(staging_block, X); + /* And copy it out */ + bcopy(&staging_block, out+total, copy_amt); + total += copy_amt; + } + /* + * Allegedly done with it! Except for the tag. + */ + s0 = AESNI_ENC(s0, key, nr); + staging_block = _mm_xor_si128(s0, rolling_mac); + bcopy(&staging_block, tag, tag_length); + explicit_bzero(&s0, sizeof(s0)); + explicit_bzero(&staging_block, sizeof(staging_block)); + explicit_bzero(&s_x, sizeof(s_x)); + explicit_bzero(&rolling_mac, sizeof(rolling_mac)); +} + +/* + * Implement AES CCM+CBC-MAC decryption and authentication. + * Returns 0 on failure, 1 on success. + * + * The primary difference here is that each encrypted block + * needs to be hashed&encrypted after it is decrypted (since + * the CBC-MAC is based on the plain text). This means that + * we do the decryption twice -- first to verify the tag, + * and second to decrypt and copy it out. + * + * To avoid annoying code copying, we implement the main + * loop as a separate function. + * + * Call with out as NULL to not store the decrypted results; + * call with hashp as NULL to not run the authentication. + * Calling with neither as NULL does the decryption and + * authentication as a single pass (which is not allowed + * per the specification, really). + * + * If hashp is non-NULL, it points to the post-AAD computed + * checksum. + */ +static void +decrypt_loop(const unsigned char *in, unsigned char *out, size_t nbytes, + __m128i s0, size_t nonce_length, __m128i *macp, + const unsigned char *key, int nr) +{ + size_t total = 0; + __m128i s_x = s0, mac_block; + int counter = 1; + const size_t L = sizeof(__m128i) - 1 - nonce_length; + __m128i pad_block, staging_block; + + /* + * The starting mac (post AAD, if any). + */ + if (macp != NULL) + mac_block = *macp; + + while (total < nbytes) { + size_t copy_amt = MIN(nbytes - total, sizeof(staging_block)); + + if (copy_amt < sizeof(staging_block)) { + staging_block = _mm_setzero_si128(); + } + bcopy(in+total, &staging_block, copy_amt); + + /* + * staging_block has the current block of input data, + * zero-padded if necessary. This is used in computing + * both the decrypted data, and the authentication tag. + */ + append_int(counter++, &s_x, L+1); + /* + * The tag is computed based on the decrypted data. + */ + pad_block = AESNI_ENC(s_x, key, nr); + if (copy_amt < sizeof(staging_block)) { + /* + * Need to pad out pad_block with 0. + * (staging_block was set to 0's above.) + */ + uint8_t *end_of_buffer = (uint8_t*)&pad_block; + bzero(end_of_buffer + copy_amt, + sizeof(pad_block) - copy_amt); + } + staging_block = _mm_xor_si128(staging_block, pad_block); + + if (out) + bcopy(&staging_block, out+total, copy_amt); + + if (macp) + mac_block = xor_and_encrypt(mac_block, staging_block, + key, nr); + total += copy_amt; + } + + if (macp) + *macp = mac_block; + + explicit_bzero(&pad_block, sizeof(pad_block)); + explicit_bzero(&staging_block, sizeof(staging_block)); + explicit_bzero(&mac_block, sizeof(mac_block)); +} + +/* + * The exposed decryption routine. This is practically a + * copy of the encryption routine, except that the order + * in which the tag is created is changed. + * XXX combine the two functions at some point! + */ +int +AES_CCM_decrypt(const unsigned char *in, unsigned char *out, + const unsigned char *addt, const unsigned char *nonce, + const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, + const unsigned char *key, int nr) +{ + static const int tag_length = 16; /* 128 bits */ + int L; + __m128i s0, rolling_mac, staging_block; + uint8_t *byte_ptr; + + if (nbytes == 0 && abytes == 0) + return (1); // No message means no decryption! + if (nlen < 0 || nlen > 15) + panic("%s: bad nonce length %d", __FUNCTION__, nlen); + + /* + * We need to know how many bytes to use to describe + * the length of the data. Normally, nlen should be + * 12, which leaves us 3 bytes to do that -- 16mbytes of + * data to encrypt. But it can be longer or shorter. + */ + L = sizeof(__m128i) - 1 - nlen; + + /* + * Now, this shouldn't happen, but let's make sure that + * the data length isn't too big. + */ + if (nbytes > ((1 << (8 * L)) - 1)) + panic("%s: nbytes is %u, but length field is %d bytes", + __FUNCTION__, nbytes, L); + /* + * Clear out the blocks + */ + s0 = _mm_setzero_si128(); + + rolling_mac = cbc_mac_start(addt, abytes, nonce, nlen, + key, nr, nbytes, tag_length); + /* s0 has flags, nonce, and then 0 */ + byte_ptr = (uint8_t*)&s0; + byte_ptr[0] = L-1; /* but the flags byte only has L' */ + bcopy(nonce, &byte_ptr[1], nlen); + + /* + * Now to cycle through the rest of the data. + */ + decrypt_loop(in, NULL, nbytes, s0, nlen, &rolling_mac, key, nr); + + /* + * Compare the tag. + */ + staging_block = _mm_xor_si128(AESNI_ENC(s0, key, nr), rolling_mac); + if (timingsafe_bcmp(&staging_block, tag, tag_length) != 0) { + return (0); + } + + /* + * Push out the decryption results this time. + */ + decrypt_loop(in, out, nbytes, s0, nlen, NULL, key, nr); + return (1); +} Modified: head/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- head/sys/crypto/aesni/aesni_wrap.c Sat May 25 04:56:06 2019 (r348267) +++ head/sys/crypto/aesni/aesni_wrap.c Sat May 25 07:26:30 2019 (r348268) @@ -446,6 +446,7 @@ aesni_cipher_setup_common(struct aesni_session *ses, c switch (ses->algo) { case CRYPTO_AES_ICM: case CRYPTO_AES_NIST_GCM_16: + case CRYPTO_AES_CCM_16: decsched = 0; /* FALLTHROUGH */ case CRYPTO_AES_CBC: Modified: head/sys/modules/aesni/Makefile ============================================================================== --- head/sys/modules/aesni/Makefile Sat May 25 04:56:06 2019 (r348267) +++ head/sys/modules/aesni/Makefile Sat May 25 07:26:30 2019 (r348268) @@ -8,16 +8,20 @@ SRCS= aesni.c SRCS+= aeskeys_${MACHINE_CPUARCH}.S SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h -OBJS+= aesni_ghash.o aesni_wrap.o +OBJS+= aesni_ghash.o aesni_wrap.o aesni_ccm.o OBJS+= intel_sha1.o intel_sha256.o # Remove -nostdinc so we can get the intrinsics. aesni_ghash.o: aesni_ghash.c - # XXX - gcc won't understand -mpclmul ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC} ${CTFCONVERT_CMD} +aesni_ccm.o: aesni_ccm.c + ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ + -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC} + ${CTFCONVERT_CMD} + aesni_wrap.o: aesni_wrap.c ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \ -mmmx -msse -msse4 -maes ${.IMPSRC} @@ -35,6 +39,7 @@ intel_sha256.o: intel_sha256.c aesni_ghash.o: aesni.h aesni_wrap.o: aesni.h +aesni_ccm.o: aesni.h intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h From owner-svn-src-all@freebsd.org Sat May 25 10:17:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E662015A8855; Sat, 25 May 2019 10:17:04 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE7C6AD8B; Sat, 25 May 2019 10:17:04 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D622BF8; Sat, 25 May 2019 10:17:04 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PAH4sb045315; Sat, 25 May 2019 10:17:04 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PAH3dR045312; Sat, 25 May 2019 10:17:03 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905251017.x4PAH3dR045312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 25 May 2019 10:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348269 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 348269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DE7C6AD8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 10:17:05 -0000 Author: rgrimes Date: Sat May 25 10:17:03 2019 New Revision: 348269 URL: https://svnweb.freebsd.org/changeset/base/348269 Log: MFC: r346717: Make bhyve SMBIOS table topology aware When the CPU Topology was added to bhyve in r332298 the SMBIOS table was missed, this table passes topology information to the system and was still using the old concept of each vCPU is a socket with 1 core and 1 thread. This code did not even try to use the old sysctl information to adjust this data. Correct that by building a proper SMBios table, mapping the > 254 cases to 0 per the SMBios 2.6 specification that is claimed by the structure. Approved by: re (kib) Modified: stable/11/usr.sbin/bhyve/bhyverun.h stable/11/usr.sbin/bhyve/smbiostbl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/11/usr.sbin/bhyve/bhyverun.h Sat May 25 07:26:30 2019 (r348268) +++ stable/11/usr.sbin/bhyve/bhyverun.h Sat May 25 10:17:03 2019 (r348269) @@ -36,6 +36,7 @@ struct vmctx; extern int guest_ncpus; +extern uint16_t cores, sockets, threads; extern char *guest_uuid_str; extern char *vmname; Modified: stable/11/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- stable/11/usr.sbin/bhyve/smbiostbl.c Sat May 25 07:26:30 2019 (r348268) +++ stable/11/usr.sbin/bhyve/smbiostbl.c Sat May 25 10:17:03 2019 (r348269) @@ -636,7 +636,7 @@ smbios_type4_initializer(struct smbios_structure *temp { int i; - for (i = 0; i < guest_ncpus; i++) { + for (i = 0; i < sockets; i++) { struct smbios_table_type4 *type4; char *p; int nstrings, len; @@ -655,6 +655,16 @@ smbios_type4_initializer(struct smbios_structure *temp *(*endaddr) = '\0'; (*endaddr)++; type4->socket = nstrings + 1; + /* Revise cores and threads after update to smbios 3.0 */ + if (cores > 254) + type4->cores = 0; + else + type4->cores = cores; + /* This threads is total threads in a socket */ + if ((cores * threads) > 254) + type4->threads = 0; + else + type4->threads = (cores * threads); curaddr = *endaddr; } From owner-svn-src-all@freebsd.org Sat May 25 11:22:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D90215AA0C8; Sat, 25 May 2019 11:22:50 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE866D18D; Sat, 25 May 2019 11:22:50 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E34E53991; Sat, 25 May 2019 11:22:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PBMn24082696; Sat, 25 May 2019 11:22:49 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PBMnsX082695; Sat, 25 May 2019 11:22:49 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905251122.x4PBMnsX082695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 25 May 2019 11:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348270 - head/libexec/bootpd X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/libexec/bootpd X-SVN-Commit-Revision: 348270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DE866D18D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 11:22:50 -0000 Author: rgrimes Date: Sat May 25 11:22:49 2019 New Revision: 348270 URL: https://svnweb.freebsd.org/changeset/base/348270 Log: Correctly align usage: output Modified: head/libexec/bootpd/bootpd.c Modified: head/libexec/bootpd/bootpd.c ============================================================================== --- head/libexec/bootpd/bootpd.c Sat May 25 10:17:03 2019 (r348269) +++ head/libexec/bootpd/bootpd.c Sat May 25 11:22:49 2019 (r348270) @@ -589,13 +589,13 @@ usage() fprintf(stderr, "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname]\n" " [-t timeout] [bootptab [dumpfile]]\n"); - fprintf(stderr, "\t -a\tdon't modify ARP table\n"); - fprintf(stderr, "\t -c n\tset current directory\n"); - fprintf(stderr, "\t -d n\tset debug level\n"); - fprintf(stderr, "\t -h n\tset the hostname to listen on\n"); - fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n"); - fprintf(stderr, "\t -s\tforce standalone mode (run without inetd)\n"); - fprintf(stderr, "\t -t n\tset inetd exit timeout to n minutes\n"); + fprintf(stderr, " -a\tdon't modify ARP table\n"); + fprintf(stderr, " -c n\tset current directory\n"); + fprintf(stderr, " -d n\tset debug level\n"); + fprintf(stderr, " -h n\tset the hostname to listen on\n"); + fprintf(stderr, " -i\tforce inetd mode (run as child of inetd)\n"); + fprintf(stderr, " -s\tforce standalone mode (run without inetd)\n"); + fprintf(stderr, " -t n\tset inetd exit timeout to n minutes\n"); exit(1); } From owner-svn-src-all@freebsd.org Sat May 25 11:27:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9444C15AA1A2; Sat, 25 May 2019 11:27:58 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 393506D371; Sat, 25 May 2019 11:27:58 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1914539A7; Sat, 25 May 2019 11:27:58 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PBRvad082945; Sat, 25 May 2019 11:27:57 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PBRuYu082936; Sat, 25 May 2019 11:27:56 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905251127.x4PBRuYu082936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 25 May 2019 11:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r348271 - in stable/11/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Commit-Revision: 348271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 393506D371 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 11:27:58 -0000 Author: rgrimes Date: Sat May 25 11:27:56 2019 New Revision: 348271 URL: https://svnweb.freebsd.org/changeset/base/348271 Log: MFC: r346714: Add accessor function for vm->maxcpus Replace most VM_MAXCPU constant useses with an accessor function to vm->maxcpus which for now is initialized and kept at the value of VM_MAXCPUS. This is a rework of Fabian Freyer (fabian.freyer_physik.tu-berlin.de) work from D10070 to adjust it for the cpu topology changes that occured in r332298 Approved by: re (kib) Modified: stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/amd64/vmm/io/vlapic.c stable/11/sys/amd64/vmm/vmm.c stable/11/sys/amd64/vmm/vmm_dev.c stable/11/sys/amd64/vmm/vmm_lapic.c stable/11/sys/amd64/vmm/vmm_stat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/include/vmm.h Sat May 25 11:27:56 2019 (r348271) @@ -184,6 +184,7 @@ int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); +uint16_t vm_get_maxcpus(struct vm *vm); void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus); int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/amd/svm.c Sat May 25 11:27:56 2019 (r348271) @@ -524,6 +524,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) struct svm_vcpu *vcpu; vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; + uint16_t maxcpus; svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); if (((uintptr_t)svm_sc & PAGE_MASK) != 0) @@ -577,7 +578,8 @@ svm_vminit(struct vm *vm, pmap_t pmap) iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); pml4_pa = svm_sc->nptp; - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(svm_sc->vm); + for (i = 0; i < maxcpus; i++) { vcpu = svm_get_vcpu(svm_sc, i); vcpu->nextrip = ~0; vcpu->lastcpu = NOCPU; Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/intel/vmx.c Sat May 25 11:27:56 2019 (r348271) @@ -941,6 +941,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) struct vmx *vmx; struct vmcs *vmcs; uint32_t exc_bitmap; + uint16_t maxcpus; vmx = malloc(sizeof(struct vmx), M_VMX, M_WAITOK | M_ZERO); if ((uintptr_t)vmx & PAGE_MASK) { @@ -1002,7 +1003,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) KASSERT(error == 0, ("vm_map_mmio(apicbase) error %d", error)); } - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(vm); + for (i = 0; i < maxcpus; i++) { vmcs = &vmx->vmcs[i]; vmcs->identifier = vmx_revision(); error = vmclear(vmcs); @@ -2994,11 +2996,13 @@ vmx_vmcleanup(void *arg) { int i; struct vmx *vmx = arg; + uint16_t maxcpus; if (apic_access_virtualization(vmx, 0)) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); - for (i = 0; i < VM_MAXCPU; i++) + maxcpus = vm_get_maxcpus(vmx->vm); + for (i = 0; i < maxcpus; i++) vpid_free(vmx->state[i].vpid); free(vmx, M_VMX); Modified: stable/11/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/11/sys/amd64/vmm/io/vlapic.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/io/vlapic.c Sat May 25 11:27:56 2019 (r348271) @@ -836,7 +836,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < VM_MAXCPU) + if (vcpuid < vm_get_maxcpus(vm)) CPU_SET(vcpuid, dmask); } else { /* @@ -963,6 +963,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool struct vlapic *vlapic2; struct vm_exit *vmexit; struct LAPIC *lapic; + uint16_t maxcpus; lapic = vlapic->apic_page; lapic->icr_lo &= ~APIC_DELSTAT_PEND; @@ -1024,11 +1025,12 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool return (0); /* handled completely in the kernel */ } + maxcpus = vm_get_maxcpus(vlapic->vm); if (mode == APIC_DELMODE_INIT) { if ((icrval & APIC_LEVEL_MASK) == APIC_LEVEL_DEASSERT) return (0); - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* move from INIT to waiting-for-SIPI state */ @@ -1041,7 +1043,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool } if (mode == APIC_DELMODE_STARTUP) { - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* @@ -1445,7 +1447,8 @@ void vlapic_init(struct vlapic *vlapic) { KASSERT(vlapic->vm != NULL, ("vlapic_init: vm is not initialized")); - KASSERT(vlapic->vcpuid >= 0 && vlapic->vcpuid < VM_MAXCPU, + KASSERT(vlapic->vcpuid >= 0 && + vlapic->vcpuid < vm_get_maxcpus(vlapic->vm), ("vlapic_init: vcpuid is not initialized")); KASSERT(vlapic->apic_page != NULL, ("vlapic_init: apic_page is not " "initialized")); Modified: stable/11/sys/amd64/vmm/vmm.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/vmm.c Sat May 25 11:27:56 2019 (r348271) @@ -273,7 +273,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create) { struct vcpu *vcpu; - KASSERT(vcpu_id >= 0 && vcpu_id < VM_MAXCPU, + KASSERT(vcpu_id >= 0 && vcpu_id < vm->maxcpus, ("vcpu_init: invalid vcpu %d", vcpu_id)); vcpu = &vm->vcpu[vcpu_id]; @@ -312,7 +312,7 @@ vm_exitinfo(struct vm *vm, int cpuid) { struct vcpu *vcpu; - if (cpuid < 0 || cpuid >= VM_MAXCPU) + if (cpuid < 0 || cpuid >= vm->maxcpus) panic("vm_exitinfo: invalid cpuid %d", cpuid); vcpu = &vm->vcpu[cpuid]; @@ -424,7 +424,7 @@ vm_init(struct vm *vm, bool create) vm->suspend = 0; CPU_ZERO(&vm->suspended_cpus); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_init(vm, i, create); } @@ -462,7 +462,7 @@ vm_create(const char *name, struct vm **retvm) vm->sockets = 1; vm->cores = cores_per_package; /* XXX backwards compatibility */ vm->threads = threads_per_core; /* XXX backwards compatibility */ - vm->maxcpus = 0; /* XXX not implemented */ + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ vm_init(vm, true); @@ -480,19 +480,25 @@ vm_get_topology(struct vm *vm, uint16_t *sockets, uint *maxcpus = vm->maxcpus; } +uint16_t +vm_get_maxcpus(struct vm *vm) +{ + return (vm->maxcpus); +} + int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus) { if (maxcpus != 0) return (EINVAL); /* XXX remove when supported */ - if ((sockets * cores * threads) > VM_MAXCPU) + if ((sockets * cores * threads) > vm->maxcpus) return (EINVAL); /* XXX need to check sockets * cores * threads == vCPU, how? */ vm->sockets = sockets; vm->cores = cores; vm->threads = threads; - vm->maxcpus = maxcpus; + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ return(0); } @@ -517,7 +523,7 @@ vm_cleanup(struct vm *vm, bool destroy) vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_cleanup(vm, i, destroy); VMCLEANUP(vm->cookie); @@ -952,9 +958,9 @@ vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, * guaranteed if at least one vcpu is in the VCPU_FROZEN state. */ int state; - KASSERT(vcpuid >= -1 && vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d", + KASSERT(vcpuid >= -1 && vcpuid < vm->maxcpus, ("%s: invalid vcpuid %d", __func__, vcpuid)); - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (vcpuid != -1 && vcpuid != i) continue; state = vcpu_get_state(vm, i, NULL); @@ -1000,7 +1006,7 @@ int vm_get_register(struct vm *vm, int vcpu, int reg, uint64_t *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1015,7 +1021,7 @@ vm_set_register(struct vm *vm, int vcpuid, int reg, ui struct vcpu *vcpu; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1069,7 +1075,7 @@ vm_get_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1082,7 +1088,7 @@ int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1254,7 +1260,7 @@ static void vm_handle_rendezvous(struct vm *vm, int vcpuid) { - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_handle_rendezvous: invalid vcpuid %d", vcpuid)); mtx_lock(&vm->rendezvous_mtx); @@ -1530,7 +1536,7 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *ret /* * Wakeup the other sleeping vcpus and return to userspace. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->suspended_cpus)) { vcpu_notify_event(vm, i, false); } @@ -1572,7 +1578,7 @@ vm_suspend(struct vm *vm, enum vm_suspend_how how) /* * Notify all active vcpus that they are now suspended. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->active_cpus)) vcpu_notify_event(vm, i, false); } @@ -1647,7 +1653,7 @@ vm_run(struct vm *vm, struct vm_run *vmrun) vcpuid = vmrun->cpuid; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (!CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -1748,7 +1754,7 @@ vm_restart_instruction(void *arg, int vcpuid) int error; vm = arg; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1787,7 +1793,7 @@ vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t in struct vcpu *vcpu; int type, vector; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1928,7 +1934,8 @@ vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t * uint64_t info1, info2; int valid; - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); + KASSERT(vcpuid >= 0 && + vcpuid < vm->maxcpus, ("invalid vcpu %d", vcpuid)); vcpu = &vm->vcpu[vcpuid]; @@ -1968,7 +1975,7 @@ vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *in { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1985,7 +1992,7 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vec uint64_t regval; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (vector < 0 || vector >= 32) @@ -2076,7 +2083,7 @@ vm_inject_nmi(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2091,7 +2098,7 @@ vm_nmi_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2104,7 +2111,7 @@ vm_nmi_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2123,7 +2130,7 @@ vm_inject_extint(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2138,7 +2145,7 @@ vm_extint_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2151,7 +2158,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2166,7 +2173,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) int vm_get_capability(struct vm *vm, int vcpu, int type, int *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2178,7 +2185,7 @@ vm_get_capability(struct vm *vm, int vcpu, int type, i int vm_set_capability(struct vm *vm, int vcpu, int type, int val) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2263,7 +2270,7 @@ vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_st int error; struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_set_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2281,7 +2288,7 @@ vcpu_get_state(struct vm *vm, int vcpuid, int *hostcpu struct vcpu *vcpu; enum vcpu_state state; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_get_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2299,7 +2306,7 @@ int vm_activate_cpu(struct vm *vm, int vcpuid) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -2334,7 +2341,7 @@ vcpu_stats(struct vm *vm, int vcpuid) int vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state *state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); *state = vm->vcpu[vcpuid].x2apic_state; @@ -2345,7 +2352,7 @@ vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2 int vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (state >= X2APIC_STATE_LAST) @@ -2432,7 +2439,7 @@ vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t * Enforce that this function is called without any locks */ WITNESS_WARN(WARN_PANIC, NULL, "vm_smp_rendezvous"); - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_smp_rendezvous: invalid vcpuid %d", vcpuid)); restart: @@ -2462,7 +2469,7 @@ restart: * Wake up any sleeping vcpus and trigger a VM-exit in any running * vcpus so they handle the rendezvous as soon as possible. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &dest)) vcpu_notify_event(vm, i, false); } Modified: stable/11/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_dev.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/vmm_dev.c Sat May 25 11:27:56 2019 (r348271) @@ -94,7 +94,7 @@ vcpu_lock_one(struct vmmdev_softc *sc, int vcpu) { int error; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(sc->vm)) return (EINVAL); error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); @@ -119,8 +119,10 @@ static int vcpu_lock_all(struct vmmdev_softc *sc) { int error, vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) { + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) { error = vcpu_lock_one(sc, vcpu); if (error) break; @@ -138,8 +140,10 @@ static void vcpu_unlock_all(struct vmmdev_softc *sc) { int vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) vcpu_unlock_one(sc, vcpu); } @@ -174,6 +178,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_paddr_t gpa, maxaddr; void *hpa, *cookie; struct vmmdev_softc *sc; + uint16_t lastcpu; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -182,7 +187,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -201,7 +207,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag * Since this device does not support lseek(2), dd(1) will * read(2) blocks of data to simulate the lseek(2). */ - hpa = vm_gpa_hold(sc->vm, VM_MAXCPU - 1, gpa, c, prot, &cookie); + hpa = vm_gpa_hold(sc->vm, lastcpu, gpa, c, + prot, &cookie); if (hpa == NULL) { if (uio->uio_rw == UIO_READ && gpa < maxaddr) error = uiomove(__DECONST(void *, zero_region), @@ -213,7 +220,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_gpa_release(cookie); } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -377,7 +384,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da * Lock a vcpu to make sure that the memory map cannot be * modified while it is being inspected. */ - vcpu = VM_MAXCPU - 1; + vcpu = vm_get_maxcpus(sc->vm) - 1; error = vcpu_lock_one(sc, vcpu); if (error) goto done; @@ -678,6 +685,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of size_t len; vm_ooffset_t segoff, first, last; int error, found, segid; + uint16_t lastcpu; bool sysmem; first = *offset; @@ -694,7 +702,8 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -723,7 +732,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of error = EINVAL; } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -910,6 +919,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of vm_ooffset_t first, last; size_t seglen; int error; + uint16_t lastcpu; bool sysmem; dsc = cdev->si_drv1; @@ -923,7 +933,8 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of if ((nprot & PROT_EXEC) || first < 0 || first >= last) return (EINVAL); - error = vcpu_lock_one(dsc->sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(dsc->sc->vm) - 1; + error = vcpu_lock_one(dsc->sc, lastcpu); if (error) return (error); @@ -931,7 +942,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of KASSERT(error == 0 && !sysmem && *objp != NULL, ("%s: invalid devmem segment %d", __func__, dsc->segid)); - vcpu_unlock_one(dsc->sc, VM_MAXCPU - 1); + vcpu_unlock_one(dsc->sc, lastcpu); if (seglen >= last) { vm_object_reference(*objp); Modified: stable/11/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_lapic.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/vmm_lapic.c Sat May 25 11:27:56 2019 (r348271) @@ -54,7 +54,7 @@ lapic_set_intr(struct vm *vm, int cpu, int vector, boo { struct vlapic *vlapic; - if (cpu < 0 || cpu >= VM_MAXCPU) + if (cpu < 0 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); /* @@ -77,7 +77,7 @@ lapic_set_local_intr(struct vm *vm, int cpu, int vecto cpuset_t dmask; int error; - if (cpu < -1 || cpu >= VM_MAXCPU) + if (cpu < -1 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); if (cpu == -1) Modified: stable/11/sys/amd64/vmm/vmm_stat.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_stat.c Sat May 25 11:22:49 2019 (r348270) +++ stable/11/sys/amd64/vmm/vmm_stat.c Sat May 25 11:27:56 2019 (r348271) @@ -86,7 +86,7 @@ vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *stats; int i; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm)) return (EINVAL); /* Let stats functions update their counters */ From owner-svn-src-all@freebsd.org Sat May 25 17:08:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C91B515B1463 for ; Sat, 25 May 2019 17:08:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 363588026C for ; Sat, 25 May 2019 17:08:20 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1558804097; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=lZin02RH2wbGcaMtQ1sgtjbMGIPB3iNSSQ6JM9yUMcCo9lXYwM6oCbitlGAhqN+xJpRPzuSjf/gkG d0BRjq5gga6/VmTWwyDjSTzvBiBQDrfIE2pXmaQelJp+pZIhmCwZT6MdjD4dHjyCIShYJBb+fBDurb J+jrGdgfVrwF0w5BJLBEXBTiPZHvLfsiK/9ievJNHNmvHhuAPiXYFro4LwiBKa3Gooz0ktsC2dcNtw gg5bUWEcJu8ObgvAhzpRftuzCFX+YJSxuN4YL8WbQSb7XkHUIEOq7LdYuXbe2Mbss446L1iZ+0vQH/ 8U8r26BhvYlK8sWpXFGsl+jEwNooRcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=hBZqK0+i/2OgiBhX/Bjyj30HBd1QjHsZ1tpBmUbDzAo=; b=qDyR4QqzSP4kJyOBqUh2ntW7wmszTk8CDhP4jGKLj5dFxchY95UQWi6JCC1OrKL+NERxsfLIaqHAO 7U4zqvviyLnLDEt5kFY11265XIE9Wgxg00lcAWzaRInz6FEPUYRgFP/eZVccfo3jT4au7bk38atnyo q976iJh1NdMhBPiZsw0iweuOtRYRMKSZbEfYiJdaC6MbAok1L4cjlQGiDIypXUQnnQviaI/wMfNShH OGh2j2Afj00Z6MmIhaydU+AHy3EPmEDaXxwuAlTKdIZaxvZj271XxVbMCQfQ0kPdiuyS+4xMBcmPwn LyTdv6/4NGuCpEkoKmWPXgT4pERlFxw== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=hBZqK0+i/2OgiBhX/Bjyj30HBd1QjHsZ1tpBmUbDzAo=; b=CwBqw6S0ENmsaIbe56GrVyShkA55g8C2uzC5PGyPWr241NXFc9EqmrEbPts0qezswQXaUCyuv0Hbw QuiP9WEBYx0Da6EG3GSivTALFmaZUuaxpthcngeyRxo5uqAKpqpMaX4CTEVnpbgyqCArv+2FxT7hN1 i4Qi1XLR7L6QXUkveGKNBHEU43pAV/5qd4WE7dk7INyVnQdkOpP/ewBnykqkcI162UAe4S4NbhJsw0 UFoTSJCp2Dacl4AOlqyrM0krSds6Ys6BkY3OQEpXEkbALN9CE2+GNjfhpH+rPlcyunH4ZXW/7qlNqv sKXGp9wyX8NeUXsh/vwH+ClRBeOxl2g== X-MHO-RoutePath: aGlwcGll X-MHO-User: ad6c9c1d-7f0f-11e9-91aa-b56e4e6b5865 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id ad6c9c1d-7f0f-11e9-91aa-b56e4e6b5865; Sat, 25 May 2019 17:08:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4PH8BQ4019978; Sat, 25 May 2019 11:08:11 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <27f68cdadcf92080f83d8d672b8cc82e9932606b.camel@freebsd.org> Subject: Re: svn commit: r348241 - head From: Ian Lepore To: cem@freebsd.org, Andrew Gallatin Cc: src-committers , svn-src-all , svn-src-head Date: Sat, 25 May 2019 11:08:11 -0600 In-Reply-To: References: <201905241545.x4OFjh4N057402@repo.freebsd.org> <857f545b-c766-b9e0-3f01-6b80420c540c@cs.duke.edu> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 363588026C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 17:08:21 -0000 On Fri, 2019-05-24 at 10:08 -0700, Conrad Meyer wrote: > On Fri, May 24, 2019 at 9:24 AM Andrew Gallatin > wrote: > > Dumb question about this: Will it update toolchains, or just use > > what > > can find? > > -DMAKE_JUST_KERNELS doesn't touch toolchains. For that, there is the > less memorable build step: > > export NCPU=$((1 * $(sysctl -n hw.ncpu) / 3)); make -sj${NCPU} > tinderbox JFLAG=-j${NCPU} UNIVERSE_TARGET=kernel-toolchain -DNO_CLEAN > Or "make toolchains". Or "make kernel-toolchains". But I think those two build the same thing these days. -- Ian From owner-svn-src-all@freebsd.org Sat May 25 17:17:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6105E15B181F; Sat, 25 May 2019 17:17:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00F238085E; Sat, 25 May 2019 17:17:10 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9AB475A5; Sat, 25 May 2019 17:17:09 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PHH9mi069232; Sat, 25 May 2019 17:17:09 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PHH9Ol069230; Sat, 25 May 2019 17:17:09 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905251717.x4PHH9Ol069230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 17:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348273 - in stable/12/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Commit-Revision: 348273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00F238085E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 17:17:10 -0000 Author: johalun Date: Sat May 25 17:17:08 2019 New Revision: 348273 URL: https://svnweb.freebsd.org/changeset/base/348273 Log: MFC r344485: import linux debugfs support Reviewed by: hps@ Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19258 Added: stable/12/sys/compat/lindebugfs/ - copied from r344485, head/sys/compat/lindebugfs/ stable/12/sys/compat/linuxkpi/common/include/linux/debugfs.h - copied unchanged from r344485, head/sys/compat/linuxkpi/common/include/linux/debugfs.h stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h - copied unchanged from r344485, head/sys/compat/linuxkpi/common/include/linux/seq_file.h stable/12/sys/compat/linuxkpi/common/src/linux_seq_file.c - copied unchanged from r344485, head/sys/compat/linuxkpi/common/src/linux_seq_file.c Modified: Directory Properties: stable/12/ (props changed) Copied: stable/12/sys/compat/linuxkpi/common/include/linux/debugfs.h (from r344485, head/sys/compat/linuxkpi/common/include/linux/debugfs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/include/linux/debugfs.h Sat May 25 17:17:08 2019 (r348273, copy of r344485, head/sys/compat/linuxkpi/common/include/linux/debugfs.h) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_DEBUGFS_H_ +#define _LINUX_DEBUGFS_H_ + +#include +#include + +#include + +void debugfs_remove(struct dentry *dentry); + +struct dentry *debugfs_create_file(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops); + +struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); + +struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, + const char *dest); + +void debugfs_remove_recursive(struct dentry *dentry); + +#endif Copied: stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h (from r344485, head/sys/compat/linuxkpi/common/include/linux/seq_file.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat May 25 17:17:08 2019 (r348273, copy of r344485, head/sys/compat/linuxkpi/common/include/linux/seq_file.h) @@ -0,0 +1,71 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SEQ_FILE_H_ +#define _LINUX_SEQ_FILE_H_ + +#include + +struct seq_operations; +struct linux_file; + +#define inode vnode + +struct seq_file { + struct sbuf *buf; + + const struct seq_operations *op; + const struct linux_file *file; + void *private; +}; + +struct seq_operations { + void * (*start) (struct seq_file *m, off_t *pos); + void (*stop) (struct seq_file *m, void *v); + void * (*next) (struct seq_file *m, void *v, off_t *pos); + int (*show) (struct seq_file *m, void *v); +}; + +ssize_t seq_read(struct linux_file *, char *, size_t, off_t *); +int seq_write(struct seq_file *seq, const void *data, size_t len); + +int seq_open(struct linux_file *f, const struct seq_operations *op); +int seq_release(struct inode *inode, struct linux_file *file); + +off_t seq_lseek(struct linux_file *file, off_t offset, int whence); +int single_open(struct linux_file *, int (*)(struct seq_file *, void *), void *); +int single_release(struct inode *, struct linux_file *); + +#define seq_printf(m, fmt, ...) sbuf_printf((m)->buf, (fmt), ##__VA_ARGS__) + +#define seq_puts(m, str) sbuf_printf((m)->buf, str) +#define seq_putc(m, str) sbuf_putc((m)->buf, str) + + +#endif /* _LINUX_SEQ_FILE_H_ */ Copied: stable/12/sys/compat/linuxkpi/common/src/linux_seq_file.c (from r344485, head/sys/compat/linuxkpi/common/src/linux_seq_file.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/src/linux_seq_file.c Sat May 25 17:17:08 2019 (r348273, copy of r344485, head/sys/compat/linuxkpi/common/src/linux_seq_file.c) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#undef file +MALLOC_DEFINE(M_LSEQ, "seq_file", "seq_file"); + +ssize_t +seq_read(struct linux_file *f, char *ubuf, size_t size, off_t *ppos) +{ + struct seq_file *m = f->private_data; + void *p; + int rc; + off_t pos = 0; + + p = m->op->start(m, &pos); + rc = m->op->show(m, p); + if (rc) + return (rc); + return (size); +} + +int +seq_write(struct seq_file *seq, const void *data, size_t len) +{ + + return (sbuf_bcpy(seq->buf, data, len)); +} + +/* + * This only needs to be a valid address for lkpi + * drivers it should never actually be called + */ +off_t +seq_lseek(struct linux_file *file, off_t offset, int whence) +{ + + panic("%s not supported\n", __FUNCTION__); + return (0); +} + +static void * +single_start(struct seq_file *p, off_t *pos) +{ + + return ((void *)(uintptr_t)(*pos == 0)); +} + +static void * +single_next(struct seq_file *p, void *v, off_t *pos) +{ + + ++*pos; + return (NULL); +} + +static void +single_stop(struct seq_file *p, void *v) +{ +} + +int +seq_open(struct linux_file *f, const struct seq_operations *op) +{ + struct seq_file *p; + + if (f->private_data != NULL) + log(LOG_WARNING, "%s private_data not NULL", __func__); + + if ((p = malloc(sizeof(*p), M_LSEQ, M_NOWAIT|M_ZERO)) == NULL) + return (-ENOMEM); + + f->private_data = p; + p->op = op; + p->file = f; + return (0); +} + +int +single_open(struct linux_file *f, int (*show)(struct seq_file *, void *), void *d) +{ + struct seq_operations *op; + int rc = -ENOMEM; + + op = malloc(sizeof(*op), M_LSEQ, M_NOWAIT); + if (op) { + op->start = single_start; + op->next = single_next; + op->stop = single_stop; + op->show = show; + rc = seq_open(f, op); + if (rc) + free(op, M_LSEQ); + else + ((struct seq_file *)f->private_data)->private = d; + + } + return (rc); +} + +int +seq_release(struct inode *inode __unused, struct linux_file *file) +{ + struct seq_file *m; + + m = file->private_data; + free(m, M_LSEQ); + return (0); +} + +int +single_release(struct vnode *v, struct linux_file *f) +{ + const struct seq_operations *op = ((struct seq_file *)f->private_data)->op; + int rc; + + rc = seq_release(v, f); + free(__DECONST(void *, op), M_LSEQ); + return (rc); +} From owner-svn-src-all@freebsd.org Sat May 25 17:37:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5610115B1DD8; Sat, 25 May 2019 17:37:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F2538184B; Sat, 25 May 2019 17:37:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72EB37910; Sat, 25 May 2019 17:37:29 +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 x4PHbTRe080287; Sat, 25 May 2019 17:37:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PHbTS3080286; Sat, 25 May 2019 17:37:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905251737.x4PHbTS3080286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 25 May 2019 17:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348274 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 348274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F2538184B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 17:37:44 -0000 Author: trasz Date: Sat May 25 17:37:28 2019 New Revision: 348274 URL: https://svnweb.freebsd.org/changeset/base/348274 Log: We don't really need two entries to describe how to deal with optical drives in devfs.conf(5). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/devfs.conf.5 Modified: head/share/man/man5/devfs.conf.5 ============================================================================== --- head/share/man/man5/devfs.conf.5 Sat May 25 17:17:08 2019 (r348273) +++ head/share/man/man5/devfs.conf.5 Sat May 25 17:37:28 2019 (r348274) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2015 +.Dd May 25, 2019 .Dt DEVFS.CONF 5 .Os .Sh NAME @@ -98,18 +98,9 @@ as explained in .Sh EXAMPLES To create a .Pa /dev/cdrom -link that points to the first -.Xr SCSI 4 -CD-ROM, +link that points to the first CD-ROM, the following may be added to .Nm : -.Bd -literal -offset indent -link cd0 cdrom -.Ed -.Pp -Similarly, to link -.Pa /dev/cdrom -to the first SCSI CD-ROM device, the following action may be used: .Bd -literal -offset indent link cd0 cdrom .Ed From owner-svn-src-all@freebsd.org Sat May 25 18:03:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E959515B2726; Sat, 25 May 2019 18:03:17 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88B22830A8; Sat, 25 May 2019 18:03:17 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 723CF7E0C; Sat, 25 May 2019 18:03:17 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PI3HWH096338; Sat, 25 May 2019 18:03:17 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PI3Hen096337; Sat, 25 May 2019 18:03:17 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905251803.x4PI3Hen096337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 18:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348275 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 348275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88B22830A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 18:03:18 -0000 Author: johalun Date: Sat May 25 18:03:17 2019 New Revision: 348275 URL: https://svnweb.freebsd.org/changeset/base/348275 Log: LinuxKPI: Register new linuxkpi and lindebugfs source files. This change is a partial MFC of r344487. Reviewed by: hps Approved by: imp (mentor), hps Obtained from: mmacy Modified: stable/12/sys/conf/files Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Sat May 25 17:37:28 2019 (r348274) +++ stable/12/sys/conf/files Sat May 25 18:03:17 2019 (r348275) @@ -4529,6 +4529,11 @@ compat/linuxkpi/common/src/linux_usb.c optional compa compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ + compile-with "${LINUXKPI_C}" + +compat/lindebugfs/lindebugfs.c optional lindebugfs \ + compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) ofed/drivers/infiniband/core/ib_addr.c optional ofed \ From owner-svn-src-all@freebsd.org Sat May 25 18:23:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9B9A15B3092; Sat, 25 May 2019 18:23:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8795884128; Sat, 25 May 2019 18:23:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DB978180; Sat, 25 May 2019 18:23:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PINXrI007312; Sat, 25 May 2019 18:23:33 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PINXPn007310; Sat, 25 May 2019 18:23:33 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905251823.x4PINXPn007310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348276 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 348276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8795884128 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 18:23:34 -0000 Author: johalun Date: Sat May 25 18:23:32 2019 New Revision: 348276 URL: https://svnweb.freebsd.org/changeset/base/348276 Log: MFC r344486: Change seq_read to seq_load to avoid namespace conflicts with lkpi Sponsored by: iX Systems Modified: stable/12/sys/kern/kern_descrip.c stable/12/sys/sys/seq.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_descrip.c ============================================================================== --- stable/12/sys/kern/kern_descrip.c Sat May 25 18:03:17 2019 (r348275) +++ stable/12/sys/kern/kern_descrip.c Sat May 25 18:23:32 2019 (r348276) @@ -2647,7 +2647,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ for (;;) { #ifdef CAPABILITIES - seq = seq_read(fd_seq(fdt, fd)); + seq = seq_load(fd_seq(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; Modified: stable/12/sys/sys/seq.h ============================================================================== --- stable/12/sys/sys/seq.h Sat May 25 18:03:17 2019 (r348275) +++ stable/12/sys/sys/seq.h Sat May 25 18:23:32 2019 (r348276) @@ -121,7 +121,7 @@ seq_write_end(seq_t *seqp) } static __inline seq_t -seq_read(const seq_t *seqp) +seq_load(const seq_t *seqp) { seq_t ret; From owner-svn-src-all@freebsd.org Sat May 25 18:36:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21CB815B3381; Sat, 25 May 2019 18:36:40 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA05A847D4; Sat, 25 May 2019 18:36:39 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94CAB8328; Sat, 25 May 2019 18:36:39 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PIade2013257; Sat, 25 May 2019 18:36:39 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PIadKg013256; Sat, 25 May 2019 18:36:39 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905251836.x4PIadKg013256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 18:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348277 - in stable/12/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Commit-Revision: 348277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA05A847D4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 18:36:40 -0000 Author: johalun Date: Sat May 25 18:36:38 2019 New Revision: 348277 URL: https://svnweb.freebsd.org/changeset/base/348277 Log: MFC r347892: LinuxKPI: Finalize import of seq_file. seq_file.h and linux_seq_file.c was imported form ports earlier but linux_seq_file.c was never compiled in with the module. With this commit base seq_file will replace ports seq_file and it required a few modifications to not break functionality and build. Reviewed by: hps Approved by: imp (mentor), hps Modified: stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h stable/12/sys/modules/linuxkpi/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat May 25 18:23:32 2019 (r348276) +++ stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat May 25 18:36:38 2019 (r348277) @@ -30,13 +30,29 @@ #ifndef _LINUX_SEQ_FILE_H_ #define _LINUX_SEQ_FILE_H_ +#include +#include #include -struct seq_operations; -struct linux_file; - +#undef file #define inode vnode +#define DEFINE_SHOW_ATTRIBUTE(__name) \ +static int __name ## _open(struct inode *inode, struct linux_file *file) \ +{ \ + return single_open(file, __name ## _show, inode->i_private); \ +} \ + \ +static const struct file_operations __name ## _fops = { \ + .owner = THIS_MODULE, \ + .open = __name ## _open, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + +struct seq_operations; + struct seq_file { struct sbuf *buf; @@ -67,5 +83,6 @@ int single_release(struct inode *, struct linux_file * #define seq_puts(m, str) sbuf_printf((m)->buf, str) #define seq_putc(m, str) sbuf_putc((m)->buf, str) +#define file linux_file #endif /* _LINUX_SEQ_FILE_H_ */ Modified: stable/12/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/12/sys/modules/linuxkpi/Makefile Sat May 25 18:23:32 2019 (r348276) +++ stable/12/sys/modules/linuxkpi/Makefile Sat May 25 18:36:38 2019 (r348277) @@ -13,6 +13,7 @@ SRCS= linux_compat.c \ linux_pci.c \ linux_radix.c \ linux_rcu.c \ + linux_seq_file.c \ linux_schedule.c \ linux_slab.c \ linux_tasklet.c \ From owner-svn-src-all@freebsd.org Sat May 25 20:00:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A821A15B4ED5; Sat, 25 May 2019 20:00:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4804786F8A; Sat, 25 May 2019 20:00:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA46B90B1; Sat, 25 May 2019 19:59:59 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PJxxbG055395; Sat, 25 May 2019 19:59:59 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PJxx9I055394; Sat, 25 May 2019 19:59:59 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905251959.x4PJxx9I055394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 19:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348278 - in stable/12/sys: libkern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: libkern sys X-SVN-Commit-Revision: 348278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4804786F8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 20:00:00 -0000 Author: johalun Date: Sat May 25 19:59:59 2019 New Revision: 348278 URL: https://svnweb.freebsd.org/changeset/base/348278 Log: MFC r344384: Add non-sleepable strdup variant strdup_flags debugfs expects to do non-sleepable allocations Reviewed by: hps@ Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19259 Modified: stable/12/sys/libkern/strdup.c stable/12/sys/sys/libkern.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/libkern/strdup.c ============================================================================== --- stable/12/sys/libkern/strdup.c Sat May 25 18:36:38 2019 (r348277) +++ stable/12/sys/libkern/strdup.c Sat May 25 19:59:59 2019 (r348278) @@ -40,13 +40,22 @@ __FBSDID("$FreeBSD$"); #include char * -strdup(const char *string, struct malloc_type *type) +strdup_flags(const char *string, struct malloc_type *type, int flags) { size_t len; char *copy; len = strlen(string) + 1; - copy = malloc(len, type, M_WAITOK); + copy = malloc(len, type, flags); + if (copy == NULL) + return (NULL); bcopy(string, copy, len); return (copy); +} + +char * +strdup(const char *string, struct malloc_type *type) +{ + + return (strdup_flags(string, type, M_WAITOK)); } Modified: stable/12/sys/sys/libkern.h ============================================================================== --- stable/12/sys/sys/libkern.h Sat May 25 18:36:38 2019 (r348277) +++ stable/12/sys/sys/libkern.h Sat May 25 19:59:59 2019 (r348278) @@ -173,6 +173,7 @@ char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char * __restrict, const char * __restrict) __pure; +char *strdup_flags(const char *__restrict, struct malloc_type *, int); char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *); From owner-svn-src-all@freebsd.org Sat May 25 20:24:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C01F15B5747; Sat, 25 May 2019 20:24:53 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE4F788027; Sat, 25 May 2019 20:24:52 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 995CC959C; Sat, 25 May 2019 20:24:52 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PKOqDf071353; Sat, 25 May 2019 20:24:52 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PKOqCC071351; Sat, 25 May 2019 20:24:52 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905252024.x4PKOqCC071351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 20:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348279 - stable/12/sys/fs/pseudofs X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/fs/pseudofs X-SVN-Commit-Revision: 348279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE4F788027 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 20:24:53 -0000 Author: johalun Date: Sat May 25 20:24:51 2019 New Revision: 348279 URL: https://svnweb.freebsd.org/changeset/base/348279 Log: MFC r344385: PFS: Bump NAMELEN and don't require clients to be sleepable - debugfs consumers expect to be able to export names more than 48 characters - debugfs consumers expect to be able to hold locks across calls and are able to handle allocation failures Reviewed by: hps@ Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19256 Modified: stable/12/sys/fs/pseudofs/pseudofs.c stable/12/sys/fs/pseudofs/pseudofs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/pseudofs/pseudofs.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs.c Sat May 25 19:59:59 2019 (r348278) +++ stable/12/sys/fs/pseudofs/pseudofs.c Sat May 25 20:24:51 2019 (r348279) @@ -68,15 +68,20 @@ SYSCTL_INT(_vfs_pfs, OID_AUTO, trace, CTLFLAG_RW, &pfs * Allocate and initialize a node */ static struct pfs_node * -pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +pfs_alloc_node_flags(struct pfs_info *pi, const char *name, pfs_type_t type, int flags) { struct pfs_node *pn; + int malloc_flags; KASSERT(strlen(name) < PFS_NAMELEN, ("%s(): node name is too long", __func__)); - - pn = malloc(sizeof *pn, - M_PFSNODES, M_WAITOK|M_ZERO); + if (flags & PFS_NOWAIT) + malloc_flags = M_NOWAIT | M_ZERO; + else + malloc_flags = M_WAITOK | M_ZERO; + pn = malloc(sizeof *pn, M_PFSNODES, malloc_flags); + if (pn == NULL) + return (NULL); mtx_init(&pn->pn_mutex, "pfs_node", NULL, MTX_DEF | MTX_DUPOK); strlcpy(pn->pn_name, name, sizeof pn->pn_name); pn->pn_type = type; @@ -84,6 +89,12 @@ pfs_alloc_node(struct pfs_info *pi, const char *name, return (pn); } +static struct pfs_node * +pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +{ + return (pfs_alloc_node_flags(pi, name, type, 0)); +} + /* * Add a node to a directory */ @@ -160,15 +171,29 @@ pfs_detach_node(struct pfs_node *pn) /* * Add . and .. to a directory */ +static int +pfs_fixup_dir_flags(struct pfs_node *parent, int flags) +{ + struct pfs_node *dot, *dotdot; + + dot = pfs_alloc_node_flags(parent->pn_info, ".", pfstype_this, flags); + if (dot == NULL) + return (ENOMEM); + dotdot = pfs_alloc_node_flags(parent->pn_info, "..", pfstype_parent, flags); + if (dotdot == NULL) { + pfs_destroy(dot); + return (ENOMEM); + } + pfs_add_node(parent, dot); + pfs_add_node(parent, dotdot); + return (0); +} + static void pfs_fixup_dir(struct pfs_node *parent) { - struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, ".", pfstype_this); - pfs_add_node(parent, pn); - pn = pfs_alloc_node(parent->pn_info, "..", pfstype_parent); - pfs_add_node(parent, pn); + pfs_fixup_dir_flags(parent, 0); } /* @@ -180,16 +205,22 @@ pfs_create_dir(struct pfs_node *parent, const char *na int flags) { struct pfs_node *pn; + int rc; - pn = pfs_alloc_node(parent->pn_info, name, - (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir); + pn = pfs_alloc_node_flags(parent->pn_info, name, + (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir, flags); + if (pn == NULL) + return (NULL); pn->pn_attr = attr; pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; pfs_add_node(parent, pn); - pfs_fixup_dir(pn); - + rc = pfs_fixup_dir_flags(pn, flags); + if (rc) { + pfs_destroy(pn); + return (NULL); + } return (pn); } @@ -203,7 +234,9 @@ pfs_create_file(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_file); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_file, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; @@ -224,7 +257,9 @@ pfs_create_link(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_symlink); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_symlink, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; Modified: stable/12/sys/fs/pseudofs/pseudofs.h ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs.h Sat May 25 19:59:59 2019 (r348278) +++ stable/12/sys/fs/pseudofs/pseudofs.h Sat May 25 20:24:51 2019 (r348279) @@ -52,7 +52,7 @@ struct vnode; /* * Limits and constants */ -#define PFS_NAMELEN 48 +#define PFS_NAMELEN 128 #define PFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ #define PFS_DELEN (offsetof(struct dirent, d_name) + PFS_NAMELEN) @@ -77,6 +77,7 @@ typedef enum { #define PFS_RAWWR 0x0008 /* raw writer */ #define PFS_RAW (PFS_RAWRD|PFS_RAWWR) #define PFS_PROCDEP 0x0010 /* process-dependent */ +#define PFS_NOWAIT 0x0020 /* allow malloc to fail */ /* * Data structures From owner-svn-src-all@freebsd.org Sat May 25 20:53:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3607C15B60C5; Sat, 25 May 2019 20:53:25 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBC5A88F6D; Sat, 25 May 2019 20:53:24 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DA8C9AA6; Sat, 25 May 2019 20:53:24 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PKrOlt087743; Sat, 25 May 2019 20:53:24 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PKrOB0087741; Sat, 25 May 2019 20:53:24 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905252053.x4PKrOB0087741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Sat, 25 May 2019 20:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348280 - in stable/12/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Commit-Revision: 348280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBC5A88F6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 20:53:25 -0000 Author: johalun Date: Sat May 25 20:53:23 2019 New Revision: 348280 URL: https://svnweb.freebsd.org/changeset/base/348280 Log: LinuxKPI: Revert MFC of r347892 Revert until we can figure out how to keep compatibility with drm-kmod ports between 12.0 and 12-STABLE/12.1. Modified: stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h stable/12/sys/modules/linuxkpi/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat May 25 20:24:51 2019 (r348279) +++ stable/12/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat May 25 20:53:23 2019 (r348280) @@ -30,29 +30,13 @@ #ifndef _LINUX_SEQ_FILE_H_ #define _LINUX_SEQ_FILE_H_ -#include -#include #include -#undef file -#define inode vnode - -#define DEFINE_SHOW_ATTRIBUTE(__name) \ -static int __name ## _open(struct inode *inode, struct linux_file *file) \ -{ \ - return single_open(file, __name ## _show, inode->i_private); \ -} \ - \ -static const struct file_operations __name ## _fops = { \ - .owner = THIS_MODULE, \ - .open = __name ## _open, \ - .read = seq_read, \ - .llseek = seq_lseek, \ - .release = single_release, \ -} - struct seq_operations; +struct linux_file; +#define inode vnode + struct seq_file { struct sbuf *buf; @@ -83,6 +67,5 @@ int single_release(struct inode *, struct linux_file * #define seq_puts(m, str) sbuf_printf((m)->buf, str) #define seq_putc(m, str) sbuf_putc((m)->buf, str) -#define file linux_file #endif /* _LINUX_SEQ_FILE_H_ */ Modified: stable/12/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/12/sys/modules/linuxkpi/Makefile Sat May 25 20:24:51 2019 (r348279) +++ stable/12/sys/modules/linuxkpi/Makefile Sat May 25 20:53:23 2019 (r348280) @@ -13,7 +13,6 @@ SRCS= linux_compat.c \ linux_pci.c \ linux_radix.c \ linux_rcu.c \ - linux_seq_file.c \ linux_schedule.c \ linux_slab.c \ linux_tasklet.c \ From owner-svn-src-all@freebsd.org Sat May 25 21:57:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C7C15B775E; Sat, 25 May 2019 21:57:03 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF42D8B025; Sat, 25 May 2019 21:57:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BEB5A503; Sat, 25 May 2019 21:57:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PLv2YS018815; Sat, 25 May 2019 21:57:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PLv2vN018814; Sat, 25 May 2019 21:57:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905252157.x4PLv2vN018814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 25 May 2019 21:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348282 - head/usr.sbin/pw X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/usr.sbin/pw X-SVN-Commit-Revision: 348282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF42D8B025 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 21:57:03 -0000 Author: lwhsu Date: Sat May 25 21:57:01 2019 New Revision: 348282 URL: https://svnweb.freebsd.org/changeset/base/348282 Log: Remove an uneeded indentation introduced in r286196 to silence gcc warnging MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat May 25 21:40:27 2019 (r348281) +++ head/usr.sbin/pw/pw_user.c Sat May 25 21:57:01 2019 (r348282) @@ -589,7 +589,7 @@ print_user(struct passwd * pwd, bool pretty, bool v7) } if (pwd->pw_expire > (time_t)0 && (tptr = localtime(&pwd->pw_expire)) != NULL) strftime(acexpire, sizeof acexpire, "%c", tptr); - if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL) + if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL) strftime(pwexpire, sizeof pwexpire, "%c", tptr); printf("Login Name: %-15s #%-12ju Group: %-15s #%ju\n" " Full Name: %s\n" From owner-svn-src-all@freebsd.org Sat May 25 23:36:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF18215B98A0; Sat, 25 May 2019 23:36:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7CB8F46F; Sat, 25 May 2019 23:36:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 437B2B602; Sat, 25 May 2019 23:36:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PNaLYl074612; Sat, 25 May 2019 23:36:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PNaLbf074611; Sat, 25 May 2019 23:36:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905252336.x4PNaLbf074611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 25 May 2019 23:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348283 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 348283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F7CB8F46F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 23:36:22 -0000 Author: markj Date: Sat May 25 23:36:20 2019 New Revision: 348283 URL: https://svnweb.freebsd.org/changeset/base/348283 Log: Remove pmap_pid_dump() from the i386 pmap. It has not been compilable in a long time and doesn't seem very useful. Suggested by: kib MFC after: 1 week Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat May 25 21:57:01 2019 (r348282) +++ head/sys/i386/i386/pmap.c Sat May 25 23:36:20 2019 (r348283) @@ -5901,67 +5901,6 @@ __CONCAT(PMTYPE, trm_free)(void *addr, size_t size) vmem_free(pmap_trm_arena, (uintptr_t)addr, roundup2(size, 4)); } -#if defined(PMAP_DEBUG) -pmap_pid_dump(int pid) -{ - pmap_t pmap; - struct proc *p; - int npte = 0; - int index; - - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_pid != pid) - continue; - - if (p->p_vmspace) { - int i,j; - index = 0; - pmap = vmspace_pmap(p->p_vmspace); - for (i = 0; i < NPDEPTD; i++) { - pd_entry_t *pde; - pt_entry_t *pte; - vm_offset_t base = i << PDRSHIFT; - - pde = &pmap->pm_pdir[i]; - if (pde && pmap_pde_v(pde)) { - for (j = 0; j < NPTEPG; j++) { - vm_offset_t va = base + (j << PAGE_SHIFT); - if (va >= (vm_offset_t) VM_MIN_KERNEL_ADDRESS) { - if (index) { - index = 0; - printf("\n"); - } - sx_sunlock(&allproc_lock); - return (npte); - } - pte = pmap_pte(pmap, va); - if (pte && pmap_pte_v(pte)) { - pt_entry_t pa; - vm_page_t m; - pa = *pte; - m = PHYS_TO_VM_PAGE(pa & PG_FRAME); - printf("va: 0x%x, pt: 0x%x, h: %d, w: %d, f: 0x%x", - va, pa, m->hold_count, m->wire_count, m->flags); - npte++; - index++; - if (index >= 2) { - index = 0; - printf("\n"); - } else { - printf(" "); - } - } - } - } - } - } - } - sx_sunlock(&allproc_lock); - return (npte); -} -#endif - static void __CONCAT(PMTYPE, ksetrw)(vm_offset_t va) { From owner-svn-src-all@freebsd.org Sat May 25 23:58:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A6B15B9F72; Sat, 25 May 2019 23:58:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5C78FCD7; Sat, 25 May 2019 23:58:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D682B95A; Sat, 25 May 2019 23:58:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4PNwAuF085046; Sat, 25 May 2019 23:58:10 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4PNwANq085045; Sat, 25 May 2019 23:58:10 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905252358.x4PNwANq085045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 25 May 2019 23:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348284 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 348284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C5C78FCD7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 23:58:11 -0000 Author: lwhsu Date: Sat May 25 23:58:09 2019 New Revision: 348284 URL: https://svnweb.freebsd.org/changeset/base/348284 Log: Remove an uneeded indentation introduced in r223637 to silence gcc warnging MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat May 25 23:36:20 2019 (r348283) +++ head/sys/netpfil/pf/pf.c Sat May 25 23:58:09 2019 (r348284) @@ -5260,7 +5260,7 @@ pf_test_state_other(struct pf_state **state, int direc nk->addr[pd->didx].v4.s_addr, 0); - break; + break; #endif /* INET */ #ifdef INET6 case AF_INET6: