From owner-svn-src-all@freebsd.org Sun Jun 16 00:27:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 00:32:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 00:43:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 00:53:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 01:05:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 01:22:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 01:23:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 03:06:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 05:12:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 09:17:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 10:43:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 10:46:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A53CB15BB040; Sun, 16 Jun 2019 10:46:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48A767499D; Sun, 16 Jun 2019 10:46:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37FFAD60A; Sun, 16 Jun 2019 10:46:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GAk3BK092424; Sun, 16 Jun 2019 10:46:03 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GAk3jV092423; Sun, 16 Jun 2019 10:46:03 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161046.x5GAk3jV092423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 10:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349102 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 349102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48A767499D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 10:46:03 -0000 Author: marius Date: Sun Jun 16 10:46:02 2019 New Revision: 349102 URL: https://svnweb.freebsd.org/changeset/base/349102 Log: MFC: r343979 As struct cryptop is wrapped in #ifdef _KERNEL, userland doesn't need to drag in either. Modified: stable/12/sys/opencrypto/cryptodev.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/opencrypto/cryptodev.h ============================================================================== --- stable/12/sys/opencrypto/cryptodev.h Sun Jun 16 10:43:18 2019 (r349101) +++ stable/12/sys/opencrypto/cryptodev.h Sun Jun 16 10:46:02 2019 (r349102) @@ -63,10 +63,10 @@ #define _CRYPTO_CRYPTO_H_ #include -#include #ifdef _KERNEL #include +#include #endif /* Some initial values */ From owner-svn-src-all@freebsd.org Sun Jun 16 11:34:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91BBF15BBFE6; Sun, 16 Jun 2019 11:34:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37DBF75C9F; Sun, 16 Jun 2019 11:34:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00916DE62; Sun, 16 Jun 2019 11:34:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GBYude018515; Sun, 16 Jun 2019 11:34:56 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GBYui4018514; Sun, 16 Jun 2019 11:34:56 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161134.x5GBYui4018514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 11:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349103 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 349103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37DBF75C9F 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 11:34:57 -0000 Author: marius Date: Sun Jun 16 11:34:56 2019 New Revision: 349103 URL: https://svnweb.freebsd.org/changeset/base/349103 Log: MFC: r344060, r344064 Further correct and optimize the bus_dma(9) usage of iflib(4): o Correct the obvious bugs in the netmap(4) parts: - No longer check for the existence of DMA maps as bus_dma(9) is used unconditionally in iflib(4) since r341095 (MFCed to stable/12 in r343304). - Supply the correct DMA tag and map pairs to bus_dma(9) functions (see also the commit message of r343753, MFCed to stable/12 in r343933). - In iflib_netmap_timer_adjust(), add synchronization of the TX descriptors before calling the ift_txd_credits_update method as the latter evaluates the TX descriptors possibly updated by the MAC. - In _task_fn_tx(), wrap the netmap(4)-specific bits in #ifdef DEV_NETMAP just as done in _task_fn_admin() and _task_fn_rx() respectively. o In iflib_fast_intr_rxtx(), synchronize the TX rather than the RX descriptors before calling the ift_txd_credits_update method (see also above). o There's no need to synchronize an RX buffer that is going to be recycled in iflib_rxd_pkt_get(), yet; it's sufficient to do that as late as passing RX buffers to the MAC via the ift_rxd_refill method. Hence, combine that synchronization with the synchronization of new buffers into a common spot in _iflib_fl_refill(). o There's no need to synchronize the RX descriptors of a free list in preparation of the MAC updating their statuses with every invocation of rxd_frag_to_sd(); it's enough to do this once before handing control over to the MAC, i. e. before calling ift_rxd_flush method in _iflib_fl_refill(), which already performs the necessary synchronization. o Given that the ift_rxd_available method evaluates the RX descriptors which possibly have been altered by the MAC, synchronize as appropriate beforehand. Most notably this is now done in iflib_rxd_avail(), which in turn means that we don't need to issue the same synchronization yet again before calling the ift_rxd_pkt_get method in iflib_rxeof(). o In iflib_txd_db_check(), synchronize the TX descriptors before handing them over to the MAC for transmission via the ift_txd_flush method. o In iflib_encap(), move the TX buffer synchronization after the invocation of the ift_txd_encap() method. If the MAC driver fails to encapsulate the packet and we retry with a defragmented mbuf chain or finally fail, the cycles for TX buffer synchronization have been wasted. Synchronizing afterwards matches what non-iflib(4) drivers typically do and is sufficient as the MAC will not actually start with the transmission before - in this case - the ift_txd_flush method is called. Moreover, for the latter reason the synchronization of the TX descriptors in iflib_encap() can go as it's enough to synchronize them before passing control over to the MAC by issuing the ift_txd_flush() method (see above). o In iflib_txq_can_drain(), only synchronize TX descriptors if the ift_txd_credits_update method accessing these is actually called. Differential Revision: https://reviews.freebsd.org/D19081 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Sun Jun 16 10:46:02 2019 (r349102) +++ stable/12/sys/net/iflib.c Sun Jun 16 11:34:56 2019 (r349103) @@ -861,11 +861,13 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring return netmap_ring_reinit(kring); fl->ifl_vm_addrs[tmp_pidx] = addr; - if (__predict_false(init) && map) { - netmap_load_map(na, fl->ifl_ifdi->idi_tag, map[nic_i], addr); - } else if (map && (slot->flags & NS_BUF_CHANGED)) { + if (__predict_false(init)) { + netmap_load_map(na, fl->ifl_buf_tag, + map[nic_i], addr); + } else if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(na, fl->ifl_ifdi->idi_tag, map[nic_i], addr); + netmap_reload_map(na, fl->ifl_buf_tag, + map[nic_i], addr); } slot->flags &= ~NS_BUF_CHANGED; @@ -877,13 +879,9 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring iru.iru_pidx = refill_pidx; iru.iru_count = tmp_pidx+1; ctx->isc_rxd_refill(ctx->ifc_softc, &iru); - refill_pidx = nic_i; - if (map == NULL) - continue; - for (int n = 0; n < iru.iru_count; n++) { - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, map[nic_i_dma], + bus_dmamap_sync(fl->ifl_buf_tag, map[nic_i_dma], BUS_DMASYNC_PREREAD); /* XXX - change this to not use the netmap func*/ nic_i_dma = nm_next(nic_i_dma, lim); @@ -892,9 +890,8 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring } kring->nr_hwcur = head; - if (map) - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if (__predict_true(nic_i != UINT_MAX)) { ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id, nic_i); DBG_COUNTER_INC(rxd_flush); @@ -938,7 +935,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl if_ctx_t ctx = ifp->if_softc; iflib_txq_t txq = &ctx->ifc_txqs[kring->ring_id]; - bus_dmamap_sync(txq->ift_buf_tag, txq->ift_ifdi->idi_map, + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* @@ -972,8 +969,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl __builtin_prefetch(&ring->slot[nm_i]); __builtin_prefetch(&txq->ift_sds.ifsd_m[nic_i]); - if (txq->ift_sds.ifsd_map) - __builtin_prefetch(&txq->ift_sds.ifsd_map[nic_i]); + __builtin_prefetch(&txq->ift_sds.ifsd_map[nic_i]); for (n = 0; nm_i != head; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; @@ -1000,20 +996,20 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl /* prefetch for next round */ __builtin_prefetch(&ring->slot[nm_i + 1]); __builtin_prefetch(&txq->ift_sds.ifsd_m[nic_i + 1]); - if (txq->ift_sds.ifsd_map) { - __builtin_prefetch(&txq->ift_sds.ifsd_map[nic_i + 1]); + __builtin_prefetch(&txq->ift_sds.ifsd_map[nic_i + 1]); - NM_CHECK_ADDR_LEN(na, addr, len); + NM_CHECK_ADDR_LEN(na, addr, len); - if (slot->flags & NS_BUF_CHANGED) { - /* buffer has changed, reload map */ - netmap_reload_map(na, txq->ift_buf_tag, - txq->ift_sds.ifsd_map[nic_i], addr); - } - /* make sure changes to the buffer are synced */ - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_sds.ifsd_map[nic_i], - BUS_DMASYNC_PREWRITE); + if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ + netmap_reload_map(na, txq->ift_buf_tag, + txq->ift_sds.ifsd_map[nic_i], addr); } + /* make sure changes to the buffer are synced */ + bus_dmamap_sync(txq->ift_buf_tag, + txq->ift_sds.ifsd_map[nic_i], + BUS_DMASYNC_PREWRITE); + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); @@ -1021,7 +1017,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl kring->nr_hwcur = nm_i; /* synchronize the NIC ring */ - bus_dmamap_sync(txq->ift_buf_tag, txq->ift_ifdi->idi_map, + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* (re)start the tx unit up to slot nic_i (excluded) */ @@ -1069,6 +1065,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl { struct netmap_adapter *na = kring->na; struct netmap_ring *ring = kring->ring; + iflib_fl_t fl; uint32_t nm_i; /* index into the netmap ring */ uint32_t nic_i; /* index into the NIC ring */ u_int i, n; @@ -1080,18 +1077,18 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl struct ifnet *ifp = na->ifp; if_ctx_t ctx = ifp->if_softc; iflib_rxq_t rxq = &ctx->ifc_rxqs[kring->ring_id]; - iflib_fl_t fl = rxq->ifr_fl; if (head > lim) return netmap_ring_reinit(kring); - /* XXX check sync modes */ + /* + * XXX netmap_fl_refill() only ever (re)fills free list 0 so far. + */ + for (i = 0, fl = rxq->ifr_fl; i < rxq->ifr_nfl; i++, fl++) { - if (fl->ifl_sds.ifsd_map == NULL) - continue; - bus_dmamap_sync(rxq->ifr_fl[i].ifl_buf_tag, - fl->ifl_ifdi->idi_map, + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); } + /* * First part: import newly received packets. * @@ -1115,7 +1112,8 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl fl = &rxq->ifr_fl[i]; nic_i = fl->ifl_cidx; nm_i = netmap_idx_n2k(kring, nic_i); - avail = iflib_rxd_avail(ctx, rxq, nic_i, USHRT_MAX); + avail = ctx->isc_rxd_available(ctx->ifc_softc, + rxq->ifr_id, nic_i, USHRT_MAX); for (n = 0; avail > 0; n++, avail--) { rxd_info_zero(&ri); ri.iri_frags = rxq->ifr_frags; @@ -1126,7 +1124,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; ring->slot[nm_i].flags = 0; - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, + bus_dmamap_sync(fl->ifl_buf_tag, fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); @@ -1237,13 +1235,17 @@ iflib_netmap_rxq_init(if_ctx_t ctx, iflib_rxq_t rxq) } static void -iflib_netmap_timer_adjust(if_ctx_t ctx, uint16_t txqid, uint32_t *reset_on) +iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t txq, uint32_t *reset_on) { struct netmap_kring *kring; + uint16_t txqid; + txqid = txq->ift_id; kring = NA(ctx->ifc_ifp)->tx_rings[txqid]; if (kring->nr_hwcur != nm_next(kring->nr_hwtail, kring->nkr_num_slots - 1)) { + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_POSTREAD); if (ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) netmap_tx_irq(ctx->ifc_ifp, txqid); if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { @@ -1265,7 +1267,7 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, uint16_t txqid #define iflib_netmap_attach(ctx) (0) #define netmap_rx_irq(ifp, qid, budget) (0) #define netmap_tx_irq(ifp, qid) do {} while (0) -#define iflib_netmap_timer_adjust(ctx, txqid, reset_on) +#define iflib_netmap_timer_adjust(ctx, txq, reset_on) #endif @@ -1503,9 +1505,12 @@ iflib_fast_intr_rxtx(void *arg) { iflib_filter_info_t info = arg; struct grouptask *gtask = info->ifi_task; + if_ctx_t ctx; iflib_rxq_t rxq = (iflib_rxq_t)info->ifi_ctx; - if_ctx_t ctx = NULL;; + iflib_txq_t txq; + void *sc; int i, cidx, result; + qidx_t txqid; if (!iflib_started) return (FILTER_STRAY); @@ -1517,19 +1522,19 @@ iflib_fast_intr_rxtx(void *arg) return (result); } + ctx = rxq->ifr_ctx; + sc = ctx->ifc_softc; MPASS(rxq->ifr_ntxqirq); for (i = 0; i < rxq->ifr_ntxqirq; i++) { - qidx_t txqid = rxq->ifr_txqid[i]; - - ctx = rxq->ifr_ctx; - - bus_dmamap_sync(rxq->ifr_ifdi->idi_tag, rxq->ifr_ifdi->idi_map, + txqid = rxq->ifr_txqid[i]; + txq = &ctx->ifc_txqs[txqid]; + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); - if (!ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) { + if (!ctx->isc_txd_credits_update(sc, txqid, false)) { IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); continue; } - GROUPTASK_ENQUEUE(&ctx->ifc_txqs[txqid].ift_task); + GROUPTASK_ENQUEUE(&txq->ift_task); } if (ctx->ifc_sctx->isc_flags & IFLIB_HAS_RXCQ) cidx = rxq->ifr_cq_cidx; @@ -1832,7 +1837,7 @@ iflib_txq_setup(iflib_txq_t txq) IFDI_TXQ_SETUP(ctx, txq->ift_id); for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -2036,8 +2041,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun break; } - bus_dmamap_sync(fl->ifl_buf_tag, sd_map[frag_idx], - BUS_DMASYNC_PREREAD); sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; sd_cl[frag_idx] = cl; #if MEMORY_LOGGING @@ -2046,6 +2049,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } else { bus_addr = sd_ba[frag_idx]; } + bus_dmamap_sync(fl->ifl_buf_tag, sd_map[frag_idx], + BUS_DMASYNC_PREREAD); MPASS(sd_m[frag_idx] == NULL); if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { @@ -2296,7 +2301,7 @@ iflib_timer(void *arg) } #ifdef DEV_NETMAP if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) - iflib_netmap_timer_adjust(ctx, txq->ift_id, &reset_on); + iflib_netmap_timer_adjust(ctx, txq, &reset_on); #endif /* handle any laggards */ if (txq->ift_db_pending) @@ -2534,7 +2539,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int int flid, cidx; bus_dmamap_t map; iflib_fl_t fl; - iflib_dma_info_t di; int next; map = NULL; @@ -2554,7 +2558,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); prefetch(&fl->ifl_sds.ifsd_map[next]); map = fl->ifl_sds.ifsd_map[cidx]; - di = fl->ifl_ifdi; next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); /* not valid assert if bxe really does SGE from non-contiguous elements */ @@ -2565,8 +2568,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); if (__predict_false(fl->ifl_cidx == 0)) fl->ifl_gen = 0; - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bit_clear(fl->ifl_rx_bitmap, cidx); } @@ -2644,9 +2645,6 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) m->m_data += 2; #endif memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); - bus_dmamap_sync(rxq->ifr_fl->ifl_buf_tag, - rxq->ifr_fl->ifl_sds.ifsd_map[ri->iri_frags[0].irf_idx], - BUS_DMASYNC_PREREAD); m->m_len = ri->iri_frags[0].irf_len; } else { m = assemble_segments(rxq, ri, &sd); @@ -2715,7 +2713,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if_ctx_t ctx = rxq->ifr_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - iflib_dma_info_t di; int avail, i; qidx_t *cidxp; struct if_rxd_info ri; @@ -2760,9 +2757,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) ri.iri_cidx = *cidxp; ri.iri_ifp = ifp; ri.iri_frags = rxq->ifr_frags; - di = rxq->ifr_fl[rxq->ifr_frags[0].irf_flid].ifl_ifdi; - bus_dmamap_sync(di->idi_tag, di->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); err = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); if (err) @@ -2931,6 +2925,8 @@ iflib_txd_db_check(if_ctx_t ctx, iflib_txq_t txq, int max = TXQ_MAX_DB_DEFERRED(txq, in_use); if (ring || txq->ift_db_pending >= max) { dbval = txq->ift_npending ? txq->ift_npending : txq->ift_pidx; + bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_txd_flush(ctx->ifc_softc, txq->ift_id, dbval); txq->ift_db_pending = txq->ift_npending = 0; rang = true; @@ -3378,10 +3374,8 @@ defrag: #ifdef PKT_DEBUG print_pkt(&pi); #endif - bus_dmamap_sync(buf_tag, map, BUS_DMASYNC_PREWRITE); if ((err = ctx->isc_txd_encap(ctx->ifc_softc, &pi)) == 0) { - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(buf_tag, map, BUS_DMASYNC_PREWRITE); DBG_COUNTER_INC(tx_encap); MPASS(pi.ipi_new_pidx < txq->ift_size); @@ -3550,10 +3544,12 @@ iflib_txq_can_drain(struct ifmp_ring *r) iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; + if (TXQ_AVAIL(txq) > MAX_TX_DESC(ctx) + 2) + return (1); bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); - return ((TXQ_AVAIL(txq) > MAX_TX_DESC(ctx) + 2) || - ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)); + return (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, + false)); } static uint32_t @@ -3707,7 +3703,9 @@ _task_fn_tx(void *context) { iflib_txq_t txq = context; if_ctx_t ctx = txq->ift_ctx; - struct ifnet *ifp = ctx->ifc_ifp; +#if defined(ALTQ) || defined(DEV_NETMAP) + if_t ifp = ctx->ifc_ifp; +#endif int abdicate = ctx->ifc_sysctl_tx_abdicate; #ifdef IFLIB_DIAGNOSTICS @@ -3715,6 +3713,7 @@ _task_fn_tx(void *context) #endif if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; +#ifdef DEV_NETMAP if (if_getcapenable(ifp) & IFCAP_NETMAP) { bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); @@ -3723,6 +3722,7 @@ _task_fn_tx(void *context) IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; } +#endif #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) iflib_altq_if_start(ifp); @@ -3830,7 +3830,7 @@ _task_fn_admin(void *context) #ifdef DEV_NETMAP reset_on = hz / 2; if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) - iflib_netmap_timer_adjust(ctx, txq->ift_id, &reset_on); + iflib_netmap_timer_adjust(ctx, txq, &reset_on); #endif callout_reset_on(&txq->ift_timer, reset_on, iflib_timer, txq, txq->ift_timer.c_cpu); } @@ -6072,7 +6072,12 @@ iflib_tx_credits_update(if_ctx_t ctx, iflib_txq_t txq) static int iflib_rxd_avail(if_ctx_t ctx, iflib_rxq_t rxq, qidx_t cidx, qidx_t budget) { + iflib_fl_t fl; + u_int i; + for (i = 0, fl = &rxq->ifr_fl[0]; i < rxq->ifr_nfl; i++, fl++) + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); return (ctx->isc_rxd_available(ctx->ifc_softc, rxq->ifr_id, cidx, budget)); } From owner-svn-src-all@freebsd.org Sun Jun 16 11:53:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 12:26:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 12:44:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 13:35:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 13:51:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 14:53:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E33E615C133B; Sun, 16 Jun 2019 14:53:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 814F884094; Sun, 16 Jun 2019 14:53:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39FE3180AC; Sun, 16 Jun 2019 14:53:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GErsRv022913; Sun, 16 Jun 2019 14:53:54 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GErrjx022910; Sun, 16 Jun 2019 14:53:53 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161453.x5GErrjx022910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 14:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349109 - in stable/12/sys: kern net sys X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/12/sys: kern net sys X-SVN-Commit-Revision: 349109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 814F884094 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.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 14:53:55 -0000 Author: marius Date: Sun Jun 16 14:53:53 2019 New Revision: 349109 URL: https://svnweb.freebsd.org/changeset/base/349109 Log: MFC: r344062 (partial) - For diff reduction, bring in as much of the taskqgroup_attach{,_cpu}(9) fix from r344062 as possible without breaking KBI, which in turn means that these functions still don't properly work across architectures in stable/12 (in theory, compat shims should be possible but result in a PITA to maintain). However, e. g. the static iflib_irq_set_affinity() now also takes the irq as an if_irq_t instead of an int. - Move the gtaskqueue_enqueue_fn typedef from to the gtaskqueue implementation as it's only used and needed there. - Change the GTASK_INIT macro to use "gtask" rather than "task" as argument given that it actually operates on a struct gtask rather than a struct task. - Let subr_gtaskqueue.c consistently use __func__ to print functions names. Modified: stable/12/sys/kern/subr_gtaskqueue.c stable/12/sys/net/iflib.c stable/12/sys/sys/_task.h stable/12/sys/sys/gtaskqueue.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_gtaskqueue.c ============================================================================== --- stable/12/sys/kern/subr_gtaskqueue.c Sun Jun 16 13:51:45 2019 (r349108) +++ stable/12/sys/kern/subr_gtaskqueue.c Sun Jun 16 14:53:53 2019 (r349109) @@ -64,6 +64,8 @@ struct gtaskqueue_busy { static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; +typedef void (*gtaskqueue_enqueue_fn)(void *context); + struct gtaskqueue { STAILQ_HEAD(, gtask) tq_queue; gtaskqueue_enqueue_fn tq_enqueue; @@ -681,7 +683,7 @@ taskqgroup_find(struct taskqgroup *qgroup, void *uniq) } } if (idx == -1) - panic("taskqgroup_find: Failed to pick a qid."); + panic("%s: failed to pick a qid.", __func__); return (idx); } @@ -734,7 +736,8 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct gr mtx_unlock(&qgroup->tqg_lock); error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); if (error) - printf("%s: setaffinity failed for %s: %d\n", __func__, gtask->gt_name, error); + printf("%s: binding interrupt failed for %s: %d\n", + __func__, gtask->gt_name, error); } else mtx_unlock(&qgroup->tqg_lock); } @@ -756,13 +759,12 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, error = intr_setaffinity(gtask->gt_irq, CPU_WHICH_IRQ, &mask); mtx_lock(&qgroup->tqg_lock); if (error) - printf("%s: %s setaffinity failed: %d\n", __func__, gtask->gt_name, error); + printf("%s: binding interrupt failed for %s: %d\n", + __func__, gtask->gt_name, error); } qgroup->tqg_queue[qid].tgc_cnt++; - - LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, - gt_list); + LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; mtx_unlock(&qgroup->tqg_lock); @@ -770,7 +772,7 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask, - void *uniq, int cpu, int irq, const char *name) + void *uniq, int cpu, int irq, const char *name) { cpuset_t mask; int i, qid, error; @@ -805,7 +807,8 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc if (irq != -1 && tqg_smp_started) { error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); if (error) - printf("%s: setaffinity failed: %d\n", __func__, error); + printf("%s: binding interrupt failed for %s: %d\n", + __func__, gtask->gt_name, error); } return (0); } @@ -843,7 +846,8 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro if (irq != -1) { error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); if (error) - printf("%s: setaffinity failed: %d\n", __func__, error); + printf("%s: binding interrupt failed for %s: %d\n", + __func__, gtask->gt_name, error); } return (0); } @@ -859,7 +863,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) break; if (i == qgroup->tqg_cnt) - panic("taskqgroup_detach: task %s not in group\n", gtask->gt_name); + panic("%s: task %s not in group", __func__, gtask->gt_name); qgroup->tqg_queue[i].tgc_cnt--; LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); @@ -882,8 +886,7 @@ taskqgroup_binder(void *ctx) thread_unlock(curthread); if (error) - printf("%s: setaffinity failed: %d\n", __func__, - error); + printf("%s: binding curthread failed: %d\n", __func__, error); free(gtask, M_DEVBUF); } @@ -1051,7 +1054,7 @@ taskqgroup_destroy(struct taskqgroup *qgroup) void taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, - const char *name) + const char *name) { GROUPTASK_INIT(gtask, 0, fn, ctx); @@ -1061,5 +1064,6 @@ taskqgroup_config_gtask_init(void *ctx, struct groupta void taskqgroup_config_gtask_deinit(struct grouptask *gtask) { + taskqgroup_detach(qgroup_config, gtask); } Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Sun Jun 16 13:51:45 2019 (r349108) +++ stable/12/sys/net/iflib.c Sun Jun 16 14:53:53 2019 (r349109) @@ -4593,7 +4593,8 @@ iflib_device_register(device_t dev, void *sc, if_share GROUPTASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); /* XXX format name */ - taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, -1, "admin"); + taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, + -1, "admin"); /* Set up cpu set. If it fails, use the set of all CPUs. */ if (bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus) != 0) { @@ -4858,7 +4859,8 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc GROUPTASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); /* XXX format name */ - taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, -1, "admin"); + taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, + -1, "admin"); /* XXX --- can support > 1 -- but keep it simple for now */ scctx->isc_intr = IFLIB_INTR_LEGACY; @@ -5754,11 +5756,14 @@ get_core_offset(if_ctx_t ctx, iflib_intr_type_t type, /* Just to avoid copy/paste */ static inline int -iflib_irq_set_affinity(if_ctx_t ctx, int irq, iflib_intr_type_t type, int qid, - struct grouptask *gtask, struct taskqgroup *tqg, void *uniq, const char *name) +iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, + int qid, struct grouptask *gtask, struct taskqgroup *tqg, void *uniq, + const char *name) { + device_t dev; int co, cpuid, err, tid; + dev = ctx->ifc_dev; co = ctx->ifc_sysctl_core_offset; if (ctx->ifc_sysctl_separate_txrx && type == IFLIB_INTR_TX) co += ctx->ifc_softc_ctx.isc_nrxqsets; @@ -5766,9 +5771,10 @@ iflib_irq_set_affinity(if_ctx_t ctx, int irq, iflib_in tid = get_core_offset(ctx, type, qid); MPASS(tid >= 0); cpuid = find_close_core(cpuid, tid); - err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, irq, name); + err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, + rman_get_start(irq->ii_res), name); if (err) { - device_printf(ctx->ifc_dev, "taskqgroup_attach_cpu failed %d\n", err); + device_printf(dev, "taskqgroup_attach_cpu failed %d\n", err); return (err); } #ifdef notyet @@ -5783,6 +5789,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in iflib_intr_type_t type, driver_filter_t *filter, void *filter_arg, int qid, const char *name) { + device_t dev; struct grouptask *gtask; struct taskqgroup *tqg; iflib_filter_info_t info; @@ -5842,20 +5849,23 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in info->ifi_task = gtask; info->ifi_ctx = q; + dev = ctx->ifc_dev; err = _iflib_irq_alloc(ctx, irq, rid, intr_fast, NULL, info, name); if (err != 0) { - device_printf(ctx->ifc_dev, "_iflib_irq_alloc failed %d\n", err); + device_printf(dev, "_iflib_irq_alloc failed %d\n", err); return (err); } if (type == IFLIB_INTR_ADMIN) return (0); if (tqrid != -1) { - err = iflib_irq_set_affinity(ctx, rman_get_start(irq->ii_res), type, qid, gtask, tqg, q, name); + err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, + q, name); if (err) return (err); } else { - taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); + taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), + name); } return (0); @@ -5868,7 +5878,6 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq struct taskqgroup *tqg; gtask_fn_t *fn; void *q; - int irq_num = -1; int err; switch (type) { @@ -5877,16 +5886,12 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq gtask = &ctx->ifc_txqs[qid].ift_task; tqg = qgroup_if_io_tqg; fn = _task_fn_tx; - if (irq != NULL) - irq_num = rman_get_start(irq->ii_res); break; case IFLIB_INTR_RX: q = &ctx->ifc_rxqs[qid]; gtask = &ctx->ifc_rxqs[qid].ifr_task; tqg = qgroup_if_io_tqg; fn = _task_fn_rx; - if (irq != NULL) - irq_num = rman_get_start(irq->ii_res); break; case IFLIB_INTR_IOV: q = ctx; @@ -5898,14 +5903,15 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq panic("unknown net intr type"); } GROUPTASK_INIT(gtask, 0, fn, q); - if (irq_num != -1) { - err = iflib_irq_set_affinity(ctx, irq_num, type, qid, gtask, tqg, q, name); + if (irq != NULL) { + err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, + q, name); if (err) - taskqgroup_attach(tqg, gtask, q, irq_num, name); + taskqgroup_attach(tqg, gtask, q, + rman_get_start(irq->ii_res), name); + } else { + taskqgroup_attach(tqg, gtask, q, -1, name); } - else { - taskqgroup_attach(tqg, gtask, q, irq_num, name); - } } void @@ -5954,7 +5960,8 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq); - taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, rman_get_start(irq->ii_res), "tx"); + taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, + rman_get_start(irq->ii_res), "tx"); return (0); } Modified: stable/12/sys/sys/_task.h ============================================================================== --- stable/12/sys/sys/_task.h Sun Jun 16 13:51:45 2019 (r349108) +++ stable/12/sys/sys/_task.h Sun Jun 16 14:53:53 2019 (r349109) @@ -39,8 +39,8 @@ * field of struct task and the second argument is a count of how many * times the task was enqueued before the call to taskqueue_run(). * - * List of locks - * (c) const after init + * List of locks + * (c) const after init * (q) taskqueue lock */ typedef void task_fn_t(void *context, int pending); Modified: stable/12/sys/sys/gtaskqueue.h ============================================================================== --- stable/12/sys/sys/gtaskqueue.h Sun Jun 16 13:51:45 2019 (r349108) +++ stable/12/sys/sys/gtaskqueue.h Sun Jun 16 14:53:53 2019 (r349109) @@ -38,7 +38,6 @@ #endif struct gtaskqueue; -typedef void (*gtaskqueue_enqueue_fn)(void *context); /* * Taskqueue groups. Manages dynamic thread groups and irq binding for @@ -55,28 +54,29 @@ void gtaskqueue_drain_all(struct gtaskqueue *queue); void grouptask_block(struct grouptask *grouptask); void grouptask_unblock(struct grouptask *grouptask); int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task); + void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask, void *uniq, int irq, const char *name); -int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask, - void *uniq, int cpu, int irq, const char *name); +int taskqgroup_attach_cpu(struct taskqgroup *qgroup, + struct grouptask *grptask, void *uniq, int cpu, int irq, + const char *name); void taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask); struct taskqgroup *taskqgroup_create(const char *name); void taskqgroup_destroy(struct taskqgroup *qgroup); int taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride); -void taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, - const char *name); +void taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, + gtask_fn_t *fn, const char *name); void taskqgroup_config_gtask_deinit(struct grouptask *gtask); #define TASK_ENQUEUED 0x1 #define TASK_SKIP_WAKEUP 0x2 #define TASK_NOENQUEUE 0x4 - -#define GTASK_INIT(task, flags, priority, func, context) do { \ - (task)->ta_flags = flags; \ - (task)->ta_priority = (priority); \ - (task)->ta_func = (func); \ - (task)->ta_context = (context); \ +#define GTASK_INIT(gtask, flags, priority, func, context) do { \ + (gtask)->ta_flags = flags; \ + (gtask)->ta_priority = (priority); \ + (gtask)->ta_func = (func); \ + (gtask)->ta_context = (context); \ } while (0) #define GROUPTASK_INIT(gtask, priority, func, context) \ From owner-svn-src-all@freebsd.org Sun Jun 16 15:11:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930E215C18FE; Sun, 16 Jun 2019 15:11:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42AA1849D2; Sun, 16 Jun 2019 15:11:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE21182C8; Sun, 16 Jun 2019 15:11:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GFBrvx031334; Sun, 16 Jun 2019 15:11:53 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFBqGo031331; Sun, 16 Jun 2019 15:11:52 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161511.x5GFBqGo031331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 15:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349110 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 349110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42AA1849D2 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:11:54 -0000 Author: marius Date: Sun Jun 16 15:11:52 2019 New Revision: 349110 URL: https://svnweb.freebsd.org/changeset/base/349110 Log: MFC: r347211 - Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx. - Remove the only ever written to ift_db_mtx_name member of struct iflib_txq. - Remove the unused or only ever written to ifr_size, ifr_cq_pidx, ifr_cq_gen and ifr_lro_enabled members of struct iflib_rxq. - Consistently spell DMA, RX and TX uppercase in comments, messages etc. instead of mixing with some lowercase variants. - Consistently use if_t instead of a mix of if_t and struct ifnet pointers. - Bring the function comments of _iflib_fl_refill(), iflib_rx_sds_free() and iflib_fl_setup() in line with reality. - Judging problem reports, people are wondering what on earth messages like: "TX(0) desc avail = 1024, pidx = 0" are trying to indicate. Thus, extend this string to be more like that of non-iflib(4) Ethernet MAC drivers, notifying about a watchdog timeout due to which the interface will be reset. - Take advantage of the M_HAS_VLANTAG macro. - Use false/true rather than FALSE/TRUE for variables of type bool. - Use FALLTHROUGH as advocated by style(9). Modified: stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h stable/12/sys/net/iflib_clone.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Sun Jun 16 14:53:53 2019 (r349109) +++ stable/12/sys/net/iflib.c Sun Jun 16 15:11:52 2019 (r349110) @@ -174,7 +174,6 @@ struct iflib_ctx { uint32_t ifc_rx_mbuf_sz; int ifc_link_state; - int ifc_link_irq; int ifc_watchdog_events; struct cdev *ifc_led_dev; struct resource *ifc_msix_mem; @@ -211,10 +210,8 @@ struct iflib_ctx { eventhandler_tag ifc_vlan_attach_event; eventhandler_tag ifc_vlan_detach_event; uint8_t ifc_mac[ETHER_ADDR_LEN]; - char ifc_mtx_name[16]; }; - void * iflib_get_softc(if_ctx_t ctx) { @@ -290,7 +287,6 @@ typedef struct iflib_sw_tx_desc_array { struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; - /* magic number that should be high enough for any hardware */ #define IFLIB_MAX_TX_SEGS 128 #define IFLIB_RX_COPY_THRESH 128 @@ -309,10 +305,10 @@ typedef struct iflib_sw_tx_desc_array { #define IFLIB_RESTART_BUDGET 8 - #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) + struct iflib_txq { qidx_t ift_in_use; qidx_t ift_cidx; @@ -362,7 +358,6 @@ struct iflib_txq { iflib_dma_info_t ift_ifdi; #define MTX_NAME_LEN 16 char ift_mtx_name[MTX_NAME_LEN]; - char ift_db_mtx_name[MTX_NAME_LEN]; bus_dma_segment_t ift_segs[IFLIB_MAX_TX_SEGS] __aligned(CACHE_LINE_SIZE); #ifdef IFLIB_DIAGNOSTICS uint64_t ift_cpu_exec_count[256]; @@ -425,24 +420,19 @@ get_inuse(int size, qidx_t cidx, qidx_t pidx, uint8_t ((head) >= (tail) ? (head) - (tail) : (wrap) - (tail) + (head)) struct iflib_rxq { - /* If there is a separate completion queue - - * these are the cq cidx and pidx. Otherwise - * these are unused. - */ - qidx_t ifr_size; - qidx_t ifr_cq_cidx; - qidx_t ifr_cq_pidx; - uint8_t ifr_cq_gen; - uint8_t ifr_fl_offset; - if_ctx_t ifr_ctx; iflib_fl_t ifr_fl; uint64_t ifr_rx_irq; + /* + * If there is a separate completion queue (IFLIB_HAS_RXCQ), this is + * the command queue consumer index. Otherwise it's unused. + */ + qidx_t ifr_cq_cidx; uint16_t ifr_id; - uint8_t ifr_lro_enabled; uint8_t ifr_nfl; uint8_t ifr_ntxqirq; uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; + uint8_t ifr_fl_offset; struct lro_ctrl ifr_lc; struct grouptask ifr_task; struct iflib_filter_info ifr_filter_info; @@ -541,14 +531,11 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_UNLOCK(ctx) sx_xunlock(&(ctx)->ifc_ctx_sx) #define CTX_LOCK_DESTROY(ctx) sx_destroy(&(ctx)->ifc_ctx_sx) - #define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) #define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) #define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) #define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) - - #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -611,15 +598,15 @@ static int iflib_fl_refills_large; static int iflib_tx_frees; SYSCTL_INT(_net_iflib, OID_AUTO, tx_seen, CTLFLAG_RD, - &iflib_tx_seen, 0, "# tx mbufs seen"); + &iflib_tx_seen, 0, "# TX mbufs seen"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_sent, CTLFLAG_RD, - &iflib_tx_sent, 0, "# tx mbufs sent"); + &iflib_tx_sent, 0, "# TX mbufs sent"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_encap, CTLFLAG_RD, - &iflib_tx_encap, 0, "# tx mbufs encapped"); + &iflib_tx_encap, 0, "# TX mbufs encapped"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_frees, CTLFLAG_RD, - &iflib_tx_frees, 0, "# tx frees"); + &iflib_tx_frees, 0, "# TX frees"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_allocs, CTLFLAG_RD, - &iflib_rx_allocs, 0, "# rx allocations"); + &iflib_rx_allocs, 0, "# RX allocations"); SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills, CTLFLAG_RD, &iflib_fl_refills, 0, "# refills"); SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills_large, CTLFLAG_RD, @@ -666,7 +653,7 @@ static int iflib_verbose_debug; SYSCTL_INT(_net_iflib, OID_AUTO, task_fn_rx, CTLFLAG_RD, &iflib_task_fn_rxs, 0, "# task_fn_rx calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_intr_enables, CTLFLAG_RD, - &iflib_rx_intr_enables, 0, "# rx intr enables"); + &iflib_rx_intr_enables, 0, "# RX intr enables"); SYSCTL_INT(_net_iflib, OID_AUTO, fast_intrs, CTLFLAG_RD, &iflib_fast_intrs, 0, "# fast_intr calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_unavail, CTLFLAG_RD, @@ -772,13 +759,13 @@ SYSCTL_DECL(_dev_netmap); int iflib_crcstrip = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_crcstrip, - CTLFLAG_RW, &iflib_crcstrip, 1, "strip CRC on rx frames"); + CTLFLAG_RW, &iflib_crcstrip, 1, "strip CRC on RX frames"); int iflib_rx_miss, iflib_rx_miss_bufs; SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss, - CTLFLAG_RW, &iflib_rx_miss, 0, "potentially missed rx intr"); + CTLFLAG_RW, &iflib_rx_miss, 0, "potentially missed RX intr"); SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss_bufs, - CTLFLAG_RW, &iflib_rx_miss_bufs, 0, "potentially missed rx intr bufs"); + CTLFLAG_RW, &iflib_rx_miss_bufs, 0, "potentially missed RX intr bufs"); /* * Register/unregister. We are already under netmap lock. @@ -787,7 +774,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss_bufs, static int iflib_netmap_register(struct netmap_adapter *na, int onoff) { - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; if_ctx_t ctx = ifp->if_softc; int status; @@ -917,7 +904,7 @@ static int iflib_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap kring */ u_int nic_i; /* index into the NIC ring */ @@ -1065,6 +1052,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl { struct netmap_adapter *na = kring->na; struct netmap_ring *ring = kring->ring; + if_t ifp = na->ifp; iflib_fl_t fl; uint32_t nm_i; /* index into the netmap ring */ uint32_t nic_i; /* index into the NIC ring */ @@ -1074,7 +1062,6 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; struct if_rxd_info ri; - struct ifnet *ifp = na->ifp; if_ctx_t ctx = ifp->if_softc; iflib_rxq_t rxq = &ctx->ifc_rxqs[kring->ring_id]; if (head > lim) @@ -1158,8 +1145,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl static void iflib_netmap_intr(struct netmap_adapter *na, int onoff) { - struct ifnet *ifp = na->ifp; - if_ctx_t ctx = ifp->if_softc; + if_ctx_t ctx = na->ifp->if_softc; CTX_LOCK(ctx); if (onoff) { @@ -1965,13 +1951,13 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int } /** - * rxq_refill - refill an rxq free-buffer list - * @ctx: the iflib context - * @rxq: the free-list to refill - * @n: the number of new buffers to allocate + * _iflib_fl_refill - refill an rxq free-buffer list + * @ctx: the iflib context + * @fl: the free list to refill + * @count: the number of new buffers to allocate * - * (Re)populate an rxq free-buffer list with up to @n new packet buffers. - * The caller must assure that @n does not exceed the queue's capacity. + * (Re)populate an rxq free-buffer list with up to @count new packet buffers. + * The caller must assure that @count does not exceed the queue's capacity. */ static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) @@ -2123,6 +2109,7 @@ uint8_t iflib_in_detach(if_ctx_t ctx) { bool in_detach; + STATE_LOCK(ctx); in_detach = !!(ctx->ifc_flags & IFC_IN_DETACH); STATE_UNLOCK(ctx); @@ -2180,7 +2167,7 @@ iflib_fl_bufs_free(iflib_fl_t fl) /********************************************************************* * - * Initialize a receive ring and its buffers. + * Initialize a free list and its buffers. * **********************************************************************/ static int @@ -2263,13 +2250,12 @@ iflib_rx_sds_free(iflib_rxq_t rxq) } free(rxq->ifr_fl, M_IFLIB); rxq->ifr_fl = NULL; - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; } } /* - * MI independent logic - * + * Timer routine */ static void iflib_timer(void *arg) @@ -2282,6 +2268,7 @@ iflib_timer(void *arg) if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; + /* ** Check on the state of the TX queue(s), this ** can be done without the lock because its RO @@ -2311,9 +2298,11 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, reset_on, iflib_timer, txq, txq->ift_timer.c_cpu); return; + hung: - device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", - txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); + device_printf(ctx->ifc_dev, + "Watchdog timeout (TX: %d desc avail: %d pidx: %d) -- resetting\n", + txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); STATE_LOCK(ctx); if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); @@ -2339,6 +2328,7 @@ iflib_calc_rx_mbuf_sz(if_ctx_t ctx) uint32_t iflib_get_rx_mbuf_sz(if_ctx_t ctx) { + return (ctx->ifc_rx_mbuf_sz); } @@ -2353,7 +2343,6 @@ iflib_init_locked(if_ctx_t ctx) iflib_rxq_t rxq; int i, j, tx_ip_csum_flags, tx_ip6_csum_flags; - if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); IFDI_INTR_DISABLE(ctx); @@ -2482,7 +2471,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ @@ -2710,6 +2699,7 @@ iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, static bool iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) { + if_t ifp; if_ctx_t ctx = rxq->ifr_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; @@ -2718,7 +2708,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) struct if_rxd_info ri; int err, budget_left, rx_bytes, rx_pkts; iflib_fl_t fl; - struct ifnet *ifp; int lro_enabled; bool v4_forwarding, v6_forwarding, lro_possible; @@ -2765,10 +2754,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) *cidxp = ri.iri_cidx; /* Update our consumer index */ /* XXX NB: shurd - check if this is still safe */ - while (rxq->ifr_cq_cidx >= scctx->isc_nrxd[0]) { + while (rxq->ifr_cq_cidx >= scctx->isc_nrxd[0]) rxq->ifr_cq_cidx -= scctx->isc_nrxd[0]; - rxq->ifr_cq_gen = 0; - } /* was this only a completion queue message? */ if (__predict_false(ri.iri_nfrags == 0)) continue; @@ -3284,7 +3271,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) pi.ipi_qsidx = txq->ift_id; pi.ipi_len = m_head->m_pkthdr.len; pi.ipi_csum_flags = m_head->m_pkthdr.csum_flags; - pi.ipi_vtag = (m_head->m_flags & M_VLANTAG) ? m_head->m_pkthdr.ether_vtag : 0; + pi.ipi_vtag = M_HAS_VLANTAG(m_head) ? m_head->m_pkthdr.ether_vtag : 0; /* deliberate bitwise OR to make one condition */ if (__predict_true((pi.ipi_csum_flags | pi.ipi_vtag))) { @@ -3557,7 +3544,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui { iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; - struct ifnet *ifp = ctx->ifc_ifp; + if_t ifp = ctx->ifc_ifp; struct mbuf **mp, *m; int i, count, consumed, pkt_sent, bytes_sent, mcast_sent, avail; int reclaimed, err, in_use_prev, desc_used; @@ -4072,18 +4059,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; #endif - bool avoid_reset = FALSE; + bool avoid_reset = false; int err = 0, reinit = 0, bits; switch (command) { case SIOCSIFADDR: #ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) - avoid_reset = TRUE; + avoid_reset = true; #endif #ifdef INET6 if (ifa->ifa_addr->sa_family == AF_INET6) - avoid_reset = TRUE; + avoid_reset = true; #endif /* ** Calling init results in link renegotiation, @@ -4155,7 +4142,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) CTX_LOCK(ctx); IFDI_MEDIA_SET(ctx); CTX_UNLOCK(ctx); - /* falls thru */ + /* FALLTHROUGH */ case SIOCGIFMEDIA: case SIOCGIFXMEDIA: err = ifmedia_ioctl(ifp, ifr, &ctx->ifc_media, command); @@ -4540,12 +4527,13 @@ iflib_device_register(device_t dev, void *sc, if_share main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ - device_printf(dev, "# rx descriptors must be a power of 2\n"); + device_printf(dev, + "# RX descriptors must be a power of 2\n"); err = EINVAL; goto fail_iflib_detach; } @@ -4553,7 +4541,7 @@ iflib_device_register(device_t dev, void *sc, if_share for (i = 0; i < sctx->isc_ntxqs; i++) { if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, - "# tx descriptors must be a power of 2"); + "# TX descriptors must be a power of 2"); err = EINVAL; goto fail_iflib_detach; } @@ -4806,12 +4794,13 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ - device_printf(dev, "# rx descriptors must be a power of 2\n"); + device_printf(dev, + "# RX descriptors must be a power of 2\n"); err = EINVAL; goto fail_iflib_detach; } @@ -4819,7 +4808,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc for (i = 0; i < sctx->isc_ntxqs; i++) { if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, - "# tx descriptors must be a power of 2"); + "# TX descriptors must be a power of 2"); err = EINVAL; goto fail_iflib_detach; } @@ -5379,14 +5368,11 @@ iflib_queues_alloc(if_ctx_t ctx) } /* Initialize the TX lock */ - snprintf(txq->ift_mtx_name, MTX_NAME_LEN, "%s:tx(%d):callout", + snprintf(txq->ift_mtx_name, MTX_NAME_LEN, "%s:TX(%d):callout", device_get_nameunit(dev), txq->ift_id); mtx_init(&txq->ift_mtx, txq->ift_mtx_name, NULL, MTX_DEF); callout_init_mtx(&txq->ift_timer, &txq->ift_mtx, 0); - snprintf(txq->ift_db_mtx_name, MTX_NAME_LEN, "%s:tx(%d):db", - device_get_nameunit(dev), txq->ift_id); - err = ifmp_ring_alloc(&txq->ift_br, 2048, txq, iflib_txq_drain, iflib_txq_can_drain, M_IFLIB, M_WAITOK); if (err) { @@ -5566,7 +5552,6 @@ iflib_rx_structures_setup(if_ctx_t ctx) device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); goto fail; } - rxq->ifr_lro_enabled = TRUE; #endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); } @@ -5581,7 +5566,7 @@ fail: rxq = ctx->ifc_rxqs; for (i = 0; i < q; ++i, rxq++) { iflib_rx_sds_free(rxq); - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; } return (err); #endif @@ -6205,8 +6190,8 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = min(rx_queues, tx_queues); } - device_printf(dev, "Using %d rx queues %d tx queues\n", - rx_queues, tx_queues); + device_printf(dev, "Using %d RX queues %d TX queues\n", rx_queues, + tx_queues); vectors = rx_queues + admincnt; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { @@ -6360,10 +6345,10 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) "disable MSI-X (default 0)"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, - "set the rx budget"); + "set the RX budget"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "tx_abdicate", CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, - "cause tx to abdicate instead of running to completion"); + "cause TX to abdicate instead of running to completion"); ctx->ifc_sysctl_core_offset = CORE_OFFSET_UNSPECIFIED; SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "core_offset", CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, @@ -6376,11 +6361,11 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NTXD_HANDLER, mp_ndesc_handler, "A", - "list of # of tx descriptors to use, 0 = use default #"); + "list of # of TX descriptors to use, 0 = use default #"); SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_nrxds", CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NRXD_HANDLER, mp_ndesc_handler, "A", - "list of # of rx descriptors to use, 0 = use default #"); + "list of # of RX descriptors to use, 0 = use default #"); } static void @@ -6437,7 +6422,7 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) &txq->ift_no_desc_avail, "# of times no descriptors were available"); SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "tx_map_failed", CTLFLAG_RD, - &txq->ift_map_failed, "# of times dma map failed"); + &txq->ift_map_failed, "# of times DMA map failed"); SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txd_encap_efbig", CTLFLAG_RD, &txq->ift_txd_encap_efbig, "# of times txd_encap returned EFBIG"); @@ -6497,9 +6482,6 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); if (sctx->isc_flags & IFLIB_HAS_RXCQ) { - SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_pidx", - CTLFLAG_RD, - &rxq->ifr_cq_pidx, 1, "Producer Index"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_cidx", CTLFLAG_RD, &rxq->ifr_cq_cidx, 1, "Consumer Index"); @@ -6577,7 +6559,7 @@ iflib_fixup_rx(struct mbuf *m) #ifdef NETDUMP static void -iflib_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) +iflib_netdump_init(if_t ifp, int *nrxr, int *ncl, int *clsize) { if_ctx_t ctx; @@ -6590,7 +6572,7 @@ iflib_netdump_init(struct ifnet *ifp, int *nrxr, int * } static void -iflib_netdump_event(struct ifnet *ifp, enum netdump_ev event) +iflib_netdump_event(if_t ifp, enum netdump_ev event) { if_ctx_t ctx; if_softc_ctx_t scctx; @@ -6618,7 +6600,7 @@ iflib_netdump_event(struct ifnet *ifp, enum netdump_ev } static int -iflib_netdump_transmit(struct ifnet *ifp, struct mbuf *m) +iflib_netdump_transmit(if_t ifp, struct mbuf *m) { if_ctx_t ctx; iflib_txq_t txq; @@ -6637,7 +6619,7 @@ iflib_netdump_transmit(struct ifnet *ifp, struct mbuf } static int -iflib_netdump_poll(struct ifnet *ifp, int count) +iflib_netdump_poll(if_t ifp, int count) { if_ctx_t ctx; if_softc_ctx_t scctx; Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Sun Jun 16 14:53:53 2019 (r349109) +++ stable/12/sys/net/iflib.h Sun Jun 16 15:11:52 2019 (r349110) @@ -79,7 +79,7 @@ typedef struct if_rxd_info { /* XXX redundant with the new irf_len field */ uint16_t iri_len; /* packet length */ qidx_t iri_cidx; /* consumer index of cq */ - struct ifnet *iri_ifp; /* some drivers >1 interface per softc */ + if_t iri_ifp; /* driver may have >1 iface per softc */ /* updated by driver */ if_rxd_frag_t iri_frags; Modified: stable/12/sys/net/iflib_clone.c ============================================================================== --- stable/12/sys/net/iflib_clone.c Sun Jun 16 14:53:53 2019 (r349109) +++ stable/12/sys/net/iflib_clone.c Sun Jun 16 15:11:52 2019 (r349110) @@ -153,16 +153,18 @@ iflib_ip_insert(if_pseudo_t ip) } static void -iflib_ifdetach(void *arg __unused, struct ifnet *ifp) +iflib_ifdetach(void *arg __unused, if_t ifp) { + /* If the ifnet is just being renamed, don't do anything. */ if (ifp->if_flags & IFF_RENAMING) return; } static void -iflib_iflladdr(void *arg __unused, struct ifnet *ifp) +iflib_iflladdr(void *arg __unused, if_t ifp __unused) { + } static int @@ -218,15 +220,15 @@ iflib_clone_create(struct if_clone *ifc, int unit, cad } static void -iflib_clone_destroy(struct ifnet *ifp) +iflib_clone_destroy(if_t ifp) { if_ctx_t ctx; device_t dev; struct sx *ctx_lock; int rc; + /* * Detach device / free / free unit - * */ ctx = if_getsoftc(ifp); dev = iflib_get_dev(ctx); From owner-svn-src-all@freebsd.org Sun Jun 16 15:14:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 15:25:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2630F15C1E05; Sun, 16 Jun 2019 15:25:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9B5A85149; Sun, 16 Jun 2019 15:25:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75FA0185CB; Sun, 16 Jun 2019 15:25:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GFPkxg038776; Sun, 16 Jun 2019 15:25:46 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFPked038775; Sun, 16 Jun 2019 15:25:46 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161525.x5GFPked038775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 15:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349112 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 349112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9B5A85149 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.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:25:47 -0000 Author: marius Date: Sun Jun 16 15:25:46 2019 New Revision: 349112 URL: https://svnweb.freebsd.org/changeset/base/349112 Log: MFC: r347221, r347245 o Use iflib_fast_intr_rxtx() also for "legacy" interrupts, i. e. INTx and MSI. Unlike as with iflib_fast_intr_ctx(), the former will also enqueue _task_fn_tx() in addition to _task_fn_rx() if appropriate, bringing TCP TX throughput of EM-class devices on par with the MSI-X case and, thus, close to wirespeed/pre-iflib(4) times again. [1] Note that independently of the interrupt type, the UDP performance with these MACs still is abysmal and nowhere near to where it was before the conversion of em(4) to iflib(4). o In iflib_init_locked(), announce which free list failed to set up. o In _task_fn_tx() when running netmap(4), issue ifdi_intr_enable instead of the ifdi_tx_queue_intr_enable method in case of a "legacy" interrupt as the latter is valid with MSI-X only. o Instead of adding the missing - and apparently convoluted enough that a DBG_COUNTER_INC was put into a wrong spot in _task_fn_rx() - checks for ifdi_{r,t}x_queue_intr_enable being available in the MSI-X case also to iflib_fast_intr_rxtx(), factor these out to iflib_device_register() and make the checks fail gracefully rather than panic. This avoids invoking the checks at runtime over and over again in iflib_fast_intr_rxtx() and _task_fn_{r,t}x() - even if it's just in case of INVARIANTS - and makes these functions more readable. o In iflib_rx_structures_setup(), only initialize LRO resources if device and driver have LRO capability in order to not waste memory. Also, free the LRO resources again if setting them up fails for one of the queues. However, don't bother invoking iflib_rx_sds_free() in that case because iflib_rx_structures_setup() doesn't call iflib_rxsd_alloc() either (and iflib_{device,pseudo}_register() will issue iflib_rx_sds_free() in case of failure via iflib_rx_structures_free(), but there definitely is some asymmetry left to be fixed, though). o Similarly, free LRO resources again in iflib_rx_structures_free(). o In iflib_irq_set_affinity(), handle get_core_offset() errors gracefully instead of panicing (but only in case of INVARIANTS). This is a follow- up to r344132 (MFCed to stable/12 in r344163) as such bugs shouldn't be fatal. o Likewise, handle unknown iflib_intr_type_t in iflib_irq_alloc_generic() gracefully, too. o Bring yet more sanity to iflib_msix_init(): - If the device doesn't provide enough MSI-X vectors or not all vectors can be allocate so the expected number of queues in addition to admin interrupts can't be supported, try MSI next (and then INTx) as proper MSI-X vector distribution can't be assured in such cases. In essence, this change brings r254008 forward to iflib(4). Also, this is the fix alluded to in the commit message of r343934. - If the MSI-X allocation has failed, don't prematurely announce MSI is going to be used as the latter in fact may not be available either. - When falling back to MSI, only release the MSI-X table resource again if it was allocated in iflib_msix_init(), i. e. isn't supplied by the driver, in the first place. o In mp_ndesc_handler(), handle unknown type arguments gracefully, too. PR: 235031 (likely) [1] Reviewed by: shurd Differential Revision: https://reviews.freebsd.org/D20175 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Sun Jun 16 15:14:49 2019 (r349111) +++ stable/12/sys/net/iflib.c Sun Jun 16 15:25:46 2019 (r349112) @@ -1497,6 +1497,7 @@ iflib_fast_intr_rxtx(void *arg) void *sc; int i, cidx, result; qidx_t txqid; + bool intr_enable, intr_legacy; if (!iflib_started) return (FILTER_STRAY); @@ -1510,6 +1511,8 @@ iflib_fast_intr_rxtx(void *arg) ctx = rxq->ifr_ctx; sc = ctx->ifc_softc; + intr_enable = false; + intr_legacy = !!(ctx->ifc_flags & IFC_LEGACY); MPASS(rxq->ifr_ntxqirq); for (i = 0; i < rxq->ifr_ntxqirq; i++) { txqid = rxq->ifr_txqid[i]; @@ -1517,7 +1520,10 @@ iflib_fast_intr_rxtx(void *arg) bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); if (!ctx->isc_txd_credits_update(sc, txqid, false)) { - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); + if (intr_legacy) + intr_enable = true; + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); continue; } GROUPTASK_ENQUEUE(&txq->ift_task); @@ -1529,9 +1535,14 @@ iflib_fast_intr_rxtx(void *arg) if (iflib_rxd_avail(ctx, rxq, cidx, 1)) GROUPTASK_ENQUEUE(gtask); else { - IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); + if (intr_legacy) + intr_enable = true; + else + IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); DBG_COUNTER_INC(rx_intr_enables); } + if (intr_enable) + IFDI_INTR_ENABLE(ctx); return (FILTER_HANDLED); } @@ -2387,7 +2398,9 @@ iflib_init_locked(if_ctx_t ctx) } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) { if (iflib_fl_setup(fl)) { - device_printf(ctx->ifc_dev, "freelist setup failed - check cluster settings\n"); + device_printf(ctx->ifc_dev, + "setting up free list %d failed - " + "check cluster settings\n", j); goto done; } } @@ -3706,7 +3719,10 @@ _task_fn_tx(void *context) BUS_DMASYNC_POSTREAD); if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); + if (ctx->ifc_flags & IFC_LEGACY) + IFDI_INTR_ENABLE(ctx); + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; } #endif @@ -3725,13 +3741,8 @@ _task_fn_tx(void *context) ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); - else { -#ifdef INVARIANTS - int rc = -#endif - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); - KASSERT(rc != ENOTSUP, ("MSI-X support requires queue_intr_enable, but not implemented in driver")); - } + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); } static void @@ -3763,14 +3774,9 @@ _task_fn_rx(void *context) if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); - else { -#ifdef INVARIANTS - int rc = -#endif - IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); - KASSERT(rc != ENOTSUP, ("MSI-X support requires queue_intr_enable, but not implemented in driver")); - DBG_COUNTER_INC(rx_intr_enables); - } + else + IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); + DBG_COUNTER_INC(rx_intr_enables); } if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; @@ -4471,15 +4477,14 @@ unref_ctx_core_offset(if_ctx_t ctx) int iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ctxp) { - int err, rid, msix; if_ctx_t ctx; if_t ifp; if_softc_ctx_t scctx; - int i; - uint16_t main_txq; - uint16_t main_rxq; + kobjop_desc_t kobj_desc; + kobj_method_t *kobj_method; + int err, i, msix, rid; + uint16_t main_rxq, main_txq; - ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); if (sc == NULL) { @@ -4635,11 +4640,43 @@ iflib_device_register(device_t dev, void *sc, if_share * interrupt storm. */ IFDI_INTR_DISABLE(ctx); - if (msix > 1 && (err = IFDI_MSIX_INTR_ASSIGN(ctx, msix)) != 0) { - device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", err); - goto fail_queues; - } - if (msix <= 1) { + + if (msix > 1) { + /* + * When using MSI-X, ensure that ifdi_{r,t}x_queue_intr_enable + * aren't the default NULL implementation. + */ + kobj_desc = &ifdi_rx_queue_intr_enable_desc; + kobj_method = kobj_lookup_method(((kobj_t)ctx)->ops->cls, NULL, + kobj_desc); + if (kobj_method == &kobj_desc->deflt) { + device_printf(dev, + "MSI-X requires ifdi_rx_queue_intr_enable method"); + err = EOPNOTSUPP; + goto fail_queues; + } + kobj_desc = &ifdi_tx_queue_intr_enable_desc; + kobj_method = kobj_lookup_method(((kobj_t)ctx)->ops->cls, NULL, + kobj_desc); + if (kobj_method == &kobj_desc->deflt) { + device_printf(dev, + "MSI-X requires ifdi_tx_queue_intr_enable method"); + err = EOPNOTSUPP; + goto fail_queues; + } + + /* + * Assign the MSI-X vectors. + * Note that the default NULL ifdi_msix_intr_assign method will + * fail here, too. + */ + err = IFDI_MSIX_INTR_ASSIGN(ctx, msix); + if (err != 0) { + device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", + err); + goto fail_queues; + } + } else { rid = 0; if (scctx->isc_intr == IFLIB_INTR_MSI) { MPASS(msix == 1); @@ -4678,6 +4715,7 @@ iflib_device_register(device_t dev, void *sc, if_share iflib_add_device_sysctl_post(ctx); ctx->ifc_flags |= IFC_INIT_DONE; CTX_UNLOCK(ctx); + return (0); fail_detach: @@ -4892,6 +4930,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc iflib_add_device_sysctl_post(ctx); ctx->ifc_flags |= IFC_INIT_DONE; CTX_UNLOCK(ctx); + return (0); fail_detach: ether_ifdetach(ctx->ifc_ifp); @@ -5281,7 +5320,6 @@ iflib_register(if_ctx_t ctx) return (0); } - static int iflib_queues_alloc(if_ctx_t ctx) { @@ -5540,17 +5578,20 @@ iflib_rx_structures_setup(if_ctx_t ctx) iflib_rxq_t rxq = ctx->ifc_rxqs; int q; #if defined(INET6) || defined(INET) - int i, err; + int err, i; #endif for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) { #if defined(INET6) || defined(INET) - tcp_lro_free(&rxq->ifr_lc); - if ((err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, - TCP_LRO_ENTRIES, min(1024, - ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset]))) != 0) { - device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); - goto fail; + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) { + err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, + TCP_LRO_ENTRIES, min(1024, + ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset])); + if (err != 0) { + device_printf(ctx->ifc_dev, + "LRO Initialization failed!\n"); + goto fail; + } } #endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); @@ -5559,14 +5600,14 @@ iflib_rx_structures_setup(if_ctx_t ctx) #if defined(INET6) || defined(INET) fail: /* - * Free RX software descriptors allocated so far, we will only handle + * Free LRO resources allocated so far, we will only handle * the rings that completed, the failing case will have - * cleaned up for itself. 'q' failed, so its the terminus. + * cleaned up for itself. 'q' failed, so its the terminus. */ rxq = ctx->ifc_rxqs; for (i = 0; i < q; ++i, rxq++) { - iflib_rx_sds_free(rxq); - rxq->ifr_cq_cidx = 0; + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) + tcp_lro_free(&rxq->ifr_lc); } return (err); #endif @@ -5581,9 +5622,14 @@ static void iflib_rx_structures_free(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; + int i; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { iflib_rx_sds_free(rxq); +#if defined(INET6) || defined(INET) + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) + tcp_lro_free(&rxq->ifr_lc); +#endif } free(ctx->ifc_rxqs, M_IFLIB); ctx->ifc_rxqs = NULL; @@ -5754,7 +5800,10 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, ifl co += ctx->ifc_softc_ctx.isc_nrxqsets; cpuid = find_nth(ctx, qid + co); tid = get_core_offset(ctx, type, qid); - MPASS(tid >= 0); + if (tid < 0) { + device_printf(dev, "get_core_offset failed\n"); + return (EOPNOTSUPP); + } cpuid = find_close_core(cpuid, tid); err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, rman_get_start(irq->ii_res), name); @@ -5766,7 +5815,7 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, ifl if (cpuid > ctx->ifc_cpuid_highest) ctx->ifc_cpuid_highest = cpuid; #endif - return 0; + return (0); } int @@ -5826,7 +5875,9 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in intr_fast = iflib_fast_intr_ctx; break; default: - panic("unknown net intr type"); + device_printf(ctx->ifc_dev, "%s: unknown net intr type\n", + __func__); + return (EINVAL); } info->ifi_filter = filter; @@ -5936,10 +5987,11 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = ctx; + info->ifi_ctx = q; /* We allocate a single interrupt resource */ - if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_ctx, NULL, info, name)) != 0) + if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx, + NULL, info, name)) != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); @@ -6101,9 +6153,8 @@ iflib_msix_init(if_ctx_t ctx) device_t dev = ctx->ifc_dev; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - int vectors, queues, rx_queues, tx_queues, queuemsgs, msgs; - int iflib_num_tx_queues, iflib_num_rx_queues; - int err, admincnt, bar; + int admincnt, bar, err, iflib_num_rx_queues, iflib_num_tx_queues; + int msgs, queuemsgs, queues, rx_queues, tx_queues, vectors; iflib_num_tx_queues = ctx->ifc_sysctl_ntxqs; iflib_num_rx_queues = ctx->ifc_sysctl_nrxqs; @@ -6112,8 +6163,6 @@ iflib_msix_init(if_ctx_t ctx) device_printf(dev, "msix_init qsets capped at %d\n", imax(scctx->isc_ntxqsets, scctx->isc_nrxqsets)); - bar = ctx->ifc_softc_ctx.isc_msix_bar; - admincnt = sctx->isc_admin_intrcnt; /* Override by tuneable */ if (scctx->isc_disable_msix) goto msi; @@ -6124,6 +6173,8 @@ iflib_msix_init(if_ctx_t ctx) device_printf(dev, "MSI-X not supported or disabled\n"); goto msi; } + + bar = ctx->ifc_softc_ctx.isc_msix_bar; /* * bar == -1 => "trust me I know what I'm doing" * Some drivers are for hardware that is so shoddily @@ -6139,6 +6190,8 @@ iflib_msix_init(if_ctx_t ctx) goto msi; } } + + admincnt = sctx->isc_admin_intrcnt; #if IFLIB_DEBUG /* use only 1 qset in debug mode */ queuemsgs = min(msgs - admincnt, 1); @@ -6190,11 +6243,30 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = min(rx_queues, tx_queues); } + vectors = rx_queues + admincnt; + if (msgs < vectors) { + device_printf(dev, + "insufficient number of MSI-X vectors " + "(supported %d, need %d)\n", msgs, vectors); + goto msi; + } + device_printf(dev, "Using %d RX queues %d TX queues\n", rx_queues, tx_queues); - - vectors = rx_queues + admincnt; + msgs = vectors; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { + if (vectors != msgs) { + device_printf(dev, + "Unable to allocate sufficient MSI-X vectors " + "(got %d, need %d)\n", vectors, msgs); + pci_release_msi(dev); + if (bar != -1) { + bus_release_resource(dev, SYS_RES_MEMORY, bar, + ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; + } + goto msi; + } device_printf(dev, "Using MSI-X interrupts with %d vectors\n", vectors); scctx->isc_vectors = vectors; @@ -6205,12 +6277,15 @@ iflib_msix_init(if_ctx_t ctx) return (vectors); } else { device_printf(dev, - "failed to allocate %d MSI-X vectors, err: %d - using MSI\n", - vectors, err); - bus_release_resource(dev, SYS_RES_MEMORY, bar, - ctx->ifc_msix_mem); - ctx->ifc_msix_mem = NULL; + "failed to allocate %d MSI-X vectors, err: %d\n", vectors, + err); + if (bar != -1) { + bus_release_resource(dev, SYS_RES_MEMORY, bar, + ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; + } } + msi: vectors = pci_msi_count(dev); scctx->isc_nrxqsets = 1; @@ -6272,8 +6347,6 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) char *p, *next; int nqs, rc, i; - MPASS(type == IFLIB_NTXD_HANDLER || type == IFLIB_NRXD_HANDLER); - nqs = 8; switch(type) { case IFLIB_NTXD_HANDLER: @@ -6287,7 +6360,8 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) nqs = ctx->ifc_sctx->isc_nrxqs; break; default: - panic("unhandled type"); + printf("%s: unhandled type\n", __func__); + return (EINVAL); } if (nqs == 0) nqs = 8; From owner-svn-src-all@freebsd.org Sun Jun 16 15:30:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A6CA15C207A; Sun, 16 Jun 2019 15:30:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E3B8853E4; Sun, 16 Jun 2019 15:30:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E34185D0; Sun, 16 Jun 2019 15:30:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GFU7VH039031; Sun, 16 Jun 2019 15:30:07 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFU75l039030; Sun, 16 Jun 2019 15:30:07 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161530.x5GFU75l039030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 15:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349113 - stable/12/sys/dev/e1000 X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/dev/e1000 X-SVN-Commit-Revision: 349113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E3B8853E4 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.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:30:08 -0000 Author: marius Date: Sun Jun 16 15:30:07 2019 New Revision: 349113 URL: https://svnweb.freebsd.org/changeset/base/349113 Log: MFC: r347222 o Avoid determining the MAC class (LEM/EM or IGB) - possibly even multiple times - on every interrupt by using an own set of device methods for the IGB class. This translates to introducing igb_if_intr_{disable,enable}() and igb_if_{rx,tx}_queue_intr_enable() with that IGB-specific code moved out of their EM counterparts and otherwise continuing to use the EM IFDI methods also for IGB. Note that igb_if_intr_{disable,enable}() also issue E1000_WRITE_FLUSH as lost with the conversion of igb(4) to iflib(4). Also note, that the em_if_{disable,enable}_intr() methods are renamed to em_if_intr_{disable,enable}() for consistency with the names used in the interface declaration. o In em_intr(): - Don't bother to bail out if the interrupt type is "legacy", i. e. INTx or MSI, as iflib(4) doesn't use ift_legacy_intr methods for MSI-X. All other iflib(4)-based drivers avoid this check, too. - Given that only the MSI-X interrupts have one-shot behavior (by taking advantage of the EIAC register), explicitly disable interrupts. Hence, em_intr() now matches what {em,igb}_irq_fast() previously did (in case of igb(4) supposedly also to work around MSI message reordering errata on certain systems). o In em_if_intr_disable(): - Clear the EIAC register unconditionally for 82574 and not just in case of MSI-X, matching em_if_intr_enable() and bringing back the last hunk of r206437 lost with the iflib(4) conversion. - Write to EM_EIAC for clearing said register instead of to the IGB-only E1000_EIAC used ever since the iflib(4) conversion. Reviewed by: shurd Differential Revision: https://reviews.freebsd.org/D20176 Modified: stable/12/sys/dev/e1000/if_em.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/if_em.c ============================================================================== --- stable/12/sys/dev/e1000/if_em.c Sun Jun 16 15:25:46 2019 (r349112) +++ stable/12/sys/dev/e1000/if_em.c Sun Jun 16 15:30:07 2019 (r349113) @@ -261,10 +261,14 @@ static int em_setup_msix(if_ctx_t ctx); static void em_initialize_transmit_unit(if_ctx_t ctx); static void em_initialize_receive_unit(if_ctx_t ctx); -static void em_if_enable_intr(if_ctx_t ctx); -static void em_if_disable_intr(if_ctx_t ctx); +static void em_if_intr_enable(if_ctx_t ctx); +static void em_if_intr_disable(if_ctx_t ctx); +static void igb_if_intr_enable(if_ctx_t ctx); +static void igb_if_intr_disable(if_ctx_t ctx); static int em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); static int em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); +static int igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); +static int igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); static void em_if_multi_set(if_ctx_t ctx); static void em_if_update_admin_status(if_ctx_t ctx); static void em_if_debug(if_ctx_t ctx); @@ -375,8 +379,8 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_init, em_if_init), DEVMETHOD(ifdi_stop, em_if_stop), DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign), - DEVMETHOD(ifdi_intr_enable, em_if_enable_intr), - DEVMETHOD(ifdi_intr_disable, em_if_disable_intr), + DEVMETHOD(ifdi_intr_enable, em_if_intr_enable), + DEVMETHOD(ifdi_intr_disable, em_if_intr_disable), DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc), DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc), DEVMETHOD(ifdi_queues_free, em_if_queues_free), @@ -398,14 +402,47 @@ static device_method_t em_if_methods[] = { DEVMETHOD_END }; -/* - * note that if (adapter->msix_mem) is replaced by: - * if (adapter->intr_type == IFLIB_INTR_MSIX) - */ static driver_t em_if_driver = { "em_if", em_if_methods, sizeof(struct adapter) }; +static device_method_t igb_if_methods[] = { + DEVMETHOD(ifdi_attach_pre, em_if_attach_pre), + DEVMETHOD(ifdi_attach_post, em_if_attach_post), + DEVMETHOD(ifdi_detach, em_if_detach), + DEVMETHOD(ifdi_shutdown, em_if_shutdown), + DEVMETHOD(ifdi_suspend, em_if_suspend), + DEVMETHOD(ifdi_resume, em_if_resume), + DEVMETHOD(ifdi_init, em_if_init), + DEVMETHOD(ifdi_stop, em_if_stop), + DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign), + DEVMETHOD(ifdi_intr_enable, igb_if_intr_enable), + DEVMETHOD(ifdi_intr_disable, igb_if_intr_disable), + DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, em_if_queues_free), + DEVMETHOD(ifdi_update_admin_status, em_if_update_admin_status), + DEVMETHOD(ifdi_multi_set, em_if_multi_set), + DEVMETHOD(ifdi_media_status, em_if_media_status), + DEVMETHOD(ifdi_media_change, em_if_media_change), + DEVMETHOD(ifdi_mtu_set, em_if_mtu_set), + DEVMETHOD(ifdi_promisc_set, em_if_set_promisc), + DEVMETHOD(ifdi_timer, em_if_timer), + DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), + DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), + DEVMETHOD(ifdi_get_counter, em_if_get_counter), + DEVMETHOD(ifdi_led_func, em_if_led_func), + DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), + DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD_END +}; + +static driver_t igb_if_driver = { + "igb_if", igb_if_methods, sizeof(struct adapter) +}; + /********************************************************************* * Tunable default values. *********************************************************************/ @@ -525,7 +562,7 @@ static struct if_shared_ctx igb_sctx_init = { .isc_admin_intrcnt = 1, .isc_vendor_info = igb_vendor_info_array, .isc_driver_version = em_driver_version, - .isc_driver = &em_if_driver, + .isc_driver = &igb_if_driver, .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, .isc_nrxd_min = {EM_MIN_RXD}, @@ -1333,8 +1370,6 @@ em_intr(void *arg) reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); - if (adapter->intr_type != IFLIB_INTR_LEGACY) - goto skip_stray; /* Hot eject? */ if (reg_icr == 0xffffffff) return FILTER_STRAY; @@ -1351,7 +1386,14 @@ em_intr(void *arg) (reg_icr & E1000_ICR_INT_ASSERTED) == 0) return FILTER_STRAY; -skip_stray: + /* + * Only MSI-X interrupts have one-shot behavior by taking advantage + * of the EIAC register. Thus, explicitly disable interrupts. This + * also works around the MSI message reordering errata on certain + * systems. + */ + IFDI_INTR_DISABLE(ctx); + /* Link status change */ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { adapter->hw.mac.get_link_status = 1; @@ -1364,53 +1406,43 @@ skip_stray: return (FILTER_SCHEDULE_THREAD); } -static void -igb_rx_enable_queue(struct adapter *adapter, struct em_rx_queue *rxq) +static int +em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) { - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, rxq->eims); -} + struct adapter *adapter = iflib_get_softc(ctx); + struct em_rx_queue *rxq = &adapter->rx_queues[rxqid]; -static void -em_rx_enable_queue(struct adapter *adapter, struct em_rx_queue *rxq) -{ E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxq->eims); + return (0); } -static void -igb_tx_enable_queue(struct adapter *adapter, struct em_tx_queue *txq) +static int +em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) { - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, txq->eims); -} + struct adapter *adapter = iflib_get_softc(ctx); + struct em_tx_queue *txq = &adapter->tx_queues[txqid]; -static void -em_tx_enable_queue(struct adapter *adapter, struct em_tx_queue *txq) -{ E1000_WRITE_REG(&adapter->hw, E1000_IMS, txq->eims); + return (0); } static int -em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) +igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) { struct adapter *adapter = iflib_get_softc(ctx); struct em_rx_queue *rxq = &adapter->rx_queues[rxqid]; - if (adapter->hw.mac.type >= igb_mac_min) - igb_rx_enable_queue(adapter, rxq); - else - em_rx_enable_queue(adapter, rxq); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, rxq->eims); return (0); } static int -em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) +igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) { struct adapter *adapter = iflib_get_softc(ctx); struct em_tx_queue *txq = &adapter->tx_queues[txqid]; - if (adapter->hw.mac.type >= igb_mac_min) - igb_tx_enable_queue(adapter, txq); - else - em_tx_enable_queue(adapter, txq); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, txq->eims); return (0); } @@ -3374,7 +3406,7 @@ em_setup_vlan_hw_support(struct adapter *adapter) } static void -em_if_enable_intr(if_ctx_t ctx) +em_if_intr_enable(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; @@ -3383,30 +3415,51 @@ em_if_enable_intr(if_ctx_t ctx) if (hw->mac.type == e1000_82574) { E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); ims_mask |= adapter->ims; - } else if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= igb_mac_min) { - u32 mask = (adapter->que_mask | adapter->link_mask); - - E1000_WRITE_REG(&adapter->hw, E1000_EIAC, mask); - E1000_WRITE_REG(&adapter->hw, E1000_EIAM, mask); - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, mask); - ims_mask = E1000_IMS_LSC; } - E1000_WRITE_REG(hw, E1000_IMS, ims_mask); } static void -em_if_disable_intr(if_ctx_t ctx) +em_if_intr_disable(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; - if (adapter->intr_type == IFLIB_INTR_MSIX) { - if (hw->mac.type >= igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_EIMC, ~0); - E1000_WRITE_REG(&adapter->hw, E1000_EIAC, 0); + if (hw->mac.type == e1000_82574) + E1000_WRITE_REG(hw, EM_EIAC, 0); + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); +} + +static void +igb_if_intr_enable(if_ctx_t ctx) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct e1000_hw *hw = &adapter->hw; + u32 mask; + + if (__predict_true(adapter->intr_type == IFLIB_INTR_MSIX)) { + mask = (adapter->que_mask | adapter->link_mask); + E1000_WRITE_REG(hw, E1000_EIAC, mask); + E1000_WRITE_REG(hw, E1000_EIAM, mask); + E1000_WRITE_REG(hw, E1000_EIMS, mask); + E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC); + } else + E1000_WRITE_REG(hw, E1000_IMS, IMS_ENABLE_MASK); + E1000_WRITE_FLUSH(hw); +} + +static void +igb_if_intr_disable(if_ctx_t ctx) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct e1000_hw *hw = &adapter->hw; + + if (__predict_true(adapter->intr_type == IFLIB_INTR_MSIX)) { + E1000_WRITE_REG(hw, E1000_EIMC, 0xffffffff); + E1000_WRITE_REG(hw, E1000_EIAC, 0); } - E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff); + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); + E1000_WRITE_FLUSH(hw); } /* From owner-svn-src-all@freebsd.org Sun Jun 16 15:34:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C53A015C235D; Sun, 16 Jun 2019 15:34:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F208586E; Sun, 16 Jun 2019 15:34:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C9DF1876D; Sun, 16 Jun 2019 15:34:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5GFYBBv043969; Sun, 16 Jun 2019 15:34:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5GFYB96043968; Sun, 16 Jun 2019 15:34:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201906161534.x5GFYB96043968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 16 Jun 2019 15:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349114 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 349114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65F208586E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2019 15:34:12 -0000 Author: marius Date: Sun Jun 16 15:34:10 2019 New Revision: 349114 URL: https://svnweb.freebsd.org/changeset/base/349114 Log: MFC: r347390 - Merge r338254 from cxgbe(4): Use fcmpset instead of cmpset when appropriate. - Revert r277226 of cxgbe(4), obsolete since r334320. Modified: stable/12/sys/net/mp_ring.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/mp_ring.c ============================================================================== --- stable/12/sys/net/mp_ring.c Sun Jun 16 15:30:07 2019 (r349113) +++ stable/12/sys/net/mp_ring.c Sun Jun 16 15:34:10 2019 (r349114) @@ -36,12 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#if defined(__i386__) -#define atomic_cmpset_acq_64 atomic_cmpset_64 -#define atomic_cmpset_rel_64 atomic_cmpset_64 -#endif - #include union ring_state { @@ -195,11 +189,12 @@ drain_ring_lockless(struct ifmp_ring *r, union ring_st n = r->drain(r, cidx, pidx); if (n == 0) { critical_enter(); + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.cidx = cidx; ns.flags = STALLED; - } while (atomic_cmpset_64(&r->state, os.state, + } while (atomic_fcmpset_64(&r->state, &os.state, ns.state) == 0); critical_exit(); if (prev != STALLED) @@ -222,11 +217,13 @@ drain_ring_lockless(struct ifmp_ring *r, union ring_st if (cidx != pidx && pending < 64 && total < budget) continue; critical_enter(); + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.cidx = cidx; ns.flags = state_to_flags(ns, total >= budget); - } while (atomic_cmpset_acq_64(&r->state, os.state, ns.state) == 0); + } while (atomic_fcmpset_acq_64(&r->state, &os.state, + ns.state) == 0); critical_exit(); if (ns.flags == ABDICATED) @@ -379,10 +376,8 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i if (abdicate) { if (os.flags == IDLE) ns.flags = ABDICATED; - } - else { + } else ns.flags = BUSY; - } r->state = ns.state; counter_u64_add(r->enqueues, n); @@ -398,7 +393,6 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i mtx_unlock(&r->lock); return (0); } - #else int ifmp_ring_enqueue(struct ifmp_ring *r, void **items, int n, int budget, int abdicate) @@ -414,8 +408,8 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i * Reserve room for the new items. Our reservation, if successful, is * from 'pidx_start' to 'pidx_stop'. */ + os.state = r->state; for (;;) { - os.state = r->state; if (n >= space_available(r, os)) { counter_u64_add(r->drops, n); MPASS(os.flags != IDLE); @@ -426,7 +420,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i ns.state = os.state; ns.pidx_head = increment_idx(r, os.pidx_head, n); critical_enter(); - if (atomic_cmpset_64(&r->state, os.state, ns.state)) + if (atomic_fcmpset_64(&r->state, &os.state, ns.state)) break; critical_exit(); cpu_spinwait(); @@ -456,17 +450,16 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i * Update the ring's pidx_tail. The release style atomic guarantees * that the items are visible to any thread that sees the updated pidx. */ + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.pidx_tail = pidx_stop; if (abdicate) { if (os.flags == IDLE) ns.flags = ABDICATED; - } - else { + } else ns.flags = BUSY; - } - } while (atomic_cmpset_rel_64(&r->state, os.state, ns.state) == 0); + } while (atomic_fcmpset_rel_64(&r->state, &os.state, ns.state) == 0); critical_exit(); counter_u64_add(r->enqueues, n); From owner-svn-src-all@freebsd.org Sun Jun 16 15:57:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 16:02:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 16:45:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 17:32:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 19:44:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 20:01:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 21:56:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Jun 16 22:13:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Mon Jun 17 00:00:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15BD915CDEF1; Mon, 17 Jun 2019 00:00:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B02256E33A; Mon, 17 Jun 2019 00:00:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A5A91DB11; Mon, 17 Jun 2019 00:00:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H00CB7007318; Mon, 17 Jun 2019 00:00:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H00CkC007317; Mon, 17 Jun 2019 00:00:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170000.x5H00CkC007317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349123 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B02256E33A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:00:13 -0000 Author: rmacklem Date: Mon Jun 17 00:00:12 2019 New Revision: 349123 URL: https://svnweb.freebsd.org/changeset/base/349123 Log: MFC: r347476 Factor out some exportlist list operations into separate functions. This patch moves the code that removes and frees all exportlist elements out into a separate function called free_exports(). It does the same for the insertion of a new exportlist entry into a list. It also adds a second argument to ex_search() for the list to use. None of these changes have any semantic effect. They are being done to prepare the code for future patches that convert the single linked list for the exportlist to a hash table of lists and a patch that will do incremental changes of exports in the kernel. And it fixes the argument for SLIST_HEAD_INITIALIZER() to a pointer, which doesn't really matter, since SLIST_HEAD_INITIALIZER() doesn't use the argument. PR: 237860 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Sun Jun 16 22:13:27 2019 (r349122) +++ stable/12/usr.sbin/mountd/mountd.c Mon Jun 17 00:00:12 2019 (r349123) @@ -128,6 +128,8 @@ struct exportlist { /* ex_flag bits */ #define EX_LINKED 0x1 +SLIST_HEAD(exportlisthead, exportlist); + struct netmsk { struct sockaddr_storage nt_net; struct sockaddr_storage nt_mask; @@ -189,13 +191,15 @@ static int do_mount(struct exportlist *, struct groupl struct xucred *, char *, int, struct statfs *); static int do_opt(char **, char **, struct exportlist *, struct grouplist *, int *, int *, struct xucred *); -static struct exportlist *ex_search(fsid_t *); +static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); static struct exportlist *get_exp(void); static void free_dir(struct dirlist *); static void free_exp(struct exportlist *); static void free_grp(struct grouplist *); static void free_host(struct hostlist *); static void get_exportlist(void); +static void insert_exports(struct exportlist *, struct exportlisthead *); +static void free_exports(struct exportlisthead *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -227,8 +231,8 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static SLIST_HEAD(, exportlist) exphead = SLIST_HEAD_INITIALIZER(exphead); -static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(mlhead); +static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); +static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -1087,7 +1091,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) if (bad) ep = NULL; else - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1540,7 +1544,7 @@ get_exportlist_one(void) * See if this directory is already * in the list. */ - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; @@ -1695,7 +1699,7 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - SLIST_INSERT_HEAD(&exphead, ep, entries); + insert_exports(ep, &exphead); ep->ex_flag |= EX_LINKED; } @@ -1714,7 +1718,6 @@ nextline: static void get_exportlist(void) { - struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; @@ -1738,10 +1741,7 @@ get_exportlist(void) /* * First, get rid of the old list */ - SLIST_FOREACH_SAFE(ep, &exphead, entries, ep2) { - SLIST_REMOVE(&exphead, ep, exportlist, entries); - free_exp(ep); - } + free_exports(&exphead); grp = grphead; while (grp) { @@ -1869,6 +1869,31 @@ get_exportlist(void) } /* + * Insert an export entry in the appropriate list. + */ +static void +insert_exports(struct exportlist *ep, struct exportlisthead *exhp) +{ + + SLIST_INSERT_HEAD(exhp, ep, entries); +} + +/* + * Free up the exports lists passed in as arguments. + */ +static void +free_exports(struct exportlisthead *exhp) +{ + struct exportlist *ep, *ep2; + + SLIST_FOREACH_SAFE(ep, exhp, entries, ep2) { + SLIST_REMOVE(exhp, ep, exportlist, entries); + free_exp(ep); + } + SLIST_INIT(exhp); +} + +/* * Allocate an export list element */ static struct exportlist * @@ -1924,11 +1949,11 @@ getexp_err(struct exportlist *ep, struct grouplist *gr * Search the export list for a matching fs. */ static struct exportlist * -ex_search(fsid_t *fsid) +ex_search(fsid_t *fsid, struct exportlisthead *exhp) { struct exportlist *ep; - SLIST_FOREACH(ep, &exphead, entries) { + SLIST_FOREACH(ep, exhp, entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); From owner-svn-src-all@freebsd.org Mon Jun 17 00:11:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2817015CE4A5; Mon, 17 Jun 2019 00:11:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFFC6EB28; Mon, 17 Jun 2019 00:11:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91F641DD12; Mon, 17 Jun 2019 00:11:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H0BkwB016293; Mon, 17 Jun 2019 00:11:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H0Bklk016292; Mon, 17 Jun 2019 00:11:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170011.x5H0Bklk016292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349124 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 349124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFFFC6EB28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:11:47 -0000 Author: rmacklem Date: Mon Jun 17 00:11:46 2019 New Revision: 349124 URL: https://svnweb.freebsd.org/changeset/base/349124 Log: MFC: r347476 Factor out some exportlist list operations into separate functions. This patch moves the code that removes and frees all exportlist elements out into a separate function called free_exports(). It does the same for the insertion of a new exportlist entry into a list. It also adds a second argument to ex_search() for the list to use. None of these changes have any semantic effect. They are being done to prepare the code for future patches that convert the single linked list for the exportlist to a hash table of lists and a patch that will do incremental changes of exports in the kernel. And it fixes the argument for SLIST_HEAD_INITIALIZER() to a pointer, which doesn't really matter, since SLIST_HEAD_INITIALIZER() doesn't use the argument. PR: 237860 Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:00:12 2019 (r349123) +++ stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:11:46 2019 (r349124) @@ -126,6 +126,8 @@ struct exportlist { /* ex_flag bits */ #define EX_LINKED 0x1 +SLIST_HEAD(exportlisthead, exportlist); + struct netmsk { struct sockaddr_storage nt_net; struct sockaddr_storage nt_mask; @@ -187,13 +189,15 @@ static int do_mount(struct exportlist *, struct groupl struct xucred *, char *, int, struct statfs *); static int do_opt(char **, char **, struct exportlist *, struct grouplist *, int *, int *, struct xucred *); -static struct exportlist *ex_search(fsid_t *); +static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); static struct exportlist *get_exp(void); static void free_dir(struct dirlist *); static void free_exp(struct exportlist *); static void free_grp(struct grouplist *); static void free_host(struct hostlist *); static void get_exportlist(void); +static void insert_exports(struct exportlist *, struct exportlisthead *); +static void free_exports(struct exportlisthead *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -225,8 +229,8 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static SLIST_HEAD(, exportlist) exphead = SLIST_HEAD_INITIALIZER(exphead); -static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(mlhead); +static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); +static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -1085,7 +1089,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) if (bad) ep = NULL; else - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1538,7 +1542,7 @@ get_exportlist_one(void) * See if this directory is already * in the list. */ - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; @@ -1693,7 +1697,7 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - SLIST_INSERT_HEAD(&exphead, ep, entries); + insert_exports(ep, &exphead); ep->ex_flag |= EX_LINKED; } @@ -1712,7 +1716,6 @@ nextline: static void get_exportlist(void) { - struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; @@ -1736,10 +1739,7 @@ get_exportlist(void) /* * First, get rid of the old list */ - SLIST_FOREACH_SAFE(ep, &exphead, entries, ep2) { - SLIST_REMOVE(&exphead, ep, exportlist, entries); - free_exp(ep); - } + free_exports(&exphead); grp = grphead; while (grp) { @@ -1867,6 +1867,31 @@ get_exportlist(void) } /* + * Insert an export entry in the appropriate list. + */ +static void +insert_exports(struct exportlist *ep, struct exportlisthead *exhp) +{ + + SLIST_INSERT_HEAD(exhp, ep, entries); +} + +/* + * Free up the exports lists passed in as arguments. + */ +static void +free_exports(struct exportlisthead *exhp) +{ + struct exportlist *ep, *ep2; + + SLIST_FOREACH_SAFE(ep, exhp, entries, ep2) { + SLIST_REMOVE(exhp, ep, exportlist, entries); + free_exp(ep); + } + SLIST_INIT(exhp); +} + +/* * Allocate an export list element */ static struct exportlist * @@ -1922,11 +1947,11 @@ getexp_err(struct exportlist *ep, struct grouplist *gr * Search the export list for a matching fs. */ static struct exportlist * -ex_search(fsid_t *fsid) +ex_search(fsid_t *fsid, struct exportlisthead *exhp) { struct exportlist *ep; - SLIST_FOREACH(ep, &exphead, entries) { + SLIST_FOREACH(ep, exhp, entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); From owner-svn-src-all@freebsd.org Mon Jun 17 00:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D48415CE5A7; Mon, 17 Jun 2019 00:20:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D01846ED57; Mon, 17 Jun 2019 00:20:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB7321DE76; Mon, 17 Jun 2019 00:20:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H0KdXo017648; Mon, 17 Jun 2019 00:20:39 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H0KdPJ017647; Mon, 17 Jun 2019 00:20:39 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170020.x5H0KdPJ017647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349125 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D01846ED57 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:20:40 -0000 Author: rmacklem Date: Mon Jun 17 00:20:39 2019 New Revision: 349125 URL: https://svnweb.freebsd.org/changeset/base/349125 Log: MFC: r347498 Factor code into two new functions in preparation for a future commit. Factor code into two functions. read_exportfile() a functon which reads the exports file(s) and calls get_exportlist_one() to process each of them. delete_export() a function which deletes the exports in the kernel for a file system. The contents of these functions is just the same code as was used to do the operations, moved into separate functions. As such, there is no semantic change. This is being done in preparation for a future commit that will add an option to do incremental changes of kernel exports upon receiving SIGHUP. PR: 237860 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Mon Jun 17 00:11:46 2019 (r349124) +++ stable/12/usr.sbin/mountd/mountd.c Mon Jun 17 00:20:39 2019 (r349125) @@ -200,6 +200,8 @@ static void free_host(struct hostlist *); static void get_exportlist(void); static void insert_exports(struct exportlist *, struct exportlisthead *); static void free_exports(struct exportlisthead *); +static void read_exportfile(void); +static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -1721,12 +1723,10 @@ get_exportlist(void) struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; - struct statfs *fsp, *mntbufp; - struct xvfsconf vfc; + struct statfs *mntbufp; char errmsg[255]; int num, i; int iovlen; - int done; struct nfsex_args eargs; if (suspend_nfsd != 0) @@ -1781,48 +1781,9 @@ get_exportlist(void) build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); } - for (i = 0; i < num; i++) { - fsp = &mntbufp[i]; - if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { - syslog(LOG_ERR, "getvfsbyname() failed for %s", - fsp->f_fstypename); - continue; - } + for (i = 0; i < num; i++) + delete_export(iov, iovlen, &mntbufp[i], errmsg); - /* - * We do not need to delete "export" flag from - * filesystems that do not have it set. - */ - if (!(fsp->f_flags & MNT_EXPORTED)) - continue; - /* - * Do not delete export for network filesystem by - * passing "export" arg to nmount(). - * It only makes sense to do this for local filesystems. - */ - if (vfc.vfc_flags & VFCF_NETWORK) - continue; - - iov[1].iov_base = fsp->f_fstypename; - iov[1].iov_len = strlen(fsp->f_fstypename) + 1; - iov[3].iov_base = fsp->f_mntonname; - iov[3].iov_len = strlen(fsp->f_mntonname) + 1; - iov[5].iov_base = fsp->f_mntfromname; - iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; - errmsg[0] = '\0'; - - /* - * EXDEV is returned when path exists but is not a - * mount point. May happens if raced with unmount. - */ - if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT && errno != ENOTSUP && errno != EXDEV) { - syslog(LOG_ERR, - "can't delete exports for %s: %m %s", - fsp->f_mntonname, errmsg); - } - } - if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ @@ -1837,26 +1798,7 @@ get_exportlist(void) iovlen = 0; } - /* - * Read in the exports file and build the list, calling - * nmount() as we go along to push the export rules into the kernel. - */ - done = 0; - for (i = 0; exnames[i] != NULL; i++) { - if (debug) - warnx("reading exports from %s", exnames[i]); - if ((exp_file = fopen(exnames[i], "r")) == NULL) { - syslog(LOG_WARNING, "can't open %s", exnames[i]); - continue; - } - get_exportlist_one(); - fclose(exp_file); - done++; - } - if (done == 0) { - syslog(LOG_ERR, "can't open any exports file"); - exit(2); - } + read_exportfile(); /* * If there was no public fh, clear any previous one set. @@ -1891,6 +1833,84 @@ free_exports(struct exportlisthead *exhp) free_exp(ep); } SLIST_INIT(exhp); +} + +/* + * Read the exports file(s) and call get_exportlist_one() for each line. + */ +static void +read_exportfile(void) +{ + int done, i; + + /* + * Read in the exports file and build the list, calling + * nmount() as we go along to push the export rules into the kernel. + */ + done = 0; + for (i = 0; exnames[i] != NULL; i++) { + if (debug) + warnx("reading exports from %s", exnames[i]); + if ((exp_file = fopen(exnames[i], "r")) == NULL) { + syslog(LOG_WARNING, "can't open %s", exnames[i]); + continue; + } + get_exportlist_one(); + fclose(exp_file); + done++; + } + if (done == 0) { + syslog(LOG_ERR, "can't open any exports file"); + exit(2); + } +} + +/* + * Delete an exports entry. + */ +static void +delete_export(struct iovec *iov, int iovlen, struct statfs *fsp, char *errmsg) +{ + struct xvfsconf vfc; + + if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { + syslog(LOG_ERR, "getvfsbyname() failed for %s", + fsp->f_fstypename); + return; + } + + /* + * We do not need to delete "export" flag from + * filesystems that do not have it set. + */ + if (!(fsp->f_flags & MNT_EXPORTED)) + return; + /* + * Do not delete export for network filesystem by + * passing "export" arg to nmount(). + * It only makes sense to do this for local filesystems. + */ + if (vfc.vfc_flags & VFCF_NETWORK) + return; + + iov[1].iov_base = fsp->f_fstypename; + iov[1].iov_len = strlen(fsp->f_fstypename) + 1; + iov[3].iov_base = fsp->f_mntonname; + iov[3].iov_len = strlen(fsp->f_mntonname) + 1; + iov[5].iov_base = fsp->f_mntfromname; + iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; + errmsg[0] = '\0'; + + /* + * EXDEV is returned when path exists but is not a + * mount point. May happens if raced with unmount. + */ + if (nmount(iov, iovlen, fsp->f_flags) < 0 && errno != ENOENT && + errno != ENOTSUP && errno != EXDEV) { + syslog(LOG_ERR, + "can't delete exports for %s: %m %s", + fsp->f_mntonname, errmsg); + } } /* From owner-svn-src-all@freebsd.org Mon Jun 17 00:29:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6418715CE783; Mon, 17 Jun 2019 00:29:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 069E46F2BF; Mon, 17 Jun 2019 00:29:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E5D1E009; Mon, 17 Jun 2019 00:29:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H0TeHL023008; Mon, 17 Jun 2019 00:29:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H0TeuV023007; Mon, 17 Jun 2019 00:29:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170029.x5H0TeuV023007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349126 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 349126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 069E46F2BF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:29:41 -0000 Author: rmacklem Date: Mon Jun 17 00:29:40 2019 New Revision: 349126 URL: https://svnweb.freebsd.org/changeset/base/349126 Log: MFC: r347498 Factor code into two new functions in preparation for a future commit. Factor code into two functions. read_exportfile() a functon which reads the exports file(s) and calls get_exportlist_one() to process each of them. delete_export() a function which deletes the exports in the kernel for a file system. The contents of these functions is just the same code as was used to do the operations, moved into separate functions. As such, there is no semantic change. This is being done in preparation for a future commit that will add an option to do incremental changes of kernel exports upon receiving SIGHUP. PR: 237860 Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:20:39 2019 (r349125) +++ stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:29:40 2019 (r349126) @@ -198,6 +198,8 @@ static void free_host(struct hostlist *); static void get_exportlist(void); static void insert_exports(struct exportlist *, struct exportlisthead *); static void free_exports(struct exportlisthead *); +static void read_exportfile(void); +static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -1719,12 +1721,10 @@ get_exportlist(void) struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; - struct statfs *fsp, *mntbufp; - struct xvfsconf vfc; + struct statfs *mntbufp; char errmsg[255]; int num, i; int iovlen; - int done; struct nfsex_args eargs; if (suspend_nfsd != 0) @@ -1779,48 +1779,9 @@ get_exportlist(void) build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); } - for (i = 0; i < num; i++) { - fsp = &mntbufp[i]; - if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { - syslog(LOG_ERR, "getvfsbyname() failed for %s", - fsp->f_fstypename); - continue; - } + for (i = 0; i < num; i++) + delete_export(iov, iovlen, &mntbufp[i], errmsg); - /* - * We do not need to delete "export" flag from - * filesystems that do not have it set. - */ - if (!(fsp->f_flags & MNT_EXPORTED)) - continue; - /* - * Do not delete export for network filesystem by - * passing "export" arg to nmount(). - * It only makes sense to do this for local filesystems. - */ - if (vfc.vfc_flags & VFCF_NETWORK) - continue; - - iov[1].iov_base = fsp->f_fstypename; - iov[1].iov_len = strlen(fsp->f_fstypename) + 1; - iov[3].iov_base = fsp->f_mntonname; - iov[3].iov_len = strlen(fsp->f_mntonname) + 1; - iov[5].iov_base = fsp->f_mntfromname; - iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; - errmsg[0] = '\0'; - - /* - * EXDEV is returned when path exists but is not a - * mount point. May happens if raced with unmount. - */ - if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT && errno != ENOTSUP && errno != EXDEV) { - syslog(LOG_ERR, - "can't delete exports for %s: %m %s", - fsp->f_mntonname, errmsg); - } - } - if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ @@ -1835,26 +1796,7 @@ get_exportlist(void) iovlen = 0; } - /* - * Read in the exports file and build the list, calling - * nmount() as we go along to push the export rules into the kernel. - */ - done = 0; - for (i = 0; exnames[i] != NULL; i++) { - if (debug) - warnx("reading exports from %s", exnames[i]); - if ((exp_file = fopen(exnames[i], "r")) == NULL) { - syslog(LOG_WARNING, "can't open %s", exnames[i]); - continue; - } - get_exportlist_one(); - fclose(exp_file); - done++; - } - if (done == 0) { - syslog(LOG_ERR, "can't open any exports file"); - exit(2); - } + read_exportfile(); /* * If there was no public fh, clear any previous one set. @@ -1889,6 +1831,84 @@ free_exports(struct exportlisthead *exhp) free_exp(ep); } SLIST_INIT(exhp); +} + +/* + * Read the exports file(s) and call get_exportlist_one() for each line. + */ +static void +read_exportfile(void) +{ + int done, i; + + /* + * Read in the exports file and build the list, calling + * nmount() as we go along to push the export rules into the kernel. + */ + done = 0; + for (i = 0; exnames[i] != NULL; i++) { + if (debug) + warnx("reading exports from %s", exnames[i]); + if ((exp_file = fopen(exnames[i], "r")) == NULL) { + syslog(LOG_WARNING, "can't open %s", exnames[i]); + continue; + } + get_exportlist_one(); + fclose(exp_file); + done++; + } + if (done == 0) { + syslog(LOG_ERR, "can't open any exports file"); + exit(2); + } +} + +/* + * Delete an exports entry. + */ +static void +delete_export(struct iovec *iov, int iovlen, struct statfs *fsp, char *errmsg) +{ + struct xvfsconf vfc; + + if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { + syslog(LOG_ERR, "getvfsbyname() failed for %s", + fsp->f_fstypename); + return; + } + + /* + * We do not need to delete "export" flag from + * filesystems that do not have it set. + */ + if (!(fsp->f_flags & MNT_EXPORTED)) + return; + /* + * Do not delete export for network filesystem by + * passing "export" arg to nmount(). + * It only makes sense to do this for local filesystems. + */ + if (vfc.vfc_flags & VFCF_NETWORK) + return; + + iov[1].iov_base = fsp->f_fstypename; + iov[1].iov_len = strlen(fsp->f_fstypename) + 1; + iov[3].iov_base = fsp->f_mntonname; + iov[3].iov_len = strlen(fsp->f_mntonname) + 1; + iov[5].iov_base = fsp->f_mntfromname; + iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; + errmsg[0] = '\0'; + + /* + * EXDEV is returned when path exists but is not a + * mount point. May happens if raced with unmount. + */ + if (nmount(iov, iovlen, fsp->f_flags) < 0 && errno != ENOENT && + errno != ENOTSUP && errno != EXDEV) { + syslog(LOG_ERR, + "can't delete exports for %s: %m %s", + fsp->f_mntonname, errmsg); + } } /* From owner-svn-src-all@freebsd.org Mon Jun 17 00:37:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C629D15CE97B; Mon, 17 Jun 2019 00:37:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1356F68A; Mon, 17 Jun 2019 00:37:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 396411E1A9; Mon, 17 Jun 2019 00:37:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H0btOf028174; Mon, 17 Jun 2019 00:37:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H0btNZ028173; Mon, 17 Jun 2019 00:37:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170037.x5H0btNZ028173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349127 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C1356F68A 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.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:37:57 -0000 Author: rmacklem Date: Mon Jun 17 00:37:55 2019 New Revision: 349127 URL: https://svnweb.freebsd.org/changeset/base/349127 Log: MFC: r347583 Replace global list for grouplist with list(s) for each exportlist element. In mountd.c, the grouplist structures are linked into a single global linked list headed by "grphead". The only use of this linked list is to free all list elements when the exportlist elements are also all being free'd at the time the exports are being reloaded. This patch replaces this one global linked list head with a list head in each exportlist structure, where the grouplist elements for that exported file system are linked. The only change is that now the grouplist elements are free'd with the associated exportlist element as they are free'd instead of all grouplist elements being free'd after the exportlist elements are free'd. This change should have no effect in practice. This is being done, since a future patch that will add a "-I" option for incrementally updating the exports in the kernel needs to know which grouplist elements are associated with each exported file system and having them linked into a list headed by the exportlist element does that. PR: 237860 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Mon Jun 17 00:29:40 2019 (r349126) +++ stable/12/usr.sbin/mountd/mountd.c Mon Jun 17 00:37:55 2019 (r349127) @@ -114,6 +114,7 @@ struct dirlist { struct exportlist { struct dirlist *ex_dirl; struct dirlist *ex_defdir; + struct grouplist *ex_grphead; int ex_flag; fsid_t ex_fs; char *ex_fsdir; @@ -235,7 +236,6 @@ static void terminate(int); static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); -static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; @@ -455,7 +455,6 @@ main(int argc, char **argv) argc -= optind; argv += optind; - grphead = (struct grouplist *)NULL; if (argc > 0) exnames = argv; else @@ -1692,8 +1691,8 @@ get_exportlist_one(void) */ if (has_host) { hang_dirp(dirhead, tgrp, ep, opt_flags); - grp->gr_next = grphead; - grphead = tgrp; + grp->gr_next = ep->ex_grphead; + ep->ex_grphead = tgrp; } else { hang_dirp(dirhead, (struct grouplist *)NULL, ep, opt_flags); @@ -1720,7 +1719,6 @@ nextline: static void get_exportlist(void) { - struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; struct statfs *mntbufp; @@ -1743,14 +1741,6 @@ get_exportlist(void) */ free_exports(&exphead); - grp = grphead; - while (grp) { - tgrp = grp; - grp = grp->gr_next; - free_grp(tgrp); - } - grphead = (struct grouplist *)NULL; - /* * and the old V4 root dir. */ @@ -2448,6 +2438,7 @@ get_host(char *cp, struct grouplist *grp, struct group static void free_exp(struct exportlist *ep) { + struct grouplist *grp, *tgrp; if (ep->ex_defdir) { free_host(ep->ex_defdir->dp_hosts); @@ -2458,6 +2449,12 @@ free_exp(struct exportlist *ep) if (ep->ex_indexfile) free(ep->ex_indexfile); free_dir(ep->ex_dirl); + grp = ep->ex_grphead; + while (grp) { + tgrp = grp; + grp = grp->gr_next; + free_grp(tgrp); + } free((caddr_t)ep); } From owner-svn-src-all@freebsd.org Mon Jun 17 00:58:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76E915CEEF7; Mon, 17 Jun 2019 00:58:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 581476FEFB; Mon, 17 Jun 2019 00:58:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C7051E500; Mon, 17 Jun 2019 00:58:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5H0worn038502; Mon, 17 Jun 2019 00:58:50 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5H0woYa038501; Mon, 17 Jun 2019 00:58:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201906170058.x5H0woYa038501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 17 Jun 2019 00:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349128 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 349128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 581476FEFB 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 00:58:51 -0000 Author: rmacklem Date: Mon Jun 17 00:58:49 2019 New Revision: 349128 URL: https://svnweb.freebsd.org/changeset/base/349128 Log: MFC: r347583 Replace global list for grouplist with list(s) for each exportlist element. In mountd.c, the grouplist structures are linked into a single global linked list headed by "grphead". The only use of this linked list is to free all list elements when the exportlist elements are also all being free'd at the time the exports are being reloaded. This patch replaces this one global linked list head with a list head in each exportlist structure, where the grouplist elements for that exported file system are linked. The only change is that now the grouplist elements are free'd with the associated exportlist element as they are free'd instead of all grouplist elements being free'd after the exportlist elements are free'd. This change should have no effect in practice. This is being done, since a future patch that will add a "-I" option for incrementally updating the exports in the kernel needs to know which grouplist elements are associated with each exported file system and having them linked into a list headed by the exportlist element does that. PR: 237860 Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:37:55 2019 (r349127) +++ stable/11/usr.sbin/mountd/mountd.c Mon Jun 17 00:58:49 2019 (r349128) @@ -112,6 +112,7 @@ struct dirlist { struct exportlist { struct dirlist *ex_dirl; struct dirlist *ex_defdir; + struct grouplist *ex_grphead; int ex_flag; fsid_t ex_fs; char *ex_fsdir; @@ -233,7 +234,6 @@ static void terminate(int); static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); -static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; @@ -453,7 +453,6 @@ main(int argc, char **argv) argc -= optind; argv += optind; - grphead = (struct grouplist *)NULL; if (argc > 0) exnames = argv; else @@ -1690,8 +1689,8 @@ get_exportlist_one(void) */ if (has_host) { hang_dirp(dirhead, tgrp, ep, opt_flags); - grp->gr_next = grphead; - grphead = tgrp; + grp->gr_next = ep->ex_grphead; + ep->ex_grphead = tgrp; } else { hang_dirp(dirhead, (struct grouplist *)NULL, ep, opt_flags); @@ -1718,7 +1717,6 @@ nextline: static void get_exportlist(void) { - struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; struct statfs *mntbufp; @@ -1741,14 +1739,6 @@ get_exportlist(void) */ free_exports(&exphead); - grp = grphead; - while (grp) { - tgrp = grp; - grp = grp->gr_next; - free_grp(tgrp); - } - grphead = (struct grouplist *)NULL; - /* * and the old V4 root dir. */ @@ -2446,6 +2436,7 @@ get_host(char *cp, struct grouplist *grp, struct group static void free_exp(struct exportlist *ep) { + struct grouplist *grp, *tgrp; if (ep->ex_defdir) { free_host(ep->ex_defdir->dp_hosts); @@ -2456,6 +2447,12 @@ free_exp(struct exportlist *ep) if (ep->ex_indexfile) free(ep->ex_indexfile); free_dir(ep->ex_dirl); + grp = ep->ex_grphead; + while (grp) { + tgrp = grp; + grp = grp->gr_next; + free_grp(tgrp); + } free((caddr_t)ep); } From owner-svn-src-all@freebsd.org Mon Jun 17 01:58:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 03:32:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 03:40:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 03:48:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 05:41:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 07:56:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 08:50:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 09:29:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 10:27:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 10:34:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 11:29:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3908015B5B21; Mon, 17 Jun 2019 11:29:35 +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 E0F5C8B891; Mon, 17 Jun 2019 11:29:34 +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 B609224EF4; Mon, 17 Jun 2019 11:29:34 +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 x5HBTYvY006419; Mon, 17 Jun 2019 11:29:34 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HBTX0X006409; Mon, 17 Jun 2019 11:29:33 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201906171129.x5HBTX0X006409@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:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r349134 - in vendor/libarchive/dist: . libarchive libarchive/test X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: . libarchive libarchive/test X-SVN-Commit-Revision: 349134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0F5C8B891 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 11:29:35 -0000 Author: mm Date: Mon Jun 17 11:29:32 2019 New Revision: 349134 URL: https://svnweb.freebsd.org/changeset/base/349134 Log: Update vendor/libarchive/dist to git 809f0dc32fff7434aef45a7c688fa285c7208af7 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 Add HAVE_UNLINKAT to config_freebsd.h Added: vendor/libarchive/dist/libarchive/test/test_read_format_rar5_different_window_size.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/config_freebsd.h vendor/libarchive/dist/libarchive/test/test_read_format_rar.c vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/Makefile.am Mon Jun 17 11:29:32 2019 (r349134) @@ -826,6 +826,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar_noeof.rar.uu \ libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \ libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu \ + libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu \ libarchive/test/test_read_format_rar_sfx.exe.uu \ libarchive/test/test_read_format_rar_subblock.rar.uu \ libarchive/test/test_read_format_rar_unicode.rar.uu \ @@ -833,6 +834,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar5_arm.rar.uu \ libarchive/test/test_read_format_rar5_blake2.rar.uu \ libarchive/test/test_read_format_rar5_compressed.rar.uu \ + libarchive/test/test_read_format_rar5_different_window_size.rar.uu \ libarchive/test/test_read_format_rar5_distance_overflow.rar.uu \ libarchive/test/test_read_format_rar5_extra_field_version.rar.uu \ libarchive/test/test_read_format_rar5_fileattr.rar.uu \ Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Mon Jun 17 11:29:32 2019 (r349134) @@ -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: vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c Mon Jun 17 11:29:32 2019 (r349134) @@ -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: vendor/libarchive/dist/libarchive/config_freebsd.h ============================================================================== --- vendor/libarchive/dist/libarchive/config_freebsd.h Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/libarchive/config_freebsd.h Mon Jun 17 11:29:32 2019 (r349134) @@ -210,6 +210,7 @@ #define HAVE_TZSET 1 #define HAVE_UINTMAX_T 1 #define HAVE_UNISTD_H 1 +#define HAVE_UNLINKAT 1 #define HAVE_UNSETENV 1 #define HAVE_UNSIGNED_LONG_LONG 1 #define HAVE_UNSIGNED_LONG_LONG_INT 1 Modified: vendor/libarchive/dist/libarchive/test/test_read_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_rar.c Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar.c Mon Jun 17 11:29:32 2019 (r349134) @@ -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: vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Mon Jun 17 05:41:47 2019 (r349133) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c Mon Jun 17 11:29:32 2019 (r349134) @@ -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(); +} Added: 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) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar5_different_window_size.rar.uu Mon Jun 17 11:29:32 2019 (r349134) @@ -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 Added: 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) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu Mon Jun 17 11:29:32 2019 (r349134) @@ -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-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@mailman.ysv.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 13:36:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 14:07:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 14:17:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 14:59:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 15:09:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 15:11:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A86115BC766; Mon, 17 Jun 2019 15:11:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A153A6D87D; Mon, 17 Jun 2019 15:11:07 +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 7C97B27484; Mon, 17 Jun 2019 15:11:07 +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 x5HFB7Tu046142; Mon, 17 Jun 2019 15:11:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HFB4E6046129; Mon, 17 Jun 2019 15:11:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906171511.x5HFB4E6046129@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 15:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349139 - in stable/12/sys: amd64/amd64 arm/arm arm/nvidia/drm2 compat/linuxkpi/common/src dev/drm2/ttm dev/ti dev/xen/gntdev i386/i386 mips/mips riscv/riscv vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 arm/arm arm/nvidia/drm2 compat/linuxkpi/common/src dev/drm2/ttm dev/ti dev/xen/gntdev i386/i386 mips/mips riscv/riscv vm X-SVN-Commit-Revision: 349139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A153A6D87D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:11:08 -0000 Author: markj Date: Mon Jun 17 15:11:04 2019 New Revision: 349139 URL: https://svnweb.freebsd.org/changeset/base/349139 Log: MFC r348785: Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). Modified: stable/12/sys/amd64/amd64/pmap.c stable/12/sys/arm/arm/pmap-v6.c stable/12/sys/arm/nvidia/drm2/tegra_bo.c stable/12/sys/compat/linuxkpi/common/src/linux_page.c stable/12/sys/dev/drm2/ttm/ttm_page_alloc.c stable/12/sys/dev/ti/if_ti.c stable/12/sys/dev/xen/gntdev/gntdev.c stable/12/sys/i386/i386/pmap.c stable/12/sys/mips/mips/pmap.c stable/12/sys/riscv/riscv/pmap.c stable/12/sys/vm/uma_core.c stable/12/sys/vm/vm_glue.c stable/12/sys/vm/vm_kern.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/amd64/amd64/pmap.c Mon Jun 17 15:11:04 2019 (r349139) @@ -3705,7 +3705,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: stable/12/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/12/sys/arm/arm/pmap-v6.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/arm/arm/pmap-v6.c Mon Jun 17 15:11:04 2019 (r349139) @@ -2973,7 +2973,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); pmap_pte2list_free(&pv_vafree, (vm_offset_t)pc); } Modified: stable/12/sys/arm/nvidia/drm2/tegra_bo.c ============================================================================== --- stable/12/sys/arm/nvidia/drm2/tegra_bo.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/arm/nvidia/drm2/tegra_bo.c Mon Jun 17 15:11:04 2019 (r349139) @@ -67,7 +67,7 @@ tegra_bo_destruct(struct tegra_bo *bo) cdev_pager_free_page(bo->cdev_pager, m); vm_page_lock(m); m->flags &= ~PG_FICTITIOUS; - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); } Modified: stable/12/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_page.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/compat/linuxkpi/common/src/linux_page.c Mon Jun 17 15:11:04 2019 (r349139) @@ -317,7 +317,7 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(page); - vm_page_unwire(page, PQ_NONE); + vm_page_unwire_noq(page); vm_page_free(page); vm_page_unlock(page); VM_OBJECT_WUNLOCK(obj); Modified: stable/12/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- stable/12/sys/dev/drm2/ttm/ttm_page_alloc.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/dev/drm2/ttm/ttm_page_alloc.c Mon Jun 17 15:11:04 2019 (r349139) @@ -136,7 +136,7 @@ ttm_vm_page_free(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m)); m->flags &= ~PG_FICTITIOUS; m->oflags |= VPO_UNMANAGED; - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: stable/12/sys/dev/ti/if_ti.c ============================================================================== --- stable/12/sys/dev/ti/if_ti.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/dev/ti/if_ti.c Mon Jun 17 15:11:04 2019 (r349139) @@ -1623,7 +1623,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct m } sf[i] = sf_buf_alloc(frame, SFB_NOWAIT); if (sf[i] == NULL) { - vm_page_unwire(frame, PQ_NONE); + vm_page_unwire_noq(frame); vm_page_free(frame); device_printf(sc->ti_dev, "buffer allocation " "failed -- packet dropped!\n"); Modified: stable/12/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- stable/12/sys/dev/xen/gntdev/gntdev.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/dev/xen/gntdev/gntdev.c Mon Jun 17 15:11:04 2019 (r349139) @@ -278,7 +278,7 @@ gref_list_dtor(struct cleanup_data_struct *cleanup_dat continue; gnttab_free_grant_reference(gref->gref_id); } - vm_page_unwire(gref->page, PQ_NONE); + vm_page_unwire_noq(gref->page); vm_page_free(gref->page); gref->page = NULL; } Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/i386/i386/pmap.c Mon Jun 17 15:11:04 2019 (r349139) @@ -2542,7 +2542,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); } Modified: stable/12/sys/mips/mips/pmap.c ============================================================================== --- stable/12/sys/mips/mips/pmap.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/mips/mips/pmap.c Mon Jun 17 15:11:04 2019 (r349139) @@ -1553,7 +1553,7 @@ free_pv_chunk(struct pv_chunk *pc) /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/riscv/riscv/pmap.c Mon Jun 17 15:11:04 2019 (r349139) @@ -1647,7 +1647,7 @@ free_pv_chunk(struct pv_chunk *pc) #if 0 /* TODO: For minidump */ dump_drop_page(m->phys_addr); #endif - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/vm/uma_core.c Mon Jun 17 15:11:04 2019 (r349139) @@ -1282,9 +1282,9 @@ pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int zkva += PAGE_SIZE; } return ((void*)addr); - fail: +fail: TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) { - vm_page_unwire(p, PQ_NONE); + vm_page_unwire_noq(p); vm_page_free(p); } return (NULL); @@ -1334,7 +1334,7 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, int doma * exit. */ TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) { - vm_page_unwire(p, PQ_NONE); + vm_page_unwire_noq(p); vm_page_free(p); } return (NULL); @@ -1395,7 +1395,7 @@ pcpu_page_free(void *mem, vm_size_t size, uint8_t flag for (curva = sva; curva < sva + size; curva += PAGE_SIZE) { paddr = pmap_kextract(curva); m = PHYS_TO_VM_PAGE(paddr); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } pmap_qremove(sva, size >> PAGE_SHIFT); Modified: stable/12/sys/vm/vm_glue.c ============================================================================== --- stable/12/sys/vm/vm_glue.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/vm/vm_glue.c Mon Jun 17 15:11:04 2019 (r349139) @@ -421,7 +421,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t if (m == NULL) panic("vm_thread_dispose: kstack already missing?"); vm_page_lock(m); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); } Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Mon Jun 17 15:09:12 2019 (r349138) +++ stable/12/sys/vm/vm_kern.c Mon Jun 17 15:11:04 2019 (r349139) @@ -586,7 +586,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ #endif for (; offset < end; offset += PAGE_SIZE, m = next) { next = vm_page_next(m); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); } VM_OBJECT_WUNLOCK(object); From owner-svn-src-all@freebsd.org Mon Jun 17 15:11:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B38515BC95A; Mon, 17 Jun 2019 15:11:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9786DB57; Mon, 17 Jun 2019 15:11:55 +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 890F7275BD; Mon, 17 Jun 2019 15:11:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HFBtJc046945; Mon, 17 Jun 2019 15:11:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HFBt4o046943; Mon, 17 Jun 2019 15:11:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906171511.x5HFBt4o046943@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 15:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349140 - in stable/12: sbin/devd sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: sbin/devd sys/dev/acpica X-SVN-Commit-Revision: 349140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE9786DB57 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:11:56 -0000 Author: markj Date: Mon Jun 17 15:11:54 2019 New Revision: 349140 URL: https://svnweb.freebsd.org/changeset/base/349140 Log: MFC r348459: acpi_dock(4): Notify devd(8) on dock status change. PR: 238138 Modified: stable/12/sbin/devd/devd.conf.5 stable/12/sys/dev/acpica/acpi_dock.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Mon Jun 17 15:11:04 2019 (r349139) +++ stable/12/sbin/devd/devd.conf.5 Mon Jun 17 15:11:54 2019 (r349140) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 20, 2018 +.Dd May 31, 2019 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -341,6 +341,8 @@ AC line state ($notify=0x00 is offline, 0x01 is online Button state ($notify=0x00 is power, 0x01 is sleep). .It Li CMBAT Battery events. +.It Li Dock +Dock state ($notify=0x00 is undocked, 0x01 is docked). .It Li Lid Lid state ($notify=0x00 is closed, 0x01 is open). .It Li PROCESSOR Modified: stable/12/sys/dev/acpica/acpi_dock.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_dock.c Mon Jun 17 15:11:04 2019 (r349139) +++ stable/12/sys/dev/acpica/acpi_dock.c Mon Jun 17 15:11:54 2019 (r349140) @@ -256,11 +256,13 @@ acpi_dock_insert_children(device_t dev) static void acpi_dock_insert(device_t dev) { - struct acpi_dock_softc *sc; + struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); if (sc->status == ACPI_DOCK_STATUS_UNDOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { @@ -270,8 +272,12 @@ acpi_dock_insert(device_t dev) return; } - if (!cold) + if (!cold) { acpi_dock_insert_children(dev); + + acpi_UserNotify("Dock", h, 1); + } + sc->status = ACPI_DOCK_STATUS_DOCKED; } } @@ -325,10 +331,13 @@ static void acpi_dock_removal(device_t dev) { struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); + if (sc->status == ACPI_DOCK_STATUS_DOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { acpi_dock_eject_children(dev); @@ -342,6 +351,8 @@ acpi_dock_removal(device_t dev) return; } + acpi_UserNotify("Dock", h, 0); + sc->status = ACPI_DOCK_STATUS_UNDOCKED; } @@ -534,4 +545,3 @@ static devclass_t acpi_dock_devclass; DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0); MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1); - From owner-svn-src-all@freebsd.org Mon Jun 17 15:13:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7922915BCA1D; Mon, 17 Jun 2019 15:13:16 +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 29B5E6DD35; Mon, 17 Jun 2019 15:13:16 +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 F3FA027600; Mon, 17 Jun 2019 15:13:15 +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 x5HFDFp3051158; Mon, 17 Jun 2019 15:13:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HFDFTS051155; Mon, 17 Jun 2019 15:13:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906171513.x5HFDFTS051155@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 15:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349141 - in stable/12: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 349141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29B5E6DD35 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:13:16 -0000 Author: markj Date: Mon Jun 17 15:13:15 2019 New Revision: 349141 URL: https://svnweb.freebsd.org/changeset/base/349141 Log: MFC r347949, r347955: Implement the M_NEXTFIT allocation strategy for vmem(9). Modified: stable/12/share/man/man9/vmem.9 stable/12/sys/kern/subr_vmem.c stable/12/sys/sys/malloc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/vmem.9 ============================================================================== --- stable/12/share/man/man9/vmem.9 Mon Jun 17 15:11:54 2019 (r349140) +++ stable/12/share/man/man9/vmem.9 Mon Jun 17 15:13:15 2019 (r349141) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" ------------------------------------------------------------ -.Dd July 12, 2013 +.Dd May 17, 2019 .Dt VMEM 9 .Os .\" ------------------------------------------------------------ @@ -95,18 +95,9 @@ The smallest unit of allocation. The largest size of allocations which can be served by quantum cache. It is merely a hint and can be ignored. .It Fa flags -Combination of .Xr malloc 9 -wait flag and -.Nm -allocation strategy flag: -.Bl -tag -width M_FIRSTFIT -.It Dv M_FIRSTFIT -Prefer allocation performance. -.It Dv M_BESTFIT -Prefer space efficiency. +wait flag. .El -.El .Pp .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .Fn vmem_add @@ -169,10 +160,16 @@ if the caller does not care. A bitwise OR of an allocation strategy and a .Xr malloc 9 wait flag. -The allocation strategy is one of -.Dv M_FIRSTFIT -and -.Dv M_BESTFIT . +The allocation strategy is one of: +.Bl -tag width indent +.It Dv M_FIRSTFIT +Prefer allocation performance. +.It Dv M_BESTFIT +Prefer space efficiency. +.It Dv M_NEXTFIT +Perform an address-ordered search for free addresses, beginning where +the previous search ended. +.El .It Fa addrp On success, if .Fa addrp Modified: stable/12/sys/kern/subr_vmem.c ============================================================================== --- stable/12/sys/kern/subr_vmem.c Mon Jun 17 15:11:54 2019 (r349140) +++ stable/12/sys/kern/subr_vmem.c Mon Jun 17 15:13:15 2019 (r349141) @@ -89,10 +89,10 @@ int vmem_startup_count(void); #define VMEM_QCACHE_IDX_MAX 16 -#define VMEM_FITMASK (M_BESTFIT | M_FIRSTFIT) +#define VMEM_FITMASK (M_BESTFIT | M_FIRSTFIT | M_NEXTFIT) -#define VMEM_FLAGS \ - (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM | M_BESTFIT | M_FIRSTFIT) +#define VMEM_FLAGS (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM | \ + M_BESTFIT | M_FIRSTFIT | M_NEXTFIT) #define BT_FLAGS (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM) @@ -120,6 +120,20 @@ typedef struct qcache qcache_t; #define VMEM_NAME_MAX 16 +/* boundary tag */ +struct vmem_btag { + TAILQ_ENTRY(vmem_btag) bt_seglist; + union { + LIST_ENTRY(vmem_btag) u_freelist; /* BT_TYPE_FREE */ + LIST_ENTRY(vmem_btag) u_hashlist; /* BT_TYPE_BUSY */ + } bt_u; +#define bt_hashlist bt_u.u_hashlist +#define bt_freelist bt_u.u_freelist + vmem_addr_t bt_start; + vmem_size_t bt_size; + int bt_type; +}; + /* vmem arena */ struct vmem { struct mtx_padalign vm_lock; @@ -145,6 +159,7 @@ struct vmem { vmem_size_t vm_inuse; vmem_size_t vm_size; vmem_size_t vm_limit; + struct vmem_btag vm_cursor; /* Used on import. */ vmem_import_t *vm_importfn; @@ -158,24 +173,11 @@ struct vmem { qcache_t vm_qcache[VMEM_QCACHE_IDX_MAX]; }; -/* boundary tag */ -struct vmem_btag { - TAILQ_ENTRY(vmem_btag) bt_seglist; - union { - LIST_ENTRY(vmem_btag) u_freelist; /* BT_TYPE_FREE */ - LIST_ENTRY(vmem_btag) u_hashlist; /* BT_TYPE_BUSY */ - } bt_u; -#define bt_hashlist bt_u.u_hashlist -#define bt_freelist bt_u.u_freelist - vmem_addr_t bt_start; - vmem_size_t bt_size; - int bt_type; -}; - #define BT_TYPE_SPAN 1 /* Allocated from importfn */ #define BT_TYPE_SPAN_STATIC 2 /* vmem_add() or create. */ #define BT_TYPE_FREE 3 /* Available space. */ #define BT_TYPE_BUSY 4 /* Used space. */ +#define BT_TYPE_CURSOR 5 /* Cursor for nextfit allocations. */ #define BT_ISSPAN_P(bt) ((bt)->bt_type <= BT_TYPE_SPAN_STATIC) #define BT_END(bt) ((bt)->bt_start + (bt)->bt_size - 1) @@ -990,6 +992,162 @@ vmem_clip(vmem_t *vm, bt_t *bt, vmem_addr_t start, vme MPASS(bt->bt_size >= size); } +static int +vmem_try_fetch(vmem_t *vm, const vmem_size_t size, vmem_size_t align, int flags) +{ + vmem_size_t avail; + + VMEM_ASSERT_LOCKED(vm); + + /* + * XXX it is possible to fail to meet xalloc constraints with the + * imported region. It is up to the user to specify the + * import quantum such that it can satisfy any allocation. + */ + if (vmem_import(vm, size, align, flags) == 0) + return (1); + + /* + * Try to free some space from the quantum cache or reclaim + * functions if available. + */ + if (vm->vm_qcache_max != 0 || vm->vm_reclaimfn != NULL) { + avail = vm->vm_size - vm->vm_inuse; + VMEM_UNLOCK(vm); + if (vm->vm_qcache_max != 0) + qc_drain(vm); + if (vm->vm_reclaimfn != NULL) + vm->vm_reclaimfn(vm, flags); + VMEM_LOCK(vm); + /* If we were successful retry even NOWAIT. */ + if (vm->vm_size - vm->vm_inuse > avail) + return (1); + } + if ((flags & M_NOWAIT) != 0) + return (0); + VMEM_CONDVAR_WAIT(vm); + return (1); +} + +static int +vmem_try_release(vmem_t *vm, struct vmem_btag *bt, const bool remfree) +{ + struct vmem_btag *prev; + + MPASS(bt->bt_type == BT_TYPE_FREE); + + if (vm->vm_releasefn == NULL) + return (0); + + prev = TAILQ_PREV(bt, vmem_seglist, bt_seglist); + MPASS(prev != NULL); + MPASS(prev->bt_type != BT_TYPE_FREE); + + if (prev->bt_type == BT_TYPE_SPAN && prev->bt_size == bt->bt_size) { + vmem_addr_t spanaddr; + vmem_size_t spansize; + + MPASS(prev->bt_start == bt->bt_start); + spanaddr = prev->bt_start; + spansize = prev->bt_size; + if (remfree) + bt_remfree(vm, bt); + bt_remseg(vm, bt); + bt_remseg(vm, prev); + vm->vm_size -= spansize; + VMEM_CONDVAR_BROADCAST(vm); + bt_freetrim(vm, BT_MAXFREE); + vm->vm_releasefn(vm->vm_arg, spanaddr, spansize); + return (1); + } + return (0); +} + +static int +vmem_xalloc_nextfit(vmem_t *vm, const vmem_size_t size, vmem_size_t align, + const vmem_size_t phase, const vmem_size_t nocross, int flags, + vmem_addr_t *addrp) +{ + struct vmem_btag *bt, *cursor, *next, *prev; + int error; + + error = ENOMEM; + VMEM_LOCK(vm); +retry: + /* + * Make sure we have enough tags to complete the operation. + */ + if (vm->vm_nfreetags < BT_MAXALLOC && bt_fill(vm, flags) != 0) + goto out; + + /* + * Find the next free tag meeting our constraints. If one is found, + * perform the allocation. + */ + for (cursor = &vm->vm_cursor, bt = TAILQ_NEXT(cursor, bt_seglist); + bt != cursor; bt = TAILQ_NEXT(bt, bt_seglist)) { + if (bt == NULL) + bt = TAILQ_FIRST(&vm->vm_seglist); + if (bt->bt_type == BT_TYPE_FREE && bt->bt_size >= size && + (error = vmem_fit(bt, size, align, phase, nocross, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, addrp)) == 0) { + vmem_clip(vm, bt, *addrp, size); + break; + } + } + + /* + * Try to coalesce free segments around the cursor. If we succeed, and + * have not yet satisfied the allocation request, try again with the + * newly coalesced segment. + */ + if ((next = TAILQ_NEXT(cursor, bt_seglist)) != NULL && + (prev = TAILQ_PREV(cursor, vmem_seglist, bt_seglist)) != NULL && + next->bt_type == BT_TYPE_FREE && prev->bt_type == BT_TYPE_FREE && + prev->bt_start + prev->bt_size == next->bt_start) { + prev->bt_size += next->bt_size; + bt_remfree(vm, next); + bt_remseg(vm, next); + + /* + * The coalesced segment might be able to satisfy our request. + * If not, we might need to release it from the arena. + */ + if (error == ENOMEM && prev->bt_size >= size && + (error = vmem_fit(prev, size, align, phase, nocross, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, addrp)) == 0) { + vmem_clip(vm, prev, *addrp, size); + bt = prev; + } else + (void)vmem_try_release(vm, prev, true); + } + + /* + * If the allocation was successful, advance the cursor. + */ + if (error == 0) { + TAILQ_REMOVE(&vm->vm_seglist, cursor, bt_seglist); + for (; bt != NULL && bt->bt_start < *addrp + size; + bt = TAILQ_NEXT(bt, bt_seglist)) + ; + if (bt != NULL) + TAILQ_INSERT_BEFORE(bt, cursor, bt_seglist); + else + TAILQ_INSERT_HEAD(&vm->vm_seglist, cursor, bt_seglist); + } + + /* + * Attempt to bring additional resources into the arena. If that fails + * and M_WAITOK is specified, sleep waiting for resources to be freed. + */ + if (error == ENOMEM && vmem_try_fetch(vm, size, align, flags)) + goto retry; + +out: + VMEM_UNLOCK(vm); + return (error); +} + /* ---- vmem API */ void @@ -1051,9 +1209,13 @@ vmem_init(vmem_t *vm, const char *name, vmem_addr_t ba qc_init(vm, qcache_max); TAILQ_INIT(&vm->vm_seglist); - for (i = 0; i < VMEM_MAXORDER; i++) { + vm->vm_cursor.bt_start = vm->vm_cursor.bt_size = 0; + vm->vm_cursor.bt_type = BT_TYPE_CURSOR; + TAILQ_INSERT_TAIL(&vm->vm_seglist, &vm->vm_cursor, bt_seglist); + + for (i = 0; i < VMEM_MAXORDER; i++) LIST_INIT(&vm->vm_freelist[i]); - } + memset(&vm->vm_hash0, 0, sizeof(vm->vm_hash0)); vm->vm_hashsize = VMEM_HASHSIZE_MIN; vm->vm_hashlist = vm->vm_hash0; @@ -1120,7 +1282,7 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vm flags &= VMEM_FLAGS; MPASS(size > 0); - MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT); + MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT || strat == M_NEXTFIT); if ((flags & M_NOWAIT) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_alloc"); @@ -1151,7 +1313,6 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ struct vmem_freelist *list; struct vmem_freelist *first; struct vmem_freelist *end; - vmem_size_t avail; bt_t *bt; int error; int strat; @@ -1160,7 +1321,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ strat = flags & VMEM_FITMASK; MPASS(size0 > 0); MPASS(size > 0); - MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT); + MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT || strat == M_NEXTFIT); MPASS((flags & (M_NOWAIT|M_WAITOK)) != (M_NOWAIT|M_WAITOK)); if ((flags & M_NOWAIT) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_xalloc"); @@ -1173,11 +1334,20 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ MPASS(nocross == 0 || nocross >= size); MPASS(minaddr <= maxaddr); MPASS(!VMEM_CROSS_P(phase, phase + size - 1, nocross)); + if (strat == M_NEXTFIT) + MPASS(minaddr == VMEM_ADDR_MIN && maxaddr == VMEM_ADDR_MAX); if (align == 0) align = vm->vm_quantum_mask + 1; - *addrp = 0; + + /* + * Next-fit allocations don't use the freelists. + */ + if (strat == M_NEXTFIT) + return (vmem_xalloc_nextfit(vm, size0, align, phase, nocross, + flags, addrp)); + end = &vm->vm_freelist[VMEM_MAXORDER]; /* * choose a free block from which we allocate. @@ -1194,6 +1364,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ error = ENOMEM; break; } + /* * Scan freelists looking for a tag that satisfies the * allocation. If we're doing BESTFIT we may encounter @@ -1215,6 +1386,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ break; } } + /* * Retry if the fast algorithm failed. */ @@ -1223,35 +1395,16 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ first = bt_freehead_toalloc(vm, size, strat); continue; } - /* - * XXX it is possible to fail to meet restrictions with the - * imported region. It is up to the user to specify the - * import quantum such that it can satisfy any allocation. - */ - if (vmem_import(vm, size, align, flags) == 0) - continue; /* - * Try to free some space from the quantum cache or reclaim - * functions if available. + * Try a few measures to bring additional resources into the + * arena. If all else fails, we will sleep waiting for + * resources to be freed. */ - if (vm->vm_qcache_max != 0 || vm->vm_reclaimfn != NULL) { - avail = vm->vm_size - vm->vm_inuse; - VMEM_UNLOCK(vm); - if (vm->vm_qcache_max != 0) - qc_drain(vm); - if (vm->vm_reclaimfn != NULL) - vm->vm_reclaimfn(vm, flags); - VMEM_LOCK(vm); - /* If we were successful retry even NOWAIT. */ - if (vm->vm_size - vm->vm_inuse > avail) - continue; - } - if ((flags & M_NOWAIT) != 0) { + if (!vmem_try_fetch(vm, size, align, flags)) { error = ENOMEM; break; } - VMEM_CONDVAR_WAIT(vm); } out: VMEM_UNLOCK(vm); @@ -1313,24 +1466,7 @@ vmem_xfree(vmem_t *vm, vmem_addr_t addr, vmem_size_t s bt_remseg(vm, t); } - t = TAILQ_PREV(bt, vmem_seglist, bt_seglist); - MPASS(t != NULL); - MPASS(BT_ISSPAN_P(t) || t->bt_type == BT_TYPE_BUSY); - if (vm->vm_releasefn != NULL && t->bt_type == BT_TYPE_SPAN && - t->bt_size == bt->bt_size) { - vmem_addr_t spanaddr; - vmem_size_t spansize; - - MPASS(t->bt_start == bt->bt_start); - spanaddr = bt->bt_start; - spansize = bt->bt_size; - bt_remseg(vm, bt); - bt_remseg(vm, t); - vm->vm_size -= spansize; - VMEM_CONDVAR_BROADCAST(vm); - bt_freetrim(vm, BT_MAXFREE); - (*vm->vm_releasefn)(vm->vm_arg, spanaddr, spansize); - } else { + if (!vmem_try_release(vm, bt, false)) { bt_insfree(vm, bt); VMEM_CONDVAR_BROADCAST(vm); bt_freetrim(vm, BT_MAXFREE); @@ -1409,6 +1545,8 @@ bt_type_string(int type) return "span"; case BT_TYPE_SPAN_STATIC: return "static span"; + case BT_TYPE_CURSOR: + return "cursor"; default: break; } @@ -1600,8 +1738,18 @@ vmem_check_sanity(vmem_t *vm) } } TAILQ_FOREACH(bt, &vm->vm_seglist, bt_seglist) { + if (bt->bt_type == BT_TYPE_CURSOR) { + if (bt->bt_start != 0 || bt->bt_size != 0) { + printf("corrupted cursor\n"); + return false; + } + continue; + } TAILQ_FOREACH(bt2, &vm->vm_seglist, bt_seglist) { if (bt == bt2) { + continue; + } + if (bt2->bt_type == BT_TYPE_CURSOR) { continue; } if (BT_ISSPAN_P(bt) != BT_ISSPAN_P(bt2)) { Modified: stable/12/sys/sys/malloc.h ============================================================================== --- stable/12/sys/sys/malloc.h Mon Jun 17 15:11:54 2019 (r349140) +++ stable/12/sys/sys/malloc.h Mon Jun 17 15:13:15 2019 (r349141) @@ -57,9 +57,10 @@ #define M_NOVM 0x0200 /* don't ask VM for pages */ #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ #define M_NODUMP 0x0800 /* don't dump pages in this allocation */ -#define M_FIRSTFIT 0x1000 /* Only for vmem, fast fit. */ -#define M_BESTFIT 0x2000 /* Only for vmem, low fragmentation. */ -#define M_EXEC 0x4000 /* allocate executable space. */ +#define M_FIRSTFIT 0x1000 /* only for vmem, fast fit */ +#define M_BESTFIT 0x2000 /* only for vmem, low fragmentation */ +#define M_EXEC 0x4000 /* allocate executable space */ +#define M_NEXTFIT 0x8000 /* only for vmem, follow cursor */ #define M_MAGIC 877983977 /* time when first defined :-) */ From owner-svn-src-all@freebsd.org Mon Jun 17 15:14:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0FA15BCAB9; Mon, 17 Jun 2019 15:14:27 +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 84FA86DEAD; Mon, 17 Jun 2019 15:14:27 +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 5D84A27614; Mon, 17 Jun 2019 15:14:27 +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 x5HFERav051258; Mon, 17 Jun 2019 15:14:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HFERum051257; Mon, 17 Jun 2019 15:14:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906171514.x5HFERum051257@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 15:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349142 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 349142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84FA86DEAD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 15:14:28 -0000 Author: markj Date: Mon Jun 17 15:14:26 2019 New Revision: 349142 URL: https://svnweb.freebsd.org/changeset/base/349142 Log: MFC r347950: Use M_NEXTFIT in memguard(9). Modified: stable/12/sys/vm/memguard.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/memguard.c ============================================================================== --- stable/12/sys/vm/memguard.c Mon Jun 17 15:13:15 2019 (r349141) +++ stable/12/sys/vm/memguard.c Mon Jun 17 15:14:26 2019 (r349142) @@ -102,26 +102,29 @@ SYSCTL_PROC(_vm_memguard, OID_AUTO, desc, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, memguard_sysctl_desc, "A", "Short description of memory type to monitor"); -static vm_offset_t memguard_cursor; +static int +memguard_sysctl_mapused(SYSCTL_HANDLER_ARGS) +{ + vmem_size_t size; + + size = vmem_size(memguard_arena, VMEM_ALLOC); + return (sysctl_handle_long(oidp, &size, sizeof(size), req)); +} + static vm_offset_t memguard_base; static vm_size_t memguard_mapsize; static vm_size_t memguard_physlimit; static u_long memguard_wasted; -static u_long memguard_wrap; static u_long memguard_succ; static u_long memguard_fail_kva; static u_long memguard_fail_pgs; -SYSCTL_ULONG(_vm_memguard, OID_AUTO, cursor, CTLFLAG_RD, - &memguard_cursor, 0, "MemGuard cursor"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, mapsize, CTLFLAG_RD, &memguard_mapsize, 0, "MemGuard private arena size"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, phys_limit, CTLFLAG_RD, &memguard_physlimit, 0, "Limit on MemGuard memory consumption"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, wasted, CTLFLAG_RD, &memguard_wasted, 0, "Excess memory used through page promotion"); -SYSCTL_ULONG(_vm_memguard, OID_AUTO, wrapcnt, CTLFLAG_RD, - &memguard_wrap, 0, "MemGuard cursor wrap count"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, numalloc, CTLFLAG_RD, &memguard_succ, 0, "Count of successful MemGuard allocations"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, fail_kva, CTLFLAG_RD, @@ -157,7 +160,7 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, frequency_hits, C /* * Return a fudged value to be used for vm_kmem_size for allocating - * the kernel_arena. The memguard memory will be a submap. + * the kernel_arena. */ unsigned long memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) @@ -199,7 +202,8 @@ memguard_fudge(unsigned long km_size, const struct vm_ /* * Initialize the MemGuard mock allocator. All objects from MemGuard come - * out of a single VM map (contiguous chunk of address space). + * out of a single contiguous chunk of kernel address space that is managed + * by a vmem arena. */ void memguard_init(vmem_t *parent) @@ -209,7 +213,6 @@ memguard_init(vmem_t *parent) vmem_alloc(parent, memguard_mapsize, M_BESTFIT | M_WAITOK, &base); vmem_init(memguard_arena, "memguard arena", base, memguard_mapsize, PAGE_SIZE, 0, M_WAITOK); - memguard_cursor = base; memguard_base = base; printf("MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:\n"); @@ -227,15 +230,15 @@ memguard_sysinit(void) struct sysctl_oid_list *parent; parent = SYSCTL_STATIC_CHILDREN(_vm_memguard); - - SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "mapstart", CTLFLAG_RD, - &memguard_base, "MemGuard KVA base"); - SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "maplimit", CTLFLAG_RD, - &memguard_mapsize, "MemGuard KVA size"); -#if 0 - SYSCTL_ADD_ULONG(NULL, parent, OID_AUTO, "mapused", CTLFLAG_RD, - &memguard_map->size, "MemGuard KVA used"); -#endif + SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "mapstart", + CTLFLAG_RD, &memguard_base, + "MemGuard KVA base"); + SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "maplimit", + CTLFLAG_RD, &memguard_mapsize, + "MemGuard KVA size"); + SYSCTL_ADD_PROC(NULL, parent, OID_AUTO, "mapused", + CTLFLAG_RD | CTLTYPE_ULONG, NULL, 0, memguard_sysctl_mapused, "LU", + "MemGuard KVA used"); } SYSINIT(memguard, SI_SUB_KLD, SI_ORDER_ANY, memguard_sysinit, NULL); @@ -288,17 +291,16 @@ memguard_alloc(unsigned long req_size, int flags) { vm_offset_t addr, origaddr; u_long size_p, size_v; - int do_guard, rv; + int do_guard, error, rv; size_p = round_page(req_size); if (size_p == 0) return (NULL); + /* * To ensure there are holes on both sides of the allocation, - * request 2 extra pages of KVA. We will only actually add a - * vm_map_entry and get pages for the original request. Save - * the value of memguard_options so we have a consistent - * value. + * request 2 extra pages of KVA. Save the value of memguard_options + * so that we use a consistent value throughout this function. */ size_v = size_p; do_guard = (memguard_options & MG_GUARD_AROUND) != 0; @@ -317,33 +319,17 @@ memguard_alloc(unsigned long req_size, int flags) memguard_fail_pgs++; goto out; } + /* - * Keep a moving cursor so we don't recycle KVA as long as - * possible. It's not perfect, since we don't know in what - * order previous allocations will be free'd, but it's simple - * and fast, and requires O(1) additional storage if guard - * pages are not used. - * - * XXX This scheme will lead to greater fragmentation of the - * map, unless vm_map_findspace() is tweaked. + * Attempt to avoid address reuse for as long as possible, to increase + * the likelihood of catching a use-after-free. */ - for (;;) { - if (vmem_xalloc(memguard_arena, size_v, 0, 0, 0, - memguard_cursor, VMEM_ADDR_MAX, - M_BESTFIT | M_NOWAIT, &origaddr) == 0) - break; - /* - * The map has no space. This may be due to - * fragmentation, or because the cursor is near the - * end of the map. - */ - if (memguard_cursor == memguard_base) { - memguard_fail_kva++; - addr = (vm_offset_t)NULL; - goto out; - } - memguard_wrap++; - memguard_cursor = memguard_base; + error = vmem_alloc(memguard_arena, size_v, M_NEXTFIT | M_NOWAIT, + &origaddr); + if (error != 0) { + memguard_fail_kva++; + addr = (vm_offset_t)NULL; + goto out; } addr = origaddr; if (do_guard) @@ -355,7 +341,6 @@ memguard_alloc(unsigned long req_size, int flags) addr = (vm_offset_t)NULL; goto out; } - memguard_cursor = addr + size_v; *v2sizep(trunc_page(addr)) = req_size; *v2sizev(trunc_page(addr)) = size_v; memguard_succ++; From owner-svn-src-all@freebsd.org Mon Jun 17 15:51:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 16:26:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 16:43:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 16:50:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 16:54:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 16:57:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 17:28:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 17:35:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 17:37:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 17:42:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 17:47:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 607C415C0C7C for ; Mon, 17 Jun 2019 17:47:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 F13AF746B0 for ; Mon, 17 Jun 2019 17:47:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x831.google.com with SMTP id p15so11788123qtl.3 for ; Mon, 17 Jun 2019 10:47:10 -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=kchi/ZhwAjaO0RGy8BBW9S2PerMi+cDB1ZhDKB/1WtlWTpMgUuUvd3FpI6QahGYR2G Q/vgh3Ngm04fB3fqeLkTHv/KCkYU23TC2g4DXcLnwxFwoaHLymyP1WOnj5EwytrW8bp0 XsCZuCwhR6s/KJtVOhfcSZ2Y0iWAYJ9sGWjmVZ+w+Ed3tg9EN9fYizfhfmeeNwwjVbMf dFtMf60veGxOGvjR1hxjetq8oSHazn/zadkJO+JFmSETve5u1oWSnc9jdYRHoGtdruTE Rgxd7S7RCUVAIOrG1RYd9YaB70CK/+j3tNwC2E792fQ6wkVMihsZuHuSJQozjgz8XX2e XHCg== X-Gm-Message-State: APjAAAW1vHXMaVvPGBs8DUa2KlwC7kGuBZewKACVDkYjFPl/FVVXRBoN uSzX6rMEXtItS4yZ/5ZbNHg+r17Ixxv3Pwcu0J6otFWACAk= 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: F13AF746B0 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 19:49:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 20:10:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 20:11:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 20:29:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 21:31:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC0315C4F5A; Mon, 17 Jun 2019 21:31:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 720128355B; Mon, 17 Jun 2019 21:31:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D65F396E; Mon, 17 Jun 2019 21:31:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5HLVS0D045559; Mon, 17 Jun 2019 21:31:28 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5HLVS65045558; Mon, 17 Jun 2019 21:31:28 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201906172131.x5HLVS65045558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 17 Jun 2019 21:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349155 - stable/12/sbin/dump X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sbin/dump X-SVN-Commit-Revision: 349155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 720128355B 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2019 21:31:29 -0000 Author: mckusick Date: Mon Jun 17 21:31:27 2019 New Revision: 349155 URL: https://svnweb.freebsd.org/changeset/base/349155 Log: MFC of 349032 Clarify -r and -R only usable for level 0 dumps. Modified: stable/12/sbin/dump/dump.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dump/dump.8 ============================================================================== --- stable/12/sbin/dump/dump.8 Mon Jun 17 20:29:13 2019 (r349154) +++ stable/12/sbin/dump/dump.8 Mon Jun 17 21:31:27 2019 (r349155) @@ -29,7 +29,7 @@ .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd June 11, 2018 +.Dd June 13, 2019 .Dt DUMP 8 .Os .Sh NAME @@ -266,6 +266,12 @@ used to update a remote copy of a level 0 dump, since the date changes for each dump. This option sets both dates to the epoch, permitting rsync to be much more efficient when transferring a dump file. +The +.Fl r +option can be used only to create level 0 dumps. +A dump using the +.Fl r +option cannot be used as the basis for a later incremental dump. .It Fl R Be even more rsync-friendly. This option disables the storage of the actual inode access time @@ -277,6 +283,12 @@ The .Fl R option also sets .Fl r . +The +.Fl R +option can be used only to create level 0 dumps. +A dump using the +.Fl R +option cannot be used as the basis for a later incremental dump. .It Fl S Display an estimate of the backup size and the number of tapes required, and exit without actually performing the dump. From owner-svn-src-all@freebsd.org Mon Jun 17 21:38:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 21:46:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 22:53:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Jun 17 23:03:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Tue Jun 18 00:08:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2BAB15C7EFE; Tue, 18 Jun 2019 00:08:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76F9A88256; Tue, 18 Jun 2019 00:08:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4572053CB; Tue, 18 Jun 2019 00:08:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5I08496027438; Tue, 18 Jun 2019 00:08:04 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5I083aR027433; Tue, 18 Jun 2019 00:08:03 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201906180008.x5I083aR027433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 18 Jun 2019 00:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349163 - stable/11/sys/dev/ixl X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/dev/ixl X-SVN-Commit-Revision: 349163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76F9A88256 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.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 00:08:05 -0000 Author: erj Date: Tue Jun 18 00:08:02 2019 New Revision: 349163 URL: https://svnweb.freebsd.org/changeset/base/349163 Log: ixl(4)/ixlv(4): Update Intel XL710 PF and VF drivers to ixl-1.11.9 and ixlv-1.5.8 Update the legacy (non-iflib) drivers in stable/11 with recent changes from the Intel out-of-tree version. Major changes: - Support for new BASE-T device with additional link speeds (2.5G and 5G) and EEE - Additional I2C access methods backported from ixl-iflib - FW LLDP Agent control with sysctl added for X722 devices (this already existed for 710 devices) - MAC/VLAN filters handling has been refactored - Building and loading if_ixlv as a KLD has been fixed This is not a MFC since the driver in 12/13 uses iflib, and the decision was made to not use it in FreeBSD 11 releases. Submitted by: Krzysztof Galazka Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20290 Modified: stable/11/sys/dev/ixl/i40e_adminq.c stable/11/sys/dev/ixl/i40e_adminq.h stable/11/sys/dev/ixl/i40e_adminq_cmd.h stable/11/sys/dev/ixl/i40e_alloc.h stable/11/sys/dev/ixl/i40e_common.c stable/11/sys/dev/ixl/i40e_dcb.c stable/11/sys/dev/ixl/i40e_dcb.h stable/11/sys/dev/ixl/i40e_devids.h stable/11/sys/dev/ixl/i40e_hmc.c stable/11/sys/dev/ixl/i40e_hmc.h stable/11/sys/dev/ixl/i40e_lan_hmc.c stable/11/sys/dev/ixl/i40e_lan_hmc.h stable/11/sys/dev/ixl/i40e_nvm.c stable/11/sys/dev/ixl/i40e_osdep.c stable/11/sys/dev/ixl/i40e_osdep.h stable/11/sys/dev/ixl/i40e_prototype.h stable/11/sys/dev/ixl/i40e_register.h stable/11/sys/dev/ixl/i40e_status.h stable/11/sys/dev/ixl/i40e_type.h stable/11/sys/dev/ixl/if_ixl.c stable/11/sys/dev/ixl/if_ixlv.c stable/11/sys/dev/ixl/ixl.h stable/11/sys/dev/ixl/ixl_iw.c stable/11/sys/dev/ixl/ixl_iw.h stable/11/sys/dev/ixl/ixl_iw_int.h stable/11/sys/dev/ixl/ixl_pf.h stable/11/sys/dev/ixl/ixl_pf_i2c.c stable/11/sys/dev/ixl/ixl_pf_iov.c stable/11/sys/dev/ixl/ixl_pf_iov.h stable/11/sys/dev/ixl/ixl_pf_main.c stable/11/sys/dev/ixl/ixl_pf_qmgr.c stable/11/sys/dev/ixl/ixl_pf_qmgr.h stable/11/sys/dev/ixl/ixl_txrx.c stable/11/sys/dev/ixl/ixlv.h stable/11/sys/dev/ixl/ixlv_vc_mgr.h stable/11/sys/dev/ixl/ixlvc.c stable/11/sys/dev/ixl/virtchnl.h Modified: stable/11/sys/dev/ixl/i40e_adminq.c ============================================================================== --- stable/11/sys/dev/ixl/i40e_adminq.c Mon Jun 17 23:34:11 2019 (r349162) +++ stable/11/sys/dev/ixl/i40e_adminq.c Tue Jun 18 00:08:02 2019 (r349163) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -125,6 +125,7 @@ enum i40e_status_code i40e_alloc_adminq_arq_ring(struc **/ void i40e_free_adminq_asq(struct i40e_hw *hw) { + i40e_free_virt_mem(hw, &hw->aq.asq.cmd_buf); i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); } @@ -404,7 +405,7 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw /* initialize base registers */ ret_code = i40e_config_asq_regs(hw); if (ret_code != I40E_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.asq.count = hw->aq.num_asq_entries; @@ -412,7 +413,11 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw init_adminq_free_rings: i40e_free_adminq_asq(hw); + return ret_code; +init_config_regs: + i40e_free_asq_bufs(hw); + init_adminq_exit: return ret_code; } @@ -575,21 +580,22 @@ static void i40e_resume_aq(struct i40e_hw *hw) **/ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { + struct i40e_adminq_info *aq = &hw->aq; + enum i40e_status_code ret_code; u16 cfg_ptr, oem_hi, oem_lo; u16 eetrack_lo, eetrack_hi; - enum i40e_status_code ret_code; int retry = 0; /* verify input for valid configuration */ - if ((hw->aq.num_arq_entries == 0) || - (hw->aq.num_asq_entries == 0) || - (hw->aq.arq_buf_size == 0) || - (hw->aq.asq_buf_size == 0)) { + if (aq->num_arq_entries == 0 || + aq->num_asq_entries == 0 || + aq->arq_buf_size == 0 || + aq->asq_buf_size == 0) { ret_code = I40E_ERR_CONFIG; goto init_adminq_exit; } - i40e_init_spinlock(&hw->aq.asq_spinlock); - i40e_init_spinlock(&hw->aq.arq_spinlock); + i40e_init_spinlock(&aq->asq_spinlock); + i40e_init_spinlock(&aq->arq_spinlock); /* Set up register offsets */ i40e_adminq_init_regs(hw); @@ -616,11 +622,11 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw */ do { ret_code = i40e_aq_get_firmware_version(hw, - &hw->aq.fw_maj_ver, - &hw->aq.fw_min_ver, - &hw->aq.fw_build, - &hw->aq.api_maj_ver, - &hw->aq.api_min_ver, + &aq->fw_maj_ver, + &aq->fw_min_ver, + &aq->fw_build, + &aq->api_maj_ver, + &aq->api_min_ver, NULL); if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT) break; @@ -643,26 +649,43 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), &oem_lo); hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; - - /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 7))) - hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; - - if (hw->mac.type == I40E_MAC_XL710 && - hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { - hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + /* + * Some features were introduced in different FW API version + * for different MAC type. + */ + switch (hw->mac.type) { + case I40E_MAC_XL710: + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710)) { + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + /* The ability to RX (not drop) 802.1ad frames */ + hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; + } + break; + case I40E_MAC_X722: + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + /* fall through */ + default: + break; } /* Newer versions of firmware require lock when reading the NVM */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 5))) + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 5)) hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; - if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 8)) + hw->flags |= I40E_HW_FLAG_FW_LLDP_PERSISTENT; + + if (aq->api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; goto init_adminq_free_arq; } @@ -682,8 +705,8 @@ init_adminq_free_arq: init_adminq_free_asq: i40e_shutdown_asq(hw); init_adminq_destroy_spinlocks: - i40e_destroy_spinlock(&hw->aq.asq_spinlock); - i40e_destroy_spinlock(&hw->aq.arq_spinlock); + i40e_destroy_spinlock(&aq->asq_spinlock); + i40e_destroy_spinlock(&aq->arq_spinlock); init_adminq_exit: return ret_code; @@ -728,7 +751,7 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); while (rd32(hw, hw->aq.asq.head) != ntc) { - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); if (details->callback) { @@ -808,7 +831,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: head overrun at %d\n", val); - status = I40E_ERR_QUEUE_EMPTY; + status = I40E_ERR_ADMIN_QUEUE_FULL; goto asq_send_command_error; } @@ -896,7 +919,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 } /* bump the tail */ - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff, buff_size); (hw->aq.asq.next_to_use)++; @@ -942,12 +965,14 @@ enum i40e_status_code i40e_asq_send_command(struct i40 cmd_completed = TRUE; if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_OK) status = I40E_SUCCESS; + else if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_EBUSY) + status = I40E_ERR_NOT_READY; else status = I40E_ERR_ADMIN_QUEUE_ERROR; hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval; } - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer writeback:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); @@ -1063,7 +1088,7 @@ enum i40e_status_code i40e_clean_arq_element(struct i4 hw->aq.arq.r.arq_bi[desc_idx].va, e->msg_len, I40E_DMA_TO_NONDMA); - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQRX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, hw->aq.arq_buf_size); Modified: stable/11/sys/dev/ixl/i40e_adminq.h ============================================================================== --- stable/11/sys/dev/ixl/i40e_adminq.h Mon Jun 17 23:34:11 2019 (r349162) +++ stable/11/sys/dev/ixl/i40e_adminq.h Tue Jun 18 00:08:02 2019 (r349163) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Modified: stable/11/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- stable/11/sys/dev/ixl/i40e_adminq_cmd.h Mon Jun 17 23:34:11 2019 (r349162) +++ stable/11/sys/dev/ixl/i40e_adminq_cmd.h Tue Jun 18 00:08:02 2019 (r349163) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x0005 -#define I40E_FW_API_VERSION_MINOR_X710 0x0007 +#define I40E_FW_API_VERSION_MINOR_X722 0x0008 +#define I40E_FW_API_VERSION_MINOR_X710 0x0008 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -52,6 +52,8 @@ /* API version 1.7 implements additional link and PHY-specific APIs */ #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007 +/* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ +#define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006 struct i40e_aq_desc { __le16 flags; @@ -289,6 +291,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07, i40e_aqc_opc_lldp_set_local_mib = 0x0A08, i40e_aqc_opc_lldp_stop_start_spec_agent = 0x0A09, + i40e_aqc_opc_lldp_restore = 0x0A0A, /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, @@ -1782,6 +1785,8 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_25GBASE_AOC = 0x23, I40E_PHY_TYPE_25GBASE_ACC = 0x24, + I40E_PHY_TYPE_2_5GBASE_T = 0x30, + I40E_PHY_TYPE_5GBASE_T = 0x31, I40E_PHY_TYPE_MAX, I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, I40E_PHY_TYPE_EMPTY = 0xFE, @@ -1823,19 +1828,25 @@ enum i40e_aq_phy_type { BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \ - BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC)) + BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \ + BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \ + BIT_ULL(I40E_PHY_TYPE_5GBASE_T)) +#define I40E_LINK_SPEED_2_5GB_SHIFT 0x0 #define I40E_LINK_SPEED_100MB_SHIFT 0x1 #define I40E_LINK_SPEED_1000MB_SHIFT 0x2 #define I40E_LINK_SPEED_10GB_SHIFT 0x3 #define I40E_LINK_SPEED_40GB_SHIFT 0x4 #define I40E_LINK_SPEED_20GB_SHIFT 0x5 #define I40E_LINK_SPEED_25GB_SHIFT 0x6 +#define I40E_LINK_SPEED_5GB_SHIFT 0x7 enum i40e_aq_link_speed { I40E_LINK_SPEED_UNKNOWN = 0, I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT), I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT), + I40E_LINK_SPEED_2_5GB = (1 << I40E_LINK_SPEED_2_5GB_SHIFT), + I40E_LINK_SPEED_5GB = (1 << I40E_LINK_SPEED_5GB_SHIFT), I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT), I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT), I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT), @@ -1865,12 +1876,15 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_FEC_ABILITY_KR 0x40 #define I40E_AQ_PHY_FEC_ABILITY_RS 0x80 __le16 eee_capability; +#define I40E_AQ_EEE_AUTO 0x0001 #define I40E_AQ_EEE_100BASE_TX 0x0002 #define I40E_AQ_EEE_1000BASE_T 0x0004 #define I40E_AQ_EEE_10GBASE_T 0x0008 #define I40E_AQ_EEE_1000BASE_KX 0x0010 #define I40E_AQ_EEE_10GBASE_KX4 0x0020 #define I40E_AQ_EEE_10GBASE_KR 0x0040 +#define I40E_AQ_EEE_2_5GBASE_T 0x0100 +#define I40E_AQ_EEE_5GBASE_T 0x0200 __le32 eeer_val; u8 d3_lpan; #define I40E_AQ_SET_PHY_D3_LPAN_ENA 0x01 @@ -1881,6 +1895,8 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 #define I40E_AQ_PHY_TYPE_EXT_25G_AOC 0x10 #define I40E_AQ_PHY_TYPE_EXT_25G_ACC 0x20 +#define I40E_AQ_PHY_TYPE_EXT_2_5GBASE_T 0x40 +#define I40E_AQ_PHY_TYPE_EXT_5GBASE_T 0x80 u8 fec_cfg_curr_mod_ext_info; #define I40E_AQ_ENABLE_FEC_KR 0x01 #define I40E_AQ_ENABLE_FEC_RS 0x02 @@ -2122,15 +2138,29 @@ enum i40e_aq_phy_reg_type { I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3 }; +#pragma pack(1) /* Run PHY Activity (0x0626) */ struct i40e_aqc_run_phy_activity { - __le16 activity_id; - u8 flags; - u8 reserved1; - __le32 control; - __le32 data; - u8 reserved2[4]; + u8 cmd_flags; + __le16 activity_id; +#define I40E_AQ_RUN_PHY_ACTIVITY_ACTIVITY_ID_USER_DEFINED 0x10 + u8 reserved; + union { + struct { + __le32 dnl_opcode; +#define I40E_AQ_RUN_PHY_ACTIVITY_DNL_OPCODE_GET_EEE_STATISTICS 0x801b + __le32 data; + u8 reserved2[4]; + } cmd; + struct { + __le32 cmd_status; +#define I40E_AQ_RUN_PHY_ACTIVITY_CMD_STATUS_SUCCESS 0x4 + __le32 data0; + __le32 data1; + } resp; + } params; }; +#pragma pack() I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity); @@ -2142,7 +2172,9 @@ struct i40e_aqc_phy_register_access { #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 u8 dev_addres; - u8 reserved1[2]; + u8 cmd_flags; +#define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE 1 + u8 reserved1; __le32 reg_address; __le32 reg_value; u8 reserved2[4]; @@ -2157,6 +2189,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); struct i40e_aqc_nvm_update { u8 command_flags; #define I40E_AQ_NVM_LAST_CMD 0x01 +#define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 +#define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 #define I40E_AQ_NVM_FLASH_ONLY 0x80 #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 @@ -2404,18 +2438,19 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv); /* Stop LLDP (direct 0x0A05) */ struct i40e_aqc_lldp_stop { u8 command; -#define I40E_AQ_LLDP_AGENT_STOP 0x0 -#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP 0x0 +#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP_PERSIST 0x2 u8 reserved[15]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop); /* Start LLDP (direct 0x0A06) */ - struct i40e_aqc_lldp_start { u8 command; -#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START_PERSIST 0x2 u8 reserved[15]; }; @@ -2534,6 +2569,16 @@ struct i40e_aqc_lldp_stop_start_specific_agent { }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent); + +/* Restore LLDP Agent factory settings (direct 0x0A0A) */ +struct i40e_aqc_lldp_restore { + u8 command; +#define I40E_AQ_LLDP_AGENT_RESTORE_NOT 0x0 +#define I40E_AQ_LLDP_AGENT_RESTORE 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore); /* Add Udp Tunnel command and completion (direct 0x0B00) */ struct i40e_aqc_add_udp_tunnel { Modified: stable/11/sys/dev/ixl/i40e_alloc.h ============================================================================== --- stable/11/sys/dev/ixl/i40e_alloc.h Mon Jun 17 23:34:11 2019 (r349162) +++ stable/11/sys/dev/ixl/i40e_alloc.h Tue Jun 18 00:08:02 2019 (r349163) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Modified: stable/11/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/11/sys/dev/ixl/i40e_common.c Mon Jun 17 23:34:11 2019 (r349162) +++ stable/11/sys/dev/ixl/i40e_common.c Tue Jun 18 00:08:02 2019 (r349163) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,7 +37,6 @@ #include "i40e_prototype.h" #include "virtchnl.h" - /** * i40e_set_mac_type - Sets MAC type * @hw: pointer to the HW structure @@ -62,10 +61,15 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: case I40E_DEV_ID_10G_BASE_T4: + case I40E_DEV_ID_10G_BASE_T_BC: + case I40E_DEV_ID_10G_B: + case I40E_DEV_ID_10G_SFP: case I40E_DEV_ID_20G_KR2: case I40E_DEV_ID_20G_KR2_A: case I40E_DEV_ID_25G_B: case I40E_DEV_ID_25G_SFP28: + case I40E_DEV_ID_X710_N3000: + case I40E_DEV_ID_XXV710_N3000: hw->mac.type = I40E_MAC_XL710; break; case I40E_DEV_ID_KX_X722: @@ -319,32 +323,37 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug void *buffer, u16 buf_len) { struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; + u32 effective_mask = hw->debug_mask & mask; u8 *buf = (u8 *)buffer; u16 len; - u16 i = 0; + u16 i; - if ((!(mask & hw->debug_mask)) || (desc == NULL)) + if (!effective_mask || !desc) return; len = LE16_TO_CPU(aq_desc->datalen); - i40e_debug(hw, mask, + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", LE16_TO_CPU(aq_desc->opcode), LE16_TO_CPU(aq_desc->flags), LE16_TO_CPU(aq_desc->datalen), LE16_TO_CPU(aq_desc->retval)); - i40e_debug(hw, mask, "\tcookie (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tcookie (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->cookie_high), LE32_TO_CPU(aq_desc->cookie_low)); - i40e_debug(hw, mask, "\tparam (0,1) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tparam (0,1) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.internal.param0), LE32_TO_CPU(aq_desc->params.internal.param1)); - i40e_debug(hw, mask, "\taddr (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\taddr (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.external.addr_high), LE32_TO_CPU(aq_desc->params.external.addr_low)); - if ((buffer != NULL) && (aq_desc->datalen != 0)) { + if (buffer && (buf_len != 0) && (len != 0) && + (effective_mask & I40E_DEBUG_AQ_DESC_BUFFER)) { i40e_debug(hw, mask, "AQ CMD Buffer:\n"); if (buf_len < len) len = buf_len; @@ -1014,6 +1023,18 @@ enum i40e_status_code i40e_init_shared_code(struct i40 hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; + /* NVMUpdate features structure initialization */ + hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; + hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; + hw->nvmupd_features.size = sizeof(hw->nvmupd_features); + i40e_memset(hw->nvmupd_features.features, 0x0, + I40E_NVMUPD_FEATURES_API_FEATURES_ARRAY_LEN * + sizeof(*hw->nvmupd_features.features), + I40E_NONDMA_MEM); + + /* No features supported at the moment */ + hw->nvmupd_features.features[0] = 0; + status = i40e_init_nvm(hw); return status; } @@ -1235,6 +1256,8 @@ static enum i40e_media_type i40e_get_media_type(struct break; case I40E_PHY_TYPE_100BASE_TX: case I40E_PHY_TYPE_1000BASE_T: + case I40E_PHY_TYPE_2_5GBASE_T: + case I40E_PHY_TYPE_5GBASE_T: case I40E_PHY_TYPE_10GBASE_T: media = I40E_MEDIA_TYPE_BASET; break; @@ -1271,6 +1294,29 @@ static enum i40e_media_type i40e_get_media_type(struct return media; } +/** + * i40e_poll_globr - Poll for Global Reset completion + * @hw: pointer to the hardware structure + * @retry_limit: how many times to retry before failure + **/ +static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, + u32 retry_limit) +{ + u32 cnt, reg = 0; + + for (cnt = 0; cnt < retry_limit; cnt++) { + reg = rd32(hw, I40E_GLGEN_RSTAT); + if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) + return I40E_SUCCESS; + i40e_msec_delay(100); + } + + DEBUGOUT("Global reset failed.\n"); + DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg); + + return I40E_ERR_RESET_FAILED; +} + #define I40E_PF_RESET_WAIT_COUNT 200 /** * i40e_pf_reset - Reset the PF @@ -1294,7 +1340,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - grst_del = grst_del * 20; + grst_del = min(grst_del * 20, 160U); for (cnt = 0; cnt < grst_del; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); @@ -1340,14 +1386,14 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) break; reg2 = rd32(hw, I40E_GLGEN_RSTAT); - if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { - DEBUGOUT("Core reset upcoming. Skipping PF reset request.\n"); - DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg2); - return I40E_ERR_NOT_READY; - } + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) + break; i40e_msec_delay(1); } - if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { + if (i40e_poll_globr(hw, grst_del) != I40E_SUCCESS) + return I40E_ERR_RESET_FAILED; + } else if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { DEBUGOUT("PF reset polling failed to complete.\n"); return I40E_ERR_RESET_FAILED; } @@ -1511,7 +1557,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int id **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1523,27 +1568,10 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; break; } - return mode; } @@ -1558,7 +1586,6 @@ u32 i40e_led_get(struct i40e_hw *hw) **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & 0xfffffff0) @@ -1572,22 +1599,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool b if (!gpio_val) continue; - - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK; /* this & is a bit of paranoia, but serves as a range check */ gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) & @@ -1828,6 +1839,10 @@ enum i40e_status_code i40e_aq_set_mac_config(struct i4 if (crc_en) cmd->params |= I40E_AQ_SET_MAC_CONFIG_CRC_EN; +#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD 0x7FFF + cmd->fc_refresh_threshold = + CPU_TO_LE16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD); + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -1968,8 +1983,7 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40 hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; - if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= 7) { + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { __le32 tmp; i40e_memcpy(&tmp, resp->link_type, sizeof(tmp), @@ -4102,6 +4116,43 @@ i40e_aq_update_nvm_exit: } /** + * i40e_aq_rearrange_nvm + * @hw: pointer to the hw struct + * @rearrange_nvm: defines direction of rearrangement + * @cmd_details: pointer to command details structure or NULL + * + * Rearrange NVM structure, available only for transition FW + **/ +enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, + u8 rearrange_nvm, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aqc_nvm_update *cmd; + enum i40e_status_code status; + struct i40e_aq_desc desc; + + DEBUGFUNC("i40e_aq_rearrange_nvm"); + + cmd = (struct i40e_aqc_nvm_update *)&desc.params.raw; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_update); + + rearrange_nvm &= (I40E_AQ_NVM_REARRANGE_TO_FLAT | + I40E_AQ_NVM_REARRANGE_TO_STRUCT); + + if (!rearrange_nvm) { + status = I40E_ERR_PARAM; + goto i40e_aq_rearrange_nvm_exit; + } + + cmd->command_flags |= rearrange_nvm; + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + +i40e_aq_rearrange_nvm_exit: + return status; +} + +/** * i40e_aq_nvm_progress * @hw: pointer to the hw struct * @progress: pointer to progress returned from AQ @@ -4208,7 +4259,7 @@ enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e cmd->type = mib_type; cmd->length = CPU_TO_LE16(buff_size); - cmd->address_high = CPU_TO_LE32(I40E_HI_WORD((u64)buff)); + cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buff)); cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buff)); status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); @@ -4244,164 +4295,54 @@ enum i40e_status_code i40e_aq_cfg_lldp_mib_change_even } /** - * i40e_aq_add_lldp_tlv + * i40e_aq_restore_lldp * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: buffer with TLV to add - * @buff_size: length of the buffer - * @tlv_len: length of the TLV to be added - * @mib_len: length of the LLDP MIB returned in response + * @setting: pointer to factory setting variable or NULL + * @restore: True if factory settings should be restored * @cmd_details: pointer to command details structure or NULL * - * Add the specified TLV to LLDP Local MIB for the given bridge type, - * it is responsibility of the caller to make sure that the TLV is not - * already present in the LLDPDU. - * In return firmware will write the complete LLDP MIB with the newly - * added TLV in the response buffer. + * Restore LLDP Agent factory settings if @restore set to True. In other case + * only returns factory setting in AQ response. **/ -enum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type, - void *buff, u16 buff_size, u16 tlv_len, - u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) +enum i40e_status_code +i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, + struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; - struct i40e_aqc_lldp_add_tlv *cmd = - (struct i40e_aqc_lldp_add_tlv *)&desc.params.raw; + struct i40e_aqc_lldp_restore *cmd = + (struct i40e_aqc_lldp_restore *)&desc.params.raw; enum i40e_status_code status; - if (buff_size == 0 || !buff || tlv_len == 0) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_add_tlv); - - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - cmd->len = CPU_TO_LE16(tlv_len); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); + if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) { + i40e_debug(hw, I40E_DEBUG_ALL, + "Restore LLDP not supported by current FW version.\n"); + return I40E_ERR_DEVICE_NOT_SUPPORTED; } - return status; -} + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_restore); -/** - * i40e_aq_update_lldp_tlv - * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: buffer with TLV to update - * @buff_size: size of the buffer holding original and updated TLVs - * @old_len: Length of the Original TLV - * @new_len: Length of the Updated TLV - * @offset: offset of the updated TLV in the buff - * @mib_len: length of the returned LLDP MIB - * @cmd_details: pointer to command details structure or NULL - * - * Update the specified TLV to the LLDP Local MIB for the given bridge type. - * Firmware will place the complete LLDP MIB in response buffer with the - * updated TLV. - **/ -enum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw, - u8 bridge_type, void *buff, u16 buff_size, - u16 old_len, u16 new_len, u16 offset, - u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_lldp_update_tlv *cmd = - (struct i40e_aqc_lldp_update_tlv *)&desc.params.raw; - enum i40e_status_code status; + if (restore) + cmd->command |= I40E_AQ_LLDP_AGENT_RESTORE; - if (buff_size == 0 || !buff || offset == 0 || - old_len == 0 || new_len == 0) - return I40E_ERR_PARAM; + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_update_tlv); + if (setting) + *setting = cmd->command & 1; - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - cmd->old_len = CPU_TO_LE16(old_len); - cmd->new_offset = CPU_TO_LE16(offset); - cmd->new_len = CPU_TO_LE16(new_len); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); - } - return status; } /** - * i40e_aq_delete_lldp_tlv - * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: pointer to a user supplied buffer that has the TLV - * @buff_size: length of the buffer - * @tlv_len: length of the TLV to be deleted - * @mib_len: length of the returned LLDP MIB - * @cmd_details: pointer to command details structure or NULL - * - * Delete the specified TLV from LLDP Local MIB for the given bridge type. - * The firmware places the entire LLDP MIB in the response buffer. - **/ -enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw, - u8 bridge_type, void *buff, u16 buff_size, - u16 tlv_len, u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_lldp_add_tlv *cmd = - (struct i40e_aqc_lldp_add_tlv *)&desc.params.raw; - enum i40e_status_code status; - - if (buff_size == 0 || !buff) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_delete_tlv); - - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - cmd->len = CPU_TO_LE16(tlv_len); - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); - } - - return status; -} - -/** * i40e_aq_stop_lldp * @hw: pointer to the hw struct * @shutdown_agent: True if LLDP Agent needs to be Shutdown + * @persist: True if stop of LLDP should be persistent across power cycles * @cmd_details: pointer to command details structure or NULL * * Stop or Shutdown the embedded LLDP Agent **/ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, + bool persist, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -4414,6 +4355,14 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw if (shutdown_agent) cmd->command |= I40E_AQ_LLDP_AGENT_SHUTDOWN; + if (persist) { + if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) + cmd->command |= I40E_AQ_LLDP_AGENT_STOP_PERSIST; + else + i40e_debug(hw, I40E_DEBUG_ALL, + "Persistent Stop LLDP not supported by current FW version.\n"); + } + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -4422,11 +4371,13 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw /** * i40e_aq_start_lldp * @hw: pointer to the hw struct + * @persist: True if start of LLDP should be persistent across power cycles * @cmd_details: pointer to command details structure or NULL * * Start the embedded LLDP Agent on all ports. **/ enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw, + bool persist, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -4437,6 +4388,15 @@ enum i40e_status_code i40e_aq_start_lldp(struct i40e_h i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start); cmd->command = I40E_AQ_LLDP_AGENT_START; + + if (persist) { + if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) + cmd->command |= I40E_AQ_LLDP_AGENT_START_PERSIST; + else + i40e_debug(hw, I40E_DEBUG_ALL, + "Persistent Start LLDP not supported by current FW version.\n"); + } + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -4458,9 +4418,7 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dc (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw; enum i40e_status_code status; - if ((hw->mac.type != I40E_MAC_XL710) || - ((hw->aq.api_maj_ver < 1) || - ((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver < 6)))) + if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) return I40E_ERR_DEVICE_NOT_SUPPORTED; i40e_fill_default_direct_cmd_desc(&desc, @@ -6088,7 +6046,71 @@ enum i40e_status_code i40e_aq_debug_dump(struct i40e_h return status; } + /** + * i40e_enable_eee + * @hw: pointer to the hardware structure + * @enable: state of Energy Efficient Ethernet mode to be set + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 18 00:11:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 00:17:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 01:15:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 02:27:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 04:32:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 07:22:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B3A515D17DF for ; Tue, 18 Jun 2019 07:22:54 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) Received: from mm12.iaires.com (mm12.iaires.com [202.162.243.77]) by mx1.freebsd.org (Postfix) with ESMTP id DD771956AC for ; Tue, 18 Jun 2019 07:22:53 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) To: svn-src-all@freebsd.org From: Krati - trade data Reply-To: marketing@indiatradedata.com Subject: IMPORT EXPORT DATABASE Message-ID: <25668308311632121@email.indiatradedata.com> Feedback-ID: 301:14483:20190618125050:nczc MIME-Version: 1.0 Date: Tue, 18 Jun 2019 12:52:53 +0530 X-Rspamd-Queue-Id: DD771956AC X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com designates 202.162.243.77 as permitted sender) smtp.mailfrom=campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com X-Spamd-Result: default: False [6.88 / 15.00]; HAS_REPLYTO(0.00)[marketing@indiatradedata.com]; R_SPF_ALLOW(-0.20)[+ip4:202.162.224.0/19]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; MX_GOOD(-0.01)[cached: mx1.ncfp.asia]; SUBJ_ALL_CAPS(1.65)[22]; FORGED_SENDER(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:33480, ipnet:202.162.243.0/24, country:US]; FROM_NEQ_ENVFROM(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-301-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.99)[0.992,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_BAD_CTE_7BIT(1.05)[7bit,utf8]; HAS_PHPMAILER_SIG(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; FORGED_SENDER_VERP_SRS(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.998,0]; DMARC_NA(0.00)[indiatradedata.com]; NEURAL_SPAM_LONG(1.00)[1.000,0]; ENVFROM_VERP(0.00)[]; IP_SCORE(0.51)[asn: 33480(2.59), country: US(-0.06)]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 07:22:54 -0000 Hello, I would like to mention that We provides 60+ Countries Reports & track each Shipment as reported by customs and tell you Who is importing, Who is exporting, at What price, How much quantity and from Where. Database is available for Import and Export based on Custom’s actual shipping bills and details for countries like: Asia -- India, Pakistan, Sri Lanka, China, Vietnam, Indonesia, Philippines South America -- Argentina, Brazil, Columbia, Ecuador, Peru, Paraguay, Uruguay, Venezuela North America -- USA and Mexico Central America -- Panama, Costa Rica Europe -- Russia, Ukraine, CIS Countries -- Kazakhstan, Kyrgyzstan, Uzbekistan African Country -- Ethiopia, Uganda, Kenya, Tanzania, Guatemala, Burundi, Malawi, DRC Congo, Zambia, Rwanda. So basically if you are looking for Importers/Exporters List of any particular Product/Commodity then we can provide the same thru Customs Report. Charges/Format/Features of Each Country Report is different. “In case of a your requirement of any database kindly send your details :- Name, Your requirement (HS Code or product), Company name, Mail id & contact details†so that I can assist you accordingly. GOOD DAY! Thanks & Regards Krati jain Business Development Officer Dir. Mob – 8586926599,Tel. Ph. - +91-11-47048012 Ext. no. 105 Skype : krati@exportgenius.in From owner-svn-src-all@freebsd.org Tue Jun 18 14:13:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 16:29:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDAAD15C249B; Tue, 18 Jun 2019 16:29:48 +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 5484384708; Tue, 18 Jun 2019 16:29:48 +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 25975FB05; Tue, 18 Jun 2019 16:29:48 +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 x5IGTlii043957; Tue, 18 Jun 2019 16:29:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IGTknT043949; Tue, 18 Jun 2019 16:29:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906181629.x5IGTknT043949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Jun 2019 16:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349171 - stable/12/contrib/elftoolchain/libelf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 349171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5484384708 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.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 16:29:49 -0000 Author: markj Date: Tue Jun 18 16:29:46 2019 New Revision: 349171 URL: https://svnweb.freebsd.org/changeset/base/349171 Log: MFC r348652: libelf: Use a red-black tree to manage the section list. PR: 234949 Modified: stable/12/contrib/elftoolchain/libelf/_libelf.h stable/12/contrib/elftoolchain/libelf/elf_end.c stable/12/contrib/elftoolchain/libelf/elf_scn.c stable/12/contrib/elftoolchain/libelf/elf_update.c stable/12/contrib/elftoolchain/libelf/libelf_allocate.c stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c stable/12/contrib/elftoolchain/libelf/libelf_extended.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelf/_libelf.h ============================================================================== --- stable/12/contrib/elftoolchain/libelf/_libelf.h Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/_libelf.h Tue Jun 18 16:29:46 2019 (r349171) @@ -30,6 +30,7 @@ #define __LIBELF_H_ #include +#include #include "_libelf_config.h" @@ -80,6 +81,9 @@ extern struct _libelf_globals _libelf; #define LIBELF_F_SHDRS_LOADED 0x200000U /* whether all shdrs were read in */ #define LIBELF_F_SPECIAL_FILE 0x400000U /* non-regular file */ +RB_HEAD(scntree, _Elf_Scn); +RB_PROTOTYPE(scntree, _Elf_Scn, e_scn, elfscn_cmp); + struct _Elf { int e_activations; /* activation count */ unsigned int e_byteorder; /* ELFDATA* */ @@ -122,7 +126,7 @@ struct _Elf { Elf32_Phdr *e_phdr32; Elf64_Phdr *e_phdr64; } e_phdr; - STAILQ_HEAD(, _Elf_Scn) e_scn; /* section list */ + struct scntree e_scn; /* sections */ size_t e_nphdr; /* number of Phdr entries */ size_t e_nscn; /* number of sections */ size_t e_strndx; /* string table section index */ @@ -147,7 +151,7 @@ struct _Elf_Scn { } s_shdr; STAILQ_HEAD(, _Libelf_Data) s_data; /* translated data */ STAILQ_HEAD(, _Libelf_Data) s_rawdata; /* raw data */ - STAILQ_ENTRY(_Elf_Scn) s_next; + RB_ENTRY(_Elf_Scn) s_tree; struct _Elf *s_elf; /* parent ELF descriptor */ unsigned int s_flags; /* flags for the section as a whole */ size_t s_ndx; /* index# for this section */ Modified: stable/12/contrib/elftoolchain/libelf/elf_end.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/elf_end.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/elf_end.c Tue Jun 18 16:29:46 2019 (r349171) @@ -66,8 +66,7 @@ elf_end(Elf *e) /* * Reclaim all section descriptors. */ - STAILQ_FOREACH_SAFE(scn, &e->e_u.e_elf.e_scn, s_next, - tscn) + RB_FOREACH_SAFE(scn, scntree, &e->e_u.e_elf.e_scn, tscn) scn = _libelf_release_scn(scn); break; case ELF_K_NUM: Modified: stable/12/contrib/elftoolchain/libelf/elf_scn.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/elf_scn.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/elf_scn.c Tue Jun 18 16:29:46 2019 (r349171) @@ -38,6 +38,19 @@ ELFTC_VCSID("$Id: elf_scn.c 3632 2018-10-10 21:12:43Z jkoshy $"); +static int +elfscn_cmp(struct _Elf_Scn *s1, struct _Elf_Scn *s2) +{ + + if (s1->s_ndx < s2->s_ndx) + return (-1); + if (s1->s_ndx > s2->s_ndx) + return (1); + return (0); +} + +RB_GENERATE(scntree, _Elf_Scn, s_tree, elfscn_cmp); + /* * Load an ELF section table and create a list of Elf_Scn structures. */ @@ -95,9 +108,9 @@ _libelf_load_section_headers(Elf *e, void *ehdr) */ i = 0; - if (!STAILQ_EMPTY(&e->e_u.e_elf.e_scn)) { - assert(STAILQ_FIRST(&e->e_u.e_elf.e_scn) == - STAILQ_LAST(&e->e_u.e_elf.e_scn, _Elf_Scn, s_next)); + if (!RB_EMPTY(&e->e_u.e_elf.e_scn)) { + assert(RB_MIN(scntree, &e->e_u.e_elf.e_scn) == + RB_MAX(scntree, &e->e_u.e_elf.e_scn)); i = 1; src += fsz; @@ -148,10 +161,16 @@ elf_getscn(Elf *e, size_t index) _libelf_load_section_headers(e, ehdr) == 0) return (NULL); - STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) + for (s = RB_ROOT(&e->e_u.e_elf.e_scn); s != NULL;) { if (s->s_ndx == index) return (s); + if (s->s_ndx < index) + s = RB_RIGHT(s, s_tree); + else + s = RB_LEFT(s, s_tree); + } + LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } @@ -201,7 +220,7 @@ elf_newscn(Elf *e) _libelf_load_section_headers(e, ehdr) == 0) return (NULL); - if (STAILQ_EMPTY(&e->e_u.e_elf.e_scn)) { + if (RB_EMPTY(&e->e_u.e_elf.e_scn)) { assert(e->e_u.e_elf.e_nscn == 0); if ((scn = _libelf_allocate_scn(e, (size_t) SHN_UNDEF)) == NULL) @@ -231,5 +250,5 @@ elf_nextscn(Elf *e, Elf_Scn *s) } return (s == NULL ? elf_getscn(e, (size_t) 1) : - STAILQ_NEXT(s, s_next)); + RB_NEXT(scntree, &e->e_u.e_elf.e_scn, s)); } Modified: stable/12/contrib/elftoolchain/libelf/elf_update.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/elf_update.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/elf_update.c Tue Jun 18 16:29:46 2019 (r349171) @@ -452,7 +452,7 @@ _libelf_resync_sections(Elf *e, off_t rc, struct _Elf_ * Make a pass through sections, computing the extent of each * section. */ - STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) { + RB_FOREACH(s, scntree, &e->e_u.e_elf.e_scn) { if (ec == ELFCLASS32) sh_type = s->s_shdr.s_shdr32.sh_type; else @@ -980,7 +980,7 @@ _libelf_write_shdr(Elf *e, unsigned char *nf, struct _ fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, (size_t) 1); - STAILQ_FOREACH(scn, &e->e_u.e_elf.e_scn, s_next) { + RB_FOREACH(scn, scntree, &e->e_u.e_elf.e_scn) { if (ec == ELFCLASS32) src.d_buf = &scn->s_shdr.s_shdr32; else @@ -1142,7 +1142,7 @@ _libelf_write_elf(Elf *e, off_t newsize, struct _Elf_E e->e_flags &= ~ELF_F_DIRTY; - STAILQ_FOREACH_SAFE(scn, &e->e_u.e_elf.e_scn, s_next, tscn) + RB_FOREACH_SAFE(scn, scntree, &e->e_u.e_elf.e_scn, tscn) _libelf_release_scn(scn); if (e->e_class == ELFCLASS32) { Modified: stable/12/contrib/elftoolchain/libelf/libelf_allocate.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/libelf_allocate.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/libelf_allocate.c Tue Jun 18 16:29:46 2019 (r349171) @@ -76,7 +76,7 @@ _libelf_init_elf(Elf *e, Elf_Kind kind) switch (kind) { case ELF_K_ELF: - STAILQ_INIT(&e->e_u.e_elf.e_scn); + RB_INIT(&e->e_u.e_elf.e_scn); break; default: break; @@ -111,7 +111,7 @@ _libelf_release_elf(Elf *e) break; } - assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); + assert(RB_EMPTY(&e->e_u.e_elf.e_scn)); if (e->e_flags & LIBELF_F_AR_HEADER) { arh = e->e_hdr.e_arhdr; @@ -174,7 +174,7 @@ _libelf_allocate_scn(Elf *e, size_t ndx) STAILQ_INIT(&s->s_data); STAILQ_INIT(&s->s_rawdata); - STAILQ_INSERT_TAIL(&e->e_u.e_elf.e_scn, s, s_next); + RB_INSERT(scntree, &e->e_u.e_elf.e_scn, s); return (s); } @@ -202,7 +202,7 @@ _libelf_release_scn(Elf_Scn *s) assert(e != NULL); - STAILQ_REMOVE(&e->e_u.e_elf.e_scn, s, _Elf_Scn, s_next); + RB_REMOVE(scntree, &e->e_u.e_elf.e_scn, s); free(s); Modified: stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c Tue Jun 18 16:29:46 2019 (r349171) @@ -46,7 +46,7 @@ _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint32_t shtype; _libelf_translator_function *xlator; - assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); + assert(RB_EMPTY(&e->e_u.e_elf.e_scn)); fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, 1); assert(fsz > 0); Modified: stable/12/contrib/elftoolchain/libelf/libelf_extended.c ============================================================================== --- stable/12/contrib/elftoolchain/libelf/libelf_extended.c Tue Jun 18 14:13:52 2019 (r349170) +++ stable/12/contrib/elftoolchain/libelf/libelf_extended.c Tue Jun 18 16:29:46 2019 (r349171) @@ -39,7 +39,7 @@ _libelf_getscn0(Elf *e) { Elf_Scn *s; - if ((s = STAILQ_FIRST(&e->e_u.e_elf.e_scn)) != NULL) + if ((s = RB_MIN(scntree, &e->e_u.e_elf.e_scn)) != NULL) return (s); return (_libelf_allocate_scn(e, (size_t) SHN_UNDEF)); From owner-svn-src-all@freebsd.org Tue Jun 18 16:30:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E3F15C252C; Tue, 18 Jun 2019 16:30:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF12484853; Tue, 18 Jun 2019 16:30:35 +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 C400BFB11; Tue, 18 Jun 2019 16:30:35 +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 x5IGUZL3046336; Tue, 18 Jun 2019 16:30:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IGUZAm046335; Tue, 18 Jun 2019 16:30:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906181630.x5IGUZAm046335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Jun 2019 16:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349172 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 349172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF12484853 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.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 16:30:36 -0000 Author: markj Date: Tue Jun 18 16:30:35 2019 New Revision: 349172 URL: https://svnweb.freebsd.org/changeset/base/349172 Log: MFC r348654: elfcopy: Use elf_getscn() instead of iterating over all sections. PR: 234949 Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/sections.c Tue Jun 18 16:29:46 2019 (r349171) +++ stable/12/contrib/elftoolchain/elfcopy/sections.c Tue Jun 18 16:30:35 2019 (r349172) @@ -119,21 +119,19 @@ is_remove_reloc_sec(struct elfcopy *ecp, uint32_t sh_i errx(EXIT_FAILURE, "elf_getshstrndx failed: %s", elf_errmsg(-1)); - is = NULL; - while ((is = elf_nextscn(ecp->ein, is)) != NULL) { - if (sh_info == elf_ndxscn(is)) { - if (gelf_getshdr(is, &ish) == NULL) - errx(EXIT_FAILURE, "gelf_getshdr failed: %s", - elf_errmsg(-1)); - if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == - NULL) - errx(EXIT_FAILURE, "elf_strptr failed: %s", - elf_errmsg(-1)); - if (is_remove_section(ecp, name)) - return (1); - else - return (0); - } + is = elf_getscn(ecp->ein, sh_info); + if (is != NULL) { + if (gelf_getshdr(is, &ish) == NULL) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + if ((name = elf_strptr(ecp->ein, indx, ish.sh_name)) == + NULL) + errx(EXIT_FAILURE, "elf_strptr failed: %s", + elf_errmsg(-1)); + if (is_remove_section(ecp, name)) + return (1); + else + return (0); } elferr = elf_errno(); if (elferr != 0) From owner-svn-src-all@freebsd.org Tue Jun 18 16:31:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A9E15C26C9; Tue, 18 Jun 2019 16:31:07 +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 3A2E0849E3; Tue, 18 Jun 2019 16:31:07 +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 14F7AFB3F; Tue, 18 Jun 2019 16:31:07 +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 x5IGV663047140; Tue, 18 Jun 2019 16:31:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5IGV6pC047134; Tue, 18 Jun 2019 16:31:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906181631.x5IGV6pC047134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Jun 2019 16:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349173 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 349173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A2E0849E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 16:31:07 -0000 Author: markj Date: Tue Jun 18 16:31:05 2019 New Revision: 349173 URL: https://svnweb.freebsd.org/changeset/base/349173 Log: MFC r348657: elfcopy: Use libelftc's string table routines to build .shstrtab. PR: 234949 Modified: stable/12/contrib/elftoolchain/elfcopy/ascii.c stable/12/contrib/elftoolchain/elfcopy/binary.c stable/12/contrib/elftoolchain/elfcopy/elfcopy.h stable/12/contrib/elftoolchain/elfcopy/main.c stable/12/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/ascii.c Tue Jun 18 16:30:35 2019 (r349172) +++ stable/12/contrib/elftoolchain/elfcopy/ascii.c Tue Jun 18 16:31:05 2019 (r349173) @@ -378,9 +378,6 @@ done: errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); @@ -604,9 +601,6 @@ done: if (gelf_update_ehdr(ecp->eout, &oeh) == 0) errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); /* Update sh_name pointer for each section header entry. */ update_shdr(ecp, 0); Modified: stable/12/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/binary.c Tue Jun 18 16:30:35 2019 (r349172) +++ stable/12/contrib/elftoolchain/elfcopy/binary.c Tue Jun 18 16:31:05 2019 (r349173) @@ -250,11 +250,8 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, c errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", elf_errmsg(-1)); - /* Generate section name string table (.shstrtab). */ - ecp->flags |= SYMTAB_EXIST; - set_shstrtab(ecp); - /* Update sh_name pointer for each section header entry. */ + ecp->flags |= SYMTAB_EXIST; update_shdr(ecp, 0); /* Properly set sh_link field of .symtab section. */ Modified: stable/12/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/elfcopy.h Tue Jun 18 16:30:35 2019 (r349172) +++ stable/12/contrib/elftoolchain/elfcopy/elfcopy.h Tue Jun 18 16:31:05 2019 (r349173) @@ -135,6 +135,8 @@ struct section { int pseudo; int nocopy; + Elftc_String_Table *strtab; + TAILQ_ENTRY(section) sec_list; /* next section */ }; @@ -313,7 +315,6 @@ struct sec_action *lookup_sec_act(struct elfcopy *_ecp struct symop *lookup_symop_list(struct elfcopy *_ecp, const char *_name, unsigned int _op); void resync_sections(struct elfcopy *_ecp); -void set_shstrtab(struct elfcopy *_ecp); void setup_phdr(struct elfcopy *_ecp); void update_shdr(struct elfcopy *_ecp, int _update_link); Modified: stable/12/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/main.c Tue Jun 18 16:30:35 2019 (r349172) +++ stable/12/contrib/elftoolchain/elfcopy/main.c Tue Jun 18 16:31:05 2019 (r349173) @@ -388,9 +388,6 @@ create_elf(struct elfcopy *ecp) */ copy_content(ecp); - /* Generate section name string table (.shstrtab). */ - set_shstrtab(ecp); - /* * Second processing of output sections: Update section headers. * At this stage we set name string index, update st_link and st_info @@ -485,6 +482,9 @@ free_elf(struct elfcopy *ecp) /* Free symbol table buffers. */ free_symtab(ecp); + + /* Free section name string table. */ + elftc_string_table_destroy(ecp->shstrtab->strtab); /* Free internal section list. */ if (!TAILQ_EMPTY(&ecp->v_sec)) { Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/sections.c Tue Jun 18 16:30:35 2019 (r349172) +++ stable/12/contrib/elftoolchain/elfcopy/sections.c Tue Jun 18 16:31:05 2019 (r349173) @@ -42,19 +42,18 @@ static void check_section_rename(struct elfcopy *ecp, static void filter_reloc(struct elfcopy *ecp, struct section *s); static int get_section_flags(struct elfcopy *ecp, const char *name); static void insert_sections(struct elfcopy *ecp); -static void insert_to_strtab(struct section *t, const char *s); static int is_append_section(struct elfcopy *ecp, const char *name); static int is_compress_section(struct elfcopy *ecp, const char *name); static int is_debug_section(const char *name); static int is_dwo_section(const char *name); static int is_modify_section(struct elfcopy *ecp, const char *name); static int is_print_section(struct elfcopy *ecp, const char *name); -static int lookup_string(struct section *t, const char *s); static void modify_section(struct elfcopy *ecp, struct section *s); static void pad_section(struct elfcopy *ecp, struct section *s); static void print_data(const char *d, size_t sz); static void print_section(struct section *s); static void *read_section(struct section *s, size_t *size); +static void set_shstrtab(struct elfcopy *ecp); static void update_reloc(struct elfcopy *ecp, struct section *s); static void update_section_group(struct elfcopy *ecp, struct section *s); @@ -1336,10 +1335,9 @@ insert_sections(struct elfcopy *ecp) void add_to_shstrtab(struct elfcopy *ecp, const char *name) { - struct section *s; - s = ecp->shstrtab; - insert_to_strtab(s, name); + if (elftc_string_table_insert(ecp->shstrtab->strtab, name) == 0) + errx(EXIT_FAILURE, "elftc_string_table_insert failed"); } void @@ -1349,6 +1347,9 @@ update_shdr(struct elfcopy *ecp, int update_link) GElf_Shdr osh; int elferr; + /* Finalize the section name string table (.shstrtab). */ + set_shstrtab(ecp); + TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (s->pseudo) continue; @@ -1358,7 +1359,8 @@ update_shdr(struct elfcopy *ecp, int update_link) elf_errmsg(-1)); /* Find section name in string table and set sh_name. */ - osh.sh_name = lookup_string(ecp->shstrtab, s->name); + osh.sh_name = elftc_string_table_lookup(ecp->shstrtab->strtab, + s->name); /* * sh_link needs to be updated, since the index of the @@ -1408,19 +1410,22 @@ init_shstrtab(struct elfcopy *ecp) s->loadable = 0; s->type = SHT_STRTAB; s->vma = 0; + s->strtab = elftc_string_table_create(0); - insert_to_strtab(s, ""); - insert_to_strtab(s, ".symtab"); - insert_to_strtab(s, ".strtab"); - insert_to_strtab(s, ".shstrtab"); + add_to_shstrtab(ecp, ""); + add_to_shstrtab(ecp, ".symtab"); + add_to_shstrtab(ecp, ".strtab"); + add_to_shstrtab(ecp, ".shstrtab"); } -void +static void set_shstrtab(struct elfcopy *ecp) { struct section *s; Elf_Data *data; GElf_Shdr sh; + const char *image; + size_t sz; s = ecp->shstrtab; @@ -1453,19 +1458,21 @@ set_shstrtab(struct elfcopy *ecp) * which are reserved for this in the beginning of shstrtab. */ if (!(ecp->flags & SYMTAB_EXIST)) { - s->sz -= sizeof(".symtab\0.strtab"); - memmove(s->buf, (char *)s->buf + sizeof(".symtab\0.strtab"), - s->sz); + elftc_string_table_remove(s->strtab, ".symtab"); + elftc_string_table_remove(s->strtab, ".strtab"); } - sh.sh_size = s->sz; + image = elftc_string_table_image(s->strtab, &sz); + s->sz = sz; + + sh.sh_size = sz; if (!gelf_update_shdr(s->os, &sh)) errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s", elf_errmsg(-1)); data->d_align = 1; - data->d_buf = s->buf; - data->d_size = s->sz; + data->d_buf = (void *)(uintptr_t)image; + data->d_size = sz; data->d_off = 0; data->d_type = ELF_T_BYTE; data->d_version = EV_CURRENT; @@ -1589,73 +1596,6 @@ add_gnu_debuglink(struct elfcopy *ecp) STAILQ_INSERT_TAIL(&ecp->v_sadd, sa, sadd_list); ecp->flags |= SEC_ADD; -} - -static void -insert_to_strtab(struct section *t, const char *s) -{ - const char *r; - char *b, *c; - size_t len, slen; - int append; - - if (t->sz == 0) { - t->cap = 512; - if ((t->buf = malloc(t->cap)) == NULL) - err(EXIT_FAILURE, "malloc failed"); - } - - slen = strlen(s); - append = 0; - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (!append && len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return; - } else if (len < slen && len != 0) { - r = s + (slen - len); - if (strcmp(c, r) == 0) { - t->sz -= len + 1; - memmove(c, c + len + 1, t->sz - (c - b)); - append = 1; - continue; - } - } - c += len + 1; - } - - while (t->sz + slen + 1 >= t->cap) { - t->cap *= 2; - if ((t->buf = realloc(t->buf, t->cap)) == NULL) - err(EXIT_FAILURE, "realloc failed"); - } - b = t->buf; - strncpy(&b[t->sz], s, slen); - b[t->sz + slen] = '\0'; - t->sz += slen + 1; -} - -static int -lookup_string(struct section *t, const char *s) -{ - const char *b, *c, *r; - size_t len, slen; - - slen = strlen(s); - b = t->buf; - for (c = b; c < b + t->sz;) { - len = strlen(c); - if (len >= slen) { - r = c + (len - slen); - if (strcmp(r, s) == 0) - return (r - b); - } - c += len + 1; - } - - return (-1); } static uint32_t crctable[256] = From owner-svn-src-all@freebsd.org Tue Jun 18 17:05:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 17:51:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 18:50:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 18:55:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743F315C56DB for ; Tue, 18 Jun 2019 18:55:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 1302789A07 for ; Tue, 18 Jun 2019 18:55:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x841.google.com with SMTP id a15so16711771qtn.7 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=f8trC5cCLAwVMHmir0slBd7l5Xcb4a4KrLL2N/EsTYmXqwI/fZi4hcP/VW/07UMLpd oSZTcApVTot9kkRzcDPqPyaW6sJ9BAE9Nj7iOIyg9JjNfEWOxnxY5t9w1cUe1uXKqVpA RZVqP9Y0s0sIsQ60Q4qqziuGMlq1OkcY26QIakGts8p4BFNI9NSEo7NHhtjKHjoA+77S 5qZxIFgeEQAuJFi0IMtXYOGE6p0S1zXzZl2TxtUpz+XYWtrWPB5yUvtDDPWuwlPDAi7Q p9iKRpuG6qjox/cjBWVtYf2kneSLdUr0nFkaKjXatYuPFpIlqKbbxI3n0zj+l5prP1E1 7Q2A== X-Gm-Message-State: APjAAAVVPuhrqq5gVMpzVSnrj2mrYTOAyLwLdwzLi+Hf7r42Bacj9M0B vPiv8OHK7FhslGLYVTGkhZANez3EKoA= 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: 1302789A07 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 18:55:14 -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-all@freebsd.org Tue Jun 18 19:46:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 19:50:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4DA715C7072 for ; Tue, 18 Jun 2019 19:50:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 737508BB20 for ; Tue, 18 Jun 2019 19:50:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x832.google.com with SMTP id x47so16904888qtk.11 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=ByO1IA7giBZEQjPQ8qZkz9/ylkQeuyrCnSPA0Ki+S0iWhTMKRbv3J7VlCXEdkI8v7I 3E0eDz679ya5IL8akFgZJZ6i2kJ2Xge1pmY24Q7Pk50BTrZNm2qwRgBEg7BVHRRu0GIo Svcmr5w948CVuFSDNcFtaeSe7MwP3DRNydvFxdfpcbHxDjRcbGBPEbp4CCgIWOZrQeUJ Mrtj0M4+NDIi08KKLwuppBSrRYRgJQNecQKoZVRhxIh0zq/SguIwtNL5+vIrhUb5kWjn O4+8sfsODRxSgvhTDVHor7wp1oeC88ucU7XcighVnH24gAUAJUZGw8WJqKqIJCb1uYs3 lWPg== X-Gm-Message-State: APjAAAUM4hdZtVyLVut1jRWiw9fRzEEICCuDXgoy5C4vhGAmGsPRsQq5 2pe7OURgkLutgsJJTDlfw7dRYEyirpA= 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: 737508BB20 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 21:02:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 21:05:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 22:00:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Jun 18 23:49:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A69B415CC1A9; Tue, 18 Jun 2019 23:49:14 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3016C209; Tue, 18 Jun 2019 23:49:14 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2436D1C55E; Tue, 18 Jun 2019 23:49:14 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5INnEVC088464; Tue, 18 Jun 2019 23:49:14 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5INnE5X088463; Tue, 18 Jun 2019 23:49:14 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201906182349.x5INnE5X088463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 18 Jun 2019 23:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349180 - stable/12/usr.sbin/jail X-SVN-Group: stable-12 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/12/usr.sbin/jail X-SVN-Commit-Revision: 349180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C3016C209 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 23:49:14 -0000 Author: jamie Date: Tue Jun 18 23:49:13 2019 New Revision: 349180 URL: https://svnweb.freebsd.org/changeset/base/349180 Log: Unmount filesystems on jail removal with "-f", to get around a situation where the jail root vnode reference is stopping the filesystem from unmounting, when the jail is removed by still exists in a dying state. PR: 238517 Reported by: matthias at harz.de Modified: stable/12/usr.sbin/jail/command.c Modified: stable/12/usr.sbin/jail/command.c ============================================================================== --- stable/12/usr.sbin/jail/command.c Tue Jun 18 22:00:38 2019 (r349179) +++ stable/12/usr.sbin/jail/command.c Tue Jun 18 23:49:13 2019 (r349180) @@ -475,6 +475,7 @@ run_command(struct cfjail *j) if (down) { argv[4] = NULL; argv[3] = argv[1]; + argv[1] = "-ft"; argv[0] = "/sbin/umount"; } else { if (argc == 4) { @@ -488,9 +489,9 @@ run_command(struct cfjail *j) argv[4] = argv[1]; argv[3] = argv[0]; } + argv[1] = "-t"; argv[0] = _PATH_MOUNT; } - argv[1] = "-t"; break; case IP_MOUNT_DEVFS: From owner-svn-src-all@freebsd.org Wed Jun 19 00:37:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80CB315CD747; Wed, 19 Jun 2019 00:37:56 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22F906D993; Wed, 19 Jun 2019 00:37:56 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E900F1CDB6; Wed, 19 Jun 2019 00:37:55 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5J0btDd014928; Wed, 19 Jun 2019 00:37:55 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J0btwW014921; Wed, 19 Jun 2019 00:37:55 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201906190037.x5J0btwW014921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 19 Jun 2019 00:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349181 - releng/11.3/sys/dev/ixl X-SVN-Group: releng X-SVN-Commit-Author: erj X-SVN-Commit-Paths: releng/11.3/sys/dev/ixl X-SVN-Commit-Revision: 349181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22F906D993 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 00:37:57 -0000 Author: erj Date: Wed Jun 19 00:37:54 2019 New Revision: 349181 URL: https://svnweb.freebsd.org/changeset/base/349181 Log: MFS r349163: ixl(4)/ixlv(4): Update Intel XL710 PF and VF drivers to ixl-1.11.9 and ixlv-1.5.8 Update the legacy (non-iflib) drivers in stable/11 with recent changes from the Intel out-of-tree version. Major changes: - Support for new BASE-T device with additional link speeds (2.5G and 5G) and EEE - Additional I2C access methods backported from ixl-iflib - FW LLDP Agent control with sysctl added for X722 devices (this already existed for 710 devices) - MAC/VLAN filters handling has been refactored - Building and loading if_ixlv as a KLD has been fixed This commit is not from CURRENT since the driver in 12/13 uses iflib, and the decision was made to not use iflib in FreeBSD 11 releases. Submitted by: Krzysztof Galazka Approved by: re@ (gjb@) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20290 Modified: releng/11.3/sys/dev/ixl/i40e_adminq.c releng/11.3/sys/dev/ixl/i40e_adminq.h releng/11.3/sys/dev/ixl/i40e_adminq_cmd.h releng/11.3/sys/dev/ixl/i40e_alloc.h releng/11.3/sys/dev/ixl/i40e_common.c releng/11.3/sys/dev/ixl/i40e_dcb.c releng/11.3/sys/dev/ixl/i40e_dcb.h releng/11.3/sys/dev/ixl/i40e_devids.h releng/11.3/sys/dev/ixl/i40e_hmc.c releng/11.3/sys/dev/ixl/i40e_hmc.h releng/11.3/sys/dev/ixl/i40e_lan_hmc.c releng/11.3/sys/dev/ixl/i40e_lan_hmc.h releng/11.3/sys/dev/ixl/i40e_nvm.c releng/11.3/sys/dev/ixl/i40e_osdep.c releng/11.3/sys/dev/ixl/i40e_osdep.h releng/11.3/sys/dev/ixl/i40e_prototype.h releng/11.3/sys/dev/ixl/i40e_register.h releng/11.3/sys/dev/ixl/i40e_status.h releng/11.3/sys/dev/ixl/i40e_type.h releng/11.3/sys/dev/ixl/if_ixl.c releng/11.3/sys/dev/ixl/if_ixlv.c releng/11.3/sys/dev/ixl/ixl.h releng/11.3/sys/dev/ixl/ixl_iw.c releng/11.3/sys/dev/ixl/ixl_iw.h releng/11.3/sys/dev/ixl/ixl_iw_int.h releng/11.3/sys/dev/ixl/ixl_pf.h releng/11.3/sys/dev/ixl/ixl_pf_i2c.c releng/11.3/sys/dev/ixl/ixl_pf_iov.c releng/11.3/sys/dev/ixl/ixl_pf_iov.h releng/11.3/sys/dev/ixl/ixl_pf_main.c releng/11.3/sys/dev/ixl/ixl_pf_qmgr.c releng/11.3/sys/dev/ixl/ixl_pf_qmgr.h releng/11.3/sys/dev/ixl/ixl_txrx.c releng/11.3/sys/dev/ixl/ixlv.h releng/11.3/sys/dev/ixl/ixlv_vc_mgr.h releng/11.3/sys/dev/ixl/ixlvc.c releng/11.3/sys/dev/ixl/virtchnl.h Directory Properties: releng/11.3/ (props changed) Modified: releng/11.3/sys/dev/ixl/i40e_adminq.c ============================================================================== --- releng/11.3/sys/dev/ixl/i40e_adminq.c Tue Jun 18 23:49:13 2019 (r349180) +++ releng/11.3/sys/dev/ixl/i40e_adminq.c Wed Jun 19 00:37:54 2019 (r349181) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -125,6 +125,7 @@ enum i40e_status_code i40e_alloc_adminq_arq_ring(struc **/ void i40e_free_adminq_asq(struct i40e_hw *hw) { + i40e_free_virt_mem(hw, &hw->aq.asq.cmd_buf); i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); } @@ -404,7 +405,7 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw /* initialize base registers */ ret_code = i40e_config_asq_regs(hw); if (ret_code != I40E_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.asq.count = hw->aq.num_asq_entries; @@ -412,7 +413,11 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw init_adminq_free_rings: i40e_free_adminq_asq(hw); + return ret_code; +init_config_regs: + i40e_free_asq_bufs(hw); + init_adminq_exit: return ret_code; } @@ -575,21 +580,22 @@ static void i40e_resume_aq(struct i40e_hw *hw) **/ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { + struct i40e_adminq_info *aq = &hw->aq; + enum i40e_status_code ret_code; u16 cfg_ptr, oem_hi, oem_lo; u16 eetrack_lo, eetrack_hi; - enum i40e_status_code ret_code; int retry = 0; /* verify input for valid configuration */ - if ((hw->aq.num_arq_entries == 0) || - (hw->aq.num_asq_entries == 0) || - (hw->aq.arq_buf_size == 0) || - (hw->aq.asq_buf_size == 0)) { + if (aq->num_arq_entries == 0 || + aq->num_asq_entries == 0 || + aq->arq_buf_size == 0 || + aq->asq_buf_size == 0) { ret_code = I40E_ERR_CONFIG; goto init_adminq_exit; } - i40e_init_spinlock(&hw->aq.asq_spinlock); - i40e_init_spinlock(&hw->aq.arq_spinlock); + i40e_init_spinlock(&aq->asq_spinlock); + i40e_init_spinlock(&aq->arq_spinlock); /* Set up register offsets */ i40e_adminq_init_regs(hw); @@ -616,11 +622,11 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw */ do { ret_code = i40e_aq_get_firmware_version(hw, - &hw->aq.fw_maj_ver, - &hw->aq.fw_min_ver, - &hw->aq.fw_build, - &hw->aq.api_maj_ver, - &hw->aq.api_min_ver, + &aq->fw_maj_ver, + &aq->fw_min_ver, + &aq->fw_build, + &aq->api_maj_ver, + &aq->api_min_ver, NULL); if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT) break; @@ -643,26 +649,43 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), &oem_lo); hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; - - /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 7))) - hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; - - if (hw->mac.type == I40E_MAC_XL710 && - hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { - hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + /* + * Some features were introduced in different FW API version + * for different MAC type. + */ + switch (hw->mac.type) { + case I40E_MAC_XL710: + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710)) { + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + /* The ability to RX (not drop) 802.1ad frames */ + hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; + } + break; + case I40E_MAC_X722: + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + /* fall through */ + default: + break; } /* Newer versions of firmware require lock when reading the NVM */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 5))) + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 5)) hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; - if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 8)) + hw->flags |= I40E_HW_FLAG_FW_LLDP_PERSISTENT; + + if (aq->api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; goto init_adminq_free_arq; } @@ -682,8 +705,8 @@ init_adminq_free_arq: init_adminq_free_asq: i40e_shutdown_asq(hw); init_adminq_destroy_spinlocks: - i40e_destroy_spinlock(&hw->aq.asq_spinlock); - i40e_destroy_spinlock(&hw->aq.arq_spinlock); + i40e_destroy_spinlock(&aq->asq_spinlock); + i40e_destroy_spinlock(&aq->arq_spinlock); init_adminq_exit: return ret_code; @@ -728,7 +751,7 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); while (rd32(hw, hw->aq.asq.head) != ntc) { - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); if (details->callback) { @@ -808,7 +831,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: head overrun at %d\n", val); - status = I40E_ERR_QUEUE_EMPTY; + status = I40E_ERR_ADMIN_QUEUE_FULL; goto asq_send_command_error; } @@ -896,7 +919,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 } /* bump the tail */ - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff, buff_size); (hw->aq.asq.next_to_use)++; @@ -942,12 +965,14 @@ enum i40e_status_code i40e_asq_send_command(struct i40 cmd_completed = TRUE; if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_OK) status = I40E_SUCCESS; + else if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_EBUSY) + status = I40E_ERR_NOT_READY; else status = I40E_ERR_ADMIN_QUEUE_ERROR; hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval; } - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer writeback:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); @@ -1063,7 +1088,7 @@ enum i40e_status_code i40e_clean_arq_element(struct i4 hw->aq.arq.r.arq_bi[desc_idx].va, e->msg_len, I40E_DMA_TO_NONDMA); - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQRX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, hw->aq.arq_buf_size); Modified: releng/11.3/sys/dev/ixl/i40e_adminq.h ============================================================================== --- releng/11.3/sys/dev/ixl/i40e_adminq.h Tue Jun 18 23:49:13 2019 (r349180) +++ releng/11.3/sys/dev/ixl/i40e_adminq.h Wed Jun 19 00:37:54 2019 (r349181) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Modified: releng/11.3/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- releng/11.3/sys/dev/ixl/i40e_adminq_cmd.h Tue Jun 18 23:49:13 2019 (r349180) +++ releng/11.3/sys/dev/ixl/i40e_adminq_cmd.h Wed Jun 19 00:37:54 2019 (r349181) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x0005 -#define I40E_FW_API_VERSION_MINOR_X710 0x0007 +#define I40E_FW_API_VERSION_MINOR_X722 0x0008 +#define I40E_FW_API_VERSION_MINOR_X710 0x0008 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -52,6 +52,8 @@ /* API version 1.7 implements additional link and PHY-specific APIs */ #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007 +/* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ +#define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006 struct i40e_aq_desc { __le16 flags; @@ -289,6 +291,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07, i40e_aqc_opc_lldp_set_local_mib = 0x0A08, i40e_aqc_opc_lldp_stop_start_spec_agent = 0x0A09, + i40e_aqc_opc_lldp_restore = 0x0A0A, /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, @@ -1782,6 +1785,8 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_25GBASE_AOC = 0x23, I40E_PHY_TYPE_25GBASE_ACC = 0x24, + I40E_PHY_TYPE_2_5GBASE_T = 0x30, + I40E_PHY_TYPE_5GBASE_T = 0x31, I40E_PHY_TYPE_MAX, I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, I40E_PHY_TYPE_EMPTY = 0xFE, @@ -1823,19 +1828,25 @@ enum i40e_aq_phy_type { BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \ - BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC)) + BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \ + BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \ + BIT_ULL(I40E_PHY_TYPE_5GBASE_T)) +#define I40E_LINK_SPEED_2_5GB_SHIFT 0x0 #define I40E_LINK_SPEED_100MB_SHIFT 0x1 #define I40E_LINK_SPEED_1000MB_SHIFT 0x2 #define I40E_LINK_SPEED_10GB_SHIFT 0x3 #define I40E_LINK_SPEED_40GB_SHIFT 0x4 #define I40E_LINK_SPEED_20GB_SHIFT 0x5 #define I40E_LINK_SPEED_25GB_SHIFT 0x6 +#define I40E_LINK_SPEED_5GB_SHIFT 0x7 enum i40e_aq_link_speed { I40E_LINK_SPEED_UNKNOWN = 0, I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT), I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT), + I40E_LINK_SPEED_2_5GB = (1 << I40E_LINK_SPEED_2_5GB_SHIFT), + I40E_LINK_SPEED_5GB = (1 << I40E_LINK_SPEED_5GB_SHIFT), I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT), I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT), I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT), @@ -1865,12 +1876,15 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_FEC_ABILITY_KR 0x40 #define I40E_AQ_PHY_FEC_ABILITY_RS 0x80 __le16 eee_capability; +#define I40E_AQ_EEE_AUTO 0x0001 #define I40E_AQ_EEE_100BASE_TX 0x0002 #define I40E_AQ_EEE_1000BASE_T 0x0004 #define I40E_AQ_EEE_10GBASE_T 0x0008 #define I40E_AQ_EEE_1000BASE_KX 0x0010 #define I40E_AQ_EEE_10GBASE_KX4 0x0020 #define I40E_AQ_EEE_10GBASE_KR 0x0040 +#define I40E_AQ_EEE_2_5GBASE_T 0x0100 +#define I40E_AQ_EEE_5GBASE_T 0x0200 __le32 eeer_val; u8 d3_lpan; #define I40E_AQ_SET_PHY_D3_LPAN_ENA 0x01 @@ -1881,6 +1895,8 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 #define I40E_AQ_PHY_TYPE_EXT_25G_AOC 0x10 #define I40E_AQ_PHY_TYPE_EXT_25G_ACC 0x20 +#define I40E_AQ_PHY_TYPE_EXT_2_5GBASE_T 0x40 +#define I40E_AQ_PHY_TYPE_EXT_5GBASE_T 0x80 u8 fec_cfg_curr_mod_ext_info; #define I40E_AQ_ENABLE_FEC_KR 0x01 #define I40E_AQ_ENABLE_FEC_RS 0x02 @@ -2122,15 +2138,29 @@ enum i40e_aq_phy_reg_type { I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3 }; +#pragma pack(1) /* Run PHY Activity (0x0626) */ struct i40e_aqc_run_phy_activity { - __le16 activity_id; - u8 flags; - u8 reserved1; - __le32 control; - __le32 data; - u8 reserved2[4]; + u8 cmd_flags; + __le16 activity_id; +#define I40E_AQ_RUN_PHY_ACTIVITY_ACTIVITY_ID_USER_DEFINED 0x10 + u8 reserved; + union { + struct { + __le32 dnl_opcode; +#define I40E_AQ_RUN_PHY_ACTIVITY_DNL_OPCODE_GET_EEE_STATISTICS 0x801b + __le32 data; + u8 reserved2[4]; + } cmd; + struct { + __le32 cmd_status; +#define I40E_AQ_RUN_PHY_ACTIVITY_CMD_STATUS_SUCCESS 0x4 + __le32 data0; + __le32 data1; + } resp; + } params; }; +#pragma pack() I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity); @@ -2142,7 +2172,9 @@ struct i40e_aqc_phy_register_access { #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 u8 dev_addres; - u8 reserved1[2]; + u8 cmd_flags; +#define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE 1 + u8 reserved1; __le32 reg_address; __le32 reg_value; u8 reserved2[4]; @@ -2157,6 +2189,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); struct i40e_aqc_nvm_update { u8 command_flags; #define I40E_AQ_NVM_LAST_CMD 0x01 +#define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 +#define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 #define I40E_AQ_NVM_FLASH_ONLY 0x80 #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 @@ -2404,18 +2438,19 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv); /* Stop LLDP (direct 0x0A05) */ struct i40e_aqc_lldp_stop { u8 command; -#define I40E_AQ_LLDP_AGENT_STOP 0x0 -#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP 0x0 +#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP_PERSIST 0x2 u8 reserved[15]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop); /* Start LLDP (direct 0x0A06) */ - struct i40e_aqc_lldp_start { u8 command; -#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START_PERSIST 0x2 u8 reserved[15]; }; @@ -2534,6 +2569,16 @@ struct i40e_aqc_lldp_stop_start_specific_agent { }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent); + +/* Restore LLDP Agent factory settings (direct 0x0A0A) */ +struct i40e_aqc_lldp_restore { + u8 command; +#define I40E_AQ_LLDP_AGENT_RESTORE_NOT 0x0 +#define I40E_AQ_LLDP_AGENT_RESTORE 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore); /* Add Udp Tunnel command and completion (direct 0x0B00) */ struct i40e_aqc_add_udp_tunnel { Modified: releng/11.3/sys/dev/ixl/i40e_alloc.h ============================================================================== --- releng/11.3/sys/dev/ixl/i40e_alloc.h Tue Jun 18 23:49:13 2019 (r349180) +++ releng/11.3/sys/dev/ixl/i40e_alloc.h Wed Jun 19 00:37:54 2019 (r349181) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Modified: releng/11.3/sys/dev/ixl/i40e_common.c ============================================================================== --- releng/11.3/sys/dev/ixl/i40e_common.c Tue Jun 18 23:49:13 2019 (r349180) +++ releng/11.3/sys/dev/ixl/i40e_common.c Wed Jun 19 00:37:54 2019 (r349181) @@ -1,8 +1,8 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2019, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,7 +37,6 @@ #include "i40e_prototype.h" #include "virtchnl.h" - /** * i40e_set_mac_type - Sets MAC type * @hw: pointer to the HW structure @@ -62,10 +61,15 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: case I40E_DEV_ID_10G_BASE_T4: + case I40E_DEV_ID_10G_BASE_T_BC: + case I40E_DEV_ID_10G_B: + case I40E_DEV_ID_10G_SFP: case I40E_DEV_ID_20G_KR2: case I40E_DEV_ID_20G_KR2_A: case I40E_DEV_ID_25G_B: case I40E_DEV_ID_25G_SFP28: + case I40E_DEV_ID_X710_N3000: + case I40E_DEV_ID_XXV710_N3000: hw->mac.type = I40E_MAC_XL710; break; case I40E_DEV_ID_KX_X722: @@ -319,32 +323,37 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug void *buffer, u16 buf_len) { struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; + u32 effective_mask = hw->debug_mask & mask; u8 *buf = (u8 *)buffer; u16 len; - u16 i = 0; + u16 i; - if ((!(mask & hw->debug_mask)) || (desc == NULL)) + if (!effective_mask || !desc) return; len = LE16_TO_CPU(aq_desc->datalen); - i40e_debug(hw, mask, + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", LE16_TO_CPU(aq_desc->opcode), LE16_TO_CPU(aq_desc->flags), LE16_TO_CPU(aq_desc->datalen), LE16_TO_CPU(aq_desc->retval)); - i40e_debug(hw, mask, "\tcookie (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tcookie (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->cookie_high), LE32_TO_CPU(aq_desc->cookie_low)); - i40e_debug(hw, mask, "\tparam (0,1) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tparam (0,1) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.internal.param0), LE32_TO_CPU(aq_desc->params.internal.param1)); - i40e_debug(hw, mask, "\taddr (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\taddr (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.external.addr_high), LE32_TO_CPU(aq_desc->params.external.addr_low)); - if ((buffer != NULL) && (aq_desc->datalen != 0)) { + if (buffer && (buf_len != 0) && (len != 0) && + (effective_mask & I40E_DEBUG_AQ_DESC_BUFFER)) { i40e_debug(hw, mask, "AQ CMD Buffer:\n"); if (buf_len < len) len = buf_len; @@ -1014,6 +1023,18 @@ enum i40e_status_code i40e_init_shared_code(struct i40 hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; + /* NVMUpdate features structure initialization */ + hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; + hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; + hw->nvmupd_features.size = sizeof(hw->nvmupd_features); + i40e_memset(hw->nvmupd_features.features, 0x0, + I40E_NVMUPD_FEATURES_API_FEATURES_ARRAY_LEN * + sizeof(*hw->nvmupd_features.features), + I40E_NONDMA_MEM); + + /* No features supported at the moment */ + hw->nvmupd_features.features[0] = 0; + status = i40e_init_nvm(hw); return status; } @@ -1235,6 +1256,8 @@ static enum i40e_media_type i40e_get_media_type(struct break; case I40E_PHY_TYPE_100BASE_TX: case I40E_PHY_TYPE_1000BASE_T: + case I40E_PHY_TYPE_2_5GBASE_T: + case I40E_PHY_TYPE_5GBASE_T: case I40E_PHY_TYPE_10GBASE_T: media = I40E_MEDIA_TYPE_BASET; break; @@ -1271,6 +1294,29 @@ static enum i40e_media_type i40e_get_media_type(struct return media; } +/** + * i40e_poll_globr - Poll for Global Reset completion + * @hw: pointer to the hardware structure + * @retry_limit: how many times to retry before failure + **/ +static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, + u32 retry_limit) +{ + u32 cnt, reg = 0; + + for (cnt = 0; cnt < retry_limit; cnt++) { + reg = rd32(hw, I40E_GLGEN_RSTAT); + if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) + return I40E_SUCCESS; + i40e_msec_delay(100); + } + + DEBUGOUT("Global reset failed.\n"); + DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg); + + return I40E_ERR_RESET_FAILED; +} + #define I40E_PF_RESET_WAIT_COUNT 200 /** * i40e_pf_reset - Reset the PF @@ -1294,7 +1340,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - grst_del = grst_del * 20; + grst_del = min(grst_del * 20, 160U); for (cnt = 0; cnt < grst_del; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); @@ -1340,14 +1386,14 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) break; reg2 = rd32(hw, I40E_GLGEN_RSTAT); - if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { - DEBUGOUT("Core reset upcoming. Skipping PF reset request.\n"); - DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg2); - return I40E_ERR_NOT_READY; - } + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) + break; i40e_msec_delay(1); } - if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { + if (i40e_poll_globr(hw, grst_del) != I40E_SUCCESS) + return I40E_ERR_RESET_FAILED; + } else if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { DEBUGOUT("PF reset polling failed to complete.\n"); return I40E_ERR_RESET_FAILED; } @@ -1511,7 +1557,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int id **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1523,27 +1568,10 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; break; } - return mode; } @@ -1558,7 +1586,6 @@ u32 i40e_led_get(struct i40e_hw *hw) **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & 0xfffffff0) @@ -1572,22 +1599,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool b if (!gpio_val) continue; - - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK; /* this & is a bit of paranoia, but serves as a range check */ gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) & @@ -1828,6 +1839,10 @@ enum i40e_status_code i40e_aq_set_mac_config(struct i4 if (crc_en) cmd->params |= I40E_AQ_SET_MAC_CONFIG_CRC_EN; +#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD 0x7FFF + cmd->fc_refresh_threshold = + CPU_TO_LE16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD); + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -1968,8 +1983,7 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40 hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; - if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= 7) { + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { __le32 tmp; i40e_memcpy(&tmp, resp->link_type, sizeof(tmp), @@ -4102,6 +4116,43 @@ i40e_aq_update_nvm_exit: } /** + * i40e_aq_rearrange_nvm + * @hw: pointer to the hw struct + * @rearrange_nvm: defines direction of rearrangement + * @cmd_details: pointer to command details structure or NULL + * + * Rearrange NVM structure, available only for transition FW + **/ +enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, + u8 rearrange_nvm, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aqc_nvm_update *cmd; + enum i40e_status_code status; + struct i40e_aq_desc desc; + + DEBUGFUNC("i40e_aq_rearrange_nvm"); + + cmd = (struct i40e_aqc_nvm_update *)&desc.params.raw; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_update); + + rearrange_nvm &= (I40E_AQ_NVM_REARRANGE_TO_FLAT | + I40E_AQ_NVM_REARRANGE_TO_STRUCT); + + if (!rearrange_nvm) { + status = I40E_ERR_PARAM; + goto i40e_aq_rearrange_nvm_exit; + } + + cmd->command_flags |= rearrange_nvm; + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + +i40e_aq_rearrange_nvm_exit: + return status; +} + +/** * i40e_aq_nvm_progress * @hw: pointer to the hw struct * @progress: pointer to progress returned from AQ @@ -4208,7 +4259,7 @@ enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e cmd->type = mib_type; cmd->length = CPU_TO_LE16(buff_size); - cmd->address_high = CPU_TO_LE32(I40E_HI_WORD((u64)buff)); + cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buff)); cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buff)); status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); @@ -4244,164 +4295,54 @@ enum i40e_status_code i40e_aq_cfg_lldp_mib_change_even } /** - * i40e_aq_add_lldp_tlv + * i40e_aq_restore_lldp * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: buffer with TLV to add - * @buff_size: length of the buffer - * @tlv_len: length of the TLV to be added - * @mib_len: length of the LLDP MIB returned in response + * @setting: pointer to factory setting variable or NULL + * @restore: True if factory settings should be restored * @cmd_details: pointer to command details structure or NULL * - * Add the specified TLV to LLDP Local MIB for the given bridge type, - * it is responsibility of the caller to make sure that the TLV is not - * already present in the LLDPDU. - * In return firmware will write the complete LLDP MIB with the newly - * added TLV in the response buffer. + * Restore LLDP Agent factory settings if @restore set to True. In other case + * only returns factory setting in AQ response. **/ -enum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type, - void *buff, u16 buff_size, u16 tlv_len, - u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) +enum i40e_status_code +i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, + struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; - struct i40e_aqc_lldp_add_tlv *cmd = - (struct i40e_aqc_lldp_add_tlv *)&desc.params.raw; + struct i40e_aqc_lldp_restore *cmd = + (struct i40e_aqc_lldp_restore *)&desc.params.raw; enum i40e_status_code status; - if (buff_size == 0 || !buff || tlv_len == 0) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_add_tlv); - - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - cmd->len = CPU_TO_LE16(tlv_len); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); + if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) { + i40e_debug(hw, I40E_DEBUG_ALL, + "Restore LLDP not supported by current FW version.\n"); + return I40E_ERR_DEVICE_NOT_SUPPORTED; } - return status; -} + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_restore); -/** - * i40e_aq_update_lldp_tlv - * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: buffer with TLV to update - * @buff_size: size of the buffer holding original and updated TLVs - * @old_len: Length of the Original TLV - * @new_len: Length of the Updated TLV - * @offset: offset of the updated TLV in the buff - * @mib_len: length of the returned LLDP MIB - * @cmd_details: pointer to command details structure or NULL - * - * Update the specified TLV to the LLDP Local MIB for the given bridge type. - * Firmware will place the complete LLDP MIB in response buffer with the - * updated TLV. - **/ -enum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw, - u8 bridge_type, void *buff, u16 buff_size, - u16 old_len, u16 new_len, u16 offset, - u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_lldp_update_tlv *cmd = - (struct i40e_aqc_lldp_update_tlv *)&desc.params.raw; - enum i40e_status_code status; + if (restore) + cmd->command |= I40E_AQ_LLDP_AGENT_RESTORE; - if (buff_size == 0 || !buff || offset == 0 || - old_len == 0 || new_len == 0) - return I40E_ERR_PARAM; + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_update_tlv); + if (setting) + *setting = cmd->command & 1; - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - cmd->old_len = CPU_TO_LE16(old_len); - cmd->new_offset = CPU_TO_LE16(offset); - cmd->new_len = CPU_TO_LE16(new_len); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); - } - return status; } /** - * i40e_aq_delete_lldp_tlv - * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: pointer to a user supplied buffer that has the TLV - * @buff_size: length of the buffer - * @tlv_len: length of the TLV to be deleted - * @mib_len: length of the returned LLDP MIB - * @cmd_details: pointer to command details structure or NULL - * - * Delete the specified TLV from LLDP Local MIB for the given bridge type. - * The firmware places the entire LLDP MIB in the response buffer. - **/ -enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw, - u8 bridge_type, void *buff, u16 buff_size, - u16 tlv_len, u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_lldp_add_tlv *cmd = - (struct i40e_aqc_lldp_add_tlv *)&desc.params.raw; - enum i40e_status_code status; - - if (buff_size == 0 || !buff) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_delete_tlv); - - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - cmd->len = CPU_TO_LE16(tlv_len); - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); - } - - return status; -} - -/** * i40e_aq_stop_lldp * @hw: pointer to the hw struct * @shutdown_agent: True if LLDP Agent needs to be Shutdown + * @persist: True if stop of LLDP should be persistent across power cycles * @cmd_details: pointer to command details structure or NULL * * Stop or Shutdown the embedded LLDP Agent **/ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, + bool persist, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -4414,6 +4355,14 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw if (shutdown_agent) cmd->command |= I40E_AQ_LLDP_AGENT_SHUTDOWN; + if (persist) { + if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) + cmd->command |= I40E_AQ_LLDP_AGENT_STOP_PERSIST; + else + i40e_debug(hw, I40E_DEBUG_ALL, + "Persistent Stop LLDP not supported by current FW version.\n"); + } + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -4422,11 +4371,13 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw /** * i40e_aq_start_lldp * @hw: pointer to the hw struct + * @persist: True if start of LLDP should be persistent across power cycles * @cmd_details: pointer to command details structure or NULL * * Start the embedded LLDP Agent on all ports. **/ enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw, + bool persist, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -4437,6 +4388,15 @@ enum i40e_status_code i40e_aq_start_lldp(struct i40e_h i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start); cmd->command = I40E_AQ_LLDP_AGENT_START; + + if (persist) { + if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) + cmd->command |= I40E_AQ_LLDP_AGENT_START_PERSIST; + else + i40e_debug(hw, I40E_DEBUG_ALL, + "Persistent Start LLDP not supported by current FW version.\n"); + } + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -4458,9 +4418,7 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dc (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw; enum i40e_status_code status; - if ((hw->mac.type != I40E_MAC_XL710) || - ((hw->aq.api_maj_ver < 1) || - ((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver < 6)))) + if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) return I40E_ERR_DEVICE_NOT_SUPPORTED; i40e_fill_default_direct_cmd_desc(&desc, @@ -6088,7 +6046,71 @@ enum i40e_status_code i40e_aq_debug_dump(struct i40e_h return status; } + /** + * i40e_enable_eee + * @hw: pointer to the hardware structure + * @enable: state of Energy Efficient Ethernet mode to be set + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 19 01:28:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C37215CE74E; Wed, 19 Jun 2019 01:28:15 +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 98B936F048; Wed, 19 Jun 2019 01:28:14 +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 850F81D636; Wed, 19 Jun 2019 01:28:14 +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 x5J1SEb6040922; Wed, 19 Jun 2019 01:28:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J1SEEs040921; Wed, 19 Jun 2019 01:28:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906190128.x5J1SEEs040921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 19 Jun 2019 01:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349182 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98B936F048 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 01:28:15 -0000 Author: cy Date: Wed Jun 19 01:28:13 2019 New Revision: 349182 URL: https://svnweb.freebsd.org/changeset/base/349182 Log: MFC r348985: Enclose a long multi-line single conditional statement in braces to improve legibility and aesthetics. Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 19 00:37:54 2019 (r349181) +++ stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 19 01:28:13 2019 (r349182) @@ -211,7 +211,7 @@ vnet_ipf_init(void) else defpass = "no-match -> block"; - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { printf("%s initialized. Default = %s all, Logging = %s%s\n", ipfilter_version, defpass, #ifdef IPFILTER_LOG @@ -225,6 +225,7 @@ vnet_ipf_init(void) "" #endif ); + } } VNET_SYSINIT(vnet_ipf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, vnet_ipf_init, NULL); From owner-svn-src-all@freebsd.org Wed Jun 19 01:28:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450B815CE74F; Wed, 19 Jun 2019 01:28:15 +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 D9CB06F049; Wed, 19 Jun 2019 01:28:14 +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 B11701D637; Wed, 19 Jun 2019 01:28:14 +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 x5J1SEOA040928; Wed, 19 Jun 2019 01:28:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5J1SEiM040927; Wed, 19 Jun 2019 01:28:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906190128.x5J1SEiM040927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 19 Jun 2019 01:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349182 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9CB06F049 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 01:28:15 -0000 Author: cy Date: Wed Jun 19 01:28:13 2019 New Revision: 349182 URL: https://svnweb.freebsd.org/changeset/base/349182 Log: MFC r348985: Enclose a long multi-line single conditional statement in braces to improve legibility and aesthetics. Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 19 00:37:54 2019 (r349181) +++ stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Jun 19 01:28:13 2019 (r349182) @@ -211,7 +211,7 @@ vnet_ipf_init(void) else defpass = "no-match -> block"; - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { printf("%s initialized. Default = %s all, Logging = %s%s\n", ipfilter_version, defpass, #ifdef IPFILTER_LOG @@ -225,6 +225,7 @@ vnet_ipf_init(void) "" #endif ); + } } VNET_SYSINIT(vnet_ipf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, vnet_ipf_init, NULL); From owner-svn-src-all@freebsd.org Wed Jun 19 03:33:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 06:41:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 08:39:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 08:49:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 11:22:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 11:37:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 13:19:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B027E15B8625; Wed, 19 Jun 2019 13:19:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 575888C743; Wed, 19 Jun 2019 13:19:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F30324E53; Wed, 19 Jun 2019 13:19:37 +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 x5JDJb7L016356; Wed, 19 Jun 2019 13:19:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JDJbaU016355; Wed, 19 Jun 2019 13:19:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906191319.x5JDJbaU016355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jun 2019 13:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349189 - stable/12/usr.bin/vtfontcvt X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 575888C743 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:19:37 -0000 Author: emaste Date: Wed Jun 19 13:19:36 2019 New Revision: 349189 URL: https://svnweb.freebsd.org/changeset/base/349189 Log: vtfontcvt: whitespace and other cleanup MFC r343842: vtfontcvt: whitespace cleanup MFC r348653: vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants MFC r348656: vtfontcvt: unwrap a line per style(9) PR: 205707 Submitted by: Dmitry Wagin Modified: stable/12/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/12/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 19 11:37:43 2019 (r349188) +++ stable/12/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 19 13:19:36 2019 (r349189) @@ -63,10 +63,10 @@ struct glyph { TAILQ_HEAD(glyph_list, glyph); static SLIST_HEAD(, glyph) glyph_hash[FONTCVT_NHASH]; static struct glyph_list glyphs[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(glyphs[0]), - TAILQ_HEAD_INITIALIZER(glyphs[1]), - TAILQ_HEAD_INITIALIZER(glyphs[2]), - TAILQ_HEAD_INITIALIZER(glyphs[3]), + TAILQ_HEAD_INITIALIZER(glyphs[0]), + TAILQ_HEAD_INITIALIZER(glyphs[1]), + TAILQ_HEAD_INITIALIZER(glyphs[2]), + TAILQ_HEAD_INITIALIZER(glyphs[3]), }; static unsigned int glyph_total, glyph_count[4], glyph_unique, glyph_dupe; @@ -79,10 +79,10 @@ struct mapping { TAILQ_HEAD(mapping_list, mapping); static struct mapping_list maps[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(maps[0]), - TAILQ_HEAD_INITIALIZER(maps[1]), - TAILQ_HEAD_INITIALIZER(maps[2]), - TAILQ_HEAD_INITIALIZER(maps[3]), + TAILQ_HEAD_INITIALIZER(maps[0]), + TAILQ_HEAD_INITIALIZER(maps[1]), + TAILQ_HEAD_INITIALIZER(maps[2]), + TAILQ_HEAD_INITIALIZER(maps[3]), }; static unsigned int mapping_total, map_count[4], map_folded_count[4], mapping_unique, mapping_dupe; @@ -201,8 +201,7 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * return (1); if (bytes_r != NULL) { gl = add_glyph(bytes_r, map_idx + 1, 0); - if (add_mapping(gl, curchar, - map_idx + 1) != 0) + if (add_mapping(gl, curchar, map_idx + 1) != 0) return (1); } } @@ -496,9 +495,9 @@ write_fnt(const char *filename) if (write_glyphs(fp) != 0 || write_mappings(fp, VFNT_MAP_NORMAL) != 0 || - write_mappings(fp, 1) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL_RH) != 0 || write_mappings(fp, VFNT_MAP_BOLD) != 0 || - write_mappings(fp, 3) != 0) { + write_mappings(fp, VFNT_MAP_BOLD_RH) != 0) { perror(filename); fclose(fp); return (1); From owner-svn-src-all@freebsd.org Wed Jun 19 13:30:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5892915B8B83; Wed, 19 Jun 2019 13:30:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46D58CF93; Wed, 19 Jun 2019 13:30:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id u13so38222309iop.0; Wed, 19 Jun 2019 06:30:28 -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; bh=PdFy362aLcggSk8VUY9UV/azc50rsYU5X9B8bJZDAXk=; b=Wa5MgjZxoht1XMgVjy/6oleJsMxDXopP78tBIR41u90cl0B8raI8SIzqkfO0Je0VVj r+qSEINxMThAB3aSn7e+D/5ro57mr9yWXPziYneChIJrZktjNp8XJxoeVPspWoNVPcY4 xz6t9ioDSGiMCRDpDWSD1r0nVZRvvip3sUugaxAdYNRznDr6UZ/I5cvLq4EnqrBvWMrd t0aPcm99Ov66ZvqAxf+3EUVUY8FrbKqOu6xzobT+r3SQW37EBIT5u9SFiq44b8b5jY4m RorbW1PfiTcj3DVbSsci+hGS0VGac6GgqVi7VQbdN9E9f9AGo36vzf2dAjB2R/QVAWk/ uW2g== X-Gm-Message-State: APjAAAWqFXdU7ngVAKjzxuuaBkvVWQWc+fIXPojecY1AS+niY2alG8+c iPI9fUoeiDXjpq9uYB3zyOEtA7wbZIluukZ7iETuyvHc X-Google-Smtp-Source: APXvYqxprj/LFGDvdcOvvUAxCR9DsxWKq3kgqELJgx0/C78ZFDeSImCgaL00976wTLtmlTfbI3H2bHaQeMcC/voXkmk= X-Received: by 2002:a6b:251:: with SMTP id 78mr67292738ioc.185.1560951026559; Wed, 19 Jun 2019 06:30:26 -0700 (PDT) MIME-Version: 1.0 References: <201906191319.x5JDJbaU016355@repo.freebsd.org> In-Reply-To: <201906191319.x5JDJbaU016355@repo.freebsd.org> From: Ed Maste Date: Wed, 19 Jun 2019 05:29:59 -0400 Message-ID: Subject: Re: svn commit: r349189 - stable/12/usr.bin/vtfontcvt To: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D46D58CF93 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:30:32 -0000 > Author: emaste > Date: Wed Jun 19 13:19:36 2019 > New Revision: 349189 > URL: https://svnweb.freebsd.org/changeset/base/349189 > > Log: > vtfontcvt: whitespace and other cleanup > > MFC r343842: vtfontcvt: whitespace cleanup That should be 348342. From owner-svn-src-all@freebsd.org Wed Jun 19 13:30:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 13:33:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C250515B8F9E; Wed, 19 Jun 2019 13:33:35 +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 644FD8D57E; Wed, 19 Jun 2019 13:33:35 +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 3892C251BC; Wed, 19 Jun 2019 13:33:35 +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 x5JDXZns026700; Wed, 19 Jun 2019 13:33:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JDXZI9026699; Wed, 19 Jun 2019 13:33:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906191333.x5JDXZI9026699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jun 2019 13:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349191 - stable/11/usr.bin/vtfontcvt X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/vtfontcvt X-SVN-Commit-Revision: 349191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 644FD8D57E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:33:36 -0000 Author: emaste Date: Wed Jun 19 13:33:34 2019 New Revision: 349191 URL: https://svnweb.freebsd.org/changeset/base/349191 Log: vtfontcvt: whitespace and other cleanup MFC r343842: vtfontcvt: whitespace cleanup MFC r348653: vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants MFC r348656: vtfontcvt: unwrap a line per style(9) PR: 205707 Submitted by: Dmitry Wagin Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/11/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 19 13:30:50 2019 (r349190) +++ stable/11/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 19 13:33:34 2019 (r349191) @@ -63,10 +63,10 @@ struct glyph { TAILQ_HEAD(glyph_list, glyph); static SLIST_HEAD(, glyph) glyph_hash[FONTCVT_NHASH]; static struct glyph_list glyphs[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(glyphs[0]), - TAILQ_HEAD_INITIALIZER(glyphs[1]), - TAILQ_HEAD_INITIALIZER(glyphs[2]), - TAILQ_HEAD_INITIALIZER(glyphs[3]), + TAILQ_HEAD_INITIALIZER(glyphs[0]), + TAILQ_HEAD_INITIALIZER(glyphs[1]), + TAILQ_HEAD_INITIALIZER(glyphs[2]), + TAILQ_HEAD_INITIALIZER(glyphs[3]), }; static unsigned int glyph_total, glyph_count[4], glyph_unique, glyph_dupe; @@ -79,10 +79,10 @@ struct mapping { TAILQ_HEAD(mapping_list, mapping); static struct mapping_list maps[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(maps[0]), - TAILQ_HEAD_INITIALIZER(maps[1]), - TAILQ_HEAD_INITIALIZER(maps[2]), - TAILQ_HEAD_INITIALIZER(maps[3]), + TAILQ_HEAD_INITIALIZER(maps[0]), + TAILQ_HEAD_INITIALIZER(maps[1]), + TAILQ_HEAD_INITIALIZER(maps[2]), + TAILQ_HEAD_INITIALIZER(maps[3]), }; static unsigned int mapping_total, map_count[4], map_folded_count[4], mapping_unique, mapping_dupe; @@ -201,8 +201,7 @@ add_char(unsigned curchar, unsigned map_idx, uint8_t * return (1); if (bytes_r != NULL) { gl = add_glyph(bytes_r, map_idx + 1, 0); - if (add_mapping(gl, curchar, - map_idx + 1) != 0) + if (add_mapping(gl, curchar, map_idx + 1) != 0) return (1); } } @@ -496,9 +495,9 @@ write_fnt(const char *filename) if (write_glyphs(fp) != 0 || write_mappings(fp, VFNT_MAP_NORMAL) != 0 || - write_mappings(fp, 1) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL_RH) != 0 || write_mappings(fp, VFNT_MAP_BOLD) != 0 || - write_mappings(fp, 3) != 0) { + write_mappings(fp, VFNT_MAP_BOLD_RH) != 0) { perror(filename); fclose(fp); return (1); From owner-svn-src-all@freebsd.org Wed Jun 19 13:41:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D0F615B91AA; Wed, 19 Jun 2019 13:41:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF8D48D862; Wed, 19 Jun 2019 13:41:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id r185so32255484iod.6; Wed, 19 Jun 2019 06:41:36 -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; bh=vbXZ2KQsSSD5bNnpVO4PsJKSt4FPtO+rLpCrlElxQKA=; b=dm0LAkG57atjX47cS9T/IDFC270vqceCamBOno7cN6aI2mY37nhxYXFfapnKwBiDUX I2EY9zHYXJvzPh/3vCWQ2lZ7FvipmAM3h3gkyuTkenBBWSIHWxCObLV56dtByMtLB1ZZ NDl/Mb9hwoJSJxxVErLb6oHyJ0uAgxNWoFLAcqkbQ2kdmQ64IQDJ0A0w3cuxHlLJlAm9 GLwSvVovAq+8QSvQuksV76QS4Gkpvy79pmPiIbXyg24ZroVotk2VXb3azu+MFC9vqUdV BRdYuLaWXiHUU6CUzjfhh50saS+Jh4lVzJEa/iIQpiG+KUn9sI10ohhuz6/w6KtELlPX OgdQ== X-Gm-Message-State: APjAAAUxYYn+r2F4zZDcTVD3TbiZID8tyjFxazi0Z15zdMbhv1SiwTqj +zXCSgoVlcx5qygfLN0SJXRG0WgHAUcoGgeKPkyB1w== X-Google-Smtp-Source: APXvYqyOQxHVHrlfrjqa0wYxlG0Pyey29433wD1h0ecZtFgrwFlK+2uD5oaacX9aYLhQiPu4h+R3hlOzkwbucwk2gj0= X-Received: by 2002:a6b:251:: with SMTP id 78mr67306616ioc.185.1560951194997; Wed, 19 Jun 2019 06:33:14 -0700 (PDT) MIME-Version: 1.0 References: <201906191319.x5JDJbaU016355@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Wed, 19 Jun 2019 05:32:47 -0400 Message-ID: Subject: Re: svn commit: r349189 - stable/12/usr.bin/vtfontcvt To: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EF8D48D862 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 13:41:37 -0000 On Wed, 19 Jun 2019 at 05:29, Ed Maste wrote: > > > Author: emaste > > Date: Wed Jun 19 13:19:36 2019 > > New Revision: 349189 > > URL: https://svnweb.freebsd.org/changeset/base/349189 > > > > Log: > > vtfontcvt: whitespace and other cleanup > > > > MFC r343842: vtfontcvt: whitespace cleanup > That should be 348342. Oops, no. 343842 is correct. From owner-svn-src-all@freebsd.org Wed Jun 19 13:55:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 14:37:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 14:57:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9571115BB1A6; Wed, 19 Jun 2019 14:57: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 9DFB068441; Wed, 19 Jun 2019 14:57:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EB825F99; Wed, 19 Jun 2019 14:57: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 x5JEvqZG069121; Wed, 19 Jun 2019 14:57:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JEvqOY069120; Wed, 19 Jun 2019 14:57:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906191457.x5JEvqOY069120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jun 2019 14:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349193 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 349193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DFB068441 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_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 14:57:53 -0000 Author: emaste Date: Wed Jun 19 14:57:51 2019 New Revision: 349193 URL: https://svnweb.freebsd.org/changeset/base/349193 Log: MFC r347228: makesyscalls: use @generated tag in generated files Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makesyscalls.sh as we've done for other generated files. Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/kern/makesyscalls.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/makesyscalls.sh ============================================================================== --- stable/12/sys/kern/makesyscalls.sh Wed Jun 19 13:55:00 2019 (r349192) +++ stable/12/sys/kern/makesyscalls.sh Wed Jun 19 14:57:51 2019 (r349193) @@ -120,18 +120,21 @@ sed -e ' capenabled_string = \"$capenabled\" "' + # Avoid a literal generated file tag here. + generated = "@" "generated"; + split(capenabled_string, capenabled, ","); printf "\n/* The casts are bogus but will do for now. */\n" > sysent printf "struct sysent %s[] = {\n",switchname > sysent printf "/*\n * System call switch table.\n *\n" > syssw - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > syssw printf " * $%s$\n", "FreeBSD" > syssw printf " */\n\n" > syssw printf "/*\n * System call prototypes.\n *\n" > sysarg - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > sysarg printf " * $%s$\n", "FreeBSD" > sysarg printf " */\n\n" > sysarg printf "#ifndef %s\n", sysproto_h > sysarg @@ -165,23 +168,23 @@ sed -e ' printf "\n#ifdef %s\n\n", compat11 > syscompat11 printf "/*\n * System call names.\n *\n" > sysnames - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > sysnames printf " * $%s$\n", "FreeBSD" > sysnames printf " */\n\n" > sysnames printf "const char *%s[] = {\n", namesname > sysnames printf "/*\n * System call numbers.\n *\n" > syshdr - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > syshdr printf " * $%s$\n", "FreeBSD" > syshdr printf " */\n\n" > syshdr printf "# FreeBSD system call object files.\n" > sysmk - printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk + printf "# DO NOT EDIT-- this file is automatically " generated ".\n" > sysmk printf "# $%s$\n", "FreeBSD" > sysmk printf "MIASM = " > sysmk printf "/*\n * System call argument to DTrace register array converstion.\n *\n" > systrace - printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > systrace printf " * $%s$\n", "FreeBSD" > systrace printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace printf "static void\nsystrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)\n{\n" > systrace From owner-svn-src-all@freebsd.org Wed Jun 19 15:26:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1C0C15BBD22; Wed, 19 Jun 2019 15:26:53 +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 5067D6AB99; Wed, 19 Jun 2019 15:26:53 +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 2C727264A8; Wed, 19 Jun 2019 15:26:53 +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 x5JFQrG2085339; Wed, 19 Jun 2019 15:26:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JFQr5P085338; Wed, 19 Jun 2019 15:26:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906191526.x5JFQr5P085338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 19 Jun 2019 15:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349194 - releng/11.3/release/pkg_repos X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/release/pkg_repos X-SVN-Commit-Revision: 349194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5067D6AB99 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.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 15:26:53 -0000 Author: gjb Date: Wed Jun 19 15:26:52 2019 New Revision: 349194 URL: https://svnweb.freebsd.org/changeset/base/349194 Log: Update the pkg.conf used to populate the dvd1.iso to use the release_3 package set. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.3/release/pkg_repos/release-dvd.conf Modified: releng/11.3/release/pkg_repos/release-dvd.conf ============================================================================== --- releng/11.3/release/pkg_repos/release-dvd.conf Wed Jun 19 14:57:51 2019 (r349193) +++ releng/11.3/release/pkg_repos/release-dvd.conf Wed Jun 19 15:26:52 2019 (r349194) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_3", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From owner-svn-src-all@freebsd.org Wed Jun 19 15:36:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 16:09:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 16:25:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B56015BE028; Wed, 19 Jun 2019 16:25:41 +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 E37FF6D5F0; Wed, 19 Jun 2019 16:25:40 +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 B03DE26F30; Wed, 19 Jun 2019 16:25:40 +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 x5JGPeWb017923; Wed, 19 Jun 2019 16:25:40 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JGPe6r017921; Wed, 19 Jun 2019 16:25:40 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201906191625.x5JGPe6r017921@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 16:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349197 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 349197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E37FF6D5F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 16:25:41 -0000 Author: jtl Date: Wed Jun 19 16:25:39 2019 New Revision: 349197 URL: https://svnweb.freebsd.org/changeset/base/349197 Log: MFC r349192: 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. Approved by: so (gordon) Security: CVE-2019-5599 Modified: stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_stacks/tcp_rack.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Wed Jun 19 16:09:20 2019 (r349196) +++ stable/12/sys/netinet/tcp_stacks/rack.c Wed Jun 19 16:25:39 2019 (r349197) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2016-2018 - * Netflix Inc. All rights reserved. + * 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 @@ -203,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; @@ -228,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; @@ -261,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); @@ -445,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); @@ -622,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, @@ -757,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), @@ -1121,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) { @@ -1132,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; @@ -3955,7 +4011,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 @@ -4016,7 +4072,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: stable/12/sys/netinet/tcp_stacks/tcp_rack.h ============================================================================== --- stable/12/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 16:09:20 2019 (r349196) +++ stable/12/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 16:25:39 2019 (r349197) @@ -55,8 +55,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); @@ -242,7 +244,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; @@ -311,7 +313,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-all@freebsd.org Wed Jun 19 16:41:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FCF215BE6BA; Wed, 19 Jun 2019 16:41:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 236C76DF80; Wed, 19 Jun 2019 16:41:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F245D2712C; Wed, 19 Jun 2019 16:41:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JGfI5n027806; Wed, 19 Jun 2019 16:41:18 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JGfIsY027804; Wed, 19 Jun 2019 16:41:18 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201906191641.x5JGfIsY027804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 19 Jun 2019 16:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349198 - releng/12.0/sys/net X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.0/sys/net X-SVN-Commit-Revision: 349198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 236C76DF80 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 16:41:19 -0000 Author: gordon Date: Wed Jun 19 16:41:18 2019 New Revision: 349198 URL: https://svnweb.freebsd.org/changeset/base/349198 Log: Fix incorrect locking in networking stack. Approved by: so Security: FreeBSD-EN-19:11.net Modified: releng/12.0/sys/net/if.c releng/12.0/sys/net/if_var.h Modified: releng/12.0/sys/net/if.c ============================================================================== --- releng/12.0/sys/net/if.c Wed Jun 19 16:25:39 2019 (r349197) +++ releng/12.0/sys/net/if.c Wed Jun 19 16:41:18 2019 (r349198) @@ -62,6 +62,8 @@ #include #include #include +#include +#include #include #include @@ -1755,6 +1757,30 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) ifd->ifi_noproto = ifp->if_get_counter(ifp, IFCOUNTER_NOPROTO); } +struct ifnet_read_lock { + struct mtx mtx; /* lock protecting tracker below */ + struct epoch_tracker et; +}; + +DPCPU_DEFINE_STATIC(struct ifnet_read_lock, ifnet_addr_read_lock); +DPCPU_DEFINE_STATIC(struct ifnet_read_lock, ifnet_maddr_read_lock); + +static void +ifnet_read_lock_init(void __unused *arg) +{ + struct ifnet_read_lock *pifrl; + int cpu; + + CPU_FOREACH(cpu) { + pifrl = DPCPU_ID_PTR(cpu, ifnet_addr_read_lock); + mtx_init(&pifrl->mtx, "ifnet_addr_read_lock", NULL, MTX_DEF); + + pifrl = DPCPU_ID_PTR(cpu, ifnet_maddr_read_lock); + mtx_init(&pifrl->mtx, "ifnet_maddr_read_lock", NULL, MTX_DEF); + } +} +SYSINIT(ifnet_read_lock_init, SI_SUB_CPU + 1, SI_ORDER_FIRST, &ifnet_read_lock_init, NULL); + /* * Wrapper functions for struct ifnet address list locking macros. These are * used by kernel modules to avoid encoding programming interface or binary @@ -1764,35 +1790,47 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) void if_addr_rlock(struct ifnet *ifp) { - MPASS(*(uint64_t *)&ifp->if_addr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); + struct ifnet_read_lock *pifrl; + + sched_pin(); + pifrl = DPCPU_PTR(ifnet_addr_read_lock); + mtx_lock(&pifrl->mtx); + epoch_enter_preempt(net_epoch_preempt, &pifrl->et); } void if_addr_runlock(struct ifnet *ifp) { - epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); -#ifdef INVARIANTS - bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); -#endif + struct ifnet_read_lock *pifrl; + + pifrl = DPCPU_PTR(ifnet_addr_read_lock); + + epoch_exit_preempt(net_epoch_preempt, &pifrl->et); + mtx_unlock(&pifrl->mtx); + sched_unpin(); } void if_maddr_rlock(if_t ifp) { + struct ifnet_read_lock *pifrl; - MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); + sched_pin(); + pifrl = DPCPU_PTR(ifnet_maddr_read_lock); + mtx_lock(&pifrl->mtx); + epoch_enter_preempt(net_epoch_preempt, &pifrl->et); } void if_maddr_runlock(if_t ifp) { + struct ifnet_read_lock *pifrl; - epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); -#ifdef INVARIANTS - bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); -#endif + pifrl = DPCPU_PTR(ifnet_maddr_read_lock); + + epoch_exit_preempt(net_epoch_preempt, &pifrl->et); + mtx_unlock(&pifrl->mtx); + sched_unpin(); } /* Modified: releng/12.0/sys/net/if_var.h ============================================================================== --- releng/12.0/sys/net/if_var.h Wed Jun 19 16:25:39 2019 (r349197) +++ releng/12.0/sys/net/if_var.h Wed Jun 19 16:41:18 2019 (r349198) @@ -381,8 +381,7 @@ struct ifnet { */ struct netdump_methods *if_netdump_methods; struct epoch_context if_epoch_ctx; - struct epoch_tracker if_addr_et; - struct epoch_tracker if_maddr_et; + void *if_unused[4]; /* * Spare fields to be added before branching a stable branch, so From owner-svn-src-all@freebsd.org Wed Jun 19 16:43:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F29615BE8BD; Wed, 19 Jun 2019 16:43:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A49AC6E198; Wed, 19 Jun 2019 16:43:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8040727281; Wed, 19 Jun 2019 16:43:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JGh6IA027936; Wed, 19 Jun 2019 16:43:06 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JGh6oW027935; Wed, 19 Jun 2019 16:43:06 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201906191643.x5JGh6oW027935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 19 Jun 2019 16:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349199 - releng/12.0/sys/netinet/tcp_stacks X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.0/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 349199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A49AC6E198 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 16:43:07 -0000 Author: gordon Date: Wed Jun 19 16:43:05 2019 New Revision: 349199 URL: https://svnweb.freebsd.org/changeset/base/349199 Log: Add ability to limit split map entries to prevent resource exhaustion in non-default RACK TCP stack. Approved by: so Security: FreeBSD-SA-19:08.rack Security: CVE-2019-5599 Modified: releng/12.0/sys/netinet/tcp_stacks/rack.c releng/12.0/sys/netinet/tcp_stacks/tcp_rack.h Modified: releng/12.0/sys/netinet/tcp_stacks/rack.c ============================================================================== --- releng/12.0/sys/netinet/tcp_stacks/rack.c Wed Jun 19 16:41:18 2019 (r349198) +++ releng/12.0/sys/netinet/tcp_stacks/rack.c Wed Jun 19 16:43:05 2019 (r349199) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2018 + * Copyright (c) 2016-2019 * Netflix Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -203,6 +203,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; @@ -228,6 +229,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; @@ -261,6 +264,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); @@ -445,6 +450,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); @@ -622,6 +629,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, @@ -757,7 +769,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), @@ -1121,10 +1145,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) { @@ -1132,14 +1157,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; @@ -3955,7 +4012,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 @@ -4016,7 +4073,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: releng/12.0/sys/netinet/tcp_stacks/tcp_rack.h ============================================================================== --- releng/12.0/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 16:41:18 2019 (r349198) +++ releng/12.0/sys/netinet/tcp_stacks/tcp_rack.h Wed Jun 19 16:43:05 2019 (r349199) @@ -55,8 +55,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); @@ -242,7 +244,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; @@ -311,7 +313,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-all@freebsd.org Wed Jun 19 16:44:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 513C415BE94F; Wed, 19 Jun 2019 16:44:08 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E171C6E2D6; Wed, 19 Jun 2019 16:44:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD08C27282; Wed, 19 Jun 2019 16:44:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JGi7uS028044; Wed, 19 Jun 2019 16:44:07 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JGi7gl028043; Wed, 19 Jun 2019 16:44:07 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201906191644.x5JGi7gl028043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 19 Jun 2019 16:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349200 - in releng/12.0: . sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng/12.0: . sys/conf X-SVN-Commit-Revision: 349200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E171C6E2D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 16:44:08 -0000 Author: gordon Date: Wed Jun 19 16:44:07 2019 New Revision: 349200 URL: https://svnweb.freebsd.org/changeset/base/349200 Log: Add UPDATING entries for today's release. Bump patch version. Also fix the previous UPDATING entry. MDS was an SA, not an EN. Approved by: so Modified: releng/12.0/UPDATING releng/12.0/sys/conf/newvers.sh Modified: releng/12.0/UPDATING ============================================================================== --- releng/12.0/UPDATING Wed Jun 19 16:43:05 2019 (r349199) +++ releng/12.0/UPDATING Wed Jun 19 16:44:07 2019 (r349200) @@ -16,7 +16,15 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. -20190515 p5 FreeBSD-EN-19:07.mds [revised] +20190619 p6 FreeBSD-EN-19:11.net + FreeBSD-SA-19:08.rack + + Fix incorrect locking in networking stack [EN-19:11.net] + + Add ability to limit split map entries to prevent resource exhaustion + in non-default RACK TCP stack [SA-19:08.rack] + +20190515 p5 FreeBSD-SA-19:07.mds [revised] Fixed error in patch causing panic on i386 architecture. [SA-19:07.mds] Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- releng/12.0/sys/conf/newvers.sh Wed Jun 19 16:43:05 2019 (r349199) +++ releng/12.0/sys/conf/newvers.sh Wed Jun 19 16:44:07 2019 (r349200) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Jun 19 18:47:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 19:19:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 19:58:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A3915C845C; Wed, 19 Jun 2019 19:58:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA74A77D14; Wed, 19 Jun 2019 19:58:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 700131365; Wed, 19 Jun 2019 19:58:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JJwiIL030611; Wed, 19 Jun 2019 19:58:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JJwiFQ030610; Wed, 19 Jun 2019 19:58:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906191958.x5JJwiFQ030610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 19:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349203 - stable/11/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 349203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA74A77D14 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.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 19:58:45 -0000 Author: avg Date: Wed Jun 19 19:58:43 2019 New Revision: 349203 URL: https://svnweb.freebsd.org/changeset/base/349203 Log: MFC r344359: fix userland illumos taskq code to pass relative timeout to cv_timedwait Sponsored by: Panzura Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Jun 19 19:19:37 2019 (r349202) +++ stable/11/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Jun 19 19:58:43 2019 (r349203) @@ -79,8 +79,13 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nal * immediately retry the allocation. */ tq->tq_maxalloc_wait++; +#ifdef __FreeBSD__ rv = cv_timedwait(&tq->tq_maxalloc_cv, + &tq->tq_lock, hz); +#else + rv = cv_timedwait(&tq->tq_maxalloc_cv, &tq->tq_lock, ddi_get_lbolt() + hz); +#endif tq->tq_maxalloc_wait--; if (rv > 0) goto again; /* signaled */ From owner-svn-src-all@freebsd.org Wed Jun 19 20:01:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308F515C8561; Wed, 19 Jun 2019 20:01:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C71D280075; Wed, 19 Jun 2019 20:01:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F75D149B; Wed, 19 Jun 2019 20:01:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JK1D8g030860; Wed, 19 Jun 2019 20:01:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JK1Drm030859; Wed, 19 Jun 2019 20:01:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192001.x5JK1Drm030859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349204 - stable/11/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 349204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C71D280075 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.996,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:01:14 -0000 Author: avg Date: Wed Jun 19 20:01:13 2019 New Revision: 349204 URL: https://svnweb.freebsd.org/changeset/base/349204 Log: MFC r344360,r344361: zpool.8: document -D flag for zpool status Also, sort zpool status flags in the same order as in illumos manual. Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jun 19 19:58:43 2019 (r349203) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Jun 19 20:01:13 2019 (r349204) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2018 +.Dd February 20, 2019 .Dt ZPOOL 8 .Os .Sh NAME @@ -187,7 +187,7 @@ .Op Ar device ... .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1862,7 +1862,7 @@ section, above, for more information on the available .It Xo .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1891,14 +1891,12 @@ done and the estimated time to completion. Both of the because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent -.It Fl x -Only display status for pools that are exhibiting errors or are otherwise -unavailable. -Warnings about pools not using the latest on-disk format, having non-native -block size or disabled features will not be included. -.It Fl v -Displays verbose data error information, printing out a complete list of all -data errors since the last complete pool scrub. +.It Fl D +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. .It Fl T Cm d Ns | Ns Cm u Print a timestamp. .Pp @@ -1910,6 +1908,14 @@ Use modifier .Cm u for unixtime .Pq equals Qq Ic date +%s . +.It Fl v +Displays verbose data error information, printing out a complete list of all +data errors since the last complete pool scrub. +.It Fl x +Only display status for pools that are exhibiting errors or are otherwise +unavailable. +Warnings about pools not using the latest on-disk format, having non-native +block size or disabled features will not be included. .El .It Xo .Nm From owner-svn-src-all@freebsd.org Wed Jun 19 20:03:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3D3E15C8778; Wed, 19 Jun 2019 20:03:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A941802B1; Wed, 19 Jun 2019 20:03:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C9791506; Wed, 19 Jun 2019 20:03:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JK33eC035742; Wed, 19 Jun 2019 20:03:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JK33L6035741; Wed, 19 Jun 2019 20:03:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192003.x5JK33L6035741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349205 - stable/11/sys/dev/intpm X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/intpm X-SVN-Commit-Revision: 349205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A941802B1 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:03:03 -0000 Author: avg Date: Wed Jun 19 20:03:02 2019 New Revision: 349205 URL: https://svnweb.freebsd.org/changeset/base/349205 Log: MFC r345411: intpm: change translation of HBA error status to smbus(4) errors PIIX4_SMBHSTSTAT_ERR can be set for several reasons that, unfortunately, cannot be distinguished, but the most typical case is a missing or hung slave (SMB_ENOACK). PIIX4_SMBHSTSTAT_FAIL means failed or killed / aborted transaction, so it's previous mapping to SMB_ENOACK was not ideal. After this change an smb(4) access to a missing slave results in ENXIO rather than EIO. To me, that seems to be more appropriate. Modified: stable/11/sys/dev/intpm/intpm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/intpm/intpm.c ============================================================================== --- stable/11/sys/dev/intpm/intpm.c Wed Jun 19 20:01:13 2019 (r349204) +++ stable/11/sys/dev/intpm/intpm.c Wed Jun 19 20:03:02 2019 (r349205) @@ -521,12 +521,19 @@ intsmb_error(device_t dev, int status) { int error = 0; + /* + * PIIX4_SMBHSTSTAT_ERR can mean either of + * - SMB_ENOACK ("Unclaimed cycle"), + * - SMB_ETIMEOUT ("Host device time-out"), + * - SMB_EINVAL ("Illegal command field"). + * SMB_ENOACK seems to be most typical. + */ if (status & PIIX4_SMBHSTSTAT_ERR) - error |= SMB_EBUSERR; + error |= SMB_ENOACK; if (status & PIIX4_SMBHSTSTAT_BUSC) error |= SMB_ECOLLI; if (status & PIIX4_SMBHSTSTAT_FAIL) - error |= SMB_ENOACK; + error |= SMB_EABORT; if (error != 0 && bootverbose) device_printf(dev, "error = %d, status = %#x\n", error, status); From owner-svn-src-all@freebsd.org Wed Jun 19 20:05:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A5E215C8814; Wed, 19 Jun 2019 20:05:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A51288040A; Wed, 19 Jun 2019 20:05:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CB9C1507; Wed, 19 Jun 2019 20:05:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JK5KN3035904; Wed, 19 Jun 2019 20:05:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JK5KEP035903; Wed, 19 Jun 2019 20:05:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192005.x5JK5KEP035903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349206 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 349206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A51288040A 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:05:21 -0000 Author: avg Date: Wed Jun 19 20:05:20 2019 New Revision: 349206 URL: https://svnweb.freebsd.org/changeset/base/349206 Log: MFC r348152: Add USB ID for CP2112 Modified: stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Wed Jun 19 20:03:02 2019 (r349205) +++ stable/11/sys/dev/usb/usbdevs Wed Jun 19 20:05:20 2019 (r349206) @@ -4201,6 +4201,7 @@ product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone +product SILABS CP2112 0xea90 CP2112 HID USB-to-SMBus Bridge with GPIO product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 product SILABS USBPULSE100 0xf003 USBpulse100 From owner-svn-src-all@freebsd.org Wed Jun 19 20:09:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED8A15C8996; Wed, 19 Jun 2019 20:09:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8D8180656; Wed, 19 Jun 2019 20:09:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B219A150C; Wed, 19 Jun 2019 20:09:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JK94tq036298; Wed, 19 Jun 2019 20:09:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JK94Hi036297; Wed, 19 Jun 2019 20:09:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192009.x5JK94Hi036297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349207 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 349207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8D8180656 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:09:05 -0000 Author: avg Date: Wed Jun 19 20:09:04 2019 New Revision: 349207 URL: https://svnweb.freebsd.org/changeset/base/349207 Log: MFC r348152: Add USB ID for CP2112 Modified: stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Wed Jun 19 20:05:20 2019 (r349206) +++ stable/12/sys/dev/usb/usbdevs Wed Jun 19 20:09:04 2019 (r349207) @@ -4343,6 +4343,7 @@ product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone +product SILABS CP2112 0xea90 CP2112 HID USB-to-SMBus Bridge with GPIO product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 product SILABS USBPULSE100 0xf003 USBpulse100 From owner-svn-src-all@freebsd.org Wed Jun 19 20:12:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 337B015C8ADC; Wed, 19 Jun 2019 20:12:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD990808BB; Wed, 19 Jun 2019 20:12:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82EB1688; Wed, 19 Jun 2019 20:12:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKC1rI040507; Wed, 19 Jun 2019 20:12:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKC1kN040505; Wed, 19 Jun 2019 20:12:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192012.x5JKC1kN040505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349208 - in stable/11: share/man/man4 sys/dev/gpio X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/gpio X-SVN-Commit-Revision: 349208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD990808BB 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:12:02 -0000 Author: avg Date: Wed Jun 19 20:12:00 2019 New Revision: 349208 URL: https://svnweb.freebsd.org/changeset/base/349208 Log: MFC r348153-r348155: gpioled: add a new hint for initial state hint.gpioled.%d.state determines the initial state of the LED when the driver takes control over it: 0 - the LED is off 1 - the LED is on -1 - the LED is kept as it was While here, add a module version declaration. Modified: stable/11/share/man/man4/gpioled.4 stable/11/sys/dev/gpio/gpioled.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/gpioled.4 ============================================================================== --- stable/11/share/man/man4/gpioled.4 Wed Jun 19 20:09:04 2019 (r349207) +++ stable/11/share/man/man4/gpioled.4 Wed Jun 19 20:12:00 2019 (r349208) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2014 +.Dd May 23, 2019 .Dt GPIOLED 4 .Os .Sh NAME @@ -71,6 +71,10 @@ to create for Which pin on the GPIO interface to map to this instance. Please note that this mask should only ever have one bit set (any other bits - i.e., pins - will be ignored). +.It Va hint.gpioled.%d.state +The initial state of the LED when the driver takes control over it. +If set to 1 or 0, the LED will be on or off correspondingly. +If set to -1, the LED will be kept in its original state. .El .Pp On a Modified: stable/11/sys/dev/gpio/gpioled.c ============================================================================== --- stable/11/sys/dev/gpio/gpioled.c Wed Jun 19 20:09:04 2019 (r349207) +++ stable/11/sys/dev/gpio/gpioled.c Wed Jun 19 20:12:00 2019 (r349208) @@ -108,6 +108,8 @@ gpioled_attach(device_t dev) if (resource_string_value(device_get_name(dev), device_get_unit(dev), "name", &name)) name = NULL; + resource_int_value(device_get_name(dev), + device_get_unit(dev), "state", &state); sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name : device_get_nameunit(dev), state); @@ -148,3 +150,4 @@ static driver_t gpioled_driver = { DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0); MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); +MODULE_VERSION(gpioled, 1); From owner-svn-src-all@freebsd.org Wed Jun 19 20:15:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E5815C8E0B; Wed, 19 Jun 2019 20:15:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91F1780CF7; Wed, 19 Jun 2019 20:15:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C8C116B1; Wed, 19 Jun 2019 20:15:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKFsYV041538; Wed, 19 Jun 2019 20:15:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKFsii041537; Wed, 19 Jun 2019 20:15:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192015.x5JKFsii041537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349209 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 349209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91F1780CF7 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.996,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:15:55 -0000 Author: avg Date: Wed Jun 19 20:15:53 2019 New Revision: 349209 URL: https://svnweb.freebsd.org/changeset/base/349209 Log: MFC r348159: add mrsas_shutdown method Sponsored by: Panzura Modified: stable/12/sys/dev/mrsas/mrsas.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.c Wed Jun 19 20:12:00 2019 (r349208) +++ stable/12/sys/dev/mrsas/mrsas.c Wed Jun 19 20:15:53 2019 (r349209) @@ -1182,6 +1182,39 @@ mrsas_detach(device_t dev) return (0); } +static int +mrsas_shutdown(device_t dev) +{ + struct mrsas_softc *sc; + int i; + + sc = device_get_softc(dev); + sc->remove_in_progress = 1; + if (panicstr == NULL) { + if (sc->ocr_thread_active) + wakeup(&sc->ocr_chan); + i = 0; + while (sc->reset_in_progress && i < 15) { + i++; + if ((i % MRSAS_RESET_NOTICE_INTERVAL) == 0) { + mrsas_dprint(sc, MRSAS_INFO, + "[%2d]waiting for OCR to be finished " + "from %s\n", i, __func__); + } + pause("mr_shutdown", hz); + } + if (sc->reset_in_progress) { + mrsas_dprint(sc, MRSAS_INFO, + "gave up waiting for OCR to be finished\n"); + } + } + + mrsas_flush_cache(sc); + mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); + mrsas_disable_intr(sc); + return (0); +} + /* * mrsas_free_mem: Frees allocated memory * input: Adapter instance soft state @@ -5028,6 +5061,7 @@ static device_method_t mrsas_methods[] = { DEVMETHOD(device_probe, mrsas_probe), DEVMETHOD(device_attach, mrsas_attach), DEVMETHOD(device_detach, mrsas_detach), + DEVMETHOD(device_shutdown, mrsas_shutdown), DEVMETHOD(device_suspend, mrsas_suspend), DEVMETHOD(device_resume, mrsas_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), From owner-svn-src-all@freebsd.org Wed Jun 19 20:16:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A9AA15C8E84; Wed, 19 Jun 2019 20:16:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBEB80E0D; Wed, 19 Jun 2019 20:16:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E09DF16B2; Wed, 19 Jun 2019 20:16:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKGgit041641; Wed, 19 Jun 2019 20:16:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKGgiB041640; Wed, 19 Jun 2019 20:16:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192016.x5JKGgiB041640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349210 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 349210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FBEB80E0D 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:16:43 -0000 Author: avg Date: Wed Jun 19 20:16:42 2019 New Revision: 349210 URL: https://svnweb.freebsd.org/changeset/base/349210 Log: MFC r348159: add mrsas_shutdown method Sponsored by: Panzura Modified: stable/11/sys/dev/mrsas/mrsas.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Wed Jun 19 20:15:53 2019 (r349209) +++ stable/11/sys/dev/mrsas/mrsas.c Wed Jun 19 20:16:42 2019 (r349210) @@ -1182,6 +1182,39 @@ mrsas_detach(device_t dev) return (0); } +static int +mrsas_shutdown(device_t dev) +{ + struct mrsas_softc *sc; + int i; + + sc = device_get_softc(dev); + sc->remove_in_progress = 1; + if (panicstr == NULL) { + if (sc->ocr_thread_active) + wakeup(&sc->ocr_chan); + i = 0; + while (sc->reset_in_progress && i < 15) { + i++; + if ((i % MRSAS_RESET_NOTICE_INTERVAL) == 0) { + mrsas_dprint(sc, MRSAS_INFO, + "[%2d]waiting for OCR to be finished " + "from %s\n", i, __func__); + } + pause("mr_shutdown", hz); + } + if (sc->reset_in_progress) { + mrsas_dprint(sc, MRSAS_INFO, + "gave up waiting for OCR to be finished\n"); + } + } + + mrsas_flush_cache(sc); + mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); + mrsas_disable_intr(sc); + return (0); +} + /* * mrsas_free_mem: Frees allocated memory * input: Adapter instance soft state @@ -5028,6 +5061,7 @@ static device_method_t mrsas_methods[] = { DEVMETHOD(device_probe, mrsas_probe), DEVMETHOD(device_attach, mrsas_attach), DEVMETHOD(device_detach, mrsas_detach), + DEVMETHOD(device_shutdown, mrsas_shutdown), DEVMETHOD(device_suspend, mrsas_suspend), DEVMETHOD(device_resume, mrsas_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), From owner-svn-src-all@freebsd.org Wed Jun 19 20:18:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F38CD15C8F81; Wed, 19 Jun 2019 20:18:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6783F80FBE; Wed, 19 Jun 2019 20:18:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3678816B3; Wed, 19 Jun 2019 20:18:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKIZqE041805; Wed, 19 Jun 2019 20:18:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKIYXU041804; Wed, 19 Jun 2019 20:18:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192018.x5JKIYXU041804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349211 - stable/12/sys/dev/amdgpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/amdgpio X-SVN-Commit-Revision: 349211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6783F80FBE 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:18:36 -0000 Author: avg Date: Wed Jun 19 20:18:34 2019 New Revision: 349211 URL: https://svnweb.freebsd.org/changeset/base/349211 Log: MFC r348227: amdgpio: remove new line symbols from pin names Modified: stable/12/sys/dev/amdgpio/amdgpio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdgpio/amdgpio.c ============================================================================== --- stable/12/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:16:42 2019 (r349210) +++ stable/12/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:18:34 2019 (r349211) @@ -383,7 +383,7 @@ amdgpio_attach(device_t dev) /* Initialize all possible pins to be Invalid */ for (i = 0; i < AMD_GPIO_PINS_MAX ; i++) { snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, - "Unexposed PIN %d\n", i); + "Unexposed PIN %d", i); sc->sc_gpio_pins[i].gp_pin = -1; sc->sc_gpio_pins[i].gp_caps = 0; sc->sc_gpio_pins[i].gp_flags = 0; @@ -393,12 +393,13 @@ amdgpio_attach(device_t dev) for (i = 0; i < AMD_GPIO_PINS_EXPOSED ; i++) { pin = kernzp_pins[i].pin_num; bank = pin/AMD_GPIO_PINS_PER_BANK; - snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s\n", + snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s", AMD_GPIO_PREFIX, bank, kernzp_pins[i].pin_name); sc->sc_gpio_pins[pin].gp_pin = pin; sc->sc_gpio_pins[pin].gp_caps = AMDGPIO_DEFAULT_CAPS; - sc->sc_gpio_pins[pin].gp_flags = (amdgpio_is_pin_output(sc, pin)? - GPIO_PIN_OUTPUT : GPIO_PIN_INPUT); + sc->sc_gpio_pins[pin].gp_flags = + amdgpio_is_pin_output(sc, pin) ? + GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; } sc->sc_busdev = gpiobus_attach_bus(dev); From owner-svn-src-all@freebsd.org Wed Jun 19 20:18:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74CF415C8FBF; Wed, 19 Jun 2019 20:18:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19469810B7; Wed, 19 Jun 2019 20:18:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3E3F16B4; Wed, 19 Jun 2019 20:18:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKInoa041862; Wed, 19 Jun 2019 20:18:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKInDj041861; Wed, 19 Jun 2019 20:18:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192018.x5JKInDj041861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349212 - stable/11/sys/dev/amdgpio X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/amdgpio X-SVN-Commit-Revision: 349212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19469810B7 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:18:50 -0000 Author: avg Date: Wed Jun 19 20:18:49 2019 New Revision: 349212 URL: https://svnweb.freebsd.org/changeset/base/349212 Log: FC r348227: amdgpio: remove new line symbols from pin names Modified: stable/11/sys/dev/amdgpio/amdgpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdgpio/amdgpio.c ============================================================================== --- stable/11/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:18:34 2019 (r349211) +++ stable/11/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:18:49 2019 (r349212) @@ -383,7 +383,7 @@ amdgpio_attach(device_t dev) /* Initialize all possible pins to be Invalid */ for (i = 0; i < AMD_GPIO_PINS_MAX ; i++) { snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, - "Unexposed PIN %d\n", i); + "Unexposed PIN %d", i); sc->sc_gpio_pins[i].gp_pin = -1; sc->sc_gpio_pins[i].gp_caps = 0; sc->sc_gpio_pins[i].gp_flags = 0; @@ -393,12 +393,13 @@ amdgpio_attach(device_t dev) for (i = 0; i < AMD_GPIO_PINS_EXPOSED ; i++) { pin = kernzp_pins[i].pin_num; bank = pin/AMD_GPIO_PINS_PER_BANK; - snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s\n", + snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s", AMD_GPIO_PREFIX, bank, kernzp_pins[i].pin_name); sc->sc_gpio_pins[pin].gp_pin = pin; sc->sc_gpio_pins[pin].gp_caps = AMDGPIO_DEFAULT_CAPS; - sc->sc_gpio_pins[pin].gp_flags = (amdgpio_is_pin_output(sc, pin)? - GPIO_PIN_OUTPUT : GPIO_PIN_INPUT); + sc->sc_gpio_pins[pin].gp_flags = + amdgpio_is_pin_output(sc, pin) ? + GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; } sc->sc_busdev = gpiobus_attach_bus(dev); From owner-svn-src-all@freebsd.org Wed Jun 19 20:20:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0BDD15C9050; Wed, 19 Jun 2019 20:20:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 877578123E; Wed, 19 Jun 2019 20:20:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 621D216C4; Wed, 19 Jun 2019 20:20:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKK3ga042010; Wed, 19 Jun 2019 20:20:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKK3Ye042009; Wed, 19 Jun 2019 20:20:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192020.x5JKK3Ye042009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349213 - stable/12/sys/dev/amdgpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/amdgpio X-SVN-Commit-Revision: 349213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 877578123E 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.996,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:20:04 -0000 Author: avg Date: Wed Jun 19 20:20:02 2019 New Revision: 349213 URL: https://svnweb.freebsd.org/changeset/base/349213 Log: MFC r348228: amdgpio: fix reading status of input pins Modified: stable/12/sys/dev/amdgpio/amdgpio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdgpio/amdgpio.c ============================================================================== --- stable/12/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:18:49 2019 (r349212) +++ stable/12/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:20:02 2019 (r349213) @@ -264,10 +264,17 @@ amdgpio_pin_get(device_t dev, uint32_t pin, unsigned i reg = AMDGPIO_PIN_REGISTER(pin); val = amdgpio_read_4(sc, reg); - if (val & BIT(OUTPUT_VALUE_OFF)) - *value = GPIO_PIN_HIGH; - else - *value = GPIO_PIN_LOW; + if ((sc->sc_gpio_pins[pin].gp_flags & GPIO_PIN_OUTPUT) != 0) { + if (val & BIT(OUTPUT_VALUE_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } else { + if (val & BIT(PIN_STS_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } dprintf("pin %d value 0x%x\n", pin, *value); From owner-svn-src-all@freebsd.org Wed Jun 19 20:21:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 718D515C9145; Wed, 19 Jun 2019 20:21:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 196BE81580; Wed, 19 Jun 2019 20:21:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0089F1835; Wed, 19 Jun 2019 20:21:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKLYbQ046638; Wed, 19 Jun 2019 20:21:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKLYdv046637; Wed, 19 Jun 2019 20:21:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192021.x5JKLYdv046637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349214 - stable/11/sys/dev/amdgpio X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/amdgpio X-SVN-Commit-Revision: 349214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 196BE81580 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:21:35 -0000 Author: avg Date: Wed Jun 19 20:21:34 2019 New Revision: 349214 URL: https://svnweb.freebsd.org/changeset/base/349214 Log: MFC r348228: amdgpio: fix reading status of input pins Modified: stable/11/sys/dev/amdgpio/amdgpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdgpio/amdgpio.c ============================================================================== --- stable/11/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:20:02 2019 (r349213) +++ stable/11/sys/dev/amdgpio/amdgpio.c Wed Jun 19 20:21:34 2019 (r349214) @@ -264,10 +264,17 @@ amdgpio_pin_get(device_t dev, uint32_t pin, unsigned i reg = AMDGPIO_PIN_REGISTER(pin); val = amdgpio_read_4(sc, reg); - if (val & BIT(OUTPUT_VALUE_OFF)) - *value = GPIO_PIN_HIGH; - else - *value = GPIO_PIN_LOW; + if ((sc->sc_gpio_pins[pin].gp_flags & GPIO_PIN_OUTPUT) != 0) { + if (val & BIT(OUTPUT_VALUE_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } else { + if (val & BIT(PIN_STS_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + } dprintf("pin %d value 0x%x\n", pin, *value); From owner-svn-src-all@freebsd.org Wed Jun 19 20:27:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A28915C9380; Wed, 19 Jun 2019 20:27:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2AD9817B2; Wed, 19 Jun 2019 20:27:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B76F91878; Wed, 19 Jun 2019 20:27:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKRVS7046989; Wed, 19 Jun 2019 20:27:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKRV9K046988; Wed, 19 Jun 2019 20:27:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192027.x5JKRV9K046988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349215 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 349215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2AD9817B2 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.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:27:32 -0000 Author: avg Date: Wed Jun 19 20:27:31 2019 New Revision: 349215 URL: https://svnweb.freebsd.org/changeset/base/349215 Log: MFC r348772: Restore ARC MFU/MRU pressure Submitted by: Slawa Olhovchenkov Sponsored by: Integros [integros.com] Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 19 20:21:34 2019 (r349214) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 19 20:27:31 2019 (r349215) @@ -1571,14 +1571,14 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *); +static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void *arc_get_data_buf(arc_buf_hdr_t *, uint64_t, void *); -static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *); +static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void arc_free_data_abd(arc_buf_hdr_t *, abd_t *, uint64_t, void *); static void arc_free_data_buf(arc_buf_hdr_t *, void *, uint64_t, void *); static void arc_free_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag); static void arc_hdr_free_pabd(arc_buf_hdr_t *); -static void arc_hdr_alloc_pabd(arc_buf_hdr_t *); +static void arc_hdr_alloc_pabd(arc_buf_hdr_t *, boolean_t); static void arc_access(arc_buf_hdr_t *, kmutex_t *); static boolean_t arc_is_overflowing(); static void arc_buf_watch(arc_buf_t *); @@ -3364,14 +3364,14 @@ arc_buf_destroy_impl(arc_buf_t *buf) } static void -arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr) +arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr, boolean_t do_adapt) { ASSERT3U(HDR_GET_LSIZE(hdr), >, 0); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(!HDR_SHARED_DATA(hdr)); ASSERT3P(hdr->b_l1hdr.b_pabd, ==, NULL); - hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr); + hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr, do_adapt); hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS; ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); @@ -3435,7 +3435,7 @@ arc_hdr_alloc(uint64_t spa, int32_t psize, int32_t lsi * the compressed or uncompressed data depending on the block * it references and compressed arc enablement. */ - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt)); return (hdr); @@ -5156,11 +5156,11 @@ arc_is_overflowing(void) } static abd_t * -arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, do_adapt); if (type == ARC_BUFC_METADATA) { return (abd_alloc(size, B_TRUE)); } else { @@ -5174,7 +5174,7 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, B_TRUE); if (type == ARC_BUFC_METADATA) { return (zio_buf_alloc(size)); } else { @@ -5190,12 +5190,13 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo * limit, we'll only signal the reclaim thread and continue on. */ static void -arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_state_t *state = hdr->b_l1hdr.b_state; arc_buf_contents_t type = arc_buf_type(hdr); - arc_adapt(size, state); + if (do_adapt) + arc_adapt(size, state); /* * If arc_size is currently overflowing, and has grown past our @@ -5946,8 +5947,9 @@ top: * do this after we've called arc_access() to * avoid hitting an assert in remove_reference(). */ + arc_adapt(arc_hdr_size(hdr), hdr->b_l1hdr.b_state); arc_access(hdr, hash_lock); - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_FALSE); } ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); size = arc_hdr_size(hdr); @@ -6361,7 +6363,7 @@ arc_release(arc_buf_t *buf, void *tag) if (arc_can_share(hdr, lastbuf)) { arc_share_buf(hdr, lastbuf); } else { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); abd_copy_from_buf(hdr->b_l1hdr.b_pabd, buf->b_data, psize); } @@ -6524,7 +6526,7 @@ arc_write_ready(zio_t *zio) * the data into it; otherwise, we share the data directly if we can. */ if (zfs_abd_scatter_enabled || !arc_can_share(hdr, buf)) { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); /* * Ideally, we would always copy the io_abd into b_pabd, but the From owner-svn-src-all@freebsd.org Wed Jun 19 20:29:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E95115C93FD; Wed, 19 Jun 2019 20:29:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A98F7818FA; Wed, 19 Jun 2019 20:29:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A8C1879; Wed, 19 Jun 2019 20:29:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5JKT246047117; Wed, 19 Jun 2019 20:29:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5JKT2TF047116; Wed, 19 Jun 2019 20:29:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906192029.x5JKT2TF047116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 19 Jun 2019 20:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349216 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 349216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A98F7818FA 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.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 20:29:03 -0000 Author: avg Date: Wed Jun 19 20:29:02 2019 New Revision: 349216 URL: https://svnweb.freebsd.org/changeset/base/349216 Log: MFC r348772: Restore ARC MFU/MRU pressure Submitted by: Slawa Olhovchenkov Sponsored by: Integros [integros.com] Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 19 20:27:31 2019 (r349215) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 19 20:29:02 2019 (r349216) @@ -1483,14 +1483,14 @@ static kmutex_t l2arc_feed_thr_lock; static kcondvar_t l2arc_feed_thr_cv; static uint8_t l2arc_thread_exit; -static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *); +static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void *arc_get_data_buf(arc_buf_hdr_t *, uint64_t, void *); -static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *); +static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *, boolean_t); static void arc_free_data_abd(arc_buf_hdr_t *, abd_t *, uint64_t, void *); static void arc_free_data_buf(arc_buf_hdr_t *, void *, uint64_t, void *); static void arc_free_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag); static void arc_hdr_free_pabd(arc_buf_hdr_t *); -static void arc_hdr_alloc_pabd(arc_buf_hdr_t *); +static void arc_hdr_alloc_pabd(arc_buf_hdr_t *, boolean_t); static void arc_access(arc_buf_hdr_t *, kmutex_t *); static boolean_t arc_is_overflowing(); static void arc_buf_watch(arc_buf_t *); @@ -3214,14 +3214,14 @@ arc_buf_destroy_impl(arc_buf_t *buf) } static void -arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr) +arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr, boolean_t do_adapt) { ASSERT3U(HDR_GET_LSIZE(hdr), >, 0); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(!HDR_SHARED_DATA(hdr)); ASSERT3P(hdr->b_l1hdr.b_pabd, ==, NULL); - hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr); + hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr, do_adapt); hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS; ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); @@ -3285,7 +3285,7 @@ arc_hdr_alloc(uint64_t spa, int32_t psize, int32_t lsi * the compressed or uncompressed data depending on the block * it references and compressed arc enablement. */ - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt)); return (hdr); @@ -4850,11 +4850,11 @@ arc_is_overflowing(void) } static abd_t * -arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, do_adapt); if (type == ARC_BUFC_METADATA) { return (abd_alloc(size, B_TRUE)); } else { @@ -4868,7 +4868,7 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo { arc_buf_contents_t type = arc_buf_type(hdr); - arc_get_data_impl(hdr, size, tag); + arc_get_data_impl(hdr, size, tag, B_TRUE); if (type == ARC_BUFC_METADATA) { return (zio_buf_alloc(size)); } else { @@ -4884,12 +4884,13 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, vo * limit, we'll only signal the reclaim thread and continue on. */ static void -arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag) +arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt) { arc_state_t *state = hdr->b_l1hdr.b_state; arc_buf_contents_t type = arc_buf_type(hdr); - arc_adapt(size, state); + if (do_adapt) + arc_adapt(size, state); /* * If arc_size is currently overflowing, and has grown past our @@ -5636,8 +5637,9 @@ top: * do this after we've called arc_access() to * avoid hitting an assert in remove_reference(). */ + arc_adapt(arc_hdr_size(hdr), hdr->b_l1hdr.b_state); arc_access(hdr, hash_lock); - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_FALSE); } ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL); size = arc_hdr_size(hdr); @@ -6013,7 +6015,7 @@ arc_release(arc_buf_t *buf, void *tag) if (arc_can_share(hdr, lastbuf)) { arc_share_buf(hdr, lastbuf); } else { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); abd_copy_from_buf(hdr->b_l1hdr.b_pabd, buf->b_data, psize); } @@ -6176,7 +6178,7 @@ arc_write_ready(zio_t *zio) * the data into it; otherwise, we share the data directly if we can. */ if (zfs_abd_scatter_enabled || !arc_can_share(hdr, buf)) { - arc_hdr_alloc_pabd(hdr); + arc_hdr_alloc_pabd(hdr, B_TRUE); /* * Ideally, we would always copy the io_abd into b_pabd, but the From owner-svn-src-all@freebsd.org Wed Jun 19 21:10:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Jun 19 21:36:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Thu Jun 20 00:23:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD1015CEB99; Thu, 20 Jun 2019 00:23:52 +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 5A23489DDA; Thu, 20 Jun 2019 00:23:52 +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 DF1E044C1; Thu, 20 Jun 2019 00:23:51 +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 x5K0NpGg075771; Thu, 20 Jun 2019 00:23:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K0NpKq075770; Thu, 20 Jun 2019 00:23:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201906200023.x5K0NpKq075770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 20 Jun 2019 00:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349219 - stable/12/share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man3 X-SVN-Commit-Revision: 349219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A23489DDA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 00:23:52 -0000 Author: markj Date: Thu Jun 20 00:23:51 2019 New Revision: 349219 URL: https://svnweb.freebsd.org/changeset/base/349219 Log: MFC r349148: Add some missing MLINKs for tree(3). Modified: stable/12/share/man/man3/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man3/Makefile ============================================================================== --- stable/12/share/man/man3/Makefile Wed Jun 19 21:36:00 2019 (r349218) +++ stable/12/share/man/man3/Makefile Thu Jun 20 00:23:51 2019 (r349219) @@ -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-all@freebsd.org Thu Jun 20 01:15:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 01:18:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC9F15CF967; Thu, 20 Jun 2019 01:18:16 +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 369478B383; Thu, 20 Jun 2019 01:18:16 +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 11D434D54; Thu, 20 Jun 2019 01:18:16 +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 x5K1IF3o002109; Thu, 20 Jun 2019 01:18:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K1IFK3002108; Thu, 20 Jun 2019 01:18:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906200118.x5K1IFK3002108@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:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349221 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 349221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 369478B383 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_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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 01:18:16 -0000 Author: mav Date: Thu Jun 20 01:18:15 2019 New Revision: 349221 URL: https://svnweb.freebsd.org/changeset/base/349221 Log: MFC r348764: Allow UMA hash tables to expand faster then 2x in 20 seconds. ZFS ABD allocates tons of 4KB chunks via UMA, requiring huge hash tables. With initial hash table size of only 32 elements it takes ~20 expansions or ~400 seconds to adapt to handling 220GB ZFS ARC. During that time not only the hash table is highly inefficient, but also each of those expan- sions takes significant time with the lock held, blocking operation. On my test system with 256GB of RAM and ZFS pool of 28 HDDs this change reduces time needed to first time read 240GB from ~300-400s, during which system is quite busy and unresponsive, to only ~150s with light CPU load and just 5 sub-second CPU spikes to expand the hash table. Modified: stable/12/sys/vm/uma_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Thu Jun 20 01:15:33 2019 (r349220) +++ stable/12/sys/vm/uma_core.c Thu Jun 20 01:18:15 2019 (r349221) @@ -256,7 +256,7 @@ static void keg_small_init(uma_keg_t keg); static void keg_large_init(uma_keg_t keg); static void zone_foreach(void (*zfunc)(uma_zone_t)); static void zone_timeout(uma_zone_t zone); -static int hash_alloc(struct uma_hash *); +static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); @@ -571,6 +571,7 @@ zone_domain_update_wss(uma_zone_domain_t zdom) static void keg_timeout(uma_keg_t keg) { + u_int slabs; KEG_LOCK(keg); /* @@ -581,7 +582,8 @@ keg_timeout(uma_keg_t keg) * may be a little aggressive. Should I allow for two collisions max? */ if (keg->uk_flags & UMA_ZONE_HASH && - keg->uk_pages / keg->uk_ppera >= keg->uk_hash.uh_hashsize) { + (slabs = keg->uk_pages / keg->uk_ppera) > + keg->uk_hash.uh_hashsize) { struct uma_hash newhash; struct uma_hash oldhash; int ret; @@ -592,9 +594,8 @@ keg_timeout(uma_keg_t keg) * I have to do everything in stages and check for * races. */ - newhash = keg->uk_hash; KEG_UNLOCK(keg); - ret = hash_alloc(&newhash); + ret = hash_alloc(&newhash, 1 << fls(slabs)); KEG_LOCK(keg); if (ret) { if (hash_expand(&keg->uk_hash, &newhash)) { @@ -635,16 +636,13 @@ zone_timeout(uma_zone_t zone) * 1 on success and 0 on failure. */ static int -hash_alloc(struct uma_hash *hash) +hash_alloc(struct uma_hash *hash, u_int size) { - u_int oldsize; size_t alloc; - oldsize = hash->uh_hashsize; - - /* We're just going to go to a power of two greater */ - if (oldsize) { - hash->uh_hashsize = oldsize * 2; + KASSERT(powerof2(size), ("hash size must be power of 2")); + if (size > UMA_HASH_SIZE_INIT) { + hash->uh_hashsize = size; alloc = sizeof(hash->uh_slab_hash[0]) * hash->uh_hashsize; hash->uh_slab_hash = (struct slabhead *)malloc(alloc, M_UMAHASH, M_NOWAIT); @@ -1733,7 +1731,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) } if (keg->uk_flags & UMA_ZONE_HASH) - hash_alloc(&keg->uk_hash); + hash_alloc(&keg->uk_hash, 0); CTR5(KTR_UMA, "keg_ctor %p zone %s(%p) out %d free %d\n", keg, zone->uz_name, zone, From owner-svn-src-all@freebsd.org Thu Jun 20 01:19:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B3615CF9D3; Thu, 20 Jun 2019 01:19:09 +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 49A328B4B6; Thu, 20 Jun 2019 01:19:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02C7B4D56; Thu, 20 Jun 2019 01:19:09 +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 x5K1J8l9002203; Thu, 20 Jun 2019 01:19:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K1J8uP002202; Thu, 20 Jun 2019 01:19:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906200119.x5K1J8uP002202@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:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349222 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 349222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49A328B4B6 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_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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 01:19:09 -0000 Author: mav Date: Thu Jun 20 01:19:08 2019 New Revision: 349222 URL: https://svnweb.freebsd.org/changeset/base/349222 Log: MFC r348764: Allow UMA hash tables to expand faster then 2x in 20 seconds. ZFS ABD allocates tons of 4KB chunks via UMA, requiring huge hash tables. With initial hash table size of only 32 elements it takes ~20 expansions or ~400 seconds to adapt to handling 220GB ZFS ARC. During that time not only the hash table is highly inefficient, but also each of those expan- sions takes significant time with the lock held, blocking operation. On my test system with 256GB of RAM and ZFS pool of 28 HDDs this change reduces time needed to first time read 240GB from ~300-400s, during which system is quite busy and unresponsive, to only ~150s with light CPU load and just 5 sub-second CPU spikes to expand the hash table. Modified: stable/11/sys/vm/uma_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Thu Jun 20 01:18:15 2019 (r349221) +++ stable/11/sys/vm/uma_core.c Thu Jun 20 01:19:08 2019 (r349222) @@ -242,7 +242,7 @@ static void keg_small_init(uma_keg_t keg); static void keg_large_init(uma_keg_t keg); static void zone_foreach(void (*zfunc)(uma_zone_t)); static void zone_timeout(uma_zone_t zone); -static int hash_alloc(struct uma_hash *); +static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); @@ -477,6 +477,7 @@ uma_timeout(void *unused) static void keg_timeout(uma_keg_t keg) { + u_int slabs; KEG_LOCK(keg); /* @@ -487,7 +488,8 @@ keg_timeout(uma_keg_t keg) * may be a little aggressive. Should I allow for two collisions max? */ if (keg->uk_flags & UMA_ZONE_HASH && - keg->uk_pages / keg->uk_ppera >= keg->uk_hash.uh_hashsize) { + (slabs = keg->uk_pages / keg->uk_ppera) > + keg->uk_hash.uh_hashsize) { struct uma_hash newhash; struct uma_hash oldhash; int ret; @@ -498,9 +500,8 @@ keg_timeout(uma_keg_t keg) * I have to do everything in stages and check for * races. */ - newhash = keg->uk_hash; KEG_UNLOCK(keg); - ret = hash_alloc(&newhash); + ret = hash_alloc(&newhash, 1 << fls(slabs)); KEG_LOCK(keg); if (ret) { if (hash_expand(&keg->uk_hash, &newhash)) { @@ -535,16 +536,13 @@ zone_timeout(uma_zone_t zone) * 1 on success and 0 on failure. */ static int -hash_alloc(struct uma_hash *hash) +hash_alloc(struct uma_hash *hash, u_int size) { - u_int oldsize; size_t alloc; - oldsize = hash->uh_hashsize; - - /* We're just going to go to a power of two greater */ - if (oldsize) { - hash->uh_hashsize = oldsize * 2; + KASSERT(powerof2(size), ("hash size must be power of 2")); + if (size > UMA_HASH_SIZE_INIT) { + hash->uh_hashsize = size; alloc = sizeof(hash->uh_slab_hash[0]) * hash->uh_hashsize; hash->uh_slab_hash = (struct slabhead *)malloc(alloc, M_UMAHASH, M_NOWAIT); @@ -1509,7 +1507,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) } if (keg->uk_flags & UMA_ZONE_HASH) - hash_alloc(&keg->uk_hash); + hash_alloc(&keg->uk_hash, 0); #ifdef UMA_DEBUG printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free %d\n", From owner-svn-src-all@freebsd.org Thu Jun 20 02:06:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 05:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670C915D415E; Thu, 20 Jun 2019 05:01:36 +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 0EBA36B240; Thu, 20 Jun 2019 05:01:36 +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 E02167410; Thu, 20 Jun 2019 05:01:35 +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 x5K51Zws020457; Thu, 20 Jun 2019 05:01:35 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K51Zsh020456; Thu, 20 Jun 2019 05:01:35 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906200501.x5K51Zsh020456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 20 Jun 2019 05:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349223 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EBA36B240 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 05:01:36 -0000 Author: cy Date: Thu Jun 20 05:01:35 2019 New Revision: 349223 URL: https://svnweb.freebsd.org/changeset/base/349223 Log: MFC r349152: 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. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jun 20 01:19:08 2019 (r349222) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Thu Jun 20 05:01:35 2019 (r349223) @@ -6268,7 +6268,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-all@freebsd.org Thu Jun 20 05:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD2615D4163; Thu, 20 Jun 2019 05:01:36 +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 5DE496B241; Thu, 20 Jun 2019 05:01:36 +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 395BA7411; Thu, 20 Jun 2019 05:01:36 +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 x5K51a8U020463; Thu, 20 Jun 2019 05:01:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K51aeq020462; Thu, 20 Jun 2019 05:01:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201906200501.x5K51aeq020462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 20 Jun 2019 05:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349223 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DE496B241 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 05:01:36 -0000 Author: cy Date: Thu Jun 20 05:01:35 2019 New Revision: 349223 URL: https://svnweb.freebsd.org/changeset/base/349223 Log: MFC r349152: 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. Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jun 20 01:19:08 2019 (r349222) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Thu Jun 20 05:01:35 2019 (r349223) @@ -6268,7 +6268,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-all@freebsd.org Thu Jun 20 06:54:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F7215D5A11; Thu, 20 Jun 2019 06:54:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF6D66DE05; Thu, 20 Jun 2019 06:53:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A86CF869B; Thu, 20 Jun 2019 06:53:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5K6rxAm079787; Thu, 20 Jun 2019 06:53:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K6rxOF079786; Thu, 20 Jun 2019 06:53:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906200653.x5K6rxOF079786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 20 Jun 2019 06:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349224 - stable/12/sys/dev/drm2/i915 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/drm2/i915 X-SVN-Commit-Revision: 349224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF6D66DE05 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.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 06:54:00 -0000 Author: avg Date: Thu Jun 20 06:53:59 2019 New Revision: 349224 URL: https://svnweb.freebsd.org/changeset/base/349224 Log: drm2/intel_iic: stop using iicbus_set_nostop The desired mode of transmitting messages is implemented by subclassing iicbb driver and overriding its iicbus_transfer method with an almost identical copy that issues the stop condition only at the very end. iicbus_set_nostop is very broken and is set to be removed from the KPI. This is a direct commit as in head the drm drivers have been moved out of the tree. The same change has been committed to FreeBSDDesktop/drm-legacy. Modified: stable/12/sys/dev/drm2/i915/intel_iic.c Modified: stable/12/sys/dev/drm2/i915/intel_iic.c ============================================================================== --- stable/12/sys/dev/drm2/i915/intel_iic.c Thu Jun 20 05:01:35 2019 (r349223) +++ stable/12/sys/dev/drm2/i915/intel_iic.c Thu Jun 20 06:53:59 2019 (r349224) @@ -562,12 +562,11 @@ intel_iicbb_attach(device_t idev) sc->bus = &dev_priv->gmbus[pin]; /* add generic bit-banging code */ - sc->iic_dev = device_add_child(idev, "iicbb", -1); + sc->iic_dev = device_add_child(idev, "iicbb_nostop", -1); if (sc->iic_dev == NULL) return (ENXIO); device_quiet(sc->iic_dev); bus_generic_attach(idev); - iicbus_set_nostop(idev, true); return (0); } @@ -608,8 +607,84 @@ static driver_t intel_iicbb_driver = { static devclass_t intel_iicbb_devclass; DRIVER_MODULE_ORDERED(intel_iicbb, drmn, intel_iicbb_driver, intel_iicbb_devclass, 0, 0, SI_ORDER_FIRST); -DRIVER_MODULE(iicbb, intel_iicbb, iicbb_driver, iicbb_devclass, 0, 0); +/* + * XXX This is a copy of struct iicbb_softc in sys/dev/iicbus/iicbb.c. + * There should really be a shared definition. + */ +struct iicbb_softc { + device_t iicbus; + int udelay; /* signal toggle delay in usec */ +}; + +static int +iicbb_nostop_transfer_impl(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + int i, error, lenread, lenwrote, addr; + struct iicbb_softc *sc; + device_t bus; + bool started; + + sc = device_get_softc(dev); + bus = sc->iicbus; + started = false; + for (i = 0, error = 0; i < nmsgs && error == 0; i++) { + addr = msgs[i].slave; + if (msgs[i].flags & IIC_M_RD) + addr |= LSB; + else + addr &= ~LSB; + + if ((msgs[i].flags & IIC_M_NOSTART) == 0) { + if (i == 0) + error = iicbus_start(bus, addr, 0); + else + error = iicbus_repeated_start(bus, addr, 0); + if (error != 0) + break; + started = true; + } + + if ((msgs[i].flags & IIC_M_RD) != 0) + error = iicbus_read(bus, msgs[i].buf, msgs[i].len, + &lenread, IIC_LAST_READ, 0); + else + error = iicbus_write(bus, msgs[i].buf, msgs[i].len, + &lenwrote, 0); + } + if (started) + iicbus_stop(bus); + return (error); +} + +static int +iicbb_nostop_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + int error; + + error = IICBB_PRE_XFER(device_get_parent(dev)); + if (error) + return (error); + + error = iicbb_nostop_transfer_impl(dev, msgs, nmsgs); + + IICBB_POST_XFER(device_get_parent(dev)); + return (error); +} + +static device_method_t iicbb_nostop_methods[] = { + DEVMETHOD(iicbus_transfer, iicbb_nostop_transfer), + + DEVMETHOD_END +}; + +static devclass_t iicbb_nostop_devclass; + +DEFINE_CLASS_1(iicbb_nostop, iicbb_nostop_driver, iicbb_nostop_methods, + sizeof(struct iicbb_softc), iicbb_driver); +DRIVER_MODULE(iicbb_nostop, intel_iicbb, iicbb_nostop_driver, + iicbb_nostop_devclass, NULL, NULL); + /** * intel_gmbus_setup - instantiate all Intel i2c GMBuses * @dev: DRM device @@ -672,7 +747,7 @@ int intel_setup_gmbus(struct drm_device *dev) /* bbbus */ iic_dev = device_find_child(bus->bbbus_bridge, - "iicbb", -1); + "iicbb_nostop", -1); if (iic_dev == NULL) { DRM_ERROR("bbbus bridge doesn't have iicbb child\n"); goto err; From owner-svn-src-all@freebsd.org Thu Jun 20 07:17:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 07:50:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A01D15D67FF; Thu, 20 Jun 2019 07:50:40 +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 B781E6F795; Thu, 20 Jun 2019 07:50:39 +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 543939020; Thu, 20 Jun 2019 07:50:39 +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 x5K7oddM006668; Thu, 20 Jun 2019 07:50:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K7odkA006667; Thu, 20 Jun 2019 07:50:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201906200750.x5K7odkA006667@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 07:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349226 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 349226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B781E6F795 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 07:50:40 -0000 Author: tuexen Date: Thu Jun 20 07:50:38 2019 New Revision: 349226 URL: https://svnweb.freebsd.org/changeset/base/349226 Log: MFC r348728: r347382 added receiver side DSACK support for the TCP base stack. The corresponding changes for the RACK stack where missed and are added by this commit. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Jun 20 07:17:16 2019 (r349225) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Jun 20 07:50:38 2019 (r349226) @@ -1790,6 +1790,17 @@ rack_drop_checks(struct tcpopt *to, struct mbuf *m, st TCPSTAT_INC(tcps_rcvpartduppack); TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); } + /* + * DSACK - add SACK block for dropped range + */ + if (tp->t_flags & TF_SACK_PERMIT) { + tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen); + /* + * ACK now, as the next in-sequence segment + * will clear the DSACK block again + */ + tp->t_flags |= TF_ACKNOW; + } *drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; tlen -= todrop; @@ -4822,6 +4833,8 @@ dodata: /* XXX */ if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; + tcp_seq save_rnxt = tp->rcv_nxt; + int save_tlen = tlen; m_adj(m, drop_hdrlen); /* delayed header drop */ /* @@ -4864,11 +4877,29 @@ dodata: /* XXX */ * m_adj() doesn't actually frees any mbufs when * trimming from the head. */ - thflags = tcp_reass(tp, th, &save_start, &tlen, m); + tcp_seq temp = save_start; + thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tlen > 0) - tcp_update_sack_list(tp, save_start, save_start + tlen); + if (((tlen == 0) && (save_tlen > 0) && + (SEQ_LT(save_start, save_rnxt)))) { + /* + * DSACK actually handled in the fastpath + * above. + */ + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { + /* + * Cleaning sackblks by using zero length + * update. + */ + tcp_update_sack_list(tp, save_start, save_start); + } else if ((tlen > 0) && (tlen >= save_tlen)) { + /* Update of sackblks. */ + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else if (tlen > 0) { + tcp_update_sack_list(tp, save_start, save_start+tlen); + } } else { m_freem(m); thflags &= ~TH_FIN; From owner-svn-src-all@freebsd.org Thu Jun 20 09:23:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDC115B3A00; Thu, 20 Jun 2019 09:23:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4FA67253C; Thu, 20 Jun 2019 09:23:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8860D9FC1; Thu, 20 Jun 2019 09:23:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5K9N3Zf059010; Thu, 20 Jun 2019 09:23:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5K9N30q059009; Thu, 20 Jun 2019 09:23:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906200923.x5K9N30q059009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 20 Jun 2019 09:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r349227 - stable/11/sys/dev/drm2/i915 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/drm2/i915 X-SVN-Commit-Revision: 349227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4FA67253C 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_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 09:23:04 -0000 Author: avg Date: Thu Jun 20 09:23:03 2019 New Revision: 349227 URL: https://svnweb.freebsd.org/changeset/base/349227 Log: drm2/intel_iic: stop using iicbus_set_nostop The desired mode of transmitting messages is implemented by subclassing iicbb driver and overriding its iicbus_transfer method with an almost identical copy that issues the stop condition only at the very end. iicbus_set_nostop is very broken and is set to be removed from the KPI. This is a direct commit as in head the drm drivers have been moved out of the tree. The same change has been committed to FreeBSDDesktop/drm-legacy. Modified: stable/11/sys/dev/drm2/i915/intel_iic.c Modified: stable/11/sys/dev/drm2/i915/intel_iic.c ============================================================================== --- stable/11/sys/dev/drm2/i915/intel_iic.c Thu Jun 20 07:50:38 2019 (r349226) +++ stable/11/sys/dev/drm2/i915/intel_iic.c Thu Jun 20 09:23:03 2019 (r349227) @@ -562,12 +562,11 @@ intel_iicbb_attach(device_t idev) sc->bus = &dev_priv->gmbus[pin]; /* add generic bit-banging code */ - sc->iic_dev = device_add_child(idev, "iicbb", -1); + sc->iic_dev = device_add_child(idev, "iicbb_nostop", -1); if (sc->iic_dev == NULL) return (ENXIO); device_quiet(sc->iic_dev); bus_generic_attach(idev); - iicbus_set_nostop(idev, true); return (0); } @@ -608,8 +607,84 @@ static driver_t intel_iicbb_driver = { static devclass_t intel_iicbb_devclass; DRIVER_MODULE_ORDERED(intel_iicbb, drmn, intel_iicbb_driver, intel_iicbb_devclass, 0, 0, SI_ORDER_FIRST); -DRIVER_MODULE(iicbb, intel_iicbb, iicbb_driver, iicbb_devclass, 0, 0); +/* + * XXX This is a copy of struct iicbb_softc in sys/dev/iicbus/iicbb.c. + * There should really be a shared definition. + */ +struct iicbb_softc { + device_t iicbus; + int udelay; /* signal toggle delay in usec */ +}; + +static int +iicbb_nostop_transfer_impl(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + int i, error, lenread, lenwrote, addr; + struct iicbb_softc *sc; + device_t bus; + bool started; + + sc = device_get_softc(dev); + bus = sc->iicbus; + started = false; + for (i = 0, error = 0; i < nmsgs && error == 0; i++) { + addr = msgs[i].slave; + if (msgs[i].flags & IIC_M_RD) + addr |= LSB; + else + addr &= ~LSB; + + if ((msgs[i].flags & IIC_M_NOSTART) == 0) { + if (i == 0) + error = iicbus_start(bus, addr, 0); + else + error = iicbus_repeated_start(bus, addr, 0); + if (error != 0) + break; + started = true; + } + + if ((msgs[i].flags & IIC_M_RD) != 0) + error = iicbus_read(bus, msgs[i].buf, msgs[i].len, + &lenread, IIC_LAST_READ, 0); + else + error = iicbus_write(bus, msgs[i].buf, msgs[i].len, + &lenwrote, 0); + } + if (started) + iicbus_stop(bus); + return (error); +} + +static int +iicbb_nostop_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + int error; + + error = IICBB_PRE_XFER(device_get_parent(dev)); + if (error) + return (error); + + error = iicbb_nostop_transfer_impl(dev, msgs, nmsgs); + + IICBB_POST_XFER(device_get_parent(dev)); + return (error); +} + +static device_method_t iicbb_nostop_methods[] = { + DEVMETHOD(iicbus_transfer, iicbb_nostop_transfer), + + DEVMETHOD_END +}; + +static devclass_t iicbb_nostop_devclass; + +DEFINE_CLASS_1(iicbb_nostop, iicbb_nostop_driver, iicbb_nostop_methods, + sizeof(struct iicbb_softc), iicbb_driver); +DRIVER_MODULE(iicbb_nostop, intel_iicbb, iicbb_nostop_driver, + iicbb_nostop_devclass, NULL, NULL); + /** * intel_gmbus_setup - instantiate all Intel i2c GMBuses * @dev: DRM device @@ -672,7 +747,7 @@ int intel_setup_gmbus(struct drm_device *dev) /* bbbus */ iic_dev = device_find_child(bus->bbbus_bridge, - "iicbb", -1); + "iicbb_nostop", -1); if (iic_dev == NULL) { DRM_ERROR("bbbus bridge doesn't have iicbb child\n"); goto err; From owner-svn-src-all@freebsd.org Thu Jun 20 12:38:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 13:24:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 13:59:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 14:13:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 14:34:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC1215BD7A5; Thu, 20 Jun 2019 14:34:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B53983E46; Thu, 20 Jun 2019 14:34:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 596ACD570; Thu, 20 Jun 2019 14:34:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5KEYkE8021414; Thu, 20 Jun 2019 14:34:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5KEYkIA021412; Thu, 20 Jun 2019 14:34:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906201434.x5KEYkIA021412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 20 Jun 2019 14:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349232 - in stable/12/release: . tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/release: . tools X-SVN-Commit-Revision: 349232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B53983E46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2019 14:34:47 -0000 Author: gjb Date: Thu Jun 20 14:34:45 2019 New Revision: 349232 URL: https://svnweb.freebsd.org/changeset/base/349232 Log: MFC r349160: 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. PR: 238615 Sponsored by: The FreeBSD Foundation Modified: stable/12/release/release.sh stable/12/release/tools/arm.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/release/release.sh ============================================================================== --- stable/12/release/release.sh Thu Jun 20 14:13:10 2019 (r349231) +++ stable/12/release/release.sh Thu Jun 20 14:34:45 2019 (r349232) @@ -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: stable/12/release/tools/arm.subr ============================================================================== --- stable/12/release/tools/arm.subr Thu Jun 20 14:13:10 2019 (r349231) +++ stable/12/release/tools/arm.subr Thu Jun 20 14:34:45 2019 (r349232) @@ -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-all@freebsd.org Thu Jun 20 14:35:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 14:38:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 14:40:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 15:14:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0481D15BEB7C 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 6E7F8857B2 for ; Thu, 20 Jun 2019 15:14:01 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1561043638; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=IiPMVX5rLu79Od/UrdWz5OkmC63dhDgXZfZMpcueKlFst85p63GUDQeIofqqkLP4Uns0LpnjRc8R3 DZj1sUlcKnhD58yogDJcLIbfx7XmBkcz3kCnltkhG0fw5RDFVYITzS4pB1lBf5ildTLt5F+3eO1/6C L4PDqF5TmzZI9bO/yQ01P8u9M9CQg0WEv+f+dV8d9ZQn/vvvl82SHStM+mJ3ScPot8pSn1zV8NQK16 wTrs/1wtCvVdVi9IWrlzeAC9DqUMdJALjEn0Eswnx5ucN7iism83KczpmWR9Inha8CLJDwkZ7iEIpZ cz9DVmAZiW8fy2/RIUGODNved7MdRZw== 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: 6E7F8857B2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 15:29:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 15:35:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D55D515BF45E 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 4FE9D8663F 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: 4FE9D8663F 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 15:44:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 16:36:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 16:43:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 17:22:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 18:19:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 18:24:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 18:30:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 18:44:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 19:43:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F414215C601C for ; Thu, 20 Jun 2019 19:43:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) 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 90409940EB for ; Thu, 20 Jun 2019 19:43:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id m29so4474555qtu.1 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=jk5VqON4W6GB1utTEq0Ge0MlAsVJ2evwO8ri1OxxiSItU3UdI5cRpjDGw2jJi37DNU CestVCUfY6Kl4ac651jVAS9v24DbJldlqEdfWphFfYny5Z+jHzOoW6Mho8luS2QfU4w4 Z8eAYjKF+y0cZr8lFVjOCE5C3w2O58MzwTA06lJ+LupM9wixYjCTw/9l0YdJG50d0rxT 7U8gZefPLxTbVHSQA3GFJob4jyQ6e15g6rx1n4i73NUOiDYwHExmEID8DrHw473Qu7Io 43rzHiCmMD+rGfr/F1tgTZPInsBwMKIqeGCyZUrxbseal1hl8Tlv8BFCqVWq+5HmBO3y rlqA== X-Gm-Message-State: APjAAAWMsGqyWnNHOR7Y2ZT+5kKawCsipEqFckt6PiGJOsvpnfn2z5L9 HvFBysdGocOEV9/R6l9SZBwUf30aNSduw0aJLdXnLA== 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: 90409940EB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Jun 20 20:06:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 20:29:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 21:52:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 22:20:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 22:59:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 23:07:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 23:15:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BBB915CA4C8 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 A9E3F6BDAD 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 d23so5061042qto.2 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=p4JQwLnn26tqnpO5operKTnyjtueaOt0z0pL6w3izSmp+J44los8BM/vaYy37tnui6 NBABEgcfTxFvSyZ5lBOrqi9TTReDhkVp5nlXnGVhW8JEpBNiH44MZzeXu3YevUgdn4Lk ORTm3VV1LeyFOIYqRMGs1HigkmZu4fElFlr6lc61jm3ZUbjU5ngIyiq38GjKSirGqnf2 Wut8wSK5aSv84BKGcdPqX8YfiGBLjHc5ogtkU2uE+zmrjgQz0RhRrzKC46WAeJVyCgSl ipnypisNwQPmAA+74n74tRlnvY5qXFgNmQHd9FImPVjcPDnMJJ7cBjYk010mAzebD8aX gvqA== X-Gm-Message-State: APjAAAVRTCZggnkUO3gb43kYqRDwPJjHs5VKb36DYIufV/bFl1+9FX8p 6hlQ9VYHrmVnJK9OnH4ofHfaJQ== 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: A9E3F6BDAD 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Jun 20 23:52:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Fri Jun 21 00:01:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF6C15CB699; Fri, 21 Jun 2019 00:01:13 +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 6F5666D88D; Fri, 21 Jun 2019 00:01:13 +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 49C1A1B51B; Fri, 21 Jun 2019 00:01:13 +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 x5L01Dvs030119; Fri, 21 Jun 2019 00:01:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L01DPd030118; Fri, 21 Jun 2019 00:01:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201906210001.x5L01DPd030118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 21 Jun 2019 00:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r349252 - releng/11.3/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.3/sys/conf X-SVN-Commit-Revision: 349252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F5666D88D 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:01:14 -0000 Author: gjb Date: Fri Jun 21 00:01:12 2019 New Revision: 349252 URL: https://svnweb.freebsd.org/changeset/base/349252 Log: Update releng/11.3 to RC2 as part of the 11.3-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.3/sys/conf/newvers.sh Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Thu Jun 20 23:52:33 2019 (r349251) +++ releng/11.3/sys/conf/newvers.sh Fri Jun 21 00:01:12 2019 (r349252) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RC1" +BRANCH="RC2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 21 00:04:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 00:16:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 00:24:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 00:33:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 00:52:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 143F015CC64A; Fri, 21 Jun 2019 00:52:32 +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 AE5F76F3A4; Fri, 21 Jun 2019 00:52:31 +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 8B1791BF01; Fri, 21 Jun 2019 00:52:31 +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 x5L0qVPs060450; Fri, 21 Jun 2019 00:52:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5L0qV5k060446; Fri, 21 Jun 2019 00:52:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906210052.x5L0qV5k060446@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 00:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r349255 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: imp X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 349255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE5F76F3A4 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 00:52:32 -0000 Author: imp Date: Fri Jun 21 00:52:30 2019 New Revision: 349255 URL: https://svnweb.freebsd.org/changeset/base/349255 Log: Add Chuck Silvers. He'll be working on the block and buffer layers. Approved by: core@ Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Jun 21 00:33:45 2019 (r349254) +++ svnadmin/conf/access Fri Jun 21 00:52:30 2019 (r349255) @@ -49,6 +49,7 @@ bwidawsk bz cem chuck +chs cognet cperciva cracauer Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Jun 21 00:33:45 2019 (r349254) +++ svnadmin/conf/mentors Fri Jun 21 00:52:30 2019 (r349255) @@ -14,6 +14,7 @@ achim scottl Co-mentor: emaste anish jhb bdragon jhibbits brd allanjude Co-mentor: bapt +chs imp def pjd dougm kib Co-mentor: markj gordon delphij Co-mentor: emaste From owner-svn-src-all@freebsd.org Fri Jun 21 02:37:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 02:49:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 03:09:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 03:49:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 07:29:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 07:46:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 07:58:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 08:24:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 09:41:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 10:54:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 13:42:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 13:51:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 14:01:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 14:10:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 14:24:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 14:46:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 15:12:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 15:44:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 16:02:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9FE15B4E82; Fri, 21 Jun 2019 16:02:27 +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 A59256EB18; Fri, 21 Jun 2019 16:02:26 +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 9657C2574A; Fri, 21 Jun 2019 16:02:26 +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 x5LG2Q7r040720; Fri, 21 Jun 2019 16:02:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5LG2QiB040719; Fri, 21 Jun 2019 16:02:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906211602.x5LG2QiB040719@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 16:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r349275 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: imp X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 349275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A59256EB18 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 16:02:27 -0000 Author: imp Date: Fri Jun 21 16:02:26 2019 New Revision: 349275 URL: https://svnweb.freebsd.org/changeset/base/349275 Log: I forgot to add Johannes Lundberg to mentors when I added him to the access file. Fix that. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Jun 21 15:56:28 2019 (r349274) +++ svnadmin/conf/mentors Fri Jun 21 16:02:26 2019 (r349275) @@ -20,6 +20,7 @@ dougm kib Co-mentor: markj gordon delphij Co-mentor: emaste jceel trasz jkh rwatson +johalun imp kadesai ken Co-mentor: scottl, ambrisko leitao jhibbits Co-mentor: nwhitehorn mahrens mckusick From owner-svn-src-all@freebsd.org Fri Jun 21 16:43:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 18:48:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 18:57:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 19:32:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 19:55:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 20:02:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 20:38:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 21:39:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 21:50:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 23:29:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Jun 21 23:40:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Sat Jun 22 00:41:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 01:06:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 01:20:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 03:16:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 03:50:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 05:35:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 07:17:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 15:39:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 16:26:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 16:54:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 17:09:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 19:09:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 19:27:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 22:35:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Jun 22 22:43:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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 ------------------------ From owner-svn-src-all@freebsd.org Sat Jun 22 23:36:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFD415BD422; Sat, 22 Jun 2019 23:36:29 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 093B96B4DB; Sat, 22 Jun 2019 23:36:29 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0D7B19A60; Sat, 22 Jun 2019 23:36:28 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5MNaSwd036618; Sat, 22 Jun 2019 23:36:28 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5MNaSpn036617; Sat, 22 Jun 2019 23:36:28 GMT (envelope-from grog@FreeBSD.org) Message-Id: <201906222336.x5MNaSpn036617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Sat, 22 Jun 2019 23:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r349296 - stable/10/usr.bin/calendar/calendars X-SVN-Group: stable-10 X-SVN-Commit-Author: grog X-SVN-Commit-Paths: stable/10/usr.bin/calendar/calendars X-SVN-Commit-Revision: 349296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 093B96B4DB 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.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 23:36:30 -0000 Author: grog Date: Sat Jun 22 23:36:28 2019 New Revision: 349296 URL: https://svnweb.freebsd.org/changeset/base/349296 Log: Correct Konrad Zuse's year of birth. Modified: stable/10/usr.bin/calendar/calendars/calendar.birthday Modified: stable/10/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- stable/10/usr.bin/calendar/calendars/calendar.birthday Sat Jun 22 22:43:40 2019 (r349295) +++ stable/10/usr.bin/calendar/calendars/calendar.birthday Sat Jun 22 23:36:28 2019 (r349296) @@ -167,7 +167,7 @@ 06/19 FreeBSD project born, 1993 06/22 Carl Hubbell born, 1903 06/22 Meryl Streep born in Summit, New Jersey, 1949 -06/22 Konrad Zuse born in Berlin, 1919 +06/22 Konrad Zuse born in Berlin, 1910 06/23 Alan Mathison Turing born, 1912 06/25 Eric Arthur Blair (a.k.a. George Orwell) born, 1903 06/27 Helen Keller born, 1880