From owner-svn-src-head@freebsd.org Sun Jun 16 00:27:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53EBD15AEB8F; Sun, 16 Jun 2019 00:27:12 +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 ED59891422; Sun, 16 Jun 2019 00:27:11 +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 C4C666CA2; Sun, 16 Jun 2019 00:27:11 +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 x5G0RBTo062372; Sun, 16 Jun 2019 00:27:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G0RBh5062371; Sun, 16 Jun 2019 00:27:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160027.x5G0RBh5062371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 00:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349091 - head/sys/modules/allwinner/aw_pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/allwinner/aw_pwm X-SVN-Commit-Revision: 349091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED59891422 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 00:27:12 -0000 Author: ian Date: Sun Jun 16 00:27:11 2019 New Revision: 349091 URL: https://svnweb.freebsd.org/changeset/base/349091 Log: The pwm interface was replaced with pwmbus, include the right header file. Modified: head/sys/modules/allwinner/aw_pwm/Makefile Modified: head/sys/modules/allwinner/aw_pwm/Makefile ============================================================================== --- head/sys/modules/allwinner/aw_pwm/Makefile Sat Jun 15 23:11:34 2019 (r349090) +++ head/sys/modules/allwinner/aw_pwm/Makefile Sun Jun 16 00:27:11 2019 (r349091) @@ -10,6 +10,6 @@ SRCS+= \ clknode_if.h \ device_if.h \ ofw_bus_if.h \ - pwm_if.h + pwmbus_if.h .include From owner-svn-src-head@freebsd.org Sun Jun 16 00:32:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0527815AEE4D; Sun, 16 Jun 2019 00:32:21 +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 9E36D91801; Sun, 16 Jun 2019 00:32:20 +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 743416E31; Sun, 16 Jun 2019 00:32:20 +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 x5G0WKMV067504; Sun, 16 Jun 2019 00:32:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G0WKMq067503; Sun, 16 Jun 2019 00:32:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160032.x5G0WKMq067503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 00:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349092 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E36D91801 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 00:32:21 -0000 Author: ian Date: Sun Jun 16 00:32:19 2019 New Revision: 349092 URL: https://svnweb.freebsd.org/changeset/base/349092 Log: Make channel number unsigned, and spell unsigned int u_int. This should have been part of r349088. Modified: head/sys/dev/pwm/pwmc.h Modified: head/sys/dev/pwm/pwmc.h ============================================================================== --- head/sys/dev/pwm/pwmc.h Sun Jun 16 00:27:11 2019 (r349091) +++ head/sys/dev/pwm/pwmc.h Sun Jun 16 00:32:19 2019 (r349092) @@ -34,9 +34,9 @@ #define PWM_POLARITY_INVERTED (1 << 0) struct pwm_state { - int channel; - unsigned int period; - unsigned int duty; + u_int channel; + u_int period; + u_int duty; uint32_t flags; bool enable; }; From owner-svn-src-head@freebsd.org Sun Jun 16 00:43:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB47815AF10B; Sun, 16 Jun 2019 00:43:06 +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 5F90891C2B; Sun, 16 Jun 2019 00:43:06 +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 3A2D16FE4; Sun, 16 Jun 2019 00:43:06 +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 x5G0h64l072516; Sun, 16 Jun 2019 00:43:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G0h6hl072515; Sun, 16 Jun 2019 00:43:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160043.x5G0h6hl072515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 00:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349093 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F90891C2B 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 00:43:06 -0000 Author: ian Date: Sun Jun 16 00:43:05 2019 New Revision: 349093 URL: https://svnweb.freebsd.org/changeset/base/349093 Log: This code no longer uses fdt/ofw stuff, no need to include ofw headers. Modified: head/sys/dev/pwm/pwmbus.c Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sun Jun 16 00:32:19 2019 (r349092) +++ head/sys/dev/pwm/pwmbus.c Sun Jun 16 00:43:05 2019 (r349093) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - #include #include "pwmbus_if.h" From owner-svn-src-head@freebsd.org Sun Jun 16 00:53:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA3515AF34D; Sun, 16 Jun 2019 00:53: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 48D3A9200A; Sun, 16 Jun 2019 00:53:11 +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 1EC947183; Sun, 16 Jun 2019 00:53:11 +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 x5G0rAKX077941; Sun, 16 Jun 2019 00:53:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G0rAd7077937; Sun, 16 Jun 2019 00:53:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160053.x5G0rAd7077937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 00:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349094 - in head/sys/modules: . pwm pwm/pwmbus pwm/pwmc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules: . pwm pwm/pwmbus pwm/pwmc X-SVN-Commit-Revision: 349094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48D3A9200A 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 00:53:12 -0000 Author: ian Date: Sun Jun 16 00:53:09 2019 New Revision: 349094 URL: https://svnweb.freebsd.org/changeset/base/349094 Log: Add module makefiles for pwm. Added: head/sys/modules/pwm/ head/sys/modules/pwm/Makefile (contents, props changed) head/sys/modules/pwm/pwmbus/ head/sys/modules/pwm/pwmbus/Makefile (contents, props changed) head/sys/modules/pwm/pwmc/ head/sys/modules/pwm/pwmc/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jun 16 00:43:05 2019 (r349093) +++ head/sys/modules/Makefile Sun Jun 16 00:53:09 2019 (r349094) @@ -299,6 +299,7 @@ SUBDIR= \ ${_pst} \ pty \ puc \ + pwm \ ${_qlxge} \ ${_qlxgb} \ ${_qlxgbe} \ Added: head/sys/modules/pwm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/pwm/Makefile Sun Jun 16 00:53:09 2019 (r349094) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +# Modules for dev/pwm drivers. + +SUBDIR = \ + pwmbus \ + pwmc \ + +.include Added: head/sys/modules/pwm/pwmbus/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/pwm/pwmbus/Makefile Sun Jun 16 00:53:09 2019 (r349094) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/pwm + +KMOD= pwmbus +SRCS= pwmbus.c + +.if !empty(OPT_FDT) +SRCS+= ofw_pwm.c ofw_bus_if.h +.endif + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + opt_platform.h \ + pwmbus_if.c \ + pwmbus_if.h \ + +.include Added: head/sys/modules/pwm/pwmc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/pwm/pwmc/Makefile Sun Jun 16 00:53:09 2019 (r349094) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/pwm +KMOD= pwmc +SRCS= pwmc.c + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + opt_platform.h \ + pwmbus_if.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + +.include From owner-svn-src-head@freebsd.org Sun Jun 16 01:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A667A15AF5D0; Sun, 16 Jun 2019 01:05:54 +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 47E7892466; Sun, 16 Jun 2019 01:05:54 +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 213137341; Sun, 16 Jun 2019 01:05:54 +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 x5G15sU3083070; Sun, 16 Jun 2019 01:05:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G15rjm083069; Sun, 16 Jun 2019 01:05:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160105.x5G15rjm083069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 01:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349095 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 349095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47E7892466 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 01:05:54 -0000 Author: ian Date: Sun Jun 16 01:05:53 2019 New Revision: 349095 URL: https://svnweb.freebsd.org/changeset/base/349095 Log: Split the dtb MODULES_EXTRA line to a series of += lines, making it easier to maintain and keep in alphabetical order, and paving the way for adding some other modules that aren't dtb-related. Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Sun Jun 16 00:53:09 2019 (r349094) +++ head/sys/arm/conf/GENERIC Sun Jun 16 01:05:53 2019 (r349095) @@ -277,4 +277,11 @@ device aw_thermal # Allwinner Thermal Sensor Controll # Flattened Device Tree options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/allwinner" +makeoptions MODULES_EXTRA+="dtb/am335x" +makeoptions MODULES_EXTRA+="dtb/imx6" +makeoptions MODULES_EXTRA+="dtb/nvidia" +makeoptions MODULES_EXTRA+="dtb/omap4" +makeoptions MODULES_EXTRA+="dtb/rpi" +makeoptions MODULES_EXTRA+="dtb/zynq" + From owner-svn-src-head@freebsd.org Sun Jun 16 01:22:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742B115AFD16; Sun, 16 Jun 2019 01:22:46 +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 164D192C1E; Sun, 16 Jun 2019 01:22:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E30197688; Sun, 16 Jun 2019 01:22:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5G1MjHL093686; Sun, 16 Jun 2019 01:22:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G1MjDS093682; Sun, 16 Jun 2019 01:22:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160122.x5G1MjDS093682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 01:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349096 - in head/sys/modules: arm_ti arm_ti/am335x_ehrpwm arm_ti/ti_i2c ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules: arm_ti arm_ti/am335x_ehrpwm arm_ti/ti_i2c ti X-SVN-Commit-Revision: 349096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 164D192C1E 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 01:22:46 -0000 Author: ian Date: Sun Jun 16 01:22:44 2019 New Revision: 349096 URL: https://svnweb.freebsd.org/changeset/base/349096 Log: Add module makefiles for Texas Instruments ARM SoCs. The natural place to look for them based on how other SoCs are organized would be sys/modules/ti, but that's already taken. Drop a clue into modules/ti/Makefile directing people to modules/arm_ti if they're looking for ARM modules. Added: head/sys/modules/arm_ti/ head/sys/modules/arm_ti/Makefile (contents, props changed) head/sys/modules/arm_ti/am335x_ehrpwm/ head/sys/modules/arm_ti/am335x_ehrpwm/Makefile (contents, props changed) head/sys/modules/arm_ti/ti_i2c/ head/sys/modules/arm_ti/ti_i2c/Makefile (contents, props changed) Modified: head/sys/modules/ti/Makefile Added: head/sys/modules/arm_ti/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/arm_ti/Makefile Sun Jun 16 01:22:44 2019 (r349096) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# Build modules specific to Texas Instruments ARM SoCs. + +SUBDIR = \ + ../am335x_dmtpps \ + am335x_ehrpwm \ + ti_i2c \ + +.include Added: head/sys/modules/arm_ti/am335x_ehrpwm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/arm_ti/am335x_ehrpwm/Makefile Sun Jun 16 01:22:44 2019 (r349096) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/ti/am335x + +KMOD= am335x_ehrpwm +SRCS= am335x_ehrpwm.c + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + ofw_bus_if.h \ + pwmbus_if.h \ + +.include + Added: head/sys/modules/arm_ti/ti_i2c/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/arm_ti/ti_i2c/Makefile Sun Jun 16 01:22:44 2019 (r349096) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/ti + +KMOD= ti_i2c +SRCS= ti_i2c.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + ofw_bus_if.h \ + +.include Modified: head/sys/modules/ti/Makefile ============================================================================== --- head/sys/modules/ti/Makefile Sun Jun 16 01:05:53 2019 (r349095) +++ head/sys/modules/ti/Makefile Sun Jun 16 01:22:44 2019 (r349096) @@ -1,4 +1,6 @@ # $FreeBSD$ +# Module for Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD. +# Modules for Texas Instruments ARM SoCs are located in sys/modules/arm_ti. .PATH: ${SRCTOP}/sys/dev/ti From owner-svn-src-head@freebsd.org Sun Jun 16 01:23:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7AEA15AFD85; Sun, 16 Jun 2019 01:23:46 +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 464CF92D56; Sun, 16 Jun 2019 01:23:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20A537689; Sun, 16 Jun 2019 01:23:46 +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 x5G1NkRR093765; Sun, 16 Jun 2019 01:23:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G1NkbA093763; Sun, 16 Jun 2019 01:23:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906160123.x5G1NkbA093763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 01:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349097 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 349097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 464CF92D56 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 01:23:46 -0000 Author: ian Date: Sun Jun 16 01:23:45 2019 New Revision: 349097 URL: https://svnweb.freebsd.org/changeset/base/349097 Log: Build SoC-specific modules with GENERIC for the SoCs that have them. Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Sun Jun 16 01:22:44 2019 (r349096) +++ head/sys/arm/conf/GENERIC Sun Jun 16 01:23:45 2019 (r349097) @@ -285,3 +285,8 @@ makeoptions MODULES_EXTRA+="dtb/omap4" makeoptions MODULES_EXTRA+="dtb/rpi" makeoptions MODULES_EXTRA+="dtb/zynq" +# SOC-specific modules +makeoptions MODULES_EXTRA+="allwinner" +makeoptions MODULES_EXTRA+="arm_ti" +makeoptions MODULES_EXTRA+="imx" + From owner-svn-src-head@freebsd.org Sun Jun 16 03:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E74515B19AA; Sun, 16 Jun 2019 03:06:06 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 360669536F; Sun, 16 Jun 2019 03:06:06 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B1FF87BE; Sun, 16 Jun 2019 03:06:06 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5G365fK046760; Sun, 16 Jun 2019 03:06:05 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G3657f046759; Sun, 16 Jun 2019 03:06:05 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201906160306.x5G3657f046759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 16 Jun 2019 03:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349098 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 349098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 360669536F 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 03:06:06 -0000 Author: philip Date: Sun Jun 16 03:06:05 2019 New Revision: 349098 URL: https://svnweb.freebsd.org/changeset/base/349098 Log: Add macOS-like three finger drag trackpad gesture to psm(4) Submitted by: Yan Ka Chiu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20648 Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun Jun 16 01:23:45 2019 (r349097) +++ head/sys/dev/atkbdc/psm.c Sun Jun 16 03:06:05 2019 (r349098) @@ -236,6 +236,7 @@ typedef struct synapticsinfo { int softbutton3_x; int max_x; int max_y; + int three_finger_drag; int natural_scroll; } synapticsinfo_t; @@ -572,6 +573,7 @@ enum { SYNAPTICS_SYSCTL_SOFTBUTTONS_Y = SYN_OFFSET(softbuttons_y), SYNAPTICS_SYSCTL_SOFTBUTTON2_X = SYN_OFFSET(softbutton2_x), SYNAPTICS_SYSCTL_SOFTBUTTON3_X = SYN_OFFSET(softbutton3_x), + SYNAPTICS_SYSCTL_THREE_FINGER_DRAG = SYN_OFFSET(three_finger_drag), SYNAPTICS_SYSCTL_NATURAL_SCROLL = SYN_OFFSET(natural_scroll), #define SYNAPTICS_SYSCTL_LAST SYNAPTICS_SYSCTL_NATURAL_SCROLL }; @@ -3785,6 +3787,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i int vscroll_hor_area, vscroll_ver_area; int two_finger_scroll; int max_x, max_y; + int three_finger_drag; /* Read sysctl. */ /* XXX Verify values? */ @@ -3799,7 +3802,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i two_finger_scroll = sc->syninfo.two_finger_scroll; max_x = sc->syninfo.max_x; max_y = sc->syninfo.max_y; - + three_finger_drag = sc->syninfo.three_finger_drag; /* Read current absolute position. */ x0 = f->x; y0 = f->y; @@ -3888,8 +3891,8 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i ~MOUSE_BUTTON1DOWN) | center_button; } - /* If in tap-hold, add the recorded button. */ - if (gest->in_taphold) + /* If in tap-hold or three fingers, add the recorded button. */ + if (gest->in_taphold || (nfingers == 3 && three_finger_drag)) ms->button |= gest->tap_button; /* @@ -5755,6 +5758,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); break; case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + case SYNAPTICS_SYSCTL_THREE_FINGER_DRAG: case SYNAPTICS_SYSCTL_NATURAL_SCROLL: if (arg < 0 || arg > 1) return (EINVAL); @@ -6147,6 +6151,14 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF, synaptics_sysctl, "I", "Turn off touchpad"); + + sc->syninfo.three_finger_drag = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "three_finger_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, SYNAPTICS_SYSCTL_THREE_FINGER_DRAG, + synaptics_sysctl, "I", + "Enable dragging with three fingers"); /* hw.psm.synaptics.natural_scroll. */ sc->syninfo.natural_scroll = 0; From owner-svn-src-head@freebsd.org Sun Jun 16 05:12:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 558A015B3ACD; Sun, 16 Jun 2019 05:12:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E01F1681E6; Sun, 16 Jun 2019 05:12:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8E349D56; Sun, 16 Jun 2019 05:12:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5G5CHsN014855; Sun, 16 Jun 2019 05:12:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G5CHA5014854; Sun, 16 Jun 2019 05:12:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906160512.x5G5CHA5014854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 16 Jun 2019 05:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349099 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E01F1681E6 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.981,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 05:12:18 -0000 Author: bdrewery Date: Sun Jun 16 05:12:17 2019 New Revision: 349099 URL: https://svnweb.freebsd.org/changeset/base/349099 Log: symlinkat(2) is not covered. Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Sun Jun 16 03:06:05 2019 (r349098) +++ head/share/man/man4/filemon.4 Sun Jun 16 05:12:17 2019 (r349099) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2016 +.Dd June 15, 2019 .Dt FILEMON 4 .Os .Sh NAME @@ -79,8 +79,7 @@ The next log entry may be lacking an absolute path or .It Ql L .Xr link 2 , .Xr linkat 2 , -.Xr symlink 2 , -.Xr symlinkat 2 +.Xr symlink 2 .It Ql M .Xr rename 2 .It Ql R From owner-svn-src-head@freebsd.org Sun Jun 16 09:17:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4984515B85A0; Sun, 16 Jun 2019 09:17:27 +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 E24DC6F29C; Sun, 16 Jun 2019 09:17:26 +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 BCFF6C6AC; Sun, 16 Jun 2019 09:17:26 +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 x5G9HQDT039847; Sun, 16 Jun 2019 09:17:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5G9HQo2039846; Sun, 16 Jun 2019 09:17:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906160917.x5G9HQo2039846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 09:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349100 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E24DC6F29C 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 09:17:27 -0000 Author: emaste Date: Sun Jun 16 09:17:26 2019 New Revision: 349100 URL: https://svnweb.freebsd.org/changeset/base/349100 Log: vtfontcvt: improve BDF and hex font parsing Support larger font sizes. PR: 205707 Submitted by: Dmitry Wagin (original version) MFC after: 2 weeks Event: Berlin Devsummit 2019 Differential Revision: https://reviews.freebsd.org/D20650 Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 05:12:17 2019 (r349099) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 09:17:26 2019 (r349100) @@ -223,119 +223,237 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * return (0); } - +/* + * Right-shift glyph row by _shift_ bits. Row _len_ bits wide, _size_ bytes. + */ static int -parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, - unsigned int dwidth) +rshift_row(uint8_t *line, size_t size, size_t len, size_t shift) { - uint8_t *p; - unsigned int i, subline; + size_t d, s, i; + uint16_t t; - if (dwidth != width && dwidth != width * 2) - errx(1, "Bitmap with unsupported width %u!", dwidth); + assert(size > 0 && len > 0); + assert(size * 8 >= len); - /* Move pixel data right to simplify splitting double characters. */ - line >>= (howmany(dwidth, 8) * 8) - dwidth; + if (shift == 0) + return (0); - for (i = dwidth / width; i > 0; i--) { - p = (i == 2) ? right : left; + d = shift / 8; + s = 8 - shift % 8; + i = howmany(len, 8); - subline = line & ((1 << width) - 1); - subline <<= (howmany(width, 8) * 8) - width; + while (i > 0) { + i--; - if (wbytes == 1) { - *p = subline; - } else if (wbytes == 2) { - *p++ = subline >> 8; - *p = subline; - } else { - errx(1, "Unsupported wbytes %u!", wbytes); - } + t = *(line + i); + *(line + i) = 0; - line >>= width; + t <<= s; + + if (i + d + 1 < size) + *(line + i + d + 1) |= (uint8_t)t; + if (i + d < size) + *(line + i + d) = t >> 8; } + return (0); +} +/* + * Split double-width characters into left and right half. Single-width + * characters in _left_ only. + */ +static int +split_row(uint8_t *left, uint8_t *right, uint8_t *line, size_t w) +{ + size_t s, i; + + s = wbytes * 8 - width; + + memcpy(left, line, wbytes); + *(left + wbytes - 1) &= 0xFF << s; + + if (w > width) { /* Double-width character. */ + uint8_t t; + + for (i = 0; i < wbytes; i++) { + t = *(line + wbytes + i - 1); + t <<= 8 - s; + t |= *(line + wbytes + i) >> s; + *(right + i) = t; + } + *(right + wbytes - 1) &= 0xFF << s; + } return (0); } +static void +set_height(int h) +{ + if (h <= 0 || h > VFNT_MAXDIMENSION) + errx(1, "invalid height %d", h); + height = h; +} + +static void +set_width(int w) +{ + if (w <= 0 || w > VFNT_MAXDIMENSION) + errx(1, "invalid width %d", w); + width = w; + wbytes = howmany(width, 8); +} + static int parse_bdf(FILE *fp, unsigned int map_idx) { - char *ln; + char *line, *ln, *p; size_t length; - uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; - unsigned int curchar = 0, dwidth = 0, i, line; + uint8_t *bytes, *bytes_r; + unsigned int curchar = 0, i, j, linenum = 0, bbwbytes; + int bbw, bbh, bbox, bboy; /* Glyph bounding box. */ + int fbbw = 0, fbbh, fbbox, fbboy; /* Font bounding box. */ + int dwidth = 0, dwy = 0; + int rv; + char spc = '\0'; + /* + * Step 1: Parse FONT logical font descriptor and FONTBOUNDINGBOX + * bounding box. + */ while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; ln[length - 1] = '\0'; - if (strncmp(ln, "ENCODING ", 9) == 0) { - curchar = atoi(ln + 9); + if (strncmp(ln, "FONT ", 5) == 0) { + p = ln + 5; + i = 0; + while ((p = strchr(p, '-')) != NULL) { + p++; + i++; + if (i == 11) { + spc = *p; + break; + } + } + } else if (strncmp(ln, "FONTBOUNDINGBOX ", 16) == 0 && + sscanf(ln + 16, "%d %d %d %d", &fbbw, &fbbh, &fbbox, + &fbboy) == 4) { + set_width(fbbw); + set_height(fbbh); + break; } + } + if (fbbw == 0) + errx(1, "broken font header"); + if (spc != 'c' && spc != 'C') + errx(1, "font spacing \"C\" (character cell) required"); - if (strncmp(ln, "DWIDTH ", 7) == 0) { - dwidth = atoi(ln + 7); + /* Step 2: Validate DWIDTH (Device Width) of all glyphs. */ + while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; + ln[length - 1] = '\0'; + + if (strncmp(ln, "DWIDTH ", 7) == 0 && + sscanf(ln + 7, "%d %d", &dwidth, &dwy) == 2) { + if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) + errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", + dwidth, dwy, linenum); + if (dwidth < fbbw) + set_width(dwidth); } + } - if (strncmp(ln, "BITMAP", 6) == 0 && + /* Step 3: Restart at the beginning of the file and read glyph data. */ + dwidth = bbw = bbh = 0; + rewind(fp); + linenum = 0; + bytes = xmalloc(wbytes * height); + bytes_r = xmalloc(wbytes * height); + line = xmalloc(wbytes * 2); + while ((ln = fgetln(fp, &length)) != NULL) { + linenum++; + ln[length - 1] = '\0'; + + if (strncmp(ln, "ENCODING ", 9) == 0) { + curchar = atoi(ln + 9); + } else if (strncmp(ln, "DWIDTH ", 7) == 0) { + dwidth = atoi(ln + 7); + } else if (strncmp(ln, "BBX ", 4) == 0 && + sscanf(ln + 4, "%d %d %d %d", &bbw, &bbh, &bbox, + &bboy) == 4) { + if (bbw < 1 || bbh < 1 || bbw > fbbw || bbh > fbbh || + bbox < fbbox || bboy < fbboy) + errx(1, "broken bitmap with BBX %d %d %d %d at line %u", + bbw, bbh, bbox, bboy, linenum); + bbwbytes = howmany(bbw, 8); + } else if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + if (dwidth == 0 || bbw == 0 || bbh == 0) + errx(1, "broken char header at line %u!", + linenum); + memset(bytes, 0, wbytes * height); + memset(bytes_r, 0, wbytes * height); + /* - * Assume that the next _height_ lines are bitmap - * data. ENDCHAR is allowed to terminate the bitmap + * Assume that the next _bbh_ lines are bitmap data. + * ENDCHAR is allowed to terminate the bitmap * early but is not otherwise checked; any extra data * is ignored. */ - for (i = 0; i < height; i++) { + for (i = (fbbh + fbboy) - (bbh + bboy); + i < (unsigned int)((fbbh + fbboy) - bboy); i++) { if ((ln = fgetln(fp, &length)) == NULL) - errx(1, "Unexpected EOF!"); + errx(1, "unexpected EOF"); + linenum++; ln[length - 1] = '\0'; - if (strcmp(ln, "ENDCHAR") == 0) { - memset(bytes + i * wbytes, 0, - (height - i) * wbytes); - memset(bytes_r + i * wbytes, 0, - (height - i) * wbytes); + if (strcmp(ln, "ENDCHAR") == 0) break; + if (strlen(ln) < bbwbytes * 2) + errx(1, "broken bitmap at line %u", + linenum); + memset(line, 0, wbytes * 2); + for (j = 0; j < bbwbytes; j++) { + unsigned int val; + if (sscanf(ln + j * 2, "%2x", &val) == + 0) + break; + *(line + j) = (uint8_t)val; } - sscanf(ln, "%x", &line); - if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) - return (1); + + rv = rshift_row(line, wbytes * 2, bbw, + bbox - fbbox); + if (rv != 0) + goto out; + + rv = split_row(bytes + i * wbytes, + bytes_r + i * wbytes, line, dwidth); + if (rv != 0) + goto out; } - if (add_char(curchar, map_idx, bytes, - dwidth == width * 2 ? bytes_r : NULL) != 0) - return (1); + rv = add_char(curchar, map_idx, bytes, + dwidth > (int)width ? bytes_r : NULL); + if (rv != 0) + goto out; + + dwidth = bbw = bbh = 0; } } - return (0); +out: + free(bytes); + free(bytes_r); + free(line); + return (rv); } -static void -set_height(int h) -{ - if (h <= 0 || h > VFNT_MAXDIMENSION) - errx(1, "invalid height %d", h); - height = h; -} - -static void -set_width(int w) -{ - if (w <= 0 || w > VFNT_MAXDIMENSION) - errx(1, "invalid width %d", w); - width = w; - wbytes = howmany(width, 8); -} - static int parse_hex(FILE *fp, unsigned int map_idx) { char *ln, *p; - char fmt_str[8]; size_t length; - uint8_t *bytes = NULL, *bytes_r = NULL; - unsigned curchar = 0, i, line, chars_per_row, dwidth; + uint8_t *bytes = NULL, *bytes_r = NULL, *line = NULL; + unsigned curchar = 0, gwidth, gwbytes, i, j, chars_per_row; int rv = 0; while ((ln = fgetln(fp, &length)) != NULL) { @@ -353,36 +471,46 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); + line = xmalloc(wbytes * 2); } /* ln is guaranteed to have a colon here. */ p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; - dwidth = width; - if (chars_per_row / 2 > (width + 7) / 8) - dwidth *= 2; /* Double-width character. */ - snprintf(fmt_str, sizeof(fmt_str), "%%%ux", - chars_per_row); + if (chars_per_row < wbytes * 2) + errx(1, + "malformed input: broken bitmap, character %06x", + curchar); + gwidth = width * 2; + gwbytes = howmany(width, 8); + if (chars_per_row < gwbytes * 2 || gwidth <= 8) { + gwidth = width; /* Single-width character. */ + gwbytes = wbytes; + } for (i = 0; i < height; i++) { - sscanf(p, fmt_str, &line); - p += chars_per_row; - if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) { - rv = 1; - goto out; + for (j = 0; j < gwbytes; j++) { + unsigned int val; + if (sscanf(p + j * 2, "%2x", &val) == 0) + break; + *(line + j) = (uint8_t)val; } + rv = split_row(bytes + i * wbytes, + bytes_r + i * wbytes, line, gwidth); + if (rv != 0) + goto out; + p += gwbytes * 2; } - if (add_char(curchar, map_idx, bytes, - dwidth == width * 2 ? bytes_r : NULL) != 0) { - rv = 1; + rv = add_char(curchar, map_idx, bytes, + gwidth != width ? bytes_r : NULL); + if (rv != 0) goto out; - } } } out: free(bytes); free(bytes_r); + free(line); return (rv); } From owner-svn-src-head@freebsd.org Sun Jun 16 10:43:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC42215BAF50; Sun, 16 Jun 2019 10:43:19 +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 47FC3747E2; Sun, 16 Jun 2019 10:43:19 +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 1EE69D607; Sun, 16 Jun 2019 10:43:19 +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 x5GAhIIU092237; Sun, 16 Jun 2019 10:43:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GAhIOs092236; Sun, 16 Jun 2019 10:43:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161043.x5GAhIOs092236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 10:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349101 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47FC3747E2 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 10:43:19 -0000 Author: emaste Date: Sun Jun 16 10:43:18 2019 New Revision: 349101 URL: https://svnweb.freebsd.org/changeset/base/349101 Log: vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 uninitialized warning PR: 205707 MFC with: 349100 Event: Berlin Devsummit 2019 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 09:17:26 2019 (r349100) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 10:43:18 2019 (r349101) @@ -367,6 +367,7 @@ parse_bdf(FILE *fp, unsigned int map_idx) dwidth = bbw = bbh = 0; rewind(fp); linenum = 0; + bbwbytes = 0; /* GCC 4.2.1 "may be used uninitialized" workaround. */ bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); line = xmalloc(wbytes * 2); From owner-svn-src-head@freebsd.org Sun Jun 16 11:53:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A63B15BC422; Sun, 16 Jun 2019 11:53:23 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B891F763C1; Sun, 16 Jun 2019 11:53:22 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91022E1D7; Sun, 16 Jun 2019 11:53:22 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GBrMFA028335; Sun, 16 Jun 2019 11:53:22 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GBrMpX028334; Sun, 16 Jun 2019 11:53:22 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201906161153.x5GBrMpX028334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Sun, 16 Jun 2019 11:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349104 - head X-SVN-Group: head X-SVN-Commit-Author: rene X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 349104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B891F763C1 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 11:53:23 -0000 Author: rene (doc,ports committer) Date: Sun Jun 16 11:53:22 2019 New Revision: 349104 URL: https://svnweb.freebsd.org/changeset/base/349104 Log: Differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases. Currently APLHA packages are treated as CURRENT or STABLE versions, resulting in e.g. 13.0.s20190615125609. This version number is indeed different from the next version number but ALPHA2 would be nicer IMO. For the BETA, PRERELEASE and RC phases the packages are versioned the same as for releases, so 11.3-BETA1 is 11.3 and so is 11.3-RC1, meaning that pkg cannot easiliy upgrade from the former the next. This happened on my Raspberry Pi which runs pkgbase. Submitted by: rene Approved by: manu Event: Berlin hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20651 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 16 11:34:56 2019 (r349103) +++ head/Makefile.inc1 Sun Jun 16 11:53:22 2019 (r349104) @@ -553,16 +553,23 @@ VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} .endif .if !defined(PKG_VERSION) -.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} || ${_BRANCH:MALPHA*} +.if ${_BRANCH:MSTABLE*} || ${_BRANCH:MCURRENT*} TIMENOW= %Y%m%d%H%M%S EXTRA_REVISION= .s${TIMENOW:gmtime} -.endif -.if ${_BRANCH:M*-p*} +.elif ${_BRANCH:MALPHA*} +EXTRA_REVISION= _${_BRANCH:C/-ALPHA/.a/} +.elif ${_BRANCH:MBETA*} +EXTRA_REVISION= _${_BRANCH:C/-BETA/.b/} +.elif ${_BRANCH:MRC*} +EXTRA_REVISION= _${_BRANCH:C/-RC/.r/} +.elif ${_BRANCH:MPRERELEASE*} +EXTRA_REVISION= _${_BRANCH:C/-PRERELEASE/.p/} +.elif ${_BRANCH:M*-p*} EXTRA_REVISION= _${_BRANCH:C/.*-p([0-9]+$)/\1/} .endif PKG_VERSION= ${_REVISION}${EXTRA_REVISION} .endif -.endif # !defined(_MKSHOWCONFIG) +.endif # !defined(PKG_VERSION) .if !defined(_MKSHOWCONFIG) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ From owner-svn-src-head@freebsd.org Sun Jun 16 12:26:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ADBF15BDC0C; Sun, 16 Jun 2019 12:26:47 +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 1C25C7758F; Sun, 16 Jun 2019 12:26:47 +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 E504BE705; Sun, 16 Jun 2019 12:26:46 +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 x5GCQk6H044084; Sun, 16 Jun 2019 12:26:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GCQkAf044083; Sun, 16 Jun 2019 12:26:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161226.x5GCQkAf044083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 12:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349105 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C25C7758F 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 12:26:47 -0000 Author: emaste Date: Sun Jun 16 12:26:46 2019 New Revision: 349105 URL: https://svnweb.freebsd.org/changeset/base/349105 Log: vtfontcvt: initialize another variable to quiet GCC warning I believe this case could be triggered by a broken .bdf font. PR: 205707 Reported by: ci.freebsd.org MFC with: 349100 Event: Berlin Devsummit 2019 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 11:53:22 2019 (r349104) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 12:26:46 2019 (r349105) @@ -313,7 +313,7 @@ parse_bdf(FILE *fp, unsigned int map_idx) int bbw, bbh, bbox, bboy; /* Glyph bounding box. */ int fbbw = 0, fbbh, fbbox, fbboy; /* Font bounding box. */ int dwidth = 0, dwy = 0; - int rv; + int rv = -1; char spc = '\0'; /* From owner-svn-src-head@freebsd.org Sun Jun 16 12:44:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3305015BE2B9; Sun, 16 Jun 2019 12:44: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 16F5077EDB; Sun, 16 Jun 2019 12:44: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 DFCDFEA75; Sun, 16 Jun 2019 12:44:49 +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 x5GCinI3054758; Sun, 16 Jun 2019 12:44:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GCin8A054757; Sun, 16 Jun 2019 12:44:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161244.x5GCin8A054757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 12:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349106 - head/share/vt/fonts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/fonts X-SVN-Commit-Revision: 349106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16F5077EDB 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 12:44:51 -0000 Author: emaste Date: Sun Jun 16 12:44:49 2019 New Revision: 349106 URL: https://svnweb.freebsd.org/changeset/base/349106 Log: allow vt(4) fonts to be built from .bdf files vtfontcvt(8) can convert both .bdf and .hex inputs to binary vt(4) .fnt files. Event: Berlin Devsummit 2019 Sponsored by: The FreeBSD Foundation Modified: head/share/vt/fonts/Makefile Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Sun Jun 16 12:26:46 2019 (r349105) +++ head/share/vt/fonts/Makefile Sun Jun 16 12:44:49 2019 (r349106) @@ -13,8 +13,8 @@ FILES= ${FONTS} INDEX.fonts CLEANFILES+= ${FONTS} -.SUFFIXES: .fnt .fnt.uu .hex -.hex.fnt: +.SUFFIXES: .bdf .fnt .fnt.uu .hex +.bdf.fnt .hex.fnt: vtfontcvt ${.IMPSRC} ${.TARGET} FILESDIR= ${SHAREDIR}/vt/fonts From owner-svn-src-head@freebsd.org Sun Jun 16 13:35:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 635A415BF40A; Sun, 16 Jun 2019 13:35:54 +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 013F68166F; Sun, 16 Jun 2019 13:35:54 +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 C32B4F33D; Sun, 16 Jun 2019 13:35:53 +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 x5GDZrYu080710; Sun, 16 Jun 2019 13:35:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GDZrq3080709; Sun, 16 Jun 2019 13:35:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161335.x5GDZrq3080709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 13:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349107 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 013F68166F 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 13:35:54 -0000 Author: emaste Date: Sun Jun 16 13:35:53 2019 New Revision: 349107 URL: https://svnweb.freebsd.org/changeset/base/349107 Log: vtfontcvt: improve .bdf verification Previously we would crash if the BBX y-offset was outside of the font bounding box. Reported by: afl MFC with: r349100 Event: Berlin Devsummit 2019 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 12:44:49 2019 (r349106) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 13:35:53 2019 (r349107) @@ -383,7 +383,8 @@ parse_bdf(FILE *fp, unsigned int map_idx) sscanf(ln + 4, "%d %d %d %d", &bbw, &bbh, &bbox, &bboy) == 4) { if (bbw < 1 || bbh < 1 || bbw > fbbw || bbh > fbbh || - bbox < fbbox || bboy < fbboy) + bbox < fbbox || bboy < fbboy || + bbh + bboy > fbbh + fbboy) errx(1, "broken bitmap with BBX %d %d %d %d at line %u", bbw, bbh, bbox, bboy, linenum); bbwbytes = howmany(bbw, 8); From owner-svn-src-head@freebsd.org Sun Jun 16 13:51:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2317D15BFB43; Sun, 16 Jun 2019 13:51:46 +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 B60DA820D5; Sun, 16 Jun 2019 13:51:45 +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 8E8A8F639; Sun, 16 Jun 2019 13:51:45 +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 x5GDpjag088520; Sun, 16 Jun 2019 13:51:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GDpjgh088519; Sun, 16 Jun 2019 13:51:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161351.x5GDpjgh088519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 13:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349108 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B60DA820D5 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 13:51:46 -0000 Author: emaste Date: Sun Jun 16 13:51:45 2019 New Revision: 349108 URL: https://svnweb.freebsd.org/changeset/base/349108 Log: vtfontcvt: improve .bdf validation Previously if we had a BBX entry that had invalid values (e.g. bounding box outside of font bounding box) and failed sscanf (e.g., because it had fewer than four values) we skipped the BBX value validation and then triggered an assertion failure. Reported by: afl MFC with: r349100 Event: Berlin Devsummit 2019 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 13:35:53 2019 (r349107) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 13:51:45 2019 (r349108) @@ -379,9 +379,10 @@ parse_bdf(FILE *fp, unsigned int map_idx) curchar = atoi(ln + 9); } else if (strncmp(ln, "DWIDTH ", 7) == 0) { dwidth = atoi(ln + 7); - } else if (strncmp(ln, "BBX ", 4) == 0 && - sscanf(ln + 4, "%d %d %d %d", &bbw, &bbh, &bbox, - &bboy) == 4) { + } else if (strncmp(ln, "BBX ", 4) == 0) { + if (sscanf(ln + 4, "%d %d %d %d", &bbw, &bbh, &bbox, + &bboy) != 4) + errx(1, "invalid BBX at line %u", linenum); if (bbw < 1 || bbh < 1 || bbw > fbbw || bbh > fbbh || bbox < fbbox || bboy < fbboy || bbh + bboy > fbbh + fbboy) From owner-svn-src-head@freebsd.org Sun Jun 16 15:14:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA82515C19DE; Sun, 16 Jun 2019 15:14:50 +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 5D90984BA4; Sun, 16 Jun 2019 15:14: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 34CEF18419; Sun, 16 Jun 2019 15:14: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 x5GFEohF033759; Sun, 16 Jun 2019 15:14:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFEokX033758; Sun, 16 Jun 2019 15:14:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906161514.x5GFEokX033758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jun 2019 15:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349111 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D90984BA4 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:14:50 -0000 Author: emaste Date: Sun Jun 16 15:14:49 2019 New Revision: 349111 URL: https://svnweb.freebsd.org/changeset/base/349111 Log: vtfontcvt: correct typo in hex parsing update PR: 205707 Submitted by: Dmitry Wagin MFC with: 349100 Event: Berlin Devsummit 2019 Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 15:11:52 2019 (r349110) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Sun Jun 16 15:14:49 2019 (r349111) @@ -484,7 +484,7 @@ parse_hex(FILE *fp, unsigned int map_idx) "malformed input: broken bitmap, character %06x", curchar); gwidth = width * 2; - gwbytes = howmany(width, 8); + gwbytes = howmany(gwidth, 8); if (chars_per_row < gwbytes * 2 || gwidth <= 8) { gwidth = width; /* Single-width character. */ gwbytes = wbytes; From owner-svn-src-head@freebsd.org Sun Jun 16 15:57:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D03D015C2DFA; Sun, 16 Jun 2019 15:57: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 71473865F6; Sun, 16 Jun 2019 15: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 C8C6F18ACB; Sun, 16 Jun 2019 15:57:00 +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 x5GFv0xL054892; Sun, 16 Jun 2019 15:57:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFv0UO054888; Sun, 16 Jun 2019 15:57:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906161557.x5GFv0UO054888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 15:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349115 - in head/sys: arm/allwinner dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner dev/pwm X-SVN-Commit-Revision: 349115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71473865F6 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:57:02 -0000 Author: ian Date: Sun Jun 16 15:56:59 2019 New Revision: 349115 URL: https://svnweb.freebsd.org/changeset/base/349115 Log: Rename pwmbus.h to ofw_pwm.h, because after all the recent changes, there is nothing left in the file that related to pwmbus at all. It just contains prototypes for the functions implemented in dev/pwm.ofw_pwm.c, so name it accordingly and fix the include protect wrappers to match. A new pwmbus.h will be coming along in a future commit. Added: head/sys/dev/pwm/ofw_pwm.h - copied, changed from r349114, head/sys/dev/pwm/pwmbus.h Deleted: head/sys/dev/pwm/pwmbus.h Modified: head/sys/arm/allwinner/aw_pwm.c head/sys/dev/pwm/ofw_pwm.c head/sys/dev/pwm/pwmbus.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Sun Jun 16 15:34:10 2019 (r349114) +++ head/sys/arm/allwinner/aw_pwm.c Sun Jun 16 15:56:59 2019 (r349115) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include "pwmbus_if.h" #define AW_PWM_CTRL 0x00 Modified: head/sys/dev/pwm/ofw_pwm.c ============================================================================== --- head/sys/dev/pwm/ofw_pwm.c Sun Jun 16 15:34:10 2019 (r349114) +++ head/sys/dev/pwm/ofw_pwm.c Sun Jun 16 15:56:59 2019 (r349115) @@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -#include "pwmbus_if.h" +#include int pwm_get_by_ofw_propidx(device_t consumer, phandle_t node, Copied and modified: head/sys/dev/pwm/ofw_pwm.h (from r349114, head/sys/dev/pwm/pwmbus.h) ============================================================================== --- head/sys/dev/pwm/pwmbus.h Sun Jun 16 15:34:10 2019 (r349114, copy source) +++ head/sys/dev/pwm/ofw_pwm.h Sun Jun 16 15:56:59 2019 (r349115) @@ -28,7 +28,8 @@ * $FreeBSD$ */ -#ifndef _PWMBUS_H_ +#ifndef _OFW_PWM_H_ +#define _OFW_PWM_H_ #include @@ -51,4 +52,4 @@ int pwm_get_by_ofw_property(device_t consumer, phandle int pwm_get_by_ofw_name(device_t consumer, phandle_t node, const char *name, pwm_channel_t *out_channel); -#endif /* _PWMBUS_H_ */ +#endif /* _OFW_PWM_H_ */ Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sun Jun 16 15:34:10 2019 (r349114) +++ head/sys/dev/pwm/pwmbus.c Sun Jun 16 15:56:59 2019 (r349115) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include "pwmbus_if.h" struct pwmbus_channel_data { From owner-svn-src-head@freebsd.org Sun Jun 16 16:02:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A06B15C3044; Sun, 16 Jun 2019 16:02:51 +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 1A135869F9; Sun, 16 Jun 2019 16:02: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 E250618C6A; Sun, 16 Jun 2019 16:02: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 x5GG2oC7059707; Sun, 16 Jun 2019 16:02:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GG2oYj059706; Sun, 16 Jun 2019 16:02:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906161602.x5GG2oYj059706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 16:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349116 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 349116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A135869F9 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 16:02:51 -0000 Author: ian Date: Sun Jun 16 16:02:50 2019 New Revision: 349116 URL: https://svnweb.freebsd.org/changeset/base/349116 Log: In detach(), call bus_generic_detach() before deleting the iicbus child. This gives the bus and its children the chance to return EBUSY to abort the detach if they're in the middle of doing some IO. Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Sun Jun 16 15:56:59 2019 (r349115) +++ head/sys/arm/ti/ti_i2c.c Sun Jun 16 16:02:50 2019 (r349116) @@ -735,8 +735,6 @@ ti_i2c_deactivate(device_t dev) sc->sc_irq_h = NULL; } - bus_generic_detach(sc->sc_dev); - /* Unmap the I2C controller registers. */ if (sc->sc_mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); @@ -925,11 +923,18 @@ ti_i2c_detach(device_t dev) int rv; sc = device_get_softc(dev); - ti_i2c_deactivate(dev); - TI_I2C_LOCK_DESTROY(sc); - if (sc->sc_iicbus && + + if ((rv = bus_generic_detach(dev)) != 0) { + device_printf(dev, "cannot detach child devices\n"); + return (rv); + } + + if (sc->sc_iicbus && (rv = device_delete_child(dev, sc->sc_iicbus)) != 0) return (rv); + + ti_i2c_deactivate(dev); + TI_I2C_LOCK_DESTROY(sc); return (0); } From owner-svn-src-head@freebsd.org Sun Jun 16 16:45:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9542515C3D91; Sun, 16 Jun 2019 16:45:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 346EC87FC2; Sun, 16 Jun 2019 16:45:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0042519309; Sun, 16 Jun 2019 16:45:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GGj1iu081586; Sun, 16 Jun 2019 16:45:01 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GGj12A081585; Sun, 16 Jun 2019 16:45:01 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906161645.x5GGj12A081585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 16 Jun 2019 16:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349117 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 346EC87FC2 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 16:45:02 -0000 Author: alc Date: Sun Jun 16 16:45:01 2019 New Revision: 349117 URL: https://svnweb.freebsd.org/changeset/base/349117 Log: Three enhancements to arm64's pmap_protect(): Implement protection changes on superpage mappings. Previously, a superpage mapping was unconditionally demoted by pmap_protect(), even if the protection change applied to the entire superpage mapping. Precompute the bit mask describing the protection changes rather than recomputing it for every page table entry that is changed. Skip page table entries that already have the requested protection changes in place. Reviewed by: andrew, kib MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D20657 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jun 16 16:02:50 2019 (r349116) +++ head/sys/arm64/arm64/pmap.c Sun Jun 16 16:45:01 2019 (r349117) @@ -2729,6 +2729,51 @@ retry: } /* + * pmap_protect_l2: do the things to protect a 2MB page in a pmap + */ +static void +pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t nbits) +{ + pd_entry_t old_l2; + vm_page_t m, mt; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((sva & L2_OFFSET) == 0, + ("pmap_protect_l2: sva is not 2mpage aligned")); + old_l2 = pmap_load(l2); + KASSERT((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK, + ("pmap_protect_l2: L2e %lx is not a block mapping", old_l2)); + + /* + * Return if the L2 entry already has the desired access restrictions + * in place. + */ + if ((old_l2 | nbits) == old_l2) + return; + + /* + * When a dirty read/write superpage mapping is write protected, + * update the dirty field of each of the superpage's constituent 4KB + * pages. + */ + if ((nbits & ATTR_AP(ATTR_AP_RO)) != 0 && + (old_l2 & ATTR_SW_MANAGED) != 0 && + pmap_page_dirty(old_l2)) { + m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK); + for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) + vm_page_dirty(mt); + } + + pmap_set(l2, nbits); + + /* + * Since a promotion must break the 4KB page mappings before making + * the 2MB page mapping, a pmap_invalidate_page() suffices. + */ + pmap_invalidate_page(pmap, sva); +} + +/* * Set the physical protection on the * specified range of this map as requested. */ @@ -2745,8 +2790,12 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t return; } - if ((prot & (VM_PROT_WRITE | VM_PROT_EXECUTE)) == - (VM_PROT_WRITE | VM_PROT_EXECUTE)) + nbits = 0; + if ((prot & VM_PROT_WRITE) == 0) + nbits |= ATTR_AP(ATTR_AP_RO); + if ((prot & VM_PROT_EXECUTE) == 0) + nbits |= ATTR_XN; + if (nbits == 0) return; PMAP_LOCK(pmap); @@ -2777,9 +2826,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t continue; if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { - l3p = pmap_demote_l2(pmap, l2, sva); - if (l3p == NULL) + if (sva + L2_SIZE == va_next && eva >= va_next) { + pmap_protect_l2(pmap, l2, sva, nbits); continue; + } else if (pmap_demote_l2(pmap, l2, sva) == NULL) + continue; } KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, ("pmap_protect: Invalid L2 entry after demotion")); @@ -2790,8 +2841,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va = va_next; for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { + /* + * Go to the next L3 entry if the current one is + * invalid or already has the desired access + * restrictions in place. (The latter case occurs + * frequently. For example, in a "buildworld" + * workload, almost 1 out of 4 L3 entries already + * have the desired restrictions.) + */ l3 = pmap_load(l3p); - if (!pmap_l3_valid(l3)) { + if (!pmap_l3_valid(l3) || (l3 | nbits) == l3) { if (va != va_next) { pmap_invalidate_range(pmap, va, sva); va = va_next; @@ -2801,17 +2860,14 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if (va == va_next) va = sva; - nbits = 0; - if ((prot & VM_PROT_WRITE) == 0) { - if ((l3 & ATTR_SW_MANAGED) && - pmap_page_dirty(l3)) { - vm_page_dirty(PHYS_TO_VM_PAGE(l3 & - ~ATTR_MASK)); - } - nbits |= ATTR_AP(ATTR_AP_RO); - } - if ((prot & VM_PROT_EXECUTE) == 0) - nbits |= ATTR_XN; + /* + * When a dirty read/write mapping is write protected, + * update the page's dirty field. + */ + if ((nbits & ATTR_AP(ATTR_AP_RO)) != 0 && + (l3 & ATTR_SW_MANAGED) != 0 && + pmap_page_dirty(l3)) + vm_page_dirty(PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK)); pmap_set(l3p, nbits); } From owner-svn-src-head@freebsd.org Sun Jun 16 17:32:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A42D15C524A; Sun, 16 Jun 2019 17:32:06 +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 D257389A01; Sun, 16 Jun 2019 17:32:05 +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 9C03619B2B; Sun, 16 Jun 2019 17:32:05 +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 x5GHW5ur005957; Sun, 16 Jun 2019 17:32:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GHW5Fv005941; Sun, 16 Jun 2019 17:32:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201906161732.x5GHW5Fv005941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 16 Jun 2019 17:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349118 - head/usr.sbin/iostat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/iostat X-SVN-Commit-Revision: 349118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D257389A01 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 17:32:06 -0000 Author: trasz Date: Sun Jun 16 17:32:05 2019 New Revision: 349118 URL: https://svnweb.freebsd.org/changeset/base/349118 Log: In iostat(8) output, skip the decimal point and the fractional part for tps >= 100 and MB/s >= 1000, to prevent them for widening too much. MFC after: 2 weeks Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Sun Jun 16 16:45:01 2019 (r349117) +++ head/usr.sbin/iostat/iostat.c Sun Jun 16 17:32:05 2019 (r349118) @@ -945,9 +945,11 @@ devstats(int perf_select, long double etime, int havel ms_per_transaction); } else { if (Iflag == 0) - printf(" %4.1Lf %4.0Lf %5.1Lf ", + printf(" %4.*Lf %4.0Lf %5.*Lf ", + kb_per_transfer >= 100 ? 0 : 1, kb_per_transfer, transfers_per_second, + mb_per_second >= 1000 ? 0 : 1, mb_per_second); else { total_mb = total_bytes; From owner-svn-src-head@freebsd.org Sun Jun 16 19:44:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31E5015C7AA7; Sun, 16 Jun 2019 19:44:44 +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 C6D0F8D0F0; Sun, 16 Jun 2019 19:44:43 +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 9A2701B158; Sun, 16 Jun 2019 19:44:43 +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 x5GJihC9075222; Sun, 16 Jun 2019 19:44:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GJihLZ075220; Sun, 16 Jun 2019 19:44:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906161944.x5GJihLZ075220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Jun 2019 19:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349119 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6D0F8D0F0 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.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 19:44:44 -0000 Author: ian Date: Sun Jun 16 19:44:42 2019 New Revision: 349119 URL: https://svnweb.freebsd.org/changeset/base/349119 Log: Rework pwmbus and pwmc so that each child will handle a single PWM channel. Previously, there was a pwmc instance for each instance of pwm hardware regardless of how many pwm channels that hardware supported. Now there will be a pwmc instance for each channel when the hardware supports multiple channels. With a separate instance for each channel, we can have "named channels" in userland by making devfs alias entries in /dev/pwm. These changes add support for ivars to pwmbus, and use an ivar to track the channel number for each child. It also adds support for hinted children. In pwmc, the driver checks for a label hint, and if present, it's used to create an alias for the cdev in /dev/pwm. It's not anticipated that hints will be heavily used, but it's easy to do and allows quick ad-hoc creation of named channels from userland by using kenv to create hint.pwmc.N.label= hints. Upcoming changes will add FDT support, and most labels will probably be specified that way. Added: head/sys/dev/pwm/pwmbus.h (contents, props changed) Modified: head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Sun Jun 16 17:32:05 2019 (r349118) +++ head/sys/dev/pwm/pwmbus.c Sun Jun 16 19:44:42 2019 (r349119) @@ -37,28 +37,131 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include +#include #include "pwmbus_if.h" -struct pwmbus_channel_data { - int reserved; - char *name; -}; - struct pwmbus_softc { device_t dev; - device_t parent; - u_int nchannels; }; +/* + * bus_if methods... + */ + +static device_t +pwmbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct pwmbus_ivars *ivars; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + + ivars = malloc(sizeof(struct pwmbus_ivars), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivars == NULL) { + device_delete_child(dev, child); + return (NULL); + } + device_set_ivars(child, ivars); + + return (child); +} + static int -pwmbus_probe(device_t dev) +pwmbus_child_location_str(device_t dev, device_t child, char *buf, size_t blen) { + struct pwmbus_ivars *ivars; + ivars = device_get_ivars(child); + snprintf(buf, blen, "hwdev=%s channel=%u", + device_get_nameunit(device_get_parent(dev)), ivars->pi_channel); + + return (0); +} + +static int +pwmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + *buf = '\0'; + return (0); +} + +static void +pwmbus_hinted_child(device_t dev, const char *dname, int dunit) +{ + struct pwmbus_ivars *ivars; + device_t child; + + child = pwmbus_add_child(dev, 0, dname, dunit); + + /* + * If there is a channel hint, use it. Otherwise pi_channel was + * initialized to zero, so that's the channel we'll use. + */ + ivars = device_get_ivars(child); + resource_int_value(dname, dunit, "channel", &ivars->pi_channel); +} + +static int +pwmbus_print_child(device_t dev, device_t child) +{ + struct pwmbus_ivars *ivars; + int rv; + + ivars = device_get_ivars(child); + + rv = bus_print_child_header(dev, child); + rv += printf(" channel %u", ivars->pi_channel); + rv += bus_print_child_footer(dev, child); + + return (rv); +} + +static void +pwmbus_probe_nomatch(device_t dev, device_t child) +{ + struct pwmbus_ivars *ivars; + + ivars = device_get_ivars(child); + if (ivars != NULL) + device_printf(dev, " on channel %u\n", + ivars->pi_channel); + + return; +} + +static int +pwmbus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct pwmbus_ivars *ivars; + + ivars = device_get_ivars(child); + + switch (which) { + case PWMBUS_IVAR_CHANNEL: + *(u_int *)result = ivars->pi_channel; + break; + default: + return (EINVAL); + } + + return (0); +} + +/* + * device_if methods... + */ + +static int +pwmbus_probe(device_t dev) +{ device_set_desc(dev, "PWM bus"); return (BUS_PROBE_GENERIC); } @@ -67,20 +170,33 @@ static int pwmbus_attach(device_t dev) { struct pwmbus_softc *sc; + struct pwmbus_ivars *ivars; + device_t child, parent; + u_int chan; sc = device_get_softc(dev); sc->dev = dev; - sc->parent = device_get_parent(dev); + parent = device_get_parent(dev); - if (PWMBUS_CHANNEL_COUNT(sc->parent, &sc->nchannels) != 0 || + if (PWMBUS_CHANNEL_COUNT(parent, &sc->nchannels) != 0 || sc->nchannels == 0) { device_printf(sc->dev, "No channels on parent %s\n", - device_get_nameunit(sc->parent)); + device_get_nameunit(parent)); return (ENXIO); } - device_add_child(sc->dev, "pwmc", -1); + /* Add a pwmc(4) child for each channel. */ + for (chan = 0; chan < sc->nchannels; ++chan) { + if ((child = pwmbus_add_child(sc->dev, 0, "pwmc", -1)) == NULL) { + device_printf(dev, "failed to add pwmc child device " + "for channel %u\n", chan); + continue; + } + ivars = device_get_ivars(child); + ivars->pi_channel = chan; + } + bus_enumerate_hinted_children(dev); bus_generic_probe(dev); return (bus_generic_attach(dev)); @@ -97,6 +213,10 @@ pwmbus_detach(device_t dev) return (rv); } +/* + * pwmbus_if methods... + */ + static int pwmbus_channel_config(device_t dev, u_int chan, u_int period, u_int duty) { @@ -145,6 +265,15 @@ static device_method_t pwmbus_methods[] = { DEVMETHOD(device_attach, pwmbus_attach), DEVMETHOD(device_detach, pwmbus_detach), + /* bus_if */ + DEVMETHOD(bus_add_child, pwmbus_add_child), + DEVMETHOD(bus_child_location_str, pwmbus_child_location_str), + DEVMETHOD(bus_child_pnpinfo_str, pwmbus_child_pnpinfo_str), + DEVMETHOD(bus_hinted_child, pwmbus_hinted_child), + DEVMETHOD(bus_print_child, pwmbus_print_child), + DEVMETHOD(bus_probe_nomatch, pwmbus_probe_nomatch), + DEVMETHOD(bus_read_ivar, pwmbus_read_ivar), + /* pwmbus_if */ DEVMETHOD(pwmbus_channel_count, pwmbus_channel_count), DEVMETHOD(pwmbus_channel_config, pwmbus_channel_config), @@ -157,13 +286,13 @@ static device_method_t pwmbus_methods[] = { DEVMETHOD_END }; -static driver_t pwmbus_driver = { +driver_t pwmbus_driver = { "pwmbus", pwmbus_methods, sizeof(struct pwmbus_softc), }; -static devclass_t pwmbus_devclass; +devclass_t pwmbus_devclass; EARLY_DRIVER_MODULE(pwmbus, pwm, pwmbus_driver, pwmbus_devclass, 0, 0, - BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(pwmbus, 1); Added: head/sys/dev/pwm/pwmbus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pwm/pwmbus.h Sun Jun 16 19:44:42 2019 (r349119) @@ -0,0 +1,62 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * 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 _PWMBUS_H_ +#define _PWMBUS_H_ + +struct pwmbus_ivars { + u_int pi_channel; +}; + +enum { + PWMBUS_IVAR_CHANNEL, /* Channel used by child dev */ +}; + +#define PWMBUS_ACCESSOR(A, B, T) \ +static inline int \ +pwmbus_get_ ## A(device_t dev, T *t) \ +{ \ + return BUS_READ_IVAR(device_get_parent(dev), dev, \ + PWMBUS_IVAR_ ## B, (uintptr_t *) t); \ +} \ +static inline int \ +pwmbus_set_ ## A(device_t dev, T t) \ +{ \ + return BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + PWMBUS_IVAR_ ## B, (uintptr_t) t); \ +} + +PWMBUS_ACCESSOR(channel, CHANNEL, u_int) + +extern driver_t pwmbus_driver; +extern devclass_t pwmbus_devclass; +extern driver_t ofw_pwmbus_driver; +extern devclass_t ofw_pwmbus_devclass; + +#endif /* _PWMBUS_H_ */ Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sun Jun 16 17:32:05 2019 (r349118) +++ head/sys/dev/pwm/pwmc.c Sun Jun 16 19:44:42 2019 (r349119) @@ -37,14 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "pwmbus_if.h" struct pwmc_softc { device_t dev; - struct cdev *pwm_dev; - char name[32]; + struct cdev *cdev; + u_int chan; }; static int @@ -68,19 +69,19 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, break; case PWMSETSTATE: bcopy(data, &state, sizeof(state)); - rv = PWMBUS_CHANNEL_CONFIG(bus, state.channel, + rv = PWMBUS_CHANNEL_CONFIG(bus, sc->chan, state.period, state.duty); if (rv == 0) - rv = PWMBUS_CHANNEL_ENABLE(bus, state.channel, + rv = PWMBUS_CHANNEL_ENABLE(bus, sc->chan, state.enable); break; case PWMGETSTATE: bcopy(data, &state, sizeof(state)); - rv = PWMBUS_CHANNEL_GET_CONFIG(bus, state.channel, + rv = PWMBUS_CHANNEL_GET_CONFIG(bus, sc->chan, &state.period, &state.duty); if (rv != 0) return (rv); - rv = PWMBUS_CHANNEL_IS_ENABLED(bus, state.channel, + rv = PWMBUS_CHANNEL_IS_ENABLED(bus, sc->chan, &state.enable); if (rv != 0) return (rv); @@ -93,7 +94,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, static struct cdevsw pwm_cdevsw = { .d_version = D_VERSION, - .d_name = "pwm", + .d_name = "pwmc", .d_ioctl = pwm_ioctl }; @@ -101,7 +102,7 @@ static int pwmc_probe(device_t dev) { - device_set_desc(dev, "PWM Controller"); + device_set_desc(dev, "PWM Control"); return (BUS_PROBE_NOWILDCARD); } @@ -110,22 +111,35 @@ pwmc_attach(device_t dev) { struct pwmc_softc *sc; struct make_dev_args args; + const char *label; + int error; sc = device_get_softc(dev); sc->dev = dev; - snprintf(sc->name, sizeof(sc->name), "pwmc%d", device_get_unit(dev)); + if ((error = pwmbus_get_channel(dev, &sc->chan)) != 0) + return (error); + make_dev_args_init(&args); args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; args.mda_devsw = &pwm_cdevsw; args.mda_uid = UID_ROOT; args.mda_gid = GID_OPERATOR; - args.mda_mode = 0600; + args.mda_mode = 0660; args.mda_si_drv1 = sc; - if (make_dev_s(&args, &sc->pwm_dev, "%s", sc->name) != 0) { + error = make_dev_s(&args, &sc->cdev, "pwmc%d.%d", + device_get_unit(device_get_parent(dev)), sc->chan); + if (error != 0) { device_printf(dev, "Failed to make PWM device\n"); - return (ENXIO); + return (error); } + + /* If there is a label hint, create an alias with that name. */ + if (resource_string_value(device_get_name(dev), device_get_unit(dev), + "label", &label) == 0) { + make_dev_alias(sc->cdev, "pwm/%s", label); + } + return (0); } @@ -135,7 +149,7 @@ pwmc_detach(device_t dev) struct pwmc_softc *sc; sc = device_get_softc(dev); - destroy_dev(sc->pwm_dev); + destroy_dev(sc->cdev); return (0); } From owner-svn-src-head@freebsd.org Sun Jun 16 20:01:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB61E15C7F30; Sun, 16 Jun 2019 20:01:46 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0898D83E; Sun, 16 Jun 2019 20:01:46 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 562971B35D; Sun, 16 Jun 2019 20:01:46 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GK1kDt082266; Sun, 16 Jun 2019 20:01:46 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GK1k1T082265; Sun, 16 Jun 2019 20:01:46 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201906162001.x5GK1k1T082265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Sun, 16 Jun 2019 20:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349120 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 349120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B0898D83E 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 20:01:47 -0000 Author: antoine Date: Sun Jun 16 20:01:45 2019 New Revision: 349120 URL: https://svnweb.freebsd.org/changeset/base/349120 Log: Remove tabs from BSD.var.dist Reported by: zeising Modified: head/etc/mtree/BSD.var.dist Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Sun Jun 16 19:44:42 2019 (r349119) +++ head/etc/mtree/BSD.var.dist Sun Jun 16 20:01:45 2019 (r349120) @@ -84,7 +84,7 @@ rwho gname=daemon mode=0775 .. spool - clientmqueue uname=smmsp gname=smmsp mode=0770 tags=package=sendmail + clientmqueue uname=smmsp gname=smmsp mode=0770 tags=package=sendmail .. dma uname=root gname=mail mode=0770 tags=package=dma .. @@ -93,9 +93,9 @@ /set gname=daemon lpd .. - mqueue tags=package=sendmail + mqueue tags=package=sendmail .. - opielocks mode=0700 + opielocks mode=0700 .. output lpd From owner-svn-src-head@freebsd.org Sun Jun 16 21:56:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2BDE15CB5CA; Sun, 16 Jun 2019 21:56:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D38F6B2A7; Sun, 16 Jun 2019 21:56:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1289D1C71E; Sun, 16 Jun 2019 21:56:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GLujaB044708; Sun, 16 Jun 2019 21:56:45 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GLuj8W044707; Sun, 16 Jun 2019 21:56:45 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201906162156.x5GLuj8W044707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 16 Jun 2019 21:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349121 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 349121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D38F6B2A7 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.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 21:56:46 -0000 Author: nwhitehorn Date: Sun Jun 16 21:56:45 2019 New Revision: 349121 URL: https://svnweb.freebsd.org/changeset/base/349121 Log: Fix bug on newbus device deletion: we should delete the child's devinfo on deletion, not the parent's. MFC after: 3 weeks Modified: head/sys/powerpc/ofw/ofw_pcibus.c Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Sun Jun 16 20:01:45 2019 (r349120) +++ head/sys/powerpc/ofw/ofw_pcibus.c Sun Jun 16 21:56:45 2019 (r349121) @@ -294,7 +294,7 @@ ofw_pcibus_child_deleted(device_t dev, device_t child) { struct ofw_pcibus_devinfo *dinfo; - dinfo = device_get_ivars(dev); + dinfo = device_get_ivars(child); ofw_bus_gen_destroy_devinfo(&dinfo->opd_obdinfo); pci_child_deleted(dev, child); } From owner-svn-src-head@freebsd.org Sun Jun 16 22:13:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C951E15CBA99; Sun, 16 Jun 2019 22:13:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9DC6BA1B; Sun, 16 Jun 2019 22:13:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42F7B1CA61; Sun, 16 Jun 2019 22:13:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GMDSQR054731; Sun, 16 Jun 2019 22:13:28 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GMDSRd054730; Sun, 16 Jun 2019 22:13:28 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906162213.x5GMDSRd054730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 16 Jun 2019 22:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349122 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D9DC6BA1B 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 22:13:29 -0000 Author: alc Date: Sun Jun 16 22:13:27 2019 New Revision: 349122 URL: https://svnweb.freebsd.org/changeset/base/349122 Log: Three changes to arm64's pmap_unwire(): Implement wiring changes on superpage mappings. Previously, a superpage mapping was unconditionally demoted by pmap_unwire(), even if the wiring change applied to the entire superpage mapping. Rewrite a comment to use the arm64 names for bits in a page table entry. Previously, the bits were referred to by their x86 names. Use atomic_"op"_64() instead of atomic_"op"_long() to update a page table entry in order to match the prevailing style in this file. MFC after: 10 days Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jun 16 21:56:45 2019 (r349121) +++ head/sys/arm64/arm64/pmap.c Sun Jun 16 22:13:27 2019 (r349122) @@ -3767,9 +3767,21 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t continue; if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { - l3 = pmap_demote_l2(pmap, l2, sva); - if (l3 == NULL) + if ((pmap_load(l2) & ATTR_SW_WIRED) == 0) + panic("pmap_unwire: l2 %#jx is missing " + "ATTR_SW_WIRED", (uintmax_t)pmap_load(l2)); + + /* + * Are we unwiring the entire large page? If not, + * demote the mapping and fall through. + */ + if (sva + L2_SIZE == va_next && eva >= va_next) { + atomic_clear_64(l2, ATTR_SW_WIRED); + pmap_resident_count_dec(pmap, L2_SIZE / + PAGE_SIZE); continue; + } else if (pmap_demote_l2(pmap, l2, sva) == NULL) + panic("pmap_unwire: demotion failed"); } KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, ("pmap_unwire: Invalid l2 entry after demotion")); @@ -3785,11 +3797,11 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t "ATTR_SW_WIRED", (uintmax_t)pmap_load(l3)); /* - * PG_W must be cleared atomically. Although the pmap - * lock synchronizes access to PG_W, another processor - * could be setting PG_M and/or PG_A concurrently. + * ATTR_SW_WIRED must be cleared atomically. Although + * the pmap lock synchronizes access to ATTR_SW_WIRED, + * the System MMU may write to the entry concurrently. */ - atomic_clear_long(l3, ATTR_SW_WIRED); + atomic_clear_64(l3, ATTR_SW_WIRED); pmap->pm_stats.wired_count--; } } From owner-svn-src-head@freebsd.org Mon Jun 17 01:58:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4055615D00BB; Mon, 17 Jun 2019 01:58:26 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D796F71624; Mon, 17 Jun 2019 01:58:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B049B1EED8; Mon, 17 Jun 2019 01:58:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H1wP0Y069558; Mon, 17 Jun 2019 01:58:25 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H1wPKv069557; Mon, 17 Jun 2019 01:58:25 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906170158.x5H1wPKv069557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 17 Jun 2019 01:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349129 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D796F71624 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.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 01:58:26 -0000 Author: alc Date: Mon Jun 17 01:58:25 2019 New Revision: 349129 URL: https://svnweb.freebsd.org/changeset/base/349129 Log: Eliminate a redundant call to pmap_invalidate_page() from pmap_ts_referenced(). MFC after: 14 days Differential Revision: https://reviews.freebsd.org/D12725 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Jun 17 00:58:49 2019 (r349128) +++ head/sys/arm64/arm64/pmap.c Mon Jun 17 01:58:25 2019 (r349129) @@ -4644,7 +4644,6 @@ small_mappings: */ pmap_remove_l3(pmap, pte, pv->pv_va, tpde, &free, &lock); - pmap_invalidate_page(pmap, pv->pv_va); cleared++; if (pvf == pv) pvf = NULL; From owner-svn-src-head@freebsd.org Mon Jun 17 03:32:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A53FA15D1CE0; Mon, 17 Jun 2019 03:32:07 +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 467807447F; Mon, 17 Jun 2019 03:32:07 +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 20BA320004; Mon, 17 Jun 2019 03:32:07 +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 x5H3W77A020464; Mon, 17 Jun 2019 03:32:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H3W5WC020459; Mon, 17 Jun 2019 03:32:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906170332.x5H3W5WC020459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 03:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349130 - in head/sys: conf dev/pwm modules/pwm/pwmbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: conf dev/pwm modules/pwm/pwmbus X-SVN-Commit-Revision: 349130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 467807447F 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 03:32:07 -0000 Author: ian Date: Mon Jun 17 03:32:05 2019 New Revision: 349130 URL: https://svnweb.freebsd.org/changeset/base/349130 Log: Add ofw_pwmbus to enumerate pwmbus devices on systems configured with fdt data. Also, add fdt support to pwmc. Added: head/sys/dev/pwm/ofw_pwmbus.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmbus.h head/sys/dev/pwm/pwmc.c head/sys/modules/pwm/pwmbus/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 17 01:58:25 2019 (r349129) +++ head/sys/conf/files Mon Jun 17 03:32:05 2019 (r349130) @@ -2704,6 +2704,7 @@ dev/pwm/pwmc.c optional pwm | pwmc dev/pwm/pwmbus.c optional pwm | pwmbus dev/pwm/pwmbus_if.m optional pwm | pwmbus dev/pwm/ofw_pwm.c optional pwm fdt | pwmbus fdt +dev/pwm/ofw_pwmbus.c optional pwm fdt | pwmbus fdt dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral Added: head/sys/dev/pwm/ofw_pwmbus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pwm/ofw_pwmbus.c Mon Jun 17 03:32:05 2019 (r349130) @@ -0,0 +1,223 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * 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 "pwmbus_if.h" + +struct ofw_pwmbus_ivars { + struct pwmbus_ivars base; + struct ofw_bus_devinfo devinfo; +}; + +struct ofw_pwmbus_softc { + struct pwmbus_softc base; +}; + +/* + * bus_if methods... + */ + +static device_t +ofw_pwmbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct ofw_pwmbus_ivars *ivars; + + if ((ivars = malloc(sizeof(struct ofw_pwmbus_ivars), M_DEVBUF, + M_NOWAIT | M_ZERO)) == NULL) { + return (NULL); + } + + if ((child = device_add_child_ordered(dev, order, name, unit)) == NULL) { + free(ivars, M_DEVBUF); + return (NULL); + } + + ivars->devinfo.obd_node = -1; + device_set_ivars(child, ivars); + + return (child); +} + +static void +ofw_pwmbus_child_deleted(device_t dev, device_t child) +{ + struct ofw_pwmbus_ivars *ivars; + + ivars = device_get_ivars(child); + if (ivars != NULL) { + ofw_bus_gen_destroy_devinfo(&ivars->devinfo); + free(ivars, M_DEVBUF); + } +} + +static const struct ofw_bus_devinfo * +ofw_pwmbus_get_devinfo(device_t bus, device_t dev) +{ + struct ofw_pwmbus_ivars *ivars; + + ivars = device_get_ivars(dev); + return (&ivars->devinfo); +} + +/* + * device_if methods... + */ + +static int +ofw_pwmbus_probe(device_t dev) +{ + + if (ofw_bus_get_node(dev) == -1) { + return (ENXIO); + } + device_set_desc(dev, "OFW PWM bus"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ofw_pwmbus_attach(device_t dev) +{ + struct ofw_pwmbus_softc *sc; + struct ofw_pwmbus_ivars *ivars; + phandle_t node; + device_t child, parent; + pcell_t chan; + bool any_children; + + sc = device_get_softc(dev); + sc->base.dev = dev; + parent = device_get_parent(dev); + + if (PWMBUS_CHANNEL_COUNT(parent, &sc->base.nchannels) != 0 || + sc->base.nchannels == 0) { + device_printf(dev, "No channels on parent %s\n", + device_get_nameunit(parent)); + return (ENXIO); + } + + /* + * Attach the children found in the fdt node of the hardware controller. + * Hardware controllers must implement the ofw_bus_get_node method so + * that our call to ofw_bus_get_node() gets back the controller's node. + */ + any_children = false; + node = ofw_bus_get_node(dev); + for (node = OF_child(node); node != 0; node = OF_peer(node)) { + /* + * The child has to have a reg property; its value is the + * channel number so range-check it. + */ + if (OF_getencprop(node, "reg", &chan, sizeof(chan)) == -1) + continue; + if (chan >= sc->base.nchannels) + continue; + + if ((child = ofw_pwmbus_add_child(dev, 0, NULL, -1)) == NULL) + continue; + + ivars = device_get_ivars(child); + ivars->base.pi_channel = chan; + + /* Set up the standard ofw devinfo. */ + if (ofw_bus_gen_setup_devinfo(&ivars->devinfo, node) != 0) { + device_delete_child(dev, child); + continue; + } + any_children = true; + } + + /* + * If we didn't find any children in the fdt data, add a pwmc(4) child + * for each channel, like the base pwmbus does. The idea is that if + * there is any fdt data, then we do exactly what it says and nothing + * more, otherwise we just provide generic userland access to all the + * pwm channels that exist like the base pwmbus's attach code does. + */ + if (!any_children) { + for (chan = 0; chan < sc->base.nchannels; ++chan) { + child = ofw_pwmbus_add_child(dev, 0, "pwmc", -1); + if (child == NULL) { + device_printf(dev, "failed to add pwmc child " + " device for channel %u\n", chan); + continue; + } + ivars = device_get_ivars(child); + ivars->base.pi_channel = chan; + } + } + bus_enumerate_hinted_children(dev); + bus_generic_probe(dev); + + return (bus_generic_attach(dev)); +} + +static device_method_t ofw_pwmbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_pwmbus_probe), + DEVMETHOD(device_attach, ofw_pwmbus_attach), + + /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_add_child, ofw_pwmbus_add_child), + DEVMETHOD(bus_child_deleted, ofw_pwmbus_child_deleted), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_pwmbus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +devclass_t ofw_pwmbus_devclass; + +DEFINE_CLASS_1(pwmbus, ofw_pwmbus_driver, ofw_pwmbus_methods, + sizeof(struct pwmbus_softc), pwmbus_driver); +EARLY_DRIVER_MODULE(ofw_pwmbus, pwm, ofw_pwmbus_driver, ofw_pwmbus_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(ofw_pwmbus, 1); +MODULE_DEPEND(ofw_pwmbus, pwmbus, 1, 1, 1); Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Mon Jun 17 01:58:25 2019 (r349129) +++ head/sys/dev/pwm/pwmbus.c Mon Jun 17 03:32:05 2019 (r349130) @@ -44,11 +44,6 @@ __FBSDID("$FreeBSD$"); #include "pwmbus_if.h" -struct pwmbus_softc { - device_t dev; - u_int nchannels; -}; - /* * bus_if methods... */ Modified: head/sys/dev/pwm/pwmbus.h ============================================================================== --- head/sys/dev/pwm/pwmbus.h Mon Jun 17 01:58:25 2019 (r349129) +++ head/sys/dev/pwm/pwmbus.h Mon Jun 17 03:32:05 2019 (r349130) @@ -30,6 +30,11 @@ #ifndef _PWMBUS_H_ #define _PWMBUS_H_ +struct pwmbus_softc { + device_t dev; + u_int nchannels; +}; + struct pwmbus_ivars { u_int pi_channel; }; @@ -53,6 +58,12 @@ pwmbus_set_ ## A(device_t dev, T t) \ } PWMBUS_ACCESSOR(channel, CHANNEL, u_int) + +#ifdef FDT +#define PWMBUS_FDT_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, pwmbus) +#else +#define PWMBUS_FDT_PNP_INFO(t) +#endif extern driver_t pwmbus_driver; extern devclass_t pwmbus_devclass; Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Mon Jun 17 01:58:25 2019 (r349129) +++ head/sys/dev/pwm/pwmc.c Mon Jun 17 03:32:05 2019 (r349130) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -42,6 +44,20 @@ __FBSDID("$FreeBSD$"); #include "pwmbus_if.h" +#ifdef FDT +#include +#include +#include + +static struct ofw_compat_data compat_data[] = { + {"freebsd,pwmc", true}, + {NULL, false}, +}; + +PWMBUS_FDT_PNP_INFO(compat_data); + +#endif + struct pwmc_softc { device_t dev; struct cdev *cdev; @@ -98,12 +114,52 @@ static struct cdevsw pwm_cdevsw = { .d_ioctl = pwm_ioctl }; +#ifdef FDT + +static void +pwmc_setup_label(struct pwmc_softc *sc) +{ + void *label; + + if (OF_getprop_alloc(ofw_bus_get_node(sc->dev), "label", &label) > 0) { + make_dev_alias(sc->cdev, "pwm/%s", (char *)label); + OF_prop_free(label); + } +} + +#else /* FDT */ + +static void +pwmc_setup_label(struct pwmc_softc *sc) +{ + char *label; + + if (resource_string_value(device_get_name(sc->dev), + device_get_unit(sc->dev), "label", &label) == 0) { + make_dev_alias(sc->cdev, "pwm/%s", label); + } +} + +#endif /* FDT */ + static int pwmc_probe(device_t dev) { + int rv; + rv = BUS_PROBE_NOWILDCARD; + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + rv = BUS_PROBE_DEFAULT; + } +#endif + device_set_desc(dev, "PWM Control"); - return (BUS_PROBE_NOWILDCARD); + return (rv); } static int @@ -111,7 +167,6 @@ pwmc_attach(device_t dev) { struct pwmc_softc *sc; struct make_dev_args args; - const char *label; int error; sc = device_get_softc(dev); @@ -134,11 +189,7 @@ pwmc_attach(device_t dev) return (error); } - /* If there is a label hint, create an alias with that name. */ - if (resource_string_value(device_get_name(dev), device_get_unit(dev), - "label", &label) == 0) { - make_dev_alias(sc->cdev, "pwm/%s", label); - } + pwmc_setup_label(sc); return (0); } Modified: head/sys/modules/pwm/pwmbus/Makefile ============================================================================== --- head/sys/modules/pwm/pwmbus/Makefile Mon Jun 17 01:58:25 2019 (r349129) +++ head/sys/modules/pwm/pwmbus/Makefile Mon Jun 17 03:32:05 2019 (r349130) @@ -6,7 +6,7 @@ KMOD= pwmbus SRCS= pwmbus.c .if !empty(OPT_FDT) -SRCS+= ofw_pwm.c ofw_bus_if.h +SRCS+= ofw_pwm.c ofw_pwmbus.c ofw_bus_if.h .endif # Generated files... From owner-svn-src-head@freebsd.org Mon Jun 17 03:40:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5945F15D2109; Mon, 17 Jun 2019 03:40: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 0002D74AE5; Mon, 17 Jun 2019 03:40:00 +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 CE3BE20036; Mon, 17 Jun 2019 03:40:00 +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 x5H3e0js023121; Mon, 17 Jun 2019 03:40:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H3e04g023120; Mon, 17 Jun 2019 03:40:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906170340.x5H3e04g023120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 03:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349131 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 349131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0002D74AE5 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 03:40:01 -0000 Author: ian Date: Mon Jun 17 03:40:00 2019 New Revision: 349131 URL: https://svnweb.freebsd.org/changeset/base/349131 Log: Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can find its metadata for instantiating children. Modified: head/sys/arm/allwinner/aw_pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Mon Jun 17 03:32:05 2019 (r349130) +++ head/sys/arm/allwinner/aw_pwm.c Mon Jun 17 03:40:00 2019 (r349131) @@ -223,6 +223,17 @@ aw_pwm_detach(device_t dev) return (0); } +static phandle_t +aw_pwm_get_node(device_t bus, device_t dev) +{ + + /* + * Share our controller node with our pwmbus child; it instantiates + * devices by walking the children contained within our node. + */ + return ofw_bus_get_node(bus); +} + static int aw_pwm_channel_count(device_t dev, u_int *nchannel) { @@ -349,6 +360,9 @@ static device_method_t aw_pwm_methods[] = { DEVMETHOD(device_probe, aw_pwm_probe), DEVMETHOD(device_attach, aw_pwm_attach), DEVMETHOD(device_detach, aw_pwm_detach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, aw_pwm_get_node), /* pwmbus interface */ DEVMETHOD(pwmbus_channel_count, aw_pwm_channel_count), From owner-svn-src-head@freebsd.org Mon Jun 17 03:48:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BBCD15D2381; Mon, 17 Jun 2019 03:48:45 +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 E181374F7F; Mon, 17 Jun 2019 03:48:44 +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 B7E71201D6; Mon, 17 Jun 2019 03:48:44 +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 x5H3miYS028045; Mon, 17 Jun 2019 03:48:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H3mi6B028044; Mon, 17 Jun 2019 03:48:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906170348.x5H3mi6B028044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 03:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349132 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E181374F7F 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.981,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 03:48:45 -0000 Author: ian Date: Mon Jun 17 03:48:44 2019 New Revision: 349132 URL: https://svnweb.freebsd.org/changeset/base/349132 Log: Add back a const qualifier I somehow fumbled away between test-building and committing recent changes. Modified: head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Mon Jun 17 03:40:00 2019 (r349131) +++ head/sys/dev/pwm/pwmc.c Mon Jun 17 03:48:44 2019 (r349132) @@ -132,7 +132,7 @@ pwmc_setup_label(struct pwmc_softc *sc) static void pwmc_setup_label(struct pwmc_softc *sc) { - char *label; + const char *label; if (resource_string_value(device_get_name(sc->dev), device_get_unit(sc->dev), "label", &label) == 0) { From owner-svn-src-head@freebsd.org Mon Jun 17 05:41:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F4AC15AC302; Mon, 17 Jun 2019 05:41:48 +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 32F5D77FA0; Mon, 17 Jun 2019 05:41:48 +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 0C1AA2147F; Mon, 17 Jun 2019 05:41:48 +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 x5H5flJ9089728; Mon, 17 Jun 2019 05:41:47 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H5flRE089727; Mon, 17 Jun 2019 05:41:47 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201906170541.x5H5flRE089727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 17 Jun 2019 05:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349133 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32F5D77FA0 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.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 05:41:48 -0000 Author: zeising (doc,ports committer) Date: Mon Jun 17 05:41:47 2019 New Revision: 349133 URL: https://svnweb.freebsd.org/changeset/base/349133 Log: pci(4): Document PCIOCATTACHED Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. PCIOCATTACHED is used to query if a driver has attached to a PCI. Reviewed by: bcr, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20652 Modified: head/share/man/man4/pci.4 Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Mon Jun 17 03:48:44 2019 (r349132) +++ head/share/man/man4/pci.4 Mon Jun 17 05:41:47 2019 (r349133) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2018 +.Dd June 17, 2019 .Dt PCI 4 .Os .Sh NAME @@ -333,6 +333,26 @@ The limitations on data width described for reading registers, above, also apply to writing .Tn PCI configuration registers. +.It PCIOCATTACHED +This +.Xr ioctl 2 +allows users to query if a driver is attached to the +.Tn PCI +specified in the passed-in +.Va pci_io +structure. +The +.Va pci_io +structure is described above, however, the +.Va pi_reg +and +.Va pi_width +fields are not used. +The status of the device is stored in the +.Va pi_data +field. +A value of 0 indicates no driver is attached, while a value larger than 0 +indicates that a driver is attached. .It PCIOCBARMMAP This .Xr ioctl 2 From owner-svn-src-head@freebsd.org Mon Jun 17 07:56:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E497415B09F1; Mon, 17 Jun 2019 07:56:39 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 7A01A8467E; Mon, 17 Jun 2019 07:56:39 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi1-x22e.google.com with SMTP id s184so6326267oie.9; Mon, 17 Jun 2019 00:56:39 -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=yIL8RO5Tzr6q7lIfjegogVyN/3mf3wcRN8CEiuhWluI=; b=fYl9rtSOn7q7P1MDdiH6Tyn3RrGDegIDEcepHJEMSbBZZA7YbhC35WdmEeP1imt7ba pYbea9SMUS32TUaWYz98dw2FT+5eLF7YUHXXqJg89kqq2NqVX1jK66zKTgoB8th2RXut QglnogVns0sFfTjI7MmD2vNtAYEb8LVvlFIdyx24sZZ92V3GMev4JrokfoOZ+67jWXo8 cchCZhzrUri8EU6ckLRM3HN57UvefcxUL2XdAanG6KUgjvqStLLOEH1FVFCeewz1Hwdu Lr+9FCSdO6jje6Cy1Rsvc2+AI/8WB/ptX4wZoweix3rEE6eyYwSjvpr2B00/BR8Br179 bRjA== 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=yIL8RO5Tzr6q7lIfjegogVyN/3mf3wcRN8CEiuhWluI=; b=ppCYxq4wHutUkiSNmiCGx/a17PGJZu6OJiIgzpA9yVjtpYwua+WmrWXXw4QQDaDKyJ ho+S2cti8PUFbMs6y+k1nCj+QGUp9hQzU+ckYteLFl27Es6W0jd+qRv6ukyadPmgtvTy LqX7EvWbr7jLUO8iPmDpn+loP/X0gOEeC4hjsl0O8IZ0T4Q6ZGbY1PGxWCg7xjIW5MF7 kH0n7s0v2WAYcN/Sy9cEg2nme1Sn/sx0jJlnbc39kIL98o+GyQVZG1jHy20bqRiOkSbu dZ4PSqiKkkhGMOEFZfWU0xXpWDKBz8T/AcdNG6KEdRjuWqxo/cMsEZy5dQcX5SpEOKKK kqxg== X-Gm-Message-State: APjAAAXtxj3RStX3/ruyXV4OgC2GZuHsmCrb90mEJWs/WtAFt+S8sT3a eQHWkyjsYV8RjEUcCMAHyW6rqp81bj5fXEzoEXCsizP8MlQ= X-Google-Smtp-Source: APXvYqxyvavy6Z4yf87BDK4Lcag5Fqf/0rRkz+l1Znw7JnRwkYDIrlQhwZjLnqKyKTwjw7hVv3xfmGTzD076ccabyHY= X-Received: by 2002:aca:5251:: with SMTP id g78mr9746379oib.16.1560758198370; Mon, 17 Jun 2019 00:56:38 -0700 (PDT) MIME-Version: 1.0 References: <201906170541.x5H5flRE089727@repo.freebsd.org> In-Reply-To: <201906170541.x5H5flRE089727@repo.freebsd.org> From: Benjamin Kaduk Date: Mon, 17 Jun 2019 00:56:27 -0700 Message-ID: Subject: Re: svn commit: r349133 - head/share/man/man4 To: Niclas Zeising Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7A01A8467E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 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.91)[-0.910,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 07:56:40 -0000 On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising wrote: > Author: zeising (doc,ports committer) > Date: Mon Jun 17 05:41:47 2019 > New Revision: 349133 > URL: https://svnweb.freebsd.org/changeset/base/349133 > > Log: > pci(4): Document PCIOCATTACHED > > Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. > PCIOCATTACHED is used to query if a driver has attached to a PCI. > > Reviewed by: bcr, imp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20652 > > Modified: > head/share/man/man4/pci.4 > > Modified: head/share/man/man4/pci.4 > > ============================================================================== > --- head/share/man/man4/pci.4 Mon Jun 17 03:48:44 2019 (r349132) > +++ head/share/man/man4/pci.4 Mon Jun 17 05:41:47 2019 (r349133) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 14, 2018 > +.Dd June 17, 2019 > .Dt PCI 4 > .Os > .Sh NAME > @@ -333,6 +333,26 @@ The limitations on data width described for > reading registers, above, also apply to writing > .Tn PCI > configuration registers. > +.It PCIOCATTACHED > +This > +.Xr ioctl 2 > +allows users to query if a driver is attached to the > +.Tn PCI > +specified in the passed-in > Is there a missing word like "device" here? Thanks, Ben > +.Va pci_io > +structure. > +The > +.Va pci_io > +structure is described above, however, the > +.Va pi_reg > +and > +.Va pi_width > +fields are not used. > +The status of the device is stored in the > +.Va pi_data > +field. > +A value of 0 indicates no driver is attached, while a value larger than 0 > +indicates that a driver is attached. > .It PCIOCBARMMAP > This > .Xr ioctl 2 > _______________________________________________ > 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-head@freebsd.org Mon Jun 17 08:50:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02DF815B1B39; Mon, 17 Jun 2019 08:50:15 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 88FFF85D6F; Mon, 17 Jun 2019 08:50:14 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45S4fR30ffz3kkc; Mon, 17 Jun 2019 08:50:07 +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 EIVtdQ-gST_B; Mon, 17 Jun 2019 08:50:06 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-237-150.mobileonline.telia.com [90.236.237.150]) by mail.daemonic.se (Postfix) with ESMTPSA id 45S4fQ3FFxz3c7W; Mon, 17 Jun 2019 08:50:06 +0000 (UTC) Subject: Re: svn commit: r349133 - head/share/man/man4 To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906170541.x5H5flRE089727@repo.freebsd.org> From: Niclas Zeising Message-ID: <52998167-2193-20da-2b54-29d0862a036d@freebsd.org> Date: Mon, 17 Jun 2019 10:50:05 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 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: 88FFF85D6F 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.99)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 08:50:15 -0000 On 2019-06-17 09:56, Benjamin Kaduk wrote: > On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising > wrote: >=20 > Author: zeising (doc,ports committer) > Date: Mon Jun 17 05:41:47 2019 > New Revision: 349133 > URL: https://svnweb.freebsd.org/changeset/base/349133 >=20 > Log: > =C2=A0 pci(4): Document PCIOCATTACHED >=20 > =C2=A0 Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. > =C2=A0 PCIOCATTACHED is used to query if a driver has attached to = a PCI. >=20 > =C2=A0 Reviewed by:=C2=A0 bcr, imp > =C2=A0 MFC after:=C2=A0 =C2=A0 2 weeks > =C2=A0 Differential Revision: https://reviews.freebsd.org/D20652 >=20 > Modified: > =C2=A0 head/share/man/man4/pci.4 >=20 > Modified: head/share/man/man4/pci.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/man/man4/pci.4=C2=A0 =C2=A0Mon Jun 17 03:48:44 2019 = =20 > (r349132) > +++ head/share/man/man4/pci.4=C2=A0 =C2=A0Mon Jun 17 05:41:47 2019 = =20 > (r349133) > @@ -24,7 +24,7 @@ > =C2=A0.\" > =C2=A0.\" $FreeBSD$ > =C2=A0.\" > -.Dd June 14, 2018 > +.Dd June 17, 2019 > =C2=A0.Dt PCI 4 > =C2=A0.Os > =C2=A0.Sh NAME > @@ -333,6 +333,26 @@ The limitations on data width described for > =C2=A0reading registers, above, also apply to writing > =C2=A0.Tn PCI > =C2=A0configuration registers. > +.It PCIOCATTACHED > +This > +.Xr ioctl 2 > +allows users to query if a driver is attached to the > +.Tn PCI > +specified in the passed-in >=20 >=20 > Is there a missing word like "device" here? I just followed the same syntax as for the PCIOCWRITE ioctl in the=20 paragraph before. I found it a little strange when I read it, but I=20 kind of assumed there was a reason it said PCI and not PCI device,=20 perhaps similar to using RAM instead of RAM memory, if you understand=20 what I mean. Regards Niclas >=20 > +.Va pci_io > +structure. > +The > +.Va pci_io > +structure is described above, however, the > +.Va pi_reg > +and > +.Va pi_width > +fields are not used. > +The status of the device is stored in the > +.Va pi_data > +field. > +A value of 0 indicates no driver is attached, while a value larger > than 0 > +indicates that a driver is attached. > =C2=A0.It PCIOCBARMMAP > =C2=A0This > =C2=A0.Xr ioctl 2 --=20 Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 17 09:29:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B3915B2A6C; Mon, 17 Jun 2019 09:29:51 +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 E0E8487016; Mon, 17 Jun 2019 09:29:50 +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 x5H93WGb008132; Mon, 17 Jun 2019 02:03: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 x5H93Wac008131; Mon, 17 Jun 2019 02:03:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906170903.x5H93Wac008131@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349133 - head/share/man/man4 In-Reply-To: <52998167-2193-20da-2b54-29d0862a036d@freebsd.org> To: Niclas Zeising Date: Mon, 17 Jun 2019 02:03:32 -0700 (PDT) CC: Benjamin Kaduk , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: E0E8487016 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.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 09:29:51 -0000 > On 2019-06-17 09:56, Benjamin Kaduk wrote: > > On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising > > wrote: > > > > Author: zeising (doc,ports committer) > > Date: Mon Jun 17 05:41:47 2019 > > New Revision: 349133 > > URL: https://svnweb.freebsd.org/changeset/base/349133 > > > > Log: > > ? pci(4): Document PCIOCATTACHED > > > > ? Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. > > ? PCIOCATTACHED is used to query if a driver has attached to a PCI. > > > > ? Reviewed by:? bcr, imp > > ? MFC after:? ? 2 weeks > > ? Differential Revision: https://reviews.freebsd.org/D20652 > > > > Modified: > > ? head/share/man/man4/pci.4 > > > > Modified: head/share/man/man4/pci.4 > > ============================================================================== > > --- head/share/man/man4/pci.4? ?Mon Jun 17 03:48:44 2019 > > (r349132) > > +++ head/share/man/man4/pci.4? ?Mon Jun 17 05:41:47 2019 > > (r349133) > > @@ -24,7 +24,7 @@ > > ?.\" > > ?.\" $FreeBSD$ > > ?.\" > > -.Dd June 14, 2018 > > +.Dd June 17, 2019 > > ?.Dt PCI 4 > > ?.Os > > ?.Sh NAME > > @@ -333,6 +333,26 @@ The limitations on data width described for > > ?reading registers, above, also apply to writing > > ?.Tn PCI > > ?configuration registers. > > +.It PCIOCATTACHED > > +This > > +.Xr ioctl 2 > > +allows users to query if a driver is attached to the > > +.Tn PCI > > +specified in the passed-in > > > > > > Is there a missing word like "device" here? Actally I think the missing word, in both cases, is register, unless I am misreading some part of the manual page and what a struct pci_io points at. I guess if the pi_reg is null then this would be device. Either way there is defanity a missing word. > > I just followed the same syntax as for the PCIOCWRITE ioctl in the > paragraph before. Probably a mistake there too. > I found it a little strange when I read it, but I > kind of assumed there was a reason it said PCI and not PCI device, > perhaps similar to using RAM instead of RAM memory, if you understand > what I mean. RAM memory == Random Access Memory Memory PCI == Peripheral Component Interconnect PCI {Register, Device, Bus} all make valid sense, PCI alone does not. > Regards > Niclas > > > > > +.Va pci_io > > +structure. > > +The > > +.Va pci_io > > +structure is described above, however, the > > +.Va pi_reg > > +and > > +.Va pi_width > > +fields are not used. > > +The status of the device is stored in the > > +.Va pi_data > > +field. > > +A value of 0 indicates no driver is attached, while a value larger > > than 0 > > +indicates that a driver is attached. > > ?.It PCIOCBARMMAP > > ?This > > ?.Xr ioctl 2 > > > -- > Niclas Zeising > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 17 10:27:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E6A915B3C1F; Mon, 17 Jun 2019 10:27:56 +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 E0C8E89176; Mon, 17 Jun 2019 10:27:55 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45S6qF49vBz3kkc; Mon, 17 Jun 2019 10:27:53 +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 ihwxH04i2ko9; Mon, 17 Jun 2019 10:27:52 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-237-150.mobileonline.telia.com [90.236.237.150]) by mail.daemonic.se (Postfix) with ESMTPSA id 45S6qD4CjQz3c7W; Mon, 17 Jun 2019 10:27:52 +0000 (UTC) Subject: Re: svn commit: r349133 - head/share/man/man4 To: rgrimes@freebsd.org Cc: Benjamin Kaduk , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906170903.x5H93Wac008131@gndrsh.dnsmgr.net> From: Niclas Zeising Message-ID: <4e64bb67-7e4b-cd2d-7690-b6be11d78f58@freebsd.org> Date: Mon, 17 Jun 2019 12:27:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906170903.x5H93Wac008131@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E0C8E89176 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.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 10:27:56 -0000 On 2019-06-17 11:03, Rodney W. Grimes wrote: >> On 2019-06-17 09:56, Benjamin Kaduk wrote: >>> On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising >> > wrote: >>> >>> Author: zeising (doc,ports committer) >>> Date: Mon Jun 17 05:41:47 2019 >>> New Revision: 349133 >>> URL: https://svnweb.freebsd.org/changeset/base/349133 >>> >>> Log: >>> ? pci(4): Document PCIOCATTACHED >>> >>> ? Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. >>> ? PCIOCATTACHED is used to query if a driver has attached to a PCI. >>> >>> ? Reviewed by:? bcr, imp >>> ? MFC after:? ? 2 weeks >>> ? Differential Revision: https://reviews.freebsd.org/D20652 >>> >>> Modified: >>> ? head/share/man/man4/pci.4 >>> >>> Modified: head/share/man/man4/pci.4 >>> ============================================================================== >>> --- head/share/man/man4/pci.4? ?Mon Jun 17 03:48:44 2019 >>> (r349132) >>> +++ head/share/man/man4/pci.4? ?Mon Jun 17 05:41:47 2019 >>> (r349133) >>> @@ -24,7 +24,7 @@ >>> ?.\" >>> ?.\" $FreeBSD$ >>> ?.\" >>> -.Dd June 14, 2018 >>> +.Dd June 17, 2019 >>> ?.Dt PCI 4 >>> ?.Os >>> ?.Sh NAME >>> @@ -333,6 +333,26 @@ The limitations on data width described for >>> ?reading registers, above, also apply to writing >>> ?.Tn PCI >>> ?configuration registers. >>> +.It PCIOCATTACHED >>> +This >>> +.Xr ioctl 2 >>> +allows users to query if a driver is attached to the >>> +.Tn PCI >>> +specified in the passed-in >>> >>> >>> Is there a missing word like "device" here? > > Actally I think the missing word, in both cases, is register, > unless I am misreading some part of the manual page and > what a struct pci_io points at. I guess if the pi_reg is null > then this would be device. Either way there is defanity a > missing word. I'll try to fix this. In the PCIOCWRITE case, perhaps register is best, however, inthe PCIOCATTACHED case, device is best, I think. I'll create a patch and put it for review, I'll get back to you once it's done. Regards > >> >> I just followed the same syntax as for the PCIOCWRITE ioctl in the >> paragraph before. > > Probably a mistake there too. > >> I found it a little strange when I read it, but I >> kind of assumed there was a reason it said PCI and not PCI device, >> perhaps similar to using RAM instead of RAM memory, if you understand >> what I mean. > > RAM memory == Random Access Memory Memory > PCI == Peripheral Component Interconnect > PCI {Register, Device, Bus} all make valid sense, > PCI alone does not. > >> Regards >> Niclas >> >>> >>> +.Va pci_io >>> +structure. >>> +The >>> +.Va pci_io >>> +structure is described above, however, the >>> +.Va pi_reg >>> +and >>> +.Va pi_width >>> +fields are not used. >>> +The status of the device is stored in the >>> +.Va pi_data >>> +field. >>> +A value of 0 indicates no driver is attached, while a value larger >>> than 0 >>> +indicates that a driver is attached. >>> ?.It PCIOCBARMMAP >>> ?This >>> ?.Xr ioctl 2 >> >> >> -- >> Niclas Zeising >> >> >> > -- Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 17 10:34:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0162615B41A1; Mon, 17 Jun 2019 10:34:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 63FB8898E8; Mon, 17 Jun 2019 10:34:16 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45S6yZ4SL0z3klb; Mon, 17 Jun 2019 10:34:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id qUZg-OtU6PsV; Mon, 17 Jun 2019 10:34:14 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-237-150.mobileonline.telia.com [90.236.237.150]) by mail.daemonic.se (Postfix) with ESMTPSA id 45S6yY5dXtz3c7W; Mon, 17 Jun 2019 10:34:13 +0000 (UTC) Subject: Re: svn commit: r349133 - head/share/man/man4 From: Niclas Zeising To: rgrimes@freebsd.org Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201906170903.x5H93Wac008131@gndrsh.dnsmgr.net> <4e64bb67-7e4b-cd2d-7690-b6be11d78f58@freebsd.org> Message-ID: Date: Mon, 17 Jun 2019 12:34:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <4e64bb67-7e4b-cd2d-7690-b6be11d78f58@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 63FB8898E8 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.965,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 10:34:17 -0000 On 2019-06-17 12:27, Niclas Zeising wrote: > On 2019-06-17 11:03, Rodney W. Grimes wrote: >>> On 2019-06-17 09:56, Benjamin Kaduk wrote: >>>> On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising >>> > wrote: >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Author: zeising (doc,ports committer) >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Date: Mon Jun 17 05:41:47 2019 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 New Revision: 349133 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 URL: https://svnweb.freebsd.org/changeset/b= ase/349133 >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Log: >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? pci(4): Document PCIOCATTACHED >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? Document the PCIOCATTACHED ioctl(2)= in the pci(4) manual. >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? PCIOCATTACHED is used to query if a= driver has attached to a=20 >>>> PCI. >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? Reviewed by:? bcr, imp >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? MFC after:? ? 2 weeks >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? Differential Revision: https://revi= ews.freebsd.org/D20652 >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Modified: >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ? head/share/man/man4/pci.4 >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 Modified: head/share/man/man4/pci.4 >>>> =20 >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=20 >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 --- head/share/man/man4/pci.4? ?Mon Jun 17 = 03:48:44 2019 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 (r349132) >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +++ head/share/man/man4/pci.4? ?Mon Jun 17 = 05:41:47 2019 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 (r349133) >>>> =C2=A0=C2=A0=C2=A0=C2=A0 @@ -24,7 +24,7 @@ >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.\" >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.\" $FreeBSD$ >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.\" >>>> =C2=A0=C2=A0=C2=A0=C2=A0 -.Dd June 14, 2018 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +.Dd June 17, 2019 >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.Dt PCI 4 >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.Os >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.Sh NAME >>>> =C2=A0=C2=A0=C2=A0=C2=A0 @@ -333,6 +333,26 @@ The limitations on dat= a width described for >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?reading registers, above, also apply= to writing >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?.Tn PCI >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ?configuration registers. >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +.It PCIOCATTACHED >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +This >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +.Xr ioctl 2 >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +allows users to query if a driver is attac= hed to the >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +.Tn PCI >>>> =C2=A0=C2=A0=C2=A0=C2=A0 +specified in the passed-in >>>> >>>> >>>> Is there a missing word like "device" here? >> >> Actally I think the missing word, in both cases, is register, >> unless I am misreading some part of the manual page and >> what a struct pci_io points at.=C2=A0 I guess if the pi_reg is null >> then this would be device.=C2=A0 Either way there is defanity a >> missing word. >=20 > I'll try to fix this.=C2=A0 In the PCIOCWRITE case, perhaps register is= best,=20 > however, inthe PCIOCATTACHED case, device is best, I think. > I'll create a patch and put it for review, I'll get back to you once=20 > it's done. > Regards >=20 Here's the review with my proposed change. Let me know what you think. https://reviews.freebsd.org/D20671 Regards --=20 Niclas Zeising From owner-svn-src-head@freebsd.org Mon Jun 17 11:46:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE8415B64B1; Mon, 17 Jun 2019 11:46:39 +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 4615D8C675; Mon, 17 Jun 2019 11:46:39 +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 203592524F; Mon, 17 Jun 2019 11:46:39 +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 x5HBkdoI019189; Mon, 17 Jun 2019 11:46:39 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HBkbCC019178; Mon, 17 Jun 2019 11:46:37 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906171146.x5HBkbCC019178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 17 Jun 2019 11:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349135 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Commit-Revision: 349135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4615D8C675 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 11:46:40 -0000 Author: mm Date: Mon Jun 17 11:46:37 2019 New Revision: 349135 URL: https://svnweb.freebsd.org/changeset/base/349135 Log: MFV r349134: Sync libarchive with vendor. Relevant vendor changes: PR #1212: RAR5 reader - window_mask was not updated correctly (OSS-Fuzz 15278) OSS-Fuzz 15120: RAR reader - extend use after free bugfix MFC after: 1 week (together with r348993) Added: head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_different_window_size.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon Jun 17 11:29:32 2019 (r349134) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Mon Jun 17 11:46:37 2019 (r349135) @@ -1027,6 +1027,7 @@ archive_read_format_rar_read_data(struct archive_read if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->start_new_table = 1; + rar->ppmd_valid = 0; } break; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Mon Jun 17 11:29:32 2019 (r349134) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Mon Jun 17 11:46:37 2019 (r349135) @@ -1125,6 +1125,13 @@ static void init_header(struct archive_read* a) { a->archive.archive_format_name = "RAR5"; } +static void init_window_mask(struct rar5* rar) { + if (rar->cstate.window_size) + rar->cstate.window_mask = rar->cstate.window_size - 1; + else + rar->cstate.window_mask = 0; +} + enum HEADER_FLAGS { HFL_EXTRA_DATA = 0x0001, HFL_DATA = 0x0002, @@ -1672,6 +1679,7 @@ static int process_head_file(struct archive_read* a, s /* Values up to 64M should fit into ssize_t on every * architecture. */ rar->cstate.window_size = (ssize_t) window_size; + init_window_mask(rar); rar->file.solid = (compression_info & SOLID) > 0; rar->file.service = 0; @@ -2235,10 +2243,7 @@ static int rar5_read_header(struct archive_read *a, static void init_unpack(struct rar5* rar) { rar->file.calculated_crc32 = 0; - if (rar->cstate.window_size) - rar->cstate.window_mask = rar->cstate.window_size - 1; - else - rar->cstate.window_mask = 0; + init_window_mask(rar); free(rar->cstate.window_buf); free(rar->cstate.filtered_buf); @@ -2851,7 +2856,7 @@ static int do_uncompress_block(struct archive_read* a, * - Values lower than 256 are just bytes. Those codes * can be stored in the output buffer directly. * - * - Code 256 defines a new filter, which is later used to + * - Code 256 defines a new filter, which is later used to * ransform the data block accordingly to the filter type. * The data block needs to be fully uncompressed first. * @@ -3906,7 +3911,7 @@ static int rar5_read_data_skip(struct archive_read *a) /* Turn off "skip mode". */ rar->skip_mode--; - if(ret < 0) { + if(ret < 0 || ret == ARCHIVE_EOF) { /* Propagate any potential error conditions * to the caller. */ return ret; Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar.c Mon Jun 17 11:29:32 2019 (r349134) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar.c Mon Jun 17 11:46:37 2019 (r349135) @@ -3776,6 +3776,35 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free) assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2) +{ + uint8_t buf[16]; + const char* reffile = "test_read_format_rar_ppmd_use_after_free2.rar"; + + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + assertA(ARCHIVE_OK == archive_read_next_header(a, &ae)); + assertA(archive_read_data(a, buf, sizeof(buf)) <= 0); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Mon Jun 17 11:29:32 2019 (r349134) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Mon Jun 17 11:46:37 2019 (r349135) @@ -1194,3 +1194,24 @@ DEFINE_TEST(test_read_format_rar5_fileattr) EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_different_window_size) +{ + char buf[4096]; + PROLOGUE("test_read_format_rar5_different_window_size.rar"); + + /* Return codes of those calls are ignored, because this sample file + * is invalid. However, the unpacker shouldn't produce any SIGSEGV + * errors during processing. */ + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + (void) archive_read_next_header(a, &ae); + while(0 != archive_read_data(a, buf, sizeof(buf))) {} + + EPILOGUE(); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu (from r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_window_size.rar.uu Mon Jun 17 11:46:37 2019 (r349135, copy of r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_different_window_size.rar.uu) @@ -0,0 +1,675 @@ +begin 600 test_read_format_rar5_different_window_size.rar +M4F%R(1H'`0"-[P+2``'#M#P\7P$'`0"-[P+2``7#`/KZ^OKZA5N8F)B8F)@` +MF`*8T@7"F!=A_________P$$_____________________R%285(A&@?_____ +M_________________V@`[E##M#P\7P$'`0"-[P+2``7"87)26`!W=%)A\"T@`"QP\)`'(A&@\"T@`" +MQP\`"7(AFC`!&B/2+0`"*"%285(A&@<8`0"-[P+2``7#10!A4B$:!Q@!`#)S +M-/_______U)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1 +MT='1T='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\` +M`"\O``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$``/____\3]O;V]O;_ +M_S\``/]!(.VG+R\``/]!(.T)__^PWOS_```O+S$``/8@[;L````````````` +M-3XR9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q< +M7#)<7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E +M9"XR9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF +M+BX**%)A\"T@`"!QS1T='1T='1T='6T='1T='1T='1T='1T='1 +MT='1T='1T='1T=&UQX`.`"'X"/\E``*H'#`"`/+__TO__O_G*_____\``"\O +M``#_02+M____`-X`_["&AFVQJ@,#45TW,?;V]@$````````3]O;V]O;__S\` +M`/]!(.VG+R\``/]!(.T)__^PWOS_```O+P```/8@[;L`````````````-38R +M9%Q<7%Q<7%Q<7%Q<7%QZ7%PJ7%Q<7"]<7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7#)< +M7#9<,F1I9V5R=#4V,61I870]+@HN"G0@9&5V270@9&1I9V5S7%Q<7'=E9"XR +M9&EG97)T-38R9&EA=#TN"BX*="!D979)="!D9&EG97-T/2X*+@HN"@HF+E)A +M\"T@`"PP<KJZNKJZNKJZNKJZNKJZNKJ +MZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNKJZNK#P\/#P\/#P\/#R\-MP\/# +MP\/#P\/#P\/#P\/#P\/#`\"T@`#QP\`"2$:TB,M``(H(5)A4B$:!Q@!`(WO`M(`!0`````````````` +M`````````0``````_____P#_965E965E965E965E965E965E8'-T/2X*+@HN +M"C(P-S`W,&EA='EAEQ<*EQ<7%PO7%Q<7%Q<7%Q<7%Q<7%Q<7%Q<7%PR7%PV7#!D:6=E +M\"T@`%PP`:!P`$9P`` +M````````[P+2``+'#P`)`"X),AP`_0$`%___"0`N"3(<`/T!`!?__Q%287(A +M_Q%287(A&H\Q`"@HW,@```/V-[P+2 +M``+'`"X),1P`_0$`%___$5)A<@$`C>\"T@`%PP`:!P`$9P``````````[P+2 +M``+'#P`)`"X),AP`_0$`%___$5)A\"T@`#QP\`"2$:TB,M``DA +M&M(C+0`"*"%285(A&@<8`0"-[P+2``7#`!H'`/R8__]E965E965E965E965E +M965E965@6%R(0HN"@HF+B8N"B@*+@HN"BY0 +M7B]A,C5I-F1G97-T/2X*+@HN"@HF+BX*"@HF+BX**`HN"BX*+E!<-3,R-C)D +M+W-.="`@6W-T/3TN"BX*+@H*)BXN"B@*+@HN"BY07#4S,C8A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A(2$A +M(2$A(2$A(2$A(2$A(2$A(2$A+@H*)BXN+EPV7#)D:6=E\"T@`%```` +M```````````````````!``````#_____```O+P``_T$@[?___[#>`/\`AH:Q +M;?;V]@.J_O;_S_\`Q+[?$?;?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?___?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_? +MW]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W_^[XP## +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M__________________________________________\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````"`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````+8````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````!287(A&@\"T@`%PF%R4E@`=W1287(A&@EFZ>45J>E"(8*1QP&#AP1O__`````!X````````````` +MNKJZNKJZN@'U``"R____`````!X```"````````````````````````````` +M`"Q!`````````"T`%0``:#H`6@$M\"T@`"PP<< +MP@2```#_;24``F<<`0(`#@```0!02P@#`"8F)@!`___/0T+_____\?__K2-T +M='3_______[______R9"____,3,U__\3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3 +M$Q,3$Q,3$Q,3$Q,3$Q,3$Q,3$R8J8BQB`/______0D)"0D)"0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D+;V]O;V]O;V]O;V]O;-C8V +M-C8V&4PA`C8V-C8V-C8V-C8V-C8V&4PA`C8V-C8V-C8V-C8V-C8H*"@H*"@H +M*"@H*"@H(1H'`0"-[P(H*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`` +M````````````````````````````V]O;V]L`VP````#;V]L`VR@H*"@H*#8V +M-C8V-C8V-C8VEC8V-C8V-C8VV]O;``````````````````````````````#; +MV]O;VP#;`````-O;VP#;``````````````````````!"0D)"0D)"0D)S0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0EU=75)A4B$:!V%R0D)"0D)"0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0MO;V]O;V]O; +MV]O;V]LV-C8V-C893"$"-C8V-C8V-C8V-C8V-C893"$"-C8V-C8V-C8V-C8V +M-B@H*"@H*"@H*"@H*"@A&@\" +M*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````````` +M`````````-O;V]O;`-L`````V]O;`-L``````````````````````$)"0D)" +M0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H'87)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +MV]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V +M-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V-C8V +M-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O;`-L` +M````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````````` +M````````````````````V]O;V]L`VP````#;V]L`VP`````````````````` +M````0D)"0D)"0D)"\"T@`%PT4```!&%<\"T@`%PF%R4E@`=W1287(A&@7EY0H```#EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>5W=V%R(2\O+R`N"@H*75U=75U9R,C(R,C(R,C(R,C(R"<.`'\` +M``I=70!=!UU=7=D`Y>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY4$X.#@X]C@X+3@X.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#AR.#@X.#@X.#@X.#@X.#@X.#@X +M.#@X./DX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X\"T@`%P_J%6YB8F)B8F`"8`IC2!<*8%V'_ +M________`03_____________________(5)A4B$:!___________________ +M____:`#N4,.T/#Q?`0\"T@`" +MQP\)`'(A&@\"T@`"QP\`"7(AFC`! +M&B/2+0`"*"%285(A&@<8`0"-[P+2``7#15\!!P$`C>\"T@`%PF%R4E@`=W12 +M87(A&@\"T@`%PP```$85!<)A +M\"T@`%PT4```!&%<\"T@`%PF%R4E@` +M=W1287(A&@`````````````+JZNKJZNKH!]0``LO___P`````>```` +M@``````````````````````````````L00`````````M`!4``&@Z`%H!+7-L +M-S8`R!$`````````XJ$`8VDP`#(`93$``/_______________P`````````` +M``H*"@H```!=75U=75U=75U=75U=75T````````````````````````````` +M``````!287(A&@7E"@```.7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY7=W87(A+R\O("X*"@I=75U=75G(R,C(R,C(R,C(R,C()PX` +M?P``"EU=`%T'75U=V0#EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY>7E03@X.#CV.#@M.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.'(X.#@X.#@X.#@X.#@X.#@X +M.#@X.#@X^3@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#AR.#@X=_[_________ +M&4PA`C8V-C8V-C8V-C8V-C8R&4PA`C8V-C8V-C8V-C8V-C8V-C8V-C8V"#8V +M-C:6-C8V-C8V-C;;V]O;V]O;V__;V]O;V]O;V]O;V]O;V]O;VS8V-C8V-C8V +M-C8V-C8V-@@V-C8VEC8V-C8V-C8VV]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O; +MV]LV-C8V-C;;V]O;V]O;V]O;VUU=75U=75U=75U=75U=75U=75U=V]O;V]O; +MV]LV-C8V-C8V&4PA`C8V-C8V-C8V-MO;V]O;V]O;V]O;V]O;V]O;V]O;V]O; +MV]O;-C8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V +M-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O; +MV]O;V]O;V]O;V]O;V]O;V]O;V]O;V]M"0D)"```````````````````````` +M``````````````````````````````````````````````````!"0D)"0D)" +M0D)S0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0EU=75)A4B$:!V%R0D)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0MO; +MV]O;V]O;V]O;V]LV-C8V-C893"$"-C8V-C8V-C8V-C8V-C893"$"-C8V-C8V +M-C8V-C8V-B@H*"@H*"@H*"@H*"@A&@\"*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V +M-C;;V]L``````````````````````````````-O;V]O;`-L`````V]O;`-O_ +M____________________________________________________________ +M_____________________R8@)B8?)B8F)B8F)B8F)B8F)R8F```````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````/8``)0X.#@X73@X..7EY>4*```` +MY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E=W=A7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>5!.#@X +M./8X."TX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X +M.#@X\"*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````` +M`````````````-O;V]O;`-L`````V]O;`-L``````````````````````$)" +M0D)"0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H' +M87)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +M0D)"V]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V +M-C8V-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V +M-C8V-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O; +M`-L`````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````` +M````````````````````````V]O;V]L`VP````#;V]L`VP`````````````` +M````````0D)"0D)"0D)"\"*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````` +M`````````````````````````-O;V]O;`-L`````V]O;`-L"-C8V-C8V-C8V +M-C8V-B@H*"@H*"@H*"@H*"@A&@\"*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;; +MV]L``````````````````````````````-O;V]O;`-L`````V]O;`-O_____ +M____________________________________________________________ +M_________________R8@)B8?)B8F)B8F)B8F)B8F)R8F```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````/8``)0X.#@X73@X..7EY>4*````Y>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7E=W=A7EY>7EY>7EY>7E +MY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>7EY>5!.#@X./8X +M."TX.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X.#@X +M\" +M*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````````````````` +M`````````-O;V]O;`-L`````V]O;`-L``````````````````````$)"0D)" +M0D)"0G-"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"75U=4F%2(1H'87)" +M0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)"0D)" +MV]O;V]O;V]O;V]O;VS8V-C8V-AE,(0(V-C8V-C8V-C8V-C8V-AE,(0(V-C8V +M-C8V-C8V-C8V*"@H*"@H*"@H*"@H*"$:!P$`C>\"*"@H*"@H-C8V-C8V-C8V +M-C:6-C8V-C8V-C;;V]L``````````````````````````````-O;V]O;`-L` +M````V]O;`-LH*"@H*"@V-C8V-C8V-C8V-I8V-C8V-C8V-MO;VP`````````` +M````````````````````V]O;V]L`VP````#;V]L`VP`````````````````` +M````0D)"0D)"0D)"\"*"@H*"@H-C8V-C8V-C8V-C:6-C8V-C8V-C;;V]L````````` +@`````````````````````-O;V]O;`-L`````V]O;`-L` +` +end Copied: head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu (from r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Mon Jun 17 11:46:37 2019 (r349135, copy of r349134, vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu) @@ -0,0 +1,10 @@ +begin 664 test_read_format_rar_ppmd_use_after_free2.rar +M4F%R(1H'``1G=$Q24`!W````>U!+`P0Q`'#_J7\`+@TU'`#]`0`7__]"0D)" +M+W5N)B8F)F=I9`UD#1T+``!"`````````&%R(1H'``3_________`F@`H2`` +M``"`P\/#2\/#P\/#P\/#P\-3PP"`P\/#PYZ>AYZ>GI[#4\,`@,/#`L,@(""= +M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(/______ +M__\@("`@("`@("`@("`@("`@("`@("`@("`$9W1,4E``=P```'M02P,$,0!P +M_ZE_`"X--1P`_0$`%___0D)"0B]U;B8F)B9G:60-9`T="P``0@````````!A +0 Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4C9D15B7EB6; Mon, 17 Jun 2019 12:17:15 +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 4B3418DB90; Mon, 17 Jun 2019 12:17:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id cqZPhTjjGo7SQcqZRh9Gew; Mon, 17 Jun 2019 06:17:09 -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=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=PzpspmS5A2wQaUeLSlgA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id F0167463; Mon, 17 Jun 2019 05:17:04 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5HCH37g057014; Mon, 17 Jun 2019 05:17:03 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5HCH3ik057008; Mon, 17 Jun 2019 05:17:03 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906171217.x5HCH3ik057008@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Martin Matuska cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349135 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests In-Reply-To: Message from Martin Matuska of "Mon, 17 Jun 2019 11:46:37 -0000." <201906171146.x5HBkbCC019178@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 17 Jun 2019 05:17:03 -0700 X-CMAE-Envelope: MS4wfNN2QAAAnN0Bq3cdVIYI+nEKj+rWZM1UGvbUzm05mqyCRj94I7WdZ/4yiyu0p5gq7o5w0HojR0VgnS2XzI2mzfanDsNTepZsSFwJQKkRXxilIq+/oPcI 1Ex5dmNLKYFlc50CyIWzCwgO+Xl/Fl6K4LtX5a+oncUo9fltToMSmznOgx9kVMmcBzmUc+G/4I8b5P6LECY25sWzMvSY1ZaiPiJY+yXoPZDzGzYD2GRS5om7 kEk05o3NidbH9KewlQDmlLa/XR9GLRD7m8uU7m6QmLboqmRIo2Rd6b4Pynj+qlNf X-Rspamd-Queue-Id: 4B3418DB90 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.39)[ip: (-6.05), ipnet: 64.59.128.0/20(-3.28), asn: 6327(-2.54), country: CA(-0.09)]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.903,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 12:17:16 -0000 In message <201906171146.x5HBkbCC019178@repo.freebsd.org>, Martin Matuska write s: > Author: mm > Date: Mon Jun 17 11:46:37 2019 > New Revision: 349135 > URL: https://svnweb.freebsd.org/changeset/base/349135 > > Log: > MFV r349134: > Sync libarchive with vendor. > > Relevant vendor changes: > PR #1212: RAR5 reader - window_mask was not updated correctly > (OSS-Fuzz 15278) > OSS-Fuzz 15120: RAR reader - extend use after free bugfix Did our upline document a CVE for this? > > MFC after: 1 week (together with r348993) > > Added: > head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_win > dow_size.rar.uu > - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/ > test_read_format_rar5_different_window_size.rar.uu > head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after > _free2.rar.uu > - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/ > test_read_format_rar_ppmd_use_after_free2.rar.uu > Modified: > head/contrib/libarchive/libarchive/archive_read_support_format_rar.c > head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c > head/contrib/libarchive/libarchive/test/test_read_format_rar.c > head/contrib/libarchive/libarchive/test/test_read_format_rar5.c > head/lib/libarchive/tests/Makefile > Directory Properties: > head/contrib/libarchive/ (props changed) > [...] -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Jun 17 13:36:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7299615BA442; Mon, 17 Jun 2019 13:36:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:191:9029::4]) by mx1.freebsd.org (Postfix) with ESMTP id 055D369B46; Mon, 17 Jun 2019 13:36:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 99F2E1944CC; Mon, 17 Jun 2019 15:36:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id 0YPStIJ127tR; Mon, 17 Jun 2019 15:36:09 +0200 (CEST) Received: from [10.10.77.184] (unknown [145.243.199.37]) by mail.vx.sk (Postfix) with ESMTPSA id 5A76F1944C8; Mon, 17 Jun 2019 15:36:09 +0200 (CEST) Subject: Re: svn commit: r349135 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906171217.x5HCH3ik057008@slippy.cwsent.com> From: Martin Matuska Message-ID: Date: Mon, 17 Jun 2019 15:36:08 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201906171217.x5HCH3ik057008@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 055D369B46 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.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 13:36:12 -0000 Due to lack of resources we (libarchive) are currently not publishing CVE information. Most of our security fixes are patches for issues discovered by Google's OSS-Fuzz project. These issues are made public 30 days after they have been detected as fixed or 90 days after being discovered. I can provide links to published issues at OSS-Fuzz. Am 17.06.19 um 14:17 schrieb Cy Schubert: > In message <201906171146.x5HBkbCC019178@repo.freebsd.org>, Martin > Matuska write > s: >> Author: mm >> Date: Mon Jun 17 11:46:37 2019 >> New Revision: 349135 >> URL: https://svnweb.freebsd.org/changeset/base/349135 >> >> Log: >> MFV r349134: >> Sync libarchive with vendor. >> >> Relevant vendor changes: >> PR #1212: RAR5 reader - window_mask was not updated correctly >> (OSS-Fuzz 15278) >> OSS-Fuzz 15120: RAR reader - extend use after free bugfix > Did our upline document a CVE for this? > >> >> MFC after: 1 week (together with r348993) >> >> Added: >> head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_win >> dow_size.rar.uu >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/ >> test_read_format_rar5_different_window_size.rar.uu >> head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_after >> _free2.rar.uu >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive/test/ >> test_read_format_rar_ppmd_use_after_free2.rar.uu >> Modified: >> head/contrib/libarchive/libarchive/archive_read_support_format_rar.c >> head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c >> head/contrib/libarchive/libarchive/test/test_read_format_rar.c >> head/contrib/libarchive/libarchive/test/test_read_format_rar5.c >> head/lib/libarchive/tests/Makefile >> Directory Properties: >> head/contrib/libarchive/ (props changed) >> > [...] > > From owner-svn-src-head@freebsd.org Mon Jun 17 14:07:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4668D15BAEA1; Mon, 17 Jun 2019 14:07:22 +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 DB3556AFEA; Mon, 17 Jun 2019 14:07:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id csI0hUR1bo7SQcsI1h9VOz; Mon, 17 Jun 2019 08:07:18 -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=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=3yS0nkhWo5LF_4pWAfkA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 5CEB01A4; Mon, 17 Jun 2019 07:07:15 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5HE7Efa036163; Mon, 17 Jun 2019 07:07:14 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5HE7EN5036160; Mon, 17 Jun 2019 07:07:14 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906171407.x5HE7EN5036160@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Martin Matuska cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349135 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests In-Reply-To: Message from Martin Matuska of "Mon, 17 Jun 2019 15:36:08 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 17 Jun 2019 07:07:14 -0700 X-CMAE-Envelope: MS4wfOy5Cf1N9RhRsVwA5PQKcLw6cLj0fm2/9uE5v7AJiwdSKSOKJEwoo86LXEZcZ+2hInBvLLe98+a0LlKgQ+i7c81ez9XiEZUkw6hL7fhIaDBbMvugqvuw e3tSXy5hXQZpYIImZP0sRQn9PGaXAmDXZLOD2+WwZi/DFTtfknY+Yi1RrzOy3OPMvDjVYitQhxhTXS1r6duYtljf/F6T/NJj9J7FUqkZp+QSRJhT8tZXpi80 KvzqZNRh0wknkFMFk+dy88Q6/kH3V3Q9XYa+vvxONU6d8F4wgDexhlioajvQAnaA X-Rspamd-Queue-Id: DB3556AFEA X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.38)[ip: (-6.02), ipnet: 64.59.128.0/20(-3.27), asn: 6327(-2.54), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 14:07:22 -0000 I could say something rhetorical and in bad taste here. This speaks for itself. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Martin Matuska w rites: > Due to lack of resources we (libarchive) are currently not publishing > CVE information. > Most of our security fixes are patches for issues discovered by Google's > OSS-Fuzz project. > These issues are made public 30 days after they have been detected as > fixed or 90 days after being discovered. > > I can provide links to published issues at OSS-Fuzz. > > Am 17.06.19 um 14:17 schrieb Cy Schubert: > > In message <201906171146.x5HBkbCC019178@repo.freebsd.org>, Martin > > Matuska write > > s: > >> Author: mm > >> Date: Mon Jun 17 11:46:37 2019 > >> New Revision: 349135 > >> URL: https://svnweb.freebsd.org/changeset/base/349135 > >> > >> Log: > >> MFV r349134: > >> Sync libarchive with vendor. > >> > >> Relevant vendor changes: > >> PR #1212: RAR5 reader - window_mask was not updated correctly > >> (OSS-Fuzz 15278) > >> OSS-Fuzz 15120: RAR reader - extend use after free bugfix > > Did our upline document a CVE for this? > > > >> > >> MFC after: 1 week (together with r348993) > >> > >> Added: > >> head/contrib/libarchive/libarchive/test/test_read_format_rar5_different > _win > >> dow_size.rar.uu > >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive/t > est/ > >> test_read_format_rar5_different_window_size.rar.uu > >> head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use_a > fter > >> _free2.rar.uu > >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive/t > est/ > >> test_read_format_rar_ppmd_use_after_free2.rar.uu > >> Modified: > >> head/contrib/libarchive/libarchive/archive_read_support_format_rar.c > >> head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c > >> head/contrib/libarchive/libarchive/test/test_read_format_rar.c > >> head/contrib/libarchive/libarchive/test/test_read_format_rar5.c > >> head/lib/libarchive/tests/Makefile > >> Directory Properties: > >> head/contrib/libarchive/ (props changed) > >> > > [...] > > > > From owner-svn-src-head@freebsd.org Mon Jun 17 14:17:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF94D15BB0F9; Mon, 17 Jun 2019 14:17:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 86C186B4CC; Mon, 17 Jun 2019 14:17:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id csRVhUVYIo7SQcsRXh9XGZ; Mon, 17 Jun 2019 08:17:07 -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=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=VxmjJ2MpAAAA:8 a=9tKOXVWixAHr62aoFLAA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 6F3F41BC; Mon, 17 Jun 2019 07:17:05 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5HEH5OZ071458; Mon, 17 Jun 2019 07:17:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5HEH4Z0071450; Mon, 17 Jun 2019 07:17:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906171417.x5HEH4Z0071450@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Martin Matuska , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349135 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests In-Reply-To: Message from Cy Schubert of "Mon, 17 Jun 2019 07:07:14 -0700." <201906171407.x5HE7EN5036160@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 17 Jun 2019 07:17:04 -0700 X-CMAE-Envelope: MS4wfATb25h87w2R2k8YkeyATZGLnQeP3JgpervTOUyCoBRbnBKYxwSOk9lMKsdgFK/MorZ3oXN37Xsn0vewD1cm5isZhePxhzCxDKKte/PEqLNmNFjKTU1I Ms1EGL9Qt2djgEWjy3TZUHuZsP1JLwsodGIvkyTTR+sdzlfPYisXTYS/MN7cUfNtqFqQ9PPMl5ubPug/oqYBHvb0fPWWgzG87N3GM27KUG4qSpV8u3B4MvWN 4JrOLdi0SgzOiA+bSUvbnCWsI52VcQMZppS5ReJ0sOkXlB+xgN+BqglNqi5pUWxK X-Rspamd-Queue-Id: 86C186B4CC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.59.64.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.47)[ip: (-6.45), ipnet: 64.59.128.0/20(-3.27), asn: 6327(-2.53), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 14:17:16 -0000 Even this was inappropriate. My apologies. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message <201906171407.x5HE7EN5036160@slippy.cwsent.com>, Cy Schubert writes: > I could say something rhetorical and in bad taste here. This speaks for > itself. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > In message , Martin > Matuska w > rites: > > Due to lack of resources we (libarchive) are currently not publishing > > CVE information. > > Most of our security fixes are patches for issues discovered by Google's > > OSS-Fuzz project. > > These issues are made public 30 days after they have been detected as > > fixed or 90 days after being discovered. > > > > I can provide links to published issues at OSS-Fuzz. > > > > Am 17.06.19 um 14:17 schrieb Cy Schubert: > > > In message <201906171146.x5HBkbCC019178@repo.freebsd.org>, Martin > > > Matuska write > > > s: > > >> Author: mm > > >> Date: Mon Jun 17 11:46:37 2019 > > >> New Revision: 349135 > > >> URL: https://svnweb.freebsd.org/changeset/base/349135 > > >> > > >> Log: > > >> MFV r349134: > > >> Sync libarchive with vendor. > > >> > > >> Relevant vendor changes: > > >> PR #1212: RAR5 reader - window_mask was not updated correctly > > >> (OSS-Fuzz 15278) > > >> OSS-Fuzz 15120: RAR reader - extend use after free bugfix > > > Did our upline document a CVE for this? > > > > > >> > > >> MFC after: 1 week (together with r348993) > > >> > > >> Added: > > >> head/contrib/libarchive/libarchive/test/test_read_format_rar5_differe > nt > > _win > > >> dow_size.rar.uu > > >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive > /t > > est/ > > >> test_read_format_rar5_different_window_size.rar.uu > > >> head/contrib/libarchive/libarchive/test/test_read_format_rar_ppmd_use > _a > > fter > > >> _free2.rar.uu > > >> - copied unchanged from r349134, vendor/libarchive/dist/libarchive > /t > > est/ > > >> test_read_format_rar_ppmd_use_after_free2.rar.uu > > >> Modified: > > >> head/contrib/libarchive/libarchive/archive_read_support_format_rar.c > > >> head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c > > >> head/contrib/libarchive/libarchive/test/test_read_format_rar.c > > >> head/contrib/libarchive/libarchive/test/test_read_format_rar5.c > > >> head/lib/libarchive/tests/Makefile > > >> Directory Properties: > > >> head/contrib/libarchive/ (props changed) > > >> > > > [...] > > > > > > > From owner-svn-src-head@freebsd.org Mon Jun 17 14:59:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D29015BC207; Mon, 17 Jun 2019 14:59: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 9FBF76CD34; Mon, 17 Jun 2019 14:59: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 6EBA62727C; Mon, 17 Jun 2019 14:59: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 x5HExlPs040579; Mon, 17 Jun 2019 14:59:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HExkPE040573; Mon, 17 Jun 2019 14:59:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906171459.x5HExkPE040573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 17 Jun 2019 14:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349137 - in head: etc/mtree sys/dev/random tests/sys tests/sys/devrandom X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: etc/mtree sys/dev/random tests/sys tests/sys/devrandom X-SVN-Commit-Revision: 349137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FBF76CD34 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 14:59:48 -0000 Author: cem Date: Mon Jun 17 14:59:45 2019 New Revision: 349137 URL: https://svnweb.freebsd.org/changeset/base/349137 Log: random(4): Add regression tests for uint128 implementation, Chacha CTR Add some basic regression tests to verify behavior of both uint128 implementations at typical boundary conditions, to run on all architectures. Test uint128 increment behavior of Chacha in keystream mode, as used by 'kern.random.use_chacha20_cipher=1' (r344913) to verify assumptions at edge cases. These assumptions are critical to the safety of using Chacha as a PRF in Fortuna (as implemented). (Chacha's use in arc4random is safe regardless of these tests, as it is limited to far less than 4 billion blocks of output in that API.) Reviewed by: markm Approved by: secteam(gordon) Differential Revision: https://reviews.freebsd.org/D20392 Added: head/tests/sys/devrandom/ head/tests/sys/devrandom/Makefile (contents, props changed) head/tests/sys/devrandom/uint128_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Jun 17 14:42:27 2019 (r349136) +++ head/etc/mtree/BSD.tests.dist Mon Jun 17 14:59:45 2019 (r349137) @@ -722,6 +722,8 @@ .. .. .. + devrandom + .. dtrace .. fifo Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Mon Jun 17 14:42:27 2019 (r349136) +++ head/sys/dev/random/hash.c Mon Jun 17 14:59:45 2019 (r349137) @@ -37,12 +37,16 @@ __FBSDID("$FreeBSD$"); #else /* !_KERNEL */ #include #include +#include #include +#include +#include #include #include #include #include -#include "unit_test.h" +#define KASSERT(x, y) assert(x) +#define CTASSERT(x) _Static_assert(x, "CTASSERT " #x) #endif /* _KERNEL */ #define CHACHA_EMBED Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Mon Jun 17 14:42:27 2019 (r349136) +++ head/sys/dev/random/hash.h Mon Jun 17 14:59:45 2019 (r349137) @@ -54,7 +54,7 @@ union randomdev_key { struct chacha_ctx chacha; }; -extern bool fortuna_chachamode; +extern bool random_chachamode; void randomdev_hash_init(struct randomdev_hash *); void randomdev_hash_iterate(struct randomdev_hash *, const void *, size_t); Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Jun 17 14:42:27 2019 (r349136) +++ head/tests/sys/Makefile Mon Jun 17 14:59:45 2019 (r349137) @@ -10,6 +10,7 @@ TESTS_SUBDIRS+= ${_audit} TESTS_SUBDIRS+= auditpipe TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} +TESTS_SUBDIRS+= devrandom TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file TESTS_SUBDIRS+= fs Added: head/tests/sys/devrandom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/devrandom/Makefile Mon Jun 17 14:59:45 2019 (r349137) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +.include + +SDEVRANDOM= ${SRCTOP}/sys/dev/random +.PATH: ${SDEVRANDOM} + +TESTSDIR= ${TESTSBASE}/sys/devrandom +WARNS?= 6 + +CFLAGS+= -I${SRCTOP}/sys + +ATF_TESTS_C+= uint128_test + +# Test Chacha CTR behavior <-> uint128 +LDADD.uint128_test+= ${SDEVRANDOM}/hash.c +LDFLAGS.uint128_test+= -Wno-unused-parameter + +# hash.c deps: +LIBADD.uint128_test+= md # SHA256 +LDADD.uint128_test+= ${SRCTOP}/sys/crypto/rijndael/rijndael-alg-fst.c +LDADD.uint128_test+= ${SRCTOP}/sys/crypto/rijndael/rijndael-api-fst.c +LDFLAGS.uint128_test+= -Wno-cast-align + + +.include Added: head/tests/sys/devrandom/uint128_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/devrandom/uint128_test.c Mon Jun 17 14:59:45 2019 (r349137) @@ -0,0 +1,225 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +static void +vec_u32_tole128(uint8_t dst[static 16], const uint32_t src[static 4]) +{ + le32enc(dst, src[0]); + le32enc(&dst[4], src[1]); + le32enc(&dst[8], src[2]); + le32enc(&dst[12], src[3]); +} + +static void +le128_to_vec_u32(uint32_t dst[static 4], const uint8_t src[static 16]) +{ + dst[0] = le32dec(src); + dst[1] = le32dec(&src[4]); + dst[2] = le32dec(&src[8]); + dst[3] = le32dec(&src[12]); +} + +static void +formatu128(char buf[static 52], uint128_t x) +{ + uint8_t le128x[16]; + uint32_t vx[4]; + size_t sz, i; + int rc; + + le128enc(le128x, x); + le128_to_vec_u32(vx, le128x); + + sz = 52; + for (i = 0; i < 4; i++) { + rc = snprintf(buf, sz, "0x%x ", vx[i]); + ATF_REQUIRE(rc > 0 && (size_t)rc < sz); + + buf += rc; + sz -= rc; + } + /* Delete last trailing space */ + buf[-1] = '\0'; +} + +static void +u128_check_equality(uint128_t a, uint128_t b, const char *descr) +{ + char fmtbufa[52], fmtbufb[52]; + + formatu128(fmtbufa, a); + formatu128(fmtbufb, b); + + ATF_CHECK_MSG(uint128_equals(a, b), + "Expected: [%s] != Actual: [%s]: %s", fmtbufa, fmtbufb, descr); +} + +ATF_TC_WITHOUT_HEAD(uint128_inc); +ATF_TC_BODY(uint128_inc, tc) +{ + static const struct u128_inc_tc { + uint32_t input[4]; + uint32_t expected[4]; + const char *descr; + } tests[] = { + { + .input = { 0, 0, 0, 0 }, + .expected = { 1, 0, 0, 0 }, + .descr = "0 -> 1", + }, + { + .input = { 1, 0, 0, 0 }, + .expected = { 2, 0, 0, 0 }, + .descr = "0 -> 2", + }, + { + .input = { 0xff, 0, 0, 0 }, + .expected = { 0x100, 0, 0, 0 }, + .descr = "0xff -> 0x100 (byte carry)", + }, + { + .input = { UINT32_MAX, 0, 0, 0 }, + .expected = { 0, 1, 0, 0 }, + .descr = "2^32 - 1 -> 2^32 (word carry)", + }, + { + .input = { UINT32_MAX, UINT32_MAX, 0, 0 }, + .expected = { 0, 0, 1, 0 }, + .descr = "2^64 - 1 -> 2^64 (u128t_word0 carry)", + }, + { + .input = { UINT32_MAX, UINT32_MAX, UINT32_MAX, 0 }, + .expected = { 0, 0, 0, 1 }, + .descr = "2^96 - 1 -> 2^96 (word carry)", + }, + }; + uint8_t inputle[16], expectedle[16]; + uint128_t a; + size_t i; + + for (i = 0; i < nitems(tests); i++) { + vec_u32_tole128(inputle, tests[i].input); + vec_u32_tole128(expectedle, tests[i].expected); + + a = le128dec(inputle); + uint128_increment(&a); + u128_check_equality(le128dec(expectedle), a, tests[i].descr); + } +} + +/* + * Test assumptions about Chacha incrementing counter in the same way as + * uint128.h + */ +ATF_TC_WITHOUT_HEAD(uint128_chacha_ctr); +ATF_TC_BODY(uint128_chacha_ctr, tc) +{ + static const struct u128_chacha_tc { + uint32_t input[4]; + uint32_t expected[4]; + const char *descr; + } tests[] = { + { + .input = { 0, 0, 0, 0 }, + .expected = { 1, 0, 0, 0 }, + .descr = "Single block", + }, + { + .input = { 1, 0, 0, 0 }, + .expected = { 2, 0, 0, 0 }, + .descr = "0 -> 2", + }, + { + .input = { 0xff, 0, 0, 0 }, + .expected = { 0x100, 0, 0, 0 }, + .descr = "0xff -> 0x100 (byte carry)", + }, + { + .input = { UINT32_MAX, 0, 0, 0 }, + .expected = { 0, 1, 0, 0 }, + .descr = "2^32 - 1 -> 2^32 (word carry)", + }, + { + .input = { UINT32_MAX, UINT32_MAX, 0, 0 }, + .expected = { 0, 0, 1, 0 }, + .descr = "2^64 - 1 -> 2^64 (u128t_word0 carry)", + }, + { + .input = { UINT32_MAX, UINT32_MAX, UINT32_MAX, 0 }, + .expected = { 0, 0, 0, 1 }, + .descr = "2^96 - 1 -> 2^96 (word carry)", + }, + }; + union randomdev_key context; + uint8_t inputle[16], expectedle[16], trash[CHACHA_BLOCKLEN]; + uint8_t notrandomkey[RANDOM_KEYSIZE] = { 0 }; + uint128_t a; + size_t i; + + random_chachamode = true; + randomdev_encrypt_init(&context, notrandomkey); + + for (i = 0; i < nitems(tests); i++) { + vec_u32_tole128(inputle, tests[i].input); + vec_u32_tole128(expectedle, tests[i].expected); + + a = le128dec(inputle); + randomdev_keystream(&context, &a, trash, sizeof(trash) / + RANDOM_BLOCKSIZE); + u128_check_equality(le128dec(expectedle), a, tests[i].descr); + } + +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, uint128_inc); + ATF_TP_ADD_TC(tp, uint128_chacha_ctr); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Mon Jun 17 15:09:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77EC15BC5A5; Mon, 17 Jun 2019 15:09:14 +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 519246D48F; Mon, 17 Jun 2019 15:09: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 20B8727437; Mon, 17 Jun 2019 15:09: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 x5HF9Egd045610; Mon, 17 Jun 2019 15:09:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HF9CFG045599; Mon, 17 Jun 2019 15:09:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906171509.x5HF9CFG045599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 17 Jun 2019 15:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349138 - in head: sys/dev/random tests/sys/devrandom X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/dev/random tests/sys/devrandom X-SVN-Commit-Revision: 349138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 519246D48F 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:09:15 -0000 Author: cem Date: Mon Jun 17 15:09:12 2019 New Revision: 349138 URL: https://svnweb.freebsd.org/changeset/base/349138 Log: random(4): Generalize algorithm-independent APIs At a basic level, remove assumptions about the underlying algorithm (such as output block size and reseeding requirements) from the algorithm-independent logic in randomdev.c. Chacha20 does not have many of the restrictions that AES-ICM does as a PRF (Pseudo-Random Function), because it has a cipher block size of 512 bits. The motivation is that by generalizing the API, Chacha is not penalized by the limitations of AES. In READ_RANDOM_UIO, first attempt to NOWAIT allocate a large enough buffer for the entire user request, or the maximal input we'll accept between signal checking, whichever is smaller. The idea is that the implementation of any randomdev algorithm is then free to divide up large requests in whatever fashion it sees fit. As part of this, two responsibilities from the "algorithm-generic" randomdev code are pushed down into the Fortuna ra_read implementation (and any other future or out-of-tree ra_read implementations): 1. If an algorithm needs to rekey every N bytes, it is responsible for handling that in ra_read(). (I.e., Fortuna's 1MB rekey interval for AES block generation.) 2. If an algorithm uses a block cipher that doesn't tolerate partial-block requests (again, e.g., AES), it is also responsible for handling that in ra_read(). Several APIs are changed from u_int buffer length to the more canonical size_t. Several APIs are changed from taking a blockcount to a bytecount, to permit PRFs like Chacha20 to directly generate quantities of output that are not multiples of RANDOM_BLOCKSIZE (AES block size). The Fortuna algorithm is changed to NOT rekey every 1MiB when in Chacha20 mode (kern.random.use_chacha20_cipher="1"). This is explicitly supported by the math in FS&K §9.4 (Ferguson, Schneier, and Kohno; "Cryptography Engineering"), as well as by their conclusion: "If we had a block cipher with a 256-bit [or greater] block size, then the collisions would not have been an issue at all." For now, continue to break up reads into PAGE_SIZE chunks, as they were before. So, no functional change, mostly. Reviewed by: markm Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D20312 Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/dev/random/other_algorithm.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/tests/sys/devrandom/uint128_test.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/fortuna.c Mon Jun 17 15:09:12 2019 (r349138) @@ -128,7 +128,7 @@ static uint8_t zero_region[RANDOM_ZERO_BLOCKSIZE]; #endif static void random_fortuna_pre_read(void); -static void random_fortuna_read(uint8_t *, u_int); +static void random_fortuna_read(uint8_t *, size_t); static bool random_fortuna_seeded(void); static bool random_fortuna_seeded_internal(void); static void random_fortuna_process_event(struct harvest_event *); @@ -306,49 +306,45 @@ random_fortuna_reseed_internal(uint32_t *entropy_data, } /*- - * FS&K - GenerateBlocks() - * Generate a number of complete blocks of random output. - */ -static __inline void -random_fortuna_genblocks(uint8_t *buf, u_int blockcount) -{ - - RANDOM_RESEED_ASSERT_LOCK_OWNED(); - KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); - - /* - * Fills buf with RANDOM_BLOCKSIZE * blockcount bytes of keystream. - * Increments fs_counter as it goes. - */ - randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, - buf, blockcount); -} - -/*- * FS&K - PseudoRandomData() - * This generates no more than 2^20 bytes of data, and cleans up its - * internal state when finished. It is assumed that a whole number of - * blocks are available for writing; any excess generated will be - * ignored. + * + * If Chacha20 is used, output size is unrestricted. If AES-CTR is used, + * output size MUST be <= 1MB and a multiple of RANDOM_BLOCKSIZE. The + * reasoning for this is discussed in FS&K 9.4; the significant distinction + * between the two ciphers is that AES has a *block* size of 128 bits while + * Chacha has a *block* size of 512 bits. */ static __inline void -random_fortuna_genrandom(uint8_t *buf, u_int bytecount) +random_fortuna_genrandom(uint8_t *buf, size_t bytecount) { - uint8_t temp[RANDOM_BLOCKSIZE * RANDOM_KEYS_PER_BLOCK]; - u_int blockcount; + uint8_t newkey[RANDOM_KEYSIZE]; RANDOM_RESEED_ASSERT_LOCK_OWNED(); + /*- - * FS&K - assert(n < 2^20 (== 1 MB) + * FS&K - assert(n < 2^20 (== 1 MB)) when 128-bit block cipher is used * - r = first-n-bytes(GenerateBlocks(ceil(n/16))) * - K = GenerateBlocks(2) */ - KASSERT((bytecount <= RANDOM_FORTUNA_MAX_READ), ("invalid single read request to Fortuna of %d bytes", bytecount)); - blockcount = howmany(bytecount, RANDOM_BLOCKSIZE); - random_fortuna_genblocks(buf, blockcount); - random_fortuna_genblocks(temp, RANDOM_KEYS_PER_BLOCK); - randomdev_encrypt_init(&fortuna_state.fs_key, temp); - explicit_bzero(temp, sizeof(temp)); + KASSERT(random_chachamode || bytecount <= RANDOM_FORTUNA_MAX_READ, + ("%s: invalid large read request: %zu bytes", __func__, + bytecount)); + + /* + * This is where FS&K would invoke GenerateBlocks(). GenerateBlocks() + * doesn't make a lot of sense or have much value if we use bytecount + * for the API (which is useful for ciphers that do not require + * block-sized output, like Chacha20). + * + * Just invoke our PRF abstraction directly, which is responsible for + * updating fs_counter ('C'). + */ + randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, + buf, bytecount); + randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, + newkey, sizeof(newkey)); + randomdev_encrypt_init(&fortuna_state.fs_key, newkey); + explicit_bzero(newkey, sizeof(newkey)); } /*- @@ -441,18 +437,71 @@ random_fortuna_pre_read(void) * FS&K - RandomData() (Part 2) * Main read from Fortuna, continued. May be called multiple times after * the random_fortuna_pre_read() above. - * The supplied buf MUST be a multiple of RANDOM_BLOCKSIZE in size. - * Lots of code presumes this for efficiency, both here and in other - * routines. You are NOT allowed to break this! + * + * The supplied buf MAY not be a multiple of RANDOM_BLOCKSIZE in size; it is + * the responsibility of the algorithm to accommodate partial block reads, if a + * block output mode is used. */ void -random_fortuna_read(uint8_t *buf, u_int bytecount) +random_fortuna_read(uint8_t *buf, size_t bytecount) { + uint8_t remainder_buf[RANDOM_BLOCKSIZE]; + size_t read_directly_len, read_chunk; - KASSERT((bytecount % RANDOM_BLOCKSIZE) == 0, ("%s(): bytecount (= %d) must be a multiple of %d", __func__, bytecount, RANDOM_BLOCKSIZE )); + /* + * The underlying AES generator expects multiples of RANDOM_BLOCKSIZE. + */ + if (random_chachamode) + read_directly_len = bytecount; + else + read_directly_len = rounddown(bytecount, RANDOM_BLOCKSIZE); + RANDOM_RESEED_LOCK(); - random_fortuna_genrandom(buf, bytecount); + KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); + + while (read_directly_len > 0) { + /* + * 128-bit block ciphers like AES must be re-keyed at 1MB + * intervals to avoid unacceptable statistical differentiation + * from true random data. + * + * 512-bit block ciphers like Chacha20 do not have this + * problem. (FS&K 9.4) + */ + if (random_chachamode) + read_chunk = read_directly_len; + else + read_chunk = MIN(read_directly_len, + RANDOM_FORTUNA_MAX_READ); + + /* + * For now, we hold the global Fortuna mutex, so yield + * periodically to provide vague availability to other lock + * users. PAGE_SIZE is chosen to match existing behavior. + */ + read_chunk = MIN(read_chunk, PAGE_SIZE); + + random_fortuna_genrandom(buf, read_chunk); + buf += read_chunk; + read_directly_len -= read_chunk; + bytecount -= read_chunk; + + /* Perform the actual yield. */ + if (read_directly_len != 0) { + RANDOM_RESEED_UNLOCK(); + RANDOM_RESEED_LOCK(); + } + } + + if (bytecount > 0) + random_fortuna_genrandom(remainder_buf, sizeof(remainder_buf)); + RANDOM_RESEED_UNLOCK(); + + if (bytecount > 0) { + memcpy(buf, remainder_buf, bytecount); + explicit_bzero(remainder_buf, sizeof(remainder_buf)); + } } #ifdef _KERNEL Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/hash.c Mon Jun 17 15:09:12 2019 (r349138) @@ -125,16 +125,18 @@ randomdev_encrypt_init(union randomdev_key *context, c } /* - * Create a psuedorandom output stream of 'blockcount' blocks using a CTR-mode + * Create a psuedorandom output stream of 'bytecount' bytes using a CTR-mode * cipher or similar. The 128-bit counter is supplied in the in-out parmeter - * 'ctr.' The output stream goes to 'd_out.' 'blockcount' RANDOM_BLOCKSIZE - * bytes are generated. + * 'ctr.' The output stream goes to 'd_out.' + * + * If AES is used, 'bytecount' is guaranteed to be a multiple of + * RANDOM_BLOCKSIZE. */ void randomdev_keystream(union randomdev_key *context, uint128_t *ctr, - void *d_out, u_int blockcount) + void *d_out, size_t bytecount) { - u_int i; + size_t i, blockcount, read_chunk; if (random_chachamode) { uint128_t lectr; @@ -147,16 +149,35 @@ randomdev_keystream(union randomdev_key *context, uint le128enc(&lectr, *ctr); chacha_ivsetup(&context->chacha, NULL, (const void *)&lectr); - chacha_encrypt_bytes(&context->chacha, NULL, d_out, - RANDOM_BLOCKSIZE * blockcount); + while (bytecount > 0) { + /* + * We are limited by the chacha_encrypt_bytes API to + * u32 bytes per chunk. + */ + read_chunk = MIN(bytecount, + rounddown((size_t)UINT32_MAX, CHACHA_BLOCKLEN)); + chacha_encrypt_bytes(&context->chacha, NULL, d_out, + read_chunk); + + d_out = (char *)d_out + read_chunk; + bytecount -= read_chunk; + } + /* * Decode Chacha-updated LE counter to native endian and store * it back in the caller's in-out parameter. */ chacha_ctrsave(&context->chacha, (void *)&lectr); *ctr = le128dec(&lectr); + + explicit_bzero(&lectr, sizeof(lectr)); } else { + KASSERT(bytecount % RANDOM_BLOCKSIZE == 0, + ("%s: AES mode invalid bytecount, not a multiple of native " + "block size", __func__)); + + blockcount = bytecount / RANDOM_BLOCKSIZE; for (i = 0; i < blockcount; i++) { /*- * FS&K - r = r|E(K,C) Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/hash.h Mon Jun 17 15:09:12 2019 (r349138) @@ -61,7 +61,7 @@ void randomdev_hash_iterate(struct randomdev_hash *, c void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(union randomdev_key *, const void *); -void randomdev_keystream(union randomdev_key *context, uint128_t *, void *, u_int); +void randomdev_keystream(union randomdev_key *context, uint128_t *, void *, size_t); void randomdev_getkey(union randomdev_key *, const void **, size_t *); #endif /* SYS_DEV_RANDOM_HASH_H_INCLUDED */ Modified: head/sys/dev/random/other_algorithm.c ============================================================================== --- head/sys/dev/random/other_algorithm.c Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/other_algorithm.c Mon Jun 17 15:09:12 2019 (r349138) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #endif /* _KERNEL */ static void random_other_pre_read(void); -static void random_other_read(uint8_t *, u_int); +static void random_other_read(uint8_t *, size_t); static bool random_other_seeded(void); static void random_other_process_event(struct harvest_event *); static void random_other_init_alg(void *); @@ -165,10 +165,10 @@ random_other_pre_read(void) } /* - * void random_other_read(uint8_t *buf, u_int count) + * void random_other_read(uint8_t *buf, size_t count) * * Generate bytes of output into <*buf>. - * You may use the fact that will be a multiple of + * You may NOT use the fact that will be a multiple of * RANDOM_BLOCKSIZE for optimization purposes. * * This function will always be called with your generator @@ -176,7 +176,7 @@ random_other_pre_read(void) * output here, then feel free to KASSERT() or panic(). */ static void -random_other_read(uint8_t *buf, u_int count) +random_other_read(uint8_t *buf, size_t count) { RANDOM_RESEED_LOCK(); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/randomdev.c Mon Jun 17 15:09:12 2019 (r349138) @@ -172,17 +172,21 @@ randomdev_wait_until_seeded(bool interruptible) int READ_RANDOM_UIO(struct uio *uio, bool nonblock) { - uint8_t *random_buf; - int error; - ssize_t read_len, total_read, c; /* 16 MiB takes about 0.08 s CPU time on my 2017 AMD Zen CPU */ #define SIGCHK_PERIOD (16 * 1024 * 1024) const size_t sigchk_period = SIGCHK_PERIOD; - CTASSERT(SIGCHK_PERIOD % PAGE_SIZE == 0); #undef SIGCHK_PERIOD - random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); + uint8_t *random_buf; + size_t total_read, read_len; + ssize_t bufsize; + int error; + + + KASSERT(uio->uio_rw == UIO_READ, ("%s: bogus write", __func__)); + KASSERT(uio->uio_resid >= 0, ("%s: bogus negative resid", __func__)); + p_random_alg_context->ra_pre_read(); error = 0; /* (Un)Blocking logic */ @@ -193,44 +197,64 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) error = randomdev_wait_until_seeded( SEEDWAIT_INTERRUPTIBLE); } - if (error == 0) { - read_rate_increment((uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t)); - total_read = 0; - while (uio->uio_resid && !error) { - read_len = uio->uio_resid; - /* - * Belt-and-braces. - * Round up the read length to a crypto block size multiple, - * which is what the underlying generator is expecting. - * See the random_buf size requirements in the Fortuna code. - */ - read_len = roundup(read_len, RANDOM_BLOCKSIZE); - /* Work in chunks page-sized or less */ - read_len = MIN(read_len, PAGE_SIZE); - p_random_alg_context->ra_read(random_buf, read_len); - c = MIN(uio->uio_resid, read_len); - /* - * uiomove() may yield the CPU before each 'c' bytes - * (up to PAGE_SIZE) are copied out. - */ - error = uiomove(random_buf, c, uio); - total_read += c; - /* - * Poll for signals every few MBs to avoid very long - * uninterruptible syscalls. - */ - if (error == 0 && uio->uio_resid != 0 && - total_read % sigchk_period == 0) { - error = tsleep_sbt(&random_alg_context, PCATCH, - "randrd", SBT_1NS, 0, C_HARDCLOCK); - /* Squash tsleep timeout condition */ - if (error == EWOULDBLOCK) - error = 0; - } + if (error != 0) + return (error); + + read_rate_increment(howmany(uio->uio_resid + 1, sizeof(uint32_t))); + total_read = 0; + + /* Easy to deal with the trivial 0 byte case. */ + if (__predict_false(uio->uio_resid == 0)) + return (0); + + /* + * If memory is plentiful, use maximally sized requests to avoid + * per-call algorithm overhead. But fall back to a single page + * allocation if the full request isn't immediately available. + */ + bufsize = MIN(sigchk_period, (size_t)uio->uio_resid); + random_buf = malloc(bufsize, M_ENTROPY, M_NOWAIT); + if (random_buf == NULL) { + bufsize = PAGE_SIZE; + random_buf = malloc(bufsize, M_ENTROPY, M_WAITOK); + } + + error = 0; + while (uio->uio_resid > 0 && error == 0) { + read_len = MIN((size_t)uio->uio_resid, bufsize); + + p_random_alg_context->ra_read(random_buf, read_len); + + /* + * uiomove() may yield the CPU before each 'read_len' bytes (up + * to bufsize) are copied out. + */ + error = uiomove(random_buf, read_len, uio); + total_read += read_len; + + /* + * Poll for signals every few MBs to avoid very long + * uninterruptible syscalls. + */ + if (error == 0 && uio->uio_resid != 0 && + total_read % sigchk_period == 0) { + error = tsleep_sbt(&random_alg_context, PCATCH, + "randrd", SBT_1NS, 0, C_HARDCLOCK); + /* Squash tsleep timeout condition */ + if (error == EWOULDBLOCK) + error = 0; } - if (error == ERESTART || error == EINTR) - error = 0; } + + /* + * Short reads due to signal interrupt should not indicate error. + * Instead, the uio will reflect that the read was shorter than + * requested. + */ + if (error == ERESTART || error == EINTR) + error = 0; + + explicit_bzero(random_buf, bufsize); free(random_buf, M_ENTROPY); return (error); } @@ -249,7 +273,6 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) void READ_RANDOM(void *random_buf, u_int len) { - u_int read_directly_len; KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); p_random_alg_context->ra_pre_read(); @@ -278,23 +301,7 @@ READ_RANDOM(void *random_buf, u_int len) (void)randomdev_wait_until_seeded(SEEDWAIT_UNINTERRUPTIBLE); } read_rate_increment(roundup2(len, sizeof(uint32_t))); - /* - * The underlying generator expects multiples of - * RANDOM_BLOCKSIZE. - */ - read_directly_len = rounddown(len, RANDOM_BLOCKSIZE); - if (read_directly_len > 0) - p_random_alg_context->ra_read(random_buf, read_directly_len); - if (read_directly_len < len) { - uint8_t remainder_buf[RANDOM_BLOCKSIZE]; - - p_random_alg_context->ra_read(remainder_buf, - sizeof(remainder_buf)); - memcpy((char *)random_buf + read_directly_len, remainder_buf, - len - read_directly_len); - - explicit_bzero(remainder_buf, sizeof(remainder_buf)); - } + p_random_alg_context->ra_read(random_buf, len); } bool Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Mon Jun 17 14:59:45 2019 (r349137) +++ head/sys/dev/random/randomdev.h Mon Jun 17 15:09:12 2019 (r349138) @@ -68,7 +68,7 @@ struct harvest_event; typedef void random_alg_init_t(void *); typedef void random_alg_deinit_t(void *); typedef void random_alg_pre_read_t(void); -typedef void random_alg_read_t(uint8_t *, u_int); +typedef void random_alg_read_t(uint8_t *, size_t); typedef bool random_alg_seeded_t(void); typedef void random_alg_reseed_t(void); typedef void random_alg_eventprocessor_t(struct harvest_event *); Modified: head/tests/sys/devrandom/uint128_test.c ============================================================================== --- head/tests/sys/devrandom/uint128_test.c Mon Jun 17 14:59:45 2019 (r349137) +++ head/tests/sys/devrandom/uint128_test.c Mon Jun 17 15:09:12 2019 (r349138) @@ -209,8 +209,7 @@ ATF_TC_BODY(uint128_chacha_ctr, tc) vec_u32_tole128(expectedle, tests[i].expected); a = le128dec(inputle); - randomdev_keystream(&context, &a, trash, sizeof(trash) / - RANDOM_BLOCKSIZE); + randomdev_keystream(&context, &a, trash, sizeof(trash)); u128_check_equality(le128dec(expectedle), a, tests[i].descr); } From owner-svn-src-head@freebsd.org Mon Jun 17 15:51:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A05F15BDD7C; Mon, 17 Jun 2019 15:51:20 +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 CA4316F811; Mon, 17 Jun 2019 15:51:19 +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 x5HFpGpN009680; Mon, 17 Jun 2019 08:51:16 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5HFpGbI009679; Mon, 17 Jun 2019 08:51:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906171551.x5HFpGbI009679@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349133 - head/share/man/man4 In-Reply-To: To: Niclas Zeising Date: Mon, 17 Jun 2019 08:51:16 -0700 (PDT) CC: rgrimes@freebsd.org, Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CA4316F811 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:51:20 -0000 > On 2019-06-17 12:27, Niclas Zeising wrote: > > On 2019-06-17 11:03, Rodney W. Grimes wrote: > >>> On 2019-06-17 09:56, Benjamin Kaduk wrote: > >>>> On Sun, Jun 16, 2019 at 10:42 PM Niclas Zeising >>>> > wrote: > >>>> > >>>> ???? Author: zeising (doc,ports committer) > >>>> ???? Date: Mon Jun 17 05:41:47 2019 > >>>> ???? New Revision: 349133 > >>>> ???? URL: https://svnweb.freebsd.org/changeset/base/349133 > >>>> > >>>> ???? Log: > >>>> ????? ? pci(4): Document PCIOCATTACHED > >>>> > >>>> ????? ? Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. > >>>> ????? ? PCIOCATTACHED is used to query if a driver has attached to a > >>>> PCI. > >>>> > >>>> ????? ? Reviewed by:? bcr, imp > >>>> ????? ? MFC after:? ? 2 weeks > >>>> ????? ? Differential Revision: https://reviews.freebsd.org/D20652 > >>>> > >>>> ???? Modified: > >>>> ????? ? head/share/man/man4/pci.4 > >>>> > >>>> ???? Modified: head/share/man/man4/pci.4 > >>>> > >>>> ============================================================================== > >>>> > >>>> ???? --- head/share/man/man4/pci.4? ?Mon Jun 17 03:48:44 2019 > >>>> ???? (r349132) > >>>> ???? +++ head/share/man/man4/pci.4? ?Mon Jun 17 05:41:47 2019 > >>>> ???? (r349133) > >>>> ???? @@ -24,7 +24,7 @@ > >>>> ????? ?.\" > >>>> ????? ?.\" $FreeBSD$ > >>>> ????? ?.\" > >>>> ???? -.Dd June 14, 2018 > >>>> ???? +.Dd June 17, 2019 > >>>> ????? ?.Dt PCI 4 > >>>> ????? ?.Os > >>>> ????? ?.Sh NAME > >>>> ???? @@ -333,6 +333,26 @@ The limitations on data width described for > >>>> ????? ?reading registers, above, also apply to writing > >>>> ????? ?.Tn PCI > >>>> ????? ?configuration registers. > >>>> ???? +.It PCIOCATTACHED > >>>> ???? +This > >>>> ???? +.Xr ioctl 2 > >>>> ???? +allows users to query if a driver is attached to the > >>>> ???? +.Tn PCI > >>>> ???? +specified in the passed-in > >>>> > >>>> > >>>> Is there a missing word like "device" here? > >> > >> Actally I think the missing word, in both cases, is register, > >> unless I am misreading some part of the manual page and > >> what a struct pci_io points at.? I guess if the pi_reg is null > >> then this would be device.? Either way there is defanity a > >> missing word. > > > > I'll try to fix this.? In the PCIOCWRITE case, perhaps register is best, > > however, inthe PCIOCATTACHED case, device is best, I think. > > I'll create a patch and put it for review, I'll get back to you once > > it's done. > > Regards > > > > Here's the review with my proposed change. Let me know what you think. > https://reviews.freebsd.org/D20671 This looks good to me, cant login right now to hit accept, but consider the rewview accepted by me too. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 17 16:26:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C508015BE9AA; Mon, 17 Jun 2019 16:26:44 +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 65BD270C83; Mon, 17 Jun 2019 16:26:44 +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 53F9B2FF; Mon, 17 Jun 2019 16:26:44 +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 x5HGQiPP087910; Mon, 17 Jun 2019 16:26:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HGQiFc087909; Mon, 17 Jun 2019 16:26:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906171626.x5HGQiFc087909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 16:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349143 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65BD270C83 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 16:26:44 -0000 Author: ian Date: Mon Jun 17 16:26:43 2019 New Revision: 349143 URL: https://svnweb.freebsd.org/changeset/base/349143 Log: Put the pwmc cdev filenames under the pwm directory along with any label names. I.e., everything related to pwm now goes in /dev/pwm. This will make it easier for userland tools to turn an unqualified name into a fully qualified pathname, whether it's the base pwmcX.Y name or a label name. Modified: head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Mon Jun 17 15:14:26 2019 (r349142) +++ head/sys/dev/pwm/pwmc.c Mon Jun 17 16:26:43 2019 (r349143) @@ -182,7 +182,7 @@ pwmc_attach(device_t dev) args.mda_gid = GID_OPERATOR; args.mda_mode = 0660; args.mda_si_drv1 = sc; - error = make_dev_s(&args, &sc->cdev, "pwmc%d.%d", + error = make_dev_s(&args, &sc->cdev, "pwm/pwmc%d.%d", device_get_unit(device_get_parent(dev)), sc->chan); if (error != 0) { device_printf(dev, "Failed to make PWM device\n"); From owner-svn-src-head@freebsd.org Mon Jun 17 16:43:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD87215BF0C1; Mon, 17 Jun 2019 16:43:34 +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 604797168F; Mon, 17 Jun 2019 16:43:34 +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 38E39670; Mon, 17 Jun 2019 16:43:34 +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 x5HGhYC4098330; Mon, 17 Jun 2019 16:43:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HGhXq8098329; Mon, 17 Jun 2019 16:43:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906171643.x5HGhXq8098329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 16:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349144 - head/usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pwm X-SVN-Commit-Revision: 349144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 604797168F 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.977,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 16:43:35 -0000 Author: ian Date: Mon Jun 17 16:43:33 2019 New Revision: 349144 URL: https://svnweb.freebsd.org/changeset/base/349144 Log: Follow changes in the pwmc(4) driver in relation to device filenames. The driver now names its cdev nodes pwmcX.Y where X is unit number and Y is the channel within that unit. Change the default device name from pwmc0 to pwmc0.0. The driver now puts cdev files and label aliases in the /dev/pwm directory, so allow the user to provide unqualified names with -f and automatically prepend the /dev/pwm part for them. Update the examples in the manpage to show the new device name format and location within /dev/pwm. Modified: head/usr.sbin/pwm/pwm.8 head/usr.sbin/pwm/pwm.c Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Mon Jun 17 16:26:43 2019 (r349143) +++ head/usr.sbin/pwm/pwm.8 Mon Jun 17 16:43:33 2019 (r349144) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2019 +.Dd June 17, 2019 .Dt PWM 8 .Os .Sh NAME @@ -61,8 +61,11 @@ Channel number to operate on .It Fl f Ar device Device to operate on. If not specified, -.Pa /dev/pwmc0 +.Pa /dev/pwm/pwmc0.0 is used. +If an unqualified name is provided, +.Pa /dev/pwm +is automatically prepended. .It Fl E Enable the pwm channel .It Fl D @@ -79,17 +82,21 @@ Configure the duty (in nanoseconds or percentage) of t .It Show the configuration of the pwm channel: .Bd -literal -pwm -f /dev/pwmc0 -C +pwm -f /dev/pwm/pwmc0.1 -C .Ed .It -Configure a 50000 ns period and a 25000 duty cycle: +Configure a 50000 ns period and a 25000 ns duty cycle: .Bd -literal -pwm -f /dev/pwmc0 -p 50000 -d 25000 +pwm -f pwmc1.1 -p 50000 -d 25000 .Ed .It -Configure a 50% duty cycle: +Configure a 50% duty cycle on the device and channel which +were configured in +.Xr pwmc 4 +to have the label +.Pa backlight : .Bd -literal -pwm -f /dev/pwmc0 -d 50% +pwm -f backlight -d 50% .Ed .El .Sh SEE ALSO Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Mon Jun 17 16:26:43 2019 (r349143) +++ head/usr.sbin/pwm/pwm.c Mon Jun 17 16:43:33 2019 (r349144) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,19 @@ #define PWM_PERIOD 0x0008 #define PWM_DUTY 0x0010 +static char device_name[PATH_MAX] = "/dev/pwm/pwmc0.0"; + static void +set_device_name(const char *name) +{ + + if (name[0] == '/') + strlcpy(device_name, name, sizeof(device_name)); + else + snprintf(device_name, sizeof(device_name), "/dev/pwm/%s", name); +} + +static void usage(void) { fprintf(stderr, "Usage:\n"); @@ -72,8 +85,10 @@ main(int argc, char *argv[]) cap_rights_t right_ioctl; const unsigned long pwm_ioctls[] = {PWMGETSTATE, PWMSETSTATE, PWMMAXCHANNEL}; char *percent; + bool setname; action = 0; + setname = false; fd = -1; channel = -1u; period = duty = -1; @@ -115,24 +130,23 @@ main(int argc, char *argv[]) channel = strtoul(optarg, NULL, 10); break; case 'f': - if ((fd = open(optarg, O_RDWR)) < 0) { - fprintf(stderr, "pwm: cannot open %s %s\n", - optarg, strerror(errno)); - exit(1); - } + setname = true; + set_device_name(optarg); + break; } } - if (fd == -1) { - if ((fd = open("/dev/pwmc0", O_RDWR)) < 0) { - fprintf(stderr, "pwm: cannot open %s %s\n", - optarg, strerror(errno)); + if (action == 0) + usage(); + + if ((fd = open(device_name, O_RDWR)) == -1) { + fprintf(stderr, "pwm: cannot open %s: %s\n", + device_name, strerror(errno)); + if (setname) exit(1); - } + else + usage(); } - - if (action == 0 || fd == -1) - usage(); if (caph_limit_stdio() < 0) { fprintf(stderr, "can't limit stdio rights"); From owner-svn-src-head@freebsd.org Mon Jun 17 16:50:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038F015BF319; Mon, 17 Jun 2019 16:50:59 +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 9AB9D718F3; Mon, 17 Jun 2019 16:50:58 +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 7467879E; Mon, 17 Jun 2019 16:50:58 +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 x5HGow1g098725; Mon, 17 Jun 2019 16:50:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HGowg6098724; Mon, 17 Jun 2019 16:50:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906171650.x5HGowg6098724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 17 Jun 2019 16:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349145 - head/usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pwm X-SVN-Commit-Revision: 349145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AB9D718F3 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 16:50:59 -0000 Author: ian Date: Mon Jun 17 16:50:58 2019 New Revision: 349145 URL: https://svnweb.freebsd.org/changeset/base/349145 Log: Put periods at the ends of argument descriptions. Explain the relationship between the period and duty arguments. Modified: head/usr.sbin/pwm/pwm.8 Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Mon Jun 17 16:43:33 2019 (r349144) +++ head/usr.sbin/pwm/pwm.8 Mon Jun 17 16:50:58 2019 (r349145) @@ -57,7 +57,7 @@ utility can be used to configure pwm controllers. The options are as follow: .Bl -tag -width "-c channel" .It Fl c Ar channel -Channel number to operate on +Channel number to operate on. .It Fl f Ar device Device to operate on. If not specified, @@ -67,15 +67,18 @@ If an unqualified name is provided, .Pa /dev/pwm is automatically prepended. .It Fl E -Enable the pwm channel +Enable the pwm channel. .It Fl D -Disable the pwm channel +Disable the pwm channel. .It Fl C -Show the configuration of the pwm channel +Show the configuration of the pwm channel. .It Fl p Ar period Configure the period (in nanoseconds) of the pwm channel .It Fl d Ar duty -Configure the duty (in nanoseconds or percentage) of the pwm channel +Configure the duty (in nanoseconds or percentage) of the pwm channel. +Duty is the portion of the +.Ar period +during which the signal is asserted. .El .Sh EXAMPLES .Bl -bullet From owner-svn-src-head@freebsd.org Mon Jun 17 16:54:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE78215BF42C; Mon, 17 Jun 2019 16:54:52 +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 5FEE271DCD; Mon, 17 Jun 2019 16:54:52 +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 38D6F817; Mon, 17 Jun 2019 16:54:52 +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 x5HGsqYT003737; Mon, 17 Jun 2019 16:54:52 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HGsqQm003736; Mon, 17 Jun 2019 16:54:52 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201906171654.x5HGsqQm003736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 17 Jun 2019 16:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349146 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FEE271DCD 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 16:54:52 -0000 Author: zeising (doc,ports committer) Date: Mon Jun 17 16:54:51 2019 New Revision: 349146 URL: https://svnweb.freebsd.org/changeset/base/349146 Log: pci.4: wordsmith and add missing words Add missing words after PCI in the description of the PCIOCWRITE and PCIOCATTACHED ioctls. Use singular in PCIOCREAD, we only read one register at the time. Reviewed by: bcr, bjk, rgrimes, cem MFC after: 2 weeks X-MFC-with: r349133 Differential Revision: https://reviews.freebsd.org/D20671 Modified: head/share/man/man4/pci.4 Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Mon Jun 17 16:50:58 2019 (r349145) +++ head/share/man/man4/pci.4 Mon Jun 17 16:54:51 2019 (r349146) @@ -290,7 +290,7 @@ This .Xr ioctl 2 reads the .Tn PCI -configuration registers specified by the passed-in +configuration register specified by the passed-in .Va pci_io structure. The @@ -323,7 +323,7 @@ This .Xr ioctl 2 allows users to write to the .Tn PCI -specified in the passed-in +configuration register specified in the passed-in .Va pci_io structure. The @@ -338,7 +338,7 @@ This .Xr ioctl 2 allows users to query if a driver is attached to the .Tn PCI -specified in the passed-in +device specified in the passed-in .Va pci_io structure. The From owner-svn-src-head@freebsd.org Mon Jun 17 16:57:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6EDD15BF50C; Mon, 17 Jun 2019 16:57: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 6AA4472057; Mon, 17 Jun 2019 16:57:45 +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 4699482A; Mon, 17 Jun 2019 16:57:45 +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 x5HGvjnf004008; Mon, 17 Jun 2019 16:57:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HGvjV1004007; Mon, 17 Jun 2019 16:57:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906171657.x5HGvjV1004007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 17 Jun 2019 16:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349148 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 349148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AA4472057 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 16:57:46 -0000 Author: markj Date: Mon Jun 17 16:57:44 2019 New Revision: 349148 URL: https://svnweb.freebsd.org/changeset/base/349148 Log: Add some missing MLINKs for tree(3). MFC after: 3 days Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Mon Jun 17 16:56:51 2019 (r349147) +++ head/share/man/man3/Makefile Mon Jun 17 16:57:44 2019 (r349148) @@ -179,8 +179,21 @@ MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 RB_ENTRY.3 \ tree.3 RB_FIND.3 \ tree.3 RB_FOREACH.3 \ + tree.3 RB_FOREACH_FROM.3 \ tree.3 RB_FOREACH_REVERSE.3 \ + tree.3 RB_FOREACH_REVERSE_FROM.3 \ + tree.3 RB_FOREACH_REVERSE_SAFE.3 \ + tree.3 RB_FOREACH_SAFE.3 \ tree.3 RB_GENERATE.3 \ + tree.3 RB_GENERATE_FIND.3 \ + tree.3 RB_GENERATE_INSERT.3 \ + tree.3 RB_GENERATE_INSERT_COLOR.3 \ + tree.3 RB_GENERATE_MINMAX.3 \ + tree.3 RB_GENERATE_NEXT.3 \ + tree.3 RB_GENERATE_NFIND.3 \ + tree.3 RB_GENERATE_PREV.3 \ + tree.3 RB_GENERATE_REMOVE.3 \ + tree.3 RB_GENERATE_REMOVE_COLOR.3 \ tree.3 RB_GENERATE_STATIC.3 \ tree.3 RB_HEAD.3 \ tree.3 RB_INIT.3 \ @@ -194,6 +207,15 @@ MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 RB_PARENT.3 \ tree.3 RB_PREV.3 \ tree.3 RB_PROTOTYPE.3 \ + tree.3 RB_PROTOTYPE_FIND.3 \ + tree.3 RB_PROTOTYPE_INSERT.3 \ + tree.3 RB_PROTOTYPE_INSERT_COLOR.3 \ + tree.3 RB_PROTOTYPE_MINMAX.3 \ + tree.3 RB_PROTOTYPE_NEXT.3 \ + tree.3 RB_PROTOTYPE_NFIND.3 \ + tree.3 RB_PROTOTYPE_PREV.3 \ + tree.3 RB_PROTOTYPE_REMOVE.3 \ + tree.3 RB_PROTOTYPE_REMOVE_COLOR.3 \ tree.3 RB_PROTOTYPE_STATIC.3 \ tree.3 RB_REMOVE.3 \ tree.3 RB_RIGHT.3 \ From owner-svn-src-head@freebsd.org Mon Jun 17 17:28:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E361D15C02E1; Mon, 17 Jun 2019 17:28:04 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85A8E73237; Mon, 17 Jun 2019 17:28:04 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A08B021650; Mon, 17 Jun 2019 13:27:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 17 Jun 2019 13:27:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=I MD23+se0lQiSNYnxSDZjYVvi1VULxRdBcc35tYJ8Hk=; b=kJb/5h+g6rgTFIllk UmKilVO7jeNVj038MBKWSfhuTmFEB8JFMQsyOq4aVu70HhGjAMaVHJDFMAwm120O IwA61WJ6bME4E77bnKER7JAoi6mpln1qgXjoLWjY6FhJduN72VZsaQJ2Aos1YMTw b8bdhGNX5CY3mXnheUd3C3ixuPXAMuwLelTLzzFq5noZpNDvJ23cl/cA+IuAN6wY Ug+Nli7EWJCcGgEEuTgWtEyDD27ACNzHVRJy1oUV2Y2kr+3UBln+r+PsMdWWdehN ADYk+qjsHlsKHGcIUtft2Hcj3CUDaQZkKrMmyBd+/MtbH4ZBaHXmGwcnNBUZ9NNL UIvRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=IMD23+se0lQiSNYnxSDZjYVvi1VULxRdBcc35tYJ8 Hk=; b=xpBxmfi0Mb9uIAsohuNa5NKY7m/qhdPCtadJ9aQZdhNI3i9+M0HkKIkkq 8MLmO6+FqX2AQfY8ekPsadg/ZhJ/zgWVlR9i2YyrVX4IDrvOFdM68n53/1wD4ExI yVCOfwp0UxV+Th19VVYX0MEinHOUXOs4txtMU4elu8bXXa26OvzMfIqBEu/ooZKK NkgAd/vMMSYUPM96nlb+mtErVnsXJGz2f2IlxGVsoY1k0Jhgu1VSoUiKFn8lGttr UVpyqlqC0JP2uR8pxKZwuJfEoey+cQ+rkDQl3tTIa8r0euZGJGxLq141SwNCjcyJ HbZ+B4gG/0VFdLbUQAy+KXcU8pTFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudeijedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutgho thhtucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucffohhmrghinh epfhhrvggvsghsugdrohhrghenucfkphepudelvddrheehrdehgedrheelnecurfgrrhgr mhepmhgrihhlfhhrohhmpehstghothhtlhesshgrmhhstghordhorhhgnecuvehluhhsth gvrhfuihiivgeptd X-ME-Proxy: Received: from [10.178.24.13] (unknown [192.55.54.59]) by mail.messagingengine.com (Postfix) with ESMTPA id A2C8B380084; Mon, 17 Jun 2019 13:27:57 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r349146 - head/share/man/man4 From: Scott Long In-Reply-To: <201906171654.x5HGsqQm003736@repo.freebsd.org> Date: Mon, 17 Jun 2019 11:27:56 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> References: <201906171654.x5HGsqQm003736@repo.freebsd.org> To: Niclas Zeising X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 85A8E73237 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 17:28:05 -0000 It=E2=80=99s customary to refer to PCI configuration registers in the = plural form. Would you mind changing back from =E2=80=9Cregister=E2=80=9D to = =E2=80=9Cregisters=E2=80=9D? Thanks, Scott > On Jun 17, 2019, at 10:54 AM, Niclas Zeising = wrote: >=20 > Author: zeising (doc,ports committer) > Date: Mon Jun 17 16:54:51 2019 > New Revision: 349146 > URL: https://svnweb.freebsd.org/changeset/base/349146 >=20 > Log: > pci.4: wordsmith and add missing words >=20 > Add missing words after PCI in the description of the PCIOCWRITE and > PCIOCATTACHED ioctls. > Use singular in PCIOCREAD, we only read one register at the time. >=20 > Reviewed by: bcr, bjk, rgrimes, cem > MFC after: 2 weeks > X-MFC-with: r349133 > Differential Revision: https://reviews.freebsd.org/D20671 >=20 > Modified: > head/share/man/man4/pci.4 >=20 > Modified: head/share/man/man4/pci.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man4/pci.4 Mon Jun 17 16:50:58 2019 = (r349145) > +++ head/share/man/man4/pci.4 Mon Jun 17 16:54:51 2019 = (r349146) > @@ -290,7 +290,7 @@ This > .Xr ioctl 2 > reads the > .Tn PCI > -configuration registers specified by the passed-in > +configuration register specified by the passed-in > .Va pci_io > structure. > The > @@ -323,7 +323,7 @@ This > .Xr ioctl 2 > allows users to write to the > .Tn PCI > -specified in the passed-in > +configuration register specified in the passed-in > .Va pci_io > structure. > The > @@ -338,7 +338,7 @@ This > .Xr ioctl 2 > allows users to query if a driver is attached to the > .Tn PCI > -specified in the passed-in > +device specified in the passed-in > .Va pci_io > structure. > The >=20 From owner-svn-src-head@freebsd.org Mon Jun 17 17:35:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C756515C063F; Mon, 17 Jun 2019 17:35:56 +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 6C73E737AF; Mon, 17 Jun 2019 17:35:56 +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 34FA0EE1; Mon, 17 Jun 2019 17:35:56 +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 x5HHZur3024862; Mon, 17 Jun 2019 17:35:56 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HHZuR6024861; Mon, 17 Jun 2019 17:35:56 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201906171735.x5HHZuR6024861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 17 Jun 2019 17:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349150 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C73E737AF 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 17:35:56 -0000 Author: zeising (doc,ports committer) Date: Mon Jun 17 17:35:55 2019 New Revision: 349150 URL: https://svnweb.freebsd.org/changeset/base/349150 Log: pci.4: Use plural configuration registers It is customary to use plural when talking about PCI configure registers. Reported by: scottl MFC after: 2 weeks X-MFC-with: r349133 Modified: head/share/man/man4/pci.4 Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Mon Jun 17 17:17:01 2019 (r349149) +++ head/share/man/man4/pci.4 Mon Jun 17 17:35:55 2019 (r349150) @@ -307,7 +307,7 @@ from the ioctl. .It pi_reg The .Tn PCI -configuration register the user would like to access. +configuration registers the user would like to access. .It pi_width The width, in bytes, of the data the user would like to read. This value @@ -323,7 +323,7 @@ This .Xr ioctl 2 allows users to write to the .Tn PCI -configuration register specified in the passed-in +configuration registers specified in the passed-in .Va pci_io structure. The From owner-svn-src-head@freebsd.org Mon Jun 17 17:37:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912C815C06F9; Mon, 17 Jun 2019 17:37:05 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 27B2773911; Mon, 17 Jun 2019 17:37:04 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45SJLQ55yXz3klm; Mon, 17 Jun 2019 17:37:02 +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 eCsunEAAw9_p; Mon, 17 Jun 2019 17:37:02 +0000 (UTC) Received: from garnet.daemonic.se (host-90-236-237-150.mobileonline.telia.com [90.236.237.150]) by mail.daemonic.se (Postfix) with ESMTPSA id 45SJLQ0XlNz3c7W; Mon, 17 Jun 2019 17:37:02 +0000 (UTC) Subject: Re: svn commit: r349146 - head/share/man/man4 To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906171654.x5HGsqQm003736@repo.freebsd.org> <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> From: Niclas Zeising Message-ID: <93b16d84-667f-5d3c-f75f-7fd8b17c2d6e@freebsd.org> Date: Mon, 17 Jun 2019 19:37:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 27B2773911 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.968,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 17:37:05 -0000 On 2019-06-17 19:27, Scott Long wrote: > It=E2=80=99s customary to refer to PCI configuration registers in the p= lural form. Would > you mind changing back from =E2=80=9Cregister=E2=80=9D to =E2=80=9Cregi= sters=E2=80=9D? >=20 I didn't know that. Changed in r349150 Regards --=20 Niclas From owner-svn-src-head@freebsd.org Mon Jun 17 17:42:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8075115C0988; Mon, 17 Jun 2019 17:42:09 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.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 24B097421B; Mon, 17 Jun 2019 17:42:09 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8CB56216CA; Mon, 17 Jun 2019 13:42:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 17 Jun 2019 13:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=V +3esD3OO58IWGeqm4ctL524itfhz9PExTywXNsXGQ8=; b=kfCSpKso8gQs+feXG m6jxIRnfQXbTqd7NtTTYztoxC5+nd8C6suI/tQ7h71U7ZM4JlpIR/mDNQXEmeqvS LfNkO16FtC6+z889v5XjD8/hzLil2sDNneGvgDeKer11Z7V2u+JRTiUkr/bE54xA wtnpBS7jHkW9Wcg7pxl7iMyrgQRHzQKdlKM56AJ1e3ZGTNPLbwFMY4lHD3RuQTwc WLDmofiglCk0k855jCjM2PBDR8RYrlixA8aoZM1klDWOtt68l6Cwsfg3PBj9KG8h TYcSpkmPpfDvCLgWoeGQu4KiQ+ITFzciY27zMP8KI9VP3Xu6fMJJ7lR39p4wlidL 2k/kA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=V+3esD3OO58IWGeqm4ctL524itfhz9PExTywXNsXG Q8=; b=zuPbAcYpYMT/JTpZn9e09ahFYeB3gIL8c1OSTf8hJb7HJZ5X2MeT93V/E y9rqdw3n1LFxAuI4jqG2KzMw2uisXCkgA/6VjMbvQ137hEeWDwgwyS+Ul66yz/+H lKggTNwUoqbwAnZC5E2WkfrqKl2iUqHcCNx62t9lmoL9i0nMCHT2r9ETWeBLrAWk wJy8+kJDt+/NSUQZWmtGLLoZzPS/tbE01V8uzwwPmMpzyaXpK+3ngwQWLF1OLsdK 3OxcNukYhGd61xB8Sa1Vmqp2O6pdGzcy1a8HUM5cK3QyEtytWrUD3QL3Ws83o6Uy p5A4zu/JYOpIlCBypO/CMXwu6nQ0g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudeijedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutgho thhtucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucfkphepudelvd drheehrdehgedrheelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehstghothhtlhesshgr mhhstghordhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [10.178.24.13] (unknown [192.55.54.59]) by mail.messagingengine.com (Postfix) with ESMTPA id 2FA018005B; Mon, 17 Jun 2019 13:42:00 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r349146 - head/share/man/man4 From: Scott Long In-Reply-To: <93b16d84-667f-5d3c-f75f-7fd8b17c2d6e@freebsd.org> Date: Mon, 17 Jun 2019 11:41:57 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201906171654.x5HGsqQm003736@repo.freebsd.org> <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> <93b16d84-667f-5d3c-f75f-7fd8b17c2d6e@freebsd.org> To: Niclas Zeising X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 24B097421B 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 17:42:09 -0000 > On Jun 17, 2019, at 11:37 AM, Niclas Zeising = wrote: >=20 > On 2019-06-17 19:27, Scott Long wrote: >> It=E2=80=99s customary to refer to PCI configuration registers in the = plural form. Would >> you mind changing back from =E2=80=9Cregister=E2=80=9D to = =E2=80=9Cregisters=E2=80=9D? >=20 > I didn't know that. > Changed in r349150 > Regards > =E2=80=94 =08=0D> =0D Thanks! Scott From owner-svn-src-head@freebsd.org Mon Jun 17 17:47:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B53B15C0C81 for ; Mon, 17 Jun 2019 17:47:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 2798B746B2 for ; Mon, 17 Jun 2019 17:47:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id x47so11729591qtk.11 for ; Mon, 17 Jun 2019 10:47:11 -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=CZ718nch003tapjLCQBtXkcyMeXI6VwB2g+BTwdmE2Q=; b=rJhJj9EGkevInZMWDPfSrT18r/UVFKv2Ef+8cw7R6Ey9s/PVEZG70j6joF6EAKV77Y 40QcYXsdRBWDoKO4vksGnbQgedUHC97kidnvoF3tnYLzCqTjVuhIqsaF38TFbsPOhiIl XREpsMv1LqwRXWTW1qKlZx+EqlQb10xJbfhsArsPJhvXVXYF7lCLizjTa3BhdzLfxgSJ pmWWj9Optd/nTHGP8IbEY9bULj9C9vT31DhktlnrCUoUdP4KaeWfTMKtPmThKfoIf5B0 C1GftK86n8hpZTmTUqIqfelXu6gDC26OYl8jURCWAPM/1nfMqSsCChAUrAJac1sZzaol HJxQ== 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=CZ718nch003tapjLCQBtXkcyMeXI6VwB2g+BTwdmE2Q=; b=YYYW4MCqX1HWO/gka0kHVaNpdXF48hnDI+O9PYupXdNE1z0PwbI0LLAgLg3Bz8juof CNI5vXYwaXMytXDxBj8aseu1VviGrCNEFunF9dYH3rMJbMhimQCk8b6wYygz1vGJI/wN vXId7wtr/QykWvKrW8JwyCOAfkT5BtcgFjBFoMRhN0oqUJoauj+gFNA9oZKw5stI0JOa IOuUzTAX5UPbw7DY/zaY8z40TwPyxyZlJ1hZgyWIdEumuxNpzUenmVBl1YgE/woTaUhh YqrnMpO6bjdWzwtCYkotCFW/5QB1lx1n4ciQp2uQA+47lAXaO5SUeoAOHl0jXIjMSY+N x1fg== X-Gm-Message-State: APjAAAUcL0DuVMoUWDprBl0s6hqWG+RoyG8OorTsoFOHc+ioGLk2Y+w7 ZAl/Eco4g1IPg+QHE9Q/wCizrkzo982+NEB8Q2fAXg== X-Google-Smtp-Source: APXvYqzdidCGu5nShtibCPTzlk2xhhLwiniU06VH3CmiakZQZN8D1/EDmUjcZJcRaN0O7AkiCGihFKQk2MdY2dk4Ey8= X-Received: by 2002:a0c:9230:: with SMTP id a45mr22453156qva.188.1560793627209; Mon, 17 Jun 2019 10:47:07 -0700 (PDT) MIME-Version: 1.0 References: <201906171654.x5HGsqQm003736@repo.freebsd.org> <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> In-Reply-To: <223A02B4-20E2-4973-B3E1-9E5D8E1B0D20@samsco.org> From: Warner Losh Date: Mon, 17 Jun 2019 10:46:54 -0700 Message-ID: Subject: Re: svn commit: r349146 - head/share/man/man4 To: Scott Long Cc: Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 2798B746B2 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 17:47:11 -0000 Especially since there can be multiple PCI registers that can be read in 1 32-bit transaction. Warner On Mon, Jun 17, 2019, 10:28 AM Scott Long wrote: > It=E2=80=99s customary to refer to PCI configuration registers in the plu= ral > form. Would > you mind changing back from =E2=80=9Cregister=E2=80=9D to =E2=80=9Cregist= ers=E2=80=9D? > > Thanks, > Scott > > > > On Jun 17, 2019, at 10:54 AM, Niclas Zeising > wrote: > > > > Author: zeising (doc,ports committer) > > Date: Mon Jun 17 16:54:51 2019 > > New Revision: 349146 > > URL: https://svnweb.freebsd.org/changeset/base/349146 > > > > Log: > > pci.4: wordsmith and add missing words > > > > Add missing words after PCI in the description of the PCIOCWRITE and > > PCIOCATTACHED ioctls. > > Use singular in PCIOCREAD, we only read one register at the time. > > > > Reviewed by: bcr, bjk, rgrimes, cem > > MFC after: 2 weeks > > X-MFC-with: r349133 > > Differential Revision: https://reviews.freebsd.org/D20671 > > > > Modified: > > head/share/man/man4/pci.4 > > > > Modified: head/share/man/man4/pci.4 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man4/pci.4 Mon Jun 17 16:50:58 2019 (r349145) > > +++ head/share/man/man4/pci.4 Mon Jun 17 16:54:51 2019 (r349146) > > @@ -290,7 +290,7 @@ This > > .Xr ioctl 2 > > reads the > > .Tn PCI > > -configuration registers specified by the passed-in > > +configuration register specified by the passed-in > > .Va pci_io > > structure. > > The > > @@ -323,7 +323,7 @@ This > > .Xr ioctl 2 > > allows users to write to the > > .Tn PCI > > -specified in the passed-in > > +configuration register specified in the passed-in > > .Va pci_io > > structure. > > The > > @@ -338,7 +338,7 @@ This > > .Xr ioctl 2 > > allows users to query if a driver is attached to the > > .Tn PCI > > -specified in the passed-in > > +device specified in the passed-in > > .Va pci_io > > structure. > > The > > > > > From owner-svn-src-head@freebsd.org Mon Jun 17 19:49:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEB6C15C2F5B; Mon, 17 Jun 2019 19:49:15 +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 9B1C177C72; Mon, 17 Jun 2019 19:49:15 +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 7873C2530; Mon, 17 Jun 2019 19:49:15 +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 x5HJnFtT091143; Mon, 17 Jun 2019 19:49:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HJn9Ed091108; Mon, 17 Jun 2019 19:49:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201906171949.x5HJn9Ed091108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jun 2019 19:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/kern sys/libkern sys/libkern... X-SVN-Commit-Revision: 349151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B1C177C72 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 19:49:16 -0000 Author: delphij Date: Mon Jun 17 19:49:08 2019 New Revision: 349151 URL: https://svnweb.freebsd.org/changeset/base/349151 Log: Separate kernel crc32() implementation to its own header (gsb_crc32.h) and rename the source to gsb_crc32.c. This is a prerequisite of unifying kernel zlib instances. PR: 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D20193 Added: head/sys/libkern/gsb_crc32.c - copied, changed from r349150, head/sys/libkern/crc32.c head/sys/sys/gsb_crc32.h (contents, props changed) Deleted: head/sys/libkern/crc32.c Modified: head/lib/libufs/Makefile head/stand/libsa/crc32_libkern.c head/sys/conf/files head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi_initiator/isc_subr.c head/sys/dev/liquidio/lio_bsd.h head/sys/dev/usb/net/if_cdce.c head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/nandfs/nandfs_segment.c head/sys/fs/nandfs/nandfs_subr.c head/sys/fs/nandfs/nandfs_vfsops.c head/sys/geom/part/g_part_bsd64.c head/sys/geom/part/g_part_gpt.c head/sys/geom/raid/md_ddf.c head/sys/kern/subr_compressor.c head/sys/libkern/x86/crc32_sse42.c head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/sctp_crc32.c head/sys/netpfil/pf/pf.c head/sys/sys/libkern.h head/sys/sys/param.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/tests/sys/kern/Makefile head/tests/sys/kern/libkern_crc32.c Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Mon Jun 17 17:35:55 2019 (r349150) +++ head/lib/libufs/Makefile Mon Jun 17 19:49:08 2019 (r349151) @@ -5,7 +5,8 @@ LIB= ufs SHLIBDIR?= /lib SHLIB_MAJOR= 7 -SRCS= block.c cgroup.c crc32.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c +SRCS= block.c cgroup.c gsb_crc32.c inode.c sblock.c type.c ffs_subr.c +SRCS+= ffs_tables.c INCS= libufs.h MAN= bread.3 cgread.3 getinode.3 libufs.3 sbread.3 ufs_disk_close.3 Modified: head/stand/libsa/crc32_libkern.c ============================================================================== --- head/stand/libsa/crc32_libkern.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/stand/libsa/crc32_libkern.c Mon Jun 17 19:49:08 2019 (r349151) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#include "../../sys/libkern/crc32.c" +#include "../../sys/libkern/gsb_crc32.c" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/conf/files Mon Jun 17 19:49:08 2019 (r349151) @@ -3982,9 +3982,9 @@ crypto/chacha20/chacha.c standard libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard -libkern/crc32.c standard libkern/explicit_bzero.c standard libkern/fnmatch.c standard +libkern/gsb_crc32.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv libkern/iconv_ucs.c optional libiconv Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/dev/iscsi/icl_soft.c Mon Jun 17 19:49:08 2019 (r349151) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_subr.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/dev/iscsi_initiator/isc_subr.c Mon Jun 17 19:49:08 2019 (r349151) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/liquidio/lio_bsd.h ============================================================================== --- head/sys/dev/liquidio/lio_bsd.h Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/dev/liquidio/lio_bsd.h Mon Jun 17 19:49:08 2019 (r349151) @@ -36,6 +36,7 @@ #define __LIO_BSD_H__ #include +#include #include #include #include Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/dev/usb/net/if_cdce.c Mon Jun 17 19:49:08 2019 (r349151) @@ -50,7 +50,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/fs/ext2fs/ext2_csum.c Mon Jun 17 19:49:08 2019 (r349151) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/nandfs/nandfs_segment.c ============================================================================== --- head/sys/fs/nandfs/nandfs_segment.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/fs/nandfs/nandfs_segment.c Mon Jun 17 19:49:08 2019 (r349151) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/fs/nandfs/nandfs_subr.c ============================================================================== --- head/sys/fs/nandfs/nandfs_subr.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/fs/nandfs/nandfs_subr.c Mon Jun 17 19:49:08 2019 (r349151) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/fs/nandfs/nandfs_vfsops.c Mon Jun 17 19:49:08 2019 (r349151) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/geom/part/g_part_bsd64.c Mon Jun 17 19:49:08 2019 (r349151) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/geom/part/g_part_gpt.c Mon Jun 17 19:49:08 2019 (r349151) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/geom/raid/md_ddf.c Mon Jun 17 19:49:08 2019 (r349151) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/kern/subr_compressor.c Mon Jun 17 19:49:08 2019 (r349151) @@ -66,6 +66,7 @@ SET_DECLARE(compressors, struct compressor_methods); #ifdef GZIO +#include #include struct gz_stream { Copied and modified: head/sys/libkern/gsb_crc32.c (from r349150, head/sys/libkern/crc32.c) ============================================================================== --- head/sys/libkern/crc32.c Mon Jun 17 17:35:55 2019 (r349150, copy source) +++ head/sys/libkern/gsb_crc32.c Mon Jun 17 19:49:08 2019 (r349151) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include #include +#include #if defined(__amd64__) || defined(__i386__) #include Modified: head/sys/libkern/x86/crc32_sse42.c ============================================================================== --- head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/libkern/x86/crc32_sse42.c Mon Jun 17 19:49:08 2019 (r349151) @@ -29,14 +29,14 @@ __FBSDID("$FreeBSD$"); /* * This file is compiled in userspace in order to run ATF unit tests. */ -#ifdef USERSPACE_TESTING +#ifndef _KERNEL #include #include #else #include -#include #include #endif +#include static __inline uint32_t _mm_crc32_u8(uint32_t x, uint8_t y) @@ -199,7 +199,7 @@ crc32c_shift(uint32_t zeros[][256], uint32_t crc) /* Initialize tables for shifting crcs. */ static void -#ifdef USERSPACE_TESTING +#ifndef _KERNEL __attribute__((__constructor__)) #endif crc32c_init_hw(void) @@ -214,9 +214,6 @@ SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32 #endif /* Compute CRC-32C using the Intel hardware instruction. */ -#ifdef USERSPACE_TESTING -uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); -#endif uint32_t sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) { Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/netinet/libalias/alias_sctp.c Mon Jun 17 19:49:08 2019 (r349151) @@ -75,6 +75,7 @@ #ifdef _KERNEL #include #include +#include #include #include #include Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/netinet/sctp_crc32.c Mon Jun 17 19:49:08 2019 (r349151) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "opt_sctp.h" +#include #ifdef SCTP #include #include Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/netpfil/pf/pf.c Mon Jun 17 19:49:08 2019 (r349151) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Added: head/sys/sys/gsb_crc32.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/gsb_crc32.h Mon Jun 17 19:49:08 2019 (r349151) @@ -0,0 +1,47 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _SYS_GSB_CRC32_H_ +#define _SYS_GSB_CRC32_H_ + +#include + +#ifdef _KERNEL + +extern const uint32_t crc32_tab[]; + +static __inline uint32_t +crc32_raw(const void *buf, size_t size, uint32_t crc) +{ + const uint8_t *p = (const uint8_t *)buf; + + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc); +} + +static __inline uint32_t +crc32(const void *buf, size_t size) +{ + uint32_t crc; + + crc = crc32_raw(buf, size, ~0U); + return (crc ^ ~0U); +} + +uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, + unsigned int length); +#endif + +#if defined(__amd64__) || defined(__i386__) +uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); +#endif +#if defined(__aarch64__) +uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned int); +#endif + +#endif /* !_SYS_GSB_CRC32_H_ */ Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/sys/libkern.h Mon Jun 17 19:49:08 2019 (r349151) @@ -190,39 +190,6 @@ size_t strspn(const char *, const char *); char *strstr(const char *, const char *); int strvalid(const char *, size_t); -extern const uint32_t crc32_tab[]; - -static __inline uint32_t -crc32_raw(const void *buf, size_t size, uint32_t crc) -{ - const uint8_t *p = (const uint8_t *)buf; - - while (size--) - crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - return (crc); -} - -static __inline uint32_t -crc32(const void *buf, size_t size) -{ - uint32_t crc; - - crc = crc32_raw(buf, size, ~0U); - return (crc ^ ~0U); -} - -uint32_t -calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, - unsigned int length); -#ifdef _KERNEL -#if defined(__amd64__) || defined(__i386__) -uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); -#endif -#if defined(__aarch64__) -uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned int); -#endif -#endif - static __inline char * index(const char *p, int ch) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/sys/param.h Mon Jun 17 19:49:08 2019 (r349151) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300031 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300032 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jun 17 19:49:08 2019 (r349151) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/ufs/ffs/ffs_snapshot.c Mon Jun 17 19:49:08 2019 (r349151) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/ufs/ffs/ffs_subr.c Mon Jun 17 19:49:08 2019 (r349151) @@ -59,6 +59,7 @@ struct malloc_type; #else /* _KERNEL */ #include +#include #include #include #include Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jun 17 19:49:08 2019 (r349151) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon Jun 17 17:35:55 2019 (r349150) +++ head/tests/sys/kern/Makefile Mon Jun 17 19:49:08 2019 (r349151) @@ -46,7 +46,6 @@ LIBADD.mqueue_test+= rt ${MACHINE_ARCH} == "i386" || \ ${MACHINE_ARCH} == "aarch64" ATF_TESTS_C+= libkern_crc32 -CFLAGS.libkern_crc32+= -DUSERSPACE_TESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c .else Modified: head/tests/sys/kern/libkern_crc32.c ============================================================================== --- head/tests/sys/kern/libkern_crc32.c Mon Jun 17 17:35:55 2019 (r349150) +++ head/tests/sys/kern/libkern_crc32.c Mon Jun 17 19:49:08 2019 (r349151) @@ -27,16 +27,13 @@ */ #include +#include #include #include -#if defined(__amd64__) || defined(__i386__) -extern uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); -#elif defined(__aarch64__) -extern uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned); -#else +#if !defined(__amd64__) && !defined(__i386__) && !defined(__aarch64__) #error These tests are not supported on this platform #endif From owner-svn-src-head@freebsd.org Mon Jun 17 20:10:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6946315C33FC; Mon, 17 Jun 2019 20:10:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3CA58075C; Mon, 17 Jun 2019 20:10:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD90728AD; Mon, 17 Jun 2019 20:10:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HKAt9w003688; Mon, 17 Jun 2019 20:10:55 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HKAtLn003687; Mon, 17 Jun 2019 20:10:55 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906172010.x5HKAtLn003687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 17 Jun 2019 20:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349152 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3CA58075C 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 20:10:56 -0000 Author: cy Date: Mon Jun 17 20:10:55 2019 New Revision: 349152 URL: https://svnweb.freebsd.org/changeset/base/349152 Log: Make ipf_objbytes a constant. ipf_objbytes is a table of internal data structures that are saved across reboots by ipfs(8). The table is not changed at runtime. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Mon Jun 17 19:49:08 2019 (r349151) +++ head/sys/contrib/ipfilter/netinet/fil.c Mon Jun 17 20:10:55 2019 (r349152) @@ -6254,7 +6254,7 @@ ipf_ioctlswitch(softc, unit, data, cmd, mode, uid, ctx * Flags: * 1 = minimum size, not absolute size */ -static int ipf_objbytes[IPFOBJ_COUNT][3] = { +static const int ipf_objbytes[IPFOBJ_COUNT][3] = { { 1, sizeof(struct frentry), 5010000 }, /* 0 */ { 1, sizeof(struct friostat), 5010000 }, { 0, sizeof(struct fr_info), 5010000 }, From owner-svn-src-head@freebsd.org Mon Jun 17 20:11:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE6915C3422; Mon, 17 Jun 2019 20:11:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B67328083C; Mon, 17 Jun 2019 20:11:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69F2028BB; Mon, 17 Jun 2019 20:11:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HKB3vL003777; Mon, 17 Jun 2019 20:11:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HKB3ec003776; Mon, 17 Jun 2019 20:11:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906172011.x5HKB3ec003776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 17 Jun 2019 20:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349153 - in head/libexec/rc: . rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/libexec/rc: . rc.d X-SVN-Commit-Revision: 349153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B67328083C 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 20:11:09 -0000 Author: cy Date: Mon Jun 17 20:11:02 2019 New Revision: 349153 URL: https://svnweb.freebsd.org/changeset/base/349153 Log: Allow the hostapd program to be specified. This allows users to use hostapd from ports instead of the one in base. The default is the hostapd in base. PR: 238571 MFC after: 1 week Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.d/hostapd Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Mon Jun 17 20:10:55 2019 (r349152) +++ head/libexec/rc/rc.conf Mon Jun 17 20:11:02 2019 (r349153) @@ -275,6 +275,7 @@ ppp_user="root" # Which user to run ppp as # profile3 uses default ppp_mode and ppp_nat ### Network daemon (miscellaneous) ### +hostapd_program="/usr/sbin/hostapd" hostapd_enable="NO" # Run hostap daemon. syslogd_enable="YES" # Run syslog daemon (or NO). syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. Modified: head/libexec/rc/rc.d/hostapd ============================================================================== --- head/libexec/rc/rc.d/hostapd Mon Jun 17 20:10:55 2019 (r349152) +++ head/libexec/rc/rc.d/hostapd Mon Jun 17 20:11:02 2019 (r349153) @@ -11,7 +11,7 @@ name="hostapd" desc="Authenticator for IEEE 802.11 networks" -command="/usr/sbin/${name}" +command=${hostapd_program} ifn="$2" if [ -z "$ifn" ]; then From owner-svn-src-head@freebsd.org Mon Jun 17 20:29:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31EB515C3B8D; Mon, 17 Jun 2019 20:29: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 CCAB0812A4; Mon, 17 Jun 2019 20:29: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 A15812C01; Mon, 17 Jun 2019 20:29: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 x5HKTEFa011526; Mon, 17 Jun 2019 20:29:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HKTDb2011520; Mon, 17 Jun 2019 20:29:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906172029.x5HKTDb2011520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 17 Jun 2019 20:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349154 - in head: sys/dev/random tests/sys/devrandom X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/dev/random tests/sys/devrandom X-SVN-Commit-Revision: 349154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCAB0812A4 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.948,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 20:29:15 -0000 Author: cem Date: Mon Jun 17 20:29:13 2019 New Revision: 349154 URL: https://svnweb.freebsd.org/changeset/base/349154 Log: random(4): Fortuna: allow increased concurrency Add experimental feature to increase concurrency in Fortuna. As this diverges slightly from canonical Fortuna, and due to the security sensitivity of random(4), it is off by default. To enable it, set the tunable kern.random.fortuna.concurrent_read="1". The rest of this commit message describes the behavior when enabled. Readers continue to update shared Fortuna state under global mutex, as they do in the status quo implementation of the algorithm, but shift the actual PRF generation out from under the global lock. This massively reduces the CPU time readers spend holding the global lock, allowing for increased concurrency on SMP systems and less bullying of the harvestq kthread. It is somewhat of a deviation from FS&K. I think the primary difference is that the specific sequence of AES keys will differ if READ_RANDOM_UIO is accessed concurrently (as the 2nd thread to take the mutex will no longer receive a key derived from rekeying the first thread). However, I believe the goals of rekeying AES are maintained: trivially, we continue to rekey every 1MB for the statistical property; and each consumer gets a forward-secret, independent AES key for their PRF. Since Chacha doesn't need to rekey for sequences of any length, this change makes no difference to the sequence of Chacha keys and PRF generated when Chacha is used in place of AES. On a GENERIC 4-thread VM (so, INVARIANTS/WITNESS, numbers not necessarily representative), 3x concurrent AES performance jumped from ~55 MiB/s per thread to ~197 MB/s per thread. Concurrent Chacha20 at 3 threads went from roughly ~113 MB/s per thread to ~430 MB/s per thread. Prior to this change, the system was extremely unresponsive with 3-4 concurrent random readers; each thread had high variance in latency and throughput, depending on who got lucky and won the lock. "rand_harvestq" thread CPU use was high (double digits), seemingly due to spinning on the global lock. After the change, concurrent random readers and the system in general are much more responsive, and rand_harvestq CPU use dropped to basically zero. Tests are added to the devrandom suite to ensure the uint128_add64 primitive utilized by unlocked read functions to specification. Reviewed by: markm Approved by: secteam(delphij) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20313 Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/fortuna.h head/sys/dev/random/hash.c head/sys/dev/random/hash.h head/sys/dev/random/uint128.h head/tests/sys/devrandom/uint128_test.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Jun 17 20:11:02 2019 (r349153) +++ head/sys/dev/random/fortuna.c Mon Jun 17 20:29:13 2019 (r349154) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include "unit_test.h" #endif /* _KERNEL */ +#include #include #include @@ -75,7 +76,10 @@ __FBSDID("$FreeBSD$"); /* Defined in FS&K */ #define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ #define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */ -#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes in a single read */ +#define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes from AES before rekeying */ +#define RANDOM_FORTUNA_BLOCKS_PER_KEY (1 << 16) /* Max blocks from AES before rekeying */ +CTASSERT(RANDOM_FORTUNA_BLOCKS_PER_KEY * RANDOM_BLOCKSIZE == + RANDOM_FORTUNA_MAX_READ); /* * The allowable range of RANDOM_FORTUNA_DEFPOOLSIZE. The default value is above. @@ -120,6 +124,26 @@ static struct fortuna_state { mtx_t fs_mtx; } fortuna_state; +/* + * Experimental concurrent reads feature. For now, disabled by default. But + * we may enable it in the future. + * + * The benefit is improved concurrency in Fortuna. That is reflected in two + * related aspects: + * + * 1. Concurrent devrandom readers can achieve similar throughput to a single + * reader thread. + * + * 2. The rand_harvestq process spends much less time spinning when one or more + * readers is processing a large request. Partially this is due to + * rand_harvestq / ra_event_processor design, which only passes one event at + * a time to the underlying algorithm. Each time, Fortuna must take its + * global state mutex, potentially blocking on a reader. Our adaptive + * mutexes assume that a lock holder currently on CPU will release the lock + * quickly, and spin if the owning thread is currently running. + */ +static bool fortuna_concurrent_read __read_frequently = false; + #ifdef _KERNEL static struct sysctl_ctx_list random_clist; RANDOM_CHECK_UINT(fs_minpoolsize, RANDOM_FORTUNA_MINPOOLSIZE, RANDOM_FORTUNA_MAXPOOLSIZE); @@ -176,6 +200,11 @@ random_fortuna_init_alg(void *unused __unused) random_check_uint_fs_minpoolsize, "IU", "Minimum pool size necessary to cause a reseed"); KASSERT(fortuna_state.fs_minpoolsize > 0, ("random: Fortuna threshold must be > 0 at startup")); + + SYSCTL_ADD_BOOL(&random_clist, SYSCTL_CHILDREN(random_fortuna_o), + OID_AUTO, "concurrent_read", CTLFLAG_RDTUN, + &fortuna_concurrent_read, 0, "If non-zero, enable EXPERIMENTAL " + "feature to improve concurrent Fortuna performance."); #endif /*- @@ -306,48 +335,6 @@ random_fortuna_reseed_internal(uint32_t *entropy_data, } /*- - * FS&K - PseudoRandomData() - * - * If Chacha20 is used, output size is unrestricted. If AES-CTR is used, - * output size MUST be <= 1MB and a multiple of RANDOM_BLOCKSIZE. The - * reasoning for this is discussed in FS&K 9.4; the significant distinction - * between the two ciphers is that AES has a *block* size of 128 bits while - * Chacha has a *block* size of 512 bits. - */ -static __inline void -random_fortuna_genrandom(uint8_t *buf, size_t bytecount) -{ - uint8_t newkey[RANDOM_KEYSIZE]; - - RANDOM_RESEED_ASSERT_LOCK_OWNED(); - - /*- - * FS&K - assert(n < 2^20 (== 1 MB)) when 128-bit block cipher is used - * - r = first-n-bytes(GenerateBlocks(ceil(n/16))) - * - K = GenerateBlocks(2) - */ - KASSERT(random_chachamode || bytecount <= RANDOM_FORTUNA_MAX_READ, - ("%s: invalid large read request: %zu bytes", __func__, - bytecount)); - - /* - * This is where FS&K would invoke GenerateBlocks(). GenerateBlocks() - * doesn't make a lot of sense or have much value if we use bytecount - * for the API (which is useful for ciphers that do not require - * block-sized output, like Chacha20). - * - * Just invoke our PRF abstraction directly, which is responsible for - * updating fs_counter ('C'). - */ - randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, - buf, bytecount); - randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, - newkey, sizeof(newkey)); - randomdev_encrypt_init(&fortuna_state.fs_key, newkey); - explicit_bzero(newkey, sizeof(newkey)); -} - -/*- * FS&K - RandomData() (Part 1) * Used to return processed entropy from the PRNG. There is a pre_read * required to be present (but it can be a stub) in order to allow @@ -433,75 +420,267 @@ random_fortuna_pre_read(void) explicit_bzero(temp, sizeof(temp)); } -/*- - * FS&K - RandomData() (Part 2) - * Main read from Fortuna, continued. May be called multiple times after - * the random_fortuna_pre_read() above. +/* + * This is basically GenerateBlocks() from FS&K. * - * The supplied buf MAY not be a multiple of RANDOM_BLOCKSIZE in size; it is - * the responsibility of the algorithm to accommodate partial block reads, if a - * block output mode is used. + * It differs in two ways: + * + * 1. Chacha20 is tolerant of non-block-multiple request sizes, so we do not + * need to handle any remainder bytes specially and can just pass the length + * directly to the PRF construction; and + * + * 2. Chacha20 is a 512-bit block size cipher (whereas AES has 128-bit block + * size, regardless of key size). This means Chacha does not require re-keying + * every 1MiB. This is implied by the math in FS&K 9.4 and mentioned + * explicitly in the conclusion, "If we had a block cipher with a 256-bit [or + * greater] block size, then the collisions would not have been an issue at + * all" (p. 144). + * + * 3. In conventional ("locked") mode, we produce a maximum of PAGE_SIZE output + * at a time before dropping the lock, to not bully the lock especially. This + * has been the status quo since 2015 (r284959). + * + * The upstream caller random_fortuna_read is responsible for zeroing out + * sensitive buffers provided as parameters to this routine. */ -void -random_fortuna_read(uint8_t *buf, size_t bytecount) +enum { + FORTUNA_UNLOCKED = false, + FORTUNA_LOCKED = true +}; +static void +random_fortuna_genbytes(uint8_t *buf, size_t bytecount, + uint8_t newkey[static RANDOM_KEYSIZE], uint128_t *p_counter, + union randomdev_key *p_key, bool locked) { uint8_t remainder_buf[RANDOM_BLOCKSIZE]; - size_t read_directly_len, read_chunk; + size_t chunk_size; + if (locked) + RANDOM_RESEED_ASSERT_LOCK_OWNED(); + else + RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED(); + /* - * The underlying AES generator expects multiples of RANDOM_BLOCKSIZE. + * Easy case: don't have to worry about bullying the global mutex, + * don't have to worry about rekeying Chacha; API is byte-oriented. */ - if (random_chachamode) - read_directly_len = bytecount; - else - read_directly_len = rounddown(bytecount, RANDOM_BLOCKSIZE); + if (!locked && random_chachamode) { + randomdev_keystream(p_key, p_counter, buf, bytecount); + return; + } - RANDOM_RESEED_LOCK(); - KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); - - while (read_directly_len > 0) { + if (locked) { /* - * 128-bit block ciphers like AES must be re-keyed at 1MB - * intervals to avoid unacceptable statistical differentiation - * from true random data. - * - * 512-bit block ciphers like Chacha20 do not have this - * problem. (FS&K 9.4) + * While holding the global lock, limit PRF generation to + * mitigate, but not eliminate, bullying symptoms. */ - if (random_chachamode) - read_chunk = read_directly_len; - else - read_chunk = MIN(read_directly_len, - RANDOM_FORTUNA_MAX_READ); - + chunk_size = PAGE_SIZE; + } else { /* - * For now, we hold the global Fortuna mutex, so yield - * periodically to provide vague availability to other lock - * users. PAGE_SIZE is chosen to match existing behavior. + * 128-bit block ciphers like AES must be re-keyed at 1MB + * intervals to avoid unacceptable statistical differentiation + * from true random data (FS&K 9.4, p. 143-144). + */ + MPASS(!random_chachamode); + chunk_size = RANDOM_FORTUNA_MAX_READ; + } + + chunk_size = MIN(bytecount, chunk_size); + if (!random_chachamode) + chunk_size = rounddown(chunk_size, RANDOM_BLOCKSIZE); + + while (bytecount >= chunk_size) { + randomdev_keystream(p_key, p_counter, buf, chunk_size); + + buf += chunk_size; + bytecount -= chunk_size; + + /* We have to rekey if there is any data remaining to be + * generated, in two scenarios: + * + * locked: we need to rekey before we unlock and release the + * global state to another consumer; or + * + * unlocked: we need to rekey because we're in AES mode and are + * required to rekey at chunk_size==1MB. But we do not need to + * rekey during the last trailing <1MB chunk. */ - read_chunk = MIN(read_chunk, PAGE_SIZE); + if (bytecount > 0) { + if (locked || chunk_size == RANDOM_FORTUNA_MAX_READ) { + randomdev_keystream(p_key, p_counter, newkey, + RANDOM_KEYSIZE); + randomdev_encrypt_init(p_key, newkey); + } - random_fortuna_genrandom(buf, read_chunk); - buf += read_chunk; - read_directly_len -= read_chunk; - bytecount -= read_chunk; + /* + * If we're holding the global lock, yield it briefly + * now. + */ + if (locked) { + RANDOM_RESEED_UNLOCK(); + RANDOM_RESEED_LOCK(); + } - /* Perform the actual yield. */ - if (read_directly_len != 0) { - RANDOM_RESEED_UNLOCK(); - RANDOM_RESEED_LOCK(); + /* + * At the trailing end, scale down chunk_size from 1MB or + * PAGE_SIZE to all remaining full blocks (AES) or all + * remaining bytes (Chacha). + */ + if (bytecount < chunk_size) { + if (random_chachamode) + chunk_size = bytecount; + else if (bytecount >= RANDOM_BLOCKSIZE) + chunk_size = rounddown(bytecount, + RANDOM_BLOCKSIZE); + else + break; + } } } - if (bytecount > 0) - random_fortuna_genrandom(remainder_buf, sizeof(remainder_buf)); + /* + * Generate any partial AES block remaining into a temporary buffer and + * copy the desired substring out. + */ + if (bytecount > 0) { + MPASS(!random_chachamode); - RANDOM_RESEED_UNLOCK(); + randomdev_keystream(p_key, p_counter, remainder_buf, + sizeof(remainder_buf)); + } + /* + * In locked mode, re-key global K before dropping the lock, which we + * don't need for memcpy/bzero below. + */ + if (locked) { + randomdev_keystream(p_key, p_counter, newkey, RANDOM_KEYSIZE); + randomdev_encrypt_init(p_key, newkey); + RANDOM_RESEED_UNLOCK(); + } + if (bytecount > 0) { memcpy(buf, remainder_buf, bytecount); explicit_bzero(remainder_buf, sizeof(remainder_buf)); } +} + + +/* + * Handle only "concurrency-enabled" Fortuna reads to simplify logic. + * + * Caller (random_fortuna_read) is responsible for zeroing out sensitive + * buffers provided as parameters to this routine. + */ +static void +random_fortuna_read_concurrent(uint8_t *buf, size_t bytecount, + uint8_t newkey[static RANDOM_KEYSIZE]) +{ + union randomdev_key key_copy; + uint128_t counter_copy; + size_t blockcount; + + MPASS(fortuna_concurrent_read); + + /* + * Compute number of blocks required for the PRF request ('delta C'). + * We will step the global counter 'C' by this number under lock, and + * then actually consume the counter values outside the lock. + * + * This ensures that contemporaneous but independent requests for + * randomness receive distinct 'C' values and thus independent PRF + * results. + */ + if (random_chachamode) { + blockcount = howmany(bytecount, CHACHA_BLOCKLEN); + } else { + blockcount = howmany(bytecount, RANDOM_BLOCKSIZE); + + /* + * Need to account for the additional blocks generated by + * rekeying when updating the global fs_counter. + */ + blockcount += RANDOM_KEYS_PER_BLOCK * + (blockcount / RANDOM_FORTUNA_BLOCKS_PER_KEY); + } + + RANDOM_RESEED_LOCK(); + KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); + /* + * Technically, we only need mutual exclusion to update shared state + * appropriately. Nothing about updating the shared internal state + * requires that we perform (most) expensive cryptographic keystream + * generation under lock. (We still need to generate 256 bits of + * keystream to re-key between consumers.) + * + * Save the original counter and key values that will be used as the + * PRF for this particular consumer. + */ + memcpy(&counter_copy, &fortuna_state.fs_counter, sizeof(counter_copy)); + memcpy(&key_copy, &fortuna_state.fs_key, sizeof(key_copy)); + + /* + * Step the counter as if we had generated 'bytecount' blocks for this + * consumer. I.e., ensure that the next consumer gets an independent + * range of counter values once we drop the global lock. + */ + uint128_add64(&fortuna_state.fs_counter, blockcount); + + /* + * We still need to Rekey the global 'K' between independent calls; + * this is no different from conventional Fortuna. Note that + * 'randomdev_keystream()' will step the fs_counter 'C' appropriately + * for the blocks needed for the 'newkey'. + * + * (This is part of PseudoRandomData() in FS&K, 9.4.4.) + */ + randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, + newkey, RANDOM_KEYSIZE); + randomdev_encrypt_init(&fortuna_state.fs_key, newkey); + + /* + * We have everything we need to generate a unique PRF for this + * consumer without touching global state. + */ + RANDOM_RESEED_UNLOCK(); + + random_fortuna_genbytes(buf, bytecount, newkey, &counter_copy, + &key_copy, FORTUNA_UNLOCKED); + RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED(); + + explicit_bzero(&counter_copy, sizeof(counter_copy)); + explicit_bzero(&key_copy, sizeof(key_copy)); +} + +/*- + * FS&K - RandomData() (Part 2) + * Main read from Fortuna, continued. May be called multiple times after + * the random_fortuna_pre_read() above. + * + * The supplied buf MAY not be a multiple of RANDOM_BLOCKSIZE in size; it is + * the responsibility of the algorithm to accommodate partial block reads, if a + * block output mode is used. + */ +void +random_fortuna_read(uint8_t *buf, size_t bytecount) +{ + uint8_t newkey[RANDOM_KEYSIZE]; + + if (fortuna_concurrent_read) { + random_fortuna_read_concurrent(buf, bytecount, newkey); + goto out; + } + + RANDOM_RESEED_LOCK(); + KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); + + random_fortuna_genbytes(buf, bytecount, newkey, + &fortuna_state.fs_counter, &fortuna_state.fs_key, FORTUNA_LOCKED); + /* Returns unlocked */ + RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED(); + +out: + explicit_bzero(newkey, sizeof(newkey)); } #ifdef _KERNEL Modified: head/sys/dev/random/fortuna.h ============================================================================== --- head/sys/dev/random/fortuna.h Mon Jun 17 20:11:02 2019 (r349153) +++ head/sys/dev/random/fortuna.h Mon Jun 17 20:29:13 2019 (r349154) @@ -36,12 +36,14 @@ typedef struct mtx mtx_t; #define RANDOM_RESEED_LOCK(x) mtx_lock(&fortuna_state.fs_mtx) #define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&fortuna_state.fs_mtx) #define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) mtx_assert(&fortuna_state.fs_mtx, MA_OWNED) +#define RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED() mtx_assert(&fortuna_state.fs_mtx, MA_NOTOWNED) #else #define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&fortuna_state.fs_mtx, mtx_plain) #define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&fortuna_state.fs_mtx) #define RANDOM_RESEED_LOCK(x) mtx_lock(&fortuna_state.fs_mtx) #define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&fortuna_state.fs_mtx) #define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) +#define RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED() #endif #endif /* SYS_DEV_RANDOM_FORTUNA_H_INCLUDED */ Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Mon Jun 17 20:11:02 2019 (r349153) +++ head/sys/dev/random/hash.c Mon Jun 17 20:29:13 2019 (r349154) @@ -74,7 +74,7 @@ _Static_assert(CHACHA_STATELEN == RANDOM_BLOCKSIZE, "" * Benefits include somewhat faster keystream generation compared with * unaccelerated AES-ICM. */ -bool random_chachamode = false; +bool random_chachamode __read_frequently = false; #ifdef _KERNEL SYSCTL_BOOL(_kern_random, OID_AUTO, use_chacha20_cipher, CTLFLAG_RDTUN, &random_chachamode, 0, Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Mon Jun 17 20:11:02 2019 (r349153) +++ head/sys/dev/random/hash.h Mon Jun 17 20:29:13 2019 (r349154) @@ -32,6 +32,10 @@ #include #include +#ifndef _KERNEL +#define __read_frequently +#endif + /* Keys are formed from cipher blocks */ #define RANDOM_KEYSIZE 32 /* (in bytes) == 256 bits */ #define RANDOM_KEYSIZE_WORDS (RANDOM_KEYSIZE/sizeof(uint32_t)) Modified: head/sys/dev/random/uint128.h ============================================================================== --- head/sys/dev/random/uint128.h Mon Jun 17 20:11:02 2019 (r349153) +++ head/sys/dev/random/uint128.h Mon Jun 17 20:29:13 2019 (r349154) @@ -65,6 +65,21 @@ uint128_increment(uint128_t *big_uintp) #endif } +static __inline void +uint128_add64(uint128_t *big_uintp, uint64_t add) +{ +#ifdef USE_REAL_UINT128_T + (*big_uintp) += add; +#else + uint64_t word0p; + + word0p = big_uintp->u128t_word0 + add; + if (word0p < big_uintp->u128t_word0) + big_uintp->u128t_word1++; + big_uintp->u128t_word0 = word0p; +#endif +} + static __inline bool uint128_equals(uint128_t a, uint128_t b) { Modified: head/tests/sys/devrandom/uint128_test.c ============================================================================== --- head/tests/sys/devrandom/uint128_test.c Mon Jun 17 20:11:02 2019 (r349153) +++ head/tests/sys/devrandom/uint128_test.c Mon Jun 17 20:29:13 2019 (r349154) @@ -152,6 +152,62 @@ ATF_TC_BODY(uint128_inc, tc) } } +ATF_TC_WITHOUT_HEAD(uint128_add64); +ATF_TC_BODY(uint128_add64, tc) +{ + static const struct u128_add64_tc { + uint32_t input[4]; + uint64_t addend; + uint32_t expected[4]; + const char *descr; + } tests[] = { + { + .input = { 0, 0, 0, 0 }, + .addend = 1, + .expected = { 1, 0, 0, 0 }, + .descr = "0 + 1 -> 1", + }, + { + .input = { 1, 0, 0, 0 }, + .addend = UINT32_MAX, + .expected = { 0, 1, 0, 0 }, + .descr = "1 + (2^32 - 1) -> 2^32 (word carry)", + }, + { + .input = { 1, 0, 0, 0 }, + .addend = UINT64_MAX, + .expected = { 0, 0, 1, 0 }, + .descr = "1 + (2^64 - 1) -> 2^64 (u128t_word0 carry)", + }, + { + .input = { 0x11111111, 0x11111111, 0, 0 }, + .addend = 0xf0123456789abcdeULL, + .expected = { 0x89abcdef, 0x01234567, 1, 0 }, + .descr = "0x1111_1111_1111_1111 +" + "0xf012_3456_789a_bcde ->" + "0x1_0123_4567_89ab_cdef", + }, + { + .input = { 1, 0, UINT32_MAX, 0 }, + .addend = UINT64_MAX, + .expected = { 0, 0, 0, 1 }, + .descr = "Carry ~2^96", + }, + }; + uint8_t inputle[16], expectedle[16]; + uint128_t a; + size_t i; + + for (i = 0; i < nitems(tests); i++) { + vec_u32_tole128(inputle, tests[i].input); + vec_u32_tole128(expectedle, tests[i].expected); + + a = le128dec(inputle); + uint128_add64(&a, tests[i].addend); + u128_check_equality(le128dec(expectedle), a, tests[i].descr); + } +} + /* * Test assumptions about Chacha incrementing counter in the same way as * uint128.h @@ -219,6 +275,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, uint128_inc); + ATF_TP_ADD_TC(tp, uint128_add64); ATF_TP_ADD_TC(tp, uint128_chacha_ctr); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon Jun 17 21:38:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FABF15C5251; Mon, 17 Jun 2019 21:38:34 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C00DF83A8A; Mon, 17 Jun 2019 21:38:33 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADD3F39CD; Mon, 17 Jun 2019 21:38:33 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HLcXj7047569; Mon, 17 Jun 2019 21:38:33 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HLcXXT047568; Mon, 17 Jun 2019 21:38:33 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906172138.x5HLcXXT047568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Mon, 17 Jun 2019 21:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349156 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C00DF83A8A 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 21:38:34 -0000 Author: sevan (doc committer) Date: Mon Jun 17 21:38:33 2019 New Revision: 349156 URL: https://svnweb.freebsd.org/changeset/base/349156 Log: Fix tab Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Jun 17 21:31:27 2019 (r349155) +++ head/share/misc/bsd-family-tree Mon Jun 17 21:38:33 2019 (r349156) @@ -762,7 +762,7 @@ OpenBSD 6.4 2018-10-18 [OBD] DragonFly 5.4.0 2018-12-03 [DFB] FreeBSD 12.0 2018-12-11 [FBD] DragonFly 5.4.1 2018-12-24 [DFB] -OpenBSD 6.5 2019-05-01 [OBD] +OpenBSD 6.5 2019-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Mon Jun 17 21:46:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273FF15C55E8; Mon, 17 Jun 2019 21:46:14 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B775A83F85; Mon, 17 Jun 2019 21:46:13 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C78E3C04; Mon, 17 Jun 2019 21:46:13 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HLkD3p052935; Mon, 17 Jun 2019 21:46:13 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HLkDJO052934; Mon, 17 Jun 2019 21:46:13 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906172146.x5HLkDJO052934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Mon, 17 Jun 2019 21:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349157 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B775A83F85 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 21:46:14 -0000 Author: sevan (doc committer) Date: Mon Jun 17 21:46:13 2019 New Revision: 349157 URL: https://svnweb.freebsd.org/changeset/base/349157 Log: Add NetBSD 8.1 & DragonFly BSD 5.6 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Jun 17 21:38:33 2019 (r349156) +++ head/share/misc/bsd-family-tree Mon Jun 17 21:46:13 2019 (r349157) @@ -380,6 +380,8 @@ FreeBSD 5.2 | | | *--FreeBSD | | v | | | 12.0 | | | DragonFly 5.4.1 | | | OpenBSD 6.5 | + | | NetBSD | | + | | 8.1 | DragonFly 5.6 | | | | | FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -763,6 +765,8 @@ DragonFly 5.4.0 2018-12-03 [DFB] FreeBSD 12.0 2018-12-11 [FBD] DragonFly 5.4.1 2018-12-24 [DFB] OpenBSD 6.5 2019-05-01 [OBD] +NetBSD 8.1 2019-06-04 [NBD] +DragonFly 5.6 2019-06-17 [DFB] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Mon Jun 17 22:53:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF38F15C6B6A; Mon, 17 Jun 2019 22:53:40 +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 54CA9863DA; Mon, 17 Jun 2019 22:53:40 +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 21EAB4815; Mon, 17 Jun 2019 22:53:40 +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 x5HMreeZ090544; Mon, 17 Jun 2019 22:53:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HMrdFB090542; Mon, 17 Jun 2019 22:53:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906172253.x5HMrdFB090542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 17 Jun 2019 22:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349160 - in head/release: . tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head/release: . tools X-SVN-Commit-Revision: 349160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54CA9863DA 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 22:53:40 -0000 Author: gjb Date: Mon Jun 17 22:53:39 2019 New Revision: 349160 URL: https://svnweb.freebsd.org/changeset/base/349160 Log: Fix passing ${CONF_FILES} (which contains MAKE_CONF and SRC_CONF, __MAKE_CONF and SRCCONF, respectively) through to arm_install_base() and chroot_arm_build_release(). This prevents failures when the target image is intended to be build with make.conf(5) and src.conf(5) overrides, which are correctly handled for non-embedded image builds. Reported and tested by: Daniel Engberg PR: 238615 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh head/release/tools/arm.subr Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Mon Jun 17 22:13:59 2019 (r349159) +++ head/release/release.sh Mon Jun 17 22:53:39 2019 (r349160) @@ -388,6 +388,7 @@ chroot_arm_build_release() { [ ! -z "${RELEASECONF}" ] && . "${RELEASECONF}" export MAKE_FLAGS="${MAKE_FLAGS} TARGET=${EMBEDDED_TARGET}" export MAKE_FLAGS="${MAKE_FLAGS} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + export MAKE_FLAGS="${MAKE_FLAGS} ${CONF_FILES}" eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release obj export WORLDDIR="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release -V WORLDDIR)" export OBJDIR="$(eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release -V .OBJDIR)" Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Jun 17 22:13:59 2019 (r349159) +++ head/release/tools/arm.subr Mon Jun 17 22:53:39 2019 (r349160) @@ -166,7 +166,7 @@ arm_install_base() { TARGET=${EMBEDDED_TARGET} \ TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ - installworld installkernel distribution + ${CONF_FILES} installworld installkernel distribution chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos arm_create_user From owner-svn-src-head@freebsd.org Mon Jun 17 23:03:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E852315C6E3C; Mon, 17 Jun 2019 23:03:31 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB9F86939; Mon, 17 Jun 2019 23:03:31 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6195849C4; Mon, 17 Jun 2019 23:03:31 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HN3Vf6095600; Mon, 17 Jun 2019 23:03:31 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HN3Uqe095595; Mon, 17 Jun 2019 23:03:30 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201906172303.x5HN3Uqe095595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Mon, 17 Jun 2019 23:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349161 - in head/sys: conf dev/usb modules/usb/usb X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: in head/sys: conf dev/usb modules/usb/usb X-SVN-Commit-Revision: 349161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AB9F86939 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 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.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 23:03:32 -0000 Author: takawata Date: Mon Jun 17 23:03:30 2019 New Revision: 349161 URL: https://svnweb.freebsd.org/changeset/base/349161 Log: Add ACPI support for USB driver. This adds ACPI device path on devinfo(8) output and show value of _UPC(usb port capabilities), _PLD (physical location of device) when hw.usb.debug >= 1 . Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D20630 Added: head/sys/dev/usb/usb_hub_acpi.c (contents, props changed) head/sys/dev/usb/usb_hub_private.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/usb_hub.c head/sys/modules/usb/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 17 22:53:39 2019 (r349160) +++ head/sys/conf/files Mon Jun 17 23:03:30 2019 (r349161) @@ -3234,6 +3234,7 @@ dev/usb/usb_generic.c optional usb dev/usb/usb_handle_request.c optional usb dev/usb/usb_hid.c optional usb dev/usb/usb_hub.c optional usb +dev/usb/usb_hub_acpi.c optional usb acpi dev/usb/usb_if.m optional usb dev/usb/usb_lookup.c optional usb dev/usb/usb_mbuf.c optional usb Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Jun 17 22:53:39 2019 (r349160) +++ head/sys/dev/usb/usb_hub.c Mon Jun 17 23:03:30 2019 (r349161) @@ -75,15 +75,10 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ -#define UHUB_INTR_INTERVAL 250 /* ms */ -enum { - UHUB_INTR_TRANSFER, -#if USB_HAVE_TT_SUPPORT - UHUB_RESET_TT_TRANSFER, -#endif - UHUB_N_TRANSFER, -}; +#include + + #ifdef USB_DEBUG static int uhub_debug = 0; @@ -111,30 +106,7 @@ SYSCTL_INT(_hw_usb, OID_AUTO, disable_port_power, CTLF &usb_disable_port_power, 0, "Set to disable all USB port power."); #endif -struct uhub_current_state { - uint16_t port_change; - uint16_t port_status; -}; -struct uhub_softc { - struct uhub_current_state sc_st;/* current state */ -#if (USB_HAVE_FIXED_PORT != 0) - struct usb_hub sc_hub; -#endif - device_t sc_dev; /* base device */ - struct mtx sc_mtx; /* our mutex */ - struct usb_device *sc_udev; /* USB device */ - struct usb_xfer *sc_xfer[UHUB_N_TRANSFER]; /* interrupt xfer */ -#if USB_HAVE_DISABLE_ENUM - int sc_disable_enumeration; - int sc_disable_port_power; -#endif - uint8_t sc_usb_port_errors; /* error counter */ -#define UHUB_USB_PORT_ERRORS_MAX 4 - uint8_t sc_flags; -#define UHUB_FLAG_DID_EXPLORE 0x01 -}; - #define UHUB_PROTO(sc) ((sc)->sc_udev->ddesc.bDeviceProtocol) #define UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB) #define UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT) @@ -143,14 +115,10 @@ struct uhub_softc { /* prototypes for type checking: */ -static device_probe_t uhub_probe; -static device_attach_t uhub_attach; -static device_detach_t uhub_detach; static device_suspend_t uhub_suspend; static device_resume_t uhub_resume; static bus_driver_added_t uhub_driver_added; -static bus_child_location_str_t uhub_child_location_string; static bus_child_pnpinfo_str_t uhub_child_pnpinfo_string; static usb_callback_t uhub_intr_callback; @@ -207,7 +175,7 @@ static device_method_t uhub_methods[] = { DEVMETHOD_END }; -static driver_t uhub_driver = { +driver_t uhub_driver = { .name = "uhub", .methods = uhub_methods, .size = sizeof(struct uhub_softc) @@ -1138,7 +1106,7 @@ uhub_explore(struct usb_device *udev) return (USB_ERR_NORMAL_COMPLETION); } -static int +int uhub_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); @@ -1152,7 +1120,7 @@ uhub_probe(device_t dev) */ if (uaa->info.bConfigIndex == 0 && uaa->info.bDeviceClass == UDCLASS_HUB) - return (0); + return (BUS_PROBE_DEFAULT); return (ENXIO); } @@ -1218,7 +1186,7 @@ uhub_query_info(struct usb_device *udev, uint8_t *pnpo return (err); } -static int +int uhub_attach(device_t dev) { struct uhub_softc *sc = device_get_softc(dev); @@ -1564,7 +1532,7 @@ error: * Called from process context when the hub is gone. * Detach all devices on active ports. */ -static int +int uhub_detach(device_t dev) { struct uhub_softc *sc = device_get_softc(dev); @@ -1634,13 +1602,7 @@ uhub_driver_added(device_t dev, driver_t *driver) usb_needs_explore_all(); } -struct hub_result { - struct usb_device *udev; - uint8_t portno; - uint8_t iface_index; -}; - -static void +void uhub_find_iface_index(struct usb_hub *hub, device_t child, struct hub_result *res) { @@ -1673,7 +1635,7 @@ uhub_find_iface_index(struct usb_hub *hub, device_t ch res->portno = 0; } -static int +int uhub_child_location_string(device_t parent, device_t child, char *buf, size_t buflen) { Added: head/sys/dev/usb/usb_hub_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/usb_hub_acpi.c Mon Jun 17 23:03:30 2019 (r349161) @@ -0,0 +1,451 @@ +/* $FreeBSD$ */ +/*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * + * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. + * Copyright (c) 1998 Lennart Augustsson. All rights reserved. + * Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2019 Takanori Watanabe. + * + * 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. + */ + +/* + * USB spec: http://www.usb.org/developers/docs/usbspec.zip + */ + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define USB_DEBUG_VAR uhub_debug + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ +#include +#include +#include +#include + +static UINT32 acpi_uhub_find_rh_cb(ACPI_HANDLE ah, UINT32 nl, void *ctx, void **status); +static ACPI_STATUS acpi_uhub_find_rh(device_t dev, ACPI_HANDLE * ah); +static ACPI_STATUS +acpi_usb_hub_port_probe_cb(ACPI_HANDLE ah, UINT32 lv, void *ctx, void **rv); +static ACPI_STATUS acpi_usb_hub_port_probe(device_t dev, ACPI_HANDLE ah); +static int acpi_uhub_root_probe(device_t dev); +static int acpi_uhub_probe(device_t dev); +static int acpi_uhub_root_attach(device_t dev); +static int acpi_uhub_attach(device_t dev); +static int acpi_uhub_detach(device_t dev); +static int +acpi_uhub_read_ivar(device_t dev, device_t child, int idx, + uintptr_t *res); +static int +acpi_uhub_child_location_string(device_t parent, device_t child, + char *buf, size_t buflen); +static int acpi_uhub_parse_upc(device_t dev, unsigned int port, ACPI_HANDLE ah); + +struct acpi_uhub_softc { + struct uhub_softc usc; + uint8_t nports; + ACPI_HANDLE *porthandle; +}; + +UINT32 +acpi_uhub_find_rh_cb(ACPI_HANDLE ah, UINT32 nl, void *ctx, void **status){ + ACPI_DEVICE_INFO *devinfo; + UINT32 ret = AE_OK; + + *status = NULL; + devinfo = NULL; + + ret = AcpiGetObjectInfo(ah, &devinfo); + + if (ACPI_FAILURE(ret)) { + return ret; + } + if ((devinfo->Valid & ACPI_VALID_ADR) && + (devinfo->Address == 0)) { + ret = AE_CTRL_TERMINATE; + *status = ah; + } + AcpiOsFree(devinfo); + + return ret; +} + +static int +acpi_uhub_parse_upc(device_t dev, unsigned int port, ACPI_HANDLE ah) +{ + ACPI_BUFFER buf; + + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + if (AcpiEvaluateObject(ah, "_UPC", NULL, &buf) == AE_OK) { + UINT64 porttypenum, conn; + const char *connectable; + const char *typelist[] = {"TypeA", "MiniAB", "Express", + "USB3-A", "USB3-B", "USB-MicroB", + "USB3-MicroAB", "USB3-PowerB", + "TypeC-USB2", "TypeC-Switch", + "TypeC-nonSwitch"}; + const char *porttype; + const int last = sizeof(typelist) / sizeof(typelist[0]); + ACPI_OBJECT *obj = buf.Pointer; + + acpi_PkgInt(obj, 0, &conn); + acpi_PkgInt(obj, 1, &porttypenum); + connectable = conn ? "" : "non"; + if (porttypenum == 0xff) + porttype = "Proprietary"; + else if (porttypenum < last) { + porttype = typelist[porttypenum]; + } else { + porttype = "Unknown"; + } + if (usb_debug) + device_printf(dev, "Port %u %sconnectable %s\n", + port, connectable, porttype); + } + AcpiOsFree(buf.Pointer); + + return 0; +} + +static int +acpi_uhub_parse_pld(device_t dev, unsigned int port, ACPI_HANDLE ah) +{ + ACPI_BUFFER buf; + + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + if (AcpiEvaluateObject(ah, "_PLD", NULL, &buf) == AE_OK) { + ACPI_OBJECT *obj; + unsigned char *resbuf; + int len; + + obj = buf.Pointer; + + if (obj->Type == ACPI_TYPE_PACKAGE + && obj->Package.Elements[0].Type == ACPI_TYPE_BUFFER) { + ACPI_OBJECT *obj1; + + obj1 = &obj->Package.Elements[0]; + len = obj1->Buffer.Length; + resbuf = obj1->Buffer.Pointer; + } else if (obj->Type == ACPI_TYPE_BUFFER) { + len = obj->Buffer.Length; + resbuf = obj->Buffer.Pointer; + } else { + goto skip; + } + if (usb_debug) { + device_printf(dev, "Revision:%d\n", + resbuf[0] & 0x7f); + if ((resbuf[0] & 0x80) == 0) { + device_printf(dev, + "Color:#%02x%02x%02x\n", + resbuf[1], resbuf[2], + resbuf[3]); + } + device_printf(dev, "Width %d mm Height %d mm\n", + resbuf[4] | (resbuf[5] << 8), + resbuf[6] | (resbuf[7] << 8)); + if (resbuf[8] & 1) { + device_printf(dev, "Visible\n"); + } + if (resbuf[8] & 2) { + device_printf(dev, "Dock\n"); + } + if (resbuf[8] & 4) { + device_printf(dev, "Lid\n"); + } + device_printf(dev, "PanelPosition: %d\n", + (resbuf[8] >> 3) & 7); + device_printf(dev, "VertPosition: %d\n", + (resbuf[8] >> 6) & 3); + device_printf(dev, "HorizPosition: %d\n", + (resbuf[9]) & 3); + device_printf(dev, "Shape: %d\n", + (resbuf[9] >> 2) & 0xf); + device_printf(dev, "80: %02x, %02x, %02x\n", + resbuf[9], resbuf[10], resbuf[11]); + device_printf(dev, "96: %02x, %02x, %02x, %02x\n", + resbuf[12], resbuf[13], + resbuf[14], resbuf[15]); + + if ((resbuf[0] & 0x7f) >= 2) { + device_printf(dev, "VOFF%d mm HOFF %dmm", + resbuf[16] | (resbuf[17] << 8), + resbuf[18] | (resbuf[19] << 8)); + } + } + skip: + AcpiOsFree(buf.Pointer); + + } + + + return 0; +} + +ACPI_STATUS +acpi_uhub_find_rh(device_t dev, ACPI_HANDLE * ah){ + device_t grand; + ACPI_HANDLE gah; + + grand = device_get_parent(device_get_parent(dev)); + if ((gah = acpi_get_handle(grand)) == NULL) { + *ah = NULL; + return AE_ERROR; + } + return AcpiWalkNamespace(ACPI_TYPE_DEVICE, gah, 1, + acpi_uhub_find_rh_cb, NULL, dev, ah); +} + +ACPI_STATUS +acpi_usb_hub_port_probe_cb(ACPI_HANDLE ah, UINT32 lv, void *ctx, void **rv){ + ACPI_DEVICE_INFO *devinfo; + device_t dev = ctx; + struct acpi_uhub_softc *sc = device_get_softc(dev); + + if (usb_debug) + device_printf(dev, "%s\n", acpi_name(ah)); + + AcpiGetObjectInfo(ah, &devinfo); + if ((devinfo->Valid & ACPI_VALID_ADR) && + (devinfo->Address > 0) && + (devinfo->Address <= (uint64_t)sc->nports)) { + sc->porthandle[devinfo->Address - 1] = ah; + acpi_uhub_parse_upc(dev, devinfo->Address, ah); + acpi_uhub_parse_pld(dev, devinfo->Address, ah); + } else { + device_printf(dev, "Skiping invalid devobj %s\n", + acpi_name(ah)); + } + AcpiOsFree(devinfo); + return AE_OK; +} + +ACPI_STATUS +acpi_usb_hub_port_probe(device_t dev, ACPI_HANDLE ah){ + return AcpiWalkNamespace(ACPI_TYPE_DEVICE, + ah, 1, + acpi_usb_hub_port_probe_cb, + NULL, dev, NULL); +} +int +acpi_uhub_root_probe(device_t dev) +{ + ACPI_HANDLE ah; + ACPI_STATUS status; + + status = acpi_uhub_find_rh(dev, &ah); + if (ACPI_SUCCESS(status) + && ah != NULL + && (uhub_probe(dev) <= 0)) { + /* success prior than non - acpi hub */ + return (BUS_PROBE_DEFAULT + 1); + } + return ENXIO; +} + +int +acpi_uhub_probe(device_t dev) +{ + ACPI_HANDLE ah = acpi_get_handle(dev); + + if (ah && (uhub_probe(dev) <= 0)) { + /*success prior than non - acpi hub*/ + return (BUS_PROBE_DEFAULT + 1); + } + return (ENXIO); +} +int +acpi_uhub_root_attach(device_t dev) +{ + ACPI_HANDLE devhandle; + struct usb_hub *uh; + struct acpi_uhub_softc *sc = device_get_softc(dev); + int ret; + + if ((ret = uhub_attach(dev)) != 0) { + return (ret); + } + uh = sc->usc.sc_udev->hub; + + if (ACPI_FAILURE(acpi_uhub_find_rh(dev, &devhandle)) || + (devhandle == NULL)) { + return ENXIO; + } + + sc->nports = uh->nports; + sc->porthandle = malloc(sizeof(ACPI_HANDLE) * uh->nports, + M_USBDEV, M_WAITOK | M_ZERO); + acpi_uhub_find_rh(dev, &devhandle); + acpi_usb_hub_port_probe(dev, devhandle); + + return 0; +} + +int +acpi_uhub_attach(device_t dev) +{ + struct usb_hub *uh; + struct acpi_uhub_softc *sc = device_get_softc(dev); + ACPI_HANDLE devhandle; + int ret; + + if ((ret = uhub_attach(dev)) != 0) { + return (ret); + } + uh = sc->usc.sc_udev->hub; + devhandle = acpi_get_handle(dev); + + if (devhandle == NULL) { + return ENXIO; + } + + sc->nports = uh->nports; + sc->porthandle = malloc(sizeof(ACPI_HANDLE) * uh->nports, + M_USBDEV, M_WAITOK | M_ZERO); + acpi_usb_hub_port_probe(dev, acpi_get_handle(dev)); + return 0; +} + +int +acpi_uhub_read_ivar(device_t dev, device_t child, int idx, + uintptr_t *res) +{ + struct hub_result hres; + struct acpi_uhub_softc *sc = device_get_softc(dev); + ACPI_HANDLE ah; + + mtx_lock(&Giant); + uhub_find_iface_index(sc->usc.sc_udev->hub, child, &hres); + mtx_unlock(&Giant); + if ((idx == ACPI_IVAR_HANDLE) && + (hres.portno > 0) && + (hres.portno <= sc->nports) && + (ah = sc->porthandle[hres.portno - 1])) { + *res = (uintptr_t)ah; + return (0); + } + return (ENXIO); +} +static int +acpi_uhub_child_location_string(device_t parent, device_t child, + char *buf, size_t buflen) +{ + + ACPI_HANDLE ah; + + uhub_child_location_string(parent, child, buf, buflen); + ah = acpi_get_handle(child); + if (ah) { + strlcat(buf, " handle=", buflen); + strlcat(buf, acpi_name(ah), buflen); + } + return (0); +} + +int +acpi_uhub_detach(device_t dev) +{ + struct acpi_uhub_softc *sc = device_get_softc(dev); + + free(sc->porthandle, M_USBDEV); + return uhub_detach(dev); +} + +static device_method_t acpi_uhub_methods[] = { + DEVMETHOD(device_probe, acpi_uhub_probe), + DEVMETHOD(device_attach, acpi_uhub_attach), + DEVMETHOD(device_detach, acpi_uhub_detach), + DEVMETHOD(bus_child_location_str, acpi_uhub_child_location_string), + DEVMETHOD(bus_read_ivar, acpi_uhub_read_ivar), + DEVMETHOD_END + +}; + +static device_method_t acpi_uhub_root_methods[] = { + DEVMETHOD(device_probe, acpi_uhub_root_probe), + DEVMETHOD(device_attach, acpi_uhub_root_attach), + DEVMETHOD(device_detach, acpi_uhub_detach), + DEVMETHOD(bus_read_ivar, acpi_uhub_read_ivar), + DEVMETHOD(bus_child_location_str, acpi_uhub_child_location_string), + DEVMETHOD_END +}; + +static devclass_t uhub_devclass; +extern driver_t uhub_driver; +static kobj_class_t uhub_baseclasses[] = {&uhub_driver, NULL}; +static driver_t acpi_uhub_driver = { + .name = "uhub", + .methods = acpi_uhub_methods, + .size = sizeof(struct acpi_uhub_softc), + .baseclasses = uhub_baseclasses, +}; +static driver_t acpi_uhub_root_driver = { + .name = "uhub", + .methods = acpi_uhub_root_methods, + .size = sizeof(struct acpi_uhub_softc), + .baseclasses = uhub_baseclasses, +}; + +DRIVER_MODULE(acpi_uhub, uhub, acpi_uhub_driver, uhub_devclass, 0, 0); +MODULE_DEPEND(acpi_uhub, acpi, 1, 1, 1); +DRIVER_MODULE(acpi_uhub, usbus, acpi_uhub_root_driver, uhub_devclass, 0, 0); Added: head/sys/dev/usb/usb_hub_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/usb_hub_private.h Mon Jun 17 23:03:30 2019 (r349161) @@ -0,0 +1,86 @@ +/* $FreeBSD$ */ +/*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * + * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. + * Copyright (c) 1998 Lennart Augustsson. All rights reserved. + * Copyright (c) 2008-2010 Hans Petter Selasky. 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. + */ + +/* + * USB spec: http://www.usb.org/developers/docs/usbspec.zip + */ + +#ifndef USB_HUB_PRIVATE_H_ +#define USB_HUB_PRIVATE_H_ +#define UHUB_INTR_INTERVAL 250 /* ms */ + +enum { + UHUB_INTR_TRANSFER, +#if USB_HAVE_TT_SUPPORT + UHUB_RESET_TT_TRANSFER, +#endif + UHUB_N_TRANSFER, +}; + + +struct uhub_current_state { + uint16_t port_change; + uint16_t port_status; +}; + +struct uhub_softc { + struct uhub_current_state sc_st; /* current state */ +#if (USB_HAVE_FIXED_PORT != 0) + struct usb_hub sc_hub; +#endif + device_t sc_dev; /* base device */ + struct mtx sc_mtx; /* our mutex */ + struct usb_device *sc_udev; /* USB device */ + struct usb_xfer *sc_xfer[UHUB_N_TRANSFER]; /* interrupt xfer */ +#if USB_HAVE_DISABLE_ENUM + int sc_disable_enumeration; + int sc_disable_port_power; +#endif + uint8_t sc_usb_port_errors; /* error counter */ +#define UHUB_USB_PORT_ERRORS_MAX 4 + uint8_t sc_flags; +#define UHUB_FLAG_DID_EXPLORE 0x01 +}; +struct hub_result { + struct usb_device *udev; + uint8_t portno; + uint8_t iface_index; +}; + +void +uhub_find_iface_index(struct usb_hub *hub, device_t child, + struct hub_result *res); + +device_probe_t uhub_probe; +device_attach_t uhub_attach; +device_detach_t uhub_detach; +bus_child_location_str_t uhub_child_location_string; + +#endif Modified: head/sys/modules/usb/usb/Makefile ============================================================================== --- head/sys/modules/usb/usb/Makefile Mon Jun 17 22:53:39 2019 (r349160) +++ head/sys/modules/usb/usb/Makefile Mon Jun 17 23:03:30 2019 (r349161) @@ -39,6 +39,11 @@ 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 ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +SRCS += opt_acpi.h usb_hub_acpi.c acpi_if.h +.endif + .if !empty(OPT_FDT) SRCS+= usb_fdt_support.c ofw_bus_if.h .endif From owner-svn-src-head@freebsd.org Tue Jun 18 00:11:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6051615C8013; Tue, 18 Jun 2019 00:11: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 076B58840D; Tue, 18 Jun 2019 00:11: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 D6FA054F8; Tue, 18 Jun 2019 00:11: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 x5I0B1uC027661; Tue, 18 Jun 2019 00:11:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I0B1hp027657; Tue, 18 Jun 2019 00:11:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906180011.x5I0B1hp027657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 00:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349164 - in head: sys/dev/pwm usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: sys/dev/pwm usr.sbin/pwm X-SVN-Commit-Revision: 349164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 076B58840D 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.99)[-0.986,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 00:11:02 -0000 Author: ian Date: Tue Jun 18 00:11:00 2019 New Revision: 349164 URL: https://svnweb.freebsd.org/changeset/base/349164 Log: Remove everything related to channels from the pwmc public interface, now that there is a pwmc(4) instance per channel and the channel number is maintained as a driver ivar rather than being passed in from userland. Modified: head/sys/dev/pwm/pwmc.c head/sys/dev/pwm/pwmc.h head/usr.sbin/pwm/pwm.8 head/usr.sbin/pwm/pwm.c Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Tue Jun 18 00:08:02 2019 (r349163) +++ head/sys/dev/pwm/pwmc.c Tue Jun 18 00:11:00 2019 (r349164) @@ -71,18 +71,12 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, struct pwmc_softc *sc; struct pwm_state state; device_t bus; - u_int nchannel; int rv = 0; sc = dev->si_drv1; bus = device_get_parent(sc->dev); switch (cmd) { - case PWMMAXCHANNEL: - nchannel = 0; - rv = PWMBUS_CHANNEL_COUNT(bus, &nchannel); - bcopy(&nchannel, data, sizeof(nchannel)); - break; case PWMSETSTATE: bcopy(data, &state, sizeof(state)); rv = PWMBUS_CHANNEL_CONFIG(bus, sc->chan, Modified: head/sys/dev/pwm/pwmc.h ============================================================================== --- head/sys/dev/pwm/pwmc.h Tue Jun 18 00:08:02 2019 (r349163) +++ head/sys/dev/pwm/pwmc.h Tue Jun 18 00:11:00 2019 (r349164) @@ -34,7 +34,6 @@ #define PWM_POLARITY_INVERTED (1 << 0) struct pwm_state { - u_int channel; u_int period; u_int duty; uint32_t flags; @@ -45,9 +44,8 @@ struct pwm_state { * ioctls */ -#define PWMMAXCHANNEL _IOWR('G', 0, int) -#define PWMGETSTATE _IOWR('G', 1, struct pwm_state) -#define PWMSETSTATE _IOWR('G', 2, struct pwm_state) +#define PWMGETSTATE _IOWR('G', 0, struct pwm_state) +#define PWMSETSTATE _IOWR('G', 1, struct pwm_state) #endif /* _PWM_H_ */ Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Tue Jun 18 00:08:02 2019 (r349163) +++ head/usr.sbin/pwm/pwm.8 Tue Jun 18 00:11:00 2019 (r349164) @@ -31,23 +31,18 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar device -.Fl c Ar channel .Fl E .Nm .Op Fl f Ar device -.Fl c Ar channel .Fl D .Nm .Op Fl f Ar device -.Fl c Ar channel .Fl C .Nm .Op Fl f Ar device -.Fl c Ar channel .Fl p Ar period .Nm .Op Fl f Ar device -.Fl c Ar channel .Fl d Ar duty .Sh DESCRIPTION The @@ -55,9 +50,7 @@ The utility can be used to configure pwm controllers. .Pp The options are as follow: -.Bl -tag -width "-c channel" -.It Fl c Ar channel -Channel number to operate on. +.Bl -tag -width "-f device" .It Fl f Ar device Device to operate on. If not specified, Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Tue Jun 18 00:08:02 2019 (r349163) +++ head/usr.sbin/pwm/pwm.c Tue Jun 18 00:11:00 2019 (r349164) @@ -66,11 +66,11 @@ static void usage(void) { fprintf(stderr, "Usage:\n"); - fprintf(stderr, "\tpwm [-f dev] -c channel -E\n"); - fprintf(stderr, "\tpwm [-f dev] -c channel -D\n"); - fprintf(stderr, "\tpwm [-f dev] -c channel -C\n"); - fprintf(stderr, "\tpwm [-f dev] -c channel -p period\n"); - fprintf(stderr, "\tpwm [-f dev] -c channel -d duty\n"); + fprintf(stderr, "\tpwm [-f dev] -E\n"); + fprintf(stderr, "\tpwm [-f dev] -D\n"); + fprintf(stderr, "\tpwm [-f dev] -C\n"); + fprintf(stderr, "\tpwm [-f dev] -p period\n"); + fprintf(stderr, "\tpwm [-f dev] -d duty\n"); exit(1); } @@ -79,21 +79,19 @@ main(int argc, char *argv[]) { struct pwm_state state; int fd; - u_int channel, nchannels; int period, duty; int action, ch; cap_rights_t right_ioctl; - const unsigned long pwm_ioctls[] = {PWMGETSTATE, PWMSETSTATE, PWMMAXCHANNEL}; + const unsigned long pwm_ioctls[] = {PWMGETSTATE, PWMSETSTATE}; char *percent; bool setname; action = 0; setname = false; fd = -1; - channel = -1u; period = duty = -1; - while ((ch = getopt(argc, argv, "f:c:EDCp:d:")) != -1) { + while ((ch = getopt(argc, argv, "f:EDCp:d:")) != -1) { switch (ch) { case 'E': if (action) @@ -124,15 +122,13 @@ main(int argc, char *argv[]) if (*percent != '\0' && *percent != '%') usage(); break; - case 'c': - if (channel != -1u) - usage(); - channel = strtoul(optarg, NULL, 10); - break; case 'f': setname = true; set_device_name(optarg); break; + case '?': + usage(); + break; } } @@ -167,19 +163,7 @@ main(int argc, char *argv[]) goto fail; } - /* Check if the channel is correct */ - if (ioctl(fd, PWMMAXCHANNEL, &nchannels) == -1) { - fprintf(stderr, "ioctl: %s\n", strerror(errno)); - goto fail; - } - if (channel > nchannels) { - fprintf(stderr, "pwm controller only support %d channels\n", - nchannels); - goto fail; - } - /* Fill the common args */ - state.channel = channel; if (ioctl(fd, PWMGETSTATE, &state) == -1) { fprintf(stderr, "Cannot get current state of the pwm controller\n"); goto fail; From owner-svn-src-head@freebsd.org Tue Jun 18 00:17:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F6DE15C82D8; Tue, 18 Jun 2019 00:17: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 A229E888CE; Tue, 18 Jun 2019 00:17: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 76256556F; Tue, 18 Jun 2019 00:17: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 x5I0HAu0032834; Tue, 18 Jun 2019 00:17:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I0HAJa032833; Tue, 18 Jun 2019 00:17:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906180017.x5I0HAJa032833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 00:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349165 - head/usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pwm X-SVN-Commit-Revision: 349165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A229E888CE 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.985,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 00:17:11 -0000 Author: ian Date: Tue Jun 18 00:17:10 2019 New Revision: 349165 URL: https://svnweb.freebsd.org/changeset/base/349165 Log: Explain the relationship between PWM hardware channels being controlled and pwmc(4) device filenames. Also, use uppercase PWM when the term is being used as an acronym, and expand the acronym where it's first used. Modified: head/usr.sbin/pwm/pwm.8 Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Tue Jun 18 00:11:00 2019 (r349164) +++ head/usr.sbin/pwm/pwm.8 Tue Jun 18 00:17:10 2019 (r349165) @@ -27,7 +27,7 @@ .Os .Sh NAME .Nm pwm -.Nd configure pwm controller +.Nd configure PWM (Pulse Width Modulation) hardware .Sh SYNOPSIS .Nm .Op Fl f Ar device @@ -47,9 +47,26 @@ .Sh DESCRIPTION The .Nm -utility can be used to configure pwm controllers. +utility can be used to configure pwm hardware. +.Nm +uses a +.Xr pwmc 4 +device to communicate with the hardware. +Some PWM hardware supports multiple output channels within a single +controller block; each +.Xr pwmc 4 +instance controls a single PWM channel. .Pp -The options are as follow: +.Xr pwmc 4 +devices are named +.Pa /dev/pwm/pwmcX.Y , +where +.Va X +is the controller unit number and +.Va Y +is the channel number within that unit. +.Pp +The options are as follows: .Bl -tag -width "-f device" .It Fl f Ar device Device to operate on. @@ -60,15 +77,15 @@ If an unqualified name is provided, .Pa /dev/pwm is automatically prepended. .It Fl E -Enable the pwm channel. +Enable the PWM channel. .It Fl D -Disable the pwm channel. +Disable the PWM channel. .It Fl C -Show the configuration of the pwm channel. +Show the configuration of the PWM channel. .It Fl p Ar period -Configure the period (in nanoseconds) of the pwm channel +Configure the period (in nanoseconds) of the PWM channel .It Fl d Ar duty -Configure the duty (in nanoseconds or percentage) of the pwm channel. +Configure the duty (in nanoseconds or percentage) of the PWM channel. Duty is the portion of the .Ar period during which the signal is asserted. @@ -76,7 +93,7 @@ during which the signal is asserted. .Sh EXAMPLES .Bl -bullet .It -Show the configuration of the pwm channel: +Show the configuration of the PWM channel: .Bd -literal pwm -f /dev/pwm/pwmc0.1 -C .Ed From owner-svn-src-head@freebsd.org Tue Jun 18 01:15:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8EF715C9EBF; Tue, 18 Jun 2019 01:15: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 6C47F8B048; Tue, 18 Jun 2019 01:15: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 47F245F68; Tue, 18 Jun 2019 01:15: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 x5I1F1Q2065852; Tue, 18 Jun 2019 01:15:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I1F1OP065851; Tue, 18 Jun 2019 01:15:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906180115.x5I1F1OP065851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 01:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349166 - head/usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pwm X-SVN-Commit-Revision: 349166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C47F8B048 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 01:15:02 -0000 Author: ian Date: Tue Jun 18 01:15:00 2019 New Revision: 349166 URL: https://svnweb.freebsd.org/changeset/base/349166 Log: Rearrange the argument checking and processing so that enable and disable can be combined with configuring the period and duty cycle (the same ioctl sets all 3 values at once, so there's no reason to require the user to run the program twice to get all 3 things set). Modified: head/usr.sbin/pwm/pwm.8 head/usr.sbin/pwm/pwm.c Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Tue Jun 18 00:17:10 2019 (r349165) +++ head/usr.sbin/pwm/pwm.8 Tue Jun 18 01:15:00 2019 (r349166) @@ -31,19 +31,12 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar device -.Fl E -.Nm -.Op Fl f Ar device -.Fl D -.Nm -.Op Fl f Ar device .Fl C .Nm .Op Fl f Ar device -.Fl p Ar period -.Nm -.Op Fl f Ar device -.Fl d Ar duty +.Op Fl D | Fl E +.Op Fl p Ar period +.Op Fl d Ar duty .Sh DESCRIPTION The .Nm @@ -76,19 +69,19 @@ is used. If an unqualified name is provided, .Pa /dev/pwm is automatically prepended. -.It Fl E -Enable the PWM channel. -.It Fl D -Disable the PWM channel. .It Fl C Show the configuration of the PWM channel. -.It Fl p Ar period -Configure the period (in nanoseconds) of the PWM channel +.It Fl D +Disable the PWM channel. .It Fl d Ar duty Configure the duty (in nanoseconds or percentage) of the PWM channel. Duty is the portion of the .Ar period during which the signal is asserted. +.It Fl E +Enable the PWM channel. +.It Fl p Ar period +Configure the period (in nanoseconds) of the PWM channel. .El .Sh EXAMPLES .Bl -bullet @@ -98,9 +91,10 @@ Show the configuration of the PWM channel: pwm -f /dev/pwm/pwmc0.1 -C .Ed .It -Configure a 50000 ns period and a 25000 ns duty cycle: +Configure a 50000 ns period and a 25000 ns duty cycle +and enable the channel: .Bd -literal -pwm -f pwmc1.1 -p 50000 -d 25000 +pwm -f pwmc1.1 -E -p 50000 -d 25000 .Ed .It Configure a 50% duty cycle on the device and channel which Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Tue Jun 18 00:17:10 2019 (r349165) +++ head/usr.sbin/pwm/pwm.c Tue Jun 18 01:15:00 2019 (r349166) @@ -66,11 +66,8 @@ static void usage(void) { fprintf(stderr, "Usage:\n"); - fprintf(stderr, "\tpwm [-f dev] -E\n"); - fprintf(stderr, "\tpwm [-f dev] -D\n"); fprintf(stderr, "\tpwm [-f dev] -C\n"); - fprintf(stderr, "\tpwm [-f dev] -p period\n"); - fprintf(stderr, "\tpwm [-f dev] -d duty\n"); + fprintf(stderr, "\tpwm [-f dev] [-D | -E] [-p period] [-d duty[%%]]\n"); exit(1); } @@ -94,14 +91,14 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "f:EDCp:d:")) != -1) { switch (ch) { case 'E': - if (action) + if (action & (PWM_DISABLE | PWM_SHOW_CONFIG)) usage(); - action = PWM_ENABLE; + action |= PWM_ENABLE; break; case 'D': - if (action) + if (action & (PWM_ENABLE | PWM_SHOW_CONFIG)) usage(); - action = PWM_DISABLE; + action |= PWM_DISABLE; break; case 'C': if (action) @@ -109,17 +106,23 @@ main(int argc, char *argv[]) action = PWM_SHOW_CONFIG; break; case 'p': - if (action & ~(PWM_PERIOD | PWM_DUTY)) + if (action & PWM_SHOW_CONFIG) usage(); - action = PWM_PERIOD; + action |= PWM_PERIOD; period = strtol(optarg, NULL, 10); break; case 'd': - if (action & ~(PWM_PERIOD | PWM_DUTY)) + if (action & PWM_SHOW_CONFIG) usage(); - action = PWM_DUTY; + action |= PWM_DUTY; duty = strtol(optarg, &percent, 10); - if (*percent != '\0' && *percent != '%') + if (*percent == '%') { + if (duty < 0 || duty > 100) { + fprintf(stderr, + "Invalid duty percentage\n"); + usage(); + } + } else if (*percent != '\0') usage(); break; case 'f': @@ -169,49 +172,31 @@ main(int argc, char *argv[]) goto fail; } - switch (action) { - case PWM_ENABLE: - if (state.enable == false) { - state.enable = true; - if (ioctl(fd, PWMSETSTATE, &state) == -1) { - fprintf(stderr, - "Cannot enable the pwm controller\n"); - goto fail; - } - } - break; - case PWM_DISABLE: - if (state.enable == true) { - state.enable = false; - if (ioctl(fd, PWMSETSTATE, &state) == -1) { - fprintf(stderr, - "Cannot disable the pwm controller\n"); - goto fail; - } - } - break; - case PWM_SHOW_CONFIG: + if (action == PWM_SHOW_CONFIG) { printf("period: %u\nduty: %u\nenabled:%d\n", state.period, state.duty, state.enable); - break; - case PWM_PERIOD: - case PWM_DUTY: - if (period != -1) + goto fail; + } else { + if (action & PWM_ENABLE) + state.enable = true; + if (action & PWM_DISABLE) + state.enable = false; + if (action & PWM_PERIOD) state.period = period; - if (duty != -1) { + if (action & PWM_DUTY) { if (*percent != '\0') state.duty = state.period * duty / 100; else state.duty = duty; } + if (ioctl(fd, PWMSETSTATE, &state) == -1) { fprintf(stderr, "Cannot configure the pwm controller\n"); goto fail; } - break; } close(fd); From owner-svn-src-head@freebsd.org Tue Jun 18 02:27:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8758415CBAF4; Tue, 18 Jun 2019 02:27: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 25A048D775; Tue, 18 Jun 2019 02:27: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 F1EE46B27; Tue, 18 Jun 2019 02:27: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 x5I2RU0H002679; Tue, 18 Jun 2019 02:27:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I2RUuH002678; Tue, 18 Jun 2019 02:27:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906180227.x5I2RUuH002678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 02:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349167 - head/usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pwm X-SVN-Commit-Revision: 349167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25A048D775 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 02:27:31 -0000 Author: ian Date: Tue Jun 18 02:27:30 2019 New Revision: 349167 URL: https://svnweb.freebsd.org/changeset/base/349167 Log: Oops, it seems I left out the word 'cycle', fix it. Reported by: rpokala@ Modified: head/usr.sbin/pwm/pwm.8 Modified: head/usr.sbin/pwm/pwm.8 ============================================================================== --- head/usr.sbin/pwm/pwm.8 Tue Jun 18 01:15:00 2019 (r349166) +++ head/usr.sbin/pwm/pwm.8 Tue Jun 18 02:27:30 2019 (r349167) @@ -74,7 +74,7 @@ Show the configuration of the PWM channel. .It Fl D Disable the PWM channel. .It Fl d Ar duty -Configure the duty (in nanoseconds or percentage) of the PWM channel. +Configure the duty cycle (in nanoseconds or percentage) of the PWM channel. Duty is the portion of the .Ar period during which the signal is asserted. From owner-svn-src-head@freebsd.org Tue Jun 18 04:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3791415CE6FC; Tue, 18 Jun 2019 04:32:20 +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 CCAA8914B7; Tue, 18 Jun 2019 04:32:19 +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 BD1618196; Tue, 18 Jun 2019 04:32:19 +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 x5I4WJZD069892; Tue, 18 Jun 2019 04:32:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I4WJa9069890; Tue, 18 Jun 2019 04:32:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906180432.x5I4WJa9069890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 04:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349168 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 349168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCAA8914B7 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 04:32:20 -0000 Author: ian Date: Tue Jun 18 04:32:19 2019 New Revision: 349168 URL: https://svnweb.freebsd.org/changeset/base/349168 Log: Add a pwmc(4) manpage. Added: head/share/man/man4/pwmc.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jun 18 02:27:30 2019 (r349167) +++ head/share/man/man4/Makefile Tue Jun 18 04:32:19 2019 (r349168) @@ -418,6 +418,7 @@ MAN= aac.4 \ pts.4 \ pty.4 \ puc.4 \ + pwmc.4 \ ${_qlxge.4} \ ${_qlxgb.4} \ ${_qlxgbe.4} \ Added: head/share/man/man4/pwmc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/pwmc.4 Tue Jun 18 04:32:19 2019 (r349168) @@ -0,0 +1,212 @@ +.\" +.\" 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 ``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$ +.\" +.Dd June 17, 2019 +.Dt PWMC 4 +.Os +.Sh NAME +.Nm pwmc +.Nd PWM (Pulse Width Modulation) control device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pwmbus" +.Cd "device pwmc" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pwmc_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides device-control access to a channel of PWM hardware. +Each instance of a +.Nm +device is associated with a single PWM output channel. +.Pp +Some PWM hardware is organized with multiple channels sharing a +common clock or other resources. +In such cases, a separate +.Nm +instance will exist for each channel, but changing the period or +duty cycle of any one channel may affect other channels within the +hardware which share the same resources. +Consult the documentation for the underlying PWM hardware device driver +for details on channels that share resources. +.Pp +An instance of +.Nm +creates a character device named +.Pa /dev/pwm/pwmcX.Y +where +.Va X +is a sequential number assigned to each PWM hardware controller +as it is discovered by the system, and +.Va Y +is the channel number within that hardware controller. +The driver can be configured to create aliases that point to the +.Pa pwmcX.Y +entries, in effect creating named channels. +.Pp +The +.Nm +driver provides control of a PWM channel with the following +.Xr ioctl 2 +calls and data structures, defined in +.In dev/pwm/pwmc.h : +.Bl -tag -width indent +.It Dv PWMGETSTATE Pq Vt "struct pwm_state" +Retrieve the current state of the channel. +.It Dv PWMSETSTATE Pq Vt "struct pwm_state" +Set the current state of the channel. +All parameters are updated on every call. +To change just one of the values, use +.Dv PWMGETSTATE +to get the current state and then submit the same data back with +just the appropriate value changed. +.El +.Pp +The +.Va pwm_state +structure is defined as follows: +.Bd -literal +struct pwm_state { + u_int period; + u_int duty; + uint32_t flags; + bool enable; +}; +.Ed +.Pp +.Bl -tag -width period +.It Va period +The duration, in nanoseconds, of one complete on-off cycle. +.It Va duty +The duration, in nanoseconds, of the on portion of one cycle. +.It Va flags +Flags that affect the output signal can be bitwise-ORed together. +The following flags are currently defined: +.Pp +.Bl -tag -width PWM_POLARITY_INVERTED -compact +.It Dv PWM_POLARITY_INVERTED +Invert the signal polarity. +.El +.It Va enable +.Va +False to disable the output signal or true to enable it. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.pwmc.%d.at +The pwmbus instance the +.Nm +instance is attached to. +.It Va hint.pwmc.%d.channel +The hardware channel number the instance is attached to. +Channel numbers count up from zero. +.It Va hint.pwmc.%d.label +If this optional hint is set, the driver creates an alias in +.Pa /dev/pwm +with the given name, which points to the instance. +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, a +.Nm +device is described with a child node of the pwm hardware controller node. +When the hardware supports multiple channels within the controller, it is +not necessary to include a +.Nm +child node for every channel the hardware supports. +Define only the channels you need to control. +.Pp +The following properties are required for a +.Nm +device node: +.Bl -tag -width indent +.It Va compatible +Must be the string "freebsd,pwmc". +.It Va reg +The hardware channel number. +.El +.Pp +The following properties are optional for the +.Nm +device node: +.Bl -tag -width indent +.It Va label +A string containing only characters legal in a file name. +The driver creates an alias with the given name in +.Pa /dev/pwm +which points to the instance's +.Pa /dev/pwm/pwmcX.Y +device entry. +.El +.Pp +Example of a PWM hardware node containing one +.Nm +child node: +.Bd -literal +&ehrpwm0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&ehrpwm0_AB_pins>; + + pwmcontrol@0 { + compatible = "freebsd,pwmc"; + reg = <0>; + label = "backlight"; + }; +}; +.Ed +.Sh FILES +.Bl -tag -width -compact +.It Pa /dev/pwm/pwmc* +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr device.hints 5 , +.Xr pwm 8 , +.Xr pwm 9 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 13.0 . From owner-svn-src-head@freebsd.org Tue Jun 18 14:13:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5FC15BD9A2; Tue, 18 Jun 2019 14:13:53 +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 102D476CE6; Tue, 18 Jun 2019 14:13:53 +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 E1DECE473; Tue, 18 Jun 2019 14:13:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5IEDqVV075515; Tue, 18 Jun 2019 14:13:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IEDqle075514; Tue, 18 Jun 2019 14:13:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906181413.x5IEDqle075514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 18 Jun 2019 14:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349170 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 349170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 102D476CE6 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.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 14:13:53 -0000 Author: emaste Date: Tue Jun 18 14:13:52 2019 New Revision: 349170 URL: https://svnweb.freebsd.org/changeset/base/349170 Log: Remove sys/capability.h for the third time In all supported (and most unsupported) FreeBSD versions the appropriate header for Capsicum is sys/capsicum.h. Software including sys/capability.h is most likely looking for Linux capabilities based on the withdrawn POSIX.1e draft. This header was previously removed in r334929 and r340156, but reverted each time due to ports failures. These issues have now (broadly) been addressed. PR: 228878 [exp-run] Submitted by: eadler (r334929) Relnotes: Yes Sponsored by: The FreeBSD Foundation Deleted: head/sys/sys/capability.h Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jun 18 05:59:24 2019 (r349169) +++ head/ObsoleteFiles.inc Tue Jun 18 14:13:52 2019 (r349170) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190618: sys/capability.h removed (sys/capsicum.h is the one to use) +OLD_FILES+=usr/include/sys/capability.h # 20190615: sys/pwm.h renamed to dev/pwmc.h OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. From owner-svn-src-head@freebsd.org Tue Jun 18 17:05:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0780715C3371; Tue, 18 Jun 2019 17:05:06 +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 A282C85D2C; Tue, 18 Jun 2019 17:05:05 +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 78351181C9; Tue, 18 Jun 2019 17:05:05 +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 x5IH55JF064715; Tue, 18 Jun 2019 17:05:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IH55eE064714; Tue, 18 Jun 2019 17:05:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906181705.x5IH55eE064714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 18 Jun 2019 17:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349174 - head/sys/dev/pwm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/pwm X-SVN-Commit-Revision: 349174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A282C85D2C 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 17:05:06 -0000 Author: ian Date: Tue Jun 18 17:05:05 2019 New Revision: 349174 URL: https://svnweb.freebsd.org/changeset/base/349174 Log: Handle labels specified with hints even on FDT systems. Hints are the easiest thing for a user to control (via loader.conf or kenv+kldload), so handle them in addition to any label specified via the FDT data. Modified: head/sys/dev/pwm/pwmc.c Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Tue Jun 18 16:31:05 2019 (r349173) +++ head/sys/dev/pwm/pwmc.c Tue Jun 18 17:05:05 2019 (r349174) @@ -108,33 +108,24 @@ static struct cdevsw pwm_cdevsw = { .d_ioctl = pwm_ioctl }; -#ifdef FDT - static void pwmc_setup_label(struct pwmc_softc *sc) { + const char *hintlabel; +#ifdef FDT void *label; if (OF_getprop_alloc(ofw_bus_get_node(sc->dev), "label", &label) > 0) { make_dev_alias(sc->cdev, "pwm/%s", (char *)label); OF_prop_free(label); } -} +#endif -#else /* FDT */ - -static void -pwmc_setup_label(struct pwmc_softc *sc) -{ - const char *label; - if (resource_string_value(device_get_name(sc->dev), - device_get_unit(sc->dev), "label", &label) == 0) { - make_dev_alias(sc->cdev, "pwm/%s", label); + device_get_unit(sc->dev), "label", &hintlabel) == 0) { + make_dev_alias(sc->cdev, "pwm/%s", hintlabel); } } - -#endif /* FDT */ static int pwmc_probe(device_t dev) From owner-svn-src-head@freebsd.org Tue Jun 18 17:51:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E21B415C4022; Tue, 18 Jun 2019 17:51:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88F5487478; Tue, 18 Jun 2019 17:51:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC15188F8; Tue, 18 Jun 2019 17:51:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5IHpVMh086956; Tue, 18 Jun 2019 17:51:31 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IHpV2c086955; Tue, 18 Jun 2019 17:51:31 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201906181751.x5IHpV2c086955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 18 Jun 2019 17:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349175 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88F5487478 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 17:51:32 -0000 Author: vmaffione Date: Tue Jun 18 17:51:30 2019 New Revision: 349175 URL: https://svnweb.freebsd.org/changeset/base/349175 Log: bhyve: vtnet: fix locking on receive The vsc_rx_ready and the RX virtqueue is protected by the rx_mtx lock. However, pci_vtnet_ping_rxq() (currently called only once after each device reset) accesses those without acquiring the lock. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20609 Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Jun 18 17:05:05 2019 (r349174) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Jun 18 17:51:30 2019 (r349175) @@ -583,10 +583,12 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) /* * A qnotify means that the rx process can now begin */ + pthread_mutex_lock(&sc->rx_mtx); if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; vq_kick_disable(vq); } + pthread_mutex_unlock(&sc->rx_mtx); } static void From owner-svn-src-head@freebsd.org Tue Jun 18 18:50:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C55515C53D3; Tue, 18 Jun 2019 18:50:59 +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 D035A89505; Tue, 18 Jun 2019 18:50:58 +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 9A64019320; Tue, 18 Jun 2019 18:50:58 +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 x5IIowwK020756; Tue, 18 Jun 2019 18:50:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IIow3d020755; Tue, 18 Jun 2019 18:50:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906181850.x5IIow3d020755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 18 Jun 2019 18:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349176 - 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: 349176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D035A89505 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.930,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 18:50:59 -0000 Author: cem Date: Tue Jun 18 18:50:58 2019 New Revision: 349176 URL: https://svnweb.freebsd.org/changeset/base/349176 Log: random(4): Fix a regression in short AES mode reads In r349154, random device reads of size < 16 bytes (AES block size) were accidentally broken to loop forever. Correct the loop condition for small reads. Reported by: pho Reviewed by: delphij Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D20686 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Tue Jun 18 17:51:30 2019 (r349175) +++ head/sys/dev/random/fortuna.c Tue Jun 18 18:50:58 2019 (r349176) @@ -489,7 +489,7 @@ random_fortuna_genbytes(uint8_t *buf, size_t bytecount if (!random_chachamode) chunk_size = rounddown(chunk_size, RANDOM_BLOCKSIZE); - while (bytecount >= chunk_size) { + while (bytecount >= chunk_size && chunk_size > 0) { randomdev_keystream(p_key, p_counter, buf, chunk_size); buf += chunk_size; From owner-svn-src-head@freebsd.org Tue Jun 18 18:55:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA1015C56DC for ; Tue, 18 Jun 2019 18:55:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 18A8289A09 for ; Tue, 18 Jun 2019 18:55:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x844.google.com with SMTP id x47so16676132qtk.11 for ; Tue, 18 Jun 2019 11:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=X3HfnDoBEh8QwWSdoImCn+gsl4L6L32DUHWE+oJgH8g=; b=ZUTIVm4i654r+2z/ZSiS7xZnNs5wEvKzTHbe//CHUkcES3Lknf6mhIvzQAKPPaHUP3 Z/KBclvJWxEymm854iIK3Z7YntprBXcAd7xz6rDgNlsO2zQXw/z+a8oc9FYXNjnttFAG qL//YQ8fbQ2qtG9sG6QLx5fHdRNqI7sRxw7RM9kFOJlQSHz0FGR5JLeyQqPOdIjShG6f F7s4iNR6ndt/z5TJLPUtd2IRmJ5b2pJyjZmNyTXpqtonGj9Xiyx6JQYSQtEz0AhqlfW6 sSAtlLl05GOWO2Ikhi6J+XJy2R8aBp8RPtbkY3oKJ9sZiLhZnHK/l+MmV6IwUb/KSGva K8vA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=X3HfnDoBEh8QwWSdoImCn+gsl4L6L32DUHWE+oJgH8g=; b=ohEZg6BD0/0unCBmxk215PEMAKAkELfy3UboTUBxEStsrrMjMLdQvaaF6Stx1nXbvY MhScgzCayF1WCm2GONRHCBMByyqMKYBz+B4ciNN+EuRWTaA/PLXQpa198SoQBR/G2mZL kbM4l8kqr4l9WVfHwxidlb6C387xyhcgaP8ergFk9Hr6f8ICP/5aDp3dY3mkCVsUXlDt YLAJK3VrSZFoP0agWTlDkQmw8W6YuuuQA7PNQO5fxSSBiAoDbLPyIi80SP0qcdEcnelQ lzweLcOxstIYGycRrJ+QKki2p3hVwIBn9GTJdPVEDeQ1A7A4nPVSJJx6O8BsdQod2cJk 8e/w== X-Gm-Message-State: APjAAAUkyycsM6pt4/pBCPWIzeZXL7W36WN7j8Ui/01qSD4KSx2ereIn 4DqpC1lOncHEon8JuN/zg9C4zg== X-Google-Smtp-Source: APXvYqylsgQ99Fc5AU5nXpC9T3AkaFtG55Rs2sRUoR+4DpwTPcK4BQBQDAREnuwdLOh2xmxrTBgpgw== X-Received: by 2002:a0c:d610:: with SMTP id c16mr29445671qvj.22.1560884113553; Tue, 18 Jun 2019 11:55:13 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id e52sm4602483qtk.20.2019.06.18.11.55.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 11:55:12 -0700 (PDT) Date: Tue, 18 Jun 2019 14:55:12 -0400 From: Shawn Webb To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349176 - head/sys/dev/random Message-ID: <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd> References: <201906181850.x5IIow3d020755@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mmc352mzirnzscxj" Content-Disposition: inline In-Reply-To: <201906181850.x5IIow3d020755@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 18A8289A09 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 18:55:15 -0000 --mmc352mzirnzscxj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2019 at 06:50:58PM +0000, Conrad Meyer wrote: > Author: cem > Date: Tue Jun 18 18:50:58 2019 > New Revision: 349176 > URL: https://svnweb.freebsd.org/changeset/base/349176 >=20 > Log: > random(4): Fix a regression in short AES mode reads > =20 > In r349154, random device reads of size < 16 bytes (AES block size) were > accidentally broken to loop forever. Correct the loop condition for sm= all > reads. > =20 > Reported by: pho > Reviewed by: delphij > Approved by: secteam(delphij) > Differential Revision: https://reviews.freebsd.org/D20686 Hey Conrad, Thanks for fixing this issue! Any plans to MFC? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --mmc352mzirnzscxj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0JM4oACgkQ/y5nonf4 4foYMhAAkBvajHiOxC2n8HSFApdoK8yiCD9oqpZAQ/PCbjHjWyQger+CSBw5TCJw iahno5TkEo1iakhueB6AIPlWrc8Heq+uwJ9Crdc3x1tWGpvPca30Hbmr3p9Hf9wV /LHGD5VABAOiKg85MgpkwI+sDnNBc330uedqPhvfQ3bMK5v79MF42vKRSVF9kZWR /iGkaUupqyhMVTNBilhL+J39gaUTg6A1Sh5MFDLCAXVZ262n0IFaE55ijxCxPZhD sqw6i8z/b75x9w1P+sQM37jlkp99RFVAsDgAS73C5KF3c40QBlhyxekHz44B+Kd+ E6PigLUDazEYk/CyPrtGJ7G3VrfbEKxUcYm5R524wSDogwctjEaAhfSSo322OREc /7Nzma4/ZYnISNNVch387ynHjWXxWk33lSx6Mg/j+8dkkLsgfhKdoGqCR0Gt3Pe5 AT8GMQNqC+T+DkbVU2+ssHLKf8ARdTA3F9ucFCp1qJN2rxyeFIx4khPik5rGfgi7 QnhIHwQw7LHXrNLFcAAiFc1HWi4O7lDa+0pwz4CXzoXxhs2Z8xaaPqPf9vAa9VDx p88dRHe0X0TM20baL8aviNOh+5yZK+X96AEpUHbcms6zeJvE1x4CgnhHQkb1y7xC msMkTgrrJ+z//rjWWDcLdf+rzpiKmLF+0YTyGz/c6kfMPob+Ihw= =SGyn -----END PGP SIGNATURE----- --mmc352mzirnzscxj-- From owner-svn-src-head@freebsd.org Tue Jun 18 19:46:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C4B15C6F85; Tue, 18 Jun 2019 19:46:52 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7BB8B981; Tue, 18 Jun 2019 19:46:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id dK45hhQCmo7SQdK47hFC3u; Tue, 18 Jun 2019 13:46:48 -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=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=SAdhG0escuY5eQpG16AA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id EC587184F; Tue, 18 Jun 2019 12:46:44 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5IJkii6003227; Tue, 18 Jun 2019 12:46:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5IJkiJ5003201; Tue, 18 Jun 2019 12:46:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201906181946.x5IJkiJ5003201@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Shawn Webb cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349176 - head/sys/dev/random In-Reply-To: Message from Shawn Webb of "Tue, 18 Jun 2019 14:55:12 -0400." <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 18 Jun 2019 12:46:44 -0700 X-CMAE-Envelope: MS4wfJ+7rqUAGSIMSCJqSoAMTITq46UpUPp6PAJpEIq1ek7DNSrqv8nCP0QTarnxMAmWNjqk4/pKG5IkNh8rtZTtDbA8cFtko7pu3Lm6HXIseVUAQltunV9H /gpWUd3I6itvakCK4zhsrMxnN5DC5OTh6fuHKflOoEW7fSff2N+OsoW2JvrmbRrok/peVl7mStHSGG+hTqopTwAlkAkcKUaX6i9ctPXZdsVePs52joWDpnPX 2cqTUUhfle9sfGnQ6x2Uo/FvWvUx2H9ecIwCZtThYogTbTEAdse68YcrtDjoHEO2DhjuR0yYmG5F9nhxTu6iAyHJl+5Fk1edG80gziit30I= X-Rspamd-Queue-Id: 1E7BB8B981 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.07 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.41)[ip: (-6.20), ipnet: 64.59.128.0/20(-3.25), asn: 6327(-2.51), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 19:46:53 -0000 In message <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd>, Shawn Webb writes: > > --mmc352mzirnzscxj > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Tue, Jun 18, 2019 at 06:50:58PM +0000, Conrad Meyer wrote: > > Author: cem > > Date: Tue Jun 18 18:50:58 2019 > > New Revision: 349176 > > URL: https://svnweb.freebsd.org/changeset/base/349176 > >=20 > > Log: > > random(4): Fix a regression in short AES mode reads > > =20 > > In r349154, random device reads of size < 16 bytes (AES block size) were > > accidentally broken to loop forever. Correct the loop condition for sm= > all > > reads. > > =20 > > Reported by: pho > > Reviewed by: delphij > > Approved by: secteam(delphij) > > Differential Revision: https://reviews.freebsd.org/D20686 > > Hey Conrad, > > Thanks for fixing this issue! Any plans to MFC? Why? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jun 18 19:50:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE15215C7068 for ; Tue, 18 Jun 2019 19:50:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 5D4D28BB1D for ; Tue, 18 Jun 2019 19:50:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82d.google.com with SMTP id y57so16977481qtk.4 for ; Tue, 18 Jun 2019 12:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=29JWM0Pxrxj4fV4pnsKEkZtLL+duE6vapPje6UqJVJ8=; b=UT31D//jl6Hz9CaYQyf29Xg8SMzH3JjovKdDH0DkSgYskPEc3t51XqeSMO0zhAcJjr Gn40b9BX/EO1NiMN5HoZm+7mEqs5GmG6pBVlZrwprWrgsVuU6qBO++KwYwyleCnbK+51 bIOLIRRlLDMDM9/GseuEKbxAMV9wf4MSNPbpfapk5mBjbSofw2yWsPOE+EhKhSD5T/lg acHHs460qZO22yjNWrFtPWsdgOKX9YQUz2qsEEDKE4uBxQw7rc+ntnbfv2+BfsMexuRU GmZLJB15vL4VsV6MbGaAxegb0mIDCtrfb+MLXxftAucHWnuo63MvGsA9fWS90C9uWOuZ pc3A== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=29JWM0Pxrxj4fV4pnsKEkZtLL+duE6vapPje6UqJVJ8=; b=drvmkTqv59IfSTJb4zts267CU14XNpehsU5SWAKM5euLzuG2FQUc5ZrQulxLzJnNB4 wo0yERaZpUPSoNlvgj2fJNQfSIVQdPfTJvTSdSkiQsnpphVTSTLgd38aveX15+801jB7 fopwPk1AdUJkZSsTDEBbjpG7oP4SZtQMtweZYLn5wnuJ2fPFDtKH7BwRFWXkV+KiiCV/ 7+kSAJCZRshjPgS6x9v5ZRuaTcxz5pZMdzO7avAn6sfZ4zKYwZXumx3OtkKfRYlZpaPj A+nYSLejnmuwHBW7znW8Ld1DRasfmlYgiLAzdJl1AeRodwrLOCgezFJvRZogqfpUlBqL cc7Q== X-Gm-Message-State: APjAAAVCiT3qMjnQ2xXLdcpX9mStcI/ueNNQ8b97GNSXHqZA9IL47HyA KY31X3BInvxVMPMKI5LT3uFlWw== X-Google-Smtp-Source: APXvYqzEZ+a7IMZRzLLMcMPI94jQaQhVaMTQY3Y1EE4iVVZxZqOofAtUQE6yYBhSUQHMT4+mAyN+Kw== X-Received: by 2002:ac8:f13:: with SMTP id e19mr100585097qtk.11.1560887415629; Tue, 18 Jun 2019 12:50:15 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id q29sm9158005qkq.77.2019.06.18.12.50.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 12:50:14 -0700 (PDT) Date: Tue, 18 Jun 2019 15:50:14 -0400 From: Shawn Webb To: Cy Schubert Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349176 - head/sys/dev/random Message-ID: <20190618195014.utsmhhmgzrj6gqlv@mutt-hbsd> References: <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd> <201906181946.x5IJkiJ5003201@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jq3dnxqekadefzxt" Content-Disposition: inline In-Reply-To: <201906181946.x5IJkiJ5003201@slippy.cwsent.com> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 5D4D28BB1D 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 19:50:17 -0000 --jq3dnxqekadefzxt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2019 at 12:46:44PM -0700, Cy Schubert wrote: > In message <20190618185512.e2nbzwbtvxz2azge@mutt-hbsd>, Shawn Webb=20 > writes: > >=20 > > --mmc352mzirnzscxj > > Content-Type: text/plain; charset=3Dus-ascii > > Content-Disposition: inline > > Content-Transfer-Encoding: quoted-printable > > > > On Tue, Jun 18, 2019 at 06:50:58PM +0000, Conrad Meyer wrote: > > > Author: cem > > > Date: Tue Jun 18 18:50:58 2019 > > > New Revision: 349176 > > > URL: https://svnweb.freebsd.org/changeset/base/349176 > > >=3D20 > > > Log: > > > random(4): Fix a regression in short AES mode reads > > > =3D20 > > > In r349154, random device reads of size < 16 bytes (AES block size)= were > > > accidentally broken to loop forever. Correct the loop condition fo= r sm=3D > > all > > > reads. > > > =3D20 > > > Reported by: pho > > > Reviewed by: delphij > > > Approved by: secteam(delphij) > > > Differential Revision: https://reviews.freebsd.org/D20686 > > > > Hey Conrad, > > > > Thanks for fixing this issue! Any plans to MFC? >=20 > Why? Whoops. I didn't catch the condition on the revision number. Sorry for the line noise! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --jq3dnxqekadefzxt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0JQHEACgkQ/y5nonf4 4fqiIA/9GOZEF0ToYa5JYa/C/4Dl6Qnw+NY0KRjSe4O3cZY/VouM2CblfT+neqi+ xmRnFG0fmesKsbOMoPbgYh96MQ7/FkSA3Od73Ilv8OCjtF1eEWJH0HusFai3iHcW pvdVn3qjiCp3tGbpxj/nJSEeZnAkKZF7sRS+wLL50Ihv68O7Wy/3B+fdmY4VvWO4 NNV96BbmLna3MT8logMDrcb3vhIy/tf1u8Lvvbg+zAMjsriSXTatRRbavzXOLTyG R21zNCDe5gDxsxUnTJ0vQDAvoP0GVdlGR/0FHAop+r6/FBtjbWh4g8XlGlyHnR3r 1QqIHiatWueyAzltXtpGwvVD66faTFHSOZ9LZzwA/YCBdV3W38I0yGZ9mVHFHvyu zfJPCd5/3ZZ1+X1ODfDaX0F8KQydnhn+70wBbXYhnKfGRCtAIo6kTB77U20yqCWi L6eH0sfOvkFbQuXwTRylSvDimm8XX2NV9cIWk4c+E7Q4Htcotl5aPntwiUMJO0qo kuzwqnalCzXkCoFi5eUK3/RAr3g1xkYBIt2oYfrUojnThQr7aZTvMFF4OBzUjoLI /SOeMqeOqexSOhIxfqNtMajhjg0HNKd/kvtbynlEWMGkBkITzr1BP1ZCXI0EUIG0 OfIDwdYGibVBa0Wc3sZ+IWCxkRoqNzIALFoDUL1nc3QbRovxo8k= =KspM -----END PGP SIGNATURE----- --jq3dnxqekadefzxt-- From owner-svn-src-head@freebsd.org Tue Jun 18 21:02:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E07F15C876D; Tue, 18 Jun 2019 21:02:41 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2A038DCF8; Tue, 18 Jun 2019 21:02:40 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CDFD1AA70; Tue, 18 Jun 2019 21:02:40 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5IL2eKk003666; Tue, 18 Jun 2019 21:02:40 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IL2eNB003665; Tue, 18 Jun 2019 21:02:40 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906182102.x5IL2eNB003665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Tue, 18 Jun 2019 21:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349177 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2A038DCF8 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 21:02:41 -0000 Author: sevan (doc committer) Date: Tue Jun 18 21:02:40 2019 New Revision: 349177 URL: https://svnweb.freebsd.org/changeset/base/349177 Log: Mark NetBSD branch points NetBSD 7.0 was a separate branch, subsequent 8.x releases did not emerge from this branch. Clean up minor visual nits, centre OpenBSD listing on the B, DragonFly listings on the y. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Jun 18 18:50:58 2019 (r349176) +++ head/share/misc/bsd-family-tree Tue Jun 18 21:02:40 2019 (r349177) @@ -64,14 +64,14 @@ Tenth Edition | | | | 4.4BSD-Encumbered | | | -NetBSD 0.8 | BSD/386 1.0 | / | | | -FreeBSD 1.0 <-----' NetBSD 0.9 | BSD/386 1.1 +FreeBSD 1.0 <-----' *--NetBSD 0.9 | BSD/386 1.1 | | .----- 4.4BSD Lite | -FreeBSD 1.1 | / / | \ | - | | / / | \ | -FreeBSD 1.1.5 .---|--------' / | \ | - | / | / | \ | -FreeBSD 1.1.5.1 / | / | \ | - | / NetBSD 1.0 <-' | \ | +FreeBSD 1.1 | / / | \ | + | | / | | \ | +FreeBSD 1.1.5 .---|--------' | | \ | + | / | | | \ | +FreeBSD 1.1.5.1 / | | | \ | + | / *--NetBSD 1.0 <-' | \ | | / | | \ | FreeBSD 2.0 <--' | | BSD/OS 2.0 | \ | | @@ -83,9 +83,9 @@ FreeBSD 2.0.5 \ | | | | | OpenBSD 2.3 | | | | | | BSD/OS 3.0 | FreeBSD 2.1 | | | | - | | | | NetBSD 1.1 ------. BSD/OS 2.1 - | FreeBSD 2.1.5 | | | \ | - | | | | NetBSD 1.2 \ BSD/OS 3.0 + | | | | *--NetBSD 1.1 -. BSD/OS 2.1 + | FreeBSD 2.1.5 | | | \ | + | | | | *--NetBSD 1.2 \ BSD/OS 3.0 | FreeBSD 2.1.6 | | | \ OpenBSD 2.0 | | | | | | \ | | | FreeBSD 2.1.6.1 | | | \ | | @@ -103,7 +103,7 @@ FreeBSD 2.1 | | | | | | | | | | | FreeBSD 2.2.5 | | | | | | | | | | OpenBSD 2.2 | - | | | | NetBSD 1.3 | | + | | | | *--NetBSD 1.3 | | | FreeBSD 2.2.6 | | | | | | | | | | | NetBSD 1.3.1 | BSD/OS 3.1 | | | | | | OpenBSD 2.3 | @@ -119,7 +119,7 @@ FreeBSD 3.0 <--------* | | v | | | | NetBSD 1.3.3 | | *---FreeBSD 3.1 | | | | | | | | | BSD/OS 4.0.1 - | FreeBSD 3.2----* | NetBSD 1.4 OpenBSD 2.5 | + | FreeBSD 3.2----* | .--*--NetBSD 1.4 OpenBSD 2.5 | | | | | | | | | | | | | | | | | | | | | | | | | | | | @@ -142,7 +142,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | | | Mac OS X | OpenBSD 2.8 BSD/OS 4.2 | | | | | | | | | | | | - | | 10.0 NetBSD 1.5 | | + | | 10.0 *--NetBSD 1.5 | | | FreeBSD 4.3 | | | | | | | | | | OpenBSD 2.9 | | | | | NetBSD 1.5.1 | | @@ -157,7 +157,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | | FreeBSD 4.6.2 Mac OS X | | | | | 10.2 | | | | FreeBSD 4.7 | | | | - | | | NetBSD 1.6 OpenBSD 3.2 | + | | | *--NetBSD 1.6 OpenBSD 3.2 | | FreeBSD 4.8 | | | | | | | | | NetBSD 1.6.1 | | | |--------. | | | OpenBSD 3.3 BSD/OS 5.0 @@ -176,7 +176,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | | | | | \ FreeBSD 5.0 | | | | | | | | | -FreeBSD 5.1 | | | DragonFly 1.0 +FreeBSD 5.1 | | | DragonFly 1.0 | \ | | | | | ----- Mac OS X | | | | 10.3 | | | @@ -186,7 +186,7 @@ FreeBSD 5.2 | | | | | | | | *-------FreeBSD 5.3 | | | | | | | | OpenBSD 3.6 | - | | | NetBSD 2.0 | | + | | | *--NetBSD 2.0 | | | | | | | | | DragonFly 1.2.0 | | Mac OS X | | NetBSD 2.0.2 | | | | 10.4 | | | | | @@ -199,7 +199,7 @@ FreeBSD 5.2 | | | | | | | | \ | | | | | | | NetBSD 2.1 | | | | | | | | | - | | | | NetBSD 3.0 | | + | | | | *--NetBSD 3.0 | | | | | | | | | | DragonFly 1.4.0 | | | | | | | OpenBSD 3.9 | | FreeBSD | | | | | | | @@ -217,7 +217,7 @@ FreeBSD 5.2 | | | | | Mac OS X | | | | | 10.5 | | | | | | | OpenBSD 4.2 | - | | | NetBSD 4.0 | | + | | | *--NetBSD 4.0 | | | FreeBSD 6.3 | | | | | | \ | | | | | *--FreeBSD | | | | | DragonFly 1.12.0 @@ -229,104 +229,112 @@ FreeBSD 5.2 | | | | | | | | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 - | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | - | \ | | | \ | | - | | Mac OS X | | \ | | - | | 10.6 | | \ | | - | | | | | NetBSD | DragonFly 2.4.0 - | | | | | 5.0.1 OpenBSD 4.6 | - | | | | | | | | - *--FreeBSD | | | | | | | - | 8.0 | | | | | | | - | | FreeBSD | | | NetBSD | | - | | 7.3 | | | 5.0.2 | DragonFly 2.6.0 - | | | | | | OpenBSD 4.7 | - | FreeBSD | | | | | | - | 8.1 | | | | | | - | | | | | | | DragonFly 2.8.2 - | | | | | | OpenBSD 4.8 | - | | | | | *--NetBSD | | - | FreeBSD FreeBSD | | | 5.1 | | - | 8.2 7.4 | | | | | DragonFly 2.10.1 - | | | | | | OpenBSD 4.9 | - | `-----. Mac OS X | | | | | - | \ 10.7 | | | | | - | | | | | | OpenBSD 5.0 | - *--FreeBSD | | | | | | | - | 9.0 | | | | NetBSD | DragonFly 3.0.1 - | | FreeBSD | | | 5.1.2 | | - | | 8.3 | | | | | | - | | | | | | NetBSD | | - | | | | | | 5.1.3 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 5.1.4 | | - | | | | | | OpenBSD 5.1 | - | | | Mac OS X | `----. | | - | | | 10.8 | \ | | - | | | | NetBSD 6.0 | | | - | | | | | | | | OpenBSD 5.2 DragonFly 3.2.1 - | FreeBSD | | | | | NetBSD | | - | 9.1 | | | | | 5.2 | | - | | | | | | | | | | - | | | | | | | NetBSD | | - | | | | | | | 5.2.1 | | - | | | | | | | | | | - | | | | | | | NetBSD | | - | | | | | | | 5.2.2 | | - | | | | | | | | | - | | | | | | \ | | - | | | | | | NetBSD | | - | | | | | | 6.0.1 | | - | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 - | | | | | | NetBSD | | - | | | | | | 6.0.2 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 6.0.3 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 6.0.4 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 6.0.5 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 6.0.6 | | - | | | | | | | | - | | | | | |`-NetBSD 6.1 | | - | | FreeBSD | | | | | - | | 8.4 | | NetBSD 6.1.1 | | - | | | | | | | - | FreeBSD | | NetBSD 6.1.2 | | - | 9.2 Mac OS X | | | | - | | 10.9 | | OpenBSD 5.4 | - | `-----. | | | | DragonFly 3.6.0 - | \ | | | | | - *--FreeBSD | | | NetBSD 6.1.3 | | - | 10.0 | | | | | | - | | | | | | | DragonFly 3.6.1 - | | | | | | | | - | | | | | | | | - | | | | | | | DragonFly 3.6.2 - | | | | | NetBSD 6.1.4 | | - | | | | | | | | - | | | | | | OpenBSD 5.5 | - | | | | | | | | - | | | | | | | DragonFly 3.8.0 - | | | | | | | | - | | | | | | | | - | | | | | | | DragonFly 3.8.1 - | | | | | | | | - | | | | | | | | - | | | | | | | DragonFly 3.6.3 - | | | | | | | | - | | FreeBSD | | | | | - | | 9.3 | | | | | - | | | | NetBSD 6.1.5 | DragonFly 3.8.2 + | FreeBSD 7.2 | *--NetBSD OpenBSD 4.5 | + | \ | | 5.0 | | + | \ | | / | \ | | + | | Mac OS X | | | \ | | + | | 10.6 | | | \ | | + | | | | | | NetBSD | DragonFly 2.4.0 + | | | | | | 5.0.1 OpenBSD 4.6 | + | | | | | | | | | + *--FreeBSD | | | | | | | | + | 8.0 | | | | | | | | + | | FreeBSD | | | | NetBSD | | + | | 7.3 | | | | 5.0.2 | DragonFly 2.6.0 + | | | | | | | OpenBSD 4.7 | + | FreeBSD | | | | | | | + | 8.1 | | | | | | | + | | | | | | | | DragonFly 2.8.2 + | | | | | | | OpenBSD 4.8 | + | | | | | | *--NetBSD | | + | FreeBSD FreeBSD | | | 5.1 | | + | 8.2 7.4 | | | | | DragonFly 2.10.1 + | | | | | | OpenBSD 4.9 | + | `-----. Mac OS X | | | | | + | \ 10.7 | | | | | + | | | | | | OpenBSD 5.0 | + *--FreeBSD | | | | | | | + | 9.0 | | | | NetBSD | DragonFly 3.0.1 + | | FreeBSD | | | 5.1.2 | | + | | 8.3 | | | | | | + | | | | | | NetBSD | | + | | | | | | 5.1.3 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 5.1.4 | | + | | | | | | OpenBSD 5.1 | + | | | Mac OS X | `--------. | | + | | | 10.8 | | | | + | | | | *--NetBSD | | | + | | | | | 6.0 | | | + | | | | | | | | OpenBSD 5.2 DragonFly 3.2.1 + | FreeBSD | | | | | NetBSD | | + | 9.1 | | | | | 5.2 | | + | | | | | | | | | | + | | | | | | | NetBSD | | + | | | | | | | 5.2.1 | | + | | | | | | | | | | + | | | | | | | NetBSD | | + | | | | | | | 5.2.2 | | + | | | | | | | | | + | | | | | | \ | | + | | | | | | NetBSD | | + | | | | | | 6.0.1 | | + | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 + | | | | | | NetBSD | | + | | | | | | 6.0.2 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.3 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.4 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.5 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.6 | | + | | | | | | | | + | | | | | *--NetBSD | | + | | | | | 6.1 | | + | | FreeBSD | | | | | + | | 8.4 | | NetBSD | | + | | | | | 6.1.1 | | + | | | | | | | + | FreeBSD | | NetBSD | | + | 9.2 | | 6.1.2 | | + | | Mac OS X | | | | + | | 10.9 | | OpenBSD 5.4 | + | `-----. | | | | DragonFly 3.6.0 + | \ | | | | | + *--FreeBSD | | | NetBSD | | + | 10.0 | | | 6.1.3 | | + | | | | | | | | + | | | | | | | DragonFly 3.6.1 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.6.2 + | | | | | NetBSD | | + | | | | | 6.1.4 | | + | | | | | | | | + | | | | | | OpenBSD 5.5 | + | | | | | | | | + | | | | | | | DragonFly 3.8.0 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.8.1 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.6.3 + | | | | | | | | + | | FreeBSD | | | | | + | | 9.3 | | | | | + | | | | NetBSD | DragonFly 3.8.2 + | | | | 6.1.5 | | | | Mac OS X | | | | | 10.10 | | | - | | | | OpenBSD 5.6 | + | | | | OpenBSD 5.6 | | FreeBSD | | | | | 10.1 | | | DragonFly 4.0.1 | | | | | | @@ -338,54 +346,62 @@ FreeBSD 5.2 | | | | | | | | | | | | | | DragonFly 4.0.5 | | | | | | - | | | | OpenBSD 5.7 | + | | | | OpenBSD 5.7 | | | | | | DragonFly 4.2.0 | FreeBSD | | | | | 10.2 | | | | - | | macOS NetBSD 7.0 | | - | | 10.11 | | | OpenBSD 5.8 | - | | | | | `--. | DragonFly 4.4.1 - | FreeBSD | | | | OpenBSD 5.9 | - | 10.3 | | | | | | - | | | | | NetBSD 7.0.1 | | - | `------. | | | | | DragonFly 4.6.0 - | | | | | | | | - | | | | | | | | - *--FreeBSD | macOS | | | OpenBSD 6.0 | - | 11.0 | 10.12 | | NetBSD 7.0.2 | | - | | | | | | | | - | | | | | *- NetBSD 7.1 | | - | | | | | | | | - | | | | | | | | - | | | macOS | | | DragonFly 4.8.0 - | | | 10.13 | | OpenBSD 6.1 | - | FreeBSD | | | | | DragonFly 5.0.0 - | 11.1 FreeBSD | | | | | - | | 10.4 | | | OpenBSD 6.2 DragonFly 5.0.1 - | | | | | | | - | `------. | | NetBSD 7.1.1 | DragonFly 5.0.2 - | | | | | | | - | | | | NetBSD 7.1.2 | | - | | | | | | | - | | | | | OpenBSD 6.3 | - | | | NetBSD | | DragonFly 5.2.0 - | | | 8.0 | | | - | | | | | | DragonFly 5.2.1 - | | | | | | | - | | | | | | DragonFly 5.2.2 - | FreeBSD | | NetBSD 7.2 | | - | 11.2 macOS | | | | - | 10.14 | | OpenBSD 6.4 | - | | | | | DragonFly 5.4.0 - *--FreeBSD | | v | | - | 12.0 | | | DragonFly 5.4.1 - | | | OpenBSD 6.5 | - | | NetBSD | | - | | 8.1 | DragonFly 5.6 - | | | | | -FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current - | | | | | - v v v v v + | | macOS *--NetBSD 7.0 | | + | | 10.11 | | | OpenBSD 5.8 | + | | | | | `--. | DragonFly 4.4.1 + | FreeBSD | | | | OpenBSD 5.9 | + | 10.3 | | | | | | + | | | | | NetBSD | | + | | | | | 7.0.1 | | + | `------. | | | | | DragonFly 4.6.0 + | | | | | | | | + | | | | | | | | + *--FreeBSD | macOS | | | OpenBSD 6.0 | + | 11.0 | 10.12 | | NetBSD | | + | | | | | | 7.0.2 | | + | | | | | | | | + | | | | | *--NetBSD | | + | | | | | | 7.1 | | + | | | | | | | | | + | | | | | | | | | + | | | macOS | | | | DragonFly 4.8.0 + | | | 10.13 | | | OpenBSD 6.1 | + | FreeBSD | | | | | | DragonFly 5.0.0 + | 11.1 FreeBSD | | | | | | + | | 10.4 | | | | OpenBSD 6.2 DragonFly 5.0.1 + | | | | | | | | + | `------. | | | NetBSD | DragonFly 5.0.2 + | | | | | 7.1.1 | | + | | | | | | | | + | | | | | NetBSD | | + | | | | | 7.1.2 `--. | + | | | | | | | + | | | | `-----. OpenBSD 6.3 | + | | | *--NetBSD | | DragonFly 5.2.0 + | | | | 8.0 | | | + | | | | | | | DragonFly 5.2.1 + | | | | | | | | + | | | | | | | DragonFly 5.2.2 + | FreeBSD | | | *--NetBSD | | + | 11.2 | | | 7.2 | | + | macOS | | | | | + | 10.14 | | | OpenBSD 6.4 | + | | | | | | | + | | | | | | DragonFly 5.4.0 + *--FreeBSD | | | v | | + | 12.0 | | | | DragonFly 5.4.1 + | | | | OpenBSD 6.5 | + | | | | | | + | | | NetBSD | | + | | | 8.1 | DragonFly 5.6 + | | | | | +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current + | | | | | + v v v v v Time ---------------- From owner-svn-src-head@freebsd.org Tue Jun 18 21:05:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900C815C8845; Tue, 18 Jun 2019 21:05:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 356818DE7C; Tue, 18 Jun 2019 21:05:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05CA61AA72; Tue, 18 Jun 2019 21:05:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5IL5BEH003831; Tue, 18 Jun 2019 21:05:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IL5Bgk003827; Tue, 18 Jun 2019 21:05:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906182105.x5IL5Bgk003827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 18 Jun 2019 21:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349178 - in head/sys: geom kern sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: geom kern sys X-SVN-Commit-Revision: 349178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 356818DE7C 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 21:05:12 -0000 Author: mav Date: Tue Jun 18 21:05:10 2019 New Revision: 349178 URL: https://svnweb.freebsd.org/changeset/base/349178 Log: Optimize kern.geom.conf* sysctls. On large systems those sysctls may generate megabytes of output. Before this change sbuf(9) code was resizing buffer by 4KB each time many times, generating tons of TLB shootdowns. Unfortunately in this case existing sbuf_new_for_sysctl() mechanism, supposed to help with this issue, is not applicable, since all the sbuf writes are done in different kernel thread. This change improves situation in two ways: - on first sysctl call, not providing any output buffer, it sets special sbuf drain function, just counting the data and so not needing big buffer; - on second sysctl call it uses as initial buffer size value saved on previous call, so that in most cases there will be no reallocation, unless GEOM topology changed significantly. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_kern.c head/sys/kern/imgact_elf.c head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Tue Jun 18 21:02:40 2019 (r349177) +++ head/sys/geom/geom_kern.c Tue Jun 18 21:05:10 2019 (r349178) @@ -157,42 +157,51 @@ g_init(void) } static int -sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) +sysctl_kern_geom_confany(struct sysctl_req *req, g_event_t *func, size_t *hint) { - int error; + size_t len = 0; + int error = 0; struct sbuf *sb; - sb = sbuf_new_auto(); - g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + if (req->oldptr == NULL) { + sb = sbuf_new(NULL, NULL, PAGE_SIZE, SBUF_FIXEDLEN | + SBUF_INCLUDENUL); + sbuf_set_drain(sb, sbuf_count_drain, &len); + g_waitfor_event(func, sb, M_WAITOK, NULL); + req->oldidx = *hint = len; + } else { + sb = sbuf_new(NULL, NULL, *hint, SBUF_AUTOEXTEND | + SBUF_INCLUDENUL); + g_waitfor_event(func, sb, M_WAITOK, NULL); + *hint = sbuf_len(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb)); + } sbuf_delete(sb); return error; } + +static int +sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) +{ + static size_t hint = PAGE_SIZE; + + return (sysctl_kern_geom_confany(req, g_conftxt, &hint)); +} static int sysctl_kern_geom_confdot(SYSCTL_HANDLER_ARGS) { - int error; - struct sbuf *sb; + static size_t hint = PAGE_SIZE; - sb = sbuf_new_auto(); - g_waitfor_event(g_confdot, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - return error; + return (sysctl_kern_geom_confany(req, g_confdot, &hint)); } - + static int sysctl_kern_geom_confxml(SYSCTL_HANDLER_ARGS) { - int error; - struct sbuf *sb; + static size_t hint = PAGE_SIZE; - sb = sbuf_new_auto(); - g_waitfor_event(g_confxml, sb, M_WAITOK, NULL); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - return error; + return (sysctl_kern_geom_confany(req, g_confxml, &hint)); } SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW, 0, "GEOMetry management"); Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Jun 18 21:02:40 2019 (r349177) +++ head/sys/kern/imgact_elf.c Tue Jun 18 21:05:10 2019 (r349178) @@ -1422,7 +1422,6 @@ static void __elfN(puthdr)(struct thread *, void *, si static void __elfN(putnote)(struct note_info *, struct sbuf *); static size_t register_note(struct note_info_list *, int, outfunc_t, void *); static int sbuf_drain_core_output(void *, const char *, int); -static int sbuf_drain_count(void *arg, const char *data, int len); static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); @@ -1552,19 +1551,6 @@ sbuf_drain_core_output(void *arg, const char *data, in return (len); } -/* - * Drain into a counter. - */ -static int -sbuf_drain_count(void *arg, const char *data __unused, int len) -{ - size_t *sizep; - - sizep = (size_t *)arg; - *sizep += len; - return (len); -} - int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { @@ -2341,7 +2327,7 @@ note_procstat_files(void *arg, struct sbuf *sb, size_t if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); - sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_set_drain(sb, sbuf_count_drain, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); kern_proc_filedesc_out(p, sb, -1, filedesc_flags); @@ -2392,7 +2378,7 @@ note_procstat_vmmap(void *arg, struct sbuf *sb, size_t if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); - sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_set_drain(sb, sbuf_count_drain, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PROC_LOCK(p); kern_proc_vmmap_out(p, sb, -1, vmmap_flags); @@ -2520,7 +2506,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, if (sb == NULL) { size = 0; sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); - sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_set_drain(sb, sbuf_count_drain, &size); sbuf_bcat(sb, &structsize, sizeof(structsize)); PHOLD(p); proc_getauxv(curthread, p, sb); Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Tue Jun 18 21:02:40 2019 (r349177) +++ head/sys/kern/subr_sbuf.c Tue Jun 18 21:05:10 2019 (r349178) @@ -342,6 +342,21 @@ sbuf_setpos(struct sbuf *s, ssize_t pos) } /* + * Drain into a counter. Counts amount of data without prodicing output. + * Useful for cases like sysctl, where user may first request only size. + * This allows to avoid pointless allocation/freeing of large buffers. + */ +int +sbuf_count_drain(void *arg, const char *data __unused, int len) +{ + size_t *sizep; + + sizep = (size_t *)arg; + *sizep += len; + return (len); +} + +/* * Set up a drain function and argument on an sbuf to flush data to * when the sbuf buffer overflows. */ Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Tue Jun 18 21:02:40 2019 (r349177) +++ head/sys/sys/sbuf.h Tue Jun 18 21:05:10 2019 (r349178) @@ -103,6 +103,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +int sbuf_count_drain(void *arg, const char *data, int len); int sbuf_printf_drain(void *arg, const char *data, int len); void sbuf_putbuf(struct sbuf *); From owner-svn-src-head@freebsd.org Tue Jun 18 22:00:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 896C215CA1A8; Tue, 18 Jun 2019 22:00:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 301E58FC57; Tue, 18 Jun 2019 22:00:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0685F1B30B; Tue, 18 Jun 2019 22:00:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5IM0cVK030943; Tue, 18 Jun 2019 22:00:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IM0cqY030942; Tue, 18 Jun 2019 22:00:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906182200.x5IM0cqY030942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 18 Jun 2019 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349179 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 301E58FC57 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 22:00:39 -0000 Author: bdrewery Date: Tue Jun 18 22:00:38 2019 New Revision: 349179 URL: https://svnweb.freebsd.org/changeset/base/349179 Log: Rework r349061: Don't apply guessed dependencies if there is a custom target. This is still targeting bin/sh cyclic dependency issues. Only apply guessed dependencies that are explicitly set for an object (which gnu/lib/cc/cc_tools needs) and if no custom target exists with its own dependencies. This was manifesting as a missing yacc.h in usr.bin/mkesdb_static when built without -j (or -B). No actual yacc.h dependency ordering was defined but with -j it got lucky and built fine. Before r349061 the behavior was different for META_MODE but that logic difference isn't needed. X-MFC-With: r349061 Sponsored by: DellEMC Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Jun 18 21:05:10 2019 (r349178) +++ head/share/mk/bsd.dep.mk Tue Jun 18 22:00:38 2019 (r349179) @@ -264,7 +264,9 @@ _depfile= ${.OBJDIR}/${_dep_obj} # - For meta mode we still need to know which file to depend on to avoid # ambiguous suffix transformation rules from .PATH. Meta mode does not # use .depend files when filemon is in use. -${__obj}: ${OBJS_DEPEND_GUESS:N*.h} +.if !target(${__obj}) +${__obj}: ${OBJS_DEPEND_GUESS} +.endif ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif # !exists(${_depfile}) || defined(_meta_filemon) .endfor From owner-svn-src-head@freebsd.org Wed Jun 19 03:33:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB5815D0834; Wed, 19 Jun 2019 03:33:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54204725B3; Wed, 19 Jun 2019 03:33:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CD691ECA9; Wed, 19 Jun 2019 03:33:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5J3X14d009382; Wed, 19 Jun 2019 03:33:01 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J3X1dc009381; Wed, 19 Jun 2019 03:33:01 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906190333.x5J3X1dc009381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 19 Jun 2019 03:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349183 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54204725B3 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 03:33:01 -0000 Author: alc Date: Wed Jun 19 03:33:00 2019 New Revision: 349183 URL: https://svnweb.freebsd.org/changeset/base/349183 Log: Correct an error in r349122. pmap_unwire() should update the pmap's wired count, not its resident count. X-MFC with: r349122 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 19 01:28:13 2019 (r349182) +++ head/sys/arm64/arm64/pmap.c Wed Jun 19 03:33:00 2019 (r349183) @@ -3777,8 +3777,8 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t */ if (sva + L2_SIZE == va_next && eva >= va_next) { atomic_clear_64(l2, ATTR_SW_WIRED); - pmap_resident_count_dec(pmap, L2_SIZE / - PAGE_SIZE); + pmap->pm_stats.wired_count -= L2_SIZE / + PAGE_SIZE; continue; } else if (pmap_demote_l2(pmap, l2, sva) == NULL) panic("pmap_unwire: demotion failed"); From owner-svn-src-head@freebsd.org Wed Jun 19 06:41:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0764A15D3CF5; Wed, 19 Jun 2019 06:41:08 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1C7777831; Wed, 19 Jun 2019 06:41:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E99D20AF1; Wed, 19 Jun 2019 06:41:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5J6f7OV006328; Wed, 19 Jun 2019 06:41:07 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J6f7ej006327; Wed, 19 Jun 2019 06:41:07 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201906190641.x5J6f7ej006327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 19 Jun 2019 06:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349184 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 349184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1C7777831 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 06:41:08 -0000 Author: scottl Date: Wed Jun 19 06:41:07 2019 New Revision: 349184 URL: https://svnweb.freebsd.org/changeset/base/349184 Log: Implement VT-d capability detection on chipsets that have multiple translation units with differing capabilities From the author via Bugzilla: --- When an attempt is made to passthrough a PCI device to a bhyve VM (causing initialisation of IOMMU) on certain Intel chipsets using VT-d the PCI bus stops working entirely. This issue occurs on the E3-1275 v5 processor on C236 chipset and has also been encountered by others on the forums with different hardware in the Skylake series. The chipset has two VT-d translation units. The issue is caused by an attempt to use the VT-d device-IOTLB capability that is supported by only the first unit for devices attached to the second unit which lacks that capability. Only the capabilities of the first unit are checked and are assumed to be the same for all units. Attached is a patch to rectify this issue by determining which unit is responsible for the device being added to a domain and then checking that unit's device-IOTLB capability. In addition to this a few fixes have been made to other instances where the first unit's capabilities are assumed for all units for domains they share. In these cases a mutual set of capabilities is determined. The patch should hopefully fix any bugs for current/future hardware with multiple translation units supporting different capabilities. A description is on the forums at https://forums.freebsd.org/threads/pci-passthrough-bhyve-usb-xhci.65235 The thread includes observations by other users of the bug occurring, and description as well as confirmation of the fix. I'd also like to thank Ordoban for their help. --- Personally tested on a Skylake laptop, Skylake Xeon server, and a Xeon-D-1541, passing through XHCI and NVMe functions. Passthru is hit-or-miss to the point of being unusable without this patch. PR: 229852 Submitted by: callum@aitchison.org MFC after: 1 week Modified: head/sys/amd64/vmm/intel/vtd.c Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Wed Jun 19 03:33:00 2019 (r349183) +++ head/sys/amd64/vmm/intel/vtd.c Wed Jun 19 06:41:07 2019 (r349184) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); * Architecture Spec, September 2008. */ +#define VTD_DRHD_INCLUDE_PCI_ALL(Flags) (((Flags) >> 0) & 0x1) + /* Section 10.4 "Register Descriptions" */ struct vtdmap { volatile uint32_t version; @@ -116,10 +118,11 @@ struct domain { static SLIST_HEAD(, domain) domhead; #define DRHD_MAX_UNITS 8 -static int drhd_num; -static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; -static int max_domains; -typedef int (*drhd_ident_func_t)(void); +static ACPI_DMAR_HARDWARE_UNIT *drhds[DRHD_MAX_UNITS]; +static int drhd_num; +static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; +static int max_domains; +typedef int (*drhd_ident_func_t)(void); static uint64_t root_table[PAGE_SIZE / sizeof(uint64_t)] __aligned(4096); static uint64_t ctx_tables[256][PAGE_SIZE / sizeof(uint64_t)] __aligned(4096); @@ -175,6 +178,69 @@ domain_id(void) return (id); } +static struct vtdmap * +vtd_device_scope(uint16_t rid) +{ + int i, remaining, pathremaining; + char *end, *pathend; + struct vtdmap *vtdmap; + ACPI_DMAR_HARDWARE_UNIT *drhd; + ACPI_DMAR_DEVICE_SCOPE *device_scope; + ACPI_DMAR_PCI_PATH *path; + + for (i = 0; i < drhd_num; i++) { + drhd = drhds[i]; + + if (VTD_DRHD_INCLUDE_PCI_ALL(drhd->Flags)) { + /* + * From Intel VT-d arch spec, version 3.0: + * If a DRHD structure with INCLUDE_PCI_ALL flag Set is reported + * for a Segment, it must be enumerated by BIOS after all other + * DRHD structures for the same Segment. + */ + vtdmap = vtdmaps[i]; + return(vtdmap); + } + + end = (char *)drhd + drhd->Header.Length; + remaining = drhd->Header.Length - sizeof(ACPI_DMAR_HARDWARE_UNIT); + while (remaining > sizeof(ACPI_DMAR_DEVICE_SCOPE)) { + device_scope = (ACPI_DMAR_DEVICE_SCOPE *)(end - remaining); + remaining -= device_scope->Length; + + switch (device_scope->EntryType){ + /* 0x01 and 0x02 are PCI device entries */ + case 0x01: + case 0x02: + break; + default: + continue; + } + + if (PCI_RID2BUS(rid) != device_scope->Bus) + continue; + + pathend = (char *)device_scope + device_scope->Length; + pathremaining = device_scope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE); + while (pathremaining >= sizeof(ACPI_DMAR_PCI_PATH)) { + path = (ACPI_DMAR_PCI_PATH *)(pathend - pathremaining); + pathremaining -= sizeof(ACPI_DMAR_PCI_PATH); + + if (PCI_RID2SLOT(rid) != path->Device) + continue; + if (PCI_RID2FUNC(rid) != path->Function) + continue; + + vtdmap = vtdmaps[i]; + return (vtdmap); + } + } + } + + /* No matching scope */ + return (NULL); +} + static void vtd_wbflush(struct vtdmap *vtdmap) { @@ -240,7 +306,7 @@ vtd_translation_disable(struct vtdmap *vtdmap) static int vtd_init(void) { - int i, units, remaining; + int i, units, remaining, tmp; struct vtdmap *vtdmap; vm_paddr_t ctx_paddr; char *end, envname[32]; @@ -291,8 +357,9 @@ vtd_init(void) break; drhd = (ACPI_DMAR_HARDWARE_UNIT *)hdr; - vtdmaps[units++] = (struct vtdmap *)PHYS_TO_DMAP(drhd->Address); - if (units >= DRHD_MAX_UNITS) + drhds[units] = drhd; + vtdmaps[units] = (struct vtdmap *)PHYS_TO_DMAP(drhd->Address); + if (++units >= DRHD_MAX_UNITS) break; remaining -= hdr->Length; } @@ -302,13 +369,19 @@ vtd_init(void) skip_dmar: drhd_num = units; - vtdmap = vtdmaps[0]; - if (VTD_CAP_CM(vtdmap->cap) != 0) - panic("vtd_init: invalid caching mode"); + max_domains = 64 * 1024; /* maximum valid value */ + for (i = 0; i < drhd_num; i++){ + vtdmap = vtdmaps[i]; - max_domains = vtd_max_domains(vtdmap); + if (VTD_CAP_CM(vtdmap->cap) != 0) + panic("vtd_init: invalid caching mode"); + /* take most compatible (minimum) value */ + if ((tmp = vtd_max_domains(vtdmap)) < max_domains) + max_domains = tmp; + } + /* * Set up the root-table to point to the context-entry tables */ @@ -373,7 +446,6 @@ vtd_add_device(void *arg, uint16_t rid) struct vtdmap *vtdmap; uint8_t bus; - vtdmap = vtdmaps[0]; bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); @@ -385,6 +457,10 @@ vtd_add_device(void *arg, uint16_t rid) (uint16_t)(ctxp[idx + 1] >> 8)); } + if ((vtdmap = vtd_device_scope(rid)) == NULL) + panic("vtd_add_device: device %x is not in scope for " + "any DMA remapping unit", rid); + /* * Order is important. The 'present' bit is set only after all fields * of the context pointer are initialized. @@ -568,8 +644,6 @@ vtd_create_domain(vm_paddr_t maxaddr) if (drhd_num <= 0) panic("vtd_create_domain: no dma remapping hardware available"); - vtdmap = vtdmaps[0]; - /* * Calculate AGAW. * Section 3.4.2 "Adjusted Guest Address Width", Architecture Spec. @@ -594,7 +668,14 @@ vtd_create_domain(vm_paddr_t maxaddr) pt_levels = 2; sagaw = 30; addrwidth = 0; - tmp = VTD_CAP_SAGAW(vtdmap->cap); + + tmp = ~0; + for (i = 0; i < drhd_num; i++) { + vtdmap = vtdmaps[i]; + /* take most compatible value */ + tmp &= VTD_CAP_SAGAW(vtdmap->cap); + } + for (i = 0; i < 5; i++) { if ((tmp & (1 << i)) != 0 && sagaw >= agaw) break; @@ -606,8 +687,8 @@ vtd_create_domain(vm_paddr_t maxaddr) } if (i >= 5) { - panic("vtd_create_domain: SAGAW 0x%lx does not support AGAW %d", - VTD_CAP_SAGAW(vtdmap->cap), agaw); + panic("vtd_create_domain: SAGAW 0x%x does not support AGAW %d", + tmp, agaw); } dom = malloc(sizeof(struct domain), M_VTD, M_ZERO | M_WAITOK); @@ -634,7 +715,12 @@ vtd_create_domain(vm_paddr_t maxaddr) * There is not any code to deal with the demotion at the moment * so we disable superpage mappings altogether. */ - dom->spsmask = VTD_CAP_SPS(vtdmap->cap); + dom->spsmask = ~0; + for (i = 0; i < drhd_num; i++) { + vtdmap = vtdmaps[i]; + /* take most compatible value */ + dom->spsmask &= VTD_CAP_SPS(vtdmap->cap); + } #endif SLIST_INSERT_HEAD(&domhead, dom, next); From owner-svn-src-head@freebsd.org Wed Jun 19 08:39:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F8C15D5FC1; Wed, 19 Jun 2019 08:39:20 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF32D83318; Wed, 19 Jun 2019 08:39:19 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B96E221EFD; Wed, 19 Jun 2019 08:39:19 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5J8dJVP068028; Wed, 19 Jun 2019 08:39:19 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J8dJIA068027; Wed, 19 Jun 2019 08:39:19 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201906190839.x5J8dJIA068027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Wed, 19 Jun 2019 08:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349185 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: zec X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF32D83318 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 08:39:20 -0000 Author: zec Date: Wed Jun 19 08:39:19 2019 New Revision: 349185 URL: https://svnweb.freebsd.org/changeset/base/349185 Log: Evaluating htons() at compile time is more efficient than doing ntohs() at runtime. This change removes a dependency on a barrel shifter pass before branch resolution, while reducing the instruction stream size by 9 bytes on amd64. MFC after: 3 days Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jun 19 06:41:07 2019 (r349184) +++ head/sys/net/iflib.c Wed Jun 19 08:39:19 2019 (r349185) @@ -2705,18 +2705,16 @@ static bool iflib_check_lro_possible(struct mbuf *m, bool v4_forwarding, bool v6_forwarding) { struct ether_header *eh; - uint16_t eh_type; eh = mtod(m, struct ether_header *); - eh_type = ntohs(eh->ether_type); - switch (eh_type) { + switch (eh->ether_type) { #if defined(INET6) - case ETHERTYPE_IPV6: - return !v6_forwarding; + case htons(ETHERTYPE_IPV6): + return (!v6_forwarding); #endif #if defined (INET) - case ETHERTYPE_IP: - return !v4_forwarding; + case htons(ETHERTYPE_IP): + return (!v4_forwarding); #endif } From owner-svn-src-head@freebsd.org Wed Jun 19 08:49:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99CD15AF2D2; Wed, 19 Jun 2019 08:49:25 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 890B4838A3; Wed, 19 Jun 2019 08:49:25 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58615220B4; Wed, 19 Jun 2019 08:49:25 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5J8nP35073667; Wed, 19 Jun 2019 08:49:25 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J8nPWO073666; Wed, 19 Jun 2019 08:49:25 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201906190849.x5J8nPWO073666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Wed, 19 Jun 2019 08:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349186 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: zec X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 349186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 890B4838A3 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 08:49:26 -0000 Author: zec Date: Wed Jun 19 08:49:24 2019 New Revision: 349186 URL: https://svnweb.freebsd.org/changeset/base/349186 Log: V_ip6_forwarding and V_ipforwarding have been defined in ip6_var.h / ip_var.h since at least 2008, so make use of those definitions here. MFC after: 3 days Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jun 19 08:39:19 2019 (r349185) +++ head/sys/net/iflib.c Wed Jun 19 08:49:24 2019 (r349186) @@ -2688,10 +2688,10 @@ iflib_get_ip_forwarding(struct lro_ctrl *lc, bool *v4, { CURVNET_SET(lc->ifp->if_vnet); #if defined(INET6) - *v6 = VNET(ip6_forwarding); + *v6 = V_ip6_forwarding; #endif #if defined(INET) - *v4 = VNET(ipforwarding); + *v4 = V_ipforwarding; #endif CURVNET_RESTORE(); } From owner-svn-src-head@freebsd.org Wed Jun 19 11:22:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6CD215B4A41; Wed, 19 Jun 2019 11:22:10 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A51187F9A; Wed, 19 Jun 2019 11:22:10 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2632323B71; Wed, 19 Jun 2019 11:22:10 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JBMAGc054592; Wed, 19 Jun 2019 11:22:10 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JBMAqF054591; Wed, 19 Jun 2019 11:22:10 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906191122.x5JBMAqF054591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Wed, 19 Jun 2019 11:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349187 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A51187F9A 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 11:22:10 -0000 Author: sevan (doc committer) Date: Wed Jun 19 11:22:09 2019 New Revision: 349187 URL: https://svnweb.freebsd.org/changeset/base/349187 Log: Whitespace Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Jun 19 08:49:24 2019 (r349186) +++ head/share/misc/bsd-family-tree Wed Jun 19 11:22:09 2019 (r349187) @@ -372,7 +372,7 @@ FreeBSD 5.2 | | | | | | 10.13 | | | OpenBSD 6.1 | | FreeBSD | | | | | | DragonFly 5.0.0 | 11.1 FreeBSD | | | | | | - | | 10.4 | | | | OpenBSD 6.2 DragonFly 5.0.1 + | | 10.4 | | | | OpenBSD 6.2 DragonFly 5.0.1 | | | | | | | | | `------. | | | NetBSD | DragonFly 5.0.2 | | | | | 7.1.1 | | @@ -381,7 +381,7 @@ FreeBSD 5.2 | | | | | | | | 7.1.2 `--. | | | | | | | | | | | | `-----. OpenBSD 6.3 | - | | | *--NetBSD | | DragonFly 5.2.0 + | | | *--NetBSD | | DragonFly 5.2.0 | | | | 8.0 | | | | | | | | | | DragonFly 5.2.1 | | | | | | | | From owner-svn-src-head@freebsd.org Wed Jun 19 11:37:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 407A815B4E1A; Wed, 19 Jun 2019 11:37:44 +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 D770E885E2; Wed, 19 Jun 2019 11:37:43 +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 A986F23D59; Wed, 19 Jun 2019 11:37:43 +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 x5JBbh7Z063223; Wed, 19 Jun 2019 11:37:43 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JBbh6k063222; Wed, 19 Jun 2019 11:37:43 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201906191137.x5JBbh6k063222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 19 Jun 2019 11:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349188 - head/stand/ofw/libofw X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/stand/ofw/libofw X-SVN-Commit-Revision: 349188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D770E885E2 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.979,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 11:37:44 -0000 Author: luporl Date: Wed Jun 19 11:37:43 2019 New Revision: 349188 URL: https://svnweb.freebsd.org/changeset/base/349188 Log: [PPC] Fix loader input with newer QEMU versions At least since version 4.0.0, QEMU became bug-compatible with PowerVM's vty, by inserting a \0 after every \r. As this confuses loader's interpreter and as a \0 coming from the console doesn't seem reasonable, it's now being filtered at OFW console input. Reviewed by: jhibbits MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20676 Modified: head/stand/ofw/libofw/ofw_console.c Modified: head/stand/ofw/libofw/ofw_console.c ============================================================================== --- head/stand/ofw/libofw/ofw_console.c Wed Jun 19 11:22:09 2019 (r349187) +++ head/stand/ofw/libofw/ofw_console.c Wed Jun 19 11:37:43 2019 (r349188) @@ -97,7 +97,11 @@ ofw_cons_getchar() return l; } - if (OF_read(stdin, &ch, 1) > 0) + /* At least since version 4.0.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * As this confuses loader's interpreter and as a \0 coming + * from the console doesn't seem reasonable, it's filtered here. */ + if (OF_read(stdin, &ch, 1) > 0 && ch != '\0') return (ch); return (-1); From owner-svn-src-head@freebsd.org Wed Jun 19 13:30:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF1B15B8BCB; Wed, 19 Jun 2019 13:30:51 +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 D2DD08D0C4; Wed, 19 Jun 2019 13:30:50 +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 A3C9D25034; Wed, 19 Jun 2019 13:30:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JDUo3w024250; Wed, 19 Jun 2019 13:30:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JDUon9024249; Wed, 19 Jun 2019 13:30:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906191330.x5JDUon9024249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 19 Jun 2019 13:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349190 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 349190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2DD08D0C4 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:30:51 -0000 Author: mav Date: Wed Jun 19 13:30:50 2019 New Revision: 349190 URL: https://svnweb.freebsd.org/changeset/base/349190 Log: Fix typo in r349178. Reported by: ae MFC after: 1 week Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Wed Jun 19 13:19:36 2019 (r349189) +++ head/sys/kern/subr_sbuf.c Wed Jun 19 13:30:50 2019 (r349190) @@ -342,7 +342,7 @@ sbuf_setpos(struct sbuf *s, ssize_t pos) } /* - * Drain into a counter. Counts amount of data without prodicing output. + * Drain into a counter. Counts amount of data without producing output. * Useful for cases like sysctl, where user may first request only size. * This allows to avoid pointless allocation/freeing of large buffers. */ From owner-svn-src-head@freebsd.org Wed Jun 19 13:55:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6467F15B9A2F; Wed, 19 Jun 2019 13:55:01 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 005F38E3F5; Wed, 19 Jun 2019 13:55:01 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEEE325540; Wed, 19 Jun 2019 13:55:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JDt0BR037848; Wed, 19 Jun 2019 13:55:00 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JDt0Si037845; Wed, 19 Jun 2019 13:55:00 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201906191355.x5JDt0Si037845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 19 Jun 2019 13:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349192 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 349192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 005F38E3F5 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:55:01 -0000 Author: jtl Date: Wed Jun 19 13:55:00 2019 New Revision: 349192 URL: https://svnweb.freebsd.org/changeset/base/349192 Log: Add the ability to limit how much the code will fragment the RACK send map in response to SACKs. The default behavior is unchanged; however, the limit can be activated by changing the new net.inet.tcp.rack.split_limit sysctl. Submitted by: Peter Lei Reported by: jtl Reviewed by: lstewart (earlier version) Security: CVE-2019-5599 Modified: head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/tcp_rack.h Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Jun 19 13:33:34 2019 (r349191) +++ head/sys/netinet/tcp_stacks/rack.c Wed Jun 19 13:55:00 2019 (r349192) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2018 Netflix, Inc. + * Copyright (c) 2016-2019 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -202,6 +202,7 @@ static int32_t rack_always_send_oldest = 0; static int32_t rack_sack_block_limit = 128; static int32_t rack_use_sack_filter = 1; static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; +static uint32_t rack_map_split_limit = 0; /* unlimited by default */ /* Rack specific counters */ counter_u64_t rack_badfr; @@ -227,6 +228,8 @@ counter_u64_t rack_to_arm_tlp; counter_u64_t rack_to_alloc; counter_u64_t rack_to_alloc_hard; counter_u64_t rack_to_alloc_emerg; +counter_u64_t rack_alloc_limited_conns; +counter_u64_t rack_split_limited; counter_u64_t rack_sack_proc_all; counter_u64_t rack_sack_proc_short; @@ -260,6 +263,8 @@ static void rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, struct tcphdr *th, uint16_t nsegs, uint16_t type, int32_t recovery); static struct rack_sendmap *rack_alloc(struct tcp_rack *rack); +static struct rack_sendmap *rack_alloc_limit(struct tcp_rack *rack, + uint8_t limit_type); static struct rack_sendmap * rack_check_recovery_mode(struct tcpcb *tp, uint32_t tsused); @@ -444,6 +449,8 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) counter_u64_zero(rack_sack_proc_short); counter_u64_zero(rack_sack_proc_restart); counter_u64_zero(rack_to_alloc); + counter_u64_zero(rack_alloc_limited_conns); + counter_u64_zero(rack_split_limited); counter_u64_zero(rack_find_high); counter_u64_zero(rack_runt_sacks); counter_u64_zero(rack_used_tlpmethod); @@ -621,6 +628,11 @@ rack_init_sysctls() OID_AUTO, "pktdelay", CTLFLAG_RW, &rack_pkt_delay, 1, "Extra RACK time (in ms) besides reordering thresh"); + SYSCTL_ADD_U32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "split_limit", CTLFLAG_RW, + &rack_map_split_limit, 0, + "Is there a limit on the number of map split entries (0=unlimited)"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "inc_var", CTLFLAG_RW, @@ -756,7 +768,19 @@ rack_init_sysctls() SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "allocemerg", CTLFLAG_RD, &rack_to_alloc_emerg, - "Total alocations done from emergency cache"); + "Total allocations done from emergency cache"); + rack_alloc_limited_conns = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "alloc_limited_conns", CTLFLAG_RD, + &rack_alloc_limited_conns, + "Connections with allocations dropped due to limit"); + rack_split_limited = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "split_limited", CTLFLAG_RD, + &rack_split_limited, + "Split allocations dropped due to limit"); rack_sack_proc_all = counter_u64_alloc(M_WAITOK); SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), @@ -1120,10 +1144,11 @@ rack_alloc(struct tcp_rack *rack) { struct rack_sendmap *rsm; - counter_u64_add(rack_to_alloc, 1); - rack->r_ctl.rc_num_maps_alloced++; rsm = uma_zalloc(rack_zone, M_NOWAIT); if (rsm) { +alloc_done: + counter_u64_add(rack_to_alloc, 1); + rack->r_ctl.rc_num_maps_alloced++; return (rsm); } if (rack->rc_free_cnt) { @@ -1131,14 +1156,46 @@ rack_alloc(struct tcp_rack *rack) rsm = TAILQ_FIRST(&rack->r_ctl.rc_free); TAILQ_REMOVE(&rack->r_ctl.rc_free, rsm, r_next); rack->rc_free_cnt--; - return (rsm); + goto alloc_done; } return (NULL); } +/* wrapper to allocate a sendmap entry, subject to a specific limit */ +static struct rack_sendmap * +rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type) +{ + struct rack_sendmap *rsm; + + if (limit_type) { + /* currently there is only one limit type */ + if (rack_map_split_limit > 0 && + rack->r_ctl.rc_num_split_allocs >= rack_map_split_limit) { + counter_u64_add(rack_split_limited, 1); + if (!rack->alloc_limit_reported) { + rack->alloc_limit_reported = 1; + counter_u64_add(rack_alloc_limited_conns, 1); + } + return (NULL); + } + } + + /* allocate and mark in the limit type, if set */ + rsm = rack_alloc(rack); + if (rsm != NULL && limit_type) { + rsm->r_limit_type = limit_type; + rack->r_ctl.rc_num_split_allocs++; + } + return (rsm); +} + static void rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm) { + if (rsm->r_limit_type) { + /* currently there is only one limit type */ + rack->r_ctl.rc_num_split_allocs--; + } rack->r_ctl.rc_num_maps_alloced--; if (rack->r_ctl.rc_tlpsend == rsm) rack->r_ctl.rc_tlpsend = NULL; @@ -3953,7 +4010,7 @@ do_rest_ofb: /* * Need to split this in two pieces the before and after. */ - nrsm = rack_alloc(rack); + nrsm = rack_alloc_limit(rack, RACK_LIMIT_TYPE_SPLIT); if (nrsm == NULL) { /* * failed XXXrrs what can we do but loose the sack @@ -4014,7 +4071,7 @@ do_rest_ofb: goto do_rest_ofb; } /* Ok we need to split off this one at the tail */ - nrsm = rack_alloc(rack); + nrsm = rack_alloc_limit(rack, RACK_LIMIT_TYPE_SPLIT); if (nrsm == NULL) { /* failed rrs what can we do but loose the sack info? */ goto out; Modified: head/sys/netinet/tcp_stacks/tcp_rack.h ============================================================================== --- head/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 13:33:34 2019 (r349191) +++ head/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 13:55:00 2019 (r349192) @@ -54,8 +54,10 @@ struct rack_sendmap { uint8_t r_sndcnt; /* Retran count, not limited by * RACK_NUM_OF_RETRANS */ uint8_t r_in_tmap; /* Flag to see if its in the r_tnext array */ - uint8_t r_resv[3]; + uint8_t r_limit_type; /* is this entry counted against a limit? */ + uint8_t r_resv[2]; }; +#define RACK_LIMIT_TYPE_SPLIT 1 TAILQ_HEAD(rack_head, rack_sendmap); @@ -241,7 +243,7 @@ struct rack_control { uint32_t rc_num_maps_alloced; /* Number of map blocks (sacks) we * have allocated */ uint32_t rc_rcvtime; /* When we last received data */ - uint32_t rc_notused; + uint32_t rc_num_split_allocs; /* num split map entries allocated */ uint32_t rc_last_output_to; uint32_t rc_went_idle_time; @@ -310,7 +312,8 @@ struct tcp_rack { uint8_t rack_tlp_threshold_use; uint8_t rc_allow_data_af_clo: 1, delayed_ack : 1, - rc_avail : 6; + alloc_limit_reported : 1, + rc_avail : 5; uint8_t r_resv[2]; /* Fill to cache line boundary */ /* Cache line 2 0x40 */ struct rack_control r_ctl; From owner-svn-src-head@freebsd.org Wed Jun 19 14:37:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE7515BA9E4; Wed, 19 Jun 2019 14:37:57 +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 D399B8FA61; Wed, 19 Jun 2019 14:37:56 +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 x5JEbp9T018476; Wed, 19 Jun 2019 07:37:51 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5JEbpTY018475; Wed, 19 Jun 2019 07:37:51 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906191437.x5JEbpTY018475@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349184 - head/sys/amd64/vmm/intel In-Reply-To: <201906190641.x5J6f7ej006327@repo.freebsd.org> To: Scott Long Date: Wed, 19 Jun 2019 07:37:51 -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: D399B8FA61 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 14:37:57 -0000 > Author: scottl > Date: Wed Jun 19 06:41:07 2019 > New Revision: 349184 > URL: https://svnweb.freebsd.org/changeset/base/349184 > > Log: > Implement VT-d capability detection on chipsets that have multiple > translation units with differing capabilities > > From the author via Bugzilla: > --- If you had read the full bug report you would also know: https://reviews.freebsd.org/D19001 existed and that some code cleanup had occurred since this bug was created. The review was pending approval by bhyve maintainer(s). > When an attempt is made to passthrough a PCI device to a bhyve VM > (causing initialisation of IOMMU) on certain Intel chipsets using > VT-d the PCI bus stops working entirely. This issue occurs on the > E3-1275 v5 processor on C236 chipset and has also been encountered > by others on the forums with different hardware in the Skylake > series. > > The chipset has two VT-d translation units. The issue is caused by > an attempt to use the VT-d device-IOTLB capability that is > supported by only the first unit for devices attached to the > second unit which lacks that capability. Only the capabilities of > the first unit are checked and are assumed to be the same for all > units. > > Attached is a patch to rectify this issue by determining which > unit is responsible for the device being added to a domain and > then checking that unit's device-IOTLB capability. In addition to > this a few fixes have been made to other instances where the first > unit's capabilities are assumed for all units for domains they > share. In these cases a mutual set of capabilities is determined. > The patch should hopefully fix any bugs for current/future > hardware with multiple translation units supporting different > capabilities. > > A description is on the forums at > https://forums.freebsd.org/threads/pci-passthrough-bhyve-usb-xhci.65235 > The thread includes observations by other users of the bug > occurring, and description as well as confirmation of the fix. > I'd also like to thank Ordoban for their help. > > --- > Personally tested on a Skylake laptop, Skylake Xeon server, and > a Xeon-D-1541, passing through XHCI and NVMe functions. Passthru > is hit-or-miss to the point of being unusable without this > patch. > > PR: 229852 > Submitted by: callum@aitchison.org > MFC after: 1 week > > Modified: > head/sys/amd64/vmm/intel/vtd.c > > Modified: head/sys/amd64/vmm/intel/vtd.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vtd.c Wed Jun 19 03:33:00 2019 (r349183) > +++ head/sys/amd64/vmm/intel/vtd.c Wed Jun 19 06:41:07 2019 (r349184) > @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); > * Architecture Spec, September 2008. > */ > > +#define VTD_DRHD_INCLUDE_PCI_ALL(Flags) (((Flags) >> 0) & 0x1) > + > /* Section 10.4 "Register Descriptions" */ > struct vtdmap { > volatile uint32_t version; > @@ -116,10 +118,11 @@ struct domain { > static SLIST_HEAD(, domain) domhead; > > #define DRHD_MAX_UNITS 8 > -static int drhd_num; > -static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; > -static int max_domains; > -typedef int (*drhd_ident_func_t)(void); > +static ACPI_DMAR_HARDWARE_UNIT *drhds[DRHD_MAX_UNITS]; > +static int drhd_num; > +static struct vtdmap *vtdmaps[DRHD_MAX_UNITS]; > +static int max_domains; > +typedef int (*drhd_ident_func_t)(void); > > static uint64_t root_table[PAGE_SIZE / sizeof(uint64_t)] __aligned(4096); > static uint64_t ctx_tables[256][PAGE_SIZE / sizeof(uint64_t)] __aligned(4096); > @@ -175,6 +178,69 @@ domain_id(void) > return (id); > } > > +static struct vtdmap * > +vtd_device_scope(uint16_t rid) > +{ > + int i, remaining, pathremaining; > + char *end, *pathend; > + struct vtdmap *vtdmap; > + ACPI_DMAR_HARDWARE_UNIT *drhd; > + ACPI_DMAR_DEVICE_SCOPE *device_scope; > + ACPI_DMAR_PCI_PATH *path; > + > + for (i = 0; i < drhd_num; i++) { > + drhd = drhds[i]; > + > + if (VTD_DRHD_INCLUDE_PCI_ALL(drhd->Flags)) { > + /* > + * From Intel VT-d arch spec, version 3.0: > + * If a DRHD structure with INCLUDE_PCI_ALL flag Set is reported > + * for a Segment, it must be enumerated by BIOS after all other > + * DRHD structures for the same Segment. > + */ > + vtdmap = vtdmaps[i]; > + return(vtdmap); > + } > + > + end = (char *)drhd + drhd->Header.Length; > + remaining = drhd->Header.Length - sizeof(ACPI_DMAR_HARDWARE_UNIT); > + while (remaining > sizeof(ACPI_DMAR_DEVICE_SCOPE)) { > + device_scope = (ACPI_DMAR_DEVICE_SCOPE *)(end - remaining); > + remaining -= device_scope->Length; > + > + switch (device_scope->EntryType){ > + /* 0x01 and 0x02 are PCI device entries */ > + case 0x01: > + case 0x02: > + break; > + default: > + continue; > + } > + > + if (PCI_RID2BUS(rid) != device_scope->Bus) > + continue; > + > + pathend = (char *)device_scope + device_scope->Length; > + pathremaining = device_scope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE); > + while (pathremaining >= sizeof(ACPI_DMAR_PCI_PATH)) { > + path = (ACPI_DMAR_PCI_PATH *)(pathend - pathremaining); > + pathremaining -= sizeof(ACPI_DMAR_PCI_PATH); > + > + if (PCI_RID2SLOT(rid) != path->Device) > + continue; > + if (PCI_RID2FUNC(rid) != path->Function) > + continue; > + > + vtdmap = vtdmaps[i]; > + return (vtdmap); > + } > + } > + } > + > + /* No matching scope */ > + return (NULL); > +} > + > static void > vtd_wbflush(struct vtdmap *vtdmap) > { > @@ -240,7 +306,7 @@ vtd_translation_disable(struct vtdmap *vtdmap) > static int > vtd_init(void) > { > - int i, units, remaining; > + int i, units, remaining, tmp; > struct vtdmap *vtdmap; > vm_paddr_t ctx_paddr; > char *end, envname[32]; > @@ -291,8 +357,9 @@ vtd_init(void) > break; > > drhd = (ACPI_DMAR_HARDWARE_UNIT *)hdr; > - vtdmaps[units++] = (struct vtdmap *)PHYS_TO_DMAP(drhd->Address); > - if (units >= DRHD_MAX_UNITS) > + drhds[units] = drhd; > + vtdmaps[units] = (struct vtdmap *)PHYS_TO_DMAP(drhd->Address); > + if (++units >= DRHD_MAX_UNITS) > break; > remaining -= hdr->Length; > } > @@ -302,13 +369,19 @@ vtd_init(void) > > skip_dmar: > drhd_num = units; > - vtdmap = vtdmaps[0]; > > - if (VTD_CAP_CM(vtdmap->cap) != 0) > - panic("vtd_init: invalid caching mode"); > + max_domains = 64 * 1024; /* maximum valid value */ > + for (i = 0; i < drhd_num; i++){ > + vtdmap = vtdmaps[i]; > > - max_domains = vtd_max_domains(vtdmap); > + if (VTD_CAP_CM(vtdmap->cap) != 0) > + panic("vtd_init: invalid caching mode"); > > + /* take most compatible (minimum) value */ > + if ((tmp = vtd_max_domains(vtdmap)) < max_domains) > + max_domains = tmp; > + } > + > /* > * Set up the root-table to point to the context-entry tables > */ > @@ -373,7 +446,6 @@ vtd_add_device(void *arg, uint16_t rid) > struct vtdmap *vtdmap; > uint8_t bus; > > - vtdmap = vtdmaps[0]; > bus = PCI_RID2BUS(rid); > ctxp = ctx_tables[bus]; > pt_paddr = vtophys(dom->ptp); > @@ -385,6 +457,10 @@ vtd_add_device(void *arg, uint16_t rid) > (uint16_t)(ctxp[idx + 1] >> 8)); > } > > + if ((vtdmap = vtd_device_scope(rid)) == NULL) > + panic("vtd_add_device: device %x is not in scope for " > + "any DMA remapping unit", rid); > + > /* > * Order is important. The 'present' bit is set only after all fields > * of the context pointer are initialized. > @@ -568,8 +644,6 @@ vtd_create_domain(vm_paddr_t maxaddr) > if (drhd_num <= 0) > panic("vtd_create_domain: no dma remapping hardware available"); > > - vtdmap = vtdmaps[0]; > - > /* > * Calculate AGAW. > * Section 3.4.2 "Adjusted Guest Address Width", Architecture Spec. > @@ -594,7 +668,14 @@ vtd_create_domain(vm_paddr_t maxaddr) > pt_levels = 2; > sagaw = 30; > addrwidth = 0; > - tmp = VTD_CAP_SAGAW(vtdmap->cap); > + > + tmp = ~0; > + for (i = 0; i < drhd_num; i++) { > + vtdmap = vtdmaps[i]; > + /* take most compatible value */ > + tmp &= VTD_CAP_SAGAW(vtdmap->cap); > + } > + > for (i = 0; i < 5; i++) { > if ((tmp & (1 << i)) != 0 && sagaw >= agaw) > break; > @@ -606,8 +687,8 @@ vtd_create_domain(vm_paddr_t maxaddr) > } > > if (i >= 5) { > - panic("vtd_create_domain: SAGAW 0x%lx does not support AGAW %d", > - VTD_CAP_SAGAW(vtdmap->cap), agaw); > + panic("vtd_create_domain: SAGAW 0x%x does not support AGAW %d", > + tmp, agaw); > } > > dom = malloc(sizeof(struct domain), M_VTD, M_ZERO | M_WAITOK); > @@ -634,7 +715,12 @@ vtd_create_domain(vm_paddr_t maxaddr) > * There is not any code to deal with the demotion at the moment > * so we disable superpage mappings altogether. > */ > - dom->spsmask = VTD_CAP_SPS(vtdmap->cap); > + dom->spsmask = ~0; > + for (i = 0; i < drhd_num; i++) { > + vtdmap = vtdmaps[i]; > + /* take most compatible value */ > + dom->spsmask &= VTD_CAP_SPS(vtdmap->cap); > + } > #endif > > SLIST_INSERT_HEAD(&domhead, dom, next); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jun 19 15:36:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FEE015BC3AF; Wed, 19 Jun 2019 15:36:06 +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 1D3BC6B43B; Wed, 19 Jun 2019 15:36:06 +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 E89282664A; Wed, 19 Jun 2019 15:36:05 +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 x5JFa5le090774; Wed, 19 Jun 2019 15:36:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JFa2EO090757; Wed, 19 Jun 2019 15:36:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906191536.x5JFa2EO090757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 19 Jun 2019 15:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349195 - in head/sys: geom geom/concat geom/eli geom/journal geom/mirror geom/multipath geom/part geom/raid geom/raid3 geom/stripe kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: geom geom/concat geom/eli geom/journal geom/mirror geom/multipath geom/part geom/raid geom/raid3 geom/stripe kern X-SVN-Commit-Revision: 349195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D3BC6B43B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 15:36:06 -0000 Author: mav Date: Wed Jun 19 15:36:02 2019 New Revision: 349195 URL: https://svnweb.freebsd.org/changeset/base/349195 Log: Use sbuf_cat() in GEOM confxml generation. When it comes to megabytes of text, difference between sbuf_printf() and sbuf_cat() becomes substantial. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/geom/concat/g_concat.c head/sys/geom/eli/g_eli.c head/sys/geom/geom_disk.c head/sys/geom/geom_dump.c head/sys/geom/geom_int.h head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/multipath/g_multipath.c head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd64.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_mbr.c head/sys/geom/raid/g_raid.c head/sys/geom/raid3/g_raid3.c head/sys/geom/stripe/g_stripe.c head/sys/kern/kern_uuid.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/concat/g_concat.c Wed Jun 19 15:36:02 2019 (r349195) @@ -1004,24 +1004,24 @@ g_concat_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s", indent); switch (sc->sc_type) { case G_CONCAT_TYPE_AUTOMATIC: - sbuf_printf(sb, "AUTOMATIC"); + sbuf_cat(sb, "AUTOMATIC"); break; case G_CONCAT_TYPE_MANUAL: - sbuf_printf(sb, "MANUAL"); + sbuf_cat(sb, "MANUAL"); break; default: - sbuf_printf(sb, "UNKNOWN"); + sbuf_cat(sb, "UNKNOWN"); break; } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%sTotal=%u, Online=%u\n", indent, sc->sc_ndisks, g_concat_nvalid(sc)); sbuf_printf(sb, "%s", indent); if (sc->sc_provider != NULL && sc->sc_provider->error == 0) - sbuf_printf(sb, "UP"); + sbuf_cat(sb, "UP"); else - sbuf_printf(sb, "DOWN"); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "DOWN"); + sbuf_cat(sb, "\n"); } } Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/eli/g_eli.c Wed Jun 19 15:36:02 2019 (r349195) @@ -1328,17 +1328,17 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, st (uintmax_t)sc->sc_ekeys_allocated); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) - sbuf_printf(sb, "NONE"); + sbuf_cat(sb, "NONE"); else { int first = 1; #define ADD_FLAG(flag, name) do { \ if (sc->sc_flags & (flag)) { \ if (!first) \ - sbuf_printf(sb, ", "); \ + sbuf_cat(sb, ", "); \ else \ first = 0; \ - sbuf_printf(sb, name); \ + sbuf_cat(sb, name); \ } \ } while (0) ADD_FLAG(G_ELI_FLAG_SUSPEND, "SUSPEND"); @@ -1358,7 +1358,7 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, st ADD_FLAG(G_ELI_FLAG_AUTORESIZE, "AUTORESIZE"); #undef ADD_FLAG } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) { sbuf_printf(sb, "%s%u\n", indent, @@ -1368,16 +1368,16 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, st sbuf_printf(sb, "%s", indent); switch (sc->sc_crypto) { case G_ELI_CRYPTO_HW: - sbuf_printf(sb, "hardware"); + sbuf_cat(sb, "hardware"); break; case G_ELI_CRYPTO_SW: - sbuf_printf(sb, "software"); + sbuf_cat(sb, "software"); break; default: - sbuf_printf(sb, "UNKNOWN"); + sbuf_cat(sb, "UNKNOWN"); break; } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); if (sc->sc_flags & G_ELI_FLAG_AUTH) { sbuf_printf(sb, "%s%s\n", Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/geom_disk.c Wed Jun 19 15:36:02 2019 (r349195) @@ -599,15 +599,15 @@ g_disk_dumpconf(struct sbuf *sb, const char *indent, s */ sbuf_printf(sb, "%s", indent); if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */ - sbuf_printf(sb, "unknown"); /* don't report RPM. */ + sbuf_cat(sb, "unknown"); /* don't report RPM. */ else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING) - sbuf_printf(sb, "0"); + sbuf_cat(sb, "0"); else if ((dp->d_rotation_rate >= DISK_RR_MIN) && (dp->d_rotation_rate <= DISK_RR_MAX)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else - sbuf_printf(sb, "invalid"); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "invalid"); + sbuf_cat(sb, "\n"); if (dp->d_getattr != NULL) { buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); bp = g_alloc_bio(); @@ -617,35 +617,34 @@ g_disk_dumpconf(struct sbuf *sb, const char *indent, s bp->bio_data = buf; res = dp->d_getattr(bp); sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", - res == 0 ? buf: dp->d_ident); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, res == 0 ? buf : dp->d_ident); + sbuf_cat(sb, "\n"); bp->bio_attribute = "GEOM::lunid"; bp->bio_length = DISK_IDENT_SIZE; bp->bio_data = buf; if (dp->d_getattr(bp) == 0) { sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", buf); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, buf); + sbuf_cat(sb, "\n"); } bp->bio_attribute = "GEOM::lunname"; bp->bio_length = DISK_IDENT_SIZE; bp->bio_data = buf; if (dp->d_getattr(bp) == 0) { sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", buf); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, buf); + sbuf_cat(sb, "\n"); } g_destroy_bio(bp); g_free(buf); } else { sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", dp->d_ident); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, dp->d_ident); + sbuf_cat(sb, "\n"); } sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", dp->d_descr); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, dp->d_descr); + sbuf_cat(sb, "\n"); } } Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/geom_dump.c Wed Jun 19 15:36:02 2019 (r349195) @@ -105,10 +105,10 @@ g_confdot(void *p, int flag ) KASSERT(flag != EV_CANCEL, ("g_confdot was cancelled")); sb = p; g_topology_assert(); - sbuf_printf(sb, "digraph geom {\n"); + sbuf_cat(sb, "digraph geom {\n"); LIST_FOREACH(mp, &g_classes, class) g_confdot_class(sb, mp); - sbuf_printf(sb, "}\n"); + sbuf_cat(sb, "}\n"); sbuf_finish(sb); } @@ -125,7 +125,7 @@ g_conftxt_geom(struct sbuf *sb, struct g_geom *gp, int pp->name, (uintmax_t)pp->mediasize, pp->sectorsize); if (gp->dumpconf != NULL) gp->dumpconf(sb, NULL, gp, NULL, pp); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); LIST_FOREACH(cp, &pp->consumers, consumers) g_conftxt_geom(sb, cp->geom, level + 1); } @@ -156,12 +156,26 @@ g_conftxt(void *p, int flag) sbuf_finish(sb); } +void +g_conf_cat_escaped(struct sbuf *sb, const char *buf) +{ + const u_char *c; + for (c = buf; *c != '\0'; c++) { + if (*c == '&' || *c == '<' || *c == '>' || + *c == '\'' || *c == '"' || *c > 0x7e) + sbuf_printf(sb, "&#x%X;", *c); + else if (*c == '\t' || *c == '\n' || *c == '\r' || *c > 0x1f) + sbuf_putc(sb, *c); + else + sbuf_putc(sb, '?'); + } +} + void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...) { struct sbuf *s; - const u_char *c; va_list ap; s = sbuf_new_auto(); @@ -170,15 +184,7 @@ g_conf_printf_escaped(struct sbuf *sb, const char *fmt va_end(ap); sbuf_finish(s); - for (c = sbuf_data(s); *c != '\0'; c++) { - if (*c == '&' || *c == '<' || *c == '>' || - *c == '\'' || *c == '"' || *c > 0x7e) - sbuf_printf(sb, "&#x%X;", *c); - else if (*c == '\t' || *c == '\n' || *c == '\r' || *c > 0x1f) - sbuf_putc(sb, *c); - else - sbuf_putc(sb, '?'); - } + g_conf_cat_escaped(sb, sbuf_data(s)); sbuf_delete(s); } @@ -195,11 +201,11 @@ g_conf_consumer(struct sbuf *sb, struct g_consumer *cp if (cp->geom->flags & G_GEOM_WITHER) ; else if (cp->geom->dumpconf != NULL) { - sbuf_printf(sb, "\t \n"); + sbuf_cat(sb, "\t \n"); cp->geom->dumpconf(sb, "\t ", cp->geom, cp, NULL); - sbuf_printf(sb, "\t \n"); + sbuf_cat(sb, "\t \n"); } - sbuf_printf(sb, "\t\n"); + sbuf_cat(sb, "\t\n"); } static void @@ -210,24 +216,24 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp sbuf_printf(sb, "\t \n", pp->geom); sbuf_printf(sb, "\t r%dw%de%d\n", pp->acr, pp->acw, pp->ace); - sbuf_printf(sb, "\t "); - g_conf_printf_escaped(sb, "%s", pp->name); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\t "); + g_conf_cat_escaped(sb, pp->name); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "\t %jd\n", (intmax_t)pp->mediasize); sbuf_printf(sb, "\t %u\n", pp->sectorsize); sbuf_printf(sb, "\t %ju\n", (uintmax_t)pp->stripesize); sbuf_printf(sb, "\t %ju\n", (uintmax_t)pp->stripeoffset); if (pp->flags & G_PF_WITHER) - sbuf_printf(sb, "\t \n"); + sbuf_cat(sb, "\t \n"); else if (pp->geom->flags & G_GEOM_WITHER) ; else if (pp->geom->dumpconf != NULL) { - sbuf_printf(sb, "\t \n"); + sbuf_cat(sb, "\t \n"); pp->geom->dumpconf(sb, "\t ", pp->geom, NULL, pp); - sbuf_printf(sb, "\t \n"); + sbuf_cat(sb, "\t \n"); } - sbuf_printf(sb, "\t\n"); + sbuf_cat(sb, "\t\n"); } @@ -240,16 +246,16 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct sbuf_printf(sb, " \n", gp); sbuf_printf(sb, " \n", gp->class); - sbuf_printf(sb, " "); - g_conf_printf_escaped(sb, "%s", gp->name); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, " "); + g_conf_cat_escaped(sb, gp->name); + sbuf_cat(sb, "\n"); sbuf_printf(sb, " %d\n", gp->rank); if (gp->flags & G_GEOM_WITHER) - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); else if (gp->dumpconf != NULL) { - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); gp->dumpconf(sb, "\t", gp, NULL, NULL); - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); } LIST_FOREACH(cp2, &gp->consumer, consumer) { if (cp != NULL && cp != cp2) @@ -263,11 +269,11 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct g_conf_provider(sb, pp2); } LIST_FOREACH(gap, &gp->aliases, ga_next) { - sbuf_printf(sb, " \n"); - g_conf_printf_escaped(sb, "%s", gap->ga_alias); - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); + g_conf_cat_escaped(sb, gap->ga_alias); + sbuf_cat(sb, " \n"); } - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); } static void @@ -276,15 +282,15 @@ g_conf_class(struct sbuf *sb, struct g_class *mp, stru struct g_geom *gp2; sbuf_printf(sb, " \n", mp); - sbuf_printf(sb, " "); - g_conf_printf_escaped(sb, "%s", mp->name); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, " "); + g_conf_cat_escaped(sb, mp->name); + sbuf_cat(sb, "\n"); LIST_FOREACH(gp2, &mp->geom, geom) { if (gp != NULL && gp != gp2) continue; g_conf_geom(sb, gp2, pp, cp); } - sbuf_printf(sb, " \n"); + sbuf_cat(sb, " \n"); } void @@ -293,13 +299,13 @@ g_conf_specific(struct sbuf *sb, struct g_class *mp, s struct g_class *mp2; g_topology_assert(); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); LIST_FOREACH(mp2, &g_classes, class) { if (mp != NULL && mp != mp2) continue; g_conf_class(sb, mp2, gp, pp, cp); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_finish(sb); } Modified: head/sys/geom/geom_int.h ============================================================================== --- head/sys/geom/geom_int.h Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/geom_int.h Wed Jun 19 15:36:02 2019 (r349195) @@ -59,6 +59,7 @@ extern int g_debugflags; /* geom_dump.c */ void g_confxml(void *, int flag); void g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp); +void g_conf_cat_escaped(struct sbuf *sb, const char *buf); void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...); void g_confdot(void *, int flag); void g_conftxt(void *, int flag); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/journal/g_journal.c Wed Jun 19 15:36:02 2019 (r349195) @@ -2623,15 +2623,15 @@ g_journal_dumpconf(struct sbuf *sb, const char *indent sbuf_printf(sb, "%s", indent); if (cp == sc->sc_dconsumer) { - sbuf_printf(sb, "Data"); + sbuf_cat(sb, "Data"); first = 0; } if (cp == sc->sc_jconsumer) { if (!first) - sbuf_printf(sb, ","); - sbuf_printf(sb, "Journal"); + sbuf_cat(sb, ","); + sbuf_cat(sb, "Journal"); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); if (cp == sc->sc_jconsumer) { sbuf_printf(sb, "%jd\n", (intmax_t)sc->sc_jstart); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/mirror/g_mirror.c Wed Jun 19 15:36:02 2019 (r349195) @@ -3373,12 +3373,12 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) { sbuf_printf(sb, "%s", indent); if (disk->d_sync.ds_offset == 0) - sbuf_printf(sb, "0%%"); + sbuf_cat(sb, "0%"); else sbuf_printf(sb, "%u%%", (u_int)((disk->d_sync.ds_offset * 100) / sc->sc_mediasize)); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); if (disk->d_sync.ds_offset > 0) sbuf_printf(sb, "%s%jd" "\n", indent, @@ -3390,17 +3390,17 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, disk->d_genid); sbuf_printf(sb, "%s", indent); if (disk->d_flags == 0) - sbuf_printf(sb, "NONE"); + sbuf_cat(sb, "NONE"); else { int first = 1; #define ADD_FLAG(flag, name) do { \ if ((disk->d_flags & (flag)) != 0) { \ if (!first) \ - sbuf_printf(sb, ", "); \ + sbuf_cat(sb, ", "); \ else \ first = 0; \ - sbuf_printf(sb, name); \ + sbuf_cat(sb, name); \ } \ } while (0) ADD_FLAG(G_MIRROR_DISK_FLAG_DIRTY, "DIRTY"); @@ -3412,7 +3412,7 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, ADD_FLAG(G_MIRROR_DISK_FLAG_BROKEN, "BROKEN"); #undef ADD_FLAG } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, disk->d_priority); sbuf_printf(sb, "%s%s\n", indent, @@ -3421,39 +3421,39 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s", indent); switch (sc->sc_type) { case G_MIRROR_TYPE_AUTOMATIC: - sbuf_printf(sb, "AUTOMATIC"); + sbuf_cat(sb, "AUTOMATIC"); break; case G_MIRROR_TYPE_MANUAL: - sbuf_printf(sb, "MANUAL"); + sbuf_cat(sb, "MANUAL"); break; default: - sbuf_printf(sb, "UNKNOWN"); + sbuf_cat(sb, "UNKNOWN"); break; } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, (u_int)sc->sc_id); sbuf_printf(sb, "%s%u\n", indent, sc->sc_syncid); sbuf_printf(sb, "%s%u\n", indent, sc->sc_genid); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) - sbuf_printf(sb, "NONE"); + sbuf_cat(sb, "NONE"); else { int first = 1; #define ADD_FLAG(flag, name) do { \ if ((sc->sc_flags & (flag)) != 0) { \ if (!first) \ - sbuf_printf(sb, ", "); \ + sbuf_cat(sb, ", "); \ else \ first = 0; \ - sbuf_printf(sb, name); \ + sbuf_cat(sb, name); \ } \ } while (0) ADD_FLAG(G_MIRROR_DEVICE_FLAG_NOFAILSYNC, "NOFAILSYNC"); ADD_FLAG(G_MIRROR_DEVICE_FLAG_NOAUTOSYNC, "NOAUTOSYNC"); #undef ADD_FLAG } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, (u_int)sc->sc_slice); sbuf_printf(sb, "%s%s\n", indent, @@ -3468,7 +3468,7 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s", "COMPLETE"); else sbuf_printf(sb, "%s", "DEGRADED"); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); } } Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/multipath/g_multipath.c Wed Jun 19 15:36:02 2019 (r349195) @@ -1450,7 +1450,7 @@ g_multipath_ctl_getactive(struct gctl_req *req, struct } else if (sc->sc_active && sc->sc_active->provider) { sbuf_printf(sb, "%s\n", sc->sc_active->provider->name); } else { - sbuf_printf(sb, "none\n"); + sbuf_cat(sb, "none\n"); } sbuf_finish(sb); gctl_set_param_err(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/part/g_part_apm.c Wed Jun 19 15:36:02 2019 (r349195) @@ -310,13 +310,13 @@ g_part_apm_dumpconf(struct g_part_table *table, struct strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN); u.name[APM_ENT_NAMELEN] = '\0'; sbuf_printf(sb, "%s\n"); + g_conf_cat_escaped(sb, u.name); + sbuf_cat(sb, "\n"); strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN); u.type[APM_ENT_TYPELEN] = '\0'; sbuf_printf(sb, "%s", indent); - g_conf_printf_escaped(sb, "%s", u.type); - sbuf_printf(sb, "\n"); + g_conf_cat_escaped(sb, u.type); + sbuf_cat(sb, "\n"); } else { /* confxml: scheme information */ } Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/part/g_part_bsd64.c Wed Jun 19 15:36:02 2019 (r349195) @@ -386,11 +386,11 @@ g_part_bsd64_dumpconf(struct g_part_table *basetable, if (!EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) { sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &entry->type_uuid); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); } sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &entry->stor_uuid); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); } else { /* confxml: scheme information */ table = (struct g_part_bsd64_table *)basetable; @@ -401,12 +401,12 @@ g_part_bsd64_dumpconf(struct g_part_table *basetable, indent, (uintmax_t)table->d_abase); sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &table->d_stor_uuid); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s\n"); + g_conf_cat_escaped(sb, buf); + sbuf_cat(sb, "\n"); } } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/part/g_part_gpt.c Wed Jun 19 15:36:02 2019 (r349195) @@ -713,14 +713,14 @@ g_part_gpt_dumpconf(struct g_part_table *table, struct entry = (struct g_part_gpt_entry *)baseentry; if (indent == NULL) { /* conftxt: libdisk compatibility */ - sbuf_printf(sb, " xs GPT xt "); + sbuf_cat(sb, " xs GPT xt "); sbuf_printf_uuid(sb, &entry->ent.ent_type); } else if (entry != NULL) { /* confxml: partition entry information */ sbuf_printf(sb, "%s\n"); + sbuf_cat(sb, "\n"); if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME) sbuf_printf(sb, "%sbootme\n", indent); if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE) { @@ -733,16 +733,16 @@ g_part_gpt_dumpconf(struct g_part_table *table, struct } sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &entry->ent.ent_type); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s", indent); sbuf_printf_uuid(sb, &entry->ent.ent_uuid); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s", indent); sbuf_printf(sb, "HD(%d,GPT,", entry->base.gpe_index); sbuf_printf_uuid(sb, &entry->ent.ent_uuid); sbuf_printf(sb, ",%#jx,%#jx)", (intmax_t)entry->base.gpe_start, (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); } else { /* confxml: scheme information */ } Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/part/g_part_mbr.c Wed Jun 19 15:36:02 2019 (r349195) @@ -330,7 +330,7 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, st sbuf_printf(sb, "%sHD(%d,MBR,%#08x,%#jx,%#jx)", indent, entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start, (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); } else { /* confxml: scheme information */ } Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/raid/g_raid.c Wed Jun 19 15:36:02 2019 (r349195) @@ -2372,7 +2372,7 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s sbuf_printf(sb, "%s ", g_raid_get_diskname(sd->sd_disk)); } else { - sbuf_printf(sb, "NONE "); + sbuf_cat(sb, "NONE "); } sbuf_printf(sb, "(%s", g_raid_subdisk_state2str(sd->sd_state)); @@ -2382,11 +2382,11 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s (int)(sd->sd_rebuild_pos * 100 / sd->sd_size)); } - sbuf_printf(sb, ")"); + sbuf_cat(sb, ")"); if (i + 1 < vol->v_disks_count) - sbuf_printf(sb, ", "); + sbuf_cat(sb, ", "); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sx_xunlock(&sc->sc_lock); g_topology_lock(); } else if (cp != NULL) { @@ -2398,7 +2398,7 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s sbuf_printf(sb, "%s%s", indent, g_raid_disk_state2str(disk->d_state)); if (!TAILQ_EMPTY(&disk->d_subdisks)) { - sbuf_printf(sb, " ("); + sbuf_cat(sb, " ("); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { sbuf_printf(sb, "%s", g_raid_subdisk_state2str(sd->sd_state)); @@ -2409,11 +2409,11 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s sd->sd_size)); } if (TAILQ_NEXT(sd, sd_next)) - sbuf_printf(sb, ", "); + sbuf_cat(sb, ", "); } - sbuf_printf(sb, ")"); + sbuf_cat(sb, ")"); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s", indent); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { sbuf_printf(sb, "r%d(%s):%d@%ju", @@ -2421,9 +2421,9 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s sd->sd_volume->v_name, sd->sd_pos, (uintmax_t)sd->sd_offset); if (TAILQ_NEXT(sd, sd_next)) - sbuf_printf(sb, ", "); + sbuf_cat(sb, ", "); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%d\n", indent, disk->d_read_errs); sx_xunlock(&sc->sc_lock); Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/raid3/g_raid3.c Wed Jun 19 15:36:02 2019 (r349195) @@ -3424,22 +3424,22 @@ g_raid3_dumpconf(struct sbuf *sb, const char *indent, sx_xlock(&sc->sc_lock); sbuf_printf(sb, "%s", indent); if (disk->d_no == sc->sc_ndisks - 1) - sbuf_printf(sb, "PARITY"); + sbuf_cat(sb, "PARITY"); else - sbuf_printf(sb, "DATA"); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "DATA"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, (u_int)disk->d_no); if (disk->d_state == G_RAID3_DISK_STATE_SYNCHRONIZING) { sbuf_printf(sb, "%s", indent); if (disk->d_sync.ds_offset == 0) - sbuf_printf(sb, "0%%"); + sbuf_cat(sb, "0%"); else { sbuf_printf(sb, "%u%%", (u_int)((disk->d_sync.ds_offset * 100) / (sc->sc_mediasize / (sc->sc_ndisks - 1)))); } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); if (disk->d_sync.ds_offset > 0) { sbuf_printf(sb, "%s%jd" "\n", indent, @@ -3451,17 +3451,17 @@ g_raid3_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s%u\n", indent, disk->d_genid); sbuf_printf(sb, "%s", indent); if (disk->d_flags == 0) - sbuf_printf(sb, "NONE"); + sbuf_cat(sb, "NONE"); else { int first = 1; #define ADD_FLAG(flag, name) do { \ if ((disk->d_flags & (flag)) != 0) { \ if (!first) \ - sbuf_printf(sb, ", "); \ + sbuf_cat(sb, ", "); \ else \ first = 0; \ - sbuf_printf(sb, name); \ + sbuf_cat(sb, name); \ } \ } while (0) ADD_FLAG(G_RAID3_DISK_FLAG_DIRTY, "DIRTY"); @@ -3472,7 +3472,7 @@ g_raid3_dumpconf(struct sbuf *sb, const char *indent, ADD_FLAG(G_RAID3_DISK_FLAG_BROKEN, "BROKEN"); #undef ADD_FLAG } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%s\n", indent, g_raid3_disk_state2str(disk->d_state)); sx_xunlock(&sc->sc_lock); @@ -3505,17 +3505,17 @@ g_raid3_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s%u\n", indent, sc->sc_genid); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) - sbuf_printf(sb, "NONE"); + sbuf_cat(sb, "NONE"); else { int first = 1; #define ADD_FLAG(flag, name) do { \ if ((sc->sc_flags & (flag)) != 0) { \ if (!first) \ - sbuf_printf(sb, ", "); \ + sbuf_cat(sb, ", "); \ else \ first = 0; \ - sbuf_printf(sb, name); \ + sbuf_cat(sb, name); \ } \ } while (0) ADD_FLAG(G_RAID3_DEVICE_FLAG_NOFAILSYNC, "NOFAILSYNC"); @@ -3525,7 +3525,7 @@ g_raid3_dumpconf(struct sbuf *sb, const char *indent, ADD_FLAG(G_RAID3_DEVICE_FLAG_VERIFY, "VERIFY"); #undef ADD_FLAG } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, sc->sc_ndisks); sbuf_printf(sb, "%s%s\n", indent, Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/geom/stripe/g_stripe.c Wed Jun 19 15:36:02 2019 (r349195) @@ -1249,24 +1249,24 @@ g_stripe_dumpconf(struct sbuf *sb, const char *indent, sbuf_printf(sb, "%s", indent); switch (sc->sc_type) { case G_STRIPE_TYPE_AUTOMATIC: - sbuf_printf(sb, "AUTOMATIC"); + sbuf_cat(sb, "AUTOMATIC"); break; case G_STRIPE_TYPE_MANUAL: - sbuf_printf(sb, "MANUAL"); + sbuf_cat(sb, "MANUAL"); break; default: - sbuf_printf(sb, "UNKNOWN"); + sbuf_cat(sb, "UNKNOWN"); break; } - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "\n"); sbuf_printf(sb, "%sTotal=%u, Online=%u\n", indent, sc->sc_ndisks, g_stripe_nvalid(sc)); sbuf_printf(sb, "%s", indent); if (sc->sc_provider != NULL && sc->sc_provider->error == 0) - sbuf_printf(sb, "UP"); + sbuf_cat(sb, "UP"); else - sbuf_printf(sb, "DOWN"); - sbuf_printf(sb, "\n"); + sbuf_cat(sb, "DOWN"); + sbuf_cat(sb, "\n"); } } Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Wed Jun 19 15:26:52 2019 (r349194) +++ head/sys/kern/kern_uuid.c Wed Jun 19 15:36:02 2019 (r349195) @@ -297,7 +297,7 @@ sbuf_printf_uuid(struct sbuf *sb, struct uuid *uuid) char buf[38]; snprintf_uuid(buf, sizeof(buf), uuid); - return (sbuf_printf(sb, "%s", buf)); + return (sbuf_cat(sb, buf)); } /* From owner-svn-src-head@freebsd.org Wed Jun 19 16:09:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4B4E15BD341; Wed, 19 Jun 2019 16:09: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 326476C679; Wed, 19 Jun 2019 16:09: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 0BFB526B82; Wed, 19 Jun 2019 16:09: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 x5JG9Kov006421; Wed, 19 Jun 2019 16:09:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JG9KlL006420; Wed, 19 Jun 2019 16:09:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906191609.x5JG9KlL006420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Jun 2019 16:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349196 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 326476C679 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 16:09:21 -0000 Author: markj Date: Wed Jun 19 16:09:20 2019 New Revision: 349196 URL: https://svnweb.freebsd.org/changeset/base/349196 Log: Make zlib encoding messages idempotent. Otherwise duplicate messages can trigger a reinitialization of the compression stream while the update thread is running. Also ensure that the stream is initialized before the update thread may attempt to use it. PR: 238333 Reviewed by: cem, rgrimes MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20673 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Wed Jun 19 15:36:02 2019 (r349195) +++ head/usr.sbin/bhyve/rfb.c Wed Jun 19 16:09:20 2019 (r349196) @@ -273,8 +273,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c rc->enc_raw_ok = true; break; case RFB_ENCODING_ZLIB: - rc->enc_zlib_ok = true; - deflateInit(&rc->zstream, Z_BEST_SPEED); + if (!rc->enc_zlib_ok) { + deflateInit(&rc->zstream, Z_BEST_SPEED); + rc->enc_zlib_ok = true; + } break; case RFB_ENCODING_RESIZE: rc->enc_resize_ok = true; From owner-svn-src-head@freebsd.org Wed Jun 19 18:47:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4309015C69BF; Wed, 19 Jun 2019 18:47:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD903759F4; Wed, 19 Jun 2019 18:47:44 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B773377D; Wed, 19 Jun 2019 18:47:44 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JIliHs094298; Wed, 19 Jun 2019 18:47:44 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JIli8Y094297; Wed, 19 Jun 2019 18:47:44 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906191847.x5JIli8Y094297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Wed, 19 Jun 2019 18:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349201 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 349201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD903759F4 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 18:47:45 -0000 Author: bcran Date: Wed Jun 19 18:47:44 2019 New Revision: 349201 URL: https://svnweb.freebsd.org/changeset/base/349201 Log: efinet: Defer exclusively opening the network handles Don't commit to exclusive access to the network device handle by efinet until the loader has decided to load something through the network. This allows for the possibility of other users of the network device. Submitted by: scottph Reviewed by: tsoome, emaste Tested by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20642 Modified: head/stand/efi/libefi/efinet.c Modified: head/stand/efi/libefi/efinet.c ============================================================================== --- head/stand/efi/libefi/efinet.c Wed Jun 19 16:44:07 2019 (r349200) +++ head/stand/efi/libefi/efinet.c Wed Jun 19 18:47:44 2019 (r349201) @@ -108,7 +108,25 @@ efinet_match(struct netif *nif, void *machdep_hint) static int efinet_probe(struct netif *nif, void *machdep_hint) { + EFI_SIMPLE_NETWORK *net; + EFI_HANDLE h; + EFI_STATUS status; + h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private; + /* + * Open the network device in exclusive mode. Without this + * we will be racing with the UEFI network stack. It will + * pull packets off the network leading to lost packets. + */ + status = BS->OpenProtocol(h, &sn_guid, (void **)&net, + IH, NULL, EFI_OPEN_PROTOCOL_EXCLUSIVE); + if (status != EFI_SUCCESS) { + printf("Unable to open network interface %d for " + "exclusive access: %lu\n", nif->nif_unit, + EFI_ERROR_CODE(status)); + return (efi_status_to_errno(status)); + } + return (0); } @@ -269,7 +287,6 @@ efinet_dev_init() struct netif_dif *dif; struct netif_stats *stats; EFI_DEVICE_PATH *devpath, *node; - EFI_SIMPLE_NETWORK *net; EFI_HANDLE *handles, *handles2; EFI_STATUS status; UINTN sz; @@ -304,19 +321,6 @@ efinet_dev_init() if (DevicePathType(node) != MESSAGING_DEVICE_PATH || DevicePathSubType(node) != MSG_MAC_ADDR_DP) continue; - - /* - * Open the network device in exclusive mode. Without this - * we will be racing with the UEFI network stack. It will - * pull packets off the network leading to lost packets. - */ - status = BS->OpenProtocol(handles[i], &sn_guid, (void **)&net, - IH, NULL, EFI_OPEN_PROTOCOL_EXCLUSIVE); - if (status != EFI_SUCCESS) { - printf("Unable to open network interface %d for " - "exclusive access: %lu\n", i, - EFI_ERROR_CODE(status)); - } handles2[nifs] = handles[i]; nifs++; From owner-svn-src-head@freebsd.org Wed Jun 19 19:19:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F1615C7353; Wed, 19 Jun 2019 19:19:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5717670B; Wed, 19 Jun 2019 19:19:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23276C9E; Wed, 19 Jun 2019 19:19:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JJJb1v009842; Wed, 19 Jun 2019 19:19:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JJJbI9009841; Wed, 19 Jun 2019 19:19:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201906191919.x5JJJbI9009841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 19 Jun 2019 19:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349202 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 349202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A5717670B 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 19:19:38 -0000 Author: bdrewery Date: Wed Jun 19 19:19:37 2019 New Revision: 349202 URL: https://svnweb.freebsd.org/changeset/base/349202 Log: Follow-up r349065: Fix .TARGET flag ambiguity with PROGS which broke MK_TESTS. X-MFC-With: r349065 Sponsored by: DellEMC Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Wed Jun 19 18:47:44 2019 (r349201) +++ head/share/mk/bsd.sys.mk Wed Jun 19 19:19:37 2019 (r349202) @@ -234,7 +234,6 @@ DEBUG_FILES_CFLAGS?= -g .if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}} CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} -CFLAGS+= ${CWARNFLAGS.${.TARGET:T}} .endif CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} @@ -245,14 +244,23 @@ AFLAGS+= ${AFLAGS.${.TARGET:T}} ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} ACFLAGS+= ${ACFLAGS.${.TARGET:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} -CFLAGS+= ${CFLAGS.${.TARGET:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} -CXXFLAGS+= ${CXXFLAGS.${.TARGET:T}} LDFLAGS+= ${LDFLAGS.${LINKER_TYPE}} + +# Only allow .TARGET when not using PROGS as it has the same syntax +# per PROG which is ambiguous with this syntax. This is only needed +# for PROG_VARS vars. +.if !defined(_RECURSING_PROGS) +.if ${MK_WARNS} != "no" +CFLAGS+= ${CWARNFLAGS.${.TARGET:T}} +.endif +CFLAGS+= ${CFLAGS.${.TARGET:T}} +CXXFLAGS+= ${CXXFLAGS.${.TARGET:T}} LDFLAGS+= ${LDFLAGS.${.TARGET:T}} LDADD+= ${LDADD.${.TARGET:T}} LIBADD+= ${LIBADD.${.TARGET:T}} +.endif .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. From owner-svn-src-head@freebsd.org Wed Jun 19 21:10:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAD815CA6A2; Wed, 19 Jun 2019 21:10:14 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1531E83386; Wed, 19 Jun 2019 21:10:14 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFB5E1F8F; Wed, 19 Jun 2019 21:10:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JLADUR068205; Wed, 19 Jun 2019 21:10:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JLAD24068204; Wed, 19 Jun 2019 21:10:13 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201906192110.x5JLAD24068204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 19 Jun 2019 21:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349217 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 349217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1531E83386 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 21:10:14 -0000 Author: mmacy Date: Wed Jun 19 21:10:13 2019 New Revision: 349217 URL: https://svnweb.freebsd.org/changeset/base/349217 Log: Tell loader to ignore newer features enabled on the root pool. There are many new features in ZoF. Most, if not all, do not effect read only usage. Encryption in particular is enabled at the pool level but used at the dataset level. The loader obviously will not be able to boot if the boot dataset is encrypted, but should not care if some other dataset in the root pool is encrypted. Reviewed by: allanjude MFC after: 1 week Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed Jun 19 20:29:02 2019 (r349216) +++ head/stand/libsa/zfs/zfsimpl.c Wed Jun 19 21:10:13 2019 (r349217) @@ -64,6 +64,12 @@ static const char *features_for_read[] = { "org.illumos:skein", "org.zfsonlinux:large_dnode", "com.joyent:multi_vdev_crash_dump", + "com.delphix:spacemap_histogram", + "com.delphix:zpool_checkpoint", + "com.delphix:spacemap_v2", + "com.datto:encryption", + "org.zfsonlinux:allocation_classes", + "com.datto:resilver_defer", NULL }; From owner-svn-src-head@freebsd.org Wed Jun 19 21:36:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0288315CAD7D; Wed, 19 Jun 2019 21:36:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9805F840BA; Wed, 19 Jun 2019 21:36:01 +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 67AE024D0; Wed, 19 Jun 2019 21:36:01 +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 x5JLa1p6083598; Wed, 19 Jun 2019 21:36:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JLa1rD083597; Wed, 19 Jun 2019 21:36:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906192136.x5JLa1rD083597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Jun 2019 21:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349218 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 349218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9805F840BA 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 21:36:02 -0000 Author: markj Date: Wed Jun 19 21:36:00 2019 New Revision: 349218 URL: https://svnweb.freebsd.org/changeset/base/349218 Log: Group vm_page_activate()'s definition with other related functions. No functional change intended. MFC after: 3 days Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jun 19 21:10:13 2019 (r349217) +++ head/sys/vm/vm_page.c Wed Jun 19 21:36:00 2019 (r349218) @@ -3401,35 +3401,6 @@ vm_page_requeue(vm_page_t m) } /* - * vm_page_activate: - * - * Put the specified page on the active list (if appropriate). - * Ensure that act_count is at least ACT_INIT but do not otherwise - * mess with it. - * - * The page must be locked. - */ -void -vm_page_activate(vm_page_t m) -{ - - vm_page_assert_locked(m); - - if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) - return; - if (vm_page_queue(m) == PQ_ACTIVE) { - if (m->act_count < ACT_INIT) - m->act_count = ACT_INIT; - return; - } - - vm_page_dequeue(m); - if (m->act_count < ACT_INIT) - m->act_count = ACT_INIT; - vm_page_enqueue(m, PQ_ACTIVE); -} - -/* * vm_page_free_prep: * * Prepares the given page to be put on the free list, @@ -3677,6 +3648,35 @@ vm_page_unwire_noq(vm_page_t m) return (true); } else return (false); +} + +/* + * vm_page_activate: + * + * Put the specified page on the active list (if appropriate). + * Ensure that act_count is at least ACT_INIT but do not otherwise + * mess with it. + * + * The page must be locked. + */ +void +vm_page_activate(vm_page_t m) +{ + + vm_page_assert_locked(m); + + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) + return; + if (vm_page_queue(m) == PQ_ACTIVE) { + if (m->act_count < ACT_INIT) + m->act_count = ACT_INIT; + return; + } + + vm_page_dequeue(m); + if (m->act_count < ACT_INIT) + m->act_count = ACT_INIT; + vm_page_enqueue(m, PQ_ACTIVE); } /* From owner-svn-src-head@freebsd.org Thu Jun 20 01:15:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF41915CF889; Thu, 20 Jun 2019 01:15: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 5492E8B1DD; Thu, 20 Jun 2019 01:15: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 2F7C84D3C; Thu, 20 Jun 2019 01:15: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 x5K1Fart001942; Thu, 20 Jun 2019 01:15:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K1FYgU001933; Thu, 20 Jun 2019 01:15:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906200115.x5K1FYgU001933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jun 2019 01:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349220 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 349220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5492E8B1DD 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 01:15:36 -0000 Author: mav Date: Thu Jun 20 01:15:33 2019 New Revision: 349220 URL: https://svnweb.freebsd.org/changeset/base/349220 Log: Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). wakeup_one() and underlying sleepq_signal() spend additional time trying to be fair, waking thread with highest priority, sleeping longest time. But in case of taskqueue there are many absolutely identical threads, and any fairness between them is quite pointless. It makes even worse, since round-robin wakeups not only make previous CPU affinity in scheduler quite useless, but also hide from user chance to see CPU bottlenecks, when sequential workload with one request at a time looks evenly distributed between multiple threads. This change adds new SLEEPQ_UNFAIR flag to sleepq_signal(), making it wakeup thread that went to sleep last, but no longer in context switch (to avoid immediate spinning on the thread lock). On top of that new wakeup_any() function is added, equivalent to wakeup_one(), but setting the flag. On top of that taskqueue(9) is switchied to wakeup_any() to wakeup its threads. As result, on 72-core Xeon v4 machine sequential ZFS write to 12 ZVOLs with 16KB block size spend 34% less time in wakeup_any() and descendants then it was spending in wakeup_one(), and total write throughput increased by ~10% with the same as before CPU usage. Reviewed by: markj, mmacy MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20669 Modified: head/share/man/man9/Makefile head/share/man/man9/sleep.9 head/share/man/man9/sleepqueue.9 head/sys/kern/kern_synch.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_taskqueue.c head/sys/sys/queue.h head/sys/sys/sleepqueue.h head/sys/sys/systm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jun 20 00:23:51 2019 (r349219) +++ head/share/man/man9/Makefile Thu Jun 20 01:15:33 2019 (r349220) @@ -1880,7 +1880,8 @@ MLINKS+=sleep.9 msleep.9 \ sleep.9 tsleep.9 \ sleep.9 tsleep_sbt.9 \ sleep.9 wakeup.9 \ - sleep.9 wakeup_one.9 + sleep.9 wakeup_one.9 \ + sleep.9 wakeup_any.9 MLINKS+=sleepqueue.9 init_sleepqueues.9 \ sleepqueue.9 sleepq_abort.9 \ sleepqueue.9 sleepq_add.9 \ Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Thu Jun 20 00:23:51 2019 (r349219) +++ head/share/man/man9/sleep.9 Thu Jun 20 01:15:33 2019 (r349220) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 4, 2018 +.Dd June 19, 2019 .Dt SLEEP 9 .Os .Sh NAME @@ -38,7 +38,9 @@ .Nm pause_sbt , .Nm tsleep , .Nm tsleep_sbt , -.Nm wakeup +.Nm wakeup , +.Nm wakeup_one , +.Nm wakeup_any .Nd wait for events .Sh SYNOPSIS .In sys/param.h @@ -70,6 +72,8 @@ .Fn wakeup "void *chan" .Ft void .Fn wakeup_one "void *chan" +.Ft void +.Fn wakeup_any "void *chan" .Sh DESCRIPTION The functions .Fn tsleep , @@ -79,8 +83,9 @@ The functions .Fn pause_sig , .Fn pause_sbt , .Fn wakeup , +.Fn wakeup_one , and -.Fn wakeup_one +.Fn wakeup_any handle event-based thread blocking. If a thread must wait for an external event, it is put to sleep by @@ -252,9 +257,10 @@ function is a wrapper around .Fn tsleep that suspends execution of the current thread for the indicated timeout. The thread can not be awakened early by signals or calls to -.Fn wakeup +.Fn wakeup , +.Fn wakeup_one or -.Fn wakeup_one . +.Fn wakeup_any . The .Fn pause_sig function is a variant of @@ -263,8 +269,8 @@ which can be awakened early by signals. .Pp The .Fn wakeup_one -function makes the first thread in the queue that is sleeping on the -parameter +function makes the first highest priority thread in the queue that is +sleeping on the parameter .Fa chan runnable. This reduces the load when a large number of threads are sleeping on @@ -292,6 +298,16 @@ to pay particular attention to ensure that no other threads wait on the same .Fa chan . +.Pp +The +.Fn wakeup_any +function is similar to +.Fn wakeup_one , +except that it makes runnable last thread on the queue (sleeping less), +ignoring fairness. +It can be used when threads sleeping on the +.Fa chan +are known to be identical and there is no reason to be fair. .Pp If the timeout given by .Fa timo Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Thu Jun 20 00:23:51 2019 (r349219) +++ head/share/man/man9/sleepqueue.9 Thu Jun 20 01:15:33 2019 (r349220) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2014 +.Dd June 19, 2019 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -290,7 +290,8 @@ and functions. The .Fn sleepq_signal -function awakens the highest priority thread sleeping on a wait channel while +function awakens the highest priority thread sleeping on a wait channel +(if SLEEPQ_UNFAIR flag is set, thread that went to sleep recently) while .Fn sleepq_broadcast awakens all of the threads sleeping on a wait channel. The Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/kern/kern_synch.c Thu Jun 20 01:15:33 2019 (r349220) @@ -368,6 +368,19 @@ wakeup_one(void *ident) kick_proc0(); } +void +wakeup_any(void *ident) +{ + int wakeup_swapper; + + sleepq_lock(ident); + wakeup_swapper = sleepq_signal(ident, SLEEPQ_SLEEP | SLEEPQ_UNFAIR, + 0, 0); + sleepq_release(ident); + if (wakeup_swapper) + kick_proc0(); +} + static void kdb_switch(void) { Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/kern/subr_sleepqueue.c Thu Jun 20 01:15:33 2019 (r349220) @@ -123,7 +123,7 @@ CTASSERT(powerof2(SC_TABLESIZE)); * c - sleep queue chain lock */ struct sleepqueue { - TAILQ_HEAD(, thread) sq_blocked[NR_SLEEPQS]; /* (c) Blocked threads. */ + struct threadqueue sq_blocked[NR_SLEEPQS]; /* (c) Blocked threads. */ u_int sq_blockedcnt[NR_SLEEPQS]; /* (c) N. of blocked threads. */ LIST_ENTRY(sleepqueue) sq_hash; /* (c) Chain and free list. */ LIST_HEAD(, sleepqueue) sq_free; /* (c) Free queues. */ @@ -889,12 +889,14 @@ sleepq_init(void *mem, int size, int flags) } /* - * Find the highest priority thread sleeping on a wait channel and resume it. + * Find thread sleeping on a wait channel and resume it. */ int sleepq_signal(void *wchan, int flags, int pri, int queue) { + struct sleepqueue_chain *sc; struct sleepqueue *sq; + struct threadqueue *head; struct thread *td, *besttd; int wakeup_swapper; @@ -907,16 +909,33 @@ sleepq_signal(void *wchan, int flags, int pri, int que KASSERT(sq->sq_type == (flags & SLEEPQ_TYPE), ("%s: mismatch between sleep/wakeup and cv_*", __func__)); - /* - * Find the highest priority thread on the queue. If there is a - * tie, use the thread that first appears in the queue as it has - * been sleeping the longest since threads are always added to - * the tail of sleep queues. - */ - besttd = TAILQ_FIRST(&sq->sq_blocked[queue]); - TAILQ_FOREACH(td, &sq->sq_blocked[queue], td_slpq) { - if (td->td_priority < besttd->td_priority) + head = &sq->sq_blocked[queue]; + if (flags & SLEEPQ_UNFAIR) { + /* + * Find the most recently sleeping thread, but try to + * skip threads still in process of context switch to + * avoid spinning on the thread lock. + */ + sc = SC_LOOKUP(wchan); + besttd = TAILQ_LAST_FAST(head, thread, td_slpq); + while (besttd->td_lock != &sc->sc_lock) { + td = TAILQ_PREV_FAST(besttd, head, thread, td_slpq); + if (td == NULL) + break; besttd = td; + } + } else { + /* + * Find the highest priority thread on the queue. If there + * is a tie, use the thread that first appears in the queue + * as it has been sleeping the longest since threads are + * always added to the tail of sleep queues. + */ + besttd = td = TAILQ_FIRST(head); + while ((td = TAILQ_NEXT(td, td_slpq)) != NULL) { + if (td->td_priority < besttd->td_priority) + besttd = td; + } } MPASS(besttd != NULL); thread_lock(besttd); Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/kern/subr_taskqueue.c Thu Jun 20 01:15:33 2019 (r349220) @@ -804,7 +804,7 @@ taskqueue_thread_enqueue(void *context) tqp = context; tq = *tqp; - wakeup_one(tq); + wakeup_any(tq); } TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL, Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/sys/queue.h Thu Jun 20 01:15:33 2019 (r349220) @@ -829,6 +829,10 @@ struct { \ #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) +#define TAILQ_PREV_FAST(elm, head, type, field) \ + ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL : \ + __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next)) + #define TAILQ_REMOVE(head, elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/sys/sleepqueue.h Thu Jun 20 01:15:33 2019 (r349220) @@ -84,6 +84,7 @@ struct thread; #define SLEEPQ_SX 0x03 /* Used by an sx lock. */ #define SLEEPQ_LK 0x04 /* Used by a lockmgr. */ #define SLEEPQ_INTERRUPTIBLE 0x100 /* Sleep is interruptible. */ +#define SLEEPQ_UNFAIR 0x200 /* Unfair wakeup order. */ void init_sleepqueues(void); int sleepq_abort(struct thread *td, int intrval); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Jun 20 00:23:51 2019 (r349219) +++ head/sys/sys/systm.h Thu Jun 20 01:15:33 2019 (r349220) @@ -489,6 +489,7 @@ int pause_sbt(const char *wmesg, sbintime_t sbt, sbint _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags)) void wakeup(void * chan); void wakeup_one(void * chan); +void wakeup_any(void * chan); /* * Common `struct cdev *' stuff are declared here to avoid #include poisoning From owner-svn-src-head@freebsd.org Thu Jun 20 02:06:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 958F015D09BC; Thu, 20 Jun 2019 02:06:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (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 640138C9C0; Thu, 20 Jun 2019 02:06:27 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f67.google.com with SMTP id y198so1182489lfa.1; Wed, 19 Jun 2019 19:06:27 -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=YtHJy+/mpKzzsjTU/qJOvRH6rk+xFPykHezowXt5+l8=; b=cm9ncuD4pci1azcGOL3ktPRvHbZam1Z/T3Ai9Pk7y4t2AEafxSfSNVXU54QKcrU1eJ Ze43OrK0h/4xA46tNSsPN5pJvnNE3HECse4OmPxQqO+Y3aDESBleABpn+GQ2YVce7vIE yyBGh1ZB8GgmKu3M0/x25/Zrs72duJFivImJYxduZOBXOmau2t1eFoCQlDhqLmU2ehqe eFQ+kxaxOjcyfXc1Pj2db0weEHlwmQyISAY8pYuNh3USUXobsCAqjC5Q5KqnDl6UcQAL w1yiSA7mYv9DEAzsR+jhTGj4ECEhU6SA6rqXrtq08gKm9gRU1VtmTmoCSCZ1i5U27iqT 1o2w== X-Gm-Message-State: APjAAAVy0djYEyn2o5Lyf6wQMkPFOq0E48H1C7P2eInqObEWORiuR03T mNjSBR4tbMSxHK6RyeOSt4uI8K4tpHuThrDof660yT0W X-Google-Smtp-Source: APXvYqx8Eb4htL5wIovPsty0hh+/RCgWxTqQWXjKbXr60PrN4Yo+RiSBBAImG8uXq3Q17VyAmmYu3XZFvBGp0o5ktrI= X-Received: by 2002:ac2:5324:: with SMTP id f4mr23057562lfh.156.1560996384953; Wed, 19 Jun 2019 19:06:24 -0700 (PDT) MIME-Version: 1.0 References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> In-Reply-To: From: Alan Somers Date: Wed, 19 Jun 2019 20:06:13 -0600 Message-ID: Subject: Re: svn commit: r348737 - head/sys/kern To: John Baldwin Cc: Ian Lepore , "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 640138C9C0 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.67 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; 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]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.16)[ipnet: 209.85.128.0/17(-3.43), asn: 15169(-2.31), country: US(-0.06)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.71)[-0.710,0]; RCVD_IN_DNSWL_NONE(0.00)[67.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[67.167.85.209.rep.mailspike.net : 127.0.0.17]; 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)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 02:06:28 -0000 On Thu, Jun 6, 2019 at 2:02 PM John Baldwin wrote: > > On 6/6/19 11:21 AM, Ian Lepore wrote: > > On Thu, 2019-06-06 at 12:04 -0600, Alan Somers wrote: > >> On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: > >>> > >>> On 6/6/19 10:39 AM, Alan Somers wrote: > >>>> On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes > >>>> wrote: > >>>>> > >>>>>> Author: asomers > >>>>>> Date: Thu Jun 6 15:04:50 2019 > >>>>>> New Revision: 348737 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/348737 > >>>>>> > >>>>>> Log: > >>>>>> Add a testing facility to manually reclaim a vnode > >>>>>> > >>>>>> Add the debug.try_reclaim_vnode sysctl. When a pathname is > >>>>>> written to it, it > >>>>>> will be reclaimed, as long as it isn't already or doomed. > >>>>>> The purpose is to > >>>>>> gain test coverage for vnode reclamation, which is > >>>>>> otherwise hard to > >>>>>> achieve. > >>>>>> > >>>>>> Add the debug.ftry_reclaim_vnode sysctl. It does the same > >>>>>> thing, except > >>>>>> that its argument is a file descriptor instead of a > >>>>>> pathname. > >>>>> > >>>>> Should not this all be wrapped in some #ifdef or other > >>>>> protection, > >>>>> is it really a good idea to have this on every single box > >>>>> running > >>>>> FreeBSD? > >>>> > >>>> I initially thought so too, but kib thought that it could be > >>>> useful > >>>> for debugging problems in the field. The potential downside is > >>>> limited, because only root can write to the sysctls, and the > >>>> worse-case damage is similar to a "umount -f". > >>> > >>> A compromise might be to stick this in a kernel module instead of > >>> in the > >>> base kernel. You could still kldload it in the field for debugging > >>> but > >>> not necessarily have it directly available out of the box. > >>> > >>> -- > >>> John Baldwin > >> > >> If we already had such a module, it would make sense to put these > >> sysctls in there. But I don't want to create an entire module for > >> just a few dozen LOC. Nor do I want to mediate a bike shed. So > >> let's > >> vote. kib already registered a vote for making them available all of > >> the time. rgrimes voted to guard them by INVARIANTS. Anybody else > >> who cares can reply to this thread. I'll count the votes in 24 > >> hours. > >> -Alan > >> > > > > If our new policy is to remove sysctls that aren't used often "because > > something bad might happen" (without any requirement for the complainer > > to elaborate on just what might happen or why it's so much worse than > > the damage a root user could do with any other sysctl), I think several > > people could be employed full time doing that removal work. Or we > > could all just get on with doing some real work. > > What I find a bit different about this case is when it's a debugging > knob. For that sort of thing, kernel modules are a pretty decent way > to inject new functionality into the system that is rarely needed. A > while back I had a problem with resume on a laptop seemingly not > unsticking all of the processes that had been paused via stop_all and had > a hacky kernel module with a magic sysctl that would try to unstick things. > That worked better as a module that I only loaded if needed. Similar for > a hacky kernel module at a previous job (killsmi.ko) that would write to > the appropriate ICH register to disable all SMIs when loaded, etc. > > -- > John Baldwin It's been two weeks, and the vote tally is: * Unconditional: 3 * Module: 2 * Don't care/Get on with bigger problems: 2 Unconditional wins the vote. Though if rgrimes goes to the trouble of writing the module, I'll review it. -Alan From owner-svn-src-head@freebsd.org Thu Jun 20 07:17:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFCD15D5E19; Thu, 20 Jun 2019 07:17:17 +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 3D3766E7CF; Thu, 20 Jun 2019 07:17:17 +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 1772E89F4; Thu, 20 Jun 2019 07:17:17 +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 x5K7HGv9090706; Thu, 20 Jun 2019 07:17:16 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K7HGaM090704; Thu, 20 Jun 2019 07:17:16 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201906200717.x5K7HGaM090704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 20 Jun 2019 07:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349225 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 349225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D3766E7CF 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 07:17:17 -0000 Author: lwhsu Date: Thu Jun 20 07:17:16 2019 New Revision: 349225 URL: https://svnweb.freebsd.org/changeset/base/349225 Log: Finsh readding Big5 in r317204, which was reverting r315568. This commit reverts r315569. Reported by: Ting-Wei Lan Discussed with: kevlo MFC after: 3 days Sponsored by: The FreeBSD Foundation Added: head/share/timedef/zh_TW.Big5.src - copied unchanged from r315568, head/share/timedef/zh_TW.Big5.src Modified: head/share/timedef/Makefile Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Thu Jun 20 06:53:59 2019 (r349224) +++ head/share/timedef/Makefile Thu Jun 20 07:17:16 2019 (r349225) @@ -129,6 +129,7 @@ LOCALES+= zh_CN.GBK LOCALES+= zh_CN.UTF-8 LOCALES+= zh_CN.eucCN LOCALES+= zh_HK.UTF-8 +LOCALES+= zh_TW.Big5 LOCALES+= zh_TW.UTF-8 Copied: head/share/timedef/zh_TW.Big5.src (from r315568, head/share/timedef/zh_TW.Big5.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/timedef/zh_TW.Big5.src Thu Jun 20 07:17:16 2019 (r349225, copy of r315568, head/share/timedef/zh_TW.Big5.src) @@ -0,0 +1,87 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# Short month names +¡@¢°¤ë +¡@¢±¤ë +¡@¢²¤ë +¡@¢³¤ë +¡@¢´¤ë +¡@¢µ¤ë +¡@¢¶¤ë +¡@¢·¤ë +¡@¢¸¤ë +¢°¢¯¤ë +¢°¢°¤ë +¢°¢±¤ë +# +# Long month names (as in a date) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# Short weekday names +¶g¤é +¶g¤@ +¶g¤G +¶g¤T +¶g¥| +¶g¤­ +¶g¤» +# +# Long weekday names +¬P´Á¤é +¬P´Á¤@ +¬P´Á¤G +¬P´Á¤T +¬P´Á¥| +¬P´Á¤­ +¬P´Á¤» +# +# X_fmt +%H®É%M¤À%S¬í +# +# x_fmt +%Y/%m/%d +# +# c_fmt +%a %b/%e %T %Y +# +# AM/PM +¤W¤È +¤U¤È +# +# date_fmt +%Y¦~%_m¤ë%e¤é %A %X %Z +# +# Long month names (without case ending) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# md_order +md +# +# ampm_fmt +%I:%M:%S %p +# EOF From owner-svn-src-head@freebsd.org Thu Jun 20 12:38:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 881B615B9B3B; Thu, 20 Jun 2019 12:38:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2911677CED; Thu, 20 Jun 2019 12:38:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B4DC117; Thu, 20 Jun 2019 12:38:41 +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 x5KCcfAA058480; Thu, 20 Jun 2019 12:38:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KCcfjl058479; Thu, 20 Jun 2019 12:38:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201906201238.x5KCcfjl058479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 20 Jun 2019 12:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349228 - head/contrib/traceroute X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/contrib/traceroute X-SVN-Commit-Revision: 349228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2911677CED 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.996,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 12:38:42 -0000 Author: tuexen Date: Thu Jun 20 12:38:41 2019 New Revision: 349228 URL: https://svnweb.freebsd.org/changeset/base/349228 Log: The variable names in the description of the port number usage is inconsistent. This patch fixes that and improves the precision of the description. Thanks to Tom Marcoen for reporting the issue and providing an initial patch, on which this change is based. PR: 237723 Reviewed by: bcr@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20708 Modified: head/contrib/traceroute/traceroute.8 Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Thu Jun 20 09:23:03 2019 (r349227) +++ head/contrib/traceroute/traceroute.8 Thu Jun 20 12:38:41 2019 (r349228) @@ -16,7 +16,7 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.Dd May 31, 2015 +.Dd June 20, 2019 .Dt TRACEROUTE 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Op Fl m Ar max_ttl .Op Fl P Ar proto .Op Fl p Ar port -.Op Fl q Ar nqueries +.Op Fl q Ar nprobes .Op Fl s Ar src_addr .Op Fl t Ar tos .Op Fl w Ar waittime @@ -125,14 +125,14 @@ Traceroute hopes that nothing is listening on UDP port if used by .Nm and supported by the peer) -.Em base + 1 +.Em port + 1 to -.Em base + nhops * nprobes +.Em port + (max_ttl - first_ttl + 1) * nprobes at the destination host (so an ICMP PORT_UNREACHABLE message will be returned to terminate the route tracing). If something is listening on a port in the default range, this option can be used to pick an unused port range. -.It Fl q Ar nqueries +.It Fl q Ar nprobes Set the number of probes per hop (default is 3, unless .Fl D From owner-svn-src-head@freebsd.org Thu Jun 20 13:24:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5766B15BB976; Thu, 20 Jun 2019 13:24:59 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F212B81363; Thu, 20 Jun 2019 13:24:58 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D540EC986; Thu, 20 Jun 2019 13:24:58 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KDOwl8084741; Thu, 20 Jun 2019 13:24:58 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KDOwrW084740; Thu, 20 Jun 2019 13:24:58 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201906201324.x5KDOwrW084740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Thu, 20 Jun 2019 13:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349229 - head X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 349229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F212B81363 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 13:24:59 -0000 Author: antoine Date: Thu Jun 20 13:24:58 2019 New Revision: 349229 URL: https://svnweb.freebsd.org/changeset/base/349229 Log: Add head(1) to native-xtools so that it can be used in qemu-user jails Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 20 12:38:41 2019 (r349228) +++ head/Makefile.inc1 Thu Jun 20 13:24:58 2019 (r349229) @@ -2553,6 +2553,7 @@ NXBDIRS+= \ usr.bin/find \ usr.bin/grep \ usr.bin/gzip \ + usr.bin/head \ usr.bin/id \ usr.bin/lex \ usr.bin/limits \ From owner-svn-src-head@freebsd.org Thu Jun 20 13:59:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB4F615BC807; Thu, 20 Jun 2019 13:59:47 +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 615D982738; Thu, 20 Jun 2019 13:59:47 +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 37CD7CE99; Thu, 20 Jun 2019 13:59:47 +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 x5KDxlOA000857; Thu, 20 Jun 2019 13:59:47 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KDxkJ1000855; Thu, 20 Jun 2019 13:59:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906201359.x5KDxkJ1000855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 13:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349230 - in head: share/man/man9 sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: share/man/man9 sys/kern X-SVN-Commit-Revision: 349230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 615D982738 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.939,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 13:59:48 -0000 Author: asomers Date: Thu Jun 20 13:59:46 2019 New Revision: 349230 URL: https://svnweb.freebsd.org/changeset/base/349230 Log: Add a VOP_BMAP(9) man page Reviewed by: mckusick MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20704 Added: head/share/man/man9/VOP_BMAP.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/kern/vfs_default.c Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jun 20 13:24:58 2019 (r349229) +++ head/share/man/man9/Makefile Thu Jun 20 13:59:46 2019 (r349230) @@ -399,6 +399,7 @@ MAN= accept_filter.9 \ VOP_ADVLOCK.9 \ VOP_ALLOCATE.9 \ VOP_ATTRIB.9 \ + VOP_BMAP.9 \ VOP_BWRITE.9 \ VOP_CREATE.9 \ VOP_FSYNC.9 \ Added: head/share/man/man9/VOP_BMAP.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_BMAP.9 Thu Jun 20 13:59:46 2019 (r349230) @@ -0,0 +1,86 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2019 The FreeBSD Foundation +.\" +.\" This software was developed by BFF Storage Systems, LLC 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 June 19, 2019 +.Dt VOP_BMAP 9 +.Os +.Sh NAME +.Nm VOP_BMAP +.Nd Logical to physical block number conversion +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct bufobj **bop" "daddr_t *bnp" "int *runp" "int *runb" +.Sh DESCRIPTION +This vnode call is used to lookup the physical block number of the file system's +underlying device where a given logical block of a file is stored. +Its arguments are: +.Bl -tag -width type +.It Fa vp +The vnode of the file. +.It Fa bn +Logical block number within the file identified by +.Fa vp . +.It Fa bop +Return storage for the buffer object associated with the file system's +underlying device. +.It Fa bnp +Return storage for the physical block number. +.It Fa runp +Return storage for the number of succeeding logical blocks that may be +efficiently read at the same time as the requested block. +This will usually be the number of logical blocks whose physical blocks are +contiguously allocated. +However a file system is free to define "efficient" as it see fit. +.It Fa runb +Like +.Fa runp +but for preceding rather than succeeding blocks. +.El +.Pp +Any of the return arguments may be +.Dv NULL +to indicate that the caller does not care about that information. +.Sh LOCKS +The vnode will be locked on entry and should remain locked on return. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh SEE ALSO +.Xr vnode 9 , +.Sh HISTORY +A +.Fn bmap +function first appeared in +.Bx 4.2 . +.Sh AUTHORS +This manual page was written by +.An Alan Somers . Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Jun 20 13:24:58 2019 (r349229) +++ head/sys/kern/vfs_default.c Thu Jun 20 13:59:46 2019 (r349230) @@ -603,7 +603,13 @@ vop_stdgetwritemount(ap) return (0); } -/* XXX Needs good comment and VOP_BMAP(9) manpage */ +/* + * If the file system doesn't implement VOP_BMAP, then return sensible defaults: + * - Return the vnode's bufobj instead of any underlying device's bufobj + * - Calculate the physical block number as if there were equal size + * consecutive blocks, but + * - Report no contiguous runs of blocks. + */ int vop_stdbmap(ap) struct vop_bmap_args /* { From owner-svn-src-head@freebsd.org Thu Jun 20 14:13:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E87615BCF7C; Thu, 20 Jun 2019 14:13:12 +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 C85C18329A; Thu, 20 Jun 2019 14:13:11 +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 976F9D1EA; Thu, 20 Jun 2019 14:13:11 +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 x5KEDBB0010925; Thu, 20 Jun 2019 14:13:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KEDB5u010923; Thu, 20 Jun 2019 14:13:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906201413.x5KEDB5u010923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 14:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349231 - in head/sys: kern sys ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys: kern sys ufs/ufs X-SVN-Commit-Revision: 349231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C85C18329A 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.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 14:13:12 -0000 Author: asomers Date: Thu Jun 20 14:13:10 2019 New Revision: 349231 URL: https://svnweb.freebsd.org/changeset/base/349231 Log: Add FIOBMAP2 ioctl This ioctl exposes VOP_BMAP information to userland. It can be used by programs like fragmentation analyzers and optimized cp implementations. But I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block number instead of 32-bit, and it also returns runp and runb. Reviewed by: mckusick MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20705 Modified: head/sys/kern/vfs_vnops.c head/sys/sys/filio.h head/sys/ufs/ufs/ufs_bmap.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 20 13:59:46 2019 (r349230) +++ head/sys/kern/vfs_vnops.c Thu Jun 20 14:13:10 2019 (r349231) @@ -1458,6 +1458,25 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucre return (0); } +/* generic FIOBMAP2 implementation */ +static int +vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) +{ + struct vnode *vp = fp->f_vnode; + daddr_t lbn = arg->bn; + int error; + + vn_lock(vp, LK_SHARED | LK_RETRY); +#ifdef MAC + error = mac_vnode_check_read(cred, fp->f_cred, vp); + if (error == 0) +#endif + error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, + &arg->runb); + VOP_UNLOCK(vp, 0); + return (error); +} + /* * File table vnode ioctl routine. */ @@ -1481,6 +1500,9 @@ vn_ioctl(struct file *fp, u_long com, void *data, stru if (error == 0) *(int *)data = vattr.va_size - fp->f_offset; return (error); + case FIOBMAP2: + return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, + active_cred)); case FIONBIO: case FIOASYNC: return (0); Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Thu Jun 20 13:59:46 2019 (r349230) +++ head/sys/sys/filio.h Thu Jun 20 14:13:10 2019 (r349231) @@ -62,6 +62,13 @@ struct fiodgname_arg { /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ +struct fiobmap2_arg { + int64_t bn; + int runp; + int runb; +}; +/* Get the file's bmap info for the logical block bn */ +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/ufs/ufs/ufs_bmap.c ============================================================================== --- head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 13:59:46 2019 (r349230) +++ head/sys/ufs/ufs/ufs_bmap.c Thu Jun 20 14:13:10 2019 (r349231) @@ -200,12 +200,15 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) *bnp = blkptrtodb(ump, ip->i_din2->di_extb[-1 - bn]); if (*bnp == 0) *bnp = -1; - if (nbp == NULL) - panic("ufs_bmaparray: mapping ext data"); + if (nbp == NULL) { + /* indirect block not found */ + return (EINVAL); + } nbp->b_xflags |= BX_ALTDATA; return (0); } else { - panic("ufs_bmaparray: blkno out of range"); + /* blkno out of range */ + return (EINVAL); } /* * Since this is FFS independent code, we are out of From owner-svn-src-head@freebsd.org Thu Jun 20 14:35:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FE215BD841; Thu, 20 Jun 2019 14:35:29 +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 6DA6D83F95; Thu, 20 Jun 2019 14:35:29 +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 49288D572; Thu, 20 Jun 2019 14:35:29 +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 x5KEZTSq021514; Thu, 20 Jun 2019 14:35:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KEZTqH021513; Thu, 20 Jun 2019 14:35:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906201435.x5KEZTqH021513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 14:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349233 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DA6D83F95 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.936,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 14:35:29 -0000 Author: asomers Date: Thu Jun 20 14:35:28 2019 New Revision: 349233 URL: https://svnweb.freebsd.org/changeset/base/349233 Log: #include from sys/filio.h This fixes world build after r349231 Reported by: Jenkins MFC after: 2 weeks MFC-With: 349231 Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/filio.h Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Thu Jun 20 14:34:45 2019 (r349232) +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 2019 (r349233) @@ -40,6 +40,7 @@ #ifndef _SYS_FILIO_H_ #define _SYS_FILIO_H_ +#include #include /* Generic file-descriptor ioctl's. */ From owner-svn-src-head@freebsd.org Thu Jun 20 14:38:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C2915BDB7F; Thu, 20 Jun 2019 14:38:24 +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 45BBE8434F; Thu, 20 Jun 2019 14:38: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 x5KEcMTx023503; Thu, 20 Jun 2019 07:38: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 x5KEcMsY023502; Thu, 20 Jun 2019 07:38:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906201438.x5KEcMsY023502@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349230 - in head: share/man/man9 sys/kern In-Reply-To: <201906201359.x5KDxkJ1000855@repo.freebsd.org> To: Alan Somers Date: Thu, 20 Jun 2019 07:38:22 -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: 45BBE8434F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 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.96)[-0.964,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 14:38:25 -0000 > Author: asomers > Date: Thu Jun 20 13:59:46 2019 > New Revision: 349230 > URL: https://svnweb.freebsd.org/changeset/base/349230 > > Log: > Add a VOP_BMAP(9) man page > > Reviewed by: mckusick > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D20704 > > Added: > head/share/man/man9/VOP_BMAP.9 (contents, props changed) > Modified: > head/share/man/man9/Makefile > head/sys/kern/vfs_default.c > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Thu Jun 20 13:24:58 2019 (r349229) > +++ head/share/man/man9/Makefile Thu Jun 20 13:59:46 2019 (r349230) > @@ -399,6 +399,7 @@ MAN= accept_filter.9 \ > VOP_ADVLOCK.9 \ > VOP_ALLOCATE.9 \ > VOP_ATTRIB.9 \ > + VOP_BMAP.9 \ > VOP_BWRITE.9 \ > VOP_CREATE.9 \ > VOP_FSYNC.9 \ > > Added: head/share/man/man9/VOP_BMAP.9 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man9/VOP_BMAP.9 Thu Jun 20 13:59:46 2019 (r349230) > @@ -0,0 +1,86 @@ > +.\"- > +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD > +.\" > +.\" Copyright (c) 2019 The FreeBSD Foundation > +.\" > +.\" This software was developed by BFF Storage Systems, LLC 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 Looks like a line join happened here. > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jun 20 14:40:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804A915BDC8B; Thu, 20 Jun 2019 14:40:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22D2A8450F; Thu, 20 Jun 2019 14:40:37 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3672D592; Thu, 20 Jun 2019 14:40:36 +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 x5KEea8a021823; Thu, 20 Jun 2019 14:40:36 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KEeaX1021822; Thu, 20 Jun 2019 14:40:36 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906201440.x5KEeaX1021822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 14:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349234 - 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: 349234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22D2A8450F 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 14:40:37 -0000 Author: asomers Date: Thu Jun 20 14:40:36 2019 New Revision: 349234 URL: https://svnweb.freebsd.org/changeset/base/349234 Log: VOP_BMAP(9): fix typo in the copyright header Reported by: rgrimes MFC after: 2 weeks MFC-With: 349230 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/VOP_BMAP.9 Modified: head/share/man/man9/VOP_BMAP.9 ============================================================================== --- head/share/man/man9/VOP_BMAP.9 Thu Jun 20 14:35:28 2019 (r349233) +++ head/share/man/man9/VOP_BMAP.9 Thu Jun 20 14:40:36 2019 (r349234) @@ -11,7 +11,7 @@ .\" 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 +.\" 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. .\" From owner-svn-src-head@freebsd.org Thu Jun 20 15:14:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A44615BEB7D for ; Thu, 20 Jun 2019 15:14:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 6E845857B3 for ; Thu, 20 Jun 2019 15:14:01 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1561043637; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=gv+fiebKEuO8F/pX1kC296hOLSNJ22YrF49ZMni48a757+mx7Pa9qszDyd+3nX2hyex37M5tTVCmj DqB060l+5U49qP8v7qg9RgEDAbDUWv1BzWTU9NGj+X5v2aYN0JWeITiZYhte5q4oZS5Viijx9eT9HD kS8cAGuQvKbn13GqeZeMd596zo0fHyVBIx/GtPyiFFnP2auiyQy7m2RXZZSB3ocMxiAKTyunWxGmyC bdEBJBD0CY2+X8/FMDkPXS0Tt1r/t9d7gV0xi0dJguCA/2EQnu4vnsPuBXRRVk1vSfrZFBXgEbwi4Y XNd8yJNHClXFoGcstIYT0Ykroi45d/Q== 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=EkGHYOWkrZ/tH/Q1s8zxh+mEMrI7CC5EjUOheh5ixss=; b=PFKoV/iKlj9yN76YpISJgBKG76KUtP0whZIr6Rxz0/4iyfiOjg5b4tGeZTzBmCknhEzFMFQ1OdGM9 SL9aP6NacB9W6sw3JC3Wq7nqV4MJhJWoEjQsavjjMQzmOF3IFZtHUz3QoINs2HmzUN0F9DWKplMZlk nMAK0LFqL7j8W4mk6ungmHGFlU7IlmmQmoTNh4siwWt0Hi40V/c8RnDSt6sNr7T+WDY7zzytFr/OA9 +RdQ9syJW1oOKJ0NrnPv9/NNk8E7DNxB2gXDtmnoXxY77LCtXq9SipiZrMlYDlQGvcEzXbUO3SOv39 CsN7VOEOXSP1an0dB7QjBtMPvYinA3Q== 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:to:from:subject:message-id:from; bh=EkGHYOWkrZ/tH/Q1s8zxh+mEMrI7CC5EjUOheh5ixss=; b=HiTYjERDdlZ5TBBER/iCOGYFrRZW+6b1HlfAjSEDwieq0t2/qk3c4e/8t4sSObYtqGI/qxn2VmRyU UoSuvz7Ob+OiBaXFw+tKlyIKQp1RJFsoX6LUFk1oxrBh06CZBQbwvCuVyywylmcIGW8thfKaCMYrVs Xoz5pvEKAcin7+Z5/9KaNKbILzBfozPM0z9bKPPp71VBI3hUxTuKSsqJeF+PvekC8GZwN6pDBLkd8V yRspOPRqoHb8Bgs8XvSxCpBrTV87rGnC/YnyLTocUHAI1rqMspCCcFfqgoWyT1nUWK/PXeaiA568t/ kbucfSqbmiQMvALq8Vi11V3ujw9VMBw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 03ddf159-936e-11e9-b1d6-935efd94926c 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 03ddf159-936e-11e9-b1d6-935efd94926c; Thu, 20 Jun 2019 15:13:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x5KFDqfG026447; Thu, 20 Jun 2019 09:13:52 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> Subject: Re: svn commit: r349233 - head/sys/sys From: Ian Lepore To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 20 Jun 2019 09:13:52 -0600 In-Reply-To: <201906201435.x5KEZTqH021513@repo.freebsd.org> References: <201906201435.x5KEZTqH021513@repo.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: 6E845857B3 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.995,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 15:14:02 -0000 On Thu, 2019-06-20 at 14:35 +0000, Alan Somers wrote: > Author: asomers > Date: Thu Jun 20 14:35:28 2019 > New Revision: 349233 > URL: https://svnweb.freebsd.org/changeset/base/349233 > > Log: > #include from sys/filio.h > > This fixes world build after r349231 > > Reported by: Jenkins > MFC after: 2 weeks > MFC-With: 349231 > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/sys/filio.h > > Modified: head/sys/sys/filio.h > ===================================================================== > ========= > --- head/sys/sys/filio.h Thu Jun 20 14:34:45 2019 (r349232) > +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 2019 (r349233) > @@ -40,6 +40,7 @@ > #ifndef _SYS_FILIO_H_ > #define _SYS_FILIO_H_ > > +#include > #include > > /* Generic file-descriptor ioctl's. */ > I wonder... is this one of those situations where it is better to use __int64_t in the struct, then #include ? I think the net effect there would be less pollution with other types? I've never seen written guidance about when to use the __names and _types.h, but I've always had the general impression that if you have to include a header from another system header, it's better to use the _header.h if it exists. -- Ian From owner-svn-src-head@freebsd.org Thu Jun 20 15:29:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9C5B15BF0FE; Thu, 20 Jun 2019 15:29:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 76D74860D1; Thu, 20 Jun 2019 15:29:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id 16so3085137ljv.10; Thu, 20 Jun 2019 08:29:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y3EIUnoLo62+axnRclDonxUQ0B/VAx0rVNKzSxlwJs4=; b=ugmZRbaKIND3oppzz1aEpN4c6gpOhXNIMwdYhSSl7fBu+Jbmh+yG+UYcbRWcP8HWeS 1Tb9TG31kDcC4U6tkzS4GH0/c/Xpgb0RB2RuH8OoaSJSkoIL7xc8VLNyr9TnC2nqsDhW tsdGqpw2yTrWDQncjIoQr1LLip1Y/oyk4yGIUjjw1A9d6Lk/wRAa+kUeoyViksskWAz7 7eSLQ7cX5d/wwE/iF/CvS4NPV7jSGPPCH1h08R7nw/ubuGt9kmNPorinb7Wbd+HudGTD cKUcjg0/rfr+vISgCxnRnW5XthyUq9hPjZq0q/g9ap7XXZtc8KIWDjZlv8nPxAsYFVgE VFkA== X-Gm-Message-State: APjAAAXLT7PS2pGpwA8EwR2aY2XIb5jiglWsZVP4utCkpOcFHsKYXbS+ 9coDxfJLiBnaEBLOSXpwpjQD2nwjQ7czhbJfANV9pu2v X-Google-Smtp-Source: APXvYqzS3BidN4g1Ky9f74q2yh/Ig0NggF50d8QaKQSFGpTDDhMymxRLWCKxQDjlyrUnkEDdGuT15ZEzzaGHdmJE6g0= X-Received: by 2002:a2e:9dc1:: with SMTP id x1mr5209636ljj.0.1561044553704; Thu, 20 Jun 2019 08:29:13 -0700 (PDT) MIME-Version: 1.0 References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> In-Reply-To: <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> From: Alan Somers Date: Thu, 20 Jun 2019 09:29:01 -0600 Message-ID: Subject: Re: svn commit: r349233 - head/sys/sys To: Ian Lepore Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 76D74860D1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 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.97)[-0.973,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 15:29:22 -0000 On Thu, Jun 20, 2019 at 9:14 AM Ian Lepore wrote: > > On Thu, 2019-06-20 at 14:35 +0000, Alan Somers wrote: > > Author: asomers > > Date: Thu Jun 20 14:35:28 2019 > > New Revision: 349233 > > URL: https://svnweb.freebsd.org/changeset/base/349233 > > > > Log: > > #include from sys/filio.h > > > > This fixes world build after r349231 > > > > Reported by: Jenkins > > MFC after: 2 weeks > > MFC-With: 349231 > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/sys/filio.h > > > > Modified: head/sys/sys/filio.h > > ===================================================================== > > ========= > > --- head/sys/sys/filio.h Thu Jun 20 14:34:45 2019 (r349232) > > +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 2019 (r349233) > > @@ -40,6 +40,7 @@ > > #ifndef _SYS_FILIO_H_ > > #define _SYS_FILIO_H_ > > > > +#include > > #include > > > > /* Generic file-descriptor ioctl's. */ > > > > I wonder... is this one of those situations where it is better to use > __int64_t in the struct, then #include ? I think the net > effect there would be less pollution with other types? I've never seen > written guidance about when to use the __names and _types.h, but I've > always had the general impression that if you have to include a header > from another system header, it's better to use the _header.h if it > exists. > > -- Ian Good question. grep shows almost equal numbers of each (37 types.h and 33 _types.h) in sys/sys. Do you think I should change it? -Alan From owner-svn-src-head@freebsd.org Thu Jun 20 15:35:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D20D515BF45D for ; Thu, 20 Jun 2019 15:35:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 4FF3686641 for ; Thu, 20 Jun 2019 15:35:22 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1561044919; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=dggJXCfMssWIeuUoDFuSGzfniRmCb3LZqNEWhlrXKzZeqoDHX3vH+ICSr9KnEVIdpKX0IczwwLsbt Ihd4GWkLjSAYC/QBlAGHbMdp2w6ESDzLwP8cKNGIs4swSy+voHyTfeNabS/G6Ck9LFu9Jw3t5bBOk7 18hjk5gkmtWgWFml34ywYc5YA8hDKaTY6RYzzgod93K/SyUG5cly8eAQHDuy+utfHK/08DR0sX+z+s PHCPbOLNSoWwUfkd+gqdTnO4Yh0ooMPFFY6GwtU6cqAuJxnKOaRcKMS3BZPlagJAIno6MYsJj5YCKd 66A54+Z3IwAhmGncWKriUp8KDv+haxw== 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=EQGjIpPxTYanXDtCt0Dp1r9AcrTOnh0x4QgIYgGw2VQ=; b=oa/mOW8IudFNOoERvQz9hxBtHTPd4uu/E8yIjMhDTUd9RHNVrA3G1ZAaiwHxffIuFhKIbFdF00YFS Na3whkg3MY/MRibqyE3jkXVVw94jvUBj46uMY+2TXf4FkQPGDL52hubkOeyamiZtcMg0HNgRA0MS+a +NI4TBbMtxe+zdIXEoCaP8+yM838YWX7Mf9/Pwl11Ks/z+sfc2055LtMwp1OUhdkU7bDJ+w5hC/Jb3 Q6szS2ZOm6UkvINoiqQTkKexObOgzNDoEJvMWoh2aMsK9T3oATnYN6sg9dWSKRMBlEyIxmIU81TGcr BEaqzJjEAySGSDF6zfDjc+CuNz0krRA== 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=EQGjIpPxTYanXDtCt0Dp1r9AcrTOnh0x4QgIYgGw2VQ=; b=e3aNeTFRHVq+vPmtp1cQm1nbEDwlb2V8SUig0/bE1rR94Tf/7ohLqOeMcj7sm2E3cWSqw/QHgKJKC z6FAidkqDpXbhfYX2p9fkgn+uY1iAif5+NjvjJT4VA6OUFGupxBh1IGK3BUsoWKOwpUrzKLQWs0QzQ 3ceY0+Uy7jYqdo30636HptBXhuzZok9+diHMvhpXj11SFIE4juY1q3/Ue0XWsEemSDYjqenTMfmpBN jZvDBw2PBIvVoppWYrRcXoui2VDWbv7XUSOU3I1swVT4AHrLI15fBHSTt0Uo0ami91PmjTe/MWiPCc 1+r30rv1xuZQs2+vUYIEUGxaHKtVwMg== X-MHO-RoutePath: aGlwcGll X-MHO-User: ffe873e7-9370-11e9-b1d6-935efd94926c 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 ffe873e7-9370-11e9-b1d6-935efd94926c; Thu, 20 Jun 2019 15:35:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x5KFZElv026517; Thu, 20 Jun 2019 09:35:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <155b84aec0183344d43b62be816ebf858a6b0e76.camel@freebsd.org> Subject: Re: svn commit: r349233 - head/sys/sys From: Ian Lepore To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Date: Thu, 20 Jun 2019 09:35:14 -0600 In-Reply-To: References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@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: 4FF3686641 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(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 15:35:23 -0000 On Thu, 2019-06-20 at 09:29 -0600, Alan Somers wrote: > On Thu, Jun 20, 2019 at 9:14 AM Ian Lepore wrote: > > > > On Thu, 2019-06-20 at 14:35 +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Thu Jun 20 14:35:28 2019 > > > New Revision: 349233 > > > URL: https://svnweb.freebsd.org/changeset/base/349233 > > > > > > Log: > > > #include from sys/filio.h > > > > > > This fixes world build after r349231 > > > > > > Reported by: Jenkins > > > MFC after: 2 weeks > > > MFC-With: 349231 > > > Sponsored by: The FreeBSD Foundation > > > > > > Modified: > > > head/sys/sys/filio.h > > > > > > Modified: head/sys/sys/filio.h > > > ================================================================= > > > ==== > > > ========= > > > --- head/sys/sys/filio.h Thu Jun 20 14:34:45 > > > 2019 (r349232) > > > +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 > > > 2019 (r349233) > > > @@ -40,6 +40,7 @@ > > > #ifndef _SYS_FILIO_H_ > > > #define _SYS_FILIO_H_ > > > > > > +#include > > > #include > > > > > > /* Generic file-descriptor ioctl's. */ > > > > > > > I wonder... is this one of those situations where it is better to > > use > > __int64_t in the struct, then #include ? I think the > > net > > effect there would be less pollution with other types? I've never > > seen > > written guidance about when to use the __names and _types.h, but > > I've > > always had the general impression that if you have to include a > > header > > from another system header, it's better to use the _header.h if it > > exists. > > > > -- Ian > > Good question. grep shows almost equal numbers of each (37 types.h > and 33 _types.h) in sys/sys. Do you think I should change it? > -Alan > Maybe some other folks will chime in with guidance... I phrased all that as questions hoping that someone who knows this stuff better would englighten us (or point us to docs). -- Ian From owner-svn-src-head@freebsd.org Thu Jun 20 15:44:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C672815BF7B1; Thu, 20 Jun 2019 15:44:44 +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 6D3CD86B20; Thu, 20 Jun 2019 15:44:44 +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 2CA16E154; Thu, 20 Jun 2019 15:44:44 +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 x5KFiigp058067; Thu, 20 Jun 2019 15:44:44 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KFih8J058065; Thu, 20 Jun 2019 15:44:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201906201544.x5KFih8J058065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 20 Jun 2019 15:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349235 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 349235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D3CD86B20 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 15:44:45 -0000 Author: allanjude Date: Thu Jun 20 15:44:43 2019 New Revision: 349235 URL: https://svnweb.freebsd.org/changeset/base/349235 Log: top(1): Don't show the swap line when there are no swap devices Submitted by: antranigv@freebsd.am Reviewed by: bapt MFC after: 1 month Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D18928 Modified: head/usr.bin/top/display.c head/usr.bin/top/machine.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Thu Jun 20 14:40:36 2019 (r349234) +++ head/usr.bin/top/display.c Thu Jun 20 15:44:43 2019 (r349235) @@ -675,6 +675,9 @@ i_swap(int *stats) { swap_buffer = setup_buffer(swap_buffer, 0); + if (swap_names == NULL) + return; + fputs("\nSwap: ", stdout); lastline++; @@ -689,6 +692,9 @@ u_swap(int *stats) static char *new = NULL; new = setup_buffer(new, 0); + + if (swap_names == NULL) + return; /* format the new line */ summary_format(new, stats, swap_names); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Thu Jun 20 14:40:36 2019 (r349234) +++ head/usr.bin/top/machine.c Thu Jun 20 15:44:43 2019 (r349235) @@ -150,6 +150,7 @@ static const char *swapnames[] = { }; static int swap_stats[nitems(swapnames)]; +static int has_swap; /* these are for keeping track of the proc array */ @@ -248,12 +249,12 @@ update_layout(void) y_mem = 3; y_arc = 4; y_carc = 5; - y_swap = 4 + arc_enabled + carc_enabled; - y_idlecursor = 5 + arc_enabled + carc_enabled; - y_message = 5 + arc_enabled + carc_enabled; - y_header = 6 + arc_enabled + carc_enabled; - y_procs = 7 + arc_enabled + carc_enabled; - Header_lines = 7 + arc_enabled + carc_enabled; + y_swap = 3 + arc_enabled + carc_enabled + has_swap; + y_idlecursor = 4 + arc_enabled + carc_enabled + has_swap; + y_message = 4 + arc_enabled + carc_enabled + has_swap; + y_header = 5 + arc_enabled + carc_enabled + has_swap; + y_procs = 6 + arc_enabled + carc_enabled + has_swap; + Header_lines = 6 + arc_enabled + carc_enabled + has_swap; if (pcpu_stats) { y_mem += ncpus - 1; @@ -273,7 +274,7 @@ machine_init(struct statics *statics) { int i, j, empty, pagesize; uint64_t arc_size; - int carc_en; + int carc_en, nswapdev; size_t size; size = sizeof(smpmode); @@ -298,6 +299,11 @@ machine_init(struct statics *statics) if (kd == NULL) return (-1); + size = sizeof(nswapdev); + if (sysctlbyname("vm.nswapdev", &nswapdev, &size, NULL, + 0) == 0 && nswapdev != 0) + has_swap = 1; + GETSYSCTL("kern.ccpu", ccpu); /* this is used in calculating WCPU -- calculate it ahead of time */ @@ -332,7 +338,10 @@ machine_init(struct statics *statics) statics->carc_names = carcnames; else statics->carc_names = NULL; - statics->swap_names = swapnames; + if (has_swap) + statics->swap_names = swapnames; + else + statics->swap_names = NULL; statics->order_names = ordernames; /* Allocate state for per-CPU stats. */ From owner-svn-src-head@freebsd.org Thu Jun 20 16:36:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E7A15C1296; Thu, 20 Jun 2019 16:36:21 +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 EDF6889291; Thu, 20 Jun 2019 16:36:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C95E9C6; Thu, 20 Jun 2019 16:36:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KGaKm9086780; Thu, 20 Jun 2019 16:36:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KGaKRt086779; Thu, 20 Jun 2019 16:36:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906201636.x5KGaKRt086779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 16:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349237 - 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: 349237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDF6889291 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.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 16:36:21 -0000 Author: asomers Date: Thu Jun 20 16:36:20 2019 New Revision: 349237 URL: https://svnweb.freebsd.org/changeset/base/349237 Log: VOP_REVOKE(9): update locking requirements per r143495 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20524 Modified: head/share/man/man9/VOP_REVOKE.9 Modified: head/share/man/man9/VOP_REVOKE.9 ============================================================================== --- head/share/man/man9/VOP_REVOKE.9 Thu Jun 20 15:56:08 2019 (r349236) +++ head/share/man/man9/VOP_REVOKE.9 Thu Jun 20 16:36:20 2019 (r349237) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2002 +.Dd June 20, 2019 .Dt VOP_REVOKE 9 .Os .Sh NAME @@ -61,7 +61,7 @@ to signify that all access will be revoked; any other .Sh LOCKS The .Fa vp -must be unlocked on entry, and will remain unlocked upon return. +must be exclusively locked on entry, and will remain locked upon return. .Sh SEE ALSO .Xr make_dev_alias 9 , .Xr vnode 9 From owner-svn-src-head@freebsd.org Thu Jun 20 16:43:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B372615C1515; Thu, 20 Jun 2019 16:43:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id F37F789731; Thu, 20 Jun 2019 16:43:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id F0C4C43AC21; Fri, 21 Jun 2019 02:43:14 +1000 (AEST) Date: Fri, 21 Jun 2019 02:43:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: Ian Lepore , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349233 - head/sys/sys In-Reply-To: Message-ID: <20190621013236.N5105@besplex.bde.org> References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=ooPoDxd5FOe0qEr_2iIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: F37F789731 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_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 16:43:25 -0000 On Thu, 20 Jun 2019, Alan Somers wrote: > On Thu, Jun 20, 2019 at 9:14 AM Ian Lepore wrote: >> >> On Thu, 2019-06-20 at 14:35 +0000, Alan Somers wrote: >>> Author: asomers >>> Date: Thu Jun 20 14:35:28 2019 >>> New Revision: 349233 >>> URL: https://svnweb.freebsd.org/changeset/base/349233 >>> >>> Log: >>> #include from sys/filio.h >>> >>> This fixes world build after r349231 This increases the bugs in r349231 by adding more undocumented namespace pollution. >>> Modified: head/sys/sys/filio.h >>> ===================================================================== >>> ========= >>> --- head/sys/sys/filio.h Thu Jun 20 14:34:45 2019 (r349232) >>> +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 2019 (r349233) >>> @@ -40,6 +40,7 @@ >>> #ifndef _SYS_FILIO_H_ >>> #define _SYS_FILIO_H_ >>> >>> +#include >>> #include >>> >>> /* Generic file-descriptor ioctl's. */ >> >> I wonder... is this one of those situations where it is better to use >> __int64_t in the struct, then #include ? I think the net >> effect there would be less pollution with other types? I've never seen >> written guidance about when to use the __names and _types.h, but I've >> always had the general impression that if you have to include a header >> from another system header, it's better to use the _header.h if it >> exists. > > Good question. grep shows almost equal numbers of each (37 types.h > and 33 _types.h) in sys/sys. Do you think I should change it? Only low quality headers include . r349231 adds a struct declaration with an int64_t in it. Everything is undocumented of course, so one knows if this header declares all the types needed to use it. If it only declared __int64_t and used that, then users would have to know to use __int64_t or to include a header that declares int64_t in order to use the struct properly (e.g., bounds checking of the __int64_t member requires knowing its type). This is a bit inconvenient. However, since everything is undocumented, users have to read the header to see what is in it anyway, so they can see that it uses __int64_t just as easily as they can see the name of the struct member of that type. Higher quality headers usually declare all the standard types that they use. Some even document the types that they declare. filio.h is not referenced in any man page. It is normally used by including the omnibus header . is documented well enough to require it to declare all the types that it uses. This follows from the SYNOPSIS for ioctl(2) -- since no preqrequisites for are given, it must not depend on other headers. ioctl(2) otherwise documents about 1% of the things needed to use it. No one knows what macros and types defines/declares. However, the headers included by used to be careful about namespace pollution. They didn't do much more than #define lots of macros and used only a few types and mostly only basic types. This has rotted a bit. r349231 added the following bugs: - use of int32_t, and no documentation of this - namespace-polluting struct member names bn, runp and runb, and no documentation of this - comment not terminated by a ".". This is the first instance of this bug in the file. - space instead of tab after #define. This is the first instance of this bug in the file. Previous bitrot in filio.h: - namespace-polluting struct member names len and buf, and no documentation of this. All struct member names in the file begin with fio, and this would not be namespace pollution if it were documented. - FIOSEEKDATA and FIOSEEKHOLE use the undeclared type off_t. This doesn't break including , since there is only a problem if these macros are used. These macros are of course undocumented, so the header must be read to even know that they exist and then it is easy to see that off_t must be declared to use them. Use of uint32_t and u_long, and function parameter names in the application namespace are not problems since they are under a _KERNEL ifdef. The other headers included by are sys/ioccom.h, sys/sockio.h and sys/ttycom.h: sys/ioccom.h: Mostly implementation details; still fairly clean. sys/sockio.h: Still defines only macros and doesn't define any of the types used by these macros. Clearly, should _not_ declare all of these types, or even one. Defining all of them might require including all socket and network headers. Since there is no documentation, users must read this header to see which type they need, then read the header that declares that type to see what its prerequisites are... sys/ttycom.h: Like sys/sockio.h, but a hundred times simpler. The only undeclared types that it uses are struct timeval and struct termios. Summary: and the headers that it includes should declare minimal types to compile (so __int64_t is enough). Most uses of this header require including domain-specific headers which declare the relevant data structures. Bruce From owner-svn-src-head@freebsd.org Thu Jun 20 17:22:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EF315C230B; Thu, 20 Jun 2019 17:22:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 1771B8B4CE; Thu, 20 Jun 2019 17:22:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id a21so3441072ljh.7; Thu, 20 Jun 2019 10:22:04 -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=LJqkFEbFVd9Oxp9J3o7kLyHxF301ZQFc/x3bgcAq73c=; b=kHiukNDGjD6Ir0TQAZq6VwInrCoPEJ7idEE9Unic4lf7OOwDGgLrgj6eWEXcplMazQ 9TQdI/DlXw1fBW8ud+B/Hrriw/zpvWbOwk9px524thjGtQYJ6vCznNavLh9SLZbny2A+ gJk1XtswPEVw1rFaxhR2oLpCQ3nuW07olHoLBmGFadYZQq9RFbcPYEaGH1bgK+AgdN5X 6uMdftWz8xh59qHpkxaERWk0UX3QENGP6izDCkZxXjET6e8QFG1FZ2rJ6nrtLkBM8ffU WTYGc8porevlM6Ca9MRb9MgCXN5XMFv5/0su9J1EWHV3/fBxSpSLrkNwqW+tm5TCHF8J 2OBw== X-Gm-Message-State: APjAAAX4lJngRB55x4nx5Rtc5ywMROOZ6RIg9nngg/bS9466A0uUaWP+ 6GKO5g0V7IiLsHlBwjSth4E48gvb6j6gYZ/SYk0= X-Google-Smtp-Source: APXvYqwdhf9e8j0fd4E2S+y4kqesRceM20E/EUbJwRji3s9tTeC7vXfrVDonooW2BFe4lIaW6SuhIXVwQhx29TMZ0Yw= X-Received: by 2002:a2e:1290:: with SMTP id 16mr50505738ljs.88.1561050925786; Thu, 20 Jun 2019 10:15:25 -0700 (PDT) MIME-Version: 1.0 References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> <20190621013236.N5105@besplex.bde.org> In-Reply-To: <20190621013236.N5105@besplex.bde.org> From: Alan Somers Date: Thu, 20 Jun 2019 11:15:14 -0600 Message-ID: Subject: Re: svn commit: r349233 - head/sys/sys To: Bruce Evans Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1771B8B4CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 17:22:06 -0000 On Thu, Jun 20, 2019 at 10:43 AM Bruce Evans wrote: > > On Thu, 20 Jun 2019, Alan Somers wrote: > > > On Thu, Jun 20, 2019 at 9:14 AM Ian Lepore wrote: > >> > >> On Thu, 2019-06-20 at 14:35 +0000, Alan Somers wrote: > >>> Author: asomers > >>> Date: Thu Jun 20 14:35:28 2019 > >>> New Revision: 349233 > >>> URL: https://svnweb.freebsd.org/changeset/base/349233 > >>> > >>> Log: > >>> #include from sys/filio.h > >>> > >>> This fixes world build after r349231 > > This increases the bugs in r349231 by adding more undocumented namespace > pollution. > > >>> Modified: head/sys/sys/filio.h > >>> ===================================================================== > >>> ========= > >>> --- head/sys/sys/filio.h Thu Jun 20 14:34:45 2019 (r349232) > >>> +++ head/sys/sys/filio.h Thu Jun 20 14:35:28 2019 (r349233) > >>> @@ -40,6 +40,7 @@ > >>> #ifndef _SYS_FILIO_H_ > >>> #define _SYS_FILIO_H_ > >>> > >>> +#include > >>> #include > >>> > >>> /* Generic file-descriptor ioctl's. */ > >> > >> I wonder... is this one of those situations where it is better to use > >> __int64_t in the struct, then #include ? I think the net > >> effect there would be less pollution with other types? I've never seen > >> written guidance about when to use the __names and _types.h, but I've > >> always had the general impression that if you have to include a header > >> from another system header, it's better to use the _header.h if it > >> exists. > > > > Good question. grep shows almost equal numbers of each (37 types.h > > and 33 _types.h) in sys/sys. Do you think I should change it? > > Only low quality headers include . > > r349231 adds a struct declaration with an int64_t in it. Everything is > undocumented of course, so one knows if this header declares all the > types needed to use it. If it only declared __int64_t and used that, > then users would have to know to use __int64_t or to include a header > that declares int64_t in order to use the struct properly (e.g., > bounds checking of the __int64_t member requires knowing its type). > This is a bit inconvenient. However, since everything is undocumented, > users have to read the header to see what is in it anyway, so they can > see that it uses __int64_t just as easily as they can see the name of > the struct member of that type. > > Higher quality headers usually declare all the standard types that they > use. Some even document the types that they declare. > > filio.h is not referenced in any man page. It is normally used by > including the omnibus header . is documented > well enough to require it to declare all the types that it uses. This > follows from the SYNOPSIS for ioctl(2) -- since no preqrequisites for > are given, it must not depend on other headers. > > ioctl(2) otherwise documents about 1% of the things needed to use it. > No one knows what macros and types defines/declares. > However, the headers included by used to be careful > about namespace pollution. They didn't do much more than #define lots > of macros and used only a few types and mostly only basic types. This > has rotted a bit. > > r349231 added the following bugs: > - use of int32_t, and no documentation of this > - namespace-polluting struct member names bn, runp and runb, and no > documentation of this > - comment not terminated by a ".". This is the first instance of this > bug in the file. > - space instead of tab after #define. This is the first instance of this > bug in the file. > > Previous bitrot in filio.h: > - namespace-polluting struct member names len and buf, and no documentation > of this. All struct member names in the file begin with fio, and this > would not be namespace pollution if it were documented. > - FIOSEEKDATA and FIOSEEKHOLE use the undeclared type off_t. This doesn't > break including , since there is only a problem if these > macros are used. These macros are of course undocumented, so the header > must be read to even know that they exist and then it is easy to see that > off_t must be declared to use them. > > Use of uint32_t and u_long, and function parameter names in the application > namespace are not problems since they are under a _KERNEL ifdef. > > The other headers included by are sys/ioccom.h, sys/sockio.h > and sys/ttycom.h: > > sys/ioccom.h: > Mostly implementation details; still fairly clean. > > sys/sockio.h: > Still defines only macros and doesn't define any of the types used by these > macros. Clearly, should _not_ declare all of these types, or > even one. Defining all of them might require including all socket and > network headers. Since there is no documentation, users must read this > header to see which type they need, then read the header that declares > that type to see what its prerequisites are... > > sys/ttycom.h: > Like sys/sockio.h, but a hundred times simpler. The only undeclared types > that it uses are struct timeval and struct termios. > > Summary: and the headers that it includes should declare > minimal types to compile (so __int64_t is enough). Most uses of this > header require including domain-specific headers which declare the > relevant data structures. > > Bruce Bruce, would you be satisfied by switching from to and from int64_t to __int64_t? -Alan From owner-svn-src-head@freebsd.org Thu Jun 20 18:19:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26B7F15C3F76; Thu, 20 Jun 2019 18:19:10 +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 BB5668FE41; Thu, 20 Jun 2019 18:19:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BE14FBB7; Thu, 20 Jun 2019 18:19:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KIJ9a4046983; Thu, 20 Jun 2019 18:19:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KIJ9Rk046982; Thu, 20 Jun 2019 18:19:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906201819.x5KIJ9Rk046982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jun 2019 18:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349239 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB5668FE41 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.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 18:19:10 -0000 Author: emaste Date: Thu Jun 20 18:19:09 2019 New Revision: 349239 URL: https://svnweb.freebsd.org/changeset/base/349239 Log: Clarify that vm_map_protect cannot upgrade max_protection It's implied by the man page's RETURN VALUES section, but be explicit in the description that vm_map_protect can not set new protection bits that are already in each entry's max_protection. Reviewed by: brooks MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20709 Modified: head/share/man/man9/vm_map_protect.9 Modified: head/share/man/man9/vm_map_protect.9 ============================================================================== --- head/share/man/man9/vm_map_protect.9 Thu Jun 20 17:08:21 2019 (r349238) +++ head/share/man/man9/vm_map_protect.9 Thu Jun 20 18:19:09 2019 (r349239) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2003 +.Dd June 20, 2019 .Dt VM_MAP_PROTECT 9 .Os .Sh NAME @@ -51,6 +51,11 @@ within the map .Fa map to .Fa new_prot . +The value specified by +.Fa new_prot +may not include any protection bits that are not set in +.Va max_protection +on every entry within the range. .Pp If .Fa set_max From owner-svn-src-head@freebsd.org Thu Jun 20 18:24:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B6215C425C; Thu, 20 Jun 2019 18:24:18 +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 CAA5F90429; Thu, 20 Jun 2019 18:24:17 +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 A6803FD8E; Thu, 20 Jun 2019 18:24:17 +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 x5KIOHsY051789; Thu, 20 Jun 2019 18:24:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KIOGFE051785; Thu, 20 Jun 2019 18:24:16 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201906201824.x5KIOGFE051785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 20 Jun 2019 18:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349240 - in head: lib/libc/sys sys/sys sys/vm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libc/sys sys/sys sys/vm X-SVN-Commit-Revision: 349240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAA5F90429 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.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 18:24:18 -0000 Author: brooks Date: Thu Jun 20 18:24:16 2019 New Revision: 349240 URL: https://svnweb.freebsd.org/changeset/base/349240 Log: Extend mmap/mprotect API to specify the max page protections. A new macro PROT_MAX() alters a protection value so it can be OR'd with a regular protection value to specify the maximum permissions. If present, these flags specify the maximum permissions. While these flags are non-portable, they can be used in portable code with simple ifdefs to expand PROT_MAX() to 0. This change allows (e.g.) a region that must be writable during run-time linking or JIT code generation to be made permanently read+execute after writes are complete. This complements W^X protections allowing more precise control by the programmer. This change alters mprotect argument checking and returns an error when unhandled protection flags are set. This differs from POSIX (in that POSIX only specifies an error), but is the documented behavior on Linux and more closely matches historical mmap behavior. In addition to explicit setting of the maximum permissions, an experimental sysctl vm.imply_prot_max causes mmap to assume that the initial permissions requested should be the maximum when the sysctl is set to 1. PROT_NONE mappings are excluded from this for compatibility with rtld and other consumers that use such mappings to reserve address space before mapping contents into part of the reservation. A final version this is expected to provide per-binary and per-process opt-in/out options and this sysctl will go away in its current form. As such it is undocumented. Reviewed by: emaste, kib (prior version), markj Additional suggestions from: alc Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18880 Modified: head/lib/libc/sys/mmap.2 head/lib/libc/sys/mprotect.2 head/sys/sys/mman.h head/sys/vm/vm_mmap.c Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Thu Jun 20 18:19:09 2019 (r349239) +++ head/lib/libc/sys/mmap.2 Thu Jun 20 18:24:16 2019 (r349240) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd June 22, 2017 +.Dd June 20, 2019 .Dt MMAP 2 .Os .Sh NAME @@ -113,6 +113,22 @@ Pages may be written. Pages may be executed. .El .Pp +In addition to these protection flags, +.Fx +provides the ability to set the maximum protection of a region allocated by +.Nm +and later altered by +.Xr mprotect 2 . +This is accomplished by +.Em or Ns 'ing +one or more +.Dv PROT_ +values wrapped in the +.Dv PROT_MAX() +macro into the +.Fa prot +argument. +.Pp The .Fa flags argument specifies the type of the mapped object, mapping options and @@ -415,6 +431,11 @@ referenced a regular file or shared memory. An invalid value was passed in the .Fa prot argument. +.It Bq Er EINVAL +The +.Fa prot +argument contains permissions which are not a subset of the specified +maximum permissions. .It Bq Er EINVAL An undefined option was set in the .Fa flags Modified: head/lib/libc/sys/mprotect.2 ============================================================================== --- head/lib/libc/sys/mprotect.2 Thu Jun 20 18:19:09 2019 (r349239) +++ head/lib/libc/sys/mprotect.2 Thu Jun 20 18:24:16 2019 (r349240) @@ -28,7 +28,7 @@ .\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd June 20, 2019 .Dt MPROTECT 2 .Os .Sh NAME @@ -65,6 +65,22 @@ The pages can be written. .It Dv PROT_EXEC The pages can be executed. .El +.Pp +In addition to these protection flags, +.Fx +provides the ability to set the maximum protection of a region +(which prevents +.Nm +from upgrading the permissions). +This is accomplished by +.Em or Ns 'ing +one or more +.Dv PROT_ +values wrapped in the +.Dv PROT_MAX() +macro into the +.Fa prot +argument. .Sh RETURN VALUES .Rv -std mprotect .Sh ERRORS @@ -78,6 +94,15 @@ The virtual address range specified by the and .Fa len arguments is not valid. +.It Bq Er EINVAL +The +.Fa prot +argument contains unhandled bits. +.It Bq Er EINVAL +The +.Fa prot +argument contains permissions which are not a subset of the specified +maximum permissions. .It Bq Er EACCES The calling process was not allowed to change the protection to the value specified by Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Thu Jun 20 18:19:09 2019 (r349239) +++ head/sys/sys/mman.h Thu Jun 20 18:24:16 2019 (r349240) @@ -55,6 +55,14 @@ #define PROT_READ 0x01 /* pages can be read */ #define PROT_WRITE 0x02 /* pages can be written */ #define PROT_EXEC 0x04 /* pages can be executed */ +#if __BSD_VISIBLE +#define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) +#define PROT_EXTRACT(prot) ((prot) & _PROT_ALL) + +#define _PROT_MAX_SHIFT 16 +#define PROT_MAX(prot) ((prot) << _PROT_MAX_SHIFT) +#define PROT_MAX_EXTRACT(prot) (((prot) >> _PROT_MAX_SHIFT) & _PROT_ALL) +#endif /* * Flags contain sharing type and options. Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Jun 20 18:19:09 2019 (r349239) +++ head/sys/vm/vm_mmap.c Thu Jun 20 18:24:16 2019 (r349240) @@ -103,6 +103,9 @@ SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RWTUN, &o static int mincore_mapped = 1; SYSCTL_INT(_vm, OID_AUTO, mincore_mapped, CTLFLAG_RWTUN, &mincore_mapped, 0, "mincore reports mappings, not residency"); +static int imply_prot_max = 0; +SYSCTL_INT(_vm, OID_AUTO, imply_prot_max, CTLFLAG_RWTUN, &imply_prot_max, 0, + "Imply maximum page permissions in mmap() when none are specified"); #ifdef MAP_32BIT #define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) @@ -187,9 +190,25 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t l vm_offset_t addr; vm_size_t pageoff, size; vm_prot_t cap_maxprot; - int align, error; + int align, error, max_prot; cap_rights_t rights; + if ((prot & ~(_PROT_ALL | PROT_MAX(_PROT_ALL))) != 0) + return (EINVAL); + max_prot = PROT_MAX_EXTRACT(prot); + prot = PROT_EXTRACT(prot); + if (max_prot != 0 && (max_prot & prot) != prot) + return (EINVAL); + /* + * Always honor PROT_MAX if set. If not, default to all + * permissions unless we're implying maximum permissions. + * + * XXX: should be tunable per process and ABI. + */ + if (max_prot == 0) + max_prot = (imply_prot_max && prot != PROT_NONE) ? + prot : _PROT_ALL; + vms = td->td_proc->p_vmspace; fp = NULL; AUDIT_ARG_FD(fd); @@ -335,7 +354,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t l * This relies on VM_PROT_* matching PROT_*. */ error = vm_mmap_object(&vms->vm_map, &addr, size, prot, - VM_PROT_ALL, flags, NULL, pos, FALSE, td); + max_prot, flags, NULL, pos, FALSE, td); } else { /* * Mapping file, get fp for validation and don't let the @@ -363,7 +382,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t l /* This relies on VM_PROT_* matching PROT_*. */ error = fo_mmap(fp, &vms->vm_map, &addr, size, prot, - cap_maxprot, flags, pos, td); + max_prot & cap_maxprot, flags, pos, td); } if (error == 0) @@ -594,9 +613,13 @@ kern_mprotect(struct thread *td, uintptr_t addr0, size { vm_offset_t addr; vm_size_t pageoff; + int vm_error, max_prot; addr = addr0; - prot = (prot & VM_PROT_ALL); + if ((prot & ~(_PROT_ALL | PROT_MAX(_PROT_ALL))) != 0) + return (EINVAL); + max_prot = PROT_MAX_EXTRACT(prot); + prot = PROT_EXTRACT(prot); pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -610,8 +633,18 @@ kern_mprotect(struct thread *td, uintptr_t addr0, size if (addr + size < addr) return (EINVAL); - switch (vm_map_protect(&td->td_proc->p_vmspace->vm_map, addr, - addr + size, prot, FALSE)) { + vm_error = KERN_SUCCESS; + if (max_prot != 0) { + if ((max_prot & prot) != prot) + return (EINVAL); + vm_error = vm_map_protect(&td->td_proc->p_vmspace->vm_map, + addr, addr + size, max_prot, TRUE); + } + if (vm_error == KERN_SUCCESS) + vm_error = vm_map_protect(&td->td_proc->p_vmspace->vm_map, + addr, addr + size, prot, FALSE); + + switch (vm_error) { case KERN_SUCCESS: return (0); case KERN_PROTECTION_FAILURE: From owner-svn-src-head@freebsd.org Thu Jun 20 18:30:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D0115C437C; Thu, 20 Jun 2019 18:30:20 +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 1AD6490963; Thu, 20 Jun 2019 18:30:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E73A1FDB0; Thu, 20 Jun 2019 18:30:19 +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 x5KIUJqL052104; Thu, 20 Jun 2019 18:30:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KIUJXe052103; Thu, 20 Jun 2019 18:30:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906201830.x5KIUJXe052103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Jun 2019 18:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349241 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AD6490963 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.969,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 18:30:20 -0000 Author: emaste Date: Thu Jun 20 18:30:19 2019 New Revision: 349241 URL: https://svnweb.freebsd.org/changeset/base/349241 Log: Clarify vm_map_protect max_protection downgrade As reported in review D20709 by brooks calling vm_map_protect to set a new max_protection value downgrades existing mappings if necessary (as opposed to returning an error). Reported by: brooks MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/vm_map_protect.9 Modified: head/share/man/man9/vm_map_protect.9 ============================================================================== --- head/share/man/man9/vm_map_protect.9 Thu Jun 20 18:24:16 2019 (r349240) +++ head/share/man/man9/vm_map_protect.9 Thu Jun 20 18:30:19 2019 (r349241) @@ -64,7 +64,12 @@ is TRUE, is treated as the new .Va max_protection setting for each underlying entry. -Otherwise, only the +Protection bits not included +.Fa new_prot +will be cleared from existing entries. +If +.Fa set_max +is FALSE only the .Va protection field is affected. .Pp From owner-svn-src-head@freebsd.org Thu Jun 20 18:44:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0623915C47BA; Thu, 20 Jun 2019 18:44:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7690E9119B; Thu, 20 Jun 2019 18:44:29 +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 34CFE14A4A8; Fri, 21 Jun 2019 04:44:20 +1000 (AEST) Date: Fri, 21 Jun 2019 04:44:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: Ian Lepore , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349233 - head/sys/sys In-Reply-To: Message-ID: <20190621033049.D5823@besplex.bde.org> References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> <20190621013236.N5105@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=qHZTYdl3w4KMAS8C2bwA:9 a=fzeUE3LNdtxtRXMc:21 a=jRwNM3MqSicG2Lbx:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 7690E9119B 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_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 18:44:30 -0000 On Thu, 20 Jun 2019, Alan Somers wrote: > On Thu, Jun 20, 2019 at 10:43 AM Bruce Evans wrote: >> Summary: and the headers that it includes should declare >> minimal types to compile (so __int64_t is enough). Most uses of this >> header require including domain-specific headers which declare the >> relevant data structures. > > Bruce, would you be satisfied by switching from to > and from int64_t to __int64_t? Not quite. The kernel block number type is daddr_t, and [__]int64_t is a hard coding of that. Hard-coding of typedefs is good for reducing namespace pollution, but it is not done for the nearby use of off_t. Unfortunately, daddr_t is only declared in . The type daddr_t seems to be correct, but ffs conflates it with ufs2_daddr_t. It is only for blocks of size DEV_BSIZE, while fs blocks are usually larger. The conflation is just a style bug because 64 bits should be large enough for anyone and ffs does the necessary conversions between DEV_BSIZE-blocks and fs-blocks. ext2fs seems to be more broken in this area. It doesn't have ext2fs_daddr_t, but hard-codes this as int32_t or int64_t. int32_t became very broken when ext2fs started attempting to support unsigned block numbers. Now, ext2_bmap() corrupts "daddr_t a_bn" to "int32_t bn" when it calls ext4_bmapext(). This has a chance of working via unsign-extension bugs provided a_bn fits in uint64_t. It is sure to fit for a valid a_bn, but perhaps your new ioctl allows probing for panics using invalid a_bn. ext2_bmap() also calls ext2_bmaparray(). That used to have essentially the same style bugs as ffs (with the ext2fs type corresponding to ufs2_daddr_t spelled int32_t), but it now correctly uses daddr_t. Internally, it misuses daddr_t for ext2fs block numbers, and there is an ext2fs block number type after all (e2fs_lbn_t = int64_t) which it uses only for metalbn. It looks like the older ext2fs code was fixed, especially if older ext2fs is limited to int32_t block numbers, but the ext4 case is quite broken since unsign extension bugs don't help it. a_bn starts as int64_t, then is truncated to the function arg "int32_t bn", then the function assigns bn to "int64_t lbn" and doesn't use bn again. Using a generic int64_t type in all interfaces would avoid some of these bugs, so I don't mind using it for the API. Just add a note that it must be large enough to represent all useful values of daddr_t. Bruce From owner-svn-src-head@freebsd.org Thu Jun 20 19:43:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A10415C601E for ; Thu, 20 Jun 2019 19:43:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (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 AB01F940EC for ; Thu, 20 Jun 2019 19:43:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id y57so4456799qtk.4 for ; Thu, 20 Jun 2019 12:43:38 -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=bAmL+mxpj2j6X1RjOIfgLsc8OX7cYgdA3KugbeEztl4=; b=AF6t9QWjZpuIc+DzX3x2xm3uGX2AHsafrLYMBzvZZ+zAsjnxI4S3pyAFf0njlTxYJf xespNHoh6/AHE9v5kUZHRuKJHkKF2sOqLDm6Fd141C3g7otSrOuuSh8NMFjwb7Hv5lgb 8ugTZgB2qB2koZV6EGPclH1xi3IerWVmerihupZQeFaxgDIG0ocSrFOZp9A5+874+zRn k8cYqZQEIMKaEt4+Pu2TnkZRCOz31HvCWPWV9ZXHXGMFIYaM6Bppq/0LwseqtWP1TncB gcpV0NlgtWBOuyIWflaf8de1mTRckKZRMe/eMYzeNIFhbsnpIwaOG/DH+GbZLwZXjiWC fzDQ== 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=bAmL+mxpj2j6X1RjOIfgLsc8OX7cYgdA3KugbeEztl4=; b=hZ4HGaDl4A79hbNDd9ADTP3cVwytuzXJQmkscMEuk2e7yNNmCkk8winJeL4zwbiiXd 7Kd5pg35EBYhmlXxlBikzjeLDgg5mi0vRbDo/+BDsRxEnBI9TZED/XQ49QzypACJCWYA /HWGSbq4K7a2nl62P7C8yFnjTHEVn2lCmmmepWCaFLe2qOIgNK2f17ms3t09548uiAQf mciey3rIuDEzULZYktvryknx5Yy8NEOK6LMGI2/G7X65Mu7Txj0vN4I5Xlzo1mKdWfX5 wFGmssRm452Lc7opxCVG90zQ+KMV7zxZVWHEEZ692qL6CBMlItaRZ8VjR4xw8I9oWHiy TbzA== X-Gm-Message-State: APjAAAX686kMLcFeZaQx+xacR+7kpQjrmQ0UpNartnH73KD7Yq2jn8zo y4kcG/zjDQGQAESDTk1In40deMf8FEucxSJbdT+tMg== X-Google-Smtp-Source: APXvYqxPen0laQiS8FLg7OTpRunMXQfeAlo6cL4f6Jv1ulo9MENvsTb+fsAJOiusKIYjpMCDNS9i4HyIWC9wYr8YnJU= X-Received: by 2002:ac8:431e:: with SMTP id z30mr113642501qtm.291.1561059817817; Thu, 20 Jun 2019 12:43:37 -0700 (PDT) MIME-Version: 1.0 References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> <20190621013236.N5105@besplex.bde.org> <20190621033049.D5823@besplex.bde.org> In-Reply-To: <20190621033049.D5823@besplex.bde.org> From: Warner Losh Date: Thu, 20 Jun 2019 12:43:26 -0700 Message-ID: Subject: Re: svn commit: r349233 - head/sys/sys To: Bruce Evans Cc: Alan Somers , Ian Lepore , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: AB01F940EC 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.968,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 19:43:39 -0000 On Thu, Jun 20, 2019, 11:44 AM Bruce Evans wrote: > On Thu, 20 Jun 2019, Alan Somers wrote: > > > On Thu, Jun 20, 2019 at 10:43 AM Bruce Evans > wrote: > >> Summary: and the headers that it includes should declare > >> minimal types to compile (so __int64_t is enough). Most uses of this > >> header require including domain-specific headers which declare the > >> relevant data structures. > > > > Bruce, would you be satisfied by switching from to > > and from int64_t to __int64_t? > > Not quite. The kernel block number type is daddr_t, and [__]int64_t is > a hard coding of that. Hard-coding of typedefs is good for reducing > namespace pollution, but it is not done for the nearby use of off_t. > > Unfortunately, daddr_t is only declared in . > > The type daddr_t seems to be correct, but ffs conflates it with > ufs2_daddr_t. It is only for blocks of size DEV_BSIZE, while fs blocks > are usually larger. The conflation is just a style bug because 64 bits > should be large enough for anyone and ffs does the necessary conversions > between DEV_BSIZE-blocks and fs-blocks. > > ext2fs seems to be more broken in this area. It doesn't have > ext2fs_daddr_t, but hard-codes this as int32_t or int64_t. int32_t > became very broken when ext2fs started attempting to support unsigned > block numbers. Now, ext2_bmap() corrupts "daddr_t a_bn" to "int32_t > bn" when it calls ext4_bmapext(). This has a chance of working via > unsign-extension bugs provided a_bn fits in uint64_t. It is sure to > fit for a valid a_bn, but perhaps your new ioctl allows probing for > panics using invalid a_bn. ext2_bmap() also calls ext2_bmaparray(). > That used to have essentially the same style bugs as ffs (with the > ext2fs type corresponding to ufs2_daddr_t spelled int32_t), but it now > correctly uses daddr_t. Internally, it misuses daddr_t for ext2fs > block numbers, and there is an ext2fs block number type after all > (e2fs_lbn_t = int64_t) which it uses only for metalbn. > > It looks like the older ext2fs code was fixed, especially if older ext2fs > is limited to int32_t block numbers, but the ext4 case is quite broken > since unsign extension bugs don't help it. a_bn starts as int64_t, then > is truncated to the function arg "int32_t bn", then the function assigns bn > to "int64_t lbn" and doesn't use bn again. > > Using a generic int64_t type in all interfaces would avoid some of these > bugs, so I don't mind using it for the API. Just add a note that it must > be large enough to represent all useful values of daddr_t. > Maybe we should add a __daddr_t define to sys/_types.h? And the usual reshuffling. That would also fix the namespace pollution. Warner > From owner-svn-src-head@freebsd.org Thu Jun 20 20:06:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C01D915C6775; Thu, 20 Jun 2019 20:06:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613E794AC4; Thu, 20 Jun 2019 20:06:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37EBB18E50; Thu, 20 Jun 2019 20:06:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KK6J9Y007324; Thu, 20 Jun 2019 20:06:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KK6JIK007323; Thu, 20 Jun 2019 20:06:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906202006.x5KK6JIK007323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 20 Jun 2019 20:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349242 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 349242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 613E794AC4 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 20:06:20 -0000 Author: np Date: Thu Jun 20 20:06:19 2019 New Revision: 349242 URL: https://svnweb.freebsd.org/changeset/base/349242 Log: cxgbe/t4_tom: DDP_DEAD is a ddp flag and not a toepcb flag. The driver was in effect setting TPF_ABORT_SHUTDOWN on the toepcb instead of what was intended. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Thu Jun 20 18:30:19 2019 (r349241) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Thu Jun 20 20:06:19 2019 (r349242) @@ -220,7 +220,7 @@ release_ddp_resources(struct toepcb *toep) int i; DDP_LOCK(toep); - toep->flags |= DDP_DEAD; + toep->ddp.flags |= DDP_DEAD; for (i = 0; i < nitems(toep->ddp.db); i++) { free_ddp_buffer(toep->td, &toep->ddp.db[i]); } From owner-svn-src-head@freebsd.org Thu Jun 20 20:29:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE13315C6FBC; Thu, 20 Jun 2019 20:29:43 +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 8602095621; Thu, 20 Jun 2019 20:29:43 +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 61E9C1918F; Thu, 20 Jun 2019 20:29:43 +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 x5KKThSO017868; Thu, 20 Jun 2019 20:29:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KKThjn017867; Thu, 20 Jun 2019 20:29:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906202029.x5KKThjn017867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jun 2019 20:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349243 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 349243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8602095621 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.96)[-0.955,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 20:29:44 -0000 Author: mav Date: Thu Jun 20 20:29:42 2019 New Revision: 349243 URL: https://svnweb.freebsd.org/changeset/base/349243 Log: Optimize xpt_getattr(). Do not allocate temporary buffer for attributes we are going to return as-is, just make sure to NUL-terminate them. Do not zero temporary 64KB buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled and there are also length fields inside the returned data also. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 20 20:06:19 2019 (r349242) +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 (r349243) @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.flags = CDAI_FLAG_NONE; cdai.bufsiz = len; + cdai.buf = buf; if (!strcmp(attr, "GEOM::ident")) cdai.buftype = CDAI_TYPE_SERIAL_NUM; @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const char *attr, s strcmp(attr, "GEOM::lunname") == 0) { cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; + cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); + if (cdai.buf == NULL) { + ret = ENOMEM; + goto out; + } } else goto out; - cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); - if (cdai.buf == NULL) { - ret = ENOMEM; - goto out; - } xpt_action((union ccb *)&cdai); /* can only be synchronous */ if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const char *attr, s ret = EFAULT; } } else { - ret = 0; - if (strlcpy(buf, cdai.buf, len) >= len) + if (cdai.provsiz < len) { + cdai.buf[cdai.provsiz] = 0; + ret = 0; + } else ret = EFAULT; } out: - if (cdai.buf != NULL) + if ((char *)cdai.buf != buf) free(cdai.buf, M_CAMXPT); return ret; } From owner-svn-src-head@freebsd.org Thu Jun 20 21:52:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB9215C8B84; Thu, 20 Jun 2019 21:52:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 771F06802F; Thu, 20 Jun 2019 21:52:31 +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 538941A09A; Thu, 20 Jun 2019 21:52:31 +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 x5KLqViB064845; Thu, 20 Jun 2019 21:52:31 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KLqUWg064842; Thu, 20 Jun 2019 21:52:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201906202152.x5KLqUWg064842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 20 Jun 2019 21:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349245 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 349245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 771F06802F 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 21:52:32 -0000 Author: brooks Date: Thu Jun 20 21:52:30 2019 New Revision: 349245 URL: https://svnweb.freebsd.org/changeset/base/349245 Log: Add PROT_MAX to the HISTORY section. In the case of mmap(), add a HISTORY section. Mention that mmap() and mprotect()'s documentation predates an implementation. The implementation first saw wide use in 4.3-Reno, but there seems to be no easy way to express that in mdoc so stick with 4.4BSD. Reviewed by: emaste Requested by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20713 Modified: head/lib/libc/sys/mmap.2 head/lib/libc/sys/mprotect.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Thu Jun 20 21:29:28 2019 (r349244) +++ head/lib/libc/sys/mmap.2 Thu Jun 20 21:52:30 2019 (r349245) @@ -542,3 +542,16 @@ was specified and insufficient memory was available. .Xr munmap 2 , .Xr getpagesize 3 , .Xr getpagesizes 3 +.Sh HISTORY +The +.Nm +system call was first documented in +.Bx 4.2 +and implemented in +.Bx 4.4 . +.\" XXX: lots of missing history of FreeBSD additions. +.Pp +The +.Dv PROT_MAX +functionality was introduced in +.Fx 13 . Modified: head/lib/libc/sys/mprotect.2 ============================================================================== --- head/lib/libc/sys/mprotect.2 Thu Jun 20 21:29:28 2019 (r349244) +++ head/lib/libc/sys/mprotect.2 Thu Jun 20 21:52:30 2019 (r349245) @@ -118,5 +118,12 @@ argument. .Sh HISTORY The .Fn mprotect -system call first appeared in +system call was first documented in +.Bx 4.2 +and first appeared in .Bx 4.4 . +.Pp +The +.Dv PROT_MAX +functionality was introduced in +.Fx 13 . From owner-svn-src-head@freebsd.org Thu Jun 20 22:20:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A8215C9265; Thu, 20 Jun 2019 22:20:31 +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 0CBB069F9C; Thu, 20 Jun 2019 22:20:31 +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 D48CD1A406; Thu, 20 Jun 2019 22:20:30 +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 x5KMKUMt075850; Thu, 20 Jun 2019 22:20:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KMKUFB075849; Thu, 20 Jun 2019 22:20:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906202220.x5KMKUFB075849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jun 2019 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349246 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 349246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CBB069F9C 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 22:20:31 -0000 Author: mav Date: Thu Jun 20 22:20:30 2019 New Revision: 349246 URL: https://svnweb.freebsd.org/changeset/base/349246 Log: SPC-3 and up require some UAs to be returned as fixed. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_error.c Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Thu Jun 20 21:52:30 2019 (r349245) +++ head/sys/cam/ctl/ctl_error.c Thu Jun 20 22:20:30 2019 (r349246) @@ -81,6 +81,12 @@ ctl_set_sense_data_va(struct scsi_sense_data *sense_da */ if (sense_format == SSD_TYPE_NONE) { /* + * SPC-3 and up require some UAs to be returned as fixed. + */ + if (asc == 0x29 || (asc == 0x2A && ascq == 0x01)) + sense_format = SSD_TYPE_FIXED; + else + /* * If the format isn't specified, we only return descriptor * sense if the LUN exists and descriptor sense is turned * on for that LUN. From owner-svn-src-head@freebsd.org Thu Jun 20 22:59:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD3BD15C9F55; Thu, 20 Jun 2019 22:59:58 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 0910D6B357; Thu, 20 Jun 2019 22:59:58 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 968E0220E2; Thu, 20 Jun 2019 18:59:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 20 Jun 2019 18:59:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=D jrFj6mQ9cl5xX59rzKd+x8OH5RseHzM/p6bxXdiYgc=; b=s12McLPrsp1cijw9P cN9BdCy+14cekWf8BWljvk8nso0MV/D2Xau27ncttx1CybRfhKEiE9NXRn576Pjc Kc1PtzsJiaz9BO0IrcDDZzCE1vteyRidZ1p61qMqSX7InlvDJoroWtDussasE1Cp 2akrlSmTwCmZAstkJbFS4QpCMFEm/FxD0UabrlCWlwQEF7mOBjFrB8Z9yNqaEZEh nSnr9r5lPN/6v8aCImSQmFSgt5wVMdHfrw+RxID177NuzQEP81VnywRqnIB9kj9E Y818w2sHJXM+1Ait30D0DthgnSGF1hAXtaUnBjWN/SR7T/VBnPsCHcrjImqElLK2 xIeVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=DjrFj6mQ9cl5xX59rzKd+x8OH5RseHzM/p6bxXdiY gc=; b=PVWA/i88d00wptGi+lOROjGt2jwCqyrvkzCrzrJQ06X93v/TvgLARjZhh yukOr0ydwWFbOyKdWzYNBzldPeVz2RrjisqCvFrhLjuHKDW1K2wTe9x9tiiK3+Pc VF7M6yUPDIBkpbUsUQ8+f+FmwfGUt1dw1dwo1JFd/MWJ8JxMGM8nrr/vximvSaQa RX4Dst5aVGBteqHUZ/gKc+Pa4Hlr05x5ZwhrrN4CGPq3TztLCud9FKxsS2Oxbu/F kMj5EhwPWsgswTJ1++zwtoYq87aZSOP/2v37PZAMyWCPf1Zc2tlLeCqHXYQkymU9 w/2gJ/4Tzd1qPMxnBsOvmsDyYemoQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdehgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesthhqmh dthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghmshgt ohdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppeduledvrd ehhedrheegrdehleenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehsrghm shgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [10.178.24.12] (unknown [192.55.54.59]) by mail.messagingengine.com (Postfix) with ESMTPA id 9490D80065; Thu, 20 Jun 2019 18:59:50 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349243 - head/sys/cam From: Scott Long In-Reply-To: <201906202029.x5KKThjn017867@repo.freebsd.org> Date: Thu, 20 Jun 2019 16:59:48 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> References: <201906202029.x5KKThjn017867@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 0910D6B357 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.95)[-0.945,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 22:59:58 -0000 Hi Alexander, I=E2=80=99m not a fan of removing the M_ZERO. I understand your = argument that lengths are provided elsewhere, but having the buffer be zero=E2=80=99d = is defensive against future bugs that might leak buffer contents. GETATTR isn=E2=80=99= t typically in a performance path, is there any measurable benefit to this? Thanks, Scott > On Jun 20, 2019, at 2:29 PM, Alexander Motin wrote: >=20 > Author: mav > Date: Thu Jun 20 20:29:42 2019 > New Revision: 349243 > URL: https://svnweb.freebsd.org/changeset/base/349243 >=20 > Log: > Optimize xpt_getattr(). >=20 > Do not allocate temporary buffer for attributes we are going to = return > as-is, just make sure to NUL-terminate them. Do not zero temporary = 64KB > buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled > and there are also length fields inside the returned data also. >=20 > MFC after: 2 weeks > Sponsored by: iXsystems, Inc. >=20 > Modified: > head/sys/cam/cam_xpt.c >=20 > Modified: head/sys/cam/cam_xpt.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/cam_xpt.c Thu Jun 20 20:06:19 2019 = (r349242) > +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 = (r349243) > @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char = *attr, s > cdai.ccb_h.func_code =3D XPT_DEV_ADVINFO; > cdai.flags =3D CDAI_FLAG_NONE; > cdai.bufsiz =3D len; > + cdai.buf =3D buf; >=20 > if (!strcmp(attr, "GEOM::ident")) > cdai.buftype =3D CDAI_TYPE_SERIAL_NUM; > @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const char = *attr, s > strcmp(attr, "GEOM::lunname") =3D=3D 0) { > cdai.buftype =3D CDAI_TYPE_SCSI_DEVID; > cdai.bufsiz =3D CAM_SCSI_DEVID_MAXLEN; > + cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); > + if (cdai.buf =3D=3D NULL) { > + ret =3D ENOMEM; > + goto out; > + } > } else > goto out; >=20 > - cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); > - if (cdai.buf =3D=3D NULL) { > - ret =3D ENOMEM; > - goto out; > - } > xpt_action((union ccb *)&cdai); /* can only be synchronous */ > if ((cdai.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) > cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); > @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const char = *attr, s > ret =3D EFAULT; > } > } else { > - ret =3D 0; > - if (strlcpy(buf, cdai.buf, len) >=3D len) > + if (cdai.provsiz < len) { > + cdai.buf[cdai.provsiz] =3D 0; > + ret =3D 0; > + } else > ret =3D EFAULT; > } >=20 > out: > - if (cdai.buf !=3D NULL) > + if ((char *)cdai.buf !=3D buf) > free(cdai.buf, M_CAMXPT); > return ret; > } >=20 From owner-svn-src-head@freebsd.org Thu Jun 20 23:07:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D167215CA211; Thu, 20 Jun 2019 23:07: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 53C566B804; Thu, 20 Jun 2019 23:07: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 2D1E31AC54; Thu, 20 Jun 2019 23:07: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 x5KN7MQ9002093; Thu, 20 Jun 2019 23:07:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KN7LLB002088; Thu, 20 Jun 2019 23:07:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906202307.x5KN7LLB002088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 20 Jun 2019 23:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349248 - in head/sys: fs/fifofs kern sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys: fs/fifofs kern sys X-SVN-Commit-Revision: 349248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53C566B804 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.96)[-0.956,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 23:07:23 -0000 Author: asomers Date: Thu Jun 20 23:07:20 2019 New Revision: 349248 URL: https://svnweb.freebsd.org/changeset/base/349248 Log: fcntl: fix overflow when setting F_READAHEAD VOP_READ and VOP_WRITE take the seqcount in blocks in a 16-bit field. However, fcntl allows you to set the seqcount in bytes to any nonnegative 31-bit value. The result can be a 16-bit overflow, which will be sign-extended in functions like ffs_read. Fix this by sanitizing the argument in kern_fcntl. As a matter of policy, limit to IO_SEQMAX rather than INT16_MAX. Also, fifos have overloaded the f_seqcount field for a completely different purpose ever since r238936. Formalize that by using a union type. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20710 Modified: head/sys/fs/fifofs/fifo_vnops.c head/sys/kern/kern_descrip.c head/sys/kern/sys_pipe.c head/sys/kern/vfs_vnops.c head/sys/sys/file.h Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Thu Jun 20 22:21:42 2019 (r349247) +++ head/sys/fs/fifofs/fifo_vnops.c Thu Jun 20 23:07:20 2019 (r349248) @@ -174,7 +174,7 @@ fifo_open(ap) if (fip->fi_writers > 0) wakeup(&fip->fi_writers); } - fp->f_seqcount = fpipe->pipe_wgen - fip->fi_writers; + fp->f_pipegen = fpipe->pipe_wgen - fip->fi_writers; } if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jun 20 22:21:42 2019 (r349247) +++ head/sys/kern/kern_descrip.c Thu Jun 20 23:07:20 2019 (r349248) @@ -780,7 +780,9 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ } if (arg >= 0) { bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; - fp->f_seqcount = (arg + bsize - 1) / bsize; + arg = MIN(arg, INT_MAX - bsize + 1); + fp->f_seqcount = MIN(IO_SEQMAX, + (arg + bsize - 1) / bsize); atomic_set_int(&fp->f_flag, FRDAHEAD); } else { atomic_clear_int(&fp->f_flag, FRDAHEAD); Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Thu Jun 20 22:21:42 2019 (r349247) +++ head/sys/kern/sys_pipe.c Thu Jun 20 23:07:20 2019 (r349248) @@ -1414,7 +1414,7 @@ pipe_poll(struct file *fp, int events, struct ucred *a levents = events & (POLLIN | POLLINIGNEOF | POLLPRI | POLLRDNORM | POLLRDBAND); if (rpipe->pipe_state & PIPE_NAMED && fp->f_flag & FREAD && levents && - fp->f_seqcount == rpipe->pipe_wgen) + fp->f_pipegen == rpipe->pipe_wgen) events |= POLLINIGNEOF; if ((events & POLLINIGNEOF) == 0) { Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jun 20 22:21:42 2019 (r349247) +++ head/sys/kern/vfs_vnops.c Thu Jun 20 23:07:20 2019 (r349248) @@ -499,7 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) * closely related to the best I/O size for real disks than * to any block size used by software. */ - fp->f_seqcount += howmany(uio->uio_resid, 16384); + fp->f_seqcount += MIN(IO_SEQMAX, + howmany(uio->uio_resid, 16384)); if (fp->f_seqcount > IO_SEQMAX) fp->f_seqcount = IO_SEQMAX; return (fp->f_seqcount << IO_SEQSHIFT); Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Thu Jun 20 22:21:42 2019 (r349247) +++ head/sys/sys/file.h Thu Jun 20 23:07:20 2019 (r349248) @@ -179,7 +179,10 @@ struct file { /* * DTYPE_VNODE specific fields. */ - int f_seqcount; /* (a) Count of sequential accesses. */ + union { + int16_t f_seqcount; /* (a) Count of sequential accesses. */ + int f_pipegen; + }; off_t f_nextoff; /* next expected read/write offset. */ union { struct cdev_privdata *fvn_cdevpriv; From owner-svn-src-head@freebsd.org Thu Jun 20 23:15:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 257F115CA4C9 for ; Thu, 20 Jun 2019 23:15:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 AFE086BDAE for ; Thu, 20 Jun 2019 23:15:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x844.google.com with SMTP id i34so5013375qta.6 for ; Thu, 20 Jun 2019 16:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pP6UDQ2YIuSQNuRYDe5b4SqRyw/WieOj4UZl6SrJwi0=; b=k8qwz3AgXFau4jkO+0u703eCaEt/eLXTy79HGN7Dym6Sr6Kkt2ej0g5qfNCRde66Kt FDkzLDyyDLvf4j+n96HHJtP8ynRcJLNe9KVmOCkRnE979LS+Il7HY3ZL7kVOcLLf5u/5 lB84GLSz/zKKMJ6AdHukYFO17+v1ImKO9VqhlUGe3p6NFphFhkpQCBvIxW3h8GOiCb33 4MT4J7I5ukgBlkiCg0CQpl02Vg00WRg2NH8aTWKwWS2wS4ViZAKninJxe0FgjqsuDAEa HqD6IkzlJNXk8DpzvX9ocCrKMx8uhSOwY/tJTP0ibhEiTYN75uGnc4+TX13rqM+JlfLN d7Bw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pP6UDQ2YIuSQNuRYDe5b4SqRyw/WieOj4UZl6SrJwi0=; b=iT25IGsCrwkkJVgwpap9FJYhgRstUfD9pBn5nCU1HwSF2HsZl8zp/2AKNGb5gvxT9m yldSziuAYh5RCZIG/Tjb9ZdwQe8dWJRqTaeXOIjAJUge5QVISZkXHvIk9GudXwxVUhWm kX11TjcYyeF0t+gr/wuX/oX1vcDLe9a4QW3+lNnMitWBxALcSo6Ey0mTkSWQv4w5z6Ek k9ggIn7uI/gKE4UMjuf2CGKtkpisnlEwoLvEkajCW8NmgTvKPZJsdz4333X2Z0itTqTA DH7QNS9qpEzlKgDH8m3YzqI0JgBLNwlVOnacWpwJt8BUlqk0hjLNSwYwZfer8BzAlBAX RafQ== X-Gm-Message-State: APjAAAVJl0nMzt5mwmLtPTKvzFsCPvmfa2fPwALuwoe+YGln50dunvBw 1SQMN55QBjoPk9i4LcNRhvDB3g== X-Google-Smtp-Source: APXvYqz+WzWTvDsEe7pDtoWNLaC3OC4Dov136wNAQj4UZHiWi9VU3kT3BWHb6Xn8fnwcAgNWT9CNfQ== X-Received: by 2002:a0c:ff46:: with SMTP id y6mr41798044qvt.214.1561072528951; Thu, 20 Jun 2019 16:15:28 -0700 (PDT) Received: from mutt-hbsd (c-69-251-68-137.hsd1.de.comcast.net. [69.251.68.137]) by smtp.gmail.com with ESMTPSA id a21sm572544qkg.47.2019.06.20.16.15.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 16:15:28 -0700 (PDT) Date: Thu, 20 Jun 2019 19:15:27 -0400 From: Shawn Webb To: Scott Long Cc: Alexander Motin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r349243 - head/sys/cam Message-ID: <20190620231527.pe2vhkvtcppao6ib@mutt-hbsd> References: <201906202029.x5KKThjn017867@repo.freebsd.org> <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ku7fsvwot5gtyq57" Content-Disposition: inline In-Reply-To: <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: AFE086BDAE 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_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 23:15:30 -0000 --ku7fsvwot5gtyq57 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable +1 for M_ZERO. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 On Thu, Jun 20, 2019 at 04:59:48PM -0600, Scott Long wrote: > Hi Alexander, >=20 > I???m not a fan of removing the M_ZERO. I understand your argument that > lengths are provided elsewhere, but having the buffer be zero???d is defe= nsive > against future bugs that might leak buffer contents. GETATTR isn???t typ= ically > in a performance path, is there any measurable benefit to this? >=20 > Thanks, > Scott >=20 >=20 > > On Jun 20, 2019, at 2:29 PM, Alexander Motin wrote: > >=20 > > Author: mav > > Date: Thu Jun 20 20:29:42 2019 > > New Revision: 349243 > > URL: https://svnweb.freebsd.org/changeset/base/349243 > >=20 > > Log: > > Optimize xpt_getattr(). > >=20 > > Do not allocate temporary buffer for attributes we are going to return > > as-is, just make sure to NUL-terminate them. Do not zero temporary 64= KB > > buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled > > and there are also length fields inside the returned data also. > >=20 > > MFC after: 2 weeks > > Sponsored by: iXsystems, Inc. > >=20 > > Modified: > > head/sys/cam/cam_xpt.c > >=20 > > Modified: head/sys/cam/cam_xpt.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/cam_xpt.c Thu Jun 20 20:06:19 2019 (r349242) > > +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 (r349243) > > @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char *at= tr, s > > cdai.ccb_h.func_code =3D XPT_DEV_ADVINFO; > > cdai.flags =3D CDAI_FLAG_NONE; > > cdai.bufsiz =3D len; > > + cdai.buf =3D buf; > >=20 > > if (!strcmp(attr, "GEOM::ident")) > > cdai.buftype =3D CDAI_TYPE_SERIAL_NUM; > > @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const char *= attr, s > > strcmp(attr, "GEOM::lunname") =3D=3D 0) { > > cdai.buftype =3D CDAI_TYPE_SCSI_DEVID; > > cdai.bufsiz =3D CAM_SCSI_DEVID_MAXLEN; > > + cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); > > + if (cdai.buf =3D=3D NULL) { > > + ret =3D ENOMEM; > > + goto out; > > + } > > } else > > goto out; > >=20 > > - cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); > > - if (cdai.buf =3D=3D NULL) { > > - ret =3D ENOMEM; > > - goto out; > > - } > > xpt_action((union ccb *)&cdai); /* can only be synchronous */ > > if ((cdai.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) > > cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); > > @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const char *= attr, s > > ret =3D EFAULT; > > } > > } else { > > - ret =3D 0; > > - if (strlcpy(buf, cdai.buf, len) >=3D len) > > + if (cdai.provsiz < len) { > > + cdai.buf[cdai.provsiz] =3D 0; > > + ret =3D 0; > > + } else > > ret =3D EFAULT; > > } > >=20 > > out: > > - if (cdai.buf !=3D NULL) > > + if ((char *)cdai.buf !=3D buf) > > free(cdai.buf, M_CAMXPT); > > return ret; > > } > >=20 >=20 > _______________________________________________ > 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" --ku7fsvwot5gtyq57 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl0ME4oACgkQ/y5nonf4 4fqioQ/+OCI8wWidt7sCNaPaHAJu9zKddev6a/evFMq8hqKG5JSjZ4As9aSFcfVZ HwWIrxxvcaS0vibuw+xbcSgktiIRG9+P0ryX+8XcL07bOxJ3eHWIV7aidO1t5q3o qSmZGxDzOXMWzQpQq+G0zz2FDag7xsCiqGosCnN1bKaEVAY83Nb9wQS8rq66jTGk yQsGoPOFYB3FLpqjdlmrsrcWHDuQa9rzsHS9r8txTwjfMSI/xhzvsYJPmz3Y6Zxh rA3uxRM1Do+2Y/cCnCr3LTI3GqEiQ3PS9Jzh/AeoDF2OImFnbRvr22dAjiD6iHCR nq4IaVbDOl6jd9nodHC3X4YQF5k+gLhBkNiUPfErrjDVhwqzQ6Jn1yf4TDkWGh0C efKxOai12X5m23SeZ1WAdJvCJ/Q6AF/tA/x3oRd+ckSYULRCAhuGqrY+XH1xgQgH zi34yyZEBHd3wmDTzE26axCFQV3QGT9gZMq3EaLnYH+83hMxBjYHKWfnsoSXAoxL zeGrTx7TWlGn8XW+1tn3/OYkP3I6YzNx+wZrkJHY5Xhii0Muq0F/okFyeDHRgz0k hI+bmiYgfFS77u3D8VD6vBAAte9CKoQpgbGZLGix/lL4CnJ5plaKJp+AgIKFtAyo qnjPt9oZyC2XQ6ORufWUexwJjeiGC6uHRAMa5k3LaeygzNznrWE= =dbMz -----END PGP SIGNATURE----- --ku7fsvwot5gtyq57-- From owner-svn-src-head@freebsd.org Thu Jun 20 23:52:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A1615CB069; Thu, 20 Jun 2019 23:52:38 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767DF6D3E7; Thu, 20 Jun 2019 23:52:36 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16FCD1B4C4; Thu, 20 Jun 2019 23:52:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KNqXYN028526; Thu, 20 Jun 2019 23:52:33 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KNqXkV028525; Thu, 20 Jun 2019 23:52:33 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201906202352.x5KNqXkV028525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Thu, 20 Jun 2019 23:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349251 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 349251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 767DF6D3E7 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 23:52:38 -0000 Author: takawata Date: Thu Jun 20 23:52:33 2019 New Revision: 349251 URL: https://svnweb.freebsd.org/changeset/base/349251 Log: Fix the case where no root hub object while host controller object exist in ACPI namespace. Also you can disable ACPI support for USB by setting debug.acpi.disabled="usb" PR: 238711 Modified: head/sys/dev/usb/usb_hub_acpi.c Modified: head/sys/dev/usb/usb_hub_acpi.c ============================================================================== --- head/sys/dev/usb/usb_hub_acpi.c Thu Jun 20 23:32:25 2019 (r349250) +++ head/sys/dev/usb/usb_hub_acpi.c Thu Jun 20 23:52:33 2019 (r349251) @@ -243,13 +243,14 @@ acpi_uhub_parse_pld(device_t dev, unsigned int port, A } ACPI_STATUS -acpi_uhub_find_rh(device_t dev, ACPI_HANDLE * ah){ +acpi_uhub_find_rh(device_t dev, ACPI_HANDLE * ah) +{ device_t grand; ACPI_HANDLE gah; + *ah = NULL; grand = device_get_parent(device_get_parent(dev)); if ((gah = acpi_get_handle(grand)) == NULL) { - *ah = NULL; return AE_ERROR; } return AcpiWalkNamespace(ACPI_TYPE_DEVICE, gah, 1, @@ -257,7 +258,8 @@ acpi_uhub_find_rh(device_t dev, ACPI_HANDLE * ah){ } ACPI_STATUS -acpi_usb_hub_port_probe_cb(ACPI_HANDLE ah, UINT32 lv, void *ctx, void **rv){ +acpi_usb_hub_port_probe_cb(ACPI_HANDLE ah, UINT32 lv, void *ctx, void **rv) +{ ACPI_DEVICE_INFO *devinfo; device_t dev = ctx; struct acpi_uhub_softc *sc = device_get_softc(dev); @@ -281,7 +283,8 @@ acpi_usb_hub_port_probe_cb(ACPI_HANDLE ah, UINT32 lv, } ACPI_STATUS -acpi_usb_hub_port_probe(device_t dev, ACPI_HANDLE ah){ +acpi_usb_hub_port_probe(device_t dev, ACPI_HANDLE ah) +{ return AcpiWalkNamespace(ACPI_TYPE_DEVICE, ah, 1, acpi_usb_hub_port_probe_cb, @@ -293,6 +296,9 @@ acpi_uhub_root_probe(device_t dev) ACPI_HANDLE ah; ACPI_STATUS status; + if(acpi_disabled("usb")) { + return ENXIO; + } status = acpi_uhub_find_rh(dev, &ah); if (ACPI_SUCCESS(status) && ah != NULL @@ -308,7 +314,7 @@ acpi_uhub_probe(device_t dev) { ACPI_HANDLE ah = acpi_get_handle(dev); - if (ah && (uhub_probe(dev) <= 0)) { + if (!acpi_disabled("usb") && ah && (uhub_probe(dev) <= 0)) { /*success prior than non - acpi hub*/ return (BUS_PROBE_DEFAULT + 1); } @@ -335,7 +341,6 @@ acpi_uhub_root_attach(device_t dev) sc->nports = uh->nports; sc->porthandle = malloc(sizeof(ACPI_HANDLE) * uh->nports, M_USBDEV, M_WAITOK | M_ZERO); - acpi_uhub_find_rh(dev, &devhandle); acpi_usb_hub_port_probe(dev, devhandle); return 0; From owner-svn-src-head@freebsd.org Fri Jun 21 00:04:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20CA615CB9B1; Fri, 21 Jun 2019 00:04:35 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) (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 9EEB36DDA8; Fri, 21 Jun 2019 00:04:34 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc44.google.com with SMTP id y185so1948307ywy.8; Thu, 20 Jun 2019 17:04:34 -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=MHcUxns/PN03ch6jdGMk7AD8GoiElP37GLgf2lDNsUk=; b=bC00iCXJohDhndPJfj5J0BLEKQB/xQUpzCB1MW3XhyHUo7sdfbXYMQV5x2raKxMWke sMtq6SmguaHizgGLVTYSJhFqaS+3TSN2ICO9viLygpxh3XPmPBZ+d2njBlxFRjcrdmRz YXDcGRUn5OfN+J/De0lx3Aoo3R7aADa03AmQ/DiKFUXM67O0gYg8bdo1+s+0TzbJ0s05 GUj7v9Me/CbIqdtQDmA6tR8pQMbvpw9aqGGUypWkUh6wGhIUhnKFiybrJP8pQ3kdH4C3 mV66eFibqO0mPYVa8d4tvPPBu7sQSie282Ed1PtwHnVNVuPhTmvUvhYDp8oUUljK07Mr orCQ== 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=MHcUxns/PN03ch6jdGMk7AD8GoiElP37GLgf2lDNsUk=; b=S/tSNzNIGi3krwSFl6G0oFCdW6EdCZHcieV3dEweYDO08zD/rL70cHOrHReR8te0aM cxaJC8YmLR9mv8qyPba/Ck+coviRhEP/D/FnVJJrou38byxVBJLUwnjdgu5Vob26lOUt 9c15YnOzsKsWXt/bJB/01Lv+r93sCrYiYkqjb1V3FrvD1uLSsv0oQpg5KM+eLdW0ucyW qdmLzoLU6E6P13EpRFxaUW3Y9CmWmHRJHLvTfUGKELcWJNmv0pLemQVnwF/DgyYk9nag tijwlDkiSlaeJdrUf9euASPuwX1yQwOVQRo5/CwPFq2S49zz5aCZDndxU5vN1YR7tbFF SNQg== X-Gm-Message-State: APjAAAUOsjWHN438aXqeIjiDBnj2lcnChqqKeuQA38p6zK77JmhQ24nf /o+F7mBkbRC0Aa8H6SVJOev1rRCuNbE= X-Google-Smtp-Source: APXvYqytPl7XZjpHP5MaCbK5AwTYqh4MTIm5stZkKlwOCsHzbeEGp18M+UEOaYAeFy0INygK2iHeNQ== X-Received: by 2002:a81:1a08:: with SMTP id a8mr69573505ywa.29.1561075473316; Thu, 20 Jun 2019 17:04:33 -0700 (PDT) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id 199sm280205ywr.101.2019.06.20.17.04.32 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 17:04:32 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r349243 - head/sys/cam To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906202029.x5KKThjn017867@repo.freebsd.org> <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <42dbbc7f-51ea-bc3d-0432-5cc9b872d0e7@FreeBSD.org> Date: Thu, 20 Jun 2019 20:04:32 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9EEB36DDA8 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.979,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:04:35 -0000 Hi Scott, You may see this buffer content is not returned directly to user any more. It is used only as temporary storage to pull CDAI_TYPE_SCSI_DEVID, which is then converted into readable form, returned to user. And the code is explicitly made to not read outside the range that was copied to the buffer with simple and dumb memcpy(). The effect is clearly visible in profiler when GEOM confxml calls it 3 times for each disk, taking about 25% of the sysctl's CPU time. With hundreds of disks it is not so small. On 20.06.2019 18:59, Scott Long wrote: > Hi Alexander, > > I’m not a fan of removing the M_ZERO. I understand your argument that > lengths are provided elsewhere, but having the buffer be zero’d is defensive > against future bugs that might leak buffer contents. GETATTR isn’t typically > in a performance path, is there any measurable benefit to this? > > Thanks, > Scott > > >> On Jun 20, 2019, at 2:29 PM, Alexander Motin wrote: >> >> Author: mav >> Date: Thu Jun 20 20:29:42 2019 >> New Revision: 349243 >> URL: https://svnweb.freebsd.org/changeset/base/349243 >> >> Log: >> Optimize xpt_getattr(). >> >> Do not allocate temporary buffer for attributes we are going to return >> as-is, just make sure to NUL-terminate them. Do not zero temporary 64KB >> buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled >> and there are also length fields inside the returned data also. >> >> MFC after: 2 weeks >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/cam/cam_xpt.c >> >> Modified: head/sys/cam/cam_xpt.c >> ============================================================================== >> --- head/sys/cam/cam_xpt.c Thu Jun 20 20:06:19 2019 (r349242) >> +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 (r349243) >> @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >> cdai.ccb_h.func_code = XPT_DEV_ADVINFO; >> cdai.flags = CDAI_FLAG_NONE; >> cdai.bufsiz = len; >> + cdai.buf = buf; >> >> if (!strcmp(attr, "GEOM::ident")) >> cdai.buftype = CDAI_TYPE_SERIAL_NUM; >> @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >> strcmp(attr, "GEOM::lunname") == 0) { >> cdai.buftype = CDAI_TYPE_SCSI_DEVID; >> cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; >> + cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); >> + if (cdai.buf == NULL) { >> + ret = ENOMEM; >> + goto out; >> + } >> } else >> goto out; >> >> - cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); >> - if (cdai.buf == NULL) { >> - ret = ENOMEM; >> - goto out; >> - } >> xpt_action((union ccb *)&cdai); /* can only be synchronous */ >> if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) >> cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); >> @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >> ret = EFAULT; >> } >> } else { >> - ret = 0; >> - if (strlcpy(buf, cdai.buf, len) >= len) >> + if (cdai.provsiz < len) { >> + cdai.buf[cdai.provsiz] = 0; >> + ret = 0; >> + } else >> ret = EFAULT; >> } >> >> out: >> - if (cdai.buf != NULL) >> + if ((char *)cdai.buf != buf) >> free(cdai.buf, M_CAMXPT); >> return ret; >> } >> > -- Alexander Motin From owner-svn-src-head@freebsd.org Fri Jun 21 00:16:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57BCD15CBC7D; Fri, 21 Jun 2019 00:16: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 EEC1B6E205; Fri, 21 Jun 2019 00:16:46 +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 C3AD51B84D; Fri, 21 Jun 2019 00:16:46 +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 x5L0GkBB039799; Fri, 21 Jun 2019 00:16:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L0GVEc039716; Fri, 21 Jun 2019 00:16:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906210016.x5L0GVEc039716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Jun 2019 00:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349253 - in head: . release/picobsd/bridge release/picobsd/qemu share/man/man4 sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/mips/mediatek sys/pow... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . release/picobsd/bridge release/picobsd/qemu share/man/man4 sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/mips/mediatek sys/powerpc/conf sys/powerpc/con... X-SVN-Commit-Revision: 349253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEC1B6E205 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.979,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:16:47 -0000 Author: cem Date: Fri Jun 21 00:16:30 2019 New Revision: 349253 URL: https://svnweb.freebsd.org/changeset/base/349253 Log: sys: Remove DEV_RANDOM device option Remove 'device random' from kernel configurations that reference it (most). Replace perhaps mistaken 'nodevice random' in two MIPS configs with 'options RANDOM_LOADABLE' instead. Document removal in UPDATING; update NOTES and random.4. Reviewed by: delphij, markm (previous version) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19918 Modified: head/UPDATING head/release/picobsd/bridge/PICOBSD head/release/picobsd/qemu/PICOBSD head/share/man/man4/random.4 head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/ALPINE head/sys/arm/conf/ARMADA38X head/sys/arm/conf/ARMADAXP head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/GENERIC head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/RPI-B head/sys/arm/conf/RT1310 head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SOCFPGA head/sys/arm/conf/TEGRA124 head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/i386/conf/MINIMAL head/sys/mips/conf/BCM head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/ERL head/sys/mips/conf/JZ4780 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/PICOSTATION_M2HP head/sys/mips/conf/WZR-300HP head/sys/mips/conf/WZR-HPAG300H head/sys/mips/conf/X1000 head/sys/mips/conf/std.AR5312 head/sys/mips/conf/std.AR5315 head/sys/mips/conf/std.AR_MIPS_BASE head/sys/mips/conf/std.BERI head/sys/mips/conf/std.MALTA head/sys/mips/conf/std.XLP head/sys/mips/mediatek/std.mediatek head/sys/mips/mediatek/std.rt2880 head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/powerpc/conf/QORIQ64 head/sys/powerpc/conf/dpaa/DPAA head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sys/random.h head/tools/tools/nanobsd/pcengines/ALIX_DSK head/tools/tools/tinybsd/conf/bridge/TINYBSD head/tools/tools/tinybsd/conf/default/TINYBSD head/tools/tools/tinybsd/conf/firewall/TINYBSD head/tools/tools/tinybsd/conf/minimal/TINYBSD head/tools/tools/tinybsd/conf/vpn/TINYBSD head/tools/tools/tinybsd/conf/wireless/TINYBSD head/tools/tools/tinybsd/conf/wrap/TINYBSD Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jun 21 00:01:12 2019 (r349252) +++ head/UPDATING Fri Jun 21 00:16:30 2019 (r349253) @@ -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".) +20190620: + The "device random" option has been removed. Entropy collection and + the /dev/random device are no longer an optional component. + Implementations of distilling algorithms can still be made loadable + with "options RANDOM_LOADABLE" (e.g., random_fortuna.ko). + 20190612: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 8.0.1. Please see the 20141231 entry below for Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/release/picobsd/bridge/PICOBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -50,7 +50,6 @@ device if_bridge # qemu, so we set HZ explicitly. options HZ=1000 -device random # used by ssh device pci # Floppy drives Modified: head/release/picobsd/qemu/PICOBSD ============================================================================== --- head/release/picobsd/qemu/PICOBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/release/picobsd/qemu/PICOBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -56,7 +56,6 @@ device if_bridge # qemu, so we set HZ explicitly. options HZ=1000 -device random # used by ssh device pci # Floppy drives Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Fri Jun 21 00:01:12 2019 (r349252) +++ head/share/man/man4/random.4 Fri Jun 21 00:16:30 2019 (r349253) @@ -30,7 +30,6 @@ .Nm random .Nd the entropy device .Sh SYNOPSIS -.Cd "device random" .Cd "options RANDOM_LOADABLE" .Cd "options RANDOM_ENABLE_ETHER" .Cd "options RANDOM_ENABLE_UMA" Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/amd64/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -309,7 +309,6 @@ device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/amd64/conf/MINIMAL Fri Jun 21 00:16:30 2019 (r349253) @@ -10,7 +10,7 @@ # some features (ACL, GJOURNAL) that GENERIC includes. # o acpi as a module has been reported flakey and not well tested, so # is included in the kernel. -# o random is included due to uncertaty... +# o (non-loaded) random is included due to uncertainty... # o Many networking things are included # # For now, please run changes to these list past imp@freebsd.org @@ -131,7 +131,6 @@ device agp # support several AGP chipsets # Pseudo devices. device loop # Network loopback -device random # Entropy device device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support Modified: head/sys/arm/conf/ALPINE ============================================================================== --- head/sys/arm/conf/ALPINE Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/ALPINE Fri Jun 21 00:16:30 2019 (r349253) @@ -41,7 +41,6 @@ device al_udma # Universal DMA # Pseudo devices device loop -device random device pty device md device gpio Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/ARMADA38X Fri Jun 21 00:16:30 2019 (r349253) @@ -25,7 +25,6 @@ options SMP options VM_KMEM_SIZE_MAX=0x9CCD000 # Pseudo devices -device random device pty device loop device md Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/ARMADAXP Fri Jun 21 00:16:30 2019 (r349253) @@ -46,7 +46,6 @@ options NO_FFS_SNAPSHOT options NO_SWAPPING # Pseudo devices -device random device pty device loop device md Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/DB-78XXX Fri Jun 21 00:16:30 2019 (r349253) @@ -45,7 +45,6 @@ device pci # Pseudo devices device loop device md -device random # Serial ports device uart Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/DB-88F5XXX Fri Jun 21 00:16:30 2019 (r349253) @@ -44,7 +44,6 @@ device pci # Pseudo devices device md device loop -device random # Serial ports device uart Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/DB-88F6XXX Fri Jun 21 00:16:30 2019 (r349253) @@ -46,7 +46,6 @@ device pci # Pseudo devices device loop device md -device random # Serial ports device uart Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/DOCKSTAR Fri Jun 21 00:16:30 2019 (r349253) @@ -68,7 +68,6 @@ device gif # IPv6 and IPv4 tunneling device loop # Network loopback device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys -device random # Entropy device device tuntap # Packet tunnel. device ether # Required for all ethernet devices device vlan # 802.1Q VLAN support Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/DREAMPLUG-1001 Fri Jun 21 00:16:30 2019 (r349253) @@ -71,7 +71,6 @@ device gif # IPv6 and IPv4 tunneling device loop # Network loopback device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys -device random # Entropy device device tuntap # Packet tunnel. device ether # Required for all ethernet devices device vlan # 802.1Q VLAN support Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/EFIKA_MX Fri Jun 21 00:16:30 2019 (r349253) @@ -57,7 +57,6 @@ device bpf # Berkeley packet filter # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support #device vlan # 802.1Q VLAN support #device tuntap # Packet tunnel. Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -121,7 +121,6 @@ device pl011 device pty device snp device md # Memory "disks" -device random # Entropy device device firmware # firmware assist module device pl310 # PL310 L2 cache controller device psci Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/IMX53 Fri Jun 21 00:16:30 2019 (r349253) @@ -44,7 +44,6 @@ device bpf # Berkeley packet filter # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support #device vlan # 802.1Q VLAN support #device tuntap # Packet tunnel. Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/IMX6 Fri Jun 21 00:16:30 2019 (r349253) @@ -49,7 +49,6 @@ device mpcore_timer # Pseudo devices. device loop # Network loopback -device random # Entropy device device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. device md # Memory "disks" Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/RPI-B Fri Jun 21 00:16:30 2019 (r349253) @@ -65,7 +65,6 @@ device iicbus device bcm2835_bsc device md -device random # Entropy device # USB support device usb Modified: head/sys/arm/conf/RT1310 ============================================================================== --- head/sys/arm/conf/RT1310 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/RT1310 Fri Jun 21 00:16:30 2019 (r349253) @@ -51,7 +51,6 @@ options WITNESS_SKIPSPIN # Don't run witness on spinl device loop device md device pty -device random # Serial ports device uart Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/SHEEVAPLUG Fri Jun 21 00:16:30 2019 (r349253) @@ -46,7 +46,6 @@ options BOOTP_WIRED_TO=mge0 # Pseudo devices device loop -device random # Serial ports device uart Modified: head/sys/arm/conf/SOCFPGA ============================================================================== --- head/sys/arm/conf/SOCFPGA Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/SOCFPGA Fri Jun 21 00:16:30 2019 (r349253) @@ -58,7 +58,6 @@ device dwmmc # Pseudo devices device loop -device random device pty device md device gpio Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/TEGRA124 Fri Jun 21 00:16:30 2019 (r349253) @@ -43,7 +43,6 @@ device regulator # Pseudo devices. device loop # Network loopback -device random # Entropy device device vlan # 802.1Q VLAN support #device tuntap # Packet tunnel. device md # Memory "disks" Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/TS7800 Fri Jun 21 00:16:30 2019 (r349253) @@ -45,7 +45,6 @@ device pci # Pseudo devices device md device loop -device random # Serial ports device uart Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/VERSATILEPB Fri Jun 21 00:16:30 2019 (r349253) @@ -66,7 +66,6 @@ options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device md -device random # Entropy device options PLATFORM Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/VYBRID Fri Jun 21 00:16:30 2019 (r349253) @@ -59,7 +59,6 @@ device sdhci # generic sdhci # Pseudo devices device loop -device random device pty device md device gpio Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm/conf/ZEDBOARD Fri Jun 21 00:16:30 2019 (r349253) @@ -48,7 +48,6 @@ device pl310 # PL310 L2 cache controller device mpcore_timer device loop -device random device ether device cgem # Zynq-7000 gig ethernet device device mii Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/arm64/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -293,7 +293,6 @@ device aw_cir # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/conf/NOTES Fri Jun 21 00:16:30 2019 (r349253) @@ -1170,9 +1170,6 @@ options NFS_DEBUG # Enable NFS Debugging # options EXT2FS -# Cryptographically secure random number generator; /dev/random -device random - # The system memory devices; /dev/mem, /dev/kmem device mem Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/conf/files Fri Jun 21 00:16:30 2019 (r349253) @@ -686,14 +686,14 @@ crypto/des/des_ecb.c optional crypto | ipsec | ipsec_ crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ - ipsec | ipsec_support | random !random_loadable | wlan_ccmp -crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | random !random_loadable + ipsec | ipsec_support | !random_loadable | wlan_ccmp +crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | !random_loadable crypto/rijndael/rijndael-api.c optional crypto | ipsec | ipsec_support | \ wlan_ccmp crypto/sha1.c optional carp | crypto | ether | ipsec | \ ipsec_support | netgraph_mppc_encryption | sctp crypto/sha2/sha256c.c optional crypto | ekcd | geom_bde | ipsec | \ - ipsec_support | random !random_loadable | sctp | zfs + ipsec_support | !random_loadable | sctp | zfs crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | \ ipsec_support | zfs crypto/skein/skein.c optional crypto | zfs @@ -2766,11 +2766,11 @@ rt2860.fw optional rt2860fw | ralfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" -dev/random/random_infra.c optional random -dev/random/random_harvestq.c optional random -dev/random/randomdev.c optional random !random_loadable -dev/random/fortuna.c optional random !random_loadable -dev/random/hash.c optional random !random_loadable +dev/random/random_infra.c standard +dev/random/random_harvestq.c standard +dev/random/randomdev.c optional !random_loadable +dev/random/fortuna.c optional !random_loadable +dev/random/hash.c optional !random_loadable dev/rc/rc.c optional rc dev/rccgpio/rccgpio.c optional rccgpio gpio dev/re/if_re.c optional re Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/conf/files.arm64 Fri Jun 21 00:16:30 2019 (r349253) @@ -87,7 +87,7 @@ arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt -arm/broadcom/bcm2835/bcm2835_rng.c optional random !random_loadable soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_rng.c optional !random_loadable soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/conf/files.powerpc Fri Jun 21 00:16:30 2019 (r349253) @@ -62,7 +62,7 @@ dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c standard dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx -dev/random/darn.c optional powerpc64 random !random_loadable +dev/random/darn.c optional powerpc64 !random_loadable dev/scc/scc_bfe_macio.c optional scc powermac dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci dev/sec/sec.c optional sec mpc85xx Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/conf/options Fri Jun 21 00:16:30 2019 (r349253) @@ -734,7 +734,6 @@ DEV_PCI opt_pci.h DEV_PF opt_pf.h DEV_PFLOG opt_pf.h DEV_PFSYNC opt_pf.h -DEV_RANDOM opt_global.h DEV_SPLASH opt_splash.h DEV_VLAN opt_vlan.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/i386/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -292,7 +292,6 @@ device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/i386/conf/MINIMAL Fri Jun 21 00:16:30 2019 (r349253) @@ -10,7 +10,7 @@ # some features (ACL, GJOURNAL) that GENERIC includes. # o acpi as a module has been reported flakey and not well tested, so # is included in the kernel. -# o random is included due to uncertaty... +# o (non-loaded) random is included due to uncertainty... # o Many networking things are included # # For now, please run changes to these list past imp@freebsd.org @@ -132,7 +132,6 @@ device agp # support several AGP chipsets # Pseudo devices. device loop # Network loopback -device random # Entropy device device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/BCM Fri Jun 21 00:16:30 2019 (r349253) @@ -82,7 +82,6 @@ device uart #Base device loop device ether -device random device md #Performance Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/DIR-825B1 Fri Jun 21 00:16:30 2019 (r349253) @@ -21,7 +21,6 @@ hints "DIR-825B1.hints" # Since the kernel image must fit inside 1024KiB, we have to build almost # everything as modules. -# nodevice random nodevice gpio nodevice gpioled nodevice gif Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/ERL Fri Jun 21 00:16:30 2019 (r349253) @@ -149,7 +149,6 @@ device wlan_amrr # AMRR transmit rate control algorit # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/JZ4780 Fri Jun 21 00:16:30 2019 (r349253) @@ -68,7 +68,6 @@ device miibus device bpf device md device uart -device random device fdt_pinctrl Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/OCTEON1 Fri Jun 21 00:16:30 2019 (r349253) @@ -184,7 +184,6 @@ device ral # Ralink Technology RT2500 wireless NICs. # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/PB92 Fri Jun 21 00:16:30 2019 (r349253) @@ -133,5 +133,4 @@ device loop device ether #device md #device bpf -device random #device if_bridge Modified: head/sys/mips/conf/PICOSTATION_M2HP ============================================================================== --- head/sys/mips/conf/PICOSTATION_M2HP Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/PICOSTATION_M2HP Fri Jun 21 00:16:30 2019 (r349253) @@ -68,6 +68,3 @@ device arswitch # Enable GPIO device gpio device gpioled - -# RNG -device random Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/WZR-300HP Fri Jun 21 00:16:30 2019 (r349253) @@ -49,4 +49,4 @@ device hwpmc # load these via modules, shrink kernel nodevice if_bridge nodevice bridgestp -nodevice random +options RANDOM_LOADABLE Modified: head/sys/mips/conf/WZR-HPAG300H ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/WZR-HPAG300H Fri Jun 21 00:16:30 2019 (r349253) @@ -49,4 +49,4 @@ device hwpmc # load these via modules, shrink kernel nodevice if_bridge nodevice bridgestp -nodevice random +options RANDOM_LOADABLE Modified: head/sys/mips/conf/X1000 ============================================================================== --- head/sys/mips/conf/X1000 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/X1000 Fri Jun 21 00:16:30 2019 (r349253) @@ -63,7 +63,6 @@ device miibus device bpf device md device uart -device random device fdt_pinctrl Modified: head/sys/mips/conf/std.AR5312 ============================================================================== --- head/sys/mips/conf/std.AR5312 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.AR5312 Fri Jun 21 00:16:30 2019 (r349253) @@ -72,7 +72,6 @@ device loop device ether device md device bpf -device random options ARGE_DEBUG # Enable if_arge debugging for now Modified: head/sys/mips/conf/std.AR5315 ============================================================================== --- head/sys/mips/conf/std.AR5315 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.AR5315 Fri Jun 21 00:16:30 2019 (r349253) @@ -72,7 +72,6 @@ device loop device ether device md device bpf -device random options ARGE_DEBUG # Enable if_arge debugging for now Modified: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- head/sys/mips/conf/std.AR_MIPS_BASE Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.AR_MIPS_BASE Fri Jun 21 00:16:30 2019 (r349253) @@ -25,9 +25,6 @@ makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_ makeoptions MODULES_OVERRIDE+="if_bridge bridgestp usb" makeoptions MODULES_OVERRIDE+="alq" -# Random - required during early boot! -device random - # net80211 options IEEE80211_DEBUG options IEEE80211_SUPPORT_MESH Modified: head/sys/mips/conf/std.BERI ============================================================================== --- head/sys/mips/conf/std.BERI Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.BERI Fri Jun 21 00:16:30 2019 (r349253) @@ -61,5 +61,4 @@ device ether device geom_map device loop device md -device random device snp Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.MALTA Fri Jun 21 00:16:30 2019 (r349253) @@ -55,4 +55,3 @@ device miibus device bpf device md device uart -device random Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/conf/std.XLP Fri Jun 21 00:16:30 2019 (r349253) @@ -66,7 +66,6 @@ makeoptions FDT_DTS_FILE=xlp-basic.dts # Pseudo device loop -device random device md device bpf Modified: head/sys/mips/mediatek/std.mediatek ============================================================================== --- head/sys/mips/mediatek/std.mediatek Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/mediatek/std.mediatek Fri Jun 21 00:16:30 2019 (r349253) @@ -74,9 +74,6 @@ device fdt_pinctrl # UART support device uart -# random support -device random - # loop device support device loop Modified: head/sys/mips/mediatek/std.rt2880 ============================================================================== --- head/sys/mips/mediatek/std.rt2880 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/mips/mediatek/std.rt2880 Fri Jun 21 00:16:30 2019 (r349253) @@ -73,9 +73,6 @@ device fdt_pinctrl # UART support device uart -# random support -device random - # loop device support device loop Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -162,7 +162,6 @@ device fxp # Intel EtherExpress PRO/100B (82557, 825 # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/GENERIC64 Fri Jun 21 00:16:30 2019 (r349253) @@ -183,7 +183,6 @@ device rl # RealTek 8129/8139 # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/MPC85XX Fri Jun 21 00:16:30 2019 (r349253) @@ -93,7 +93,6 @@ device mmcsd device pass device pci device quicc -device random #device rl device scbus device scc Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/MPC85XXSPE Fri Jun 21 00:16:30 2019 (r349253) @@ -94,7 +94,6 @@ device mmcsd device pass device pci device quicc -device random #device rl device scbus device scc Modified: head/sys/powerpc/conf/QORIQ64 ============================================================================== --- head/sys/powerpc/conf/QORIQ64 Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/QORIQ64 Fri Jun 21 00:16:30 2019 (r349253) @@ -99,7 +99,6 @@ device mmc device mmcsd device pass device pci -device random #device rl device scbus device scc Modified: head/sys/powerpc/conf/dpaa/DPAA ============================================================================== --- head/sys/powerpc/conf/dpaa/DPAA Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/powerpc/conf/dpaa/DPAA Fri Jun 21 00:16:30 2019 (r349253) @@ -96,7 +96,6 @@ device pci # Pseudo devices device ether # Ethernet support device loop # Network loopback -device random # Entropy device device bpf # Berkeley packet filter device md # Memory "disks" Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/riscv/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -137,7 +137,6 @@ options ZSTDIO # zstd-compressed kernel and user du # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/sparc64/conf/GENERIC Fri Jun 21 00:16:30 2019 (r349253) @@ -224,7 +224,6 @@ device ath_rate_sample # SampleRate tx rate control f # Pseudo devices. device crypto # core crypto support device loop # Network loopback -device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Fri Jun 21 00:01:12 2019 (r349252) +++ head/sys/sys/random.h Fri Jun 21 00:16:30 2019 (r349253) @@ -37,26 +37,9 @@ struct uio; -#if defined(DEV_RANDOM) void read_random(void *, u_int); int read_random_uio(struct uio *, bool); bool is_random_seeded(void); -#else -static __inline int -read_random_uio(void *a __unused, u_int b __unused) -{ - return (0); -} -static __inline void -read_random(void *a __unused, u_int b __unused) -{ -} -static __inline bool -is_random_seeded(void) -{ - return (false); -} -#endif /* * Note: if you add or remove members of random_entropy_source, remember to @@ -101,7 +84,6 @@ _Static_assert(ENTROPYSOURCE <= 32, #define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" #define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" -#if defined(DEV_RANDOM) extern u_int hc_source_mask; void random_harvest_queue_(const void *, u_int, enum random_entropy_source); void random_harvest_fast_(const void *, u_int); @@ -133,13 +115,6 @@ random_harvest_direct(const void *entropy, u_int size, void random_harvest_register_source(enum random_entropy_source); void random_harvest_deregister_source(enum random_entropy_source); -#else -#define random_harvest_queue(a, b, c) do {} while (0) -#define random_harvest_fast(a, b, c) do {} while (0) -#define random_harvest_direct(a, b, c) do {} while (0) -#define random_harvest_register_source(a) do {} while (0) -#define random_harvest_deregister_source(a) do {} while (0) -#endif #if defined(RANDOM_ENABLE_UMA) #define random_harvest_fast_uma(a, b, c) random_harvest_fast(a, b, c) Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jun 21 00:16:30 2019 (r349253) @@ -65,7 +65,6 @@ device ath_hal device ath_rate_sample device wi device loop -device random device ether device tun device pty Modified: head/tools/tools/tinybsd/conf/bridge/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/bridge/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/bridge/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -130,7 +130,6 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" Modified: head/tools/tools/tinybsd/conf/default/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/default/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/default/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -140,7 +140,6 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device ppp # Kernel PPP device tun # Packet tunnel. Modified: head/tools/tools/tinybsd/conf/firewall/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/firewall/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/firewall/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -129,7 +129,6 @@ device wlan # 802.11 support # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" Modified: head/tools/tools/tinybsd/conf/minimal/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/minimal/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/minimal/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -65,7 +65,6 @@ device pmtimer # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" Modified: head/tools/tools/tinybsd/conf/vpn/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/vpn/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/vpn/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -130,7 +130,6 @@ device xe # Xircom pccard Ethernet # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device ppp # Kernel PPP device tun # Packet tunnel. Modified: head/tools/tools/tinybsd/conf/wireless/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/wireless/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/wireless/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -136,7 +136,6 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" Modified: head/tools/tools/tinybsd/conf/wrap/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/wrap/TINYBSD Fri Jun 21 00:01:12 2019 (r349252) +++ head/tools/tools/tinybsd/conf/wrap/TINYBSD Fri Jun 21 00:16:30 2019 (r349253) @@ -102,7 +102,6 @@ device ath_rate_sample # Pseudo devices. device loop # Network loopback -device random # Entropy device device ether # Ethernet support device ppp # Kernel PPP device tun # Packet tunnel. From owner-svn-src-head@freebsd.org Fri Jun 21 00:24:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F1215CBED0; Fri, 21 Jun 2019 00:24:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 320496E67F; Fri, 21 Jun 2019 00:24:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id h10so4387477ljg.0; Thu, 20 Jun 2019 17:24: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:from:date :message-id:subject:to:cc; bh=VlIboitvJ2toxKWj+darijoWRULHSEfG0NPmFZFetJc=; b=uDbevFyTES/T8eEOvpIRPWpB92IklOJZOp3zDcUfEUsPdNZdLS26YkSKtALjFxcseT 7g2g/uu/j+W3D0e+FoX2YMEt5vzSGsEJYo64/v26m1ek8g42HipWZRm7Fa1PGgUFGDts BBiAsu0ot+QRtHySrMHu5CsBwD9bK/8MS5C9G8JV1SlVQRdvyx02OFG6LKKu9smAJoxR ojUXWMCVFAAY9EaCy9Scws9UxLpl89R3/I8qiiz6V0wTDDUTAaq2KhhoWaytCjaDf+pi N9Ea5M62Xf7Po1h3f8spdvJMpY+jsDSngkyfn2s3E6MCRMTAAG5XPv4fBW6iA7KRNCBO 0PAg== X-Gm-Message-State: APjAAAX/G6I3qjB0hKbJOcowsCvkiwGA5dSJP/2mJg6zBJP6JOEctUFc KrEx/9i+Ud8ljDzXW+GqX+NYFvE2vypljuiET4H/kT3KzJ4= X-Google-Smtp-Source: APXvYqxNX3zCdeuQvVriihaw4PUhW7kCHZ7uBAidXhm5F1wK2CDw7dghuYSlbxbPIr8ctg2LVMZVArru0xODchFY8go= X-Received: by 2002:a2e:2c07:: with SMTP id s7mr31336989ljs.44.1561076690316; Thu, 20 Jun 2019 17:24:50 -0700 (PDT) MIME-Version: 1.0 References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> <20190621013236.N5105@besplex.bde.org> <20190621033049.D5823@besplex.bde.org> In-Reply-To: From: Alan Somers Date: Thu, 20 Jun 2019 18:24:38 -0600 Message-ID: Subject: Re: svn commit: r349233 - head/sys/sys To: Warner Losh Cc: Bruce Evans , Ian Lepore , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 320496E67F 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.979,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:24:53 -0000 On Thu, Jun 20, 2019 at 1:43 PM Warner Losh wrote: > > > > On Thu, Jun 20, 2019, 11:44 AM Bruce Evans wrote: >> >> On Thu, 20 Jun 2019, Alan Somers wrote: >> >> > On Thu, Jun 20, 2019 at 10:43 AM Bruce Evans wrote: >> >> Summary: and the headers that it includes should declare >> >> minimal types to compile (so __int64_t is enough). Most uses of this >> >> header require including domain-specific headers which declare the >> >> relevant data structures. >> > >> > Bruce, would you be satisfied by switching from to >> > and from int64_t to __int64_t? >> >> Not quite. The kernel block number type is daddr_t, and [__]int64_t is >> a hard coding of that. Hard-coding of typedefs is good for reducing >> namespace pollution, but it is not done for the nearby use of off_t. >> >> Unfortunately, daddr_t is only declared in . >> >> The type daddr_t seems to be correct, but ffs conflates it with >> ufs2_daddr_t. It is only for blocks of size DEV_BSIZE, while fs blocks >> are usually larger. The conflation is just a style bug because 64 bits >> should be large enough for anyone and ffs does the necessary conversions >> between DEV_BSIZE-blocks and fs-blocks. >> >> ext2fs seems to be more broken in this area. It doesn't have >> ext2fs_daddr_t, but hard-codes this as int32_t or int64_t. int32_t >> became very broken when ext2fs started attempting to support unsigned >> block numbers. Now, ext2_bmap() corrupts "daddr_t a_bn" to "int32_t >> bn" when it calls ext4_bmapext(). This has a chance of working via >> unsign-extension bugs provided a_bn fits in uint64_t. It is sure to >> fit for a valid a_bn, but perhaps your new ioctl allows probing for >> panics using invalid a_bn. ext2_bmap() also calls ext2_bmaparray(). >> That used to have essentially the same style bugs as ffs (with the >> ext2fs type corresponding to ufs2_daddr_t spelled int32_t), but it now >> correctly uses daddr_t. Internally, it misuses daddr_t for ext2fs >> block numbers, and there is an ext2fs block number type after all >> (e2fs_lbn_t = int64_t) which it uses only for metalbn. >> >> It looks like the older ext2fs code was fixed, especially if older ext2fs >> is limited to int32_t block numbers, but the ext4 case is quite broken >> since unsign extension bugs don't help it. a_bn starts as int64_t, then >> is truncated to the function arg "int32_t bn", then the function assigns bn >> to "int64_t lbn" and doesn't use bn again. >> >> Using a generic int64_t type in all interfaces would avoid some of these >> bugs, so I don't mind using it for the API. Just add a note that it must >> be large enough to represent all useful values of daddr_t. > > > Maybe we should add a __daddr_t define to sys/_types.h? And the usual reshuffling. That would also fix the namespace pollution. > > Warner See https://reviews.freebsd.org/D20715 . From owner-svn-src-head@freebsd.org Fri Jun 21 00:33:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F5C715CC146; Fri, 21 Jun 2019 00:33:46 +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 E68746EB82; Fri, 21 Jun 2019 00:33:45 +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 D06751BBC5; Fri, 21 Jun 2019 00:33:45 +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 x5L0XjsM049995; Fri, 21 Jun 2019 00:33:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L0XjuW049994; Fri, 21 Jun 2019 00:33:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906210033.x5L0XjuW049994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Jun 2019 00:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349254 - head X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 349254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E68746EB82 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:33:46 -0000 Author: cem Date: Fri Jun 21 00:33:45 2019 New Revision: 349254 URL: https://svnweb.freebsd.org/changeset/base/349254 Log: Fixup UPDATING text for r349253 Requested by: delphij Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jun 21 00:16:30 2019 (r349253) +++ head/UPDATING Fri Jun 21 00:33:45 2019 (r349254) @@ -32,8 +32,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20190620: - The "device random" option has been removed. Entropy collection and - the /dev/random device are no longer an optional component. + Entropy collection and the /dev/random device are no longer optional + components. The "device random" option has been removed. Implementations of distilling algorithms can still be made loadable with "options RANDOM_LOADABLE" (e.g., random_fortuna.ko). From owner-svn-src-head@freebsd.org Fri Jun 21 02:37:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3610115CDFB3; Fri, 21 Jun 2019 02:37:56 +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 C5EDC7197F; Fri, 21 Jun 2019 02:37:55 +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 949E91CFA5; Fri, 21 Jun 2019 02:37:55 +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 x5L2bt0a012722; Fri, 21 Jun 2019 02:37:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L2bt8I012721; Fri, 21 Jun 2019 02:37:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906210237.x5L2bt8I012721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Jun 2019 02:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349256 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 349256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5EDC7197F 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.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 02:37:56 -0000 Author: cem Date: Fri Jun 21 02:37:54 2019 New Revision: 349256 URL: https://svnweb.freebsd.org/changeset/base/349256 Log: rc.d/motd: Update motd more robustly Use appropriate fsyncs to persist the rewritten /etc/motd file, when a rewrite is performed. Reported by: Jonathan Walton Reviewed by: allanjude, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20701 Modified: head/libexec/rc/rc.d/motd Modified: head/libexec/rc/rc.d/motd ============================================================================== --- head/libexec/rc/rc.d/motd Fri Jun 21 00:52:30 2019 (r349255) +++ head/libexec/rc/rc.d/motd Fri Jun 21 02:37:54 2019 (r349256) @@ -37,11 +37,15 @@ motd_start() uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} - cmp -s $T /etc/motd || { - cp $T /etc/motd + if ! cmp -s $T /etc/motd; then + mv -f $T /etc/.motd.tmp + fsync /etc/.motd.tmp + mv -f /etc/.motd.tmp /etc/motd chmod ${PERMS} /etc/motd - } - rm -f $T + fsync /etc + else + rm -f $T + fi check_startmsgs && echo '.' } From owner-svn-src-head@freebsd.org Fri Jun 21 02:49:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9D8215CE264; Fri, 21 Jun 2019 02:49:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55C6F71E03; Fri, 21 Jun 2019 02:49:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22C1F1D165; Fri, 21 Jun 2019 02:49:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5L2nbtT018109; Fri, 21 Jun 2019 02:49:37 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L2nbYa018108; Fri, 21 Jun 2019 02:49:37 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201906210249.x5L2nbYa018108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 21 Jun 2019 02:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349257 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55C6F71E03 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.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 02:49:37 -0000 Author: kevlo Date: Fri Jun 21 02:49:36 2019 New Revision: 349257 URL: https://svnweb.freebsd.org/changeset/base/349257 Log: Correct function names. Modified: head/share/man/man9/iflibdi.9 Modified: head/share/man/man9/iflibdi.9 ============================================================================== --- head/share/man/man9/iflibdi.9 Fri Jun 21 02:37:54 2019 (r349256) +++ head/share/man/man9/iflibdi.9 Fri Jun 21 02:49:36 2019 (r349257) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd May 24, 2017 +.Dd May 21, 2019 .Dt IFLIBDI 9 .Os .Sh NAME @@ -194,10 +194,10 @@ Allocate and initialize the \fIif_ctx_t\fP structure. Setup and initialize the MSI or MSI/X interrupt queues if necessary. Allocate memory for queues and qset structure setup. -.It Fn iflib_device_irq_alloc +.It Fn iflib_irq_alloc Allocate an interrupt resource for a given rid value with an associated filter and handler function. -.It Fn iflib_device_irq_alloc_generic +.It Fn iflib_irq_alloc_generic Performs the same function as iflib_device_irq_alloc along with the additional functionality of adding a taskgroup. The data fields and callback function are determined by the type of interrupt, From owner-svn-src-head@freebsd.org Fri Jun 21 03:09:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FB815CE9A8; Fri, 21 Jun 2019 03:09:28 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "eg.sd.rdtc.ru", Issuer "eg.sd.rdtc.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32D5F72BE9; Fri, 21 Jun 2019 03:09:27 +0000 (UTC) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: cem@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x5L39FCE031649 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 21 Jun 2019 10:09:15 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r349256 - head/libexec/rc/rc.d To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906210237.x5L2bt8I012721@repo.freebsd.org> From: Eugene Grosbein Message-ID: Date: Fri, 21 Jun 2019 10:09:10 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201906210237.x5L2bt8I012721@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 32D5F72BE9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 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.95)[-0.947,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 03:09:29 -0000 21.06.2019 9:37, Conrad Meyer wrote: > Author: cem > Date: Fri Jun 21 02:37:54 2019 > New Revision: 349256 > URL: https://svnweb.freebsd.org/changeset/base/349256 > > Log: > rc.d/motd: Update motd more robustly > > Use appropriate fsyncs to persist the rewritten /etc/motd file, when a > rewrite is performed. > > Reported by: Jonathan Walton > Reviewed by: allanjude, vangyzen > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20701 > > Modified: > head/libexec/rc/rc.d/motd > > Modified: head/libexec/rc/rc.d/motd > ============================================================================== > --- head/libexec/rc/rc.d/motd Fri Jun 21 00:52:30 2019 (r349255) > +++ head/libexec/rc/rc.d/motd Fri Jun 21 02:37:54 2019 (r349256) > @@ -37,11 +37,15 @@ motd_start() > uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} > awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} > > - cmp -s $T /etc/motd || { > - cp $T /etc/motd > + if ! cmp -s $T /etc/motd; then > + mv -f $T /etc/.motd.tmp > + fsync /etc/.motd.tmp > + mv -f /etc/.motd.tmp /etc/motd > chmod ${PERMS} /etc/motd > - } > - rm -f $T > + fsync /etc > + else > + rm -f $T > + fi > > check_startmsgs && echo '.' > } Why do we need fsync while updating small plain text file? From owner-svn-src-head@freebsd.org Fri Jun 21 03:49:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155AB15CF202; Fri, 21 Jun 2019 03:49:37 +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 B0CAB73B56; Fri, 21 Jun 2019 03:49:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A0AE1DBE2; Fri, 21 Jun 2019 03:49: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 x5L3na7N050080; Fri, 21 Jun 2019 03:49:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L3naat050079; Fri, 21 Jun 2019 03:49:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906210349.x5L3naat050079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 21 Jun 2019 03:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349261 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 349261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0CAB73B56 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.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 03:49:37 -0000 Author: imp Date: Fri Jun 21 03:49:36 2019 New Revision: 349261 URL: https://svnweb.freebsd.org/changeset/base/349261 Log: Mount and unmount devfs around calls to add packages. pkg now uses /dev/null for some of its operations. NanoBSD's packaging stuff didn't mount that for the chroot it ran in, so any config that added packages would see the error: pkg: Cannot open /dev/null:No such file or directory when trying to actually add those packages. It's easy enough for nanobsd to mount /dev and it won't hurt anything that was already working and may help things that weren't (like this). I moved the mount/unmount pair to be in the right push/pop order from the submitted patch. PR: 238727 Submitted by: mike tancsa Tested by: Karl Denninger Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jun 21 03:17:27 2019 (r349260) +++ head/tools/tools/nanobsd/defaults.sh Fri Jun 21 03:49:36 2019 (r349261) @@ -778,8 +778,9 @@ cust_pkgng ( ) ( # Mount packages into chroot mkdir -p ${NANO_WORLDDIR}/_.p mount -t nullfs -o noatime -o ro ${NANO_PACKAGE_DIR} ${NANO_WORLDDIR}/_.p + mount -t devfs devfs ${NANO_WORLDDIR}/dev - trap "umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT + trap "umount ${NANO_WORLDDIR}/dev; umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT # Install pkg-* package CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" @@ -804,6 +805,7 @@ cust_pkgng ( ) ( CR0 "${PKGCMD} info" trap - 1 2 15 EXIT + umount ${NANO_WORLDDIR}/dev umount ${NANO_WORLDDIR}/_.p rm -rf ${NANO_WORLDDIR}/_.p ) From owner-svn-src-head@freebsd.org Fri Jun 21 07:29:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4769E15D2F3E; Fri, 21 Jun 2019 07:29:03 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E358783E20; Fri, 21 Jun 2019 07:29:02 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C045320070; Fri, 21 Jun 2019 07:29:02 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5L7T2mu064466; Fri, 21 Jun 2019 07:29:02 GMT (envelope-from syrinx@FreeBSD.org) Received: (from syrinx@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L7T2An064465; Fri, 21 Jun 2019 07:29:02 GMT (envelope-from syrinx@FreeBSD.org) Message-Id: <201906210729.x5L7T2An064465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: syrinx set sender to syrinx@FreeBSD.org using -f From: Shteryana Shopova Date: Fri, 21 Jun 2019 07:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349264 - head/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: head X-SVN-Commit-Author: syrinx X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 349264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E358783E20 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.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 07:29:03 -0000 Author: syrinx Date: Fri Jun 21 07:29:02 2019 New Revision: 349264 URL: https://svnweb.freebsd.org/changeset/base/349264 Log: Unbreak snmp_pf(3) after the changes introduced in r338209 PR: 237011 Event: Vienna Hackathon 2019 MFC after: 2 weeks Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jun 21 04:57:23 2019 (r349263) +++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jun 21 07:29:02 2019 (r349264) @@ -907,7 +907,7 @@ pf_tbladdr(struct snmp_context __unused *ctx, struct s } int -pf_altq(struct snmp_context __unused *ctx, struct snmp_value *val, +pf_altq_num(struct snmp_context __unused *ctx, struct snmp_value *val, u_int sub, u_int __unused vindex, enum snmp_op op) { asn_subid_t which = val->var.subs[sub - 1]; Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Fri Jun 21 04:57:23 2019 (r349263) +++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Fri Jun 21 07:29:02 2019 (r349264) @@ -174,7 +174,7 @@ ) ) (10 pfAltq - (1 pfAltqQueueNumber INTEGER32 pf_altq GET) + (1 pfAltqQueueNumber INTEGER32 pf_altq_num GET) (2 pfAltqQueueTable (1 pfAltqQueueEntry : INTEGER32 pf_altqq (1 pfAltqQueueIndex INTEGER32) From owner-svn-src-head@freebsd.org Fri Jun 21 07:46:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1155E15D352D; Fri, 21 Jun 2019 07:46:00 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA0FD8487E; Fri, 21 Jun 2019 07:45:59 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38B1F203D5; Fri, 21 Jun 2019 07:45:59 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5L7jwhd074912; Fri, 21 Jun 2019 07:45:58 GMT (envelope-from syrinx@FreeBSD.org) Received: (from syrinx@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L7jwAJ074911; Fri, 21 Jun 2019 07:45:58 GMT (envelope-from syrinx@FreeBSD.org) Message-Id: <201906210745.x5L7jwAJ074911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: syrinx set sender to syrinx@FreeBSD.org using -f From: Shteryana Shopova Date: Fri, 21 Jun 2019 07:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349265 - head/usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Group: head X-SVN-Commit-Author: syrinx X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Commit-Revision: 349265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA0FD8487E 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 07:46:00 -0000 Author: syrinx Date: Fri Jun 21 07:45:58 2019 New Revision: 349265 URL: https://svnweb.freebsd.org/changeset/base/349265 Log: No need for each bsnmpd(1) module to open connection to syslog bsnmpd(1) main does that early on init and the connection is available to all loaded modules Event: Vienna Hackathon 2019 PR: 233431 , 221487 MFC after: 2 weeks Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Fri Jun 21 07:29:02 2019 (r349264) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Fri Jun 21 07:45:58 2019 (r349265) @@ -100,7 +100,6 @@ lm75_init(struct lmodule *mod, int argc __unused, char module = mod; lm75_sensors = 0; - openlog("snmp_lm75", LOG_NDELAY | LOG_PID, LOG_DAEMON); return(0); } From owner-svn-src-head@freebsd.org Fri Jun 21 07:58:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4015B15D3A46; Fri, 21 Jun 2019 07:58:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D842C84F27; Fri, 21 Jun 2019 07:58:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A680520579; Fri, 21 Jun 2019 07:58:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5L7w8po080488; Fri, 21 Jun 2019 07:58:08 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L7w8hp080487; Fri, 21 Jun 2019 07:58:08 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201906210758.x5L7w8hp080487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 21 Jun 2019 07:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349266 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 349266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D842C84F27 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.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 07:58:09 -0000 Author: kp Date: Fri Jun 21 07:58:08 2019 New Revision: 349266 URL: https://svnweb.freebsd.org/changeset/base/349266 Log: ip_output: pass PFIL_FWD in the slow path If we take the slow path for forwarding we should still tell our firewalls (hooked through pfil(9)) that we're forwarding. Pass the ip_output() flags to ip_output_pfil() so it can set the PFIL_FWD flag when we're forwarding. MFC after: 1 week Sponsored by: Axiado Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Jun 21 07:45:58 2019 (r349265) +++ head/sys/netinet/ip_output.c Fri Jun 21 07:58:08 2019 (r349266) @@ -109,20 +109,24 @@ extern int in_mcast_loop; extern struct protosw inetsw[]; static inline int -ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, - struct sockaddr_in *dst, int *fibnum, int *error) +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, int flags, + struct inpcb *inp, struct sockaddr_in *dst, int *fibnum, int *error) { struct m_tag *fwd_tag = NULL; struct mbuf *m; struct in_addr odst; struct ip *ip; + int pflags = PFIL_OUT; + if (flags & IP_FORWARDING) + pflags |= PFIL_FWD; + m = *mp; ip = mtod(m, struct ip *); /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - switch (pfil_run_hooks(V_inet_pfil_head, mp, ifp, PFIL_OUT, inp)) { + switch (pfil_run_hooks(V_inet_pfil_head, mp, ifp, pflags, inp)) { case PFIL_DROPPED: *error = EPERM; /* FALLTHROUGH */ @@ -653,7 +657,8 @@ sendit: /* Jump over all PFIL processing if hooks are not active. */ if (PFIL_HOOKED_OUT(V_inet_pfil_head)) { - switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, &error)) { + switch (ip_output_pfil(&m, ifp, flags, inp, dst, &fibnum, + &error)) { case 1: /* Finished */ goto done; From owner-svn-src-head@freebsd.org Fri Jun 21 08:24:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D31F715D45BC; Fri, 21 Jun 2019 08:24:52 +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 4AF4F8635A; Fri, 21 Jun 2019 08:24:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 4D89D14A175; Fri, 21 Jun 2019 18:24:49 +1000 (AEST) Date: Fri, 21 Jun 2019 18:24:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Alan Somers , Ian Lepore , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r349233 - head/sys/sys In-Reply-To: Message-ID: <20190621181031.X814@besplex.bde.org> References: <201906201435.x5KEZTqH021513@repo.freebsd.org> <54f3bc97cbb485cdcc44b81c82c149ac9e46d42f.camel@freebsd.org> <20190621013236.N5105@besplex.bde.org> <20190621033049.D5823@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=Y7VpVtdrFqipLqLOIW4A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 4AF4F8635A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 08:24:53 -0000 On Thu, 20 Jun 2019, Warner Losh wrote: > On Thu, Jun 20, 2019, 11:44 AM Bruce Evans wrote: > >> On Thu, 20 Jun 2019, Alan Somers wrote: >> >>> On Thu, Jun 20, 2019 at 10:43 AM Bruce Evans >> wrote: >>>> Summary: and the headers that it includes should declare >>>> minimal types to compile (so __int64_t is enough). Most uses of this >>>> header require including domain-specific headers which declare the >>>> relevant data structures. >>> >>> Bruce, would you be satisfied by switching from to >>> and from int64_t to __int64_t? >> >> Not quite. The kernel block number type is daddr_t, and [__]int64_t is >> a hard coding of that. Hard-coding of typedefs is good for reducing >> namespace pollution, but it is not done for the nearby use of off_t. >> >> Unfortunately, daddr_t is only declared in . >> >> [... related type/units errors in ffs and ext2fs] >> Using a generic int64_t type in all interfaces would avoid some of these >> bugs, so I don't mind using it for the API. Just add a note that it must >> be large enough to represent all useful values of daddr_t. > > Maybe we should add a __daddr_t define to sys/_types.h? And the usual > reshuffling. That would also fix the namespace pollution. OK. ABI's should use only fixed-width types to be stable, and APIs should use only basic types to be stable, but avoiding typedefs (except to fixed- width types) would be a larger project, with few existing examples. Bruce From owner-svn-src-head@freebsd.org Fri Jun 21 09:41:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A14715D5AD6; Fri, 21 Jun 2019 09:41:29 +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 E22D088BCF; Fri, 21 Jun 2019 09:41:28 +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 D8FFF3DCD16; Fri, 21 Jun 2019 19:41:16 +1000 (AEST) Date: Fri, 21 Jun 2019 19:41:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349248 - in head/sys: fs/fifofs kern sys In-Reply-To: <201906202307.x5KN7LLB002088@repo.freebsd.org> Message-ID: <20190621185323.C1023@besplex.bde.org> References: <201906202307.x5KN7LLB002088@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=-mX6YWkVlwCD4PSfj4sA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: E22D088BCF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 09:41:29 -0000 On Thu, 20 Jun 2019, Alan Somers wrote: > Log: > fcntl: fix overflow when setting F_READAHEAD > > VOP_READ and VOP_WRITE take the seqcount in blocks in a 16-bit field. > However, fcntl allows you to set the seqcount in bytes to any nonnegative > 31-bit value. The result can be a 16-bit overflow, which will be > sign-extended in functions like ffs_read. Fix this by sanitizing the > argument in kern_fcntl. As a matter of policy, limit to IO_SEQMAX rather > than INT16_MAX. > ... > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Thu Jun 20 22:21:42 2019 (r349247) > +++ head/sys/kern/vfs_vnops.c Thu Jun 20 23:07:20 2019 (r349248) > @@ -499,7 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp) > * closely related to the best I/O size for real disks than > * to any block size used by software. > */ > - fp->f_seqcount += howmany(uio->uio_resid, 16384); > + fp->f_seqcount += MIN(IO_SEQMAX, > + howmany(uio->uio_resid, 16384)); > if (fp->f_seqcount > IO_SEQMAX) > fp->f_seqcount = IO_SEQMAX; This already limited the result to IO_SEQMAX. Now it limits the result to IO_SEQMAX twice. Using MIN() is a style bug. 4.4BSD removed the MIN() macro from the kernel and replaced it by *min() inline functions. MIN() was restored because too much contribed code used it, but it should not be used in core code. However, *min() is not type-generic, so it is hard to use. Using f_seqcount = imin(IO_SEQMAX, howmany(uio->uio_resid, 16384)); would restore the overflow bug. This code worked originally when uio_resid had type int. It was broken by changing uio_resid's type to ssize_t. This makes howmany(uio->uio_resid, 16384) have type ssize_t too, and its value overflows on assignment to "int f_seqcount" before the value is clamped to IO_SEQMAX, whenever uio_resid is especially preposterously large (2G * 16384) on 64-bit systems which pretend to support such silly i/o sizes. imin() is as bad as the blind assignment to an int, since its prototype cause blind conversion to int. I have some macros for *min() which optionally detect such type errors or just do much the same as MIN() (but using inline functions), but these are not quite of production quality. The case where one arg has a signed type and the other arg has a signed type is hardest to handle. This has sign extension or unsign extension bugs in general. MIN() blindly does the extension. The overflow usually only causes negative f_seqcount which should be treated as 0. > return (fp->f_seqcount << IO_SEQSHIFT); > > Modified: head/sys/sys/file.h > ============================================================================== > --- head/sys/sys/file.h Thu Jun 20 22:21:42 2019 (r349247) > +++ head/sys/sys/file.h Thu Jun 20 23:07:20 2019 (r349248) > @@ -179,7 +179,10 @@ struct file { > /* > * DTYPE_VNODE specific fields. > */ > - int f_seqcount; /* (a) Count of sequential accesses. */ > + union { > + int16_t f_seqcount; /* (a) Count of sequential accesses. */ > + int f_pipegen; > + }; > off_t f_nextoff; /* next expected read/write offset. */ > union { > struct cdev_privdata *fvn_cdevpriv; f_seqcount should still have type int. Conversion of any type smaller than int to int just wastes time, and int16_t is a bogus type for holding values limited to 0x7F. int for f_seqcount costs no space, since f_pipegen still has the correct type and the union is padded to at least the size of its largest member. This struct has delicate ordering which usually minimizes padding, although it violates style(9) for most integer members. Before f_seqcount, there are some pointers, then 2 shorts and 2 u_int's, so 64-bit alignment occurs after f_seqcount on 64-bit arches, just in time for there to be no padding before the 64-bit f_offset. style(9) requires sorting all the 64-bit types first. My macros look like: XX #define __min(x, y) \ XX ( \ XX (sizeof(x) == 8 || sizeof(y) == 8) ? \ XX ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ XX _qmin((x), (y)) \ XX : \ XX _uqmin((x), (y)) \ XX : \ XX ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ XX _imin((x), (y)) \ XX : \ XX _min((x), (y)) \ XX ) XX XX #ifdef MACRO_MIN XX static __inline int _imin(int a, int b) { return (a < b ? a : b); } XX ... XX #define imin(a, b) __min((a), (b)) XX #else XX #ifdef __GNUC__ XX static __inline int imin(int a, int b) { return (a < b ? a : b); } XX #endif XX #endif One reason that these are not production quality is that they require gnu __typeof() but production quality must work with any C compiler. This worked with gcc-1 or 2. Later versions of gcc have better support for type-generic functions, but that is even more unportable. These can be used to find type errors: compile without and with MACRO_MIN. If the object code changes, then the non-underscored function must have had wrong types since the type-generic macro selected a sub-version with different types. Bruce From owner-svn-src-head@freebsd.org Fri Jun 21 10:54:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B7C15D6B8A; Fri, 21 Jun 2019 10:54:53 +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 066AC8AA78; Fri, 21 Jun 2019 10:54:53 +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 D6EEF223B2; Fri, 21 Jun 2019 10:54:52 +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 x5LAsqCx076538; Fri, 21 Jun 2019 10:54:52 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LAspOH076532; Fri, 21 Jun 2019 10:54:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201906211054.x5LAspOH076532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 21 Jun 2019 10:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349267 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Commit-Revision: 349267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 066AC8AA78 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 10:54:53 -0000 Author: ae Date: Fri Jun 21 10:54:51 2019 New Revision: 349267 URL: https://svnweb.freebsd.org/changeset/base/349267 Log: Add "tcpmss" opcode to match the TCP MSS value. With this opcode it is possible to match TCP packets with specified MSS option, whose value corresponds to configured in opcode value. It is allowed to specify single value, range of values, or array of specific values or ranges. E.g. # ipfw add deny log tcp from any to any tcpmss 0-500 Reviewed by: melifaro,bcr Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Jun 21 07:58:08 2019 (r349266) +++ head/sbin/ipfw/ipfw.8 Fri Jun 21 10:54:51 2019 (r349267) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2019 +.Dd June 21, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -1989,6 +1989,12 @@ a non-zero offset. See the .Cm frag option for details on matching fragmented packets. +.It Cm tcpmss Ar tcpmss-list +Matches TCP packets whose MSS (maximum segment size) value is set to +.Ar tcpmss-list , +which is either a single value or a list of values or ranges +specified in the same way as +.Ar ports . .It Cm tcpseq Ar seq TCP packets only. Match if the TCP header sequence number field is set to Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Jun 21 07:58:08 2019 (r349266) +++ head/sbin/ipfw/ipfw2.c Fri Jun 21 10:54:51 2019 (r349267) @@ -338,6 +338,7 @@ static struct _s_x rule_options[] = { { "tcpdatalen", TOK_TCPDATALEN }, { "tcpflags", TOK_TCPFLAGS }, { "tcpflgs", TOK_TCPFLAGS }, + { "tcpmss", TOK_TCPMSS }, { "tcpoptions", TOK_TCPOPTS }, { "tcpopts", TOK_TCPOPTS }, { "tcpseq", TOK_TCPSEQ }, @@ -881,6 +882,7 @@ static struct _s_x _port_name[] = { {"ipttl", O_IPTTL}, {"mac-type", O_MAC_TYPE}, {"tcpdatalen", O_TCPDATALEN}, + {"tcpmss", O_TCPMSS}, {"tcpwin", O_TCPWIN}, {"tagged", O_TAGGED}, {NULL, 0} @@ -1588,6 +1590,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPMSS: case O_TCPWIN: if (F_LEN(cmd) == 1) { switch (cmd->opcode) { @@ -1603,6 +1606,9 @@ print_instruction(struct buf_pr *bp, const struct form case O_TCPDATALEN: s = "tcpdatalen"; break; + case O_TCPMSS: + s = "tcpmss"; + break; case O_TCPWIN: s = "tcpwin"; break; @@ -4709,14 +4715,18 @@ read_options: av++; break; + case TOK_TCPMSS: case TOK_TCPWIN: - NEED1("tcpwin requires length"); + NEED1("tcpmss/tcpwin requires size"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) - errx(EX_DATAERR, "invalid tcpwin len %s", *av); + if (add_ports(cmd, *av, 0, + i == TOK_TCPWIN ? O_TCPWIN : O_TCPMSS, + cblen) == NULL) + errx(EX_DATAERR, "invalid %s size %s", + s, *av); } else - fill_cmd(cmd, O_TCPWIN, 0, - strtoul(*av, NULL, 0)); + fill_cmd(cmd, i == TOK_TCPWIN ? O_TCPWIN : + O_TCPMSS, 0, strtoul(*av, NULL, 0)); av++; break; Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Fri Jun 21 07:58:08 2019 (r349266) +++ head/sbin/ipfw/ipfw2.h Fri Jun 21 10:54:51 2019 (r349267) @@ -151,6 +151,7 @@ enum tokens { TOK_TCPOPTS, TOK_TCPSEQ, TOK_TCPACK, + TOK_TCPMSS, TOK_TCPWIN, TOK_ICMPTYPES, TOK_MAC, Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Jun 21 07:58:08 2019 (r349266) +++ head/sys/netinet/ip_fw.h Fri Jun 21 10:54:51 2019 (r349267) @@ -293,6 +293,7 @@ enum ipfw_opcodes { /* arguments (4 byte each) */ O_EXTERNAL_DATA, /* variable length data */ O_SKIP_ACTION, /* none */ + O_TCPMSS, /* arg1=MSS value */ O_LAST_OPCODE /* not an opcode! */ }; Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Jun 21 07:58:08 2019 (r349266) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Jun 21 10:54:51 2019 (r349267) @@ -331,10 +331,10 @@ ipopts_match(struct ip *ip, ipfw_insn *cmd) } static int -tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) +tcpopts_parse(struct tcphdr *tcp, uint16_t *mss) { - int optlen, bits = 0; u_char *cp = (u_char *)(tcp + 1); + int optlen, bits = 0; int x = (tcp->th_off << 2) - sizeof(struct tcphdr); for (; x > 0; x -= optlen, cp += optlen) { @@ -350,12 +350,13 @@ tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) } switch (opt) { - default: break; case TCPOPT_MAXSEG: bits |= IP_FW_TCPOPT_MSS; + if (mss != NULL) + *mss = be16dec(cp + 2); break; case TCPOPT_WINDOW: @@ -370,13 +371,19 @@ tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) case TCPOPT_TIMESTAMP: bits |= IP_FW_TCPOPT_TS; break; - } } - return (flags_match(cmd, bits)); + return (bits); } static int +tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) +{ + + return (flags_match(cmd, tcpopts_parse(tcp, NULL))); +} + +static int iface_match(struct ifnet *ifp, ipfw_insn_if *cmd, struct ip_fw_chain *chain, uint32_t *tablearg) { @@ -2314,6 +2321,31 @@ do { \ match = (proto == IPPROTO_TCP && offset == 0 && ((ipfw_insn_u32 *)cmd)->d[0] == TCP(ulp)->th_ack); + break; + + case O_TCPMSS: + if (proto == IPPROTO_TCP && + (args->f_id._flags & TH_SYN) != 0 && + ulp != NULL) { + uint16_t mss, *p; + int i; + + PULLUP_LEN(hlen, ulp, + (TCP(ulp)->th_off << 2)); + if ((tcpopts_parse(TCP(ulp), &mss) & + IP_FW_TCPOPT_MSS) == 0) + break; + if (cmdlen == 1) { + match = (cmd->arg1 == mss); + break; + } + /* Otherwise we have ranges. */ + p = ((ipfw_insn_u16 *)cmd)->ports; + i = cmdlen - 1; + for (; !match && i > 0; i--, p += 2) + match = (mss >= p[0] && + mss <= p[1]); + } break; case O_TCPWIN: Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Jun 21 07:58:08 2019 (r349266) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Jun 21 10:54:51 2019 (r349267) @@ -1176,7 +1176,9 @@ move_objects(struct ip_fw_chain *ch, ipfw_range_tlv *r } } return (c); -}/* +} + +/* * Changes set of given rule rannge @rt * with each other. * @@ -1907,6 +1909,7 @@ check_ipfw_rule_body(ipfw_insn *cmd, int cmd_len, stru case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPMSS: case O_TCPWIN: case O_TAGGED: if (cmdlen < 1 || cmdlen > 31) From owner-svn-src-head@freebsd.org Fri Jun 21 13:42:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF0015A6918; Fri, 21 Jun 2019 13:42:41 +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 85EC669ABC; Fri, 21 Jun 2019 13:42:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56AB724007; Fri, 21 Jun 2019 13:42:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5LDgfJs066788; Fri, 21 Jun 2019 13:42:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LDgfWA066787; Fri, 21 Jun 2019 13:42:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906211342.x5LDgfWA066787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Jun 2019 13:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349268 - head/sys/dev/nand X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/nand X-SVN-Commit-Revision: 349268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85EC669ABC 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 13:42:42 -0000 Author: emaste Date: Fri Jun 21 13:42:40 2019 New Revision: 349268 URL: https://svnweb.freebsd.org/changeset/base/349268 Log: nandsim: correct test to avoid out-of-bounds access Previously nandsim_chip_status returned EINVAL iff both of user-provided chip->ctrl_num and chip->num were out of bounds. If only one failed the bounds check arbitrary memory would be read and returned. The NAND framework is not built by default, nandsim is not intended for production use (it is a simulator), and the nandsim device has root-only permissions. admbugs: 827 Reported by: Daniel Hodson of elttam MFC after: 3 days Security: kernel information leak or DoS Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/nand/nandsim.c Modified: head/sys/dev/nand/nandsim.c ============================================================================== --- head/sys/dev/nand/nandsim.c Fri Jun 21 10:54:51 2019 (r349267) +++ head/sys/dev/nand/nandsim.c Fri Jun 21 13:42:40 2019 (r349268) @@ -295,7 +295,7 @@ nandsim_chip_status(struct sim_chip *chip) nand_debug(NDBG_SIM,"status for chip num:%d at ctrl:%d", chip->num, chip->ctrl_num); - if (chip->ctrl_num >= MAX_SIM_DEV && + if (chip->ctrl_num >= MAX_SIM_DEV || chip->num >= MAX_CTRL_CS) return (EINVAL); From owner-svn-src-head@freebsd.org Fri Jun 21 13:51:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4957E15A6ABC; Fri, 21 Jun 2019 13:51:29 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0: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 54C2B69FFC; Fri, 21 Jun 2019 13:51:28 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: by mail-ot1-x341.google.com with SMTP id l15so6334722otn.9; Fri, 21 Jun 2019 06:51: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=poANa9w6rCvlPCyvf8LEXFCYuEMrylyIQva2JhcZcfk=; b=FpTvNB8RFyuwU54NVIXAOLuXMb/W8wWHpvFJpxuThQACRFrun+hUCBSN5mJD+1wQNR WVaQ70QSi3QUA9x5lK7QWT2kPnXV/w7/mATIF9kUith4QXTzL8kDESpBPxQmZHulHUIq LXNTWxOV5G3lUq7ghUB6hC/KdTbaJIvIkRaB1kYgUxMhTk72nvmwymNYnqugNFAswgjJ XoCV2Z6cbhG0eDLdEVunNlVSjws4rBAb7PBY40xhLxXRVzRKefYkOMMl/o9gr1R3Timj +/tuFowhMaBB08ooiquNOSyIENg+j6zxK4oag5IxrTueFPdGCOW4Ccdid5R7MNkhAHzn FKAA== 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=poANa9w6rCvlPCyvf8LEXFCYuEMrylyIQva2JhcZcfk=; b=oJ5fpjr8OJemkHTy5YLsYGHb0WvJ3eYD9zYcmBW7kpJ0vfXFGFbmmKrYAIzIA1+twd RTUWn/EJ/GU5StIHjxYn5OJrBwQKfZAV4wNABRoNfOZWQB1Qv+3WfkI1qyezlfQ/YthA ITbPncYt86yZ4Yoy/iiWpslBX8+927Xolz6LrnZLIaheoDzx7oI41aTlnma66ILFm44Z rIV96CMPqB0Hg/wfLukLJyHSZmrsGBV9CS16MnlWJnTrH6/JC2YEjfIy8XWfNrcGbkIN uXVTn25r07r+CYX+5Wv8Bcbjb9Xnh/EBxs32+cbb3uh2HVMd8GVJ45+XTBlEGV/0uy/X AGoA== X-Gm-Message-State: APjAAAVZgG35snaZU/xR48JfKv92aEIGqDUmxO36LrdbB77Lma9YNiNb C/hrligtv9tya4MQME2Kkb/SFEbubfE0rxN8DBZixL2y X-Google-Smtp-Source: APXvYqwrHvU86/HwMSnA2Ire99m5M0weVkGd4S+9kEBPKpzsG2KqDBRGlgwwQDnm5jH+eJpbhJHlZhCedUpK9yrfpSg= X-Received: by 2002:a9d:c22:: with SMTP id 31mr26045130otr.48.1561125086638; Fri, 21 Jun 2019 06:51:26 -0700 (PDT) MIME-Version: 1.0 References: <201906102150.x5ALo8wL089525@repo.freebsd.org> In-Reply-To: From: Luiz Otavio O Souza Date: Fri, 21 Jun 2019 10:51:15 -0300 Message-ID: Subject: Re: svn commit: r348882 - head/sys/dev/sdhci To: "Bjoern A. Zeeb" Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 54C2B69FFC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FpTvNB8R; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of listsbr@gmail.com designates 2607:f8b0:4864:20::341 as permitted sender) smtp.mailfrom=listsbr@gmail.com X-Spamd-Result: default: False [-4.19 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; 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.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; IP_SCORE(-0.82)[ip: (1.42), ipnet: 2607:f8b0::/32(-3.14), asn: 15169(-2.32), country: US(-0.06)]; NEURAL_HAM_SHORT(-0.36)[-0.362,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 13:51:29 -0000 On Fri, 14 Jun 2019 at 05:25, Bjoern A. Zeeb wrote: > > On 10 Jun 2019, at 21:50, Luiz Otavio O Souza wrote: > > > Author: loos > > Date: Mon Jun 10 21:50:07 2019 > > New Revision: 348882 > > URL: https://svnweb.freebsd.org/changeset/base/348882 > > > > Log: > > Add support for the GPIO SD Card VCC regulator/switch and the GPIO > > SD Card > > detection pins to the Marvell Xenon SDHCI controller. > > > > These features are enable by 'vqmmc-supply' and 'cd-gpios' > > properties in the > > DTS. > > > > This fixes the SD Card detection on espressobin. > > Do you have a copy or a reference to such a (working) dts file? I'm using the in tree DTS for the espresso bin: sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts Now that it works, I think we could build it by default. Luiz From owner-svn-src-head@freebsd.org Fri Jun 21 14:01:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F1715A6DD9; Fri, 21 Jun 2019 14:01:03 +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 079E06A61F; Fri, 21 Jun 2019 14:01:03 +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 D7A9F241D0; Fri, 21 Jun 2019 14:01: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 x5LE120j073467; Fri, 21 Jun 2019 14:01:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LE12vu073466; Fri, 21 Jun 2019 14:01:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906211401.x5LE12vu073466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Jun 2019 14:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349269 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 349269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 079E06A61F 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 14:01:03 -0000 Author: ian Date: Fri Jun 21 14:01:02 2019 New Revision: 349269 URL: https://svnweb.freebsd.org/changeset/base/349269 Log: Some mundane tweaks and cleanups to help de-clutter the diffs of some upcoming functional changes. Add an ofw_compat_data table for probing compat strings, and use it to add PNP data. Remove some stray semicolons at the end of macro definitions, and add a PWM_LOCK_ASSERT macro to round out the usual suite. Move the device_t and driver_methods structs to the end of the file. Tweak comments. Modified: head/sys/arm/ti/am335x/am335x_ehrpwm.c Modified: head/sys/arm/ti/am335x/am335x_ehrpwm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_ehrpwm.c Fri Jun 21 13:42:40 2019 (r349268) +++ head/sys/arm/ti/am335x/am335x_ehrpwm.c Fri Jun 21 14:01:02 2019 (r349269) @@ -53,13 +53,14 @@ __FBSDID("$FreeBSD$"); #define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PWM_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) #define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ device_get_nameunit(_sc->sc_dev), "am335x_ehrpwm softc", MTX_DEF) #define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) -#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res, reg); +#define EPWM_READ2(_sc, reg) bus_read_2((_sc)->sc_mem_res, reg) #define EPWM_WRITE2(_sc, reg, value) \ - bus_write_2((_sc)->sc_mem_res, reg, value); + bus_write_2((_sc)->sc_mem_res, reg, value) #define EPWM_TBCTL 0x00 #define TBCTL_FREERUN (2 << 14) @@ -140,7 +141,8 @@ struct am335x_ehrpwm_softc { struct mtx sc_mtx; struct resource *sc_mem_res; int sc_mem_rid; - /* sysctl for configuration */ + + /* Things used for configuration via sysctl [deprecated]. */ int sc_pwm_clkdiv; int sc_pwm_freq; struct sysctl_oid *sc_clkdiv_oid; @@ -153,22 +155,13 @@ struct am335x_ehrpwm_softc { uint32_t sc_pwm_dutyB; }; -static device_method_t am335x_ehrpwm_methods[] = { - DEVMETHOD(device_probe, am335x_ehrpwm_probe), - DEVMETHOD(device_attach, am335x_ehrpwm_attach), - DEVMETHOD(device_detach, am335x_ehrpwm_detach), - - DEVMETHOD_END +static struct ofw_compat_data compat_data[] = { + {"ti,am33xx-ehrpwm", true}, + {NULL, false}, }; +SIMPLEBUS_PNP_INFO(compat_data); -static driver_t am335x_ehrpwm_driver = { - "am335x_ehrpwm", - am335x_ehrpwm_methods, - sizeof(struct am335x_ehrpwm_softc), -}; -static devclass_t am335x_ehrpwm_devclass; - static void am335x_ehrpwm_freq(struct am335x_ehrpwm_softc *sc) { @@ -337,7 +330,7 @@ am335x_ehrpwm_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "ti,am33xx-ehrpwm")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "AM335x EHRPWM"); @@ -365,7 +358,7 @@ am335x_ehrpwm_attach(device_t dev) goto fail; } - /* Init backlight interface */ + /* Init sysctl interface */ ctx = device_get_sysctl_ctx(sc->sc_dev); tree = device_get_sysctl_tree(sc->sc_dev); @@ -441,6 +434,22 @@ am335x_ehrpwm_detach(device_t dev) return (0); } + +static device_method_t am335x_ehrpwm_methods[] = { + DEVMETHOD(device_probe, am335x_ehrpwm_probe), + DEVMETHOD(device_attach, am335x_ehrpwm_attach), + DEVMETHOD(device_detach, am335x_ehrpwm_detach), + + DEVMETHOD_END +}; + +static driver_t am335x_ehrpwm_driver = { + "pwm", + am335x_ehrpwm_methods, + sizeof(struct am335x_ehrpwm_softc), +}; + +static devclass_t am335x_ehrpwm_devclass; DRIVER_MODULE(am335x_ehrpwm, am335x_pwmss, am335x_ehrpwm_driver, am335x_ehrpwm_devclass, 0, 0); MODULE_VERSION(am335x_ehrpwm, 1); From owner-svn-src-head@freebsd.org Fri Jun 21 14:10:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9143415AF294; Fri, 21 Jun 2019 14:10:38 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (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 707576AC4B; Fri, 21 Jun 2019 14:10:32 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id x5LEATYX070214; Fri, 21 Jun 2019 16:10:29 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 5552FDEC; Fri, 21 Jun 2019 16:10:29 +0200 (CEST) Subject: Re: svn commit: r346976 - head/usr.sbin/mountd To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904302138.x3ULcdQR011997@repo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <3687e455-4b63-cc74-249e-2a4ea680091f@omnilan.de> Date: Fri, 21 Jun 2019 16:10:28 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201904302138.x3ULcdQR011997@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 21 Jun 2019 16:10:29 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 707576AC4B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-6.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[omnilan.de]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.50)[ip: (-9.23), ipnet: 2a00:e10:2800::/38(-4.56), asn: 25074(-3.69), country: DE(-0.01)]; MX_GOOD(-0.01)[mx0.gentlemail.de]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25074, ipnet:2a00:e10:2800::/38, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 14:10:38 -0000 Am 30.04.2019 um 23:38 schrieb Alexander Motin: > Author: mav > Date: Tue Apr 30 21:38:38 2019 > New Revision: 346976 > URL: https://svnweb.freebsd.org/changeset/base/346976 > > Log: > Respect quotes and escapes when splitting exports fields. > > Without this r293305 was still unable to handle names with spaces. > > MFC after: 1 week Hi Alexander, could you please have a look into https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238725 This commit breaks -maproot for :groupX definition in exports(5). Since this was also MFCd to stable/11 (in r347341), I hope this can be fixed quickly and RE approves the fix for 11.3. Thanks, -harry From owner-svn-src-head@freebsd.org Fri Jun 21 14:24:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DA1615AF85B; Fri, 21 Jun 2019 14:24:34 +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 41A916B557; Fri, 21 Jun 2019 14:24:34 +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 0FF17246B9; Fri, 21 Jun 2019 14:24:34 +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 x5LEOXvh088050; Fri, 21 Jun 2019 14:24:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LEOX4p088049; Fri, 21 Jun 2019 14:24:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906211424.x5LEOX4p088049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Jun 2019 14:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349270 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 349270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41A916B557 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 14:24:35 -0000 Author: ian Date: Fri Jun 21 14:24:33 2019 New Revision: 349270 URL: https://svnweb.freebsd.org/changeset/base/349270 Log: Add support for the PWM(9) API. This allows configuring the pwm output using pwm(9), but also maintains the historical sysctl config interface for compatiblity with existing apps. The two config systems are not compatible with each other; if you use both interfaces to change configurations you're likely to end up with incorrect output or none at all. Modified: head/sys/arm/ti/am335x/am335x_ehrpwm.c Modified: head/sys/arm/ti/am335x/am335x_ehrpwm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_ehrpwm.c Fri Jun 21 14:01:02 2019 (r349269) +++ head/sys/arm/ti/am335x/am335x_ehrpwm.c Fri Jun 21 14:24:33 2019 (r349270) @@ -45,12 +45,33 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pwmbus_if.h" + #include "am335x_pwm.h" +/******************************************************************************* + * Enhanced resolution PWM driver. Many of the advanced featues of the hardware + * are not supported by this driver. What is implemented here is simple + * variable-duty-cycle PWM output. + * + * Note that this driver was historically configured using a set of sysctl + * variables/procs, and later gained support for the PWM(9) API. The sysctl + * code is still present to support existing apps, but that interface is + * considered deprecated. + * + * An important caveat is that the original sysctl interface and the new PWM API + * cannot both be used at once. If both interfaces are used to change + * configuration, it's quite likely you won't get the expected results. Also, + * reading the sysctl values after configuring via PWM will not return the right + * results. + ******************************************************************************/ + /* In ticks */ #define DEFAULT_PWM_PERIOD 1000 #define PWM_CLOCK 100000000UL +#define NS_PER_SEC 1000000000 + #define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define PWM_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -120,6 +141,11 @@ __FBSDID("$FreeBSD$"); #define AQCTL_ZRO_TOGGLE (3 << 0) #define EPWM_AQSFRC 0x1a #define EPWM_AQCSFRC 0x1c +#define AQCSFRC_OFF 0 +#define AQCSFRC_LO 1 +#define AQCSFRC_HI 2 +#define AQCSFRC_MASK 3 +#define AQCSFRC(chan, hilo) ((hilo) << (2 * chan)) /* Trip-Zone module */ #define EPWM_TZCTL 0x28 @@ -136,8 +162,16 @@ static device_detach_t am335x_ehrpwm_detach; static int am335x_ehrpwm_clkdiv[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; +struct ehrpwm_channel { + u_int duty; /* on duration, in ns */ + bool enabled; /* channel enabled? */ + bool inverted; /* signal inverted? */ +}; +#define NUM_CHANNELS 2 + struct am335x_ehrpwm_softc { device_t sc_dev; + device_t sc_busdev; struct mtx sc_mtx; struct resource *sc_mem_res; int sc_mem_rid; @@ -153,6 +187,12 @@ struct am335x_ehrpwm_softc { uint32_t sc_pwm_period; uint32_t sc_pwm_dutyA; uint32_t sc_pwm_dutyB; + + /* Things used for configuration via pwm(9) api. */ + u_int sc_clkfreq; /* frequency in Hz */ + u_int sc_clktick; /* duration in ns */ + u_int sc_period; /* duration in ns */ + struct ehrpwm_channel sc_channels[NUM_CHANNELS]; }; static struct ofw_compat_data compat_data[] = { @@ -161,8 +201,118 @@ static struct ofw_compat_data compat_data[] = { }; SIMPLEBUS_PNP_INFO(compat_data); +static void +am335x_ehrpwm_cfg_duty(struct am335x_ehrpwm_softc *sc, u_int chan, u_int duty) +{ + u_int tbcmp; + if (duty == 0) + tbcmp = 0; + else + tbcmp = max(1, duty / sc->sc_clktick); + + sc->sc_channels[chan].duty = tbcmp * sc->sc_clktick; + + PWM_LOCK_ASSERT(sc); + EPWM_WRITE2(sc, (chan == 0) ? EPWM_CMPA : EPWM_CMPB, tbcmp); +} + static void +am335x_ehrpwm_cfg_enable(struct am335x_ehrpwm_softc *sc, u_int chan, bool enable) +{ + uint16_t regval; + + sc->sc_channels[chan].enabled = enable; + + /* + * Turn off any existing software-force of the channel, then force + * it in the right direction (high or low) if it's not being enabled. + */ + PWM_LOCK_ASSERT(sc); + regval = EPWM_READ2(sc, EPWM_AQCSFRC); + regval &= ~AQCSFRC(chan, AQCSFRC_MASK); + if (!sc->sc_channels[chan].enabled) { + if (sc->sc_channels[chan].inverted) + regval |= AQCSFRC(chan, AQCSFRC_HI); + else + regval |= AQCSFRC(chan, AQCSFRC_LO); + } + EPWM_WRITE2(sc, EPWM_AQCSFRC, regval); +} + +static bool +am335x_ehrpwm_cfg_period(struct am335x_ehrpwm_softc *sc, u_int period) +{ + uint16_t regval; + u_int clkdiv, hspclkdiv, pwmclk, pwmtick, tbprd; + + /* Can't do a period shorter than 2 clock ticks. */ + if (period < 2 * NS_PER_SEC / PWM_CLOCK) { + sc->sc_clkfreq = 0; + sc->sc_clktick = 0; + sc->sc_period = 0; + return (false); + } + + /* + * Figure out how much we have to divide down the base 100MHz clock so + * that we can express the requested period as a 16-bit tick count. + */ + tbprd = 0; + for (clkdiv = 0; clkdiv < 8; ++clkdiv) { + const u_int cd = 1 << clkdiv; + for (hspclkdiv = 0; hspclkdiv < 8; ++hspclkdiv) { + const u_int cdhs = max(1, hspclkdiv * 2); + pwmclk = PWM_CLOCK / (cd * cdhs); + pwmtick = NS_PER_SEC / pwmclk; + if (period / pwmtick < 65536) { + tbprd = period / pwmtick; + break; + } + } + if (tbprd != 0) + break; + } + + /* Handle requested period too long for available clock divisors. */ + if (tbprd == 0) + return (false); + + /* + * If anything has changed from the current settings, reprogram the + * clock divisors and period register. + */ + if (sc->sc_clkfreq != pwmclk || sc->sc_clktick != pwmtick || + sc->sc_period != tbprd * pwmtick) { + + sc->sc_clkfreq = pwmclk; + sc->sc_clktick = pwmtick; + sc->sc_period = tbprd * pwmtick; + + PWM_LOCK_ASSERT(sc); + regval = EPWM_READ2(sc, EPWM_TBCTL); + regval &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); + regval |= TBCTL_CLKDIV(clkdiv) | TBCTL_HSPCLKDIV(hspclkdiv); + EPWM_WRITE2(sc, EPWM_TBCTL, regval); + EPWM_WRITE2(sc, EPWM_TBPRD, tbprd - 1); +#if 0 + device_printf(sc->sc_dev, "clkdiv %u hspclkdiv %u tbprd %u " + "clkfreq %u Hz clktick %u ns period got %u requested %u\n", + clkdiv, hspclkdiv, tbprd - 1, + sc->sc_clkfreq, sc->sc_clktick, sc->sc_period, period); +#endif + /* + * If the period changed, that invalidates the current CMP + * registers (duty values), just zero them out. + */ + am335x_ehrpwm_cfg_duty(sc, 0, 0); + am335x_ehrpwm_cfg_duty(sc, 1, 0); + } + + return (true); +} + +static void am335x_ehrpwm_freq(struct am335x_ehrpwm_softc *sc) { int clkdiv; @@ -324,6 +474,82 @@ am335x_ehrpwm_sysctl_period(SYSCTL_HANDLER_ARGS) } static int +am335x_ehrpwm_channel_count(device_t dev, u_int *nchannel) +{ + + *nchannel = NUM_CHANNELS; + + return (0); +} + +static int +am335x_ehrpwm_channel_config(device_t dev, u_int channel, u_int period, u_int duty) +{ + struct am335x_ehrpwm_softc *sc; + bool status; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + status = am335x_ehrpwm_cfg_period(sc, period); + if (status) + am335x_ehrpwm_cfg_duty(sc, channel, duty); + PWM_UNLOCK(sc); + + return (status ? 0 : EINVAL); +} + +static int +am335x_ehrpwm_channel_get_config(device_t dev, u_int channel, + u_int *period, u_int *duty) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + *period = sc->sc_period; + *duty = sc->sc_channels[channel].duty; + return (0); +} + +static int +am335x_ehrpwm_channel_enable(device_t dev, u_int channel, bool enable) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + am335x_ehrpwm_cfg_enable(sc, channel, enable); + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_ehrpwm_channel_is_enabled(device_t dev, u_int channel, bool *enabled) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + *enabled = sc->sc_channels[channel].enabled; + + return (0); +} + +static int am335x_ehrpwm_probe(device_t dev) { @@ -407,7 +633,13 @@ am335x_ehrpwm_attach(device_t dev) EPWM_WRITE2(sc, EPWM_TZCTL, 0xf); reg = EPWM_READ2(sc, EPWM_TZFLG); - return (0); + if ((sc->sc_busdev = device_add_child(dev, "pwmbus", -1)) == NULL) { + device_printf(dev, "Cannot add child pwmbus\n"); + // This driver can still do things even without the bus child. + } + + bus_generic_probe(dev); + return (bus_generic_attach(dev)); fail: PWM_LOCK_DESTROY(sc); if (sc->sc_mem_res) @@ -421,13 +653,22 @@ static int am335x_ehrpwm_detach(device_t dev) { struct am335x_ehrpwm_softc *sc; + int error; sc = device_get_softc(dev); + if ((error = bus_generic_detach(sc->sc_dev)) != 0) + return (error); + PWM_LOCK(sc); + + if (sc->sc_busdev != NULL) + device_delete_child(dev, sc->sc_busdev); + if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, sc->sc_mem_res); + PWM_UNLOCK(sc); PWM_LOCK_DESTROY(sc); @@ -435,11 +676,32 @@ am335x_ehrpwm_detach(device_t dev) return (0); } +static phandle_t +am335x_ehrpwm_get_node(device_t bus, device_t dev) +{ + + /* + * Share our controller node with our pwmbus child; it instantiates + * devices by walking the children contained within our node. + */ + return ofw_bus_get_node(bus); +} + static device_method_t am335x_ehrpwm_methods[] = { DEVMETHOD(device_probe, am335x_ehrpwm_probe), DEVMETHOD(device_attach, am335x_ehrpwm_attach), DEVMETHOD(device_detach, am335x_ehrpwm_detach), + /* ofw_bus_if */ + DEVMETHOD(ofw_bus_get_node, am335x_ehrpwm_get_node), + + /* pwm interface */ + DEVMETHOD(pwmbus_channel_count, am335x_ehrpwm_channel_count), + DEVMETHOD(pwmbus_channel_config, am335x_ehrpwm_channel_config), + DEVMETHOD(pwmbus_channel_get_config, am335x_ehrpwm_channel_get_config), + DEVMETHOD(pwmbus_channel_enable, am335x_ehrpwm_channel_enable), + DEVMETHOD(pwmbus_channel_is_enabled, am335x_ehrpwm_channel_is_enabled), + DEVMETHOD_END }; @@ -454,3 +716,4 @@ static devclass_t am335x_ehrpwm_devclass; DRIVER_MODULE(am335x_ehrpwm, am335x_pwmss, am335x_ehrpwm_driver, am335x_ehrpwm_devclass, 0, 0); MODULE_VERSION(am335x_ehrpwm, 1); MODULE_DEPEND(am335x_ehrpwm, am335x_pwmss, 1, 1, 1); +MODULE_DEPEND(am335x_ehrpwm, pwmbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Jun 21 14:46:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D45D615B3187; Fri, 21 Jun 2019 14:46:44 +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 73E116BFD0; Fri, 21 Jun 2019 14:46:44 +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 4C4F624A0C; Fri, 21 Jun 2019 14:46:44 +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 x5LEki6W098474; Fri, 21 Jun 2019 14:46:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LEkhS8098472; Fri, 21 Jun 2019 14:46:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906211446.x5LEkhS8098472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Jun 2019 14:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349271 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73E116BFD0 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 14:46:45 -0000 Author: ian Date: Fri Jun 21 14:46:43 2019 New Revision: 349271 URL: https://svnweb.freebsd.org/changeset/base/349271 Log: Catch up with recent changes in pwmbus(9). The pwm(9) and pwmbus(9) interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX method was renamed PWMBUS_CHANNEL_COUNT. The pwmbus_attach_bus() function just went away completely. Also, fix a few typos such as s/is/if/. Deleted: head/share/man/man9/pwm.9 Modified: head/share/man/man9/Makefile head/share/man/man9/pwmbus.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jun 21 14:24:33 2019 (r349270) +++ head/share/man/man9/Makefile Fri Jun 21 14:46:43 2019 (r349271) @@ -270,7 +270,6 @@ MAN= accept_filter.9 \ proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ - pwm.9 \ pwmbus.9 \ random.9 \ random_harvest.9 \ @@ -1670,6 +1669,7 @@ MLINKS+=proc_rwmem.9 proc_readmem.9 \ MLINKS+=psignal.9 gsignal.9 \ psignal.9 pgsignal.9 \ psignal.9 tdsignal.9 +MLINKS+=pwmbus.9 pwm.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 is_random_seeded.9 \ Modified: head/share/man/man9/pwmbus.9 ============================================================================== --- head/share/man/man9/pwmbus.9 Fri Jun 21 14:24:33 2019 (r349270) +++ head/share/man/man9/pwmbus.9 Fri Jun 21 14:46:43 2019 (r349271) @@ -22,12 +22,11 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd June 21, 2019 .Dt PWMBUS 9 .Os .Sh NAME .Nm pwmbus , -.Nm pwmbus_attach_bus , .Nm PWMBUS_GET_BUS , .Nm PWMBUS_CHANNEL_CONFIG , .Nm PWMBUS_CHANNEL_GET_CONFIG , @@ -40,8 +39,6 @@ .Sh SYNOPSIS .Cd "device pwm" .In "pwmbus_if.h" -.Ft device_t -.Fn pwmbus_attach_bus "device_t dev" .Ft int .Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" .Ft int @@ -55,37 +52,35 @@ .Ft int .Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" .Sh DESCRIPTION The PWMBUS (Pulse-Width Modulation) interface allows the device driver to register to a global -bus so other devices in the kernel can use them in a generic way +bus so other devices in the kernel can use them in a generic way. .Sh INTERFACE .Bl -tag -width indent -.It Fn pwmbus_attach_bus "device_t dev" -Attach the -.Nm pwmbus -to the device driver .It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. Returns 0 on success or .Er EINVAL -is the values are not supported by the controller or +if the values are not supported by the controller or .Er EBUSY -is the PWMBUS controller is in use and doesn't support changing the value on the fly. +if the PWMBUS controller is in use and doesn't support changing the value on the fly. .It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" Get the current configuration of the period and duty for the specified channel. .It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" -Set the flags of the channel (like inverted polarity), if the driver or controller -doesn't support this a default method is used. +Set the flags of the channel (such as inverted polarity), if the driver or controller +doesn't support this a do-nothing default method is used. .It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" -Get the current flags for the channel, if the driver or controller -doesn't support this, a default method is used. +Get the current flags for the channel. +If the driver or controller +doesn't support this, a default method returns a flags value of zero. .It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" Enable the PWM channel. .It Fn PWMBUS_CHANNEL_ISENABLED "device_t bus" "int channel" "bool *enable" Test if the PWM channel is enabled. -.It PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" -Get the maximum number of channel supported by the controller. +.It PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" +Get the number of channels supported by the controller. +Channel numbers count up from zero. .El .Sh HISTORY The From owner-svn-src-head@freebsd.org Fri Jun 21 15:12:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A2DD15B3A2D; Fri, 21 Jun 2019 15:12:18 +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 A7C906CD3F; Fri, 21 Jun 2019 15:12:17 +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 7EAB924EEF; Fri, 21 Jun 2019 15:12:17 +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 x5LFCHGF013181; Fri, 21 Jun 2019 15:12:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LFCHue013180; Fri, 21 Jun 2019 15:12:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906211512.x5LFCHue013180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Jun 2019 15:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349272 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 349272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7C906CD3F 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 15:12:18 -0000 Author: ian Date: Fri Jun 21 15:12:17 2019 New Revision: 349272 URL: https://svnweb.freebsd.org/changeset/base/349272 Log: Do some general cleanup and light wordsmithing. Sort methods alphabetically. Wrap long lines. Start sentences on a new line. Remove contractions (not because it's a good idea, just to silence igor). Add some explanation of the units for the period and duty arguments and the convention for channel numbers. Modified: head/share/man/man9/pwmbus.9 Modified: head/share/man/man9/pwmbus.9 ============================================================================== --- head/share/man/man9/pwmbus.9 Fri Jun 21 14:46:43 2019 (r349271) +++ head/share/man/man9/pwmbus.9 Fri Jun 21 15:12:17 2019 (r349272) @@ -27,14 +27,14 @@ .Os .Sh NAME .Nm pwmbus , -.Nm PWMBUS_GET_BUS , .Nm PWMBUS_CHANNEL_CONFIG , +.Nm PWMBUS_CHANNEL_COUNT , +.Nm PWMBUS_CHANNEL_ENABLE , .Nm PWMBUS_CHANNEL_GET_CONFIG , -.Nm PWMBUS_CHANNEL_SET_FLAGS , .Nm PWMBUS_CHANNEL_GET_FLAGS , -.Nm PWMBUS_CHANNEL_ENABLE , .Nm PWMBUS_CHANNEL_IS_ENABLED , -.Nm PWMBUS_CHANNEL_MAX +.Nm PWMBUS_CHANNEL_SET_FLAGS , +.Nm PWMBUS_GET_BUS .Nd PWMBUS methods .Sh SYNOPSIS .Cd "device pwm" @@ -42,45 +42,65 @@ .Ft int .Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" .Ft int -.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" .Ft int -.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" .Ft int +.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Ft int .Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" .Ft int -.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" -.Ft int .Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" .Sh DESCRIPTION -The PWMBUS (Pulse-Width Modulation) interface allows the device driver to register to a global -bus so other devices in the kernel can use them in a generic way. +The PWMBUS (Pulse-Width Modulation) interface allows a device driver to +register to a global bus so other devices in the kernel can use them in a +generic way. +.Pp +For all +.Nm +methods, the +.Va period +argument is the duration in nanoseconds of one complete on-off cycle, and the +.Va duty +argument is the duration in nanoseconds of the on portion of that cycle. +.Pp +Some PWM hardware is organized as a single controller with multiple channels. +Channel numbers count up from zero. +When multiple channels are present, they sometimes share a common clock or +other resources. +In such cases, changing the period or duty cycle of any one channel may affect +other channels within the hardware which share the same resources. +Consult the documentation for the underlying PWM hardware device driver for +details on channels that share resources. .Sh INTERFACE .Bl -tag -width indent .It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" -Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. +Configure the period and duty (in nanoseconds) in the PWM controller on the bus +for the specified channel. Returns 0 on success or .Er EINVAL if the values are not supported by the controller or .Er EBUSY -if the PWMBUS controller is in use and doesn't support changing the value on the fly. +if the PWMBUS controller is in use and does not support changing the value on +the fly. +.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int *nchannel" +Get the number of channels supported by the controller. +.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +Enable the PWM channel. .It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" Get the current configuration of the period and duty for the specified channel. -.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" -Set the flags of the channel (such as inverted polarity), if the driver or controller -doesn't support this a do-nothing default method is used. .It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" Get the current flags for the channel. If the driver or controller -doesn't support this, a default method returns a flags value of zero. -.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" -Enable the PWM channel. -.It Fn PWMBUS_CHANNEL_ISENABLED "device_t bus" "int channel" "bool *enable" -Test if the PWM channel is enabled. -.It PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" -Get the number of channels supported by the controller. -Channel numbers count up from zero. +does not support this, a default method returns a flags value of zero. +.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enable" +Test whether the PWM channel is enabled. +.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +Set the flags of the channel (such as inverted polarity). +If the driver or controller does not support this a do-nothing default method +is used. .El .Sh HISTORY The From owner-svn-src-head@freebsd.org Fri Jun 21 15:44:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 745C915B4401; Fri, 21 Jun 2019 15:44:59 +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 136536DDD6; Fri, 21 Jun 2019 15:44:59 +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 DD8AC253F2; Fri, 21 Jun 2019 15:44:58 +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 x5LFiwew029841; Fri, 21 Jun 2019 15:44:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LFiw0w029840; Fri, 21 Jun 2019 15:44:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201906211544.x5LFiw0w029840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 21 Jun 2019 15:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349273 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 349273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 136536DDD6 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_SHORT(-0.95)[-0.945,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 15:44:59 -0000 Author: ian Date: Fri Jun 21 15:44:58 2019 New Revision: 349273 URL: https://svnweb.freebsd.org/changeset/base/349273 Log: Add pwm to the armv7 GENERIC kernel, it's now used by TI and Allwinner. Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Fri Jun 21 15:12:17 2019 (r349272) +++ head/sys/arm/conf/GENERIC Fri Jun 21 15:44:58 2019 (r349273) @@ -174,6 +174,9 @@ device ti_spi # ADC support device ti_adc +# PWM +device pwm + # Watchdog support # If we don't enable the watchdog driver, the BealeBone could potentially # reboot automatically because the boot loader might have enabled the From owner-svn-src-head@freebsd.org Fri Jun 21 16:43:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1942A15B5AFE; Fri, 21 Jun 2019 16:43:18 +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 AFED66FCDD; Fri, 21 Jun 2019 16:43: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 828C725DF1; Fri, 21 Jun 2019 16:43: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 x5LGhH3b061554; Fri, 21 Jun 2019 16:43:17 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LGhHLV061553; Fri, 21 Jun 2019 16:43:17 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201906211643.x5LGhHLV061553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 21 Jun 2019 16:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349276 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 349276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFED66FCDD 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 16:43:18 -0000 Author: johalun Date: Fri Jun 21 16:43:16 2019 New Revision: 349276 URL: https://svnweb.freebsd.org/changeset/base/349276 Log: LinuxKPI: Add atomic_long_sub macro. Reviewed by: imp (mentor), hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D20718 Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Fri Jun 21 16:02:26 2019 (r349275) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Fri Jun 21 16:43:16 2019 (r349276) @@ -42,6 +42,7 @@ typedef struct { } atomic_long_t; #define atomic_long_add(i, v) atomic_long_add_return((i), (v)) +#define atomic_long_sub(i, v) atomic_long_add_return(-(i), (v)) #define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) #define atomic_long_inc_not_zero(v) atomic_long_add_unless((v), 1, 0) From owner-svn-src-head@freebsd.org Fri Jun 21 18:48:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0307D15BB8C3; Fri, 21 Jun 2019 18:48:09 +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 A04BB73592; Fri, 21 Jun 2019 18:48: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 75E3F27217; Fri, 21 Jun 2019 18:48: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 x5LIm8bn024118; Fri, 21 Jun 2019 18:48:08 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LIm8Sg024117; Fri, 21 Jun 2019 18:48:08 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201906211848.x5LIm8Sg024117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 21 Jun 2019 18:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349277 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 349277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A04BB73592 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.938,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 18:48:09 -0000 Author: johalun Date: Fri Jun 21 18:48:07 2019 New Revision: 349277 URL: https://svnweb.freebsd.org/changeset/base/349277 Log: LinuxKPI: Additions to rcu list. - Add rcu list functions. - Make rcu hlist's foreach macro use rcu calls instead of the non-rcu macro. - Bump FreeBSD version so we have a checkpoint for the vboxvideo drm driver. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D20719 Modified: head/sys/compat/linuxkpi/common/include/linux/rculist.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/rculist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/rculist.h Fri Jun 21 16:43:16 2019 (r349276) +++ head/sys/compat/linuxkpi/common/include/linux/rculist.h Fri Jun 21 18:48:07 2019 (r349277) @@ -33,6 +33,25 @@ #include #include +#define list_entry_rcu(ptr, type, member) \ + container_of(READ_ONCE(ptr), type, member) + +#define list_next_rcu(head) (*((struct list_head **)(&(head)->next))) + +#define list_for_each_entry_rcu(pos, head, member) \ + for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \ + &(pos)->member != (head); \ + pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) + +static inline void +list_add_rcu(struct list_head *new, struct list_head *prev) +{ + new->next = prev->next; + new->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), new); + prev->prev = new; +} + #define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) #define hlist_next_rcu(node) (*((struct hlist_node **)(&(node)->next))) #define hlist_pprev_rcu(node) (*((struct hlist_node **)((node)->pprev))) @@ -47,8 +66,12 @@ hlist_add_behind_rcu(struct hlist_node *n, struct hlis n->next->pprev = &n->next; } -#define hlist_for_each_entry_rcu(pos, head, member) \ - hlist_for_each_entry(pos, head, member) +#define hlist_for_each_entry_rcu(pos, head, member) \ + for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ + typeof(*(pos)), member); \ + (pos); \ + pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ + &(pos)->member)), typeof(*(pos)), member)) static inline void hlist_del_rcu(struct hlist_node *n) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jun 21 16:43:16 2019 (r349276) +++ head/sys/sys/param.h Fri Jun 21 18:48:07 2019 (r349277) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300032 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300033 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Jun 21 18:57:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208EF15BBCBD; Fri, 21 Jun 2019 18:57:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA18E73CC0; Fri, 21 Jun 2019 18:57:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E55273BE; Fri, 21 Jun 2019 18:57:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5LIvXPf029544; Fri, 21 Jun 2019 18:57:33 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LIvXe6029543; Fri, 21 Jun 2019 18:57:33 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201906211857.x5LIvXe6029543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 21 Jun 2019 18:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349278 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 349278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA18E73CC0 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 18:57:34 -0000 Author: vangyzen Date: Fri Jun 21 18:57:33 2019 New Revision: 349278 URL: https://svnweb.freebsd.org/changeset/base/349278 Log: bhyve: Fix vtscsi maximum segment config The seg_max value reported to the guest should be two less than the host's maximum, in order to leave room for the request and the response. This is analogous to r347033 for virtio_block. We hit the "too many segments to enqueue" assertion on OneFS because we increase MAXPHYS to 256 KB. Reviewed by: bryanv Discussed with: cem jhb rgrimes MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20529 Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_scsi.c Fri Jun 21 18:48:07 2019 (r349277) +++ head/usr.sbin/bhyve/pci_virtio_scsi.c Fri Jun 21 18:57:33 2019 (r349278) @@ -309,7 +309,8 @@ pci_vtscsi_reset(void *vsc) /* initialize config structure */ sc->vss_config = (struct pci_vtscsi_config){ .num_queues = VTSCSI_REQUESTQ, - .seg_max = VTSCSI_MAXSEG, + /* Leave room for the request and the response. */ + .seg_max = VTSCSI_MAXSEG - 2, .max_sectors = 2, .cmd_per_lun = 1, .event_info_size = sizeof(struct pci_vtscsi_event), From owner-svn-src-head@freebsd.org Fri Jun 21 19:32:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E3A15BCAE9; Fri, 21 Jun 2019 19:32:52 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 48456754ED; Fri, 21 Jun 2019 19:32:52 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-io1-xd44.google.com with SMTP id n5so376222ioc.7; Fri, 21 Jun 2019 12:32:52 -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=QXmRuwdoRev9wOS+4vKfDJsk9IId6w8cijD06Sm+p00=; b=mhdHsc1G4RD0+LZ4ILx98bxCJ+fWvtNpRksN0vm9/IJBVGyEhGA1voVAfTuiY6WBUK VL2IHP5kSD+CMq9SDPDqmQwe8z9i24+FzupG7umkQoWFWuiXi0Da1ZjJDZX8PVo66vGK 4+8cA8OQzwrvTghI7DcHkxcUcJZHyIN1GrrgooJ//kBrK4pTQJJG0dfu5beOENAY0hsY Bz7uTNT9YC83H6rR95nFJN6M0Tuu5AvOoFO2JTuRKaTg/PL0kx+vBMKtqJNo5Cq/xgpc PlJZd15HdqzJIDmCjZVeuTaBXgwSKvzcNhB29Cn7gjj0a2WEjHa4YXSJgAaism0gDw/W SCpQ== 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=QXmRuwdoRev9wOS+4vKfDJsk9IId6w8cijD06Sm+p00=; b=P+rkrupDWr7DrvSih+SqCB0w2aPQpThJGKEy95XKKd1vvZCG59dYfQCYOhl2JU95xa 4LFknBG2bzhK3WAjs6dTewdiNt0yf0rCxY9TpFaa0CimAn9xt/rPRaqBdVWUt+n6vM0m TMUsnMc9G0XTIcZJcLAqmgMmGZEwcxMYWuvQErnWWmtv3nGCbiWxXUzIkmrhpghdEnQl uqYDY63tcnVyuksOTiJNHa4v2IcIOpMz/f68RXd/baD1M43x9DQyZ8s3vjxeI4JDKJFf J054vr3wVe2g/iJFXuHeyywAoG9z07k09+CBPte9l/YXspGlaBrIZEznzu5oOnOq0iXH 77lA== X-Gm-Message-State: APjAAAV0h/EuOeC/BFXqndFgDGQQ21qm0npfueICRKmZh2PqwlJxU11C u1wZXeRdBqo/RbMwqubMA43ROCbVBU2wfMLXm6X/kDcy X-Google-Smtp-Source: APXvYqyKxFh8f0EMTjtj/sr4qlTqjJ13gwTng197LEHAtKxYS6g2TFa8HATf9FXRvK/FyLIDQm0h7f2QiawoSoi/GFI= X-Received: by 2002:a6b:b987:: with SMTP id j129mr48155240iof.166.1561145571063; Fri, 21 Jun 2019 12:32:51 -0700 (PDT) MIME-Version: 1.0 References: <201906210237.x5L2bt8I012721@repo.freebsd.org> In-Reply-To: <201906210237.x5L2bt8I012721@repo.freebsd.org> From: Xin LI Date: Fri, 21 Jun 2019 12:32:39 -0700 Message-ID: Subject: Re: svn commit: r349256 - head/libexec/rc/rc.d To: Conrad Meyer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 48456754ED 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.97)[-0.970,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 19:32:52 -0000 On Thu, Jun 20, 2019 at 7:38 PM Conrad Meyer wrote: > Author: cem > Date: Fri Jun 21 02:37:54 2019 > New Revision: 349256 > URL: https://svnweb.freebsd.org/changeset/base/349256 > > Log: > rc.d/motd: Update motd more robustly > > Use appropriate fsyncs to persist the rewritten /etc/motd file, when a > rewrite is performed. > Why is /etc/motd so important to deserve this kind of construct? The worst that could happen to /etc/motd with previous code is that you might end up with an empty or non-existent /etc/motd, and the change have introduced more problems than it intended to solve. > > Reported by: Jonathan Walton > Reviewed by: allanjude, vangyzen > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20701 > > Modified: > head/libexec/rc/rc.d/motd > > Modified: head/libexec/rc/rc.d/motd > > ============================================================================== > --- head/libexec/rc/rc.d/motd Fri Jun 21 00:52:30 2019 (r349255) > +++ head/libexec/rc/rc.d/motd Fri Jun 21 02:37:54 2019 (r349256) > @@ -37,11 +37,15 @@ motd_start() > uname -v | sed -e 's,^\([^#]*\) #\(.* > [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} > awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print > "\n"$0}} else {print}}' < /etc/motd >> ${T} > > - cmp -s $T /etc/motd || { > - cp $T /etc/motd > + if ! cmp -s $T /etc/motd; then > + mv -f $T /etc/.motd.tmp > This have partially defeated the benefit of doing mktemp in the code above. The old code tries to avoid excessive writes to /, which is preserved, but it is not safe to assume /etc/.motd.tmp is a non-existent plain file: mv would happily proceed when .motd.tmp is a preexisting directory, for instance (and subsequent mv -f would fail). A malicious system administrator can now plant a timing bomb which will fill / eventually. You can do a TMPDIR=/etc/ mktemp .motd.tmp.XXXXXXXX and use that to mitigate the attack above, but then if the system crash in the middle you would still end up with a dangling .motd.tmp.XXXXXXXX file in /etc. Also note that $T is on /tmp which is likely to be a different filesystem, internally this is mostly equivalent to cp + rm. You can simplify the code by reverting to previous cp and keep the rm -f below as an unconditional remove like before. + fsync /etc/.motd.tmp > + mv -f /etc/.motd.tmp /etc/motd > chmod ${PERMS} /etc/motd > - } > - rm -f $T > + fsync /etc > There is absolutely no reason to fsync /etc here. mv'ing on the same file system is performed with rename(2) which is required to be atomic by POSIX. /etc/motd will be pointing to either the old one or the new one in the event of a crash, and both are acceptable. So, in my opinion the new code would have made the situation worse than the old code. But ultimately, I think the real design question here that needs to be solved would probably be "Why are piling up multiple layers of workarounds around motd? Does it even need to be located in /etc?" The contents is meant to be updated every time when there is a kernel change, and to that extent it seems to be more appropriate for /var/run and generated at boot from a template located somewhere in /etc. The benefit of this approach is that you would have one less file to merge for each etcupdate/mergemaster (or at least only need to do it when some customization is made), and there is no need to worry about write durability. From owner-svn-src-head@freebsd.org Fri Jun 21 19:55:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1604B15BD531; Fri, 21 Jun 2019 19:55:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (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 9008E76394; Fri, 21 Jun 2019 19:55:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x444.google.com with SMTP id m30so4107627pff.8; Fri, 21 Jun 2019 12:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=npe6X+w1uPCjmmoJrRTZkikXeuQUwdJkCFqxhAjRX5g=; b=sTVCXuP8i5tqKaUjmVNzersyr7UcXFpYlCVNC1W4GxYlWsjvoqqS0PCGhvI95PKJHV bQRzDOrMZWReorkwQSrXeQwDvXt/qJyK0nUDMA6MchBAT+xrlGSEtfEAPozdmOvnlzeT 1qVsbQIGbnYeZwpd1LkWYAsMaFDj7szwFGU+xC7r5MSlfYkdTjQCcky5juncGnrRI+nA iqhB0AxCgdgNQbP6/AC+/VQvf4g5ejs0KKVNWkh0yQ6Mwqd1TZeMyzU3yVf4P4bYgxL/ NupfsIv1j4ZVIOVOt/bEROPsVB1LERYwFzbXQvEz414MdDNsSirE55XaFeiP63RX+/Ch PNSA== 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=npe6X+w1uPCjmmoJrRTZkikXeuQUwdJkCFqxhAjRX5g=; b=BvPCVcUP3l7pK4EsSbzGBlRYiOePifQwwpAoqYjdNkOHuY9BVtX0F2qUkiJVJpDd1J /6BjjNsCjArXqlPOj18+3mvK63L8dcp6JOnaVK2a/9dlE1adupYumTvgcRjP6J9StofC vwKy+uPLTBWjvBn1YBAPmugVhO9ba9bkYWGdD0e+2lPCVli8H5j6MvjbUscMZw4jAwZ+ 3WDSn0hFe6jzAH/bqCnaSxfynFrQs9SDbmnEKId2eljkUUaVLHT18h2uOnsQPIw1xzMa UM8qbMduUu2Rqifj0p20dKJjuuOiSFfDoWHNQNSgNuaSAIX6TDdACBrIcFVSf62X77tu YZ3A== X-Gm-Message-State: APjAAAWLMycPwNWaZ6l7N0K3jkIebf5pQdroNJDCEdtZ3Zql5PS+4VSj 0/qbs3NvauOPmggcvodj1OR/bOwf X-Google-Smtp-Source: APXvYqxgZboDZz/jFN+NcypFCb9gJLO2gvUsTiR9fFjCd/66UmQYBQd2R4QBZt87tCO84doCRo4wNQ== X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr9028253pjb.42.1561146919311; Fri, 21 Jun 2019 12:55:19 -0700 (PDT) Received: from ?IPv6:2607:fb90:8364:6ea7:c064:9286:67ab:e20a? ([2607:fb90:8364:6ea7:c064:9286:67ab:e20a]) by smtp.gmail.com with ESMTPSA id g5sm4165134pfm.54.2019.06.21.12.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 12:55:18 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r349256 - head/libexec/rc/rc.d From: Enji Cooper X-Mailer: iPhone Mail (16F203) In-Reply-To: Date: Fri, 21 Jun 2019 12:55:17 -0700 Cc: Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201906210237.x5L2bt8I012721@repo.freebsd.org> To: Xin LI X-Rspamd-Queue-Id: 9008E76394 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 19:55:21 -0000 > On Jun 21, 2019, at 12:32, Xin LI wrote: >=20 >=20 >> On Thu, Jun 20, 2019 at 7:38 PM Conrad Meyer wrote: >> Author: cem >> Date: Fri Jun 21 02:37:54 2019 >> New Revision: 349256 >> URL: https://svnweb.freebsd.org/changeset/base/349256 >>=20 >> Log: >> rc.d/motd: Update motd more robustly >>=20 >> Use appropriate fsyncs to persist the rewritten /etc/motd file, when a >> rewrite is performed. >=20 > Why is /etc/motd so important to deserve this kind of construct? The wors= t that could happen to /etc/motd with previous code is that you might end up= with an empty or non-existent /etc/motd, and the change have introduced mor= e problems than it intended to solve. > =20 >>=20 >> Reported by: Jonathan Walton >> Reviewed by: allanjude, vangyzen >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D20701 >>=20 >> Modified: >> head/libexec/rc/rc.d/motd >>=20 >> Modified: head/libexec/rc/rc.d/motd >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/libexec/rc/rc.d/motd Fri Jun 21 00:52:30 2019 (r349255)= >> +++ head/libexec/rc/rc.d/motd Fri Jun 21 02:37:54 2019 (r349256)= >> @@ -37,11 +37,15 @@ motd_start() >> uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\(= [^\]*\) $,\1 (\3) #\2,' > ${T} >> awk '{if (NR =3D=3D 1) {if ($1 =3D=3D "FreeBSD") {next} else {pri= nt "\n"$0}} else {print}}' < /etc/motd >> ${T} >>=20 >> - cmp -s $T /etc/motd || { >> - cp $T /etc/motd >> + if ! cmp -s $T /etc/motd; then >> + mv -f $T /etc/.motd.tmp >=20 > This have partially defeated the benefit of doing mktemp in the code above= . The old code tries to avoid excessive writes to /, which is preserved, bu= t it is not safe to assume /etc/.motd.tmp is a non-existent plain file: mv w= ould happily proceed when .motd.tmp is a preexisting directory, for instance= (and subsequent mv -f would fail). A malicious system administrator can no= w plant a timing bomb which will fill / eventually. >=20 > You can do a TMPDIR=3D/etc/ mktemp .motd.tmp.XXXXXXXX and use that to miti= gate the attack above, but then if the system crash in the middle you would s= till end up with a dangling .motd.tmp.XXXXXXXX file in /etc. >=20 > Also note that $T is on /tmp which is likely to be a different filesystem,= internally this is mostly equivalent to cp + rm. You can simplify the code= by reverting to previous cp and keep the rm -f below as an unconditional re= move like before. >=20 >> + fsync /etc/.motd.tmp >> + mv -f /etc/.motd.tmp /etc/motd >> chmod ${PERMS} /etc/motd >> - } >> - rm -f $T >> + fsync /etc >=20 > There is absolutely no reason to fsync /etc here. mv'ing on the same file= system is performed with rename(2) which is required to be atomic by POSIX.= /etc/motd will be pointing to either the old one or the new one in the eve= nt of a crash, and both are acceptable. > =20 > So, in my opinion the new code would have made the situation worse than th= e old code. >=20 > But ultimately, I think the real design question here that needs to be sol= ved would probably be "Why are piling up multiple layers of workarounds arou= nd motd? Does it even need to be located in /etc?" The contents is meant to= be updated every time when there is a kernel change, and to that extent it s= eems to be more appropriate for /var/run and generated at boot from a templa= te located somewhere in /etc. The benefit of this approach is that you woul= d have one less file to merge for each etcupdate/mergemaster (or at least on= ly need to do it when some customization is made), and there is no need to w= orry about write durability. I don=E2=80=99t know the exact reasoning today, but once upon a time, th= ere used to be a number of things hooked to /etc/motd generation that could i= nfluence information provided to downstream callers/systems. Thank you, -Enji= From owner-svn-src-head@freebsd.org Fri Jun 21 20:02:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EAB415BDC42; Fri, 21 Jun 2019 20:02:05 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 9F71276A6D; Fri, 21 Jun 2019 20:02:04 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 237BF22295; Fri, 21 Jun 2019 16:02:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 21 Jun 2019 16:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=e 0qJDQNlRh0If7nhvaoDnFUD2F+nlA0CDplc1dt+Aj8=; b=oNb54BVF07iSWrtmU rOmLyClVZCoS+ykvsvDU05wFjLOYImZ4Auii0JPJO4Fx8RjpAw5ENvNbk0QeqQ/Z IB7KsWXN7yxjB5drRz3UVM5kmqdaGIrxtXuMtfU9yW8eezfPI9RldwSlddxqUXQg ww7rRDoGoe0rHwrnjH0fNQjJHJAW7QuAQS+SUd9KtjSkpcOAsg+hgcyiYGdpm1B6 A6T7gQmiFrTxucKmgHTHGcAmzbzIIFaRkBed2rfJEWvrDSAui0/Gwx4Vn8EKO0/1 5VMGtlxc6/T/050MBM9BLyt1qr5fDGIZizunD4eBzmreDmU+O/mQMgbuXbJ6kFSL ILknA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=e0qJDQNlRh0If7nhvaoDnFUD2F+nlA0CDplc1dt+A j8=; b=V5KQh8NI4nFaXn/TBVJlA4OlIPXTwMJE2XO5Vl/3ow/8gvDAeOoBsBME2 xZbvD0F8I4I4TZoOUlSR53f5e3Ki3Y2SreqOqeRkHqZKWTaYCWYd1C8kx2Md82mb /xHMjo/OM4Heg68ONFMkQoyWXhO3DEr0EDZKREQhD2sROkp3sTnHNw8ZQ80N/fEV YsjvwyOaL4/IX5iy/tN1l7Roewor9V7ozp56MrC1t6+c55JyjUBpgMWCQxlyQCwu zTOnsopkj04QgMdqZI7XYxs2TC7yM21GcRlp0IO3sfb2c+pcS4ugM3H7ryKeyBvy r2RjXESZyHfObe2JD+Wl8Ynxbez2g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeigddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtggfuhfgjfffgkfhfvffosehtqh hmtdhhtdejnecuhfhrohhmpefutghothhtucfnohhnghcuoehstghothhtlhesshgrmhhs tghordhorhhgqeenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucfkphepudelvd drheehrdehgedrheelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehstghothhtlhesshgr mhhstghordhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [10.178.24.13] (unknown [192.55.54.59]) by mail.messagingengine.com (Postfix) with ESMTPA id 3A05A8005A; Fri, 21 Jun 2019 16:02:03 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349243 - head/sys/cam From: Scott Long In-Reply-To: <42dbbc7f-51ea-bc3d-0432-5cc9b872d0e7@FreeBSD.org> Date: Fri, 21 Jun 2019 14:02:01 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201906202029.x5KKThjn017867@repo.freebsd.org> <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> <42dbbc7f-51ea-bc3d-0432-5cc9b872d0e7@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 9F71276A6D 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.962,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 20:02:05 -0000 Hi Alexander, Thanks for the explanation, sorry I didn=E2=80=99t realize sooner that = it=E2=80=99s not used as a copyout buffer anymore. FWIW, that code is really hard to read on an 80 column window, would you be ok if it was refactored for better readability? Thanks, Scott > On Jun 20, 2019, at 6:04 PM, Alexander Motin wrote: >=20 > Hi Scott, >=20 > You may see this buffer content is not returned directly to user any > more. It is used only as temporary storage to pull > CDAI_TYPE_SCSI_DEVID, which is then converted into readable form, > returned to user. And the code is explicitly made to not read outside > the range that was copied to the buffer with simple and dumb memcpy(). >=20 > The effect is clearly visible in profiler when GEOM confxml calls it 3 > times for each disk, taking about 25% of the sysctl's CPU time. With > hundreds of disks it is not so small. >=20 > On 20.06.2019 18:59, Scott Long wrote: >> Hi Alexander, >>=20 >> I=E2=80=99m not a fan of removing the M_ZERO. I understand your = argument that >> lengths are provided elsewhere, but having the buffer be zero=E2=80=99d= is defensive >> against future bugs that might leak buffer contents. GETATTR isn=E2=80= =99t typically >> in a performance path, is there any measurable benefit to this? >>=20 >> Thanks, >> Scott >>=20 >>=20 >>> On Jun 20, 2019, at 2:29 PM, Alexander Motin = wrote: >>>=20 >>> Author: mav >>> Date: Thu Jun 20 20:29:42 2019 >>> New Revision: 349243 >>> URL: https://svnweb.freebsd.org/changeset/base/349243 >>>=20 >>> Log: >>> Optimize xpt_getattr(). >>>=20 >>> Do not allocate temporary buffer for attributes we are going to = return >>> as-is, just make sure to NUL-terminate them. Do not zero temporary = 64KB >>> buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it = filled >>> and there are also length fields inside the returned data also. >>>=20 >>> MFC after: 2 weeks >>> Sponsored by: iXsystems, Inc. >>>=20 >>> Modified: >>> head/sys/cam/cam_xpt.c >>>=20 >>> Modified: head/sys/cam/cam_xpt.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/cam_xpt.c Thu Jun 20 20:06:19 2019 = (r349242) >>> +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 = (r349243) >>> @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char = *attr, s >>> cdai.ccb_h.func_code =3D XPT_DEV_ADVINFO; >>> cdai.flags =3D CDAI_FLAG_NONE; >>> cdai.bufsiz =3D len; >>> + cdai.buf =3D buf; >>>=20 >>> if (!strcmp(attr, "GEOM::ident")) >>> cdai.buftype =3D CDAI_TYPE_SERIAL_NUM; >>> @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const = char *attr, s >>> strcmp(attr, "GEOM::lunname") =3D=3D 0) { >>> cdai.buftype =3D CDAI_TYPE_SCSI_DEVID; >>> cdai.bufsiz =3D CAM_SCSI_DEVID_MAXLEN; >>> + cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); >>> + if (cdai.buf =3D=3D NULL) { >>> + ret =3D ENOMEM; >>> + goto out; >>> + } >>> } else >>> goto out; >>>=20 >>> - cdai.buf =3D malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); >>> - if (cdai.buf =3D=3D NULL) { >>> - ret =3D ENOMEM; >>> - goto out; >>> - } >>> xpt_action((union ccb *)&cdai); /* can only be synchronous */ >>> if ((cdai.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) >>> cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); >>> @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const = char *attr, s >>> ret =3D EFAULT; >>> } >>> } else { >>> - ret =3D 0; >>> - if (strlcpy(buf, cdai.buf, len) >=3D len) >>> + if (cdai.provsiz < len) { >>> + cdai.buf[cdai.provsiz] =3D 0; >>> + ret =3D 0; >>> + } else >>> ret =3D EFAULT; >>> } >>>=20 >>> out: >>> - if (cdai.buf !=3D NULL) >>> + if ((char *)cdai.buf !=3D buf) >>> free(cdai.buf, M_CAMXPT); >>> return ret; >>> } >>>=20 >>=20 >=20 > --=20 > Alexander Motin From owner-svn-src-head@freebsd.org Fri Jun 21 20:38:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D3415BEECE; Fri, 21 Jun 2019 20:38: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 BC94E805AA; Fri, 21 Jun 2019 20:38:35 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb42.google.com with SMTP id x7so3185793ybg.5; Fri, 21 Jun 2019 13:38:35 -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=GLi4m4MNKCzuklIzblk8qZqKMPaWji2KHZrOoTUzM+s=; b=psOHJlgdzGgeARet0asZCd0bYIrADuizHbVADq5RJ8DPRdw2L7ho6pYOuC6ST2SyVv kymP24rEa2MB7GlR9SIU4i8LVCkw6UagaWmVRGRFYdNeHUyFauM5Rsz3myZnLkpXwXZP q3/P8Iy41LlHwQbBXJ+nCdOVcc33ADPGEo3tg6aTv5OeSf2hkigrufFZSajc4Cu656Ue wp/mr/yElwR+OBaEXJEuMuuLAEmuyuCfSPCWSbAqUtf6Zn6a3Qvf4ICOP59X9/wahIW4 XJqXvMJ0HJaaw4SlV+yeWK4X4u/yDwhudLyh+VVJf6+oL0+zX//Ck3eNea4foTXWlyjZ u/MA== 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=GLi4m4MNKCzuklIzblk8qZqKMPaWji2KHZrOoTUzM+s=; b=lVy2pt0rKCnKu93WrcCTat33lPGDSpKQTmywKJ2CwRgcto7GbSnuJw56qgKRp7YHz0 fyDhVSxL2iGZs3dyUToyMP+Vm/MbMfpKRhqROS0QX/pu1oqOfchbnOnhNEdtUDB+T4GU fjQIlo1HAPgiwphXkKS5eJb64qvZ4+sMSrQC2IAColgW4eMWLruWeMsi99nxc+4j7AhT Hy5M2lJwo9cm7+/ai77sBcnmxU5lpulwYXFKdAk0p1YK6wkMyTcTD7Go/aIyVaTsdZq6 xsLCBFfbkhOxtGQu1lqlP6JZbzXxRknOuDzBCnwhKkjboGiGnQCxFJuhytHXLPYE6aks K6iQ== X-Gm-Message-State: APjAAAVZ24fgxL/jhr8KbWwoLHWZ8zG4EnrhagDPlBUz5ZDMOxO9KZ2m dzZCudc6VvSdNngXPuGXdvJh9ddkQjU= X-Google-Smtp-Source: APXvYqzF7OvGTPQeaivwu7osfAdV1fEE70mgMP0qhjHQrFJK7HDPFG9PnZtIqKUCgjMhYlazgTkXpQ== X-Received: by 2002:a25:c505:: with SMTP id v5mr72987174ybe.492.1561149514639; Fri, 21 Jun 2019 13:38:34 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id p7sm918065ywd.26.2019.06.21.13.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 13:38:33 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r349243 - head/sys/cam To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201906202029.x5KKThjn017867@repo.freebsd.org> <6B266DFC-87FF-4742-ACEE-0D37EABEFD7A@samsco.org> <42dbbc7f-51ea-bc3d-0432-5cc9b872d0e7@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: <58b239ed-c119-7946-d601-1f46686cb7a8@FreeBSD.org> Date: Fri, 21 Jun 2019 16:38:33 -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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC94E805AA 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 20:38:36 -0000 On 21.06.2019 16:02, Scott Long wrote: > Hi Alexander, > > Thanks for the explanation, sorry I didn’t realize sooner that it’s > not used as a copyout buffer anymore. FWIW, that code is really > hard to read on an 80 column window, would you be ok if it was > refactored for better readability? Sure, why not. >> On Jun 20, 2019, at 6:04 PM, Alexander Motin wrote: >> >> Hi Scott, >> >> You may see this buffer content is not returned directly to user any >> more. It is used only as temporary storage to pull >> CDAI_TYPE_SCSI_DEVID, which is then converted into readable form, >> returned to user. And the code is explicitly made to not read outside >> the range that was copied to the buffer with simple and dumb memcpy(). >> >> The effect is clearly visible in profiler when GEOM confxml calls it 3 >> times for each disk, taking about 25% of the sysctl's CPU time. With >> hundreds of disks it is not so small. >> >> On 20.06.2019 18:59, Scott Long wrote: >>> Hi Alexander, >>> >>> I’m not a fan of removing the M_ZERO. I understand your argument that >>> lengths are provided elsewhere, but having the buffer be zero’d is defensive >>> against future bugs that might leak buffer contents. GETATTR isn’t typically >>> in a performance path, is there any measurable benefit to this? >>> >>> Thanks, >>> Scott >>> >>> >>>> On Jun 20, 2019, at 2:29 PM, Alexander Motin wrote: >>>> >>>> Author: mav >>>> Date: Thu Jun 20 20:29:42 2019 >>>> New Revision: 349243 >>>> URL: https://svnweb.freebsd.org/changeset/base/349243 >>>> >>>> Log: >>>> Optimize xpt_getattr(). >>>> >>>> Do not allocate temporary buffer for attributes we are going to return >>>> as-is, just make sure to NUL-terminate them. Do not zero temporary 64KB >>>> buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled >>>> and there are also length fields inside the returned data also. >>>> >>>> MFC after: 2 weeks >>>> Sponsored by: iXsystems, Inc. >>>> >>>> Modified: >>>> head/sys/cam/cam_xpt.c >>>> >>>> Modified: head/sys/cam/cam_xpt.c >>>> ============================================================================== >>>> --- head/sys/cam/cam_xpt.c Thu Jun 20 20:06:19 2019 (r349242) >>>> +++ head/sys/cam/cam_xpt.c Thu Jun 20 20:29:42 2019 (r349243) >>>> @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >>>> cdai.ccb_h.func_code = XPT_DEV_ADVINFO; >>>> cdai.flags = CDAI_FLAG_NONE; >>>> cdai.bufsiz = len; >>>> + cdai.buf = buf; >>>> >>>> if (!strcmp(attr, "GEOM::ident")) >>>> cdai.buftype = CDAI_TYPE_SERIAL_NUM; >>>> @@ -1262,14 +1263,14 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >>>> strcmp(attr, "GEOM::lunname") == 0) { >>>> cdai.buftype = CDAI_TYPE_SCSI_DEVID; >>>> cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; >>>> + cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); >>>> + if (cdai.buf == NULL) { >>>> + ret = ENOMEM; >>>> + goto out; >>>> + } >>>> } else >>>> goto out; >>>> >>>> - cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); >>>> - if (cdai.buf == NULL) { >>>> - ret = ENOMEM; >>>> - goto out; >>>> - } >>>> xpt_action((union ccb *)&cdai); /* can only be synchronous */ >>>> if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) >>>> cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); >>>> @@ -1334,13 +1335,15 @@ xpt_getattr(char *buf, size_t len, const char *attr, s >>>> ret = EFAULT; >>>> } >>>> } else { >>>> - ret = 0; >>>> - if (strlcpy(buf, cdai.buf, len) >= len) >>>> + if (cdai.provsiz < len) { >>>> + cdai.buf[cdai.provsiz] = 0; >>>> + ret = 0; >>>> + } else >>>> ret = EFAULT; >>>> } >>>> >>>> out: >>>> - if (cdai.buf != NULL) >>>> + if ((char *)cdai.buf != buf) >>>> free(cdai.buf, M_CAMXPT); >>>> return ret; >>>> } >>>> >>> >> >> -- >> Alexander Motin > -- Alexander Motin From owner-svn-src-head@freebsd.org Fri Jun 21 21:39:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCFE15BFED4; Fri, 21 Jun 2019 21:39:38 +0000 (UTC) (envelope-from truckman@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 B9470820E5; Fri, 21 Jun 2019 21:39:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id CAD57A13E; Fri, 21 Jun 2019 21:39:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Fri, 21 Jun 2019 14:39:34 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r349256 - head/libexec/rc/rc.d To: Xin LI cc: Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: Message-ID: References: <201906210237.x5L2bt8I012721@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-Rspamd-Queue-Id: B9470820E5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 21:39:38 -0000 On 21 Jun, Xin LI wrote: > But ultimately, I think the real design question here that needs to be > solved would probably be "Why are piling up multiple layers of workarounds > around motd? Does it even need to be located in /etc?" The contents is > meant to be updated every time when there is a kernel change, and to that > extent it seems to be more appropriate for /var/run and generated at boot > from a template located somewhere in /etc. The benefit of this approach is > that you would have one less file to merge for each etcupdate/mergemaster > (or at least only need to do it when some customization is made), and there > is no need to worry about write durability. +1 This is something that has bothered me for a long time. It should be possible to run with a read-only /etc (obviously with some functional limitations). From owner-svn-src-head@freebsd.org Fri Jun 21 21:50:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286D315C095D; Fri, 21 Jun 2019 21:50:16 +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 BF86F82AEE; Fri, 21 Jun 2019 21:50:15 +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 8478D10F6; Fri, 21 Jun 2019 21:50:15 +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 x5LLoFst019981; Fri, 21 Jun 2019 21:50:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LLoF0m019979; Fri, 21 Jun 2019 21:50:15 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201906212150.x5LLoF0m019979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 21 Jun 2019 21:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349280 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 349280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF86F82AEE 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.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 21:50:16 -0000 Author: asomers Date: Fri Jun 21 21:50:14 2019 New Revision: 349280 URL: https://svnweb.freebsd.org/changeset/base/349280 Log: Reduce namespace pollution from r349233 Define __daddr_t in _types.h and use it in filio.h Reported by: ian, bde Reviewed by: ian, imp, cem MFC after: 2 weeks MFC-With: 349233 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20715 Modified: head/sys/sys/_types.h head/sys/sys/filio.h head/sys/sys/types.h Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Fri Jun 21 21:44:31 2019 (r349279) +++ head/sys/sys/_types.h Fri Jun 21 21:50:14 2019 (r349280) @@ -68,6 +68,7 @@ typedef unsigned int __useconds_t; /* microseconds (un typedef int __cpuwhich_t; /* which parameter for cpuset. */ typedef int __cpulevel_t; /* level parameter for cpuset. */ typedef int __cpusetid_t; /* cpuset identifier. */ +typedef __int64_t __daddr_t; /* bwrite(3), FIOBMAP2, etc */ /* * Unusual type definitions. Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Fri Jun 21 21:44:31 2019 (r349279) +++ head/sys/sys/filio.h Fri Jun 21 21:50:14 2019 (r349280) @@ -40,7 +40,7 @@ #ifndef _SYS_FILIO_H_ #define _SYS_FILIO_H_ -#include +#include #include /* Generic file-descriptor ioctl's. */ @@ -64,12 +64,12 @@ struct fiodgname_arg { #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ struct fiobmap2_arg { - int64_t bn; - int runp; - int runb; + __daddr_t bn; + int runp; + int runb; }; -/* Get the file's bmap info for the logical block bn */ -#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) +/* Get the file's bmap info for the logical block bn. */ +#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Fri Jun 21 21:44:31 2019 (r349279) +++ head/sys/sys/types.h Fri Jun 21 21:50:14 2019 (r349280) @@ -101,7 +101,7 @@ typedef __clockid_t clockid_t; #endif typedef __critical_t critical_t; /* Critical section value */ -typedef __int64_t daddr_t; /* disk address */ +typedef __daddr_t daddr_t; /* disk address */ #ifndef _DEV_T_DECLARED typedef __dev_t dev_t; /* device number or struct cdev */ From owner-svn-src-head@freebsd.org Fri Jun 21 23:29:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A851115C3924; Fri, 21 Jun 2019 23:29:17 +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 4E32887119; Fri, 21 Jun 2019 23:29:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A19121D0; Fri, 21 Jun 2019 23:29:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5LNTHgh074587; Fri, 21 Jun 2019 23:29:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LNTHfQ074586; Fri, 21 Jun 2019 23:29:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906212329.x5LNTHfQ074586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Jun 2019 23:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349281 - 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: 349281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E32887119 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 23:29:17 -0000 Author: mav Date: Fri Jun 21 23:29:16 2019 New Revision: 349281 URL: https://svnweb.freebsd.org/changeset/base/349281 Log: Fix individual_element_index when some type has 0 elements. When some type has 0 elements, saved_individual_element_index was set to -1 on second type bump, since individual_element_index was not restored after the first. To me it looks easier just to increment saved_individual_element_index separately than think when to save it. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Fri Jun 21 21:50:14 2019 (r349280) +++ head/sys/cam/scsi/scsi_enc_ses.c Fri Jun 21 23:29:16 2019 (r349281) @@ -444,6 +444,7 @@ ses_iter_next(struct ses_iterator *iter) iter->type_element_index = ITERATOR_INDEX_END; iter->global_element_index = ITERATOR_INDEX_END; iter->individual_element_index = ITERATOR_INDEX_END; + iter->saved_individual_element_index = ITERATOR_INDEX_END; return (NULL); } @@ -468,17 +469,12 @@ ses_iter_next(struct ses_iterator *iter) */ iter->type_index++; iter->type_element_index = 0; - iter->saved_individual_element_index - = iter->individual_element_index; iter->individual_element_index = ITERATOR_INDEX_INVALID; } if (iter->type_element_index > 0) { - if (iter->type_element_index == 1) { - iter->individual_element_index - = iter->saved_individual_element_index; - } - iter->individual_element_index++; + iter->individual_element_index = + ++iter->saved_individual_element_index; } return (&iter->cache->elm_map[iter->global_element_index]); From owner-svn-src-head@freebsd.org Fri Jun 21 23:40:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6914115C3D0A; Fri, 21 Jun 2019 23:40:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 101B487785; Fri, 21 Jun 2019 23:40:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88F82379; Fri, 21 Jun 2019 23:40:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5LNeQlL079723; Fri, 21 Jun 2019 23:40:26 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LNeQ7E079722; Fri, 21 Jun 2019 23:40:26 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201906212340.x5LNeQ7E079722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 21 Jun 2019 23:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349283 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 349283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 101B487785 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 23:40:27 -0000 Author: scottl Date: Fri Jun 21 23:40:26 2019 New Revision: 349283 URL: https://svnweb.freebsd.org/changeset/base/349283 Log: Refactor xpt_getattr() to make it more readable. No outwardly visible functional changes, though code flow was modified a bit internally to lessen the need for goto jumps and chained if conditionals. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Jun 21 23:29:29 2019 (r349282) +++ head/sys/cam/cam_xpt.c Fri Jun 21 23:40:26 2019 (r349283) @@ -1244,6 +1244,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s { int ret = -1, l, o; struct ccb_dev_advinfo cdai; + struct scsi_vpd_device_id *did; struct scsi_vpd_id_descriptor *idd; xpt_path_assert(path, MA_OWNED); @@ -1276,31 +1277,36 @@ xpt_getattr(char *buf, size_t len, const char *attr, s cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); if (cdai.provsiz == 0) goto out; - if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) { + switch(cdai.buftype) { + case CDAI_TYPE_SCSI_DEVID: + did = (struct scsi_vpd_device_id *)cdai.buf; if (strcmp(attr, "GEOM::lunid") == 0) { - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_naa); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_naa); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_eui64); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_eui64); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_uuid); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_uuid); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_md5); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_md5); } else idd = NULL; + if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_t10); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_t10); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_name); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_name); if (idd == NULL) - goto out; + break; + ret = 0; - if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII) { + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_ASCII) { if (idd->length < len) { for (l = 0; l < idd->length; l++) buf[l] = idd->identifier[l] ? @@ -1308,38 +1314,46 @@ xpt_getattr(char *buf, size_t len, const char *attr, s buf[l] = 0; } else ret = EFAULT; - } else if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { + break; + } + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_UTF8) { l = strnlen(idd->identifier, idd->length); if (l < len) { bcopy(idd->identifier, buf, l); buf[l] = 0; } else ret = EFAULT; - } else if ((idd->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_UUID - && idd->identifier[0] == 0x10) { - if ((idd->length - 2) * 2 + 4 < len) { - for (l = 2, o = 0; l < idd->length; l++) { - if (l == 6 || l == 8 || l == 10 || l == 12) - o += sprintf(buf + o, "-"); - o += sprintf(buf + o, "%02x", - idd->identifier[l]); - } - } else + break; + } + if ((idd->id_type & SVPD_ID_TYPE_MASK) == + SVPD_ID_TYPE_UUID && idd->identifier[0] == 0x10) { + if ((idd->length - 2) * 2 + 4 >= len) { ret = EFAULT; - } else { - if (idd->length * 2 < len) { - for (l = 0; l < idd->length; l++) - sprintf(buf + l * 2, "%02x", - idd->identifier[l]); - } else - ret = EFAULT; + break; + } + for (l = 2, o = 0; l < idd->length; l++) { + if (l == 6 || l == 8 || l == 10 || l == 12) + o += sprintf(buf + o, "-"); + o += sprintf(buf + o, "%02x", + idd->identifier[l]); + } + break; } - } else { + if (idd->length * 2 < len) { + for (l = 0; l < idd->length; l++) + sprintf(buf + l * 2, "%02x", + idd->identifier[l]); + } else + ret = EFAULT; + break; + default: if (cdai.provsiz < len) { cdai.buf[cdai.provsiz] = 0; ret = 0; } else ret = EFAULT; + break; } out: From owner-svn-src-head@freebsd.org Sat Jun 22 00:41:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCBB915C532B; Sat, 22 Jun 2019 00:41:34 +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 43AC489189; Sat, 22 Jun 2019 00:41:34 +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 x5M0fTEu031124; Fri, 21 Jun 2019 17:41:29 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x5M0fTIb031123; Fri, 21 Jun 2019 17:41:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201906220041.x5M0fTIb031123@gndrsh.dnsmgr.net> Subject: Re: svn commit: r349256 - head/libexec/rc/rc.d In-Reply-To: To: Don Lewis Date: Fri, 21 Jun 2019 17:41:29 -0700 (PDT) CC: Xin LI , Conrad Meyer , "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: 43AC489189 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 00:41:35 -0000 > On 21 Jun, Xin LI wrote: > > > But ultimately, I think the real design question here that needs to be > > solved would probably be "Why are piling up multiple layers of workarounds > > around motd? Does it even need to be located in /etc?" The contents is > > meant to be updated every time when there is a kernel change, and to that > > extent it seems to be more appropriate for /var/run and generated at boot > > from a template located somewhere in /etc. The benefit of this approach is > > that you would have one less file to merge for each etcupdate/mergemaster > > (or at least only need to do it when some customization is made), and there > > is no need to worry about write durability. > > +1 > > This is something that has bothered me for a long time. It should be > possible to run with a read-only /etc (obviously with some functional > limitations). The updating of the kernel string in /etc/motd is what should go, that was done before the days of uname, so was more important, but now it is rather pointless to have the kernel name and version in motd. Just go back to earlier days and leave motd as it was intended, the Message of The Day from the system administrator(s). If you want readonly / you do: cd /etc mkdir ../var/etc mv motd ../var/etc ln -s ../var/etc/motd If your head hurts from the .. it is from decades of me doing chrooted stuff, sorry, just how my brain fires. You need to do the above to a fistfull of other files too, and iirc there are some issues with passwd as it unlinks the symlinks. For simpler readonly / you do: cd / mv etc var ln -s var/etc this one works very well and is what I use in my nfs diskless setups to share a readonly / as each node has its own /var file system, / and /usr are shared. /tmp varies depending on what i am doing, but most often a tmpfs. I do not use the standard freebsd diskless /var tar ball, my /var's are persistant accross reboots and are per node. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jun 22 01:06:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04F7D15C5853; Sat, 22 Jun 2019 01:06:43 +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 A057589C56; Sat, 22 Jun 2019 01:06:42 +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 5F5D6325B; Sat, 22 Jun 2019 01:06:42 +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 x5M16gS6026996; Sat, 22 Jun 2019 01:06:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5M16gml026995; Sat, 22 Jun 2019 01:06:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906220106.x5M16gml026995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Jun 2019 01:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349284 - 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: 349284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A057589C56 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 01:06:43 -0000 Author: mav Date: Sat Jun 22 01:06:41 2019 New Revision: 349284 URL: https://svnweb.freebsd.org/changeset/base/349284 Log: Make ELEMENT INDEX validation more strict. SES specifications tell: "The Additional Element Status descriptors shall be in the same order as the status elements in the Enclosure Status diagnostic page". It allows us to question ELEMENT INDEX that is lower then values we already processed. There are many SAS2 enclosures with this kind of problem. While there, add more specific error messages for cases when ELEMENT INDEX is obviously wrong. Also skip elements with INVALID bit set. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Fri Jun 21 23:40:26 2019 (r349283) +++ head/sys/cam/scsi/scsi_enc_ses.c Sat Jun 22 01:06:41 2019 (r349284) @@ -1681,7 +1681,6 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en struct ses_iterator iter, titer; int eip; int err; - int ignore_index = 0; int length; int offset; enc_cache_t *enc_cache; @@ -1752,7 +1751,7 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en elm_hdr = (struct ses_elm_addlstatus_base_hdr *)&buf[offset]; eip = ses_elm_addlstatus_eip(elm_hdr); - if (eip && !ignore_index) { + if (eip) { struct ses_elm_addlstatus_eip_hdr *eip_hdr; int expected_index, index; ses_elem_index_type_t index_type; @@ -1765,17 +1764,44 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en index_type = SES_ELEM_INDEX_INDIVIDUAL; expected_index = iter.individual_element_index; } + if (eip_hdr->element_index < expected_index) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d is lower then expected %d\n", + __func__, (eip_hdr->byte2 & + SES_ADDL_EIP_EIIOE) ? "global " : "", + eip_hdr->element_index, expected_index); + goto badindex; + } titer = iter; telement = ses_iter_seek_to(&titer, eip_hdr->element_index, index_type); - if (telement != NULL && - (ses_typehasaddlstatus(enc, titer.type_index) != - TYPE_ADDLSTATUS_NONE || - titer.type_index > ELMTYP_SAS_CONN)) { + if (telement == NULL) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d does not exist\n", __func__, + (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) ? + "global " : "", eip_hdr->element_index); + goto badindex; + } + if (ses_typehasaddlstatus(enc, titer.type_index) == + TYPE_ADDLSTATUS_NONE) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d can't have additional status\n", + __func__, + (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) ? + "global " : "", eip_hdr->element_index); +badindex: + /* + * If we expected mandatory element, we may + * guess it was just a wrong index and we may + * use the status. If element was optional, + * then we have no idea where status belongs. + */ + if (status_type == TYPE_ADDLSTATUS_OPTIONAL) + break; + } else { iter = titer; element = telement; - } else - ignore_index = 1; + } if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) index = iter.global_element_index; @@ -1797,35 +1823,41 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en "type element index=%d, offset=0x%x, " "byte0=0x%x, length=0x%x\n", __func__, iter.global_element_index, iter.type_index, - iter.type_element_index, offset, elmpriv->addl.hdr->byte0, - elmpriv->addl.hdr->length); + iter.type_element_index, offset, elm_hdr->byte0, + elm_hdr->length); /* Skip to after the length field */ offset += sizeof(struct ses_elm_addlstatus_base_hdr); /* Make sure the descriptor is within bounds */ - if ((offset + elmpriv->addl.hdr->length) > length) { + if ((offset + elm_hdr->length) > length) { ENC_VLOG(enc, "Element %d Beyond End " "of Additional Element Status Descriptors\n", iter.global_element_index); break; } + /* Skip elements marked as invalid. */ + if (ses_elm_addlstatus_invalid(elm_hdr)) { + offset += elm_hdr->length; + continue; + } + /* Advance to the protocol data, skipping eip bytes if needed */ offset += (eip * SES_EIP_HDR_EXTRA_LEN); - proto_info_len = elmpriv->addl.hdr->length + proto_info_len = elm_hdr->length - (eip * SES_EIP_HDR_EXTRA_LEN); /* Errors in this block are ignored as they are non-fatal */ - switch(ses_elm_addlstatus_proto(elmpriv->addl.hdr)) { + switch(ses_elm_addlstatus_proto(elm_hdr)) { case SPSP_PROTO_FC: - if (elmpriv->addl.hdr->length == 0) + if (elm_hdr->length == 0) break; ses_get_elm_addlstatus_fc(enc, enc_cache, &buf[offset], proto_info_len); break; case SPSP_PROTO_SAS: - if (elmpriv->addl.hdr->length <= 2) + if (elm_hdr->length <= 2) break; ses_get_elm_addlstatus_sas(enc, enc_cache, &buf[offset], @@ -1836,7 +1868,7 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en default: ENC_VLOG(enc, "Element %d: Unknown Additional Element " "Protocol 0x%x\n", iter.global_element_index, - ses_elm_addlstatus_proto(elmpriv->addl.hdr)); + ses_elm_addlstatus_proto(elm_hdr)); break; } From owner-svn-src-head@freebsd.org Sat Jun 22 01:20:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6038115C5DDE; Sat, 22 Jun 2019 01:20:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 001B58A228; Sat, 22 Jun 2019 01:20:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBD96343B; Sat, 22 Jun 2019 01:20:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5M1Kjr7032915; Sat, 22 Jun 2019 01:20:45 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5M1KjVs032914; Sat, 22 Jun 2019 01:20:45 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201906220120.x5M1KjVs032914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 22 Jun 2019 01:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349285 - head/sys/dev/virtio/scsi X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/dev/virtio/scsi X-SVN-Commit-Revision: 349285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 001B58A228 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 01:20:46 -0000 Author: vangyzen Date: Sat Jun 22 01:20:45 2019 New Revision: 349285 URL: https://svnweb.freebsd.org/changeset/base/349285 Log: VirtIO SCSI: validate seg_max on attach Until r349278, bhyve presented a seg_max to the guest that was too large. Detect this case and clamp it to the virtqueue size. Otherwise, we would fail the "too many segments to enqueue" assertion in virtqueue_enqueue(). I hit this by running a guest with a MAXPHYS of 256 KB. Reviewed by: bryanv cem MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20703 Modified: head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Sat Jun 22 01:06:41 2019 (r349284) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Sat Jun 22 01:20:45 2019 (r349285) @@ -81,6 +81,7 @@ static void vtscsi_read_config(struct vtscsi_softc *, struct virtio_scsi_config *); static int vtscsi_maximum_segments(struct vtscsi_softc *, int); static int vtscsi_alloc_virtqueues(struct vtscsi_softc *); +static void vtscsi_check_sizes(struct vtscsi_softc *); static void vtscsi_write_device_config(struct vtscsi_softc *); static int vtscsi_reinit(struct vtscsi_softc *); @@ -311,6 +312,8 @@ vtscsi_attach(device_t dev) goto fail; } + vtscsi_check_sizes(sc); + error = vtscsi_init_event_vq(sc); if (error) { device_printf(dev, "cannot populate the eventvq\n"); @@ -475,6 +478,26 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc) "%s request", device_get_nameunit(dev)); return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); +} + +static void +vtscsi_check_sizes(struct vtscsi_softc *sc) +{ + int rqsize; + + if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) { + /* + * Ensure the assertions in virtqueue_enqueue(), + * even if the hypervisor reports a bad seg_max. + */ + rqsize = virtqueue_size(sc->vtscsi_request_vq); + if (sc->vtscsi_max_nsegs > rqsize) { + device_printf(sc->vtscsi_dev, + "clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs, + rqsize); + sc->vtscsi_max_nsegs = rqsize; + } + } } static void From owner-svn-src-head@freebsd.org Sat Jun 22 03:16:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9265015C96F9; Sat, 22 Jun 2019 03:16:03 +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 343748DA1D; Sat, 22 Jun 2019 03:16:03 +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 E590E4C1E; Sat, 22 Jun 2019 03:16:02 +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 x5M3G2Qr095551; Sat, 22 Jun 2019 03:16:02 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5M3G2sp095548; Sat, 22 Jun 2019 03:16:02 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906220316.x5M3G2sp095548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 22 Jun 2019 03:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349286 - in head: sbin/swapon share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head: sbin/swapon share/man/man5 X-SVN-Commit-Revision: 349286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 343748DA1D 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 03:16:03 -0000 Author: dougm Date: Sat Jun 22 03:16:01 2019 New Revision: 349286 URL: https://svnweb.freebsd.org/changeset/base/349286 Log: Modify swapon(8) to invoke BIO_DELETE to trim swap devices, either if '-E' appears on the swapon command line, or if "trimonce" appears as an fstab option. Discussed at: BSDCAN Tested by: markj Reviewed by: markj Approved by: markj (mentor) Differential Revision:https://reviews.freebsd.org/D20599 Modified: head/sbin/swapon/swapon.8 head/sbin/swapon/swapon.c head/share/man/man5/fstab.5 Modified: head/sbin/swapon/swapon.8 ============================================================================== --- head/sbin/swapon/swapon.8 Sat Jun 22 01:20:45 2019 (r349285) +++ head/sbin/swapon/swapon.8 Sat Jun 22 03:16:01 2019 (r349286) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 21, 2016 +.Dd June 21, 2019 .Dt SWAPON 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nm swapon .Oo Fl F Ar fstab .Oc -.Fl aLq | Ar +.Fl aLq | E Ar .Nm swapoff .Oo Fl F Ar fstab .Oc @@ -86,6 +86,11 @@ If the option is used, informational messages will not be written to standard output when a swap device is added. +The +.Fl E +option causes each of following devices to receive a +.Dv BIO_DELETE +command to mark all blocks as unused. .Pp The .Nm swapoff Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Jun 22 01:20:45 2019 (r349285) +++ head/sbin/swapon/swapon.c Sat Jun 22 03:16:01 2019 (r349286) @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -77,7 +78,7 @@ static int run_cmd(int *, const char *, ...) __printfl static enum { SWAPON, SWAPOFF, SWAPCTL } orig_prog, which_prog = SWAPCTL; -static int qflag; +static int Eflag, qflag; int main(int argc, char **argv) @@ -100,7 +101,7 @@ main(int argc, char **argv) doall = 0; etc_fstab = NULL; - while ((ch = getopt(argc, argv, "AadghklLmqsUF:")) != -1) { + while ((ch = getopt(argc, argv, "AadEghklLmqsUF:")) != -1) { switch(ch) { case 'A': if (which_prog == SWAPCTL) { @@ -121,6 +122,12 @@ main(int argc, char **argv) else usage(); break; + case 'E': + if (which_prog == SWAPON) + Eflag = 2; + else + usage(); + break; case 'g': hflag = 'G'; break; @@ -182,8 +189,10 @@ main(int argc, char **argv) strstr(fsp->fs_mntops, "late") == NULL && late != 0) continue; + Eflag |= (strstr(fsp->fs_mntops, "trimonce") != NULL); swfile = swap_on_off(fsp->fs_spec, 1, fsp->fs_mntops); + Eflag &= ~1; if (swfile == NULL) { ret = 1; continue; @@ -378,12 +387,22 @@ swap_on_geli_args(const char *mntops) return (NULL); } } else if (strcmp(token, "notrim") == 0) { + if (Eflag) { + warn("Options \"notrim\" and " + "\"trimonce\" conflict"); + free(ops); + return (NULL); + } Tflag = " -T "; } else if (strcmp(token, "late") == 0) { /* ignore known option */ } else if (strcmp(token, "noauto") == 0) { /* ignore known option */ - } else if (strcmp(token, "sw") != 0) { + } else if (strcmp(token, "sw") == 0) { + /* ignore known option */ + } else if (strcmp(token, "trimonce") == 0) { + /* ignore known option */ + } else { warnx("Invalid option: %s", token); free(ops); return (NULL); @@ -721,14 +740,42 @@ run_cmd(int *ofd, const char *cmdline, ...) return (WEXITSTATUS(status)); } +static void +swap_trim(const char *name) +{ + struct stat sb; + off_t ioarg[2], sz; + int fd; + + fd = open(name, O_WRONLY); + if (fd < 0) + errx(1, "Cannot open %s", name); + if (fstat(fd, &sb) < 0) + errx(1, "Cannot stat %s", name); + if (S_ISREG(sb.st_mode)) + sz = sb.st_size; + else if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { + if (ioctl(fd, DIOCGMEDIASIZE, &sz) != 0) + err(1, "ioctl(DIOCGMEDIASIZE)"); + } else + errx(1, "%s has an invalid file type", name); + ioarg[0] = 0; + ioarg[1] = sz; + if (ioctl(fd, DIOCGDELETE, ioarg) != 0) + warn("ioctl(DIOCGDELETE)"); + close(fd); +} + static const char * swap_on_off_sfile(const char *name, int doingall) { int error; - if (which_prog == SWAPON) + if (which_prog == SWAPON) { + if (Eflag) + swap_trim(name); error = swapon(name); - else /* SWAPOFF */ + } else /* SWAPOFF */ error = swapoff(name); if (error == -1) { @@ -759,6 +806,8 @@ usage(void) fprintf(stderr, "usage: %s ", getprogname()); switch(orig_prog) { case SWAPON: + fprintf(stderr, "[-F fstab] -aLq | [-E] file ...\n"); + break; case SWAPOFF: fprintf(stderr, "[-F fstab] -aLq | file ...\n"); break; Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Sat Jun 22 01:20:45 2019 (r349285) +++ head/share/man/man5/fstab.5 Sat Jun 22 03:16:01 2019 (r349286) @@ -216,6 +216,12 @@ then the special file is made available as a piece of space by the .Xr swapon 8 command at the end of the system reboot procedure. +For swap devices, the keyword +.Dq trimonce +triggers the delivery of a +.Dv BIO_DELETE +command to the device to mark +all blocks as unused. For vnode-backed swap spaces, .Dq file is supported in the From owner-svn-src-head@freebsd.org Sat Jun 22 03:50:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A83715CA5D4; Sat, 22 Jun 2019 03:50:44 +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 E58E58EB9D; Sat, 22 Jun 2019 03:50:43 +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 B9E9F5296; Sat, 22 Jun 2019 03:50:43 +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 x5M3ohr0011427; Sat, 22 Jun 2019 03:50:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5M3ohpf011425; Sat, 22 Jun 2019 03:50:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906220350.x5M3ohpf011425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Jun 2019 03:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349287 - 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: 349287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E58E58EB9D 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 03:50:44 -0000 Author: mav Date: Sat Jun 22 03:50:43 2019 New Revision: 349287 URL: https://svnweb.freebsd.org/changeset/base/349287 Log: Remove ancient SCSI-2/3 mentioning. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc_internal.h Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Sat Jun 22 03:16:01 2019 (r349286) +++ head/sys/cam/scsi/scsi_enc.c Sat Jun 22 03:50:43 2019 (r349287) @@ -684,14 +684,8 @@ enc_type(struct ccb_getdev *cgd) buflen = min(sizeof(cgd->inq_data), SID_ADDITIONAL_LENGTH(&cgd->inq_data)); - if ((iqd[0] & 0x1f) == T_ENCLOSURE) { - if ((iqd[2] & 0x7) > 2) { - return (ENC_SES); - } else { - return (ENC_SES_SCSI2); - } - return (ENC_NONE); - } + if ((iqd[0] & 0x1f) == T_ENCLOSURE) + return (ENC_SES); #ifdef SES_ENABLE_PASSTHROUGH if ((iqd[6] & 0x40) && (iqd[2] & 0x7) >= 2) { @@ -928,7 +922,6 @@ enc_ctor(struct cam_periph *periph, void *arg) switch (enc->enc_type) { case ENC_SES: - case ENC_SES_SCSI2: case ENC_SES_PASSTHROUGH: case ENC_SEMB_SES: err = ses_softc_init(enc); @@ -1017,17 +1010,14 @@ enc_ctor(struct cam_periph *periph, void *arg) case ENC_NONE: tname = "No ENC device"; break; - case ENC_SES_SCSI2: - tname = "SCSI-2 ENC Device"; - break; case ENC_SES: - tname = "SCSI-3 ENC Device"; + tname = "SES Device"; break; case ENC_SES_PASSTHROUGH: - tname = "ENC Passthrough Device"; + tname = "SES Passthrough Device"; break; case ENC_SAFT: - tname = "SAF-TE Compliant Device"; + tname = "SAF-TE Device"; break; case ENC_SEMB_SES: tname = "SEMB SES Device"; Modified: head/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- head/sys/cam/scsi/scsi_enc_internal.h Sat Jun 22 03:16:01 2019 (r349286) +++ head/sys/cam/scsi/scsi_enc_internal.h Sat Jun 22 03:50:43 2019 (r349287) @@ -55,10 +55,8 @@ typedef struct enc_element { typedef enum { ENC_NONE, - ENC_SES_SCSI2, ENC_SES, ENC_SES_PASSTHROUGH, - ENC_SEN, ENC_SAFT, ENC_SEMB_SES, ENC_SEMB_SAFT From owner-svn-src-head@freebsd.org Sat Jun 22 05:35:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6040515CC5F4; Sat, 22 Jun 2019 05:35:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0571B6AC2F; Sat, 22 Jun 2019 05:35:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0846482; Sat, 22 Jun 2019 05:35:23 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5M5ZN9T068886; Sat, 22 Jun 2019 05:35:23 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5M5ZNQk068885; Sat, 22 Jun 2019 05:35:23 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201906220535.x5M5ZNQk068885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 22 Jun 2019 05:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349288 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 349288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0571B6AC2F 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.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 05:35:24 -0000 Author: rlibby Date: Sat Jun 22 05:35:23 2019 New Revision: 349288 URL: https://svnweb.freebsd.org/changeset/base/349288 Log: ddb show proc typo Modified: head/sys/ddb/db_ps.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Sat Jun 22 03:50:43 2019 (r349287) +++ head/sys/ddb/db_ps.c Sat Jun 22 05:35:23 2019 (r349288) @@ -481,7 +481,7 @@ DB_SHOW_COMMAND(proc, db_show_proc) dump_args(p); db_printf("\n"); } - db_printf(" repear: %p reapsubtree: %d\n", + db_printf(" reaper: %p reapsubtree: %d\n", p->p_reaper, p->p_reapsubtree); db_printf(" sigparent: %d\n", p->p_sigparent); db_printf(" vmspace: %p\n", p->p_vmspace); From owner-svn-src-head@freebsd.org Sat Jun 22 07:17:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE3515CE257; Sat, 22 Jun 2019 07:17:21 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (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 4DE9E6CEA3; Sat, 22 Jun 2019 07:17:20 +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 x5M7H8Vv070114 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 22 Jun 2019 17:17:15 +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 x5M7H3ZZ071171 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 22 Jun 2019 17:17:03 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x5M7H30D071170; Sat, 22 Jun 2019 17:17:03 +1000 (AEST) (envelope-from peter) Date: Sat, 22 Jun 2019 17:17:03 +1000 From: Peter Jeremy To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349151 - in head: lib/libufs stand/libsa sys/conf sys/dev/iscsi sys/dev/iscsi_initiator sys/dev/liquidio sys/dev/usb/net sys/fs/ext2fs sys/fs/nandfs sys/geom/part sys/geom/raid sys/ker... Message-ID: <20190622071703.GA71146@server.rulingia.com> References: <201906171949.x5HJn9Ed091108@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <201906171949.x5HJn9Ed091108@repo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.0 (2019-05-25) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 07:17:21 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Jun-17 19:49:09 +0000, Xin LI wrote: >Author: delphij >Date: Mon Jun 17 19:49:08 2019 >New Revision: 349151 >URL: https://svnweb.freebsd.org/changeset/base/349151 > >Log: > Separate kernel crc32() implementation to its own header (gsb_crc32.h) a= nd > rename the source to gsb_crc32.c. I'm not sure how but this breaks my Rock64. r349150 boots without problem but r349151 panics during the probe: =2E.. rockchip_dwmmc0: mem 0xff500000-0xff503fff irq 40 on ofwbus0 rockchip_dwmmc0: Hardware version ID is 270a mmc0: on rockchip_dwmmc0 rockchip_dwmmc1: mem 0xff520000-0xff523fff irq 42 on ofwbus0 rockchip_dwmmc1: Hardware version ID is 270a panic: Duplicate alloc of 0xfffffd000089cf50 from zone 0xfffffd0000817540(1= 6) slab 0xfffffd000089cf90(0) cpuid =3D 0 time =3D 1 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc =3D 0xffff000000535a14 lr =3D 0xffff0000000df10c sp =3D 0xffff0000000104d0 fp =3D 0xffff0000000106e0 db_trace_self_wrapper() at vpanic+0x18c pc =3D 0xffff0000000df10c lr =3D 0xffff000000277edc sp =3D 0xffff0000000106f0 fp =3D 0xffff000000010790 vpanic() at panic+0x44 pc =3D 0xffff000000277edc lr =3D 0xffff000000277c8c sp =3D 0xffff0000000107a0 fp =3D 0xffff000000010820 panic() at uma_dbg_alloc+0x144 pc =3D 0xffff000000277c8c lr =3D 0xffff0000004fa174 sp =3D 0xffff000000010830 fp =3D 0xffff000000010850 uma_dbg_alloc() at uma_zalloc_arg+0x9b0 pc =3D 0xffff0000004fa174 lr =3D 0xffff0000004f9624 sp =3D 0xffff000000010860 fp =3D 0xffff0000000108e0 uma_zalloc_arg() at malloc+0x9c pc =3D 0xffff0000004f9624 lr =3D 0xffff000000252750 sp =3D 0xffff0000000108f0 fp =3D 0xffff000000010920 malloc() at bounce_bus_dmamem_alloc+0x4c pc =3D 0xffff000000252750 lr =3D 0xffff000000533828 sp =3D 0xffff000000010930 fp =3D 0xffff000000010960 bounce_bus_dmamem_alloc() at dwmmc_attach+0x5fc pc =3D 0xffff000000533828 lr =3D 0xffff000000556f14 sp =3D 0xffff000000010970 fp =3D 0xffff0000000109e0 dwmmc_attach() at device_attach+0x3f4 pc =3D 0xffff000000556f14 lr =3D 0xffff0000002aba50 sp =3D 0xffff0000000109f0 fp =3D 0xffff000000010a40 device_attach() at bus_generic_new_pass+0x12c pc =3D 0xffff0000002aba50 lr =3D 0xffff0000002ad804 sp =3D 0xffff000000010a50 fp =3D 0xffff000000010a80 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff0000002ad804 lr =3D 0xffff0000002ad7bc sp =3D 0xffff000000010a90 fp =3D 0xffff000000010ac0 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff0000002ad7bc lr =3D 0xffff0000002ad7bc sp =3D 0xffff000000010ad0 fp =3D 0xffff000000010b00 bus_generic_new_pass() at bus_set_pass+0x8c pc =3D 0xffff0000002ad7bc lr =3D 0xffff0000002a91ac sp =3D 0xffff000000010b10 fp =3D 0xffff000000010b40 bus_set_pass() at mi_startup+0x238 pc =3D 0xffff0000002a91ac lr =3D 0xffff00000021246c sp =3D 0xffff000000010b50 fp =3D 0xffff000000010bb0 =2E.. --=20 Peter Jeremy --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl0N1elfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRpJA//WGfQHMPrppQxHsQy4NfY1J9bjx+YkPjRFzNPwbdvLzVdum8GQZutxxSj ScbemSChoiOwNwd6SE9y9IEZ7jAChT6MO+HkNba5t0vUw2e1bhMELDjG+K1Copcz YCzsKvzd8vOt9jMHJE9tmm4cQ/yxkxA7+Q8Y+PfkiXg3xsRUaGITGABb4Dm/jIDR rqspzDOsvWhnKUZI7tjAZ8OnBEhyxvp+yLuznBajefel4tQF/lhaA7EJpAinHEGD BgI3XhskBe876eSJvVXfzh8lk0o0IdXGL3/8jPgTKPeMvbnNQ0LRWR975Gt2YREs O/EudvlG9+1BzrePFjlxFjishTJumWYDDhIkURvQMQBY5WWoIDxD21dP6lqz7569 DHGrKVOnWbGAtpbc2WC59bIDz052jhgDOfdgzhaFXgnPopZbCX8VCrvKVTpfBeS8 2pzN/qpMMu2C9Ud8E5eCOpstpJN6/6TaWMKgx7ah38RoaFQhIwyPrXWo3adH8v24 OvN5wNYV81Cj+l+44CfeKETauamYeaMntz4/vN8QxjrggwEqRPPhO0n1onrRsu0F 89IVPuCgwfrNeEt1VWgwrqIlYqpTkC4aKEbdj76Mxa+3WpPvh0bePZQvm+DYUEas Lqc+LqKpsJDCs7MS0WL+5uj/kLfpCR+dFWYrt5zp6ymXOkcJRHk= =iSrx -----END PGP SIGNATURE----- --liOOAslEiF7prFVr-- From owner-svn-src-head@freebsd.org Sat Jun 22 15:39:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC4E15D6F83; Sat, 22 Jun 2019 15:39:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C82F81BB9; Sat, 22 Jun 2019 15:39:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B1F9C9B9; Sat, 22 Jun 2019 15:39:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5MFdZE6083782; Sat, 22 Jun 2019 15:39:35 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MFdZJ5083781; Sat, 22 Jun 2019 15:39:35 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201906221539.x5MFdZJ5083781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 22 Jun 2019 15:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349289 - head/lib/libjail X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/lib/libjail X-SVN-Commit-Revision: 349289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C82F81BB9 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 15:39:36 -0000 Author: dteske Date: Sat Jun 22 15:39:34 2019 New Revision: 349289 URL: https://svnweb.freebsd.org/changeset/base/349289 Log: `libjail/jail.c' includes both and Latter is undesired when including according to style(9) Submitted by: Faraz Vahedi Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D20637 Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Sat Jun 22 05:35:23 2019 (r349288) +++ head/lib/libjail/jail.c Sat Jun 22 15:39:34 2019 (r349289) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include From owner-svn-src-head@freebsd.org Sat Jun 22 16:26:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D82715D8119; Sat, 22 Jun 2019 16:26:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA75B83600; Sat, 22 Jun 2019 16:26:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4873FD227; Sat, 22 Jun 2019 16:26:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5MGQddm009636; Sat, 22 Jun 2019 16:26:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MGQdoA009635; Sat, 22 Jun 2019 16:26:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201906221626.x5MGQdoA009635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jun 2019 16:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349290 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 349290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA75B83600 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 16:26:40 -0000 Author: alc Date: Sat Jun 22 16:26:38 2019 New Revision: 349290 URL: https://svnweb.freebsd.org/changeset/base/349290 Log: Introduce pmap_remove_l3_range() and use it in two places: (1) pmap_remove(), where it eliminates redundant TLB invalidations by pmap_remove() and pmap_remove_l3(), and (2) pmap_enter_l2(), where it may optimize the TLB invalidations by batching them. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12725 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Jun 22 15:39:34 2019 (r349289) +++ head/sys/arm64/arm64/pmap.c Sat Jun 22 16:26:38 2019 (r349290) @@ -2510,6 +2510,82 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ } /* + * Remove the specified range of addresses from the L3 page table that is + * identified by the given L2 entry. + */ +static void +pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, + vm_offset_t eva, struct spglist *free, struct rwlock **lockp) +{ + struct md_page *pvh; + struct rwlock *new_lock; + pt_entry_t *l3, old_l3; + vm_offset_t va; + vm_page_t m; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(rounddown2(sva, L2_SIZE) + L2_SIZE == roundup2(eva, L2_SIZE), + ("pmap_remove_l3_range: range crosses an L3 page table boundary")); + va = eva; + for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { + if (!pmap_l3_valid(pmap_load(l3))) { + if (va != eva) { + pmap_invalidate_range(pmap, va, sva); + va = eva; + } + continue; + } + old_l3 = pmap_load_clear(l3); + if ((old_l3 & ATTR_SW_WIRED) != 0) + pmap->pm_stats.wired_count--; + pmap_resident_count_dec(pmap, 1); + if ((old_l3 & ATTR_SW_MANAGED) != 0) { + m = PHYS_TO_VM_PAGE(old_l3 & ~ATTR_MASK); + if (pmap_page_dirty(old_l3)) + vm_page_dirty(m); + if ((old_l3 & ATTR_AF) != 0) + vm_page_aflag_set(m, PGA_REFERENCED); + new_lock = PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)); + if (new_lock != *lockp) { + if (*lockp != NULL) { + /* + * Pending TLB invalidations must be + * performed before the PV list lock is + * released. Otherwise, a concurrent + * pmap_remove_all() on a physical page + * could return while a stale TLB entry + * still provides access to that page. + */ + if (va != eva) { + pmap_invalidate_range(pmap, va, + sva); + va = eva; + } + rw_wunlock(*lockp); + } + *lockp = new_lock; + rw_wlock(*lockp); + } + pmap_pvh_free(&m->md, pmap, sva); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); + } + } + if (va == eva) + va = sva; + if (pmap_unuse_pt(pmap, sva, l2e, free)) { + sva += L3_SIZE; + break; + } + } + if (va != eva) + pmap_invalidate_range(pmap, va, sva); +} + +/* * Remove the given range of addresses from the specified map. * * It is assumed that the start and end are properly @@ -2519,9 +2595,9 @@ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { struct rwlock *lock; - vm_offset_t va, va_next; + vm_offset_t va_next; pd_entry_t *l0, *l1, *l2; - pt_entry_t l3_paddr, *l3; + pt_entry_t l3_paddr; struct spglist free; /* @@ -2594,28 +2670,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (va_next > eva) va_next = eva; - va = va_next; - for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, - sva += L3_SIZE) { - if (l3 == NULL) - panic("l3 == NULL"); - if (pmap_load(l3) == 0) { - if (va != va_next) { - pmap_invalidate_range(pmap, va, sva); - va = va_next; - } - continue; - } - if (va == va_next) - va = sva; - if (pmap_remove_l3(pmap, l3, sva, l3_paddr, &free, - &lock)) { - sva += L3_SIZE; - break; - } - } - if (va != va_next) - pmap_invalidate_range(pmap, va, sva); + pmap_remove_l3_range(pmap, l3_paddr, sva, va_next, &free, + &lock); } if (lock != NULL) rw_wunlock(lock); @@ -3419,8 +3475,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t vm_page_t m, struct rwlock **lockp) { struct spglist free; - pd_entry_t *l2, *l3, old_l2; - vm_offset_t sva; + pd_entry_t *l2, old_l2; vm_page_t l2pg, mt; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -3449,13 +3504,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, lockp); else - for (sva = va; sva < va + L2_SIZE; sva += PAGE_SIZE) { - l3 = pmap_l2_to_l3(l2, sva); - if (pmap_l3_valid(pmap_load(l3)) && - pmap_remove_l3(pmap, l3, sva, old_l2, &free, - lockp) != 0) - break; - } + pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, + &free, lockp); vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { /* From owner-svn-src-head@freebsd.org Sat Jun 22 16:54:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC43B15D8724; Sat, 22 Jun 2019 16:54:24 +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 5A64784142; Sat, 22 Jun 2019 16:54:24 +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 3ED06D70B; Sat, 22 Jun 2019 16:54:24 +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 x5MGsOw6025316; Sat, 22 Jun 2019 16:54:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MGsOMR025315; Sat, 22 Jun 2019 16:54:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906221654.x5MGsOMR025315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 22 Jun 2019 16:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349291 - head/share/examples/etc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/examples/etc X-SVN-Commit-Revision: 349291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A64784142 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 16:54:24 -0000 Author: imp Date: Sat Jun 22 16:54:23 2019 New Revision: 349291 URL: https://svnweb.freebsd.org/changeset/base/349291 Log: Add list of valid CPUTYPE flags for arm/arm64 to make.conf example Summary: Adds a list of valid CPUTYPE flags for arm and arm64 architectures List taken from share/mk/bsd.cpu.mk Submitted by: Daniel Engberg Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D20315 Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Sat Jun 22 16:26:38 2019 (r349290) +++ head/share/examples/etc/make.conf Sat Jun 22 16:54:23 2019 (r349291) @@ -49,6 +49,12 @@ # icelake-client, cannonlake, knm, skylake-avx512, knl, # goldmont, skylake, broadwell, haswell, ivybridge, # sandybridge, westmere, nehalem, silvermont, bonnell +# ARM architecture: armv5, armv5te, armv6, armv6t2, arm1176jzf-s, armv7, +# armv7-a, armv7ve, generic-armv7-a, cortex-a5, +# cortex-a7, cortex-a8, cortex-a9, cortex-a12, +# cortex-a15, cortex-a17 +# ARM64 architechture: cortex-a53, cortex-a57, cortex-a72, +# exynos-m1 # # (?= allows to buildworld for a different CPUTYPE.) # From owner-svn-src-head@freebsd.org Sat Jun 22 17:09:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3684A15D8CA8; Sat, 22 Jun 2019 17:09:53 +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 479C3848FC; Sat, 22 Jun 2019 17:09:52 +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 x5MH9gww000210 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 22 Jun 2019 20:09:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x5MH9gww000210 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x5MH9gYA000206; Sat, 22 Jun 2019 20:09:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Jun 2019 20:09:42 +0300 From: Konstantin Belousov To: Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349286 - in head: sbin/swapon share/man/man5 Message-ID: <20190622170942.GN8697@kib.kiev.ua> References: <201906220316.x5M3G2sp095548@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906220316.x5M3G2sp095548@repo.freebsd.org> User-Agent: Mutt/1.12.0 (2019-05-25) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 17:09:53 -0000 On Sat, Jun 22, 2019 at 03:16:02AM +0000, Doug Moore wrote: > Author: dougm > Date: Sat Jun 22 03:16:01 2019 > New Revision: 349286 > URL: https://svnweb.freebsd.org/changeset/base/349286 > > Log: > Modify swapon(8) to invoke BIO_DELETE to trim swap devices, either if > '-E' appears on the swapon command line, or if "trimonce" appears as > an fstab option. > > Discussed at: BSDCAN > Tested by: markj > Reviewed by: markj > Approved by: markj (mentor) > Differential Revision:https://reviews.freebsd.org/D20599 > > Modified: > head/sbin/swapon/swapon.8 > head/sbin/swapon/swapon.c > head/share/man/man5/fstab.5 > > Modified: head/sbin/swapon/swapon.8 > ============================================================================== > --- head/sbin/swapon/swapon.8 Sat Jun 22 01:20:45 2019 (r349285) > +++ head/sbin/swapon/swapon.8 Sat Jun 22 03:16:01 2019 (r349286) > @@ -28,7 +28,7 @@ > .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 > .\" $FreeBSD$ > .\" > -.Dd October 21, 2016 > +.Dd June 21, 2019 > .Dt SWAPON 8 > .Os > .Sh NAME > @@ -38,7 +38,7 @@ > .Nm swapon > .Oo Fl F Ar fstab > .Oc > -.Fl aLq | Ar > +.Fl aLq | E Ar > .Nm swapoff > .Oo Fl F Ar fstab > .Oc > @@ -86,6 +86,11 @@ If the > option is used, > informational messages will not be > written to standard output when a swap device is added. > +The > +.Fl E > +option causes each of following devices to receive a > +.Dv BIO_DELETE > +command to mark all blocks as unused. > .Pp > The > .Nm swapoff > > Modified: head/sbin/swapon/swapon.c > ============================================================================== > --- head/sbin/swapon/swapon.c Sat Jun 22 01:20:45 2019 (r349285) > +++ head/sbin/swapon/swapon.c Sat Jun 22 03:16:01 2019 (r349286) > @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/ > #include > __FBSDID("$FreeBSD$"); > > +#include > #include > #include > #include > @@ -77,7 +78,7 @@ static int run_cmd(int *, const char *, ...) __printfl > > static enum { SWAPON, SWAPOFF, SWAPCTL } orig_prog, which_prog = SWAPCTL; > > -static int qflag; > +static int Eflag, qflag; > > int > main(int argc, char **argv) > @@ -100,7 +101,7 @@ main(int argc, char **argv) > > doall = 0; > etc_fstab = NULL; > - while ((ch = getopt(argc, argv, "AadghklLmqsUF:")) != -1) { > + while ((ch = getopt(argc, argv, "AadEghklLmqsUF:")) != -1) { > switch(ch) { > case 'A': > if (which_prog == SWAPCTL) { > @@ -121,6 +122,12 @@ main(int argc, char **argv) > else > usage(); > break; > + case 'E': > + if (which_prog == SWAPON) > + Eflag = 2; > + else > + usage(); > + break; > case 'g': > hflag = 'G'; > break; > @@ -182,8 +189,10 @@ main(int argc, char **argv) > strstr(fsp->fs_mntops, "late") == NULL && > late != 0) > continue; > + Eflag |= (strstr(fsp->fs_mntops, "trimonce") != NULL); > swfile = swap_on_off(fsp->fs_spec, 1, > fsp->fs_mntops); > + Eflag &= ~1; > if (swfile == NULL) { > ret = 1; > continue; > @@ -378,12 +387,22 @@ swap_on_geli_args(const char *mntops) > return (NULL); > } > } else if (strcmp(token, "notrim") == 0) { > + if (Eflag) { > + warn("Options \"notrim\" and " > + "\"trimonce\" conflict"); > + free(ops); > + return (NULL); > + } > Tflag = " -T "; > } else if (strcmp(token, "late") == 0) { > /* ignore known option */ > } else if (strcmp(token, "noauto") == 0) { > /* ignore known option */ > - } else if (strcmp(token, "sw") != 0) { > + } else if (strcmp(token, "sw") == 0) { > + /* ignore known option */ > + } else if (strcmp(token, "trimonce") == 0) { > + /* ignore known option */ > + } else { > warnx("Invalid option: %s", token); > free(ops); > return (NULL); > @@ -721,14 +740,42 @@ run_cmd(int *ofd, const char *cmdline, ...) > return (WEXITSTATUS(status)); > } > > +static void > +swap_trim(const char *name) > +{ > + struct stat sb; > + off_t ioarg[2], sz; > + int fd; > + > + fd = open(name, O_WRONLY); > + if (fd < 0) > + errx(1, "Cannot open %s", name); > + if (fstat(fd, &sb) < 0) > + errx(1, "Cannot stat %s", name); > + if (S_ISREG(sb.st_mode)) > + sz = sb.st_size; > + else if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { S_ISBLK check is useless or even wrong. > + if (ioctl(fd, DIOCGMEDIASIZE, &sz) != 0) > + err(1, "ioctl(DIOCGMEDIASIZE)"); > + } else > + errx(1, "%s has an invalid file type", name); > + ioarg[0] = 0; > + ioarg[1] = sz; > + if (ioctl(fd, DIOCGDELETE, ioarg) != 0) > + warn("ioctl(DIOCGDELETE)"); > + close(fd); > +} > + > static const char * > swap_on_off_sfile(const char *name, int doingall) > { > int error; > > - if (which_prog == SWAPON) > + if (which_prog == SWAPON) { > + if (Eflag) > + swap_trim(name); > error = swapon(name); > - else /* SWAPOFF */ > + } else /* SWAPOFF */ > error = swapoff(name); > > if (error == -1) { > @@ -759,6 +806,8 @@ usage(void) > fprintf(stderr, "usage: %s ", getprogname()); > switch(orig_prog) { > case SWAPON: > + fprintf(stderr, "[-F fstab] -aLq | [-E] file ...\n"); > + break; > case SWAPOFF: > fprintf(stderr, "[-F fstab] -aLq | file ...\n"); > break; > > Modified: head/share/man/man5/fstab.5 > ============================================================================== > --- head/share/man/man5/fstab.5 Sat Jun 22 01:20:45 2019 (r349285) > +++ head/share/man/man5/fstab.5 Sat Jun 22 03:16:01 2019 (r349286) > @@ -216,6 +216,12 @@ then the special file is made available as a piece of > space by the > .Xr swapon 8 > command at the end of the system reboot procedure. > +For swap devices, the keyword > +.Dq trimonce > +triggers the delivery of a > +.Dv BIO_DELETE > +command to the device to mark > +all blocks as unused. > For vnode-backed swap spaces, > .Dq file > is supported in the From owner-svn-src-head@freebsd.org Sat Jun 22 19:09:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2317D15B3F91; Sat, 22 Jun 2019 19:09:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8B478844E; Sat, 22 Jun 2019 19:09:11 +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 42312ED6C; Sat, 22 Jun 2019 19:09:11 +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 x5MJ9B0R093407; Sat, 22 Jun 2019 19:09:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MJ9AQl093403; Sat, 22 Jun 2019 19:09:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906221909.x5MJ9AQl093403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Jun 2019 19:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349292 - 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: 349292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8B478844E 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 19:09:12 -0000 Author: mav Date: Sat Jun 22 19:09:10 2019 New Revision: 349292 URL: https://svnweb.freebsd.org/changeset/base/349292 Log: Decouple enc/ses verbosity from bootverbose. I don't want to be regularly notified that my enclosure violates standards until there is some real problem I want to debug. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc_internal.h head/sys/cam/scsi/scsi_enc_safte.c Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Sat Jun 22 16:54:23 2019 (r349291) +++ head/sys/cam/scsi/scsi_enc.c Sat Jun 22 19:09:10 2019 (r349292) @@ -81,6 +81,14 @@ static enctyp enc_type(struct ccb_getdev *); SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0, "CAM Enclosure Services driver"); +#if defined(DEBUG) || defined(ENC_DEBUG) +int enc_verbose = 1; +#else +int enc_verbose = 0; +#endif +SYSCTL_INT(_kern_cam_enc, OID_AUTO, verbose, CTLFLAG_RWTUN, + &enc_verbose, 0, "Enable verbose logging"); + static struct periph_driver encdriver = { enc_init, "ses", TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 Modified: head/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- head/sys/cam/scsi/scsi_enc_internal.h Sat Jun 22 16:54:23 2019 (r349291) +++ head/sys/cam/scsi/scsi_enc_internal.h Sat Jun 22 19:09:10 2019 (r349292) @@ -36,6 +36,8 @@ #ifndef __SCSI_ENC_INTERNAL_H__ #define __SCSI_ENC_INTERNAL_H__ +#include + typedef struct enc_element { uint32_t enctype : 8, /* enclosure type */ @@ -204,6 +206,9 @@ enc_softc_init_t ses_softc_init; /* SAF-TE interface */ enc_softc_init_t safte_softc_init; +SYSCTL_DECL(_kern_cam_enc); +extern int enc_verbose; + /* Helper macros */ MALLOC_DECLARE(M_SCSIENC); #define ENC_CFLAGS CAM_RETRY_SELTO @@ -216,7 +221,7 @@ MALLOC_DECLARE(M_SCSIENC); #else #define ENC_DLOG if (0) enc_log #endif -#define ENC_VLOG if (bootverbose) enc_log +#define ENC_VLOG if (enc_verbose) enc_log #define ENC_MALLOC(amt) malloc(amt, M_SCSIENC, M_NOWAIT) #define ENC_MALLOCZ(amt) malloc(amt, M_SCSIENC, M_ZERO|M_NOWAIT) /* Cast away const avoiding GCC warnings. */ Modified: head/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_safte.c Sat Jun 22 16:54:23 2019 (r349291) +++ head/sys/cam/scsi/scsi_enc_safte.c Sat Jun 22 19:09:10 2019 (r349292) @@ -227,7 +227,6 @@ static char *safte_2little = "Too Little Data Returned } int emulate_array_devices = 1; -SYSCTL_DECL(_kern_cam_enc); SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN, &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE"); From owner-svn-src-head@freebsd.org Sat Jun 22 19:27:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F3615B487F; Sat, 22 Jun 2019 19:27:10 +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 295408926B; Sat, 22 Jun 2019 19:27:10 +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 F0264F0DC; Sat, 22 Jun 2019 19:27:09 +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 x5MJR9Ho003792; Sat, 22 Jun 2019 19:27:09 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MJR9is003791; Sat, 22 Jun 2019 19:27:09 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201906221927.x5MJR9is003791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 22 Jun 2019 19:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349293 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 349293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 295408926B 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 19:27:10 -0000 Author: dougm Date: Sat Jun 22 19:27:09 2019 New Revision: 349293 URL: https://svnweb.freebsd.org/changeset/base/349293 Log: You can't use block special nodes for swap, so don't let that happen. Fix a style violation with regard to header file arrangement. Improved by: alc Approved by: markj, kib (mentor) Differential Revision: https://reviews.freebsd.org/D20723 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Jun 22 19:09:10 2019 (r349292) +++ head/sbin/swapon/swapon.c Sat Jun 22 19:27:09 2019 (r349293) @@ -43,9 +43,8 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/ #include __FBSDID("$FreeBSD$"); -#include #include -#include +#include #include #include #include @@ -754,7 +753,7 @@ swap_trim(const char *name) errx(1, "Cannot stat %s", name); if (S_ISREG(sb.st_mode)) sz = sb.st_size; - else if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { + else if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &sz) != 0) err(1, "ioctl(DIOCGMEDIASIZE)"); } else From owner-svn-src-head@freebsd.org Sat Jun 22 22:35:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DFF15BB8C7; Sat, 22 Jun 2019 22:35:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A46B08FE18; Sat, 22 Jun 2019 22:34:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D98A1907C; Sat, 22 Jun 2019 22:34:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5MMYxQV005256; Sat, 22 Jun 2019 22:34:59 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MMYxMX005255; Sat, 22 Jun 2019 22:34:59 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906222234.x5MMYxMX005255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 22 Jun 2019 22:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349294 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A46B08FE18 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 22:35:00 -0000 Author: sevan (doc committer) Date: Sat Jun 22 22:34:59 2019 New Revision: 349294 URL: https://svnweb.freebsd.org/changeset/base/349294 Log: Remove question mark from the link between NetBSD & Darwin. As linked to in bug 26137 as a source https://web.archive.org/web/20001012121507/http://www.opensource.apple.com/projects/darwin/faq.html mentions: "We already synchronize our code periodically with NetBSD for most of our user commands" Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Jun 22 19:27:09 2019 (r349293) +++ head/share/misc/bsd-family-tree Sat Jun 22 22:34:59 2019 (r349294) @@ -135,7 +135,7 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | | FreeBSD 3.5.1 | | | | | | | | | | | | | | | *---FreeBSD 4.1 | | | | | | | - | | | | (?) | | | | + | | | | | | | | | | FreeBSD 4.1.1 | | / | | | | | | | | / | | | | | FreeBSD 4.2 Darwin/ | NetBSD 1.4.3 | | From owner-svn-src-head@freebsd.org Sat Jun 22 22:43:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6999E15BBC7B; Sat, 22 Jun 2019 22:43:41 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEA5468340; Sat, 22 Jun 2019 22:43:40 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 857931921B; Sat, 22 Jun 2019 22:43:40 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5MMhefR010273; Sat, 22 Jun 2019 22:43:40 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MMhelW010272; Sat, 22 Jun 2019 22:43:40 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201906222243.x5MMhelW010272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 22 Jun 2019 22:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349295 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 349295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEA5468340 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 22:43:41 -0000 Author: sevan (doc committer) Date: Sat Jun 22 22:43:40 2019 New Revision: 349295 URL: https://svnweb.freebsd.org/changeset/base/349295 Log: Add DragonFly BSD 5.6.1 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Jun 22 22:34:59 2019 (r349294) +++ head/share/misc/bsd-family-tree Sat Jun 22 22:43:40 2019 (r349295) @@ -399,6 +399,8 @@ FreeBSD 5.2 | | | | | | NetBSD | | | | | 8.1 | DragonFly 5.6 | | | | | + | | | | DragonFly 5.6.1 + | | | | | FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -783,6 +785,7 @@ DragonFly 5.4.1 2018-12-24 [DFB] OpenBSD 6.5 2019-05-01 [OBD] NetBSD 8.1 2019-06-04 [NBD] DragonFly 5.6 2019-06-17 [DFB] +DragonFly 5.6.1 2019-06-19 [DFB] Bibliography ------------------------