From owner-svn-src-all@freebsd.org Sun Jan 7 00:04:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C41E9DFBA37; Sun, 7 Jan 2018 00:04:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 887A569109; Sun, 7 Jan 2018 00:04:16 +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 A06F519706; Sun, 7 Jan 2018 00:04:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0704FCO031321; Sun, 7 Jan 2018 00:04:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0704D8K031297; Sun, 7 Jan 2018 00:04:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801070004.w0704D8K031297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 00:04: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: r327658 - in stable/11/sys: arm/allwinner arm/altera/socfpga arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/mv/armada38x arm/mv/armadaxp ar... X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11/sys: arm/allwinner arm/altera/socfpga arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/mv/armada38x arm/mv/armadaxp arm/nvidia/tegra124 arm/roc... X-SVN-Commit-Revision: 327658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 00:04:16 -0000 Author: ian Date: Sun Jan 7 00:04:13 2018 New Revision: 327658 URL: https://svnweb.freebsd.org/changeset/base/327658 Log: MFC r327367: Make kernel option KERNVIRTADDR optional, remove it from std. files that can use the default value. It used to be required that the low-order bits of KERNVIRTADDR matched the low-order bits of the physical load address for all arm platforms. That hasn't been a requirement for armv6 platforms since FreeBSD 10. There is no longer any relationship between load addr and KERNVIRTADDR except that both must be aligned to a 2 MiB boundary. This change makes the default KERNVIRTADDR value 0xc0000000, and removes the options from all the platforms that can use the default value. The default is now defined in vmparam.h, and that file is now included in a few new places that reference KERNVIRTADDR, since it may not come in via the forced-include of opt_global.h on the compile command line. Modified: stable/11/sys/arm/allwinner/std.allwinner stable/11/sys/arm/allwinner/std.allwinner_up stable/11/sys/arm/altera/socfpga/std.socfpga stable/11/sys/arm/arm/dump_machdep.c stable/11/sys/arm/arm/elf_trampoline.c stable/11/sys/arm/arm/genassym.c stable/11/sys/arm/arm/machdep_boot.c stable/11/sys/arm/broadcom/bcm2835/std.rpi stable/11/sys/arm/conf/NOTES stable/11/sys/arm/freescale/imx/std.imx51 stable/11/sys/arm/freescale/imx/std.imx53 stable/11/sys/arm/freescale/imx/std.imx6 stable/11/sys/arm/freescale/vybrid/std.vybrid stable/11/sys/arm/include/vmparam.h stable/11/sys/arm/mv/armada38x/std.armada38x stable/11/sys/arm/mv/armadaxp/std.armadaxp stable/11/sys/arm/nvidia/tegra124/std.tegra124 stable/11/sys/arm/rockchip/std.rk30xx stable/11/sys/arm/samsung/exynos/std.exynos5250 stable/11/sys/arm/samsung/exynos/std.exynos5420 stable/11/sys/arm/ti/am335x/std.am335x stable/11/sys/arm/ti/omap4/std.omap4 stable/11/sys/arm/xilinx/std.zynq7 stable/11/sys/conf/Makefile.arm Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/std.allwinner ============================================================================== --- stable/11/sys/arm/allwinner/std.allwinner Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/allwinner/std.allwinner Sun Jan 7 00:04:13 2018 (r327658) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/allwinner/std.allwinner_up ============================================================================== --- stable/11/sys/arm/allwinner/std.allwinner_up Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/allwinner/std.allwinner_up Sun Jan 7 00:04:13 2018 (r327658) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 - files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner" files "../allwinner/a10/files.a10" Modified: stable/11/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- stable/11/sys/arm/altera/socfpga/std.socfpga Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/altera/socfpga/std.socfpga Sun Jan 7 00:04:13 2018 (r327658) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/arm/dump_machdep.c ============================================================================== --- stable/11/sys/arm/arm/dump_machdep.c Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/arm/dump_machdep.c Sun Jan 7 00:04:13 2018 (r327658) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ int do_minidump = 1; SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0, Modified: stable/11/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/11/sys/arm/arm/elf_trampoline.c Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/arm/elf_trampoline.c Sun Jan 7 00:04:13 2018 (r327658) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ extern char kernel_start[]; extern char kernel_end[]; Modified: stable/11/sys/arm/arm/genassym.c ============================================================================== --- stable/11/sys/arm/arm/genassym.c Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/arm/genassym.c Sun Jan 7 00:04:13 2018 (r327658) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include ASSYM(KERNBASE, KERNBASE); +ASSYM(KERNVIRTADDR, KERNVIRTADDR); #if __ARM_ARCH >= 6 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); #endif Modified: stable/11/sys/arm/arm/machdep_boot.c ============================================================================== --- stable/11/sys/arm/arm/machdep_boot.c Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/arm/machdep_boot.c Sun Jan 7 00:04:13 2018 (r327658) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* For KERNVIRTADDR */ #ifdef FDT #include Modified: stable/11/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/std.rpi Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/broadcom/bcm2835/std.rpi Sun Jan 7 00:04:13 2018 (r327658) @@ -1,5 +1,3 @@ # $FreeBSD$ -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 options LINUX_BOOT_ABI Modified: stable/11/sys/arm/conf/NOTES ============================================================================== --- stable/11/sys/arm/conf/NOTES Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/conf/NOTES Sun Jan 7 00:04:13 2018 (r327658) @@ -24,11 +24,9 @@ files "../xscale/ixp425/files.ixp425" files "../xscale/pxa/files.pxa" options PHYSADDR=0x00000000 -options KERNVIRTADDR=0xc0000000 makeoptions LDFLAGS="-zmuldefs" makeoptions KERNPHYSADDR=0x00000000 -makeoptions KERNVIRTADDR=0xc0000000 options FDT Modified: stable/11/sys/arm/freescale/imx/std.imx51 ============================================================================== --- stable/11/sys/arm/freescale/imx/std.imx51 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/freescale/imx/std.imx51 Sun Jan 7 00:04:13 2018 (r327658) @@ -3,9 +3,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 - device fdt_pinctrl files "../freescale/imx/files.imx5" Modified: stable/11/sys/arm/freescale/imx/std.imx53 ============================================================================== --- stable/11/sys/arm/freescale/imx/std.imx53 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/freescale/imx/std.imx53 Sun Jan 7 00:04:13 2018 (r327658) @@ -3,9 +3,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR=0xc0100000 -makeoptions KERNVIRTADDR=0xc0100000 - device fdt_pinctrl files "../freescale/imx/files.imx5" Modified: stable/11/sys/arm/freescale/imx/std.imx6 ============================================================================== --- stable/11/sys/arm/freescale/imx/std.imx6 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/freescale/imx/std.imx6 Sun Jan 7 00:04:13 2018 (r327658) @@ -3,9 +3,6 @@ machine arm armv6 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR = 0xc2000000 -makeoptions KERNVIRTADDR = 0xc2000000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- stable/11/sys/arm/freescale/vybrid/std.vybrid Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/freescale/vybrid/std.vybrid Sun Jan 7 00:04:13 2018 (r327658) @@ -4,7 +4,4 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0100000 -options KERNVIRTADDR=0xc0100000 - files "../freescale/vybrid/files.vybrid" Modified: stable/11/sys/arm/include/vmparam.h ============================================================================== --- stable/11/sys/arm/include/vmparam.h Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/include/vmparam.h Sun Jan 7 00:04:13 2018 (r327658) @@ -73,6 +73,19 @@ #endif /* + * The virtual address the kernel is linked to run at. For armv4/5 platforms + * the low-order 30 bits of this must match the low-order bits of the physical + * address the kernel is loaded at, so the value is most often provided as a + * kernel config option in the std.platform file. For armv6/7 the kernel can + * be loaded at any 2MB boundary, and KERNVIRTADDR can also be set to any 2MB + * boundary. It is typically overridden in the std.platform file only when + * KERNBASE is also set to a lower address to provide more KVA. + */ +#ifndef KERNVIRTADDR +#define KERNVIRTADDR 0xc0000000 +#endif + +/* * max number of non-contig chunks of physical RAM you can have */ Modified: stable/11/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- stable/11/sys/arm/mv/armada38x/std.armada38x Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/mv/armada38x/std.armada38x Sun Jan 7 00:04:13 2018 (r327658) @@ -5,8 +5,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0000000 -options KERNVIRTADDR=0xc0000000 options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- stable/11/sys/arm/mv/armadaxp/std.armadaxp Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/mv/armadaxp/std.armadaxp Sun Jan 7 00:04:13 2018 (r327658) @@ -1,4 +1,2 @@ # $FreeBSD$ -makeoptions KERNVIRTADDR=0xc0200000 -options KERNVIRTADDR=0xc0200000 Modified: stable/11/sys/arm/nvidia/tegra124/std.tegra124 ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/std.tegra124 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/nvidia/tegra124/std.tegra124 Sun Jan 7 00:04:13 2018 (r327658) @@ -3,9 +3,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -options KERNVIRTADDR = 0xc0200000 -makeoptions KERNVIRTADDR = 0xc0200000 - options INTRNG options IPI_IRQ_START=0 Modified: stable/11/sys/arm/rockchip/std.rk30xx ============================================================================== --- stable/11/sys/arm/rockchip/std.rk30xx Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/rockchip/std.rk30xx Sun Jan 7 00:04:13 2018 (r327658) @@ -5,9 +5,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0400000 -options KERNVIRTADDR=0xc0400000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/samsung/exynos/std.exynos5250 ============================================================================== --- stable/11/sys/arm/samsung/exynos/std.exynos5250 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/samsung/exynos/std.exynos5250 Sun Jan 7 00:04:13 2018 (r327658) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- stable/11/sys/arm/samsung/exynos/std.exynos5420 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/samsung/exynos/std.exynos5420 Sun Jan 7 00:04:13 2018 (r327658) @@ -4,9 +4,6 @@ cpu CPU_CORTEXA machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a" -makeoptions KERNVIRTADDR=0xc0f00000 -options KERNVIRTADDR=0xc0f00000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/arm/ti/am335x/std.am335x ============================================================================== --- stable/11/sys/arm/ti/am335x/std.am335x Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/ti/am335x/std.am335x Sun Jan 7 00:04:13 2018 (r327658) @@ -3,7 +3,4 @@ files "../ti/am335x/files.am335x" include "../ti/std.ti" -options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0200000 - options SOC_TI_AM335X Modified: stable/11/sys/arm/ti/omap4/std.omap4 ============================================================================== --- stable/11/sys/arm/ti/omap4/std.omap4 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/ti/omap4/std.omap4 Sun Jan 7 00:04:13 2018 (r327658) @@ -3,7 +3,4 @@ files "../ti/omap4/files.omap4" include "../ti/std.ti" -options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0200000 - options SOC_OMAP4 Modified: stable/11/sys/arm/xilinx/std.zynq7 ============================================================================== --- stable/11/sys/arm/xilinx/std.zynq7 Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/arm/xilinx/std.zynq7 Sun Jan 7 00:04:13 2018 (r327658) @@ -9,8 +9,5 @@ makeoptions CONF_CFLAGS="-march=armv7a" files "../xilinx/files.zynq7" -options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm -makeoptions KERNVIRTADDR=0xc0100000 - options IPI_IRQ_START=0 options IPI_IRQ_END=15 Modified: stable/11/sys/conf/Makefile.arm ============================================================================== --- stable/11/sys/conf/Makefile.arm Sat Jan 6 23:44:14 2018 (r327657) +++ stable/11/sys/conf/Makefile.arm Sun Jan 7 00:04:13 2018 (r327658) @@ -53,6 +53,11 @@ CFLAGS += -mllvm -arm-enable-ehabi .endif .endif +# "makeoptions KERNVIRTADDR=" is now optional, supply the default value. +.if empty(KERNVIRTADDR) +KERNVIRTADDR= 0xc0000000 +.endif + # hack because genassym.c includes sys/bus.h which includes these. genassym.o: bus_if.h device_if.h From owner-svn-src-all@freebsd.org Sun Jan 7 00:31:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 351F4DFD3F7; Sun, 7 Jan 2018 00:31:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 117C269E85; Sun, 7 Jan 2018 00:31:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B1F719B89; Sun, 7 Jan 2018 00:31:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w070VjtV042683; Sun, 7 Jan 2018 00:31:45 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w070VjPR042682; Sun, 7 Jan 2018 00:31:45 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801070031.w070VjPR042682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 7 Jan 2018 00:31:45 +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: r327659 - stable/11/share/skel X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/skel X-SVN-Commit-Revision: 327659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 00:31:46 -0000 Author: eadler Date: Sun Jan 7 00:31:45 2018 New Revision: 327659 URL: https://svnweb.freebsd.org/changeset/base/327659 Log: MFC r327420: skel: Quote PAGER in dot.shrc PR: 181853 Submitted by: pl@catslair.org Modified: stable/11/share/skel/dot.shrc Directory Properties: stable/11/ (props changed) Modified: stable/11/share/skel/dot.shrc ============================================================================== --- stable/11/share/skel/dot.shrc Sun Jan 7 00:04:13 2018 (r327658) +++ stable/11/share/skel/dot.shrc Sun Jan 7 00:31:45 2018 (r327659) @@ -21,7 +21,7 @@ # some useful aliases alias h='fc -l' alias j=jobs -alias m=$PAGER +alias m="$PAGER" alias ll='ls -laFo' alias l='ls -l' alias g='egrep -i' From owner-svn-src-all@freebsd.org Sun Jan 7 00:35:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F038DFD622; Sun, 7 Jan 2018 00:35:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29FF56A1E5; Sun, 7 Jan 2018 00:35:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F9BA19BCD; Sun, 7 Jan 2018 00:35:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w070ZrQp043659; Sun, 7 Jan 2018 00:35:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w070ZrKD043658; Sun, 7 Jan 2018 00:35:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801070035.w070ZrKD043658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 7 Jan 2018 00:35:53 +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: r327660 - stable/11/usr.bin/man X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/man X-SVN-Commit-Revision: 327660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 00:35:54 -0000 Author: eadler Date: Sun Jan 7 00:35:52 2018 New Revision: 327660 URL: https://svnweb.freebsd.org/changeset/base/327660 Log: MFC r327396: man(1): document exit code man(1) uses standard exit codes, document that. PR: 223517 Reported by: wosch Modified: stable/11/usr.bin/man/man.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/man/man.1 ============================================================================== --- stable/11/usr.bin/man/man.1 Sun Jan 7 00:31:45 2018 (r327659) +++ stable/11/usr.bin/man/man.1 Sun Jan 7 00:35:52 2018 (r327660) @@ -355,6 +355,8 @@ System configuration file. .It Pa /usr/local/etc/man.d/*.conf Local configuration files. .El +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr apropos 1 , .Xr intro 1 , From owner-svn-src-all@freebsd.org Sun Jan 7 00:38:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9A9FDFD861; Sun, 7 Jan 2018 00:38:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83EBD6A374; Sun, 7 Jan 2018 00:38:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCBD019BD0; Sun, 7 Jan 2018 00:38:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w070cYc5043798; Sun, 7 Jan 2018 00:38:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w070cY8a043797; Sun, 7 Jan 2018 00:38:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801070038.w070cY8a043797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 7 Jan 2018 00:38: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: r327661 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 327661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 00:38:35 -0000 Author: eadler Date: Sun Jan 7 00:38:34 2018 New Revision: 327661 URL: https://svnweb.freebsd.org/changeset/base/327661 Log: MFC r327398: isgreater(3): correct description of isunordered macro PR: 211376 Submitted by: Duane Modified: stable/11/lib/libc/gen/isgreater.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/isgreater.3 ============================================================================== --- stable/11/lib/libc/gen/isgreater.3 Sun Jan 7 00:35:52 2018 (r327660) +++ stable/11/lib/libc/gen/isgreater.3 Sun Jan 7 00:38:34 2018 (r327661) @@ -75,9 +75,9 @@ macro takes arguments .Fa x and .Fa y -and returns non-zero if and only if neither +and returns non-zero if and only if any of .Fa x -nor +or .Fa y are NaNs. For any pair of floating-point values, one From owner-svn-src-all@freebsd.org Sun Jan 7 00:44:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C9C5DFDCAC; Sun, 7 Jan 2018 00:44:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC126A807; Sun, 7 Jan 2018 00:44:24 +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 74BE019D62; Sun, 7 Jan 2018 00:44:23 +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 w070iNRt047873; Sun, 7 Jan 2018 00:44:23 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w070iMGX047862; Sun, 7 Jan 2018 00:44:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801070044.w070iMGX047862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 7 Jan 2018 00:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327662 - in head: . tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . tests/sys/geom/class/eli X-SVN-Commit-Revision: 327662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 00:44:24 -0000 Author: asomers Date: Sun Jan 7 00:44:22 2018 New Revision: 327662 URL: https://svnweb.freebsd.org/changeset/base/327662 Log: geli: convert most tests from TAP to ATF I'm leaving readonly_test and nokey_test alone for now. In a future commit they should be broken up into several smaller test cases and distributed between multiple files. Reviewed by: ngie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13717 Added: head/tests/sys/geom/class/eli/attach_test.sh (contents, props changed) head/tests/sys/geom/class/eli/configure_test.sh (contents, props changed) head/tests/sys/geom/class/eli/detach_test.sh (contents, props changed) head/tests/sys/geom/class/eli/integrity_test.sh (contents, props changed) Deleted: head/tests/sys/geom/class/eli/attach_d_test.sh head/tests/sys/geom/class/eli/configure_b_B_test.sh head/tests/sys/geom/class/eli/detach_l_test.sh head/tests/sys/geom/class/eli/init_B_test.sh head/tests/sys/geom/class/eli/init_J_test.sh head/tests/sys/geom/class/eli/init_a_test.sh head/tests/sys/geom/class/eli/init_alias_test.sh head/tests/sys/geom/class/eli/init_i_P_test.sh head/tests/sys/geom/class/eli/integrity_copy_test.sh head/tests/sys/geom/class/eli/integrity_data_test.sh head/tests/sys/geom/class/eli/integrity_hmac_test.sh head/tests/sys/geom/class/eli/onetime_a_test.sh head/tests/sys/geom/class/eli/onetime_d_test.sh Modified: head/ObsoleteFiles.inc head/tests/sys/geom/class/eli/Makefile head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/delkey_test.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/kill_test.sh head/tests/sys/geom/class/eli/onetime_test.sh head/tests/sys/geom/class/eli/resize_test.sh head/tests/sys/geom/class/eli/setkey_test.sh Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jan 7 00:38:34 2018 (r327661) +++ head/ObsoleteFiles.inc Sun Jan 7 00:44:22 2018 (r327662) @@ -38,6 +38,20 @@ # xargs -n1 | sort | uniq -d; # done +# 20180106: Convert most geli(8) tests to ATF +OLD_FILES+=tests/sys/geom/class/eli/attach_d_test.sh +OLD_FILES+=tests/sys/geom/class/eli/configure_b_B_test.sh +OLD_FILES+=tests/sys/geom/class/eli/detach_l_test.sh +OLD_FILES+=tests/sys/geom/class/eli/init_B_test.sh +OLD_FILES+=tests/sys/geom/class/eli/init_J_test.sh +OLD_FILES+=tests/sys/geom/class/eli/init_a_test.sh +OLD_FILES+=tests/sys/geom/class/eli/init_alias_test.sh +OLD_FILES+=tests/sys/geom/class/eli/init_i_P_test.sh +OLD_FILES+=tests/sys/geom/class/eli/integrity_copy_test.sh +OLD_FILES+=tests/sys/geom/class/eli/integrity_data_test.sh +OLD_FILES+=tests/sys/geom/class/eli/integrity_hmac_test.sh +OLD_FILES+=tests/sys/geom/class/eli/onetime_a_test.sh +OLD_FILES+=tests/sys/geom/class/eli/onetime_d_test.sh # 20171230: Remove /etc/skel from mtree OLD_DIRS+=/etc/skel # 20171208: Remove basename_r(3) Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Sun Jan 7 00:38:34 2018 (r327661) +++ head/tests/sys/geom/class/eli/Makefile Sun Jan 7 00:44:22 2018 (r327662) @@ -7,36 +7,20 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} ATF_TESTS_C= pbkdf2_test +ATF_TESTS_SH+= attach_test +ATF_TESTS_SH+= configure_test +ATF_TESTS_SH+= delkey_test +ATF_TESTS_SH+= detach_test +ATF_TESTS_SH+= init_test +ATF_TESTS_SH+= integrity_test +ATF_TESTS_SH+= kill_test +ATF_TESTS_SH+= onetime_test +ATF_TESTS_SH+= resize_test +ATF_TESTS_SH+= setkey_test -TAP_TESTS_SH+= attach_d_test -TAP_TESTS_SH+= configure_b_B_test -TAP_TESTS_SH+= delkey_test -TAP_TESTS_SH+= detach_l_test -TAP_TESTS_SH+= init_B_test -TAP_TESTS_SH+= init_J_test -TAP_TESTS_SH+= init_a_test -TAP_TESTS_SH+= init_alias_test -TAP_TESTS_SH+= init_i_P_test -TAP_TESTS_SH+= init_test -TAP_TESTS_SH+= integrity_copy_test -TAP_TESTS_SH+= integrity_data_test -TAP_TESTS_SH+= integrity_hmac_test -TAP_TESTS_SH+= kill_test TAP_TESTS_SH+= nokey_test -TAP_TESTS_SH+= onetime_a_test -TAP_TESTS_SH+= onetime_d_test -TAP_TESTS_SH+= onetime_test TAP_TESTS_SH+= readonly_test -TAP_TESTS_SH+= resize_test -TAP_TESTS_SH+= setkey_test -TEST_METADATA.init_a_test+= timeout="3600" -TEST_METADATA.init_test+= timeout="600" -TEST_METADATA.integrity_copy_test+= timeout="3600" -TEST_METADATA.integrity_data_test+= timeout="1800" -TEST_METADATA.integrity_hmac_test+= timeout="1800" -TEST_METADATA.onetime_a_test+= timeout="1800" -TEST_METADATA.onetime_test+= timeout="1800" ${PACKAGE}FILES+= conf.sh Added: head/tests/sys/geom/class/eli/attach_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/attach_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +atf_test_case attach_d cleanup +attach_d_head() +{ + atf_set "descr" "geli attach -d will cause the provider to detach on last close" + atf_set "require.user" "root" +} +attach_d_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -d -p -k keyfile ${md} + + # Be sure it doesn't detach on read. + atf_check dd if=/dev/${md}.eli of=/dev/null status=none + sleep 1 + if [ ! -c /dev/${md}.eli ]; then + atf_fail "Detached on last close of a reader" + fi + + # It should detach on last close of a writer + true > /dev/${md}.eli + sleep 1 + if [ -c /dev/${md}.eli ]; then + atf_fail "Did not detach on last close of a writer" + fi + +} +attach_d_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case attach_d +} Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 00:38:34 2018 (r327661) +++ head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -2,8 +2,19 @@ # $FreeBSD$ class="eli" -base=`basename $0` +base=$(atf_get ident) +[ -z "$base" ] && base=`basename $0` # for TAP compatibility +TEST_MDS_FILE=md.devs +attach_md() +{ + local test_md + + test_md=$(mdconfig -a "$@") || atf_fail "failed to allocate md(4)" + echo $test_md >> $TEST_MDS_FILE || exit + echo $test_md +} + # Execute `func` for each combination of cipher, sectorsize, and hmac algo # `func` usage should be: # func @@ -23,7 +34,11 @@ for_each_geli_config() { for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do - bytes=`expr $secsize \* $sectors + 512`b + # Double the requested sector size to allow + # for the HMACs' storage space. + osecsize=$(( $secsize * 2 )) + # geli needs 512B for the label. + bytes=`expr $osecsize \* $sectors + 512`b md=$(attach_md -t malloc -s $bytes) ${func} $cipher $aalgo $secsize geli detach ${md} 2>/dev/null @@ -50,6 +65,7 @@ for_each_geli_config_nointegrity() { ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do + # geli needs 512B for the label. bytes=`expr $secsize \* $sectors + 512`b md=$(attach_md -t malloc -s $bytes) ${func} $cipher $secsize @@ -69,8 +85,9 @@ geli_test_cleanup() mdconfig -d -u $md 2>/dev/null done < $TEST_MDS_FILE fi - rm -f "$TEST_MDS_FILE" + true } +# TODO: remove the trap statement once all TAP tests are converted trap geli_test_cleanup ABRT EXIT INT TERM . `dirname $0`/../geom_subr.sh Added: head/tests/sys/geom/class/eli/configure_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/configure_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -0,0 +1,59 @@ +# $FreeBSD$ + +atf_test_case configure_b_B cleanup +configure_b_B_head() +{ + atf_set "descr" "geli configure -b will set the BOOT flag" + atf_set "require.user" "root" +} +configure_b_B_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check geli init -B none -P -K /dev/null ${md} + + atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md} + + atf_check geli init -B none -b -P -K /dev/null ${md} + + atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md} + + atf_check geli configure -B ${md} + + atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md} + + atf_check geli configure -b ${md} + + atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md} + + atf_check geli attach -p -k /dev/null ${md} + + atf_check -s exit:0 -o match:'^Flags: .*BOOT' geli list ${md}.eli + + atf_check geli configure -B ${md} + + atf_check -o not-match:'^Flags: .*BOOT' geli list ${md}.eli + + atf_check -s exit:0 -o match:'flags: 0x0$' geli dump ${md} + + atf_check geli configure -b ${md} + + atf_check -s exit:0 -o match:'^Flags: .*BOOT' geli list ${md}.eli + + atf_check -s exit:0 -o match:'flags: 0x2$' geli dump ${md} + + atf_check geli detach ${md} +} +configure_b_B_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case configure_b_B +} Modified: head/tests/sys/geom/class/eli/delkey_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/delkey_test.sh Sun Jan 7 00:38:34 2018 (r327661) +++ head/tests/sys/geom/class/eli/delkey_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -1,140 +1,86 @@ #!/bin/sh # $FreeBSD$ -. $(dirname $0)/conf.sh +atf_test_case delkey cleanup +delkey_head() +{ + atf_set "descr" "geli delkey can destroy the master key" + atf_set "require.user" "root" +} +delkey_body() +{ + . $(atf_get_srcdir)/conf.sh -base=`basename $0` -sectors=100 -keyfile1=`mktemp $base.XXXXXX` || exit 1 -keyfile2=`mktemp $base.XXXXXX` || exit 1 -keyfile3=`mktemp $base.XXXXXX` || exit 1 -keyfile4=`mktemp $base.XXXXXX` || exit 1 -md=$(attach_md -t malloc -s `expr $sectors + 1`) + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) -echo "1..14" + atf_check dd if=/dev/random of=keyfile1 bs=512 count=16 status=none + atf_check dd if=/dev/random of=keyfile2 bs=512 count=16 status=none + atf_check dd if=/dev/random of=keyfile3 bs=512 count=16 status=none + atf_check dd if=/dev/random of=keyfile4 bs=512 count=16 status=none -dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile3} bs=512 count=16 >/dev/null 2>&1 -dd if=/dev/random of=${keyfile4} bs=512 count=16 >/dev/null 2>&1 + atf_check geli init -B none -P -K keyfile1 ${md} + atf_check geli attach -p -k keyfile1 ${md} + atf_check -s exit:0 -o ignore geli setkey -n 1 -P -K keyfile2 ${md} -geli init -B none -P -K $keyfile1 ${md} -geli attach -p -k $keyfile1 ${md} -geli setkey -n 1 -P -K $keyfile2 ${md} + # Remove key 0 for attached provider. + atf_check geli delkey -n 0 ${md} + atf_check geli detach ${md} -# Remove key 0 for attached provider. -geli delkey -n 0 ${md} -if [ $? -eq 0 ]; then - echo "ok 1" -else - echo "not ok 1" -fi -geli detach ${md} + # We cannot use keyfile1 anymore. + atf_check -s not-exit:0 -e match:"Wrong key" \ + geli attach -p -k keyfile1 ${md} -# We cannot use keyfile1 anymore. -geli attach -p -k $keyfile1 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 2" -else - echo "not ok 2" -fi + # Attach with key 1. + atf_check geli attach -p -k keyfile2 ${md} -# Attach with key 1. -geli attach -p -k $keyfile2 ${md} -if [ $? -eq 0 ]; then - echo "ok 3" -else - echo "not ok 3" -fi + # We cannot remove last key without -f option (for attached provider). + atf_check -s not-exit:0 -e match:"This is the last Master Key" \ + geli delkey -n 1 ${md} -# We cannot remove last key without -f option (for attached provider). -geli delkey -n 1 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 4" -else - echo "not ok 4" -fi + # Remove last key for attached provider. + atf_check geli delkey -f -n 1 ${md} -# Remove last key for attached provider. -geli delkey -f -n 1 ${md} -if [ $? -eq 0 ]; then - echo "ok 5" -else - echo "not ok 5" -fi + # If there are no valid keys, but provider is attached, we can save situation. + atf_check -s exit:0 -o ignore geli setkey -n 0 -P -K keyfile3 ${md} + atf_check geli detach ${md} -# If there are no valid keys, but provider is attached, we can save situation. -geli setkey -n 0 -P -K $keyfile3 ${md} -if [ $? -eq 0 ]; then - echo "ok 6" -else - echo "not ok 6" -fi -geli detach ${md} + # We cannot use keyfile2 anymore. + atf_check -s not-exit:0 -e match:"Wrong key" \ + geli attach -p -k keyfile2 ${md} -# We cannot use keyfile2 anymore. -geli attach -p -k $keyfile2 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 7" -else - echo "not ok 7" -fi + # Attach with key 0. + atf_check geli attach -p -k keyfile3 ${md} -# Attach with key 0. -geli attach -p -k $keyfile3 ${md} -if [ $? -eq 0 ]; then - echo "ok 8" -else - echo "not ok 8" -fi + # Setup key 1. + atf_check -s exit:0 -o ignore geli setkey -n 1 -P -K keyfile4 ${md} + atf_check geli detach ${md} -# Setup key 1. -geli setkey -n 1 -P -K $keyfile4 ${md} -if [ $? -eq 0 ]; then - echo "ok 9" -else - echo "not ok 9" -fi -geli detach ${md} + # Remove key 1 for detached provider. + atf_check geli delkey -n 1 ${md} -# Remove key 1 for detached provider. -geli delkey -n 1 ${md} -if [ $? -eq 0 ]; then - echo "ok 10" -else - echo "not ok 10" -fi + # We cannot use keyfile4 anymore. + atf_check -s not-exit:0 -e match:"Wrong key" \ + geli attach -p -k keyfile4 ${md} -# We cannot use keyfile4 anymore. -geli attach -p -k $keyfile4 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 11" -else - echo "not ok 11" -fi + # We cannot remove last key without -f option (for detached provider). + atf_check -s not-exit:0 -e match:"This is the last Master Key" \ + geli delkey -n 0 ${md} -# We cannot remove last key without -f option (for detached provider). -geli delkey -n 0 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 12" -else - echo "not ok 12" -fi + # Remove last key for detached provider. + atf_check geli delkey -f -n 0 ${md} -# Remove last key for detached provider. -geli delkey -f -n 0 ${md} -if [ $? -eq 0 ]; then - echo "ok 13" -else - echo "not ok 13" -fi + # We cannot use keyfile3 anymore. + atf_check -s not-exit:0 -e match:"No valid keys" \ + geli attach -p -k keyfile3 ${md} +} +delkey_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} -# We cannot use keyfile3 anymore. -geli attach -p -k $keyfile3 ${md} 2>/dev/null -if [ $? -ne 0 ]; then - echo "ok 14" -else - echo "not ok 14" -fi - -rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 +atf_init_test_cases() +{ + atf_add_test_case delkey +} Added: head/tests/sys/geom/class/eli/detach_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/detach_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -0,0 +1,46 @@ +# $FreeBSD$ + +atf_test_case detach_l cleanup +detach_l_head() +{ + atf_set "descr" "geli detach -l will cause a provider to detach on last close" + atf_set "require.user" "root" +} +detach_l_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -p -k keyfile ${md} + + # Be sure it doesn't detach before 'detach -l'. + atf_check dd if=/dev/${md}.eli of=/dev/null status=none + sleep 1 + if [ ! -c /dev/${md}.eli ]; then + atf_fail "provider detached on last close without detach -l" + fi + atf_check geli detach -l ${md} + if [ ! -c /dev/${md}.eli ]; then + atf_fail "Provider detached before last close" + fi + atf_check dd if=/dev/${md}.eli of=/dev/null status=none + sleep 1 + if [ -c /dev/${md}.eli ]; then + atf_fail "Provider did not detach on last close" + fi +} +detach_l_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case detach_l +} Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 00:38:34 2018 (r327661) +++ head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -1,50 +1,368 @@ #!/bin/sh # $FreeBSD$ -. $(dirname $0)/conf.sh +init_test() +{ + cipher=$1 + secsize=$2 + ealgo=${cipher%%:*} + keylen=${cipher##*:} -base=`basename $0` -sectors=32 -keyfile=`mktemp $base.XXXXXX` || exit 1 -rnd=`mktemp $base.XXXXXX` || exit 1 + atf_check -s exit:0 -e ignore \ + geli init -B none -e $ealgo -l $keylen -P -K keyfile -s $secsize ${md} + atf_check geli attach -p -k keyfile ${md} -echo "1..200" + secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` -do_test() { + atf_check dd if=/dev/random of=rnd bs=${secsize} count=${secs} status=none + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none + + md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + atf_check_equal 0 $? + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + atf_check_equal 0 $? + md_edev=`dd if=/dev/${md} bs=${secsize} count=${secs} status=none | md5` + atf_check_equal 0 $? + + if [ ${md_rnd} != ${md_ddev} ]; then + atf_fail "Miscompare for ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi + if [ ${md_rnd} == ${md_edev} ]; then + atf_fail "Data was not encrypted for ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + fi +} +atf_test_case init cleanup +init_head() +{ + atf_set "descr" "Basic I/O with geli" + atf_set "require.user" "root" + atf_set "timeout" 600 +} +init_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=32 + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + atf_check dd if=/dev/random of=rnd bs=8192 count=${sectors} status=none + for_each_geli_config_nointegrity init_test +} +init_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case init_B cleanup +init_B_head() +{ + atf_set "descr" "init -B can select an alternate backup metadata file" + atf_set "require.user" "root" +} +init_B_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + md=$(attach_md -t malloc -s $sectors) + + # -B none + rm -f /var/backups/${md}.eli + atf_check -s exit:0 -o ignore geli init -B none -P -K keyfile ${md} + if [ -f /var/backups/${md}.eli ]; then + atf_fail "geli created a backup file even with -B none" + fi + + # no -B + rm -f /var/backups/${md}.eli + atf_check -s exit:0 -o ignore geli init -P -K keyfile ${md} + if [ ! -f /var/backups/${md}.eli ]; then + atf_fail "geli did not create a backup file" + fi + atf_check geli clear ${md} + atf_check -s not-exit:0 -e ignore geli attach -p -k keyfile ${md} + atf_check -s exit:0 -o ignore geli restore /var/backups/${md}.eli ${md} + atf_check -s exit:0 -o ignore geli attach -p -k keyfile ${md} + atf_check geli detach ${md} + rm -f /var/backups/${md}.eli + + # -B file + rm -f backupfile + atf_check -s exit:0 -o ignore \ + geli init -B backupfile -P -K keyfile ${md} + if [ ! -f backupfile ]; then + atf_fail "geli init -B did not create a backup file" + fi + atf_check geli clear ${md} + atf_check -s not-exit:0 -e ignore geli attach -p -k keyfile ${md} + atf_check geli restore backupfile ${md} + atf_check geli attach -p -k keyfile ${md} +} +init_B_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case init_J cleanup +init_J_head() +{ + atf_set "descr" "init -J accepts a passfile" + atf_set "require.user" "root" +} +init_J_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check dd if=/dev/random of=keyfile0 bs=512 count=16 status=none + atf_check dd if=/dev/random of=keyfile1 bs=512 count=16 status=none + dd if=/dev/random bs=512 count=16 status=none | sha1 > passfile0 + atf_check_equal 0 $? + dd if=/dev/random bs=512 count=16 status=none | sha1 > passfile1 + atf_check_equal 0 $? + + for iter in -1 0 64; do + atf_check -s not-exit:0 -e ignore \ + geli init -i ${iter} -B none -J passfile0 -P ${md} + atf_check -s not-exit:0 -e ignore \ + geli init -i ${iter} -B none -J passfile0 -P -K keyfile0 ${md} + atf_check geli init -i ${iter} -B none -J passfile0 -K keyfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -p ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j keyfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k passfile0 -p ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j keyfile0 -k passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j keyfile0 -k keyfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j passfile0 -k passfile0 ${md} + atf_check -s exit:0 -e ignore \ + geli attach -j passfile0 -k keyfile0 ${md} + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat keyfile0 | geli attach -j passfile0 -k - ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat passfile0 | geli attach -j - -k keyfile0 ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + + atf_check -s not-exit:0 -e ignore \ + geli init -i ${iter} -B none -J passfile0 -J passfile1 -P ${md} + atf_check -s not-exit:0 -e ignore \ + geli init -i ${iter} -B none -J passfile0 -J passfile1 -P -K keyfile0 -K keyfile1 ${md} + atf_check -s exit:0 -e ignore \ + geli init -i ${iter} -B none -J passfile0 -J passfile1 -K keyfile0 -K keyfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -p ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -p ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -k keyfile1 -p ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -j passfile0 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -j passfile0 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -j passfile0 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -k keyfile1 -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -k keyfile1 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -k keyfile0 -j passfile0 -j passfile1 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile0 -k keyfile1 -j passfile1 -j passfile0 ${md} + atf_check -s not-exit:0 -e ignore \ + geli attach -k keyfile1 -k keyfile0 -j passfile1 -j passfile0 ${md} + atf_check -s exit:0 -e ignore \ + geli attach -j passfile0 -j passfile1 -k keyfile0 -k keyfile1 ${md} + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat passfile0 | geli attach -j - -j passfile1 -k keyfile0 -k keyfile1 ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat passfile1 | geli attach -j passfile0 -j - -k keyfile0 -k keyfile1 ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat keyfile0 | geli attach -j passfile0 -j passfile1 -k - -k keyfile1 ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat keyfile1 | geli attach -j passfile0 -j passfile1 -k keyfile0 -k - ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat keyfile0 keyfile1 | geli attach -j passfile0 -j passfile1 -k - ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + atf_check -s exit:0 -e ignore -x \ + "cat passfile0 passfile1 | awk '{printf \"%s\", \$0}' | geli attach -j - -k keyfile0 -k keyfile1 ${md}" + atf_check -s exit:0 -e ignore geli detach ${md} + done +} +init_J_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +init_a_test() +{ cipher=$1 - secsize=$2 + aalgo=$2 + secsize=$3 ealgo=${cipher%%:*} keylen=${cipher##*:} - geli init -B none -e $ealgo -l $keylen -P -K $keyfile -s $secsize ${md} 2>/dev/null - geli attach -p -k $keyfile ${md} + atf_check -s exit:0 -e ignore geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile -s $secsize ${md} + atf_check geli attach -p -k keyfile ${md} secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` - dd if=/dev/random of=${rnd} bs=${secsize} count=${secs} >/dev/null 2>&1 - dd if=${rnd} of=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none - md_rnd=`dd if=${rnd} bs=${secsize} count=${secs} 2>/dev/null | md5` - md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` - md_edev=`dd if=/dev/${md} bs=${secsize} count=${secs} 2>/dev/null | md5` + md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + atf_check_equal 0 $? + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} status=none | md5` + atf_check_equal 0 $? - if [ ${md_rnd} = ${md_ddev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" + if [ ${md_rnd} != ${md_ddev} ]; then + atf_fail "Miscompare for aalgo=${aalgo} ealgo=${ealgo} keylen=${keylen} sec=${secsize}" fi - i=$((i+1)) - if [ ${md_rnd} != ${md_edev} ]; then - echo "ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" - else - echo "not ok $i - ealgo=${ealgo} keylen=${keylen} sec=${secsize}" +} +atf_test_case init_a cleanup +init_a_head() +{ + atf_set "descr" "I/O with geli and HMACs" + atf_set "require.user" "root" + atf_set "timeout" 3600 +} +init_a_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + atf_check dd if=/dev/random of=rnd bs=8192 count=${sectors} status=none + for_each_geli_config init_a_test + true +} +init_a_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +init_alias_test() { + ealgo=$1 + keylen=$2 + expected_ealgo=$3 + expected_keylen=$4 + + atf_check geli init -B none -e $ealgo -l $keylen -P -K keyfile ${md} + atf_check geli attach -p -k keyfile ${md} + real_ealgo=`geli list ${md}.eli | awk '/EncryptionAlgorithm/ {print $2}'` + real_keylen=`geli list ${md}.eli | awk '/KeyLength/ {print $2}'` + + if [ "${real_ealgo}" != "${expected_ealgo}" ]; then + atf_fail "expected ${expected_ealgo} but got ${real_ealgo}" fi - i=$((i+1)) + + if [ "${real_keylen}" != "${expected_keylen}" ]; then + atf_fail "expected ${expected_keylen} but got ${real_keylen}" + fi + atf_check geli detach ${md} } +atf_test_case init_alias cleanup +init_alias_head() +{ + atf_set "descr" "geli init accepts cipher aliases" + atf_set "require.user" "root" +} +init_alias_body() +{ + . $(atf_get_srcdir)/conf.sh -i=1 -dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 -for_each_geli_config_nointegrity do_test + md=$(attach_md -t malloc -s 1024k) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none -rm -f $rnd -rm -f $keyfile + for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ + 3des:0:3DES-CBC:192 3des:192:3DES-CBC:192 \ + blowfish:0:Blowfish-CBC:128 blowfish:128:Blowfish-CBC:128 \ + blowfish:160:Blowfish-CBC:160 blowfish:192:Blowfish-CBC:192 \ + blowfish:224:Blowfish-CBC:224 blowfish:256:Blowfish-CBC:256 \ + blowfish:288:Blowfish-CBC:288 blowfish:352:Blowfish-CBC:352 \ + blowfish:384:Blowfish-CBC:384 blowfish:416:Blowfish-CBC:416 \ + blowfish:448:Blowfish-CBC:448 \ + camellia:0:CAMELLIA-CBC:128 camellia:128:CAMELLIA-CBC:128 \ + camellia:256:CAMELLIA-CBC:256 ; do + + ealgo=`echo $spec | cut -d : -f 1` + keylen=`echo $spec | cut -d : -f 2` + expected_ealgo=`echo $spec | cut -d : -f 3` + expected_keylen=`echo $spec | cut -d : -f 4` + + init_alias_test $ealgo $keylen $expected_ealgo $expected_keylen + done +} +init_alias_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case init_i_P cleanup +init_i_P_head() +{ + atf_set "descr" "geli: Options -i and -P are mutually exclusive" + atf_set "require.user" "root" +} +init_i_P_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check -s exit:1 -e "match:Options -i and -P are mutually exclusive"\ + geli init -B none -i 64 -P -K keyfile $md +} +init_i_P_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case init + atf_add_test_case init_B + atf_add_test_case init_J + atf_add_test_case init_a + atf_add_test_case init_alias + atf_add_test_case init_i_P +} Added: head/tests/sys/geom/class/eli/integrity_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/eli/integrity_test.sh Sun Jan 7 00:44:22 2018 (r327662) @@ -0,0 +1,160 @@ +# $FreeBSD$ + +copy_test() { + cipher=$1 + aalgo=$2 + secsize=$3 + ealgo=${cipher%%:*} + keylen=${cipher##*:} + + atf_check -s exit:0 -e ignore \ + geli init -B none -a $aalgo -e $ealgo -l $keylen -P \ + -K keyfile -s $secsize ${md} + atf_check geli attach -p -k keyfile ${md} + + atf_check dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=1 status=none + + atf_check geli detach ${md} + # Copy first small sector to the second small sector. + # This should be detected as corruption. + atf_check dd if=/dev/${md} of=sector bs=512 count=1 status=none + atf_check dd if=sector of=/dev/${md} bs=512 count=1 seek=1 status=none + atf_check geli attach -p -k keyfile ${md} + + atf_check -s not-exit:0 -e ignore \ + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=1 + + # Fix the corruption + atf_check dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=2 status=none + atf_check dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=2 status=none + + # Copy first big sector to the second big sector. + # This should be detected as corruption. + ms=`diskinfo /dev/${md} | awk '{print $3 - 512}'` + ns=`diskinfo /dev/${md}.eli | awk '{print $4}'` + usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` + atf_check geli detach ${md} + atf_check dd if=/dev/${md} bs=512 count=$(( ${usecsize} / 512 )) seek=$(( $secsize / 512 )) of=sector status=none + atf_check dd of=/dev/${md} bs=512 count=$(( ${usecsize} / 512 )) seek=$(( $secsize / 256 )) if=sector status=none + atf_check -s exit:0 -e ignore geli attach -p -k keyfile ${md} + atf_check -s not-exit:0 -e ignore \ + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=$ns +} + +atf_test_case copy cleanup +copy_head() +{ + atf_set "descr" "geli will detect misdirected writes as corruption" + atf_set "require.user" "root" + atf_set "timeout" 3600 +} +copy_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=2 + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + for_each_geli_config copy_test +} +copy_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + + +data_test() { + cipher=$1 + aalgo=$2 + secsize=$3 + ealgo=${cipher%%:*} + keylen=${cipher##*:} + + atf_check -s exit:0 -e ignore \ + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile \ + -s $secsize ${md} + + # Corrupt 8 bytes of data. + atf_check dd if=/dev/${md} of=sector bs=512 count=1 status=none + atf_check dd if=/dev/random of=sector bs=1 count=8 seek=64 conv=notrunc status=none + atf_check dd if=sector of=/dev/${md} bs=512 count=1 status=none + atf_check geli attach -p -k keyfile ${md} + + # Try to read from the corrupt sector + atf_check -s not-exit:0 -e ignore \ + dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=1 +} + +atf_test_case data cleanup +data_head() +{ + atf_set "descr" "With HMACs, geli will detect data corruption" + atf_set "require.user" "root" + atf_set "timeout" 1800 +} +data_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=2 + + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jan 7 01:06:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445F5DFEAAA; Sun, 7 Jan 2018 01:06: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E2D56B21D; Sun, 7 Jan 2018 01:06: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 690331A0A4; Sun, 7 Jan 2018 01:06: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 w071650u056255; Sun, 7 Jan 2018 01:06:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07165K0056253; Sun, 7 Jan 2018 01:06:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801070106.w07165K0056253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 01:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327663 - in stable/11: . share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11: . share/man/man7 X-SVN-Commit-Revision: 327663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 01:06:06 -0000 Author: ian Date: Sun Jan 7 01:06:04 2018 New Revision: 327663 URL: https://svnweb.freebsd.org/changeset/base/327663 Log: MFC r327439: Allow use of .WAIT in the LOCAL_DIRS and LOCAL_LIB_DIRS lists. A comment in Makefile.inc1 has long stated that LOCAL_DIRS are built last, after the base system. Incremental improvements in parallel building over the years have led to LOCAL_DIRS being built in parallel with base system directories. This change allows the .WAIT directive to appear in LOCAL_DIRS and LOCAL_LIB_DIRS lists to give the user some control over parallel building of local additions. Differential Revision: https://reviews.freebsd.org/D13622 Modified: stable/11/Makefile.inc1 stable/11/share/man/man7/build.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sun Jan 7 00:44:22 2018 (r327662) +++ stable/11/Makefile.inc1 Sun Jan 7 01:06:04 2018 (r327663) @@ -260,10 +260,11 @@ SUBDIR+= tests SUBDIR+=contrib/ofed .endif -# Local directories are last, since it is nice to at least get the base -# system rebuilt before you do them. +# Local directories are built in parallel with the base system directories. +# Users may insert a .WAIT directive at the beginning or elsewhere within +# the LOCAL_DIRS and LOCAL_LIB_DIRS lists as needed. .for _DIR in ${LOCAL_DIRS} -.if exists(${.CURDIR}/${_DIR}/Makefile) +.if ${_DIR} == ".WAIT" || exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} .endif .endfor @@ -274,7 +275,7 @@ SUBDIR+= ${_DIR} _REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} .endfor .for _DIR in ${LOCAL_LIB_DIRS} -.if empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile) +.if ${_DIR} == ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)) SUBDIR+= ${_DIR} .endif .endfor @@ -2146,7 +2147,7 @@ lib/liblzma__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} .for _DIR in ${LOCAL_LIB_DIRS} -.if exists(${.CURDIR}/${_DIR}/Makefile) && empty(_generic_libs:M${_DIR}) +.if ${_DIR} == ".WAIT" || (empty(_generic_libs:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)) _generic_libs+= ${_DIR} .endif .endfor Modified: stable/11/share/man/man7/build.7 ============================================================================== --- stable/11/share/man/man7/build.7 Sun Jan 7 00:44:22 2018 (r327662) +++ stable/11/share/man/man7/build.7 Sun Jan 7 01:06:04 2018 (r327663) @@ -441,6 +441,15 @@ If set, this variable supplies a list of additional di the root of the source tree to build as part of the .Cm everything target. +The directories are built in parallel with each other, +and with the base system directories. +Insert a +.Va .WAIT +directive at the beginning of the +.Va LOCAL_DIRS +list to ensure all base system directories are built first. +.Va .WAIT +may also be used as needed elsewhere within the list. .It Va LOCAL_ITOOLS If set, this variable supplies a list of additional tools that are used by the .Cm installworld @@ -452,6 +461,15 @@ If set, this variable supplies a list of additional di the root of the source tree to build as part of the .Cm libraries target. +The directories are built in parallel with each other, +and with the base system libraries. +Insert a +.Va .WAIT +directive at the beginning of the +.Va LOCAL_DIRS +list to ensure all base system libraries are built first. +.Va .WAIT +may also be used as needed elsewhere within the list. .It Va LOCAL_MTREE If set, this variable supplies a list of additional mtrees relative to the root of the source tree to use as part of the From owner-svn-src-all@freebsd.org Sun Jan 7 01:08:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9CADFED32; Sun, 7 Jan 2018 01:08: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D19586B3E9; Sun, 7 Jan 2018 01:08: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 1F1CB1A0A6; Sun, 7 Jan 2018 01:08: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 w0718A80056362; Sun, 7 Jan 2018 01:08:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0718A6S056361; Sun, 7 Jan 2018 01:08:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801070108.w0718A6S056361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 01:08:10 +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: r327664 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 327664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 01:08:12 -0000 Author: ian Date: Sun Jan 7 01:08:10 2018 New Revision: 327664 URL: https://svnweb.freebsd.org/changeset/base/327664 Log: MFC r327226, r327356 r327226: Add a section describing how to tune ARM kernel options to use an MD_ROOT filesystem larger than about 50-55 MiB. The description of VM_KMEM_SIZE_SCALE is roughly as hand-wavy as my understanding of the option, but at least mentioning that it's a factor and giving an empirical datapoint that works will give folks some idea of what to tweak if they have problems. r327356: Correct a mistake and reword a couple sentences to clarify that "the value" refers to the scale value, not the kmem_arena size that results from scaling. Suggested by: alc@ Modified: stable/11/share/man/man4/md.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/md.4 ============================================================================== --- stable/11/share/man/man4/md.4 Sun Jan 7 01:06:04 2018 (r327663) +++ stable/11/share/man/man4/md.4 Sun Jan 7 01:08:10 2018 (r327664) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2017 +.Dd December 26, 2017 .Dt MD 4 .Os .Sh NAME @@ -93,6 +93,47 @@ disk found in the .Xr mdconfig 8 man page. Other tools will also create these images, such as NanoBSD. +.Sh ARM KERNEL OPTIONS +On armv6 and armv7 architectures, an MD_ROOT image larger than +approximately 55 MiB may require building a custom kernel using +several tuning options related to kernel memory usage. +.Bl -tag -width indent +.It Cd options LOCORE_MAP_MB= +This configures how much memory is mapped for the kernel during +the early initialization stages. +The value must be at least as large as the kernel plus all preloaded +modules, including the root image. +There is no downside to setting this value too large, as long +as it does not exceed the amount of physical memory. +The default is 64 MiB. +.It Cd options NKPT2PG= +This configures the number of kernel L2 page table pages to +preallocate during kernel initialization. +Each L2 page can map 4 MiB of kernel space. +The value must be large enough to map the kernel plus all preloaded +modules, including the root image. +The default value is 32, which is sufficient to map 128 MiB. +.It Cd options VM_KMEM_SIZE_SCALE= +This configures the amount of kernel virtual address (KVA) space to +dedicate to the kmem_arena map. +The scale value is the ratio of physical to virtual pages. +The default value of 3 allocates a page of KVA for each 3 pages +of physical ram in the system. + +The kernel and modules, including the root image, also consume KVA. +The combination of a large root image and the default scaling +may preallocate so much KVA that there is not enough +remaining address space to allocate kernel stacks, IO buffers, +and other resources that are not part of kmem_arena. +Overallocating kmem_arena space is likely to manifest as failure to +launch userland processes with "cannot allocate kernel stack" messages. + +Setting the scale value too high may result in kernel failure to allocate +memory because kmem_arena is too small, and the failure may require +significant runtime to manifest. +Empirically, a value of 5 works well for a 200 MiB root image on +a system with 2 GiB of physical ram. +.El .Sh SEE ALSO .Xr gpart 8 , .Xr loader 8 , From owner-svn-src-all@freebsd.org Sun Jan 7 02:30:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A55E5DBE8; Sun, 7 Jan 2018 02:30:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0816F053; Sun, 7 Jan 2018 02:30:10 +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 75EE51B039; Sun, 7 Jan 2018 02:30:09 +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 w072U9EO089382; Sun, 7 Jan 2018 02:30:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w072U9FX089379; Sun, 7 Jan 2018 02:30:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801070230.w072U9FX089379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 7 Jan 2018 02:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327666 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 02:30:10 -0000 Author: asomers Date: Sun Jan 7 02:30:08 2018 New Revision: 327666 URL: https://svnweb.freebsd.org/changeset/base/327666 Log: geli: fix parallel execution of tests The trick is not to destroy an md(4) device during a test. That can create a "double-free" situation, because we also destroy md devices during test cleanup. MFC after: 2 weeks Modified: head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 02:19:54 2018 (r327665) +++ head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 02:30:08 2018 (r327666) @@ -4,6 +4,7 @@ class="eli" base=$(atf_get ident) [ -z "$base" ] && base=`basename $0` # for TAP compatibility +MAX_SECSIZE=8192 TEST_MDS_FILE=md.devs attach_md() @@ -21,6 +22,11 @@ attach_md() for_each_geli_config() { func=$1 + # Double the sector size to allow for the HMACs' storage space. + osecsize=$(( $MAX_SECSIZE * 2 )) + # geli needs 512B for the label. + bytes=`expr $osecsize \* $sectors + 512`b + md=$(attach_md -t malloc -s $bytes) for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des-cbc:192 \ @@ -33,16 +39,9 @@ for_each_geli_config() { keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do - for secsize in 512 1024 2048 4096 8192; do - # Double the requested sector size to allow - # for the HMACs' storage space. - osecsize=$(( $secsize * 2 )) - # geli needs 512B for the label. - bytes=`expr $osecsize \* $sectors + 512`b - md=$(attach_md -t malloc -s $bytes) + for secsize in 512 1024 2048 4096 $MAX_SECSIZE; do ${func} $cipher $aalgo $secsize geli detach ${md} 2>/dev/null - mdconfig -d -u ${md} 2>/dev/null done done done @@ -54,6 +53,9 @@ for_each_geli_config() { for_each_geli_config_nointegrity() { func=$1 + # geli needs 512B for the label. + bytes=`expr $MAX_SECSIZE \* $sectors + 512`b + md=$(attach_md -t malloc -s $bytes) for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des-cbc:192 \ @@ -64,13 +66,9 @@ for_each_geli_config_nointegrity() { camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} - for secsize in 512 1024 2048 4096 8192; do - # geli needs 512B for the label. - bytes=`expr $secsize \* $sectors + 512`b - md=$(attach_md -t malloc -s $bytes) + for secsize in 512 1024 2048 4096 $MAX_SECSIZE; do ${func} $cipher $secsize geli detach ${md} 2>/dev/null - mdconfig -d -u ${md} 2>/dev/null done done } Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 02:19:54 2018 (r327665) +++ head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 02:30:08 2018 (r327666) @@ -9,19 +9,18 @@ init_test() keylen=${cipher##*:} atf_check -s exit:0 -e ignore \ - geli init -B none -e $ealgo -l $keylen -P -K keyfile -s $secsize ${md} + geli init -B none -e $ealgo -l $keylen -P -K keyfile + -s $secsize ${md} atf_check geli attach -p -k keyfile ${md} - secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} \ + status=none - atf_check dd if=/dev/random of=rnd bs=${secsize} count=${secs} status=none - atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none - - md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} 2>/dev/null | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_edev=`dd if=/dev/${md} bs=${secsize} count=${secs} status=none | md5` + md_edev=`dd if=/dev/${md} bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? if [ ${md_rnd} != ${md_ddev} ]; then @@ -45,7 +44,8 @@ init_body() sectors=32 atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none - atf_check dd if=/dev/random of=rnd bs=8192 count=${sectors} status=none + atf_check dd if=/dev/random of=rnd bs=$MAX_SECSIZE count=${sectors} \ + status=none for_each_geli_config_nointegrity init_test } init_cleanup() @@ -235,16 +235,16 @@ init_a_test() ealgo=${cipher%%:*} keylen=${cipher##*:} - atf_check -s exit:0 -e ignore geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile -s $secsize ${md} + atf_check -s exit:0 -e ignore \ + geli init -B none -a $aalgo -e $ealgo -l $keylen -P -K keyfile \ + -s $secsize ${md} atf_check geli attach -p -k keyfile ${md} - secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} status=none - atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none - - md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} status=none | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? if [ ${md_rnd} != ${md_ddev} ]; then @@ -265,7 +265,8 @@ init_a_body() sectors=100 atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none - atf_check dd if=/dev/random of=rnd bs=8192 count=${sectors} status=none + atf_check dd if=/dev/random of=rnd bs=$MAX_SECSIZE count=${sectors} \ + status=none for_each_geli_config init_a_test true } @@ -348,7 +349,7 @@ init_i_P_body() atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none - atf_check -s exit:1 -e "match:Options -i and -P are mutually exclusive"\ + atf_check -s not-exit:0 -e "match:Options -i and -P are mutually exclusive"\ geli init -B none -i 64 -P -K keyfile $md } init_i_P_cleanup() Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Sun Jan 7 02:19:54 2018 (r327665) +++ head/tests/sys/geom/class/eli/onetime_test.sh Sun Jan 7 02:30:08 2018 (r327666) @@ -10,16 +10,14 @@ onetime_test() atf_check -s exit:0 -o ignore -e ignore \ geli onetime -e $ealgo -l $keylen -s $secsize ${md} - secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` + atf_check dd if=/dev/random of=rnd bs=${secsize} count=${sectors} status=none + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} status=none - atf_check dd if=/dev/random of=rnd bs=${secsize} count=${secs} status=none - atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none - - md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} status=none | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_edev=`dd if=/dev/${md} bs=${secsize} count=${secs} status=none | md5` + md_edev=`dd if=/dev/${md} bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? if [ ${md_rnd} != ${md_ddev} ]; then @@ -41,6 +39,7 @@ onetime_body() . $(atf_get_srcdir)/conf.sh sectors=100 + dd if=/dev/random of=rnd bs=${MAX_SECSIZE} count=${sectors} status=none for_each_geli_config_nointegrity onetime_test } onetime_cleanup() @@ -60,13 +59,11 @@ onetime_a_test() atf_check -s exit:0 -o ignore -e ignore \ geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize ${md} - secs=`diskinfo /dev/${md}.eli | awk '{print $4}'` + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} status=none - atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${secs} status=none - - md_rnd=`dd if=rnd bs=${secsize} count=${secs} status=none | md5` + md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? - md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${secs} status=none | md5` + md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` atf_check_equal 0 $? if [ ${md_rnd} != ${md_ddev} ]; then From owner-svn-src-all@freebsd.org Sun Jan 7 02:19:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4F7E5D185; Sun, 7 Jan 2018 02:19:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 856826EB0D; Sun, 7 Jan 2018 02:19:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A918D1AE67; Sun, 7 Jan 2018 02:19:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w072JskF085252; Sun, 7 Jan 2018 02:19:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w072Jsx2085251; Sun, 7 Jan 2018 02:19:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801070219.w072Jsx2085251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 7 Jan 2018 02:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327665 - head/sys/dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/syscon X-SVN-Commit-Revision: 327665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 02:19:55 -0000 Author: kevans Date: Sun Jan 7 02:19:54 2018 New Revision: 327665 URL: https://svnweb.freebsd.org/changeset/base/327665 Log: Fix bogus pass for syscon_generic introduced in r327621 ian@ pointed out that BUS_PASS_DEFAULT + $anything is bogus, given that BUS_PASS_DEFAULT is defined as __INT_MAX. Instead, we take a page out of imx6_usbphy's book and use BUS_PASS_DEFAULT - 1000 to achieve the desired effect of syscon_generic attaching before if_awg and other potential consumers, but late enough that more specialized implementations should have no problem attaching instead. Reported by: ian Modified: head/sys/dev/extres/syscon/syscon_generic.c Modified: head/sys/dev/extres/syscon/syscon_generic.c ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.c Sun Jan 7 01:08:10 2018 (r327664) +++ head/sys/dev/extres/syscon/syscon_generic.c Sun Jan 7 02:19:54 2018 (r327665) @@ -206,6 +206,11 @@ static device_method_t syscon_generic_dmethods[] = { DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, syscon_generic_dmethods, sizeof(struct syscon_generic_softc)); static devclass_t syscon_generic_devclass; +/* + * syscon_generic needs to attach before other devices that may require it, such + * as if_awg, but later than others to give way for more specialized syscon + * implementations. + */ EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver, - syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT + BUS_PASS_ORDER_FIRST); + syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT - 1000); MODULE_VERSION(syscon_generic, 1); From owner-svn-src-all@freebsd.org Sun Jan 7 03:31:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D85D3E6213C; Sun, 7 Jan 2018 03:31:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3FC3722D7; Sun, 7 Jan 2018 03:31:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0CC1BCD4; Sun, 7 Jan 2018 03:31:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w073VtWL019149; Sun, 7 Jan 2018 03:31:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w073Vttb019148; Sun, 7 Jan 2018 03:31:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801070331.w073Vttb019148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 7 Jan 2018 03:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327669 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 03:31:57 -0000 Author: kevans Date: Sun Jan 7 03:31:55 2018 New Revision: 327669 URL: https://svnweb.freebsd.org/changeset/base/327669 Log: aw_sid: Add method for reading keys via prctl registers Technically supported on the later SoCs, this will only really be used to add support for the H3 sid. The H3 has a silicon bug that manifests itself by returning garbled rootkeys unless first read via the prctl registers. Modified: head/sys/arm/allwinner/aw_sid.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Sun Jan 7 02:59:27 2018 (r327668) +++ head/sys/arm/allwinner/aw_sid.c Sun Jan 7 03:31:55 2018 (r327669) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -48,6 +50,16 @@ __FBSDID("$FreeBSD$"); #include +/* efuse registers */ +#define SID_PRCTL 0x40 +#define SID_PRCTL_OFFSET_MASK 0xff +#define SID_PRCTL_OFFSET(n) (((n) & SID_PRCTL_OFFSET_MASK) << 16) +#define SID_PRCTL_LOCK (0xac << 8) +#define SID_PRCTL_READ (0x01 << 1) +#define SID_PRCTL_WRITE (0x01 << 0) +#define SID_PRKEY 0x50 +#define SID_RDKEY 0x60 + #define SID_SRAM 0x200 #define SID_THERMAL_CALIB0 (SID_SRAM + 0x34) #define SID_THERMAL_CALIB1 (SID_SRAM + 0x38) @@ -56,6 +68,7 @@ __FBSDID("$FreeBSD$"); struct aw_sid_conf { bus_size_t rootkey_offset; + bool has_prctl; bool has_thermal; }; @@ -69,11 +82,13 @@ static const struct aw_sid_conf a20_conf = { static const struct aw_sid_conf a64_conf = { .rootkey_offset = SID_SRAM, + .has_prctl = true, .has_thermal = true, }; static const struct aw_sid_conf a83t_conf = { .rootkey_offset = SID_SRAM, + .has_prctl = true, .has_thermal = true, }; @@ -88,6 +103,7 @@ static struct ofw_compat_data compat_data[] = { struct aw_sid_softc { struct resource *res; struct aw_sid_conf *sid_conf; + struct mtx prctl_mtx; }; static struct aw_sid_softc *aw_sid_sc; @@ -105,8 +121,37 @@ enum sid_keys { #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS); +static int aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val); + +/* + * offset here is offset into efuse space, rather than offset into sid register + * space. This form of read is only an option for newer SoC: A83t, H3, A64 + */ static int +aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val) +{ + struct aw_sid_softc *sc; + uint32_t readval; + + sc = device_get_softc(dev); + if (!sc->sid_conf->has_prctl) + return (1); + + mtx_lock(&sc->prctl_mtx); + readval = SID_PRCTL_OFFSET(offset) | SID_PRCTL_LOCK | SID_PRCTL_READ; + WR4(sc, SID_PRCTL, readval); + /* Read bit will be cleared once read has concluded */ + while (RD4(sc, SID_PRCTL) & SID_PRCTL_READ) + continue; + readval = RD4(sc, SID_RDKEY); + mtx_unlock(&sc->prctl_mtx); + *val = readval; + + return (0); +} + +static int aw_sid_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -131,8 +176,9 @@ aw_sid_attach(device_t dev) return (ENXIO); } - aw_sid_sc = sc; + mtx_init(&sc->prctl_mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->sid_conf = (struct aw_sid_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + aw_sid_sc = sc; SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), From owner-svn-src-all@freebsd.org Sun Jan 7 02:57:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76ED6E5FCA5; Sun, 7 Jan 2018 02:57:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52AD070512; Sun, 7 Jan 2018 02:57:37 +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 80C4B1B5B8; Sun, 7 Jan 2018 02:57:36 +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 w072vaDT001922; Sun, 7 Jan 2018 02:57:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w072vaBA001919; Sun, 7 Jan 2018 02:57:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801070257.w072vaBA001919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 02:57:36 +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: r327667 - in stable/11/sys: arm/arm conf X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11/sys: arm/arm conf X-SVN-Commit-Revision: 327667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 02:57:37 -0000 Author: ian Date: Sun Jan 7 02:57:35 2018 New Revision: 327667 URL: https://svnweb.freebsd.org/changeset/base/327667 Log: MFC r327222: Add a new ARM kernel option, LOCORE_MAP_MB, to control the size of the kernel VA mapping in the temporary page tables set up by locore-v6.S. The number used to be hard-coded to 64MB, which is still the default if the kernel option is not specified. However, 64MB is insufficient for using a large mdroot filesystem. The hard-coded number can't be safely increased because too large a number may run into memory-mapped IO space on some SoCs that must not be mapped as ordinary memory. Modified: stable/11/sys/arm/arm/genassym.c stable/11/sys/arm/arm/locore-v6.S stable/11/sys/conf/options.arm Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/genassym.c ============================================================================== --- stable/11/sys/arm/arm/genassym.c Sun Jan 7 02:30:08 2018 (r327666) +++ stable/11/sys/arm/arm/genassym.c Sun Jan 7 02:57:35 2018 (r327667) @@ -161,3 +161,12 @@ ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcach ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); + +/* + * Emit the LOCORE_MAP_MB option as a #define only if the option was set. + */ +#include "opt_locore.h" + +#ifdef LOCORE_MAP_MB +ASSYM(LOCORE_MAP_MB, LOCORE_MAP_MB); +#endif Modified: stable/11/sys/arm/arm/locore-v6.S ============================================================================== --- stable/11/sys/arm/arm/locore-v6.S Sun Jan 7 02:30:08 2018 (r327666) +++ stable/11/sys/arm/arm/locore-v6.S Sun Jan 7 02:57:35 2018 (r327667) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); +/* We map 64MB of kernel unless overridden in assym.s by the kernel option. */ +#ifndef LOCORE_MAP_MB +#define LOCORE_MAP_MB 64 +#endif #if __ARM_ARCH >= 7 #if defined(__ARM_ARCH_7VE__) || defined(__clang__) @@ -172,12 +176,13 @@ ASENTRY_NP(_start) bl build_pagetables /* - * Next we do 64MiB starting at the physical load address, mapped to - * the VA the kernel is linked for. + * Next we map the kernel starting at the physical load address, mapped + * to the VA the kernel is linked for. The default size we map is 64MiB + * but it can be overridden with a kernel option. */ mov r1, r5 ldr r2, =(KERNVIRTADDR) - mov r3, #64 + ldr r3, =(LOCORE_MAP_MB) bl build_pagetables /* Create a device mapping for early_printf if specified. */ Modified: stable/11/sys/conf/options.arm ============================================================================== --- stable/11/sys/conf/options.arm Sun Jan 7 02:30:08 2018 (r327666) +++ stable/11/sys/conf/options.arm Sun Jan 7 02:57:35 2018 (r327667) @@ -34,6 +34,7 @@ KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h MULTIDELAY opt_global.h +LOCORE_MAP_MB opt_locore.h PHYSADDR opt_global.h PLATFORM opt_global.h PLATFORM_SMP opt_global.h From owner-svn-src-all@freebsd.org Sun Jan 7 02:59:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6DEE5FE52; Sun, 7 Jan 2018 02:59:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A81E2706B9; Sun, 7 Jan 2018 02:59:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556571B5D3; Sun, 7 Jan 2018 02:59:27 +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 w072xR2k002028; Sun, 7 Jan 2018 02:59:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w072xR7V002027; Sun, 7 Jan 2018 02:59:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801070259.w072xR7V002027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 02:59:27 +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: r327668 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 327668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 02:59:29 -0000 Author: ian Date: Sun Jan 7 02:59:27 2018 New Revision: 327668 URL: https://svnweb.freebsd.org/changeset/base/327668 Log: MFC r327220-r327221 r327220: Update the FDT example for the lm75 sensor to match current devicetree standards and what the existing driver expects. Also change 'like' to 'such as' where the text is providing an example rather than a simile. r327221: Complete the changing of the old "i2c-address" property to the modern "reg" property by updating the description text to match the updated example. This should have been part of r327220 Modified: stable/11/share/man/man4/lm75.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/lm75.4 ============================================================================== --- stable/11/share/man/man4/lm75.4 Sun Jan 7 02:57:35 2018 (r327667) +++ stable/11/share/man/man4/lm75.4 Sun Jan 7 02:59:27 2018 (r327668) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2014 +.Dd December 26, 2017 .Dt LM75 4 .Os .Sh NAME @@ -122,7 +122,7 @@ clones may not work reliably. .Pp On a .Xr device.hints 5 -based system, like +based system, such as .Li MIPS , these values are configurable for .Nm : @@ -140,31 +140,28 @@ i2c address on the .Pp On a .Xr FDT 4 -based system, like +based system, such as .Li ARM , the DTS part for a .Nm device usually looks like: .Bd -literal i2c { - + /* Properties describing the controller appear here. */ ... - - lm750 { + lm750@49 { compatible = "national,lm75"; - i2c-address = <0x49>; + reg = <0x49>; }; }; .Ed .Pp Where: -.Bl -tag -width ".Va i2c-address" +.Bl -tag -width ".Va compatible" .It Va compatible Should always be set to "national,lm75". -.It Va i2c-address -The -.Va i2c-address -property indicates which i2c address the +.It Va reg +Indicates which 7-bit i2c address the .Nm is wired at. .Nm From owner-svn-src-all@freebsd.org Sun Jan 7 04:59:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A6F0E68822; Sun, 7 Jan 2018 04:59:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFCF76668; Sun, 7 Jan 2018 04:59:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9568A1CA61; Sun, 7 Jan 2018 04:59:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w074xSb5052268; Sun, 7 Jan 2018 04:59:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w074xSaZ052266; Sun, 7 Jan 2018 04:59:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801070459.w074xSaZ052266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 7 Jan 2018 04:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327670 - in head: share/man/man4 sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/man/man4 sys/arm/allwinner X-SVN-Commit-Revision: 327670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 04:59:29 -0000 Author: kevans Date: Sun Jan 7 04:59:28 2018 New Revision: 327670 URL: https://svnweb.freebsd.org/changeset/base/327670 Log: aw_sid(4): Add support for Allwinner H3 The sid controller on the H3 is generally identical in location, size, and efuse offset to the a64 and the a83t. The main difference is that the H3 has a silicon bug that sometimes causes the rootkey (at least) to be garbled unless first read by the prctl registers. This device is currently not in our DTS and, as of now, is not yet present in mainline Linux DTS. Tested on: OrangePi One Modified: head/share/man/man4/aw_sid.4 head/sys/arm/allwinner/aw_sid.c Modified: head/share/man/man4/aw_sid.4 ============================================================================== --- head/share/man/man4/aw_sid.4 Sun Jan 7 03:31:55 2018 (r327669) +++ head/share/man/man4/aw_sid.4 Sun Jan 7 04:59:28 2018 (r327670) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2018 +.Dd January 6, 2018 .Dt AW_SID 4 .Os .Sh NAME @@ -52,6 +52,8 @@ allwinner,sun7i-a20-sid allwinner,sun50i-a64-sid .It allwinner,sun8i-a83t-sid +.It +allwinner,sun8i-h3-sid .El .Sh SYSCTL VARIABLES The following read-only variables are available via Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Sun Jan 7 03:31:55 2018 (r327669) +++ head/sys/arm/allwinner/aw_sid.c Sun Jan 7 04:59:28 2018 (r327670) @@ -67,36 +67,51 @@ __FBSDID("$FreeBSD$"); #define ROOT_KEY_SIZE 4 struct aw_sid_conf { + bus_size_t efuse_size; bus_size_t rootkey_offset; bool has_prctl; bool has_thermal; + bool requires_prctl_read; }; static const struct aw_sid_conf a10_conf = { + .efuse_size = 0x10, .rootkey_offset = 0, }; static const struct aw_sid_conf a20_conf = { + .efuse_size = 0x10, .rootkey_offset = 0, }; static const struct aw_sid_conf a64_conf = { + .efuse_size = 0x100, .rootkey_offset = SID_SRAM, .has_prctl = true, .has_thermal = true, }; static const struct aw_sid_conf a83t_conf = { + .efuse_size = 0x100, .rootkey_offset = SID_SRAM, .has_prctl = true, .has_thermal = true, }; +static const struct aw_sid_conf h3_conf = { + .efuse_size = 0x100, + .rootkey_offset = SID_SRAM, + .has_prctl = true, + .has_thermal = true, + .requires_prctl_read = true, +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-sid", (uintptr_t)&a10_conf}, { "allwinner,sun7i-a20-sid", (uintptr_t)&a20_conf}, { "allwinner,sun50i-a64-sid", (uintptr_t)&a64_conf}, { "allwinner,sun8i-a83t-sid", (uintptr_t)&a83t_conf}, + { "allwinner,sun8i-h3-sid", (uintptr_t)&h3_conf}, { NULL, 0 } }; @@ -168,6 +183,8 @@ static int aw_sid_attach(device_t dev) { struct aw_sid_softc *sc; + bus_size_t i; + uint32_t val; sc = device_get_softc(dev); @@ -179,6 +196,19 @@ aw_sid_attach(device_t dev) mtx_init(&sc->prctl_mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->sid_conf = (struct aw_sid_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; aw_sid_sc = sc; + + /* + * This set of reads is solely for working around a silicon bug on some + * SoC that require a prctl read in order for direct register access to + * return a non-garbled value. Hence, the values we read are simply + * ignored. + */ + if (sc->sid_conf->requires_prctl_read) + for (i = 0; i < sc->sid_conf->efuse_size; i += 4) + if (aw_sid_prctl_read(dev, i, &val) != 0) { + device_printf(dev, "failed prctl read\n"); + return (ENXIO); + } SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), From owner-svn-src-all@freebsd.org Sun Jan 7 05:38:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 719CAE6A6FC; Sun, 7 Jan 2018 05:38:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E23977A1E; Sun, 7 Jan 2018 05:38:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EE771D0F5; Sun, 7 Jan 2018 05:38:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w075croB068640; Sun, 7 Jan 2018 05:38:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w075crox068639; Sun, 7 Jan 2018 05:38:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801070538.w075crox068639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 7 Jan 2018 05:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327671 - head/sbin/ldconfig X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/ldconfig X-SVN-Commit-Revision: 327671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 05:38:54 -0000 Author: eadler Date: Sun Jan 7 05:38:53 2018 New Revision: 327671 URL: https://svnweb.freebsd.org/changeset/base/327671 Log: ldconfig(8): clarify language for files The previous language did not make it clear that 'Files' are the files specified above. Clarify it. Reported by: dana Reviewed by: dana MFC After: 1 week Modified: head/sbin/ldconfig/ldconfig.8 Modified: head/sbin/ldconfig/ldconfig.8 ============================================================================== --- head/sbin/ldconfig/ldconfig.8 Sun Jan 7 04:59:28 2018 (r327670) +++ head/sbin/ldconfig/ldconfig.8 Sun Jan 7 05:38:53 2018 (r327671) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd January 6, 2018 .Dt LDCONFIG 8 .Os .Sh NAME @@ -58,7 +58,9 @@ the overhead that would otherwise result from the dire operations the dynamic linker would have to perform to load the required shared libraries. .Pp -Files named on the command line are expected to contain directories +Alternatively, +.Ar files +may be specified; these are expected to contain directories to scan for shared libraries. Each directory's pathname must start on a new line. From owner-svn-src-all@freebsd.org Sun Jan 7 07:09:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BEFEE5AC5D; Sun, 7 Jan 2018 07:09:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07C4A7A369; Sun, 7 Jan 2018 07:09:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52AFB1DF5C; Sun, 7 Jan 2018 07:09:00 +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 w07790gr005800; Sun, 7 Jan 2018 07:09:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07790UI005799; Sun, 7 Jan 2018 07:09:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201801070709.w07790UI005799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 7 Jan 2018 07:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327672 - head/bin/cat X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/bin/cat X-SVN-Commit-Revision: 327672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 07:09:01 -0000 Author: delphij Date: Sun Jan 7 07:08:59 2018 New Revision: 327672 URL: https://svnweb.freebsd.org/changeset/base/327672 Log: stddef.h is not used by cat.c, remove the include. Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Sun Jan 7 05:38:53 2018 (r327671) +++ head/bin/cat/cat.c Sun Jan 7 07:08:59 2018 (r327672) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Jan 7 09:55:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76CC1E63218; Sun, 7 Jan 2018 09:55:48 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB9D7F58B; Sun, 7 Jan 2018 09:55:46 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id a1694042; Sun, 7 Jan 2018 10:55:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=dHeQsY 7JicdZxRCIelLgf25sbjk=; b=rMkd/Sygcmhsz2xMbEp43iQXHALIKLGRsI8z3w oZDOJeQzeJFYdtFr29Lfh+n0tvou8ds7cdA0PotQsLTW9Iqnv1vXzNDxSQWmtsA3 8+dzpiH0H4j97+aos22Lnov3MRUhMTtyqIeRTkzf4UmPPkRfs6x9icE4Hlbl1FrZ UPPBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= b9sxhBxdh5Ac73OKf2bLQvRodiDhiL3qkhYVBfhLLBhseSA9G2glbiaMQuJP3VgF 0GFi8jBMrATQC5Gz+n4DUj0nOs0iUUl3uYLY91mAW8oxgSwGq4Y5jEX/5M0fGy07 iNVNSjGsVAKQI5rIxiHhMpGrTfqVdvmUlcjLbmBsOEY= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 9c75bae9; Sun, 7 Jan 2018 10:55:44 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 07 Jan 2018 10:55:43 +0100 From: Emmanuel Vadot To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r327665 - head/sys/dev/extres/syscon Organization: Bidouilliste In-Reply-To: <201801070219.w072Jsx2085251@repo.freebsd.org> References: <201801070219.w072Jsx2085251@repo.freebsd.org> Message-ID: X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 09:55:48 -0000 On 2018-01-07 03:19, Kyle Evans wrote: > Author: kevans > Date: Sun Jan 7 02:19:54 2018 > New Revision: 327665 > URL: https://svnweb.freebsd.org/changeset/base/327665 > > Log: > Fix bogus pass for syscon_generic introduced in r327621 > > ian@ pointed out that BUS_PASS_DEFAULT + $anything is bogus, given > that > BUS_PASS_DEFAULT is defined as __INT_MAX. Instead, we take a page out > of > imx6_usbphy's book and use BUS_PASS_DEFAULT - 1000 to achieve the > desired > effect of syscon_generic attaching before if_awg and other potential > consumers, but late enough that more specialized implementations > should have > no problem attaching instead. > > Reported by: ian > > Modified: > head/sys/dev/extres/syscon/syscon_generic.c > > Modified: head/sys/dev/extres/syscon/syscon_generic.c > ============================================================================== > --- head/sys/dev/extres/syscon/syscon_generic.c Sun Jan 7 01:08:10 > 2018 (r327664) > +++ head/sys/dev/extres/syscon/syscon_generic.c Sun Jan 7 02:19:54 > 2018 (r327665) > @@ -206,6 +206,11 @@ static device_method_t syscon_generic_dmethods[] = > { > DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, > syscon_generic_dmethods, > sizeof(struct syscon_generic_softc)); > static devclass_t syscon_generic_devclass; > +/* > + * syscon_generic needs to attach before other devices that may > require it, such > + * as if_awg, but later than others to give way for more specialized > syscon > + * implementations. > + */ I think that the comment should be more generic, syscon_generic will only be match for the "syscon" compatible, if a driver needs to attach at a specific pass, it should be subclassed and use the other compatible in the node. All the syscon node I've seen always have a specific compatible and a fallback to "syscon". > EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver, > - syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT + > BUS_PASS_ORDER_FIRST); > + syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT - 1000); > MODULE_VERSION(syscon_generic, 1); -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sun Jan 7 10:29:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A875E647DA; Sun, 7 Jan 2018 10:29:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8A8080608; Sun, 7 Jan 2018 10:29:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 219FF1FF83; Sun, 7 Jan 2018 10:29:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w07ATGeq088777; Sun, 7 Jan 2018 10:29:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07ATFRV088776; Sun, 7 Jan 2018 10:29:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201801071029.w07ATFRV088776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 7 Jan 2018 10:29:15 +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: r327673 - stable/11/usr.bin/ctlstat X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/usr.bin/ctlstat X-SVN-Commit-Revision: 327673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 10:29:17 -0000 Author: bapt Date: Sun Jan 7 10:29:15 2018 New Revision: 327673 URL: https://svnweb.freebsd.org/changeset/base/327673 Log: MFC r326769: Remove hard coded number of lun definition The number of lun exposed is now exposed via sysctl by the kernel. Use that number in ctlstat instead of the hardcoded version Add a backward compatibility in case the sysctl(2) request fails. This also allows ctlstat -l 1118 to actually work when having more than 1024 luns. Reviewed by: avg, manu (both before the backward compatibility addition) Approved by: avg, manu (both before the backward compatibility addition) Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D13446 Modified: stable/11/usr.bin/ctlstat/ctlstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ctlstat/ctlstat.c ============================================================================== --- stable/11/usr.bin/ctlstat/ctlstat.c Sun Jan 7 07:08:59 2018 (r327672) +++ stable/11/usr.bin/ctlstat/ctlstat.c Sun Jan 7 10:29:15 2018 (r327673) @@ -72,12 +72,7 @@ __FBSDID("$FreeBSD$"); */ #define CTL_STAT_NUM_ITEMS 256 -/* - * The default number of LUN selection bits we allocate. This is large - * because we don't currently increase it if the user specifies a LUN - * number of 1024 or larger. - */ -#define CTL_STAT_BITS 1024L +static int ctl_stat_bits; static const char *ctlstat_opts = "Cc:Ddhjl:n:p:tw:"; static const char *ctlstat_usage = "Usage: ctlstat [-CDdjht] [-l lunnum]" @@ -125,7 +120,7 @@ struct ctlstat_context { struct ctl_cpu_stats cur_cpu, prev_cpu; uint64_t cur_total_jiffies, prev_total_jiffies; uint64_t cur_idle, prev_idle; - bitstr_t bit_decl(item_mask, CTL_STAT_BITS); + bitstr_t *item_mask; int cur_items, prev_items; int cur_alloc, prev_alloc; int numdevs; @@ -429,7 +424,7 @@ ctlstat_standard(struct ctlstat_context *ctx) { (F_TIMEVAL(ctx) != 0) ? " " : ""); n = 3; } else { - for (i = n = 0; i < min(CTL_STAT_BITS, + for (i = n = 0; i < min(ctl_stat_bits, ctx->cur_items); i++) { int item; @@ -537,7 +532,7 @@ ctlstat_standard(struct ctlstat_context *ctx) { dmas_per_sec[i], mbsec[i]); } } else { - for (i = n = 0; i < min(CTL_STAT_BITS, ctx->cur_items); i++) { + for (i = n = 0; i < min(ctl_stat_bits, ctx->cur_items); i++) { long double mbsec, kb_per_transfer; long double transfers_per_sec; long double ms_per_transfer; @@ -580,6 +575,7 @@ main(int argc, char **argv) int c; int count, waittime; int fd, retval; + size_t size; struct ctlstat_context ctx; struct ctl_io_stats *tmp_stats; @@ -594,6 +590,16 @@ main(int argc, char **argv) ctx.flags |= CTLSTAT_FLAG_FIRST_RUN; ctx.flags |= CTLSTAT_FLAG_HEADER; + size = sizeof(ctl_stat_bits); + if (sysctlbyname("kern.cam.ctl.max_luns", &ctl_stat_bits, &size, NULL, + 0) == -1) { + /* Backward compatibility for where the sysctl wasn't exposed */ + ctl_stat_bits = 1024; + } + ctx.item_mask = bit_alloc(ctl_stat_bits); + if (ctx.item_mask == NULL) + err(1, "bit_alloc() failed"); + while ((c = getopt(argc, argv, ctlstat_opts)) != -1) { switch (c) { case 'C': @@ -620,7 +626,7 @@ main(int argc, char **argv) int cur_lun; cur_lun = atoi(optarg); - if (cur_lun > CTL_STAT_BITS) + if (cur_lun > ctl_stat_bits) errx(1, "Invalid LUN number %d", cur_lun); if (!F_MASK(&ctx)) @@ -639,7 +645,7 @@ main(int argc, char **argv) int cur_port; cur_port = atoi(optarg); - if (cur_port > CTL_STAT_BITS) + if (cur_port > ctl_stat_bits) errx(1, "Invalid port number %d", cur_port); if (!F_MASK(&ctx)) From owner-svn-src-all@freebsd.org Sun Jan 7 13:21:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D559E6CFF4; Sun, 7 Jan 2018 13:21:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 288653099; Sun, 7 Jan 2018 13:21:03 +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 7C49421BA5; Sun, 7 Jan 2018 13:21:02 +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 w07DL2JZ064477; Sun, 7 Jan 2018 13:21:02 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07DL2hN064072; Sun, 7 Jan 2018 13:21:02 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201801071321.w07DL2hN064072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 7 Jan 2018 13:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327674 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 327674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 13:21:03 -0000 Author: kp Date: Sun Jan 7 13:21:01 2018 New Revision: 327674 URL: https://svnweb.freebsd.org/changeset/base/327674 Log: Introduce mallocarray() in the kernel Similar to calloc() the mallocarray() function checks for integer overflows before allocating memory. It does not zero memory, unless the M_ZERO flag is set. Reviewed by: pfg, vangyzen (previous version), imp (previous version) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D13766 Modified: head/share/man/man9/malloc.9 head/sys/kern/kern_malloc.c head/sys/sys/malloc.h Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Sun Jan 7 10:29:15 2018 (r327673) +++ head/share/man/man9/malloc.9 Sun Jan 7 13:21:01 2018 (r327674) @@ -45,6 +45,8 @@ .In sys/malloc.h .Ft void * .Fn malloc "unsigned long size" "struct malloc_type *type" "int flags" +.Ft void * +.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags" .Ft void .Fn free "void *addr" "struct malloc_type *type" .Ft void * @@ -64,6 +66,14 @@ object whose size is specified by .Fa size . .Pp The +.Fn mallocarray +function allocates uninitialized memory in kernel address space for an +array of +.Fa nmemb +entries whose size is specified by +.Fa size . +.Pp +The .Fn free function releases memory at address .Fa addr @@ -152,6 +162,15 @@ functions cannot return if .Dv M_WAITOK is specified. +The +.Fn mallocarray +function can return +.Dv NULL +if the multiplication of +.Fa nmemb +and +.Fa size +would cause an integer overflow. .It Dv M_USE_RESERVE Indicates that the system can use its reserve of memory to satisfy the request. Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sun Jan 7 10:29:15 2018 (r327673) +++ head/sys/kern/kern_malloc.c Sun Jan 7 13:21:01 2018 (r327674) @@ -4,6 +4,7 @@ * Copyright (c) 1987, 1991, 1993 * The Regents of the University of California. * Copyright (c) 2005-2009 Robert N. M. Watson + * Copyright (c) 2008 Otto Moerbeek (mallocarray) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -532,6 +533,22 @@ malloc(unsigned long size, struct malloc_type *mtp, in va = redzone_setup(va, osize); #endif return ((void *) va); +} + +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 8 / 2)) +void * +mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) +{ + + if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + nmemb > 0 && SIZE_MAX / nmemb < size) + return (NULL); + + return (malloc(size * nmemb, type, flags)); } /* Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Sun Jan 7 10:29:15 2018 (r327673) +++ head/sys/sys/malloc.h Sun Jan 7 13:21:01 2018 (r327674) @@ -177,6 +177,9 @@ void *contigmalloc(unsigned long size, struct malloc_t void free(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1); +void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, + int flags) __malloc_like __result_use_check + __alloc_size(1) __alloc_size(2); void malloc_init(void *); int malloc_last_fail(void); void malloc_type_allocated(struct malloc_type *type, unsigned long size); From owner-svn-src-all@freebsd.org Sun Jan 7 13:35:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 895C7E6DAED; Sun, 7 Jan 2018 13:35:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 507AC3AB2; Sun, 7 Jan 2018 13:35:16 +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 7A68421DC9; Sun, 7 Jan 2018 13:35:15 +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 w07DZFDw069855; Sun, 7 Jan 2018 13:35:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07DZFWh069854; Sun, 7 Jan 2018 13:35:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201801071335.w07DZFWh069854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 7 Jan 2018 13:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327675 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 327675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 13:35:16 -0000 Author: kp Date: Sun Jan 7 13:35:15 2018 New Revision: 327675 URL: https://svnweb.freebsd.org/changeset/base/327675 Log: pf: Avoid integer overflow issues by using mallocarray() iso. malloc() pfioctl() handles several ioctl that takes variable length input, these include: - DIOCRADDTABLES - DIOCRDELTABLES - DIOCRGETTABLES - DIOCRGETTSTATS - DIOCRCLRTSTATS - DIOCRSETTFLAGS All of them take a pfioc_table struct as input from userland. One of its elements (pfrio_size) is used in a buffer length calculation. The calculation contains an integer overflow which if triggered can lead to out of bound reads and writes later on. Reported by: Ilja Van Sprundel Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sun Jan 7 13:21:01 2018 (r327674) +++ head/sys/netpfil/pf/pf_ioctl.c Sun Jan 7 13:35:15 2018 (r327675) @@ -2531,7 +2531,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = malloc(totlen, M_TEMP, M_WAITOK); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); + if (! pfrts) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2555,7 +2560,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = malloc(totlen, M_TEMP, M_WAITOK); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); + if (! pfrts) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2579,7 +2589,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = malloc(totlen, M_TEMP, M_WAITOK); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); + if (! pfrts) { + error = ENOMEM; + break; + } PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -2600,7 +2615,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_tstats); - pfrtstats = malloc(totlen, M_TEMP, M_WAITOK); + pfrtstats = mallocarray(io->pfrio_size, + sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); + if (! pfrtstats) { + error = ENOMEM; + break; + } PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -2621,7 +2641,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = malloc(totlen, M_TEMP, M_WAITOK); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); + if (! pfrts) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2645,7 +2670,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = malloc(totlen, M_TEMP, M_WAITOK); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); + if (! pfrts) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2684,7 +2714,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2711,7 +2746,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2739,7 +2779,12 @@ DIOCCHANGEADDR_error: } count = max(io->pfrio_size, io->pfrio_size2); totlen = count * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, + M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2767,7 +2812,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } PF_RULES_RLOCK(); error = pfr_get_addrs(&io->pfrio_table, pfras, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -2788,7 +2838,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_astats); - pfrastats = malloc(totlen, M_TEMP, M_WAITOK); + pfrastats = mallocarray(io->pfrio_size, + sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + if (! pfrastats) { + error = ENOMEM; + break; + } PF_RULES_RLOCK(); error = pfr_get_astats(&io->pfrio_table, pfrastats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -2809,7 +2864,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2836,7 +2896,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2863,7 +2928,12 @@ DIOCCHANGEADDR_error: break; } totlen = io->pfrio_size * sizeof(struct pfr_addr); - pfras = malloc(totlen, M_TEMP, M_WAITOK); + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), + M_TEMP, M_WAITOK); + if (! pfras) { + error = ENOMEM; + break; + } error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -2905,7 +2975,12 @@ DIOCCHANGEADDR_error: break; } totlen = sizeof(struct pfioc_trans_e) * io->size; - ioes = malloc(totlen, M_TEMP, M_WAITOK); + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), + M_TEMP, M_WAITOK); + if (! ioes) { + error = ENOMEM; + break; + } error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -2971,7 +3046,12 @@ DIOCCHANGEADDR_error: break; } totlen = sizeof(struct pfioc_trans_e) * io->size; - ioes = malloc(totlen, M_TEMP, M_WAITOK); + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), + M_TEMP, M_WAITOK); + if (! ioes) { + error = ENOMEM; + break; + } error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -3037,7 +3117,12 @@ DIOCCHANGEADDR_error: break; } totlen = sizeof(struct pfioc_trans_e) * io->size; - ioes = malloc(totlen, M_TEMP, M_WAITOK); + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), + M_TEMP, M_WAITOK); + if (! ioes) { + error = ENOMEM; + break; + } error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -3238,7 +3323,12 @@ DIOCCHANGEADDR_error: } bufsiz = io->pfiio_size * sizeof(struct pfi_kif); - ifstore = malloc(bufsiz, M_TEMP, M_WAITOK); + ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), + M_TEMP, M_WAITOK); + if (! ifstore) { + error = ENOMEM; + break; + } PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-all@freebsd.org Sun Jan 7 13:39:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE9DE6DD2B; Sun, 7 Jan 2018 13:39:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9977D3C6B; Sun, 7 Jan 2018 13:39:13 +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 CB4B421DCA; Sun, 7 Jan 2018 13:39:12 +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 w07DdCrN070033; Sun, 7 Jan 2018 13:39:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07DdCaX070032; Sun, 7 Jan 2018 13:39:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201801071339.w07DdCaX070032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 7 Jan 2018 13:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 327676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 13:39:13 -0000 Author: kp Date: Sun Jan 7 13:39:12 2018 New Revision: 327676 URL: https://svnweb.freebsd.org/changeset/base/327676 Log: linuxkpi: Implement kcalloc() based on mallocarray() This means we now get integer overflow protection, which Linux code might expect as it is also provided by kcalloc() in Linux. Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 13:35:15 2018 (r327675) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 13:39:12 2018 (r327676) @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | __GFP_ZERO) #define kfree_const(ptr) kfree(ptr) -#define kcalloc(n, size, flags) kmalloc((n) * (size), (flags) | __GFP_ZERO) #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0) #define vfree(arg) kfree(arg) #define kvfree(arg) kfree(arg) @@ -98,6 +97,13 @@ static inline void * kmalloc(size_t size, gfp_t flags) { return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); +} + +static inline void * +kcalloc(size_t n, size_t size, gfp_t flags) +{ + flags |= __GFP_ZERO; + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } static inline void * From owner-svn-src-all@freebsd.org Sun Jan 7 13:41:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1CA2E6DFF3; Sun, 7 Jan 2018 13:41:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B93C3FCE; Sun, 7 Jan 2018 13:41:07 +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 AD6CA21DF9; Sun, 7 Jan 2018 13:41:06 +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 w07Df6ID070846; Sun, 7 Jan 2018 13:41:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07Df62R070845; Sun, 7 Jan 2018 13:41:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201801071341.w07Df62R070845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 7 Jan 2018 13:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327677 - head/sys/contrib/vchiq/interface/compat X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/contrib/vchiq/interface/compat X-SVN-Commit-Revision: 327677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 13:41:07 -0000 Author: kp Date: Sun Jan 7 13:41:06 2018 New Revision: 327677 URL: https://svnweb.freebsd.org/changeset/base/327677 Log: vchiq: Use mallocarray() to provide kcalloc() This means we now also provide integer overflow protection, like the Linux kcalloc(). Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h ============================================================================== --- head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Sun Jan 7 13:39:12 2018 (r327676) +++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.h Sun Jan 7 13:41:06 2018 (r327677) @@ -329,7 +329,8 @@ device_rlprintf(int pps, device_t dev, const char *fmt MALLOC_DECLARE(M_VCHI); #define kmalloc(size, flags) malloc((size), M_VCHI, M_NOWAIT | M_ZERO) -#define kcalloc(n, size, flags) malloc((n) * (size), M_VCHI, M_NOWAIT | M_ZERO) +#define kcalloc(n, size, flags) mallocarray((n), (size), M_VCHI, \ + M_NOWAIT | M_ZERO) #define kzalloc(a, b) kcalloc(1, (a), (b)) #define kfree(p) free(p, M_VCHI) From owner-svn-src-all@freebsd.org Sun Jan 7 14:44:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70F0E706FF; Sun, 7 Jan 2018 14:44:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7B4691D0; Sun, 7 Jan 2018 14:44:33 +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 w07EiNVx027025 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 7 Jan 2018 16:44:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w07EiNVx027025 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w07EiNY4027024; Sun, 7 Jan 2018 16:44:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 7 Jan 2018 16:44:23 +0200 From: Konstantin Belousov To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327675 - head/sys/netpfil/pf Message-ID: <20180107144423.GD1684@kib.kiev.ua> References: <201801071335.w07DZFWh069854@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801071335.w07DZFWh069854@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 14:44:33 -0000 On Sun, Jan 07, 2018 at 01:35:15PM +0000, Kristof Provost wrote: > Author: kp > Date: Sun Jan 7 13:35:15 2018 > New Revision: 327675 > URL: https://svnweb.freebsd.org/changeset/base/327675 > > Log: > pf: Avoid integer overflow issues by using mallocarray() iso. malloc() > > pfioctl() handles several ioctl that takes variable length input, these > include: > - DIOCRADDTABLES > - DIOCRDELTABLES > - DIOCRGETTABLES > - DIOCRGETTSTATS > - DIOCRCLRTSTATS > - DIOCRSETTFLAGS > > All of them take a pfioc_table struct as input from userland. One of > its elements (pfrio_size) is used in a buffer length calculation. > The calculation contains an integer overflow which if triggered can lead > to out of bound reads and writes later on. So the size of the allocation is controlled directly from the userspace ? This is an easy DoS, and by itself is perhaps bigger issue than the overflow. > > Reported by: Ilja Van Sprundel > > Modified: > head/sys/netpfil/pf/pf_ioctl.c > > Modified: head/sys/netpfil/pf/pf_ioctl.c > ============================================================================== > --- head/sys/netpfil/pf/pf_ioctl.c Sun Jan 7 13:21:01 2018 (r327674) > +++ head/sys/netpfil/pf/pf_ioctl.c Sun Jan 7 13:35:15 2018 (r327675) > @@ -2531,7 +2531,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_table); > - pfrts = malloc(totlen, M_TEMP, M_WAITOK); > + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > + M_TEMP, M_WAITOK); > + if (! pfrts) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfrts, totlen); > if (error) { > free(pfrts, M_TEMP); > @@ -2555,7 +2560,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_table); > - pfrts = malloc(totlen, M_TEMP, M_WAITOK); > + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > + M_TEMP, M_WAITOK); > + if (! pfrts) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfrts, totlen); > if (error) { > free(pfrts, M_TEMP); > @@ -2579,7 +2589,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_table); > - pfrts = malloc(totlen, M_TEMP, M_WAITOK); > + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > + M_TEMP, M_WAITOK); > + if (! pfrts) { > + error = ENOMEM; > + break; > + } > PF_RULES_RLOCK(); > error = pfr_get_tables(&io->pfrio_table, pfrts, > &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); > @@ -2600,7 +2615,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_tstats); > - pfrtstats = malloc(totlen, M_TEMP, M_WAITOK); > + pfrtstats = mallocarray(io->pfrio_size, > + sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); > + if (! pfrtstats) { > + error = ENOMEM; > + break; > + } > PF_RULES_WLOCK(); > error = pfr_get_tstats(&io->pfrio_table, pfrtstats, > &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); > @@ -2621,7 +2641,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_table); > - pfrts = malloc(totlen, M_TEMP, M_WAITOK); > + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > + M_TEMP, M_WAITOK); > + if (! pfrts) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfrts, totlen); > if (error) { > free(pfrts, M_TEMP); > @@ -2645,7 +2670,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_table); > - pfrts = malloc(totlen, M_TEMP, M_WAITOK); > + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > + M_TEMP, M_WAITOK); > + if (! pfrts) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfrts, totlen); > if (error) { > free(pfrts, M_TEMP); > @@ -2684,7 +2714,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2711,7 +2746,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2739,7 +2779,12 @@ DIOCCHANGEADDR_error: > } > count = max(io->pfrio_size, io->pfrio_size2); > totlen = count * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, > + M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2767,7 +2812,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > PF_RULES_RLOCK(); > error = pfr_get_addrs(&io->pfrio_table, pfras, > &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); > @@ -2788,7 +2838,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_astats); > - pfrastats = malloc(totlen, M_TEMP, M_WAITOK); > + pfrastats = mallocarray(io->pfrio_size, > + sizeof(struct pfr_astats), M_TEMP, M_WAITOK); > + if (! pfrastats) { > + error = ENOMEM; > + break; > + } > PF_RULES_RLOCK(); > error = pfr_get_astats(&io->pfrio_table, pfrastats, > &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); > @@ -2809,7 +2864,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2836,7 +2896,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2863,7 +2928,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = io->pfrio_size * sizeof(struct pfr_addr); > - pfras = malloc(totlen, M_TEMP, M_WAITOK); > + pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), > + M_TEMP, M_WAITOK); > + if (! pfras) { > + error = ENOMEM; > + break; > + } > error = copyin(io->pfrio_buffer, pfras, totlen); > if (error) { > free(pfras, M_TEMP); > @@ -2905,7 +2975,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = sizeof(struct pfioc_trans_e) * io->size; > - ioes = malloc(totlen, M_TEMP, M_WAITOK); > + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), > + M_TEMP, M_WAITOK); > + if (! ioes) { > + error = ENOMEM; > + break; > + } > error = copyin(io->array, ioes, totlen); > if (error) { > free(ioes, M_TEMP); > @@ -2971,7 +3046,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = sizeof(struct pfioc_trans_e) * io->size; > - ioes = malloc(totlen, M_TEMP, M_WAITOK); > + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), > + M_TEMP, M_WAITOK); > + if (! ioes) { > + error = ENOMEM; > + break; > + } > error = copyin(io->array, ioes, totlen); > if (error) { > free(ioes, M_TEMP); > @@ -3037,7 +3117,12 @@ DIOCCHANGEADDR_error: > break; > } > totlen = sizeof(struct pfioc_trans_e) * io->size; > - ioes = malloc(totlen, M_TEMP, M_WAITOK); > + ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), > + M_TEMP, M_WAITOK); > + if (! ioes) { > + error = ENOMEM; > + break; > + } > error = copyin(io->array, ioes, totlen); > if (error) { > free(ioes, M_TEMP); > @@ -3238,7 +3323,12 @@ DIOCCHANGEADDR_error: > } > > bufsiz = io->pfiio_size * sizeof(struct pfi_kif); > - ifstore = malloc(bufsiz, M_TEMP, M_WAITOK); > + ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), > + M_TEMP, M_WAITOK); > + if (! ifstore) { > + error = ENOMEM; > + break; > + } > PF_RULES_RLOCK(); > pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); > PF_RULES_RUNLOCK(); From owner-svn-src-all@freebsd.org Sun Jan 7 16:24:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26297E748E1; Sun, 7 Jan 2018 16:24:35 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2ACE6CF27; Sun, 7 Jan 2018 16:24:34 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyhthbnp0l0tszn.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:e0f1:72a1:d72b:ec03]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id EB44EAC73; Sun, 7 Jan 2018 17:24:31 +0100 (CET) From: "Kristof Provost" To: "Konstantin Belousov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327675 - head/sys/netpfil/pf Date: Sun, 07 Jan 2018 17:25:02 +0100 X-Mailer: MailMate (2.0BETAr6102) Message-ID: In-Reply-To: <20180107144423.GD1684@kib.kiev.ua> References: <201801071335.w07DZFWh069854@repo.freebsd.org> <20180107144423.GD1684@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 16:24:35 -0000 On 7 Jan 2018, at 15:44, Konstantin Belousov wrote: > On Sun, Jan 07, 2018 at 01:35:15PM +0000, Kristof Provost wrote: >> Author: kp >> Date: Sun Jan 7 13:35:15 2018 >> New Revision: 327675 >> URL: https://svnweb.freebsd.org/changeset/base/327675 >> >> Log: >> pf: Avoid integer overflow issues by using mallocarray() iso. >> malloc() >> >> pfioctl() handles several ioctl that takes variable length input, >> these >> include: >> - DIOCRADDTABLES >> - DIOCRDELTABLES >> - DIOCRGETTABLES >> - DIOCRGETTSTATS >> - DIOCRCLRTSTATS >> - DIOCRSETTFLAGS >> >> All of them take a pfioc_table struct as input from userland. One >> of >> its elements (pfrio_size) is used in a buffer length calculation. >> The calculation contains an integer overflow which if triggered can >> lead >> to out of bound reads and writes later on. > So the size of the allocation is controlled directly from the > userspace ? > This is an easy DoS, and by itself is perhaps bigger issue than the > overflow. Yes, although only as root. I’m not sure what the best way of handling that would be. It’s not easy to determine limits for these sizes. Any arbitrary value might break someone’s use case. OpenBSD tend to copy in individual entries one at a time. This avoids having to allocate memory for all of them in one go, but I don’t like mixing user pointers and kernel pointers. It’s far too easy to lose track of what’s been copied in and what’s still in user space. Regards, Kristof From owner-svn-src-all@freebsd.org Sun Jan 7 17:55:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7F26E783BD; Sun, 7 Jan 2018 17:55:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A781F702FC; Sun, 7 Jan 2018 17:55:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w07HtCFJ017656; Sun, 7 Jan 2018 09:55:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w07HtCAU017655; Sun, 7 Jan 2018 09:55:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801071755.w07HtCAU017655@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327674 - in head: share/man/man9 sys/kern sys/sys In-Reply-To: <201801071321.w07DL2hN064072@repo.freebsd.org> To: Kristof Provost Date: Sun, 7 Jan 2018 09:55:12 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 17:55:14 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kp > Date: Sun Jan 7 13:21:01 2018 > New Revision: 327674 > URL: https://svnweb.freebsd.org/changeset/base/327674 > > Log: > Introduce mallocarray() in the kernel > > Similar to calloc() the mallocarray() function checks for integer > overflows before allocating memory. > It does not zero memory, unless the M_ZERO flag is set. > > Reviewed by: pfg, vangyzen (previous version), imp (previous version) > Obtained from: OpenBSD > Differential Revision: https://reviews.freebsd.org/D13766 > > Modified: > head/share/man/man9/malloc.9 > head/sys/kern/kern_malloc.c > head/sys/sys/malloc.h > > Modified: head/share/man/man9/malloc.9 > ============================================================================== > --- head/share/man/man9/malloc.9 Sun Jan 7 10:29:15 2018 (r327673) > +++ head/share/man/man9/malloc.9 Sun Jan 7 13:21:01 2018 (r327674) > @@ -45,6 +45,8 @@ > .In sys/malloc.h > .Ft void * > .Fn malloc "unsigned long size" "struct malloc_type *type" "int flags" > +.Ft void * > +.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags" > .Ft void > .Fn free "void *addr" "struct malloc_type *type" > .Ft void * > @@ -64,6 +66,14 @@ object whose size is specified by > .Fa size . > .Pp > The > +.Fn mallocarray > +function allocates uninitialized memory in kernel address space for an > +array of > +.Fa nmemb > +entries whose size is specified by > +.Fa size . > +.Pp > +The > .Fn free > function releases memory at address > .Fa addr > @@ -152,6 +162,15 @@ functions cannot return > if > .Dv M_WAITOK > is specified. > +The > +.Fn mallocarray > +function can return > +.Dv NULL > +if the multiplication of > +.Fa nmemb > +and > +.Fa size > +would cause an integer overflow. > .It Dv M_USE_RESERVE > Indicates that the system can use its reserve of memory to satisfy the > request. > > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Sun Jan 7 10:29:15 2018 (r327673) > +++ head/sys/kern/kern_malloc.c Sun Jan 7 13:21:01 2018 (r327674) > @@ -4,6 +4,7 @@ > * Copyright (c) 1987, 1991, 1993 > * The Regents of the University of California. > * Copyright (c) 2005-2009 Robert N. M. Watson > + * Copyright (c) 2008 Otto Moerbeek (mallocarray) Is this code really over a decade old???? or is this a typo? > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -532,6 +533,22 @@ malloc(unsigned long size, struct malloc_type *mtp, in > va = redzone_setup(va, osize); > #endif > return ((void *) va); > +} > + > +/* > + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX > + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW > + */ > +#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 8 / 2)) > +void * > +mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) > +{ > + > + if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && > + nmemb > 0 && SIZE_MAX / nmemb < size) > + return (NULL); > + > + return (malloc(size * nmemb, type, flags)); > } > > /* > > Modified: head/sys/sys/malloc.h > ============================================================================== > --- head/sys/sys/malloc.h Sun Jan 7 10:29:15 2018 (r327673) > +++ head/sys/sys/malloc.h Sun Jan 7 13:21:01 2018 (r327674) > @@ -177,6 +177,9 @@ void *contigmalloc(unsigned long size, struct malloc_t > void free(void *addr, struct malloc_type *type); > void *malloc(unsigned long size, struct malloc_type *type, int flags) > __malloc_like __result_use_check __alloc_size(1); > +void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, > + int flags) __malloc_like __result_use_check > + __alloc_size(1) __alloc_size(2); > void malloc_init(void *); > int malloc_last_fail(void); > void malloc_type_allocated(struct malloc_type *type, unsigned long size); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jan 7 18:00:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43D88E788BC; Sun, 7 Jan 2018 18:00:47 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCA670704; Sun, 7 Jan 2018 18:00:46 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyhthbnp0l0tszn.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:e0f1:72a1:d72b:ec03]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 1D862ADE1; Sun, 7 Jan 2018 19:00:44 +0100 (CET) From: "Kristof Provost" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327674 - in head: share/man/man9 sys/kern sys/sys Date: Sun, 07 Jan 2018 19:00:43 +0100 X-Mailer: MailMate (2.0BETAr6102) Message-ID: <89EADF3F-DFCB-4EE7-8FE6-5129B77411EB@FreeBSD.org> In-Reply-To: <201801071755.w07HtCAU017655@pdx.rh.CN85.dnsmgr.net> References: <201801071755.w07HtCAU017655@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:00:47 -0000 On 7 Jan 2018, at 18:55, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: kp >> Date: Sun Jan 7 13:21:01 2018 >> New Revision: 327674 >> URL: https://svnweb.freebsd.org/changeset/base/327674 >> >> Log: >> Introduce mallocarray() in the kernel >> >> Similar to calloc() the mallocarray() function checks for integer >> overflows before allocating memory. >> It does not zero memory, unless the M_ZERO flag is set. >> >> Reviewed by: pfg, vangyzen (previous version), imp (previous = >> version) >> Obtained from: OpenBSD >> Differential Revision: https://reviews.freebsd.org/D13766 >> >> Modified: head/sys/kern/kern_malloc.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/kern_malloc.c Sun Jan 7 10:29:15 2018 (r327673) >> +++ head/sys/kern/kern_malloc.c Sun Jan 7 13:21:01 2018 (r327674) >> @@ -4,6 +4,7 @@ >> * Copyright (c) 1987, 1991, 1993 >> * The Regents of the University of California. >> * Copyright (c) 2005-2009 Robert N. M. Watson >> + * Copyright (c) 2008 Otto Moerbeek (mallocarray) > > Is this code really over a decade old???? or is this a typo? > > That=E2=80=99s the copyright statement OpenBSD have for it, and that=E2=80= =99s where = it came from: https://github.com/openbsd/src/blob/3031d9a2ee043e48086ede83d43c1e37d034a= ff4/sys/kern/kern_malloc.c#L705 Regards, Kristof From owner-svn-src-all@freebsd.org Sun Jan 7 18:02:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 593CDE789B9; Sun, 7 Jan 2018 18:02:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21E5870A9E; Sun, 7 Jan 2018 18:02:35 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w07I2Ycj017700; Sun, 7 Jan 2018 10:02:34 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w07I2YEB017699; Sun, 7 Jan 2018 10:02:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801071802.w07I2YEB017699@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: <201801071339.w07DdCaX070032@repo.freebsd.org> To: Kristof Provost Date: Sun, 7 Jan 2018 10:02:34 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:02:36 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kp > Date: Sun Jan 7 13:39:12 2018 > New Revision: 327676 > URL: https://svnweb.freebsd.org/changeset/base/327676 > > Log: > linuxkpi: Implement kcalloc() based on mallocarray() > > This means we now get integer overflow protection, which Linux code > might expect as it is also provided by kcalloc() in Linux. > > Modified: > head/sys/compat/linuxkpi/common/include/linux/slab.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 13:35:15 2018 (r327675) > +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 13:39:12 2018 (r327676) > @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); > #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) > #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | __GFP_ZERO) > #define kfree_const(ptr) kfree(ptr) > -#define kcalloc(n, size, flags) kmalloc((n) * (size), (flags) | __GFP_ZERO) Would not: #define kcalloc(n, size, flags) mallocarray(mallocarray((n), (size), M_KMALLOC, linux_check_m_flags((flags | __GFP_ZERO)) work just fine, saving a call and stack use of about framesize + 32 bytes? > #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0) > #define vfree(arg) kfree(arg) > #define kvfree(arg) kfree(arg) > @@ -98,6 +97,13 @@ static inline void * > kmalloc(size_t size, gfp_t flags) > { > return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); > +} > + > +static inline void * > +kcalloc(size_t n, size_t size, gfp_t flags) > +{ > + flags |= __GFP_ZERO; > + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); > } > > static inline void * > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jan 7 18:06:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F56E78DB8; Sun, 7 Jan 2018 18:06: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B61B170F7B; Sun, 7 Jan 2018 18:06: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 DE17124921; Sun, 7 Jan 2018 18:06: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 w07I6UVe084571; Sun, 7 Jan 2018 18:06:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07I6U84084570; Sun, 7 Jan 2018 18:06:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801071806.w07I6U84084570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 18:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327678 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:06:32 -0000 Author: ian Date: Sun Jan 7 18:06:30 2018 New Revision: 327678 URL: https://svnweb.freebsd.org/changeset/base/327678 Log: Use EVENTHANDLER_DIRECT_INVOKE() for device events, for better performance. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Jan 7 13:41:06 2018 (r327677) +++ head/sys/kern/subr_bus.c Sun Jan 7 18:06:30 2018 (r327678) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -146,6 +147,10 @@ struct device { static MALLOC_DEFINE(M_BUS, "bus", "Bus data structures"); static MALLOC_DEFINE(M_BUS_SC, "bus-sc", "Bus data structures, softc"); +EVENTHANDLER_LIST_DEFINE(device_attach); +EVENTHANDLER_LIST_DEFINE(device_detach); +EVENTHANDLER_LIST_DEFINE(dev_lookup); + static void devctl2_init(void); #define DRIVERNAME(d) ((d)? d->name : "no driver") @@ -2938,7 +2943,7 @@ device_attach(device_t dev) else dev->state = DS_ATTACHED; dev->flags &= ~DF_DONENOMATCH; - EVENTHANDLER_INVOKE(device_attach, dev); + EVENTHANDLER_DIRECT_INVOKE(device_attach, dev); devadded(dev); return (0); } @@ -2972,12 +2977,14 @@ device_detach(device_t dev) if (dev->state != DS_ATTACHED) return (0); - EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_BEGIN); + EVENTHANDLER_DIRECT_INVOKE(device_detach, dev, EVHDEV_DETACH_BEGIN); if ((error = DEVICE_DETACH(dev)) != 0) { - EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_FAILED); + EVENTHANDLER_DIRECT_INVOKE(device_detach, dev, + EVHDEV_DETACH_FAILED); return (error); } else { - EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_COMPLETE); + EVENTHANDLER_DIRECT_INVOKE(device_detach, dev, + EVHDEV_DETACH_COMPLETE); } devremoved(dev); if (!device_is_quiet(dev)) @@ -5330,7 +5337,7 @@ find_device(struct devreq *req, device_t *devp) /* Finally, give device enumerators a chance. */ dev = NULL; - EVENTHANDLER_INVOKE(dev_lookup, req->dr_name, &dev); + EVENTHANDLER_DIRECT_INVOKE(dev_lookup, req->dr_name, &dev); if (dev == NULL) return (ENOENT); *devp = dev; From owner-svn-src-all@freebsd.org Sun Jan 7 18:07:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 970A5E78E75; Sun, 7 Jan 2018 18:07:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73679710D0; Sun, 7 Jan 2018 18:07:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE06D24922; Sun, 7 Jan 2018 18:07:22 +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 w07I7Ms5084642; Sun, 7 Jan 2018 18:07:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07I7MQm084641; Sun, 7 Jan 2018 18:07:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801071807.w07I7MQm084641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 7 Jan 2018 18:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327679 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:07:23 -0000 Author: ian Date: Sun Jan 7 18:07:22 2018 New Revision: 327679 URL: https://svnweb.freebsd.org/changeset/base/327679 Log: Use EVENTHANDLER_DIRECT_INVOKE for [un]mount events, for better performance. Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Jan 7 18:06:30 2018 (r327678) +++ head/sys/kern/vfs_mount.c Sun Jan 7 18:07:22 2018 (r327679) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,6 +92,9 @@ struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(moun struct mtx mountlist_mtx; MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF); +EVENTHANDLER_LIST_DEFINE(vfs_mounted); +EVENTHANDLER_LIST_DEFINE(vfs_unmounted); + /* * Global opts, taken by all filesystems */ @@ -865,7 +869,7 @@ vfs_domount_first( if (VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) panic("mount: lost mount"); VOP_UNLOCK(vp, 0); - EVENTHANDLER_INVOKE(vfs_mounted, mp, newdp, td); + EVENTHANDLER_DIRECT_INVOKE(vfs_mounted, mp, newdp, td); VOP_UNLOCK(newdp, 0); mountcheckdirs(vp, newdp); vrele(newdp); @@ -1401,7 +1405,7 @@ dounmount(struct mount *mp, int flags, struct thread * mtx_lock(&mountlist_mtx); TAILQ_REMOVE(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); - EVENTHANDLER_INVOKE(vfs_unmounted, mp, td); + EVENTHANDLER_DIRECT_INVOKE(vfs_unmounted, mp, td); if (coveredvp != NULL) { coveredvp->v_mountedhere = NULL; VOP_UNLOCK(coveredvp, 0); From owner-svn-src-all@freebsd.org Sun Jan 7 18:30:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923CBE79E08; Sun, 7 Jan 2018 18:30:08 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59B3B722E3; Sun, 7 Jan 2018 18:30:08 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyhthbnp0l0tszn.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:e0f1:72a1:d72b:ec03]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 181FBAE7A; Sun, 7 Jan 2018 19:30:06 +0100 (CET) From: "Kristof Provost" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux Date: Sun, 07 Jan 2018 19:30:04 +0100 X-Mailer: MailMate (2.0BETAr6102) Message-ID: <219974D5-0240-49D9-8DE4-C1FBCEF74776@FreeBSD.org> In-Reply-To: <201801071802.w07I2YEB017699@pdx.rh.CN85.dnsmgr.net> References: <201801071802.w07I2YEB017699@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:30:08 -0000 On 7 Jan 2018, at 19:02, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: kp >> Date: Sun Jan 7 13:39:12 2018 >> New Revision: 327676 >> URL: https://svnweb.freebsd.org/changeset/base/327676 >> >> Log: >> linuxkpi: Implement kcalloc() based on mallocarray() >> >> This means we now get integer overflow protection, which Linux code >> might expect as it is also provided by kcalloc() in Linux. >> >> Modified: >> head/sys/compat/linuxkpi/common/include/linux/slab.h >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 = >> 13:35:15 2018 (r327675) >> +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 = >> 13:39:12 2018 (r327676) >> @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); >> #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) >> #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | = >> __GFP_ZERO) >> #define kfree_const(ptr) kfree(ptr) >> -#define kcalloc(n, size, flags) kmalloc((n) * (size), = >> (flags) | __GFP_ZERO) > > Would not: > #define kcalloc(n, size, flags) mallocarray(mallocarray((n), = > (size), M_KMALLOC, linux_check_m_flags((flags | __GFP_ZERO)) > work just fine, saving a call and stack use of about framesize + 32 = > bytes? > > It would also work, but it=E2=80=99d have to be split up into multiple li= nes = then. I thought it=E2=80=99d be more readable as a function. It=E2=80=99s an inline function, so it won=E2=80=99t actually use stack s= pace in = practice. Also, it used to call kmalloc(), which is also an inline function, so at = worst we=E2=80=99ve traded one function for another. Regards, Kristof From owner-svn-src-all@freebsd.org Sun Jan 7 18:37:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54EFCE7A3E1; Sun, 7 Jan 2018 18:37:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C04B729C7; Sun, 7 Jan 2018 18:37:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w07Ibf29017915; Sun, 7 Jan 2018 10:37:41 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w07Ibfxb017914; Sun, 7 Jan 2018 10:37:41 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801071837.w07Ibfxb017914@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: <219974D5-0240-49D9-8DE4-C1FBCEF74776@FreeBSD.org> To: Kristof Provost Date: Sun, 7 Jan 2018 10:37:41 -0800 (PST) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:37:44 -0000 > On 7 Jan 2018, at 19:02, Rodney W. Grimes wrote: > >> Author: kp > >> Date: Sun Jan 7 13:39:12 2018 > >> New Revision: 327676 > >> URL: https://svnweb.freebsd.org/changeset/base/327676 > >> > >> Log: > >> linuxkpi: Implement kcalloc() based on mallocarray() > >> > >> This means we now get integer overflow protection, which Linux code > >> might expect as it is also provided by kcalloc() in Linux. > >> > >> Modified: > >> head/sys/compat/linuxkpi/common/include/linux/slab.h > >> > >> Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h > >> ============================================================================== > >> --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 > >> 13:35:15 2018 (r327675) > >> +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 > >> 13:39:12 2018 (r327676) > >> @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); > >> #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) > >> #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | > >> __GFP_ZERO) > >> #define kfree_const(ptr) kfree(ptr) > >> -#define kcalloc(n, size, flags) kmalloc((n) * (size), > >> (flags) | __GFP_ZERO) > > > > Would not: > > #define kcalloc(n, size, flags) mallocarray(mallocarray((n), > > (size), M_KMALLOC, linux_check_m_flags((flags | __GFP_ZERO)) > > work just fine, saving a call and stack use of about framesize + 32 > > bytes? > > > > > It would also work, but it?d have to be split up into multiple lines > then. But it would retain the direct macro form, your change changes it from a #define which is evaluated at pre proc time to a function call that is evaluated at compile time. The resulting code from a -O0 well be different because of this. > I thought it?d be more readable as a function. If that is the only reason I would rather see it retain the same form as all the other allocs. > It?s an inline function, so it won?t actually use stack space in > practice. That depends on compiler and optimization levels. > Also, it used to call kmalloc(), which is also an inline function, so at > worst we?ve traded one function for another. I am not sure, well the inlining of all compilers unwrap 2 levels? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jan 7 18:53:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64D13E7AD8E; Sun, 7 Jan 2018 18:53:03 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15C4073320; Sun, 7 Jan 2018 18:53:03 +0000 (UTC) (envelope-from srs0=cu0q=ec=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyhthbnp0l0tszn.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:e0f1:72a1:d72b:ec03]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 03FEEAEDF; Sun, 7 Jan 2018 19:53:00 +0100 (CET) From: "Kristof Provost" To: rgrimes@FreeBSD.org Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux Date: Sun, 07 Jan 2018 19:52:59 +0100 X-Mailer: MailMate (2.0BETAr6102) Message-ID: In-Reply-To: <201801071837.w07Ibfxb017914@pdx.rh.CN85.dnsmgr.net> References: <201801071837.w07Ibfxb017914@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 18:53:03 -0000 On 7 Jan 2018, at 19:37, Rodney W. Grimes wrote: >> On 7 Jan 2018, at 19:02, Rodney W. Grimes wrote: >>>> Author: kp >>>> Date: Sun Jan 7 13:39:12 2018 >>>> New Revision: 327676 >>>> URL: https://svnweb.freebsd.org/changeset/base/327676 >>>> >>>> Log: >>>> linuxkpi: Implement kcalloc() based on mallocarray() >>>> >>>> This means we now get integer overflow protection, which Linux = >>>> code >>>> might expect as it is also provided by kcalloc() in Linux. >>>> >>>> Modified: >>>> head/sys/compat/linuxkpi/common/include/linux/slab.h >>>> >>>> Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 >>>> 13:35:15 2018 (r327675) >>>> +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 >>>> 13:39:12 2018 (r327676) >>>> @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); >>>> #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) >>>> #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | >>>> __GFP_ZERO) >>>> #define kfree_const(ptr) kfree(ptr) >>>> -#define kcalloc(n, size, flags) kmalloc((n) * (size), >>>> (flags) | __GFP_ZERO) >>> >>> Would not: >>> #define kcalloc(n, size, flags) mallocarray(mallocarray((n), >>> (size), M_KMALLOC, linux_check_m_flags((flags | __GFP_ZERO)) >>> work just fine, saving a call and stack use of about framesize + 32 >>> bytes? >>> >>> >> It would also work, but it?d have to be split up into multiple lines >> then. > > But it would retain the direct macro form, your change changes it > from a #define which is evaluated at pre proc time to a function > call that is evaluated at compile time. The resulting code from > a -O0 well be different because of this. > Indeed. It=E2=80=99s not something I=E2=80=99d worry about as anyone who = cares about = it being fast (as opposed to easier to debug for example) would build it = as -O2/-O3. >> I thought it?d be more readable as a function. > > If that is the only reason I would rather see it retain the > same form as all the other allocs. > How does this look? diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h = b/sys/compat/linuxkpi/common/include/linux/slab.h index 1f8ec82db98..5551211c281 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -46,6 +46,9 @@ MALLOC_DECLARE(M_KMALLOC); #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | = __GFP_ZERO) #define kfree_const(ptr) kfree(ptr) +#define kcalloc(n, size, flags) mallocarray((n), (size), \ + M_KMALLOC, \ + linux_check_m_flags((flags | __GFP_ZERO))) #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | = __GFP_ZERO, 0) #define vfree(arg) kfree(arg) #define kvfree(arg) kfree(arg) @@ -99,13 +102,6 @@ kmalloc(size_t size, gfp_t flags) return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); } = -static inline void * -kcalloc(size_t n, size_t size, gfp_t flags) -{ - flags |=3D __GFP_ZERO; - return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); -} - static inline void * __vmalloc(size_t size, gfp_t flags, int other) { Regards, Kristof From owner-svn-src-all@freebsd.org Sun Jan 7 19:07:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D37AE7B849; Sun, 7 Jan 2018 19:07:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC8B773EAC; Sun, 7 Jan 2018 19:07:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w07J7pRd018032; Sun, 7 Jan 2018 11:07:51 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w07J7pUF018031; Sun, 7 Jan 2018 11:07:51 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801071907.w07J7pUF018031@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327676 - head/sys/compat/linuxkpi/common/include/linux In-Reply-To: To: Kristof Provost Date: Sun, 7 Jan 2018 11:07:51 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 19:07:54 -0000 > On 7 Jan 2018, at 19:37, Rodney W. Grimes wrote: > >> On 7 Jan 2018, at 19:02, Rodney W. Grimes wrote: > >>>> Author: kp > >>>> Date: Sun Jan 7 13:39:12 2018 > >>>> New Revision: 327676 > >>>> URL: https://svnweb.freebsd.org/changeset/base/327676 > >>>> > >>>> Log: > >>>> linuxkpi: Implement kcalloc() based on mallocarray() > >>>> > >>>> This means we now get integer overflow protection, which Linux > >>>> code > >>>> might expect as it is also provided by kcalloc() in Linux. > >>>> > >>>> Modified: > >>>> head/sys/compat/linuxkpi/common/include/linux/slab.h > >>>> > >>>> Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h > >>>> ============================================================================== > >>>> --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 > >>>> 13:35:15 2018 (r327675) > >>>> +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Jan 7 > >>>> 13:39:12 2018 (r327676) > >>>> @@ -46,7 +46,6 @@ MALLOC_DECLARE(M_KMALLOC); > >>>> #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) > >>>> #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | > >>>> __GFP_ZERO) > >>>> #define kfree_const(ptr) kfree(ptr) > >>>> -#define kcalloc(n, size, flags) kmalloc((n) * (size), > >>>> (flags) | __GFP_ZERO) > >>> > >>> Would not: > >>> #define kcalloc(n, size, flags) mallocarray(mallocarray((n), > >>> (size), M_KMALLOC, linux_check_m_flags((flags | __GFP_ZERO)) > >>> work just fine, saving a call and stack use of about framesize + 32 > >>> bytes? > >>> > >>> > >> It would also work, but it?d have to be split up into multiple lines > >> then. > > > > But it would retain the direct macro form, your change changes it > > from a #define which is evaluated at pre proc time to a function > > call that is evaluated at compile time. The resulting code from > > a -O0 well be different because of this. > > > Indeed. It?s not something I?d worry about as anyone who cares about > it being fast (as opposed to easier to debug for example) would build it > as -O2/-O3. > > >> I thought it?d be more readable as a function. > > > > If that is the only reason I would rather see it retain the > > same form as all the other allocs. > > > How does this look? > > diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h > b/sys/compat/linuxkpi/common/include/linux/slab.h > index 1f8ec82db98..5551211c281 100644 > --- a/sys/compat/linuxkpi/common/include/linux/slab.h > +++ b/sys/compat/linuxkpi/common/include/linux/slab.h > @@ -46,6 +46,9 @@ MALLOC_DECLARE(M_KMALLOC); > #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) > #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | > __GFP_ZERO) > #define kfree_const(ptr) kfree(ptr) > +#define kcalloc(n, size, flags) mallocarray((n), (size), \ > + M_KMALLOC, \ > + linux_check_m_flags((flags | __GFP_ZERO))) > #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | > __GFP_ZERO, 0) > #define vfree(arg) kfree(arg) > #define kvfree(arg) kfree(arg) > @@ -99,13 +102,6 @@ kmalloc(size_t size, gfp_t flags) > return (malloc(size, M_KMALLOC, linux_check_m_flags(flags))); > } > > -static inline void * > -kcalloc(size_t n, size_t size, gfp_t flags) > -{ > - flags |= __GFP_ZERO; > - return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); > -} > - > static inline void * > __vmalloc(size_t size, gfp_t flags, int other) > { > > Regards, > Kristof Should probably revert and go through review, I would at least wait for comments from others. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jan 7 20:28:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E11FE5ACDB; Sun, 7 Jan 2018 20:28:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCF1C77328; Sun, 7 Jan 2018 20:28:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF4F25F95; Sun, 7 Jan 2018 20:28:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w07KSHKr044609; Sun, 7 Jan 2018 20:28:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07KSHpF044608; Sun, 7 Jan 2018 20:28:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801072028.w07KSHpF044608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 7 Jan 2018 20:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327681 - head/sys/modules/gpio/gpiobus X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/modules/gpio/gpiobus X-SVN-Commit-Revision: 327681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 20:28:19 -0000 Author: jhibbits Date: Sun Jan 7 20:28:17 2018 New Revision: 327681 URL: https://svnweb.freebsd.org/changeset/base/327681 Log: Add missing file to gpiobus module ofw_gpiobus.c is needed when FDT is used. MFC after: 2 weeks Modified: head/sys/modules/gpio/gpiobus/Makefile Modified: head/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- head/sys/modules/gpio/gpiobus/Makefile Sun Jan 7 18:33:19 2018 (r327680) +++ head/sys/modules/gpio/gpiobus/Makefile Sun Jan 7 20:28:17 2018 (r327681) @@ -36,6 +36,10 @@ SRCS= gpiobus.c gpioc.c SRCS+= gpio_if.c gpio_if.h gpiobus_if.c gpiobus_if.h ofw_bus_if.h SRCS+= device_if.h bus_if.h opt_platform.h +.if !empty(OPT_FDT) +SRCS+= ofw_gpiobus.c +.endif + CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ .include From owner-svn-src-all@freebsd.org Sun Jan 7 21:57:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77893E60DF7; Sun, 7 Jan 2018 21:57:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C0C7ACBB; Sun, 7 Jan 2018 21:57:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B3C226DF4; Sun, 7 Jan 2018 21:57:52 +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 w07LvqAt082185; Sun, 7 Jan 2018 21:57:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07LvqPR082184; Sun, 7 Jan 2018 21:57:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801072157.w07LvqPR082184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 7 Jan 2018 21:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327682 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 21:57:53 -0000 Author: asomers Date: Sun Jan 7 21:57:52 2018 New Revision: 327682 URL: https://svnweb.freebsd.org/changeset/base/327682 Log: Fix typo from r327666 MFC after: 13 days X-MFC-With: 327666 Modified: head/tests/sys/geom/class/eli/init_test.sh Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 20:28:17 2018 (r327681) +++ head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 21:57:52 2018 (r327682) @@ -9,7 +9,7 @@ init_test() keylen=${cipher##*:} atf_check -s exit:0 -e ignore \ - geli init -B none -e $ealgo -l $keylen -P -K keyfile + geli init -B none -e $ealgo -l $keylen -P -K keyfile \ -s $secsize ${md} atf_check geli attach -p -k keyfile ${md} From owner-svn-src-all@freebsd.org Sun Jan 7 22:21:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21E12E62495; Sun, 7 Jan 2018 22:21:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F029F7BDCE; Sun, 7 Jan 2018 22:21:08 +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 3ACEC2724A; Sun, 7 Jan 2018 22:21:08 +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 w07ML8i2092796; Sun, 7 Jan 2018 22:21:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07ML7AE092788; Sun, 7 Jan 2018 22:21:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801072221.w07ML7AE092788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 7 Jan 2018 22:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327683 - in head: . tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . tests/sys/geom/class/eli X-SVN-Commit-Revision: 327683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 22:21:09 -0000 Author: asomers Date: Sun Jan 7 22:21:07 2018 New Revision: 327683 URL: https://svnweb.freebsd.org/changeset/base/327683 Log: geli: convert remaining TAP tests to ATF MFC after: 2 weeks Deleted: head/tests/sys/geom/class/eli/nokey_test.sh head/tests/sys/geom/class/eli/readonly_test.sh Modified: head/ObsoleteFiles.inc head/tests/sys/geom/class/eli/Makefile head/tests/sys/geom/class/eli/attach_test.sh head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/delkey_test.sh head/tests/sys/geom/class/eli/init_test.sh head/tests/sys/geom/class/eli/kill_test.sh head/tests/sys/geom/class/eli/setkey_test.sh Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jan 7 21:57:52 2018 (r327682) +++ head/ObsoleteFiles.inc Sun Jan 7 22:21:07 2018 (r327683) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180107: Convert remaining geli(8) tests to ATF +OLD_FILES+=tests/sys/geom/class/eli/nokey_test.sh +OLD_FILES+=tests/sys/geom/class/eli/readonly_test.sh # 20180106: Convert most geli(8) tests to ATF OLD_FILES+=tests/sys/geom/class/eli/attach_d_test.sh OLD_FILES+=tests/sys/geom/class/eli/configure_b_B_test.sh Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/Makefile Sun Jan 7 22:21:07 2018 (r327683) @@ -18,10 +18,6 @@ ATF_TESTS_SH+= onetime_test ATF_TESTS_SH+= resize_test ATF_TESTS_SH+= setkey_test -TAP_TESTS_SH+= nokey_test -TAP_TESTS_SH+= readonly_test - - ${PACKAGE}FILES+= conf.sh .for t in ${TAP_TESTS_SH} Modified: head/tests/sys/geom/class/eli/attach_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/attach_test.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/attach_test.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -39,7 +39,62 @@ attach_d_cleanup() geli_test_cleanup } +atf_test_case attach_r cleanup +attach_r_head() +{ + atf_set "descr" "geli attach -r will create a readonly provider" + atf_set "require.user" "root" +} +attach_r_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -r -p -k keyfile ${md} + + atf_check -o match:"^Flags: .*READ-ONLY" geli list ${md}.eli + + # Verify that writes are verbotten + atf_check -s not-exit:0 -e match:"Read-only" \ + dd if=/dev/zero of=/dev/${md}.eli count=1 +} +attach_r_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case nokey cleanup +nokey_head() +{ + atf_set "descr" "geli attach fails if called with no key component" + atf_set "require.user" "root" +} +nokey_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check -s not-exit:0 -e match:"No key components given" \ + geli attach -p ${md} 2>/dev/null +} +nokey_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case attach_d + atf_add_test_case attach_r + atf_add_test_case nokey } Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -3,7 +3,6 @@ class="eli" base=$(atf_get ident) -[ -z "$base" ] && base=`basename $0` # for TAP compatibility MAX_SECSIZE=8192 TEST_MDS_FILE=md.devs @@ -85,7 +84,5 @@ geli_test_cleanup() fi true } -# TODO: remove the trap statement once all TAP tests are converted -trap geli_test_cleanup ABRT EXIT INT TERM . `dirname $0`/../geom_subr.sh Modified: head/tests/sys/geom/class/eli/delkey_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/delkey_test.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/delkey_test.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -80,7 +80,35 @@ delkey_cleanup() geli_test_cleanup } +atf_test_case delkey_readonly cleanup +delkey_readonly_head() +{ + atf_set "descr" "geli delkey cannot work on a read-only provider" + atf_set "require.user" "root" +} +delkey_readonly_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -r -p -k keyfile ${md} + + atf_check -s not-exit:0 -e match:"read-only" geli delkey -n 0 ${md} + # Even with -f (force) it should still fail + atf_check -s not-exit:0 -e match:"read-only" geli delkey -f -n 0 ${md} +} +delkey_readonly_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case delkey + atf_add_test_case delkey_readonly } Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/init_test.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -358,6 +358,28 @@ init_i_P_cleanup() geli_test_cleanup } +atf_test_case nokey cleanup +nokey_head() +{ + atf_set "descr" "geli init fails if called with no key component" + atf_set "require.user" "root" +} +nokey_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + + atf_check -s not-exit:0 -e match:"No key components given" \ + geli init -B none -P ${md} +} +nokey_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case init @@ -366,4 +388,5 @@ atf_init_test_cases() atf_add_test_case init_a atf_add_test_case init_alias atf_add_test_case init_i_P + atf_add_test_case nokey } Modified: head/tests/sys/geom/class/eli/kill_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/kill_test.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/kill_test.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -65,7 +65,38 @@ kill_cleanup() geli_test_cleanup } +atf_test_case kill_readonly cleanup +kill_readonly_head() +{ + atf_set "descr" "geli kill will not destroy the keys of a readonly provider" + atf_set "require.user" "root" +} +kill_readonly_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + # Attach read-only + atf_check geli attach -r -p -k keyfile ${md} + + atf_check geli kill ${md} + # The provider will be detached + atf_check [ ! -c /dev/${md}.eli ] + # But its keys should not be destroyed + atf_check geli attach -p -k keyfile ${md} +} +kill_readonly_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case kill + atf_add_test_case kill_readonly } Modified: head/tests/sys/geom/class/eli/setkey_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/setkey_test.sh Sun Jan 7 21:57:52 2018 (r327682) +++ head/tests/sys/geom/class/eli/setkey_test.sh Sun Jan 7 22:21:07 2018 (r327683) @@ -92,7 +92,73 @@ setkey_cleanup() geli_test_cleanup } +atf_test_case setkey_readonly cleanup +setkey_readonly_head() +{ + atf_set "descr" "geli setkey cannot change the keys of a readonly provider" + atf_set "require.user" "root" +} +setkey_readonly_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -r -p -k keyfile ${md} + + atf_check -s not-exit:0 -e match:"read-only" \ + geli setkey -n 1 -P -K /dev/null ${md} +} +setkey_readonly_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + +atf_test_case nokey cleanup +nokey_head() +{ + atf_set "descr" "geli setkey can change the key for an existing provider" + atf_set "require.user" "root" +} +nokey_body() +{ + . $(atf_get_srcdir)/conf.sh + + sectors=100 + md=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile1 bs=512 count=16 status=none + atf_check dd if=/dev/random of=keyfile2 bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile1 ${md} + + # Try to set the key for a detached device without providing any + # components for the old key. + atf_check -s not-exit:0 -e match:"No key components given" \ + geli setkey -n 0 -p -P -K keyfile2 ${md} + + # Try to set the key for a detached device without providing any + # components for the new key + atf_check -s not-exit:0 -e match:"No key components given" \ + geli setkey -n 0 -p -k keyfile1 -P ${md} + + # Try to set a new key for an attached device with no components + atf_check geli attach -p -k keyfile1 ${md} + atf_check -s not-exit:0 -e match:"No key components given" \ + geli setkey -n 0 -P ${md} +} +nokey_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + geli_test_cleanup +} + atf_init_test_cases() { atf_add_test_case setkey + atf_add_test_case setkey_readonly + atf_add_test_case nokey } From owner-svn-src-all@freebsd.org Sun Jan 7 22:38:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F08C7E63301; Sun, 7 Jan 2018 22:38:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD2EF7C76D; Sun, 7 Jan 2018 22:38:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A32727444; Sun, 7 Jan 2018 22:38:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w07McjVM099236; Sun, 7 Jan 2018 22:38:45 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w07McjLP099234; Sun, 7 Jan 2018 22:38:45 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201801072238.w07McjLP099234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 7 Jan 2018 22:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head/sys/compat: cloudabi32 cloudabi64 X-SVN-Commit-Revision: 327684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Jan 2018 22:38:47 -0000 Author: ed Date: Sun Jan 7 22:38:45 2018 New Revision: 327684 URL: https://svnweb.freebsd.org/changeset/base/327684 Log: Use mallocarray(9) in CloudABI kernel code where possible. Submitted by: pfg@ Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c head/sys/compat/cloudabi64/cloudabi64_sock.c Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 22:21:07 2018 (r327683) +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 22:38:45 2018 (r327684) @@ -60,7 +60,7 @@ cloudabi32_sys_sock_recv(struct thread *td, /* Convert iovecs to native format. */ if (ri.ri_data_len > UIO_MAXIOV) return (EINVAL); - iov = malloc(ri.ri_data_len * sizeof(struct iovec), + iov = mallocarray(ri.ri_data_len, sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(ri.ri_data); for (i = 0; i < ri.ri_data_len; i++) { @@ -104,7 +104,7 @@ cloudabi32_sys_sock_send(struct thread *td, /* Convert iovecs to native format. */ if (si.si_data_len > UIO_MAXIOV) return (EINVAL); - iov = malloc(si.si_data_len * sizeof(struct iovec), + iov = mallocarray(si.si_data_len, sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(si.si_data); for (i = 0; i < si.si_data_len; i++) { Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sock.c Sun Jan 7 22:21:07 2018 (r327683) +++ head/sys/compat/cloudabi64/cloudabi64_sock.c Sun Jan 7 22:38:45 2018 (r327684) @@ -60,7 +60,7 @@ cloudabi64_sys_sock_recv(struct thread *td, /* Convert iovecs to native format. */ if (ri.ri_data_len > UIO_MAXIOV) return (EINVAL); - iov = malloc(ri.ri_data_len * sizeof(struct iovec), + iov = mallocarray(ri.ri_data_len, sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(ri.ri_data); for (i = 0; i < ri.ri_data_len; i++) { @@ -104,7 +104,7 @@ cloudabi64_sys_sock_send(struct thread *td, /* Convert iovecs to native format. */ if (si.si_data_len > UIO_MAXIOV) return (EINVAL); - iov = malloc(si.si_data_len * sizeof(struct iovec), + iov = mallocarray(si.si_data_len, sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(si.si_data); for (i = 0; i < si.si_data_len; i++) { From owner-svn-src-all@freebsd.org Mon Jan 8 00:10:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF5CCE68548; Mon, 8 Jan 2018 00:10:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A196B7F949; Mon, 8 Jan 2018 00:10:46 +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 BA595282BD; Mon, 8 Jan 2018 00:10:45 +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 w080Aj8s037228; Mon, 8 Jan 2018 00:10:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w080AjJj037225; Mon, 8 Jan 2018 00:10:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801080010.w080AjJj037225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 8 Jan 2018 00:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327685 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 00:10:47 -0000 Author: asomers Date: Mon Jan 8 00:10:45 2018 New Revision: 327685 URL: https://svnweb.freebsd.org/changeset/base/327685 Log: geli: optimize tests Reduce the geli tests' runtime by about a third: * In integrity_test:copy, use a file-backed md(4) device instead of a malloc'd one. That way we can corrupt the underlying storage without needing to detach and reattach the geli device. * In integrity_test:{copy, hmac, data} and onetime_test:{onetime, onetime_a}, move reads of /dev/random out of the loop. MFC after: 2 weeks Modified: head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/integrity_test.sh head/tests/sys/geom/class/eli/onetime_test.sh Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Sun Jan 7 22:38:45 2018 (r327684) +++ head/tests/sys/geom/class/eli/conf.sh Mon Jan 8 00:10:45 2018 (r327685) @@ -20,12 +20,22 @@ attach_md() # func for_each_geli_config() { func=$1 + backing_filename=$2 # Double the sector size to allow for the HMACs' storage space. osecsize=$(( $MAX_SECSIZE * 2 )) # geli needs 512B for the label. bytes=`expr $osecsize \* $sectors + 512`b - md=$(attach_md -t malloc -s $bytes) + + if [ -n "$backing_filename" ]; then + # Use a file-backed md(4) device, so we can deliberatly corrupt + # it without detaching the geli device first. + truncate -s $bytes backing_file + md=$(attach_md -t vnode -f backing_file) + else + md=$(attach_md -t malloc -s $bytes) + fi + for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ 3des-cbc:192 \ Modified: head/tests/sys/geom/class/eli/integrity_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/integrity_test.sh Sun Jan 7 22:38:45 2018 (r327684) +++ head/tests/sys/geom/class/eli/integrity_test.sh Mon Jan 8 00:10:45 2018 (r327685) @@ -12,31 +12,32 @@ copy_test() { -K keyfile -s $secsize ${md} atf_check geli attach -p -k keyfile ${md} - atf_check dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=1 status=none + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=1 status=none - atf_check geli detach ${md} # Copy first small sector to the second small sector. # This should be detected as corruption. - atf_check dd if=/dev/${md} of=sector bs=512 count=1 status=none - atf_check dd if=sector of=/dev/${md} bs=512 count=1 seek=1 status=none - atf_check geli attach -p -k keyfile ${md} + atf_check dd if=backing_file of=sector bs=512 count=1 \ + conv=notrunc status=none + atf_check dd if=sector of=backing_file bs=512 count=1 seek=1 \ + conv=notrunc status=none atf_check -s not-exit:0 -e ignore \ dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=1 # Fix the corruption - atf_check dd if=/dev/random of=/dev/${md}.eli bs=${secsize} count=2 status=none - atf_check dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=2 status=none + atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=2 status=none + atf_check dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=2 \ + status=none # Copy first big sector to the second big sector. # This should be detected as corruption. ms=`diskinfo /dev/${md} | awk '{print $3 - 512}'` ns=`diskinfo /dev/${md}.eli | awk '{print $4}'` usecsize=`echo "($ms / $ns) - (($ms / $ns) % 512)" | bc` - atf_check geli detach ${md} - atf_check dd if=/dev/${md} bs=512 count=$(( ${usecsize} / 512 )) seek=$(( $secsize / 512 )) of=sector status=none - atf_check dd of=/dev/${md} bs=512 count=$(( ${usecsize} / 512 )) seek=$(( $secsize / 256 )) if=sector status=none - atf_check -s exit:0 -e ignore geli attach -p -k keyfile ${md} + atf_check dd if=backing_file bs=512 count=$(( ${usecsize} / 512 )) \ + seek=$(( $secsize / 512 )) of=sector conv=notrunc status=none + atf_check dd of=backing_file bs=512 count=$(( ${usecsize} / 512 )) \ + seek=$(( $secsize / 256 )) if=sector conv=notrunc status=none atf_check -s not-exit:0 -e ignore \ dd if=/dev/${md}.eli of=/dev/null bs=${secsize} count=$ns } @@ -55,7 +56,9 @@ copy_body() sectors=2 atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none - for_each_geli_config copy_test + dd if=/dev/random of=rnd bs=${MAX_SECSIZE} count=${sectors} status=none + + for_each_geli_config copy_test backing_file } copy_cleanup() { @@ -77,7 +80,7 @@ data_test() { # Corrupt 8 bytes of data. atf_check dd if=/dev/${md} of=sector bs=512 count=1 status=none - atf_check dd if=/dev/random of=sector bs=1 count=8 seek=64 conv=notrunc status=none + atf_check dd if=rnd of=sector bs=1 count=8 seek=64 conv=notrunc status=none atf_check dd if=sector of=/dev/${md} bs=512 count=1 status=none atf_check geli attach -p -k keyfile ${md} @@ -100,6 +103,7 @@ data_body() sectors=2 atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + dd if=/dev/random of=rnd bs=${MAX_SECSIZE} count=${sectors} status=none for_each_geli_config data_test } data_cleanup() @@ -121,7 +125,7 @@ hmac_test() { # Corrupt 8 bytes of HMAC. atf_check dd if=/dev/${md} of=sector bs=512 count=1 status=none - atf_check dd if=/dev/random of=sector bs=1 count=16 conv=notrunc status=none + atf_check dd if=rnd of=sector bs=1 count=16 conv=notrunc status=none atf_check dd if=sector of=/dev/${md} bs=512 count=1 status=none atf_check geli attach -p -k keyfile ${md} @@ -144,6 +148,7 @@ hmac_body() sectors=2 atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + dd if=/dev/random of=rnd bs=${MAX_SECSIZE} count=${sectors} status=none for_each_geli_config hmac_test } hmac_cleanup() Modified: head/tests/sys/geom/class/eli/onetime_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/onetime_test.sh Sun Jan 7 22:38:45 2018 (r327684) +++ head/tests/sys/geom/class/eli/onetime_test.sh Mon Jan 8 00:10:45 2018 (r327685) @@ -10,7 +10,6 @@ onetime_test() atf_check -s exit:0 -o ignore -e ignore \ geli onetime -e $ealgo -l $keylen -s $secsize ${md} - atf_check dd if=/dev/random of=rnd bs=${secsize} count=${sectors} status=none atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} status=none md_rnd=`dd if=rnd bs=${secsize} count=${sectors} status=none | md5` @@ -82,7 +81,8 @@ onetime_a_body() . $(atf_get_srcdir)/conf.sh sectors=8 - atf_check dd if=/dev/random of=rnd bs=1024 count=1024 status=none + atf_check dd if=/dev/random of=rnd bs=$MAX_SECSIZE count=$sectors \ + status=none for_each_geli_config onetime_a_test } onetime_a_cleanup() From owner-svn-src-all@freebsd.org Mon Jan 8 00:57:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55B35E6B01B; Mon, 8 Jan 2018 00:57:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F74E81656; Mon, 8 Jan 2018 00:57:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59F4628AFA; Mon, 8 Jan 2018 00:57:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w080vTiZ058155; Mon, 8 Jan 2018 00:57:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w080vTdx058154; Mon, 8 Jan 2018 00:57:29 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801080057.w080vTdx058154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 8 Jan 2018 00:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327686 - stable/11/usr.bin/units X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/units X-SVN-Commit-Revision: 327686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 00:57:30 -0000 Author: eadler Date: Mon Jan 8 00:57:28 2018 New Revision: 327686 URL: https://svnweb.freebsd.org/changeset/base/327686 Log: MFC r327578: units(1): add missing ':' for two short arguments PR: 209850 Modified: stable/11/usr.bin/units/units.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/units/units.c ============================================================================== --- stable/11/usr.bin/units/units.c Mon Jan 8 00:10:45 2018 (r327685) +++ stable/11/usr.bin/units/units.c Mon Jan 8 00:57:28 2018 (r327686) @@ -761,7 +761,7 @@ main(int argc, char **argv) history_file = NULL; outputformat = numfmt; quit = false; - while ((optchar = getopt_long(argc, argv, "+ehf:oqtvHUV", longopts, NULL)) != -1) { + while ((optchar = getopt_long(argc, argv, "+ehf:o:qtvH:UV", longopts, NULL)) != -1) { switch (optchar) { case 'e': outputformat = "%6e"; From owner-svn-src-all@freebsd.org Mon Jan 8 07:47:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730C9E7E2EB; Mon, 8 Jan 2018 07:47:08 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id CEBAB6E9AF; Mon, 8 Jan 2018 07:47:05 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:341b:263b:a811:3894] (unknown [IPv6:2a02:c7f:1e13:cf00:341b:263b:a811:3894]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id B75784EBDB; Mon, 8 Jan 2018 07:37:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 From: Andrew Turner In-Reply-To: <201801072238.w07McjLP099234@repo.freebsd.org> Date: Mon, 8 Jan 2018 07:37:44 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> References: <201801072238.w07McjLP099234@repo.freebsd.org> To: Ed Schouten X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 07:47:08 -0000 > On 7 Jan 2018, at 22:38, Ed Schouten wrote: >=20 > Author: ed > Date: Sun Jan 7 22:38:45 2018 > New Revision: 327684 > URL: https://svnweb.freebsd.org/changeset/base/327684 >=20 > Log: > Use mallocarray(9) in CloudABI kernel code where possible. >=20 > Submitted by: pfg@ >=20 > Modified: > head/sys/compat/cloudabi32/cloudabi32_sock.c > head/sys/compat/cloudabi64/cloudabi64_sock.c >=20 > Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 = 22:21:07 2018 (r327683) > +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 = 22:38:45 2018 (r327684) > @@ -60,7 +60,7 @@ cloudabi32_sys_sock_recv(struct thread *td, > /* Convert iovecs to native format. */ > if (ri.ri_data_len > UIO_MAXIOV) > return (EINVAL); > - iov =3D malloc(ri.ri_data_len * sizeof(struct iovec), > + iov =3D mallocarray(ri.ri_data_len, sizeof(struct iovec), > M_SOCKET, M_WAITOK); Won=E2=80=99t this lead to a NULL pointer dereference on overflow? = mallocarray can return NULL even with M_WAITOK. Andrew From owner-svn-src-all@freebsd.org Mon Jan 8 09:20:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE24DE5DCE1; Mon, 8 Jan 2018 09:20:09 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 956AF72080; Mon, 8 Jan 2018 09:20:09 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B77D12DB24; Mon, 8 Jan 2018 09:20:08 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w089K8dS068923; Mon, 8 Jan 2018 09:20:08 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w089K8Ur068921; Mon, 8 Jan 2018 09:20:08 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201801080920.w089K8Ur068921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 8 Jan 2018 09:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327689 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 327689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 09:20:09 -0000 Author: oshogbo Date: Mon Jan 8 09:20:08 2018 New Revision: 327689 URL: https://svnweb.freebsd.org/changeset/base/327689 Log: Document the DNS Casper service. Reviewed by: brueffer@, bcr@ Differential Revision: https://reviews.freebsd.org/D13762 Added: head/lib/libcasper/services/cap_dns/cap_dns.3 (contents, props changed) Modified: head/lib/libcasper/services/cap_dns/Makefile Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Mon Jan 8 08:37:31 2018 (r327688) +++ head/lib/libcasper/services/cap_dns/Makefile Mon Jan 8 09:20:08 2018 (r327689) @@ -24,4 +24,14 @@ CFLAGS+=-I${.CURDIR} HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +MAN+= cap_dns.3 + +MLINKS+=cap_dns.3 libcap_dns.3 +MLINKS+=cap_dns.3 cap_gethostbyname.3 +MLINKS+=cap_dns.3 cap_gethostbyname2.3 +MLINKS+=cap_dns.3 cap_gethostbyaddr.3 +MLINKS+=cap_dns.3 cap_getnameinfo.3 +MLINKS+=cap_dns.3 cap_dns_type_limit.3 +MLINKS+=cap_dns.3 cap_dns_family_limit.3 + .include Added: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Mon Jan 8 09:20:08 2018 (r327689) @@ -0,0 +1,205 @@ +.\" Copyright (c) 2018 Mariusz Zaborski +.\" 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 AUTHORS 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 AUTHORS 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 January 8, 2018 +.Dt CAP_DNS 3 +.Os +.Sh NAME +.Nm cap_gethostbyname , +.Nm cap_gethostbyname2 , +.Nm cap_gethostbyaddr , +.Nm cap_getnameinfo , +.Nm cap_dns_type_limit , +.Nm cap_dns_family_limit +.Nd "library for getting network host entry in capability mode" +.Sh LIBRARY +.Lb libcap_dns +.Sh SYNOPSIS +.In sys/nv.h +.In libcasper.h +.In casper/cap_dns.h +.Ft "struct hostent *" +.Fn cap_gethostbyname "const cap_channel_t *chan" "const char *name" +.Ft "struct hostent *" +.Fn cap_gethostbyname2 "const cap_channel_t *chan" "const char *name" "int af" +.Ft "struct hostent *" +.Fn cap_gethostbyaddr "const cap_channel_t *chan" "const void *addr" "socklen_t len" "int af" +.Ft "int" +.Fn cap_getnameinfo "const cap_channel_t *chan" "const void *name" "int namelen" +.Ft "int" +.Fn cap_dns_type_limit "cap_channel_t *chan" "const char * const *types" "size_t ntypes" +.Ft "int" +.Fn cap_dns_family_limit "const cap_channel_t *chan" "const int *families" "size_t nfamilies" +.Sh DESCRIPTION +The functions +.Fn cap_gethostbyname , +.Fn cap_gethostbyname2 , +.Fn cep_gethostbyaddr +and +.Xr cap_getnameinfo +are respectively equivalent to +.Xr gethostbyname 2 , +.Xr gethostbyname2 2 , +.Xr gethostbyaddr 2 +and +.Xr getnameinfo 2 +except that the connection to the +.Nm system.dns +service needs to be provided. +.Pp +The +.Fn cap_dns_type_limit +function limits the functions allowed in the service. +The +.Fa types +variable can be set to +.Dv ADDR +or +.Dv NAME . +See the +.Sx LIMITS +section for more details. +The +.Fa ntpyes +variable contains the number of +.Fa types +provided. +.Pp +The +.Fn cap_dns_family_limit +functions allows to limit address families. +For details see +.Sx LIMITS . +The +.Fa nfamilies +variable contains the number of +.Fa families +provided. +.Sh LIMITS +The preferred way of setting limits is to use the +.Fn cap_dns_type_limit +and +.Fn cap_dns_family_limit +functions, but the limits of service can be set also using +.Xr cap_limit_set 3 . +The nvlist for that function can contain the following values and types: +.Bl -ohang -offset indent +.It type ( NV_TYPE_STRING ) +The +.Va type +can have two values: +.Dv ADDR +or +.Dv NAME . +The +.Dv ADDR +means that functions +.Fn cap_gethostbyname , +.Fn cap_gethostbyname2 +and +.Fn cap_gethostbyaddr +are allowed. +In case when +.Va type +is set to +.Dv NAME +the +.Fn cap_getnameinfo +function is allowed. +.It family ( NV_TYPE_NUMBER ) +The +.Va family +limits service to one of the address families (e.g. +.Dv AF_INET , AF_INET6 , +etc.). +.Sh EXAMPLES +The following example first opens a capability to casper and then uses this +capability to create the +.Nm system.dns +casper service and uses it to resolve an IP address. +.Bd -literal +cap_channel_t *capcas, *capdns; +const char *typelimit = "ADDR"; +int familylimit; +const char *ipstr = "127.0.0.1"; +struct in_addr ip; +struct hostent *hp; + +/* Open capability to Casper. */ +capcas = cap_init(); +if (capcas == NULL) + err(1, "Unable to contact Casper"); + +/* Enter capability mode sandbox. */ +if (cap_enter() < 0 && errno != ENOSYS) + err(1, "Unable to enter capability mode"); + +/* Use Casper capability to create capability to the system.dns service. */ +capdns = cap_service_open(capcas, "system.dns"); +if (capdns == NULL) + err(1, "Unable to open system.dns service"); + +/* Close Casper capability, we don't need it anymore. */ +cap_close(capcas); + +/* Limit system.dns to reverse DNS lookups. */ +if (cap_dns_type_limit(capdns, &typelimit, 1) < 0) + err(1, "Unable to limit access to the system.dns service"); + +/* Limit system.dns to reserve IPv4 addresses */ +familylimit = AF_INET; +if (cap_dns_family_limit(capdns, &familylimit, 1) < 0) + err(1, "Unable to limit access to the system.dns service"); + +/* Convert IP address in C-string to in_addr. */ +if (!inet_aton(ipstr, &ip)) + errx(1, "Unable to parse IP address %s.", ipstr); + +/* Find hostname for the given IP address. */ +hp = cap_gethostbyaddr(capdns, (const void *)&ip, sizeof(ip), AF_INET); +if (hp == NULL) + errx(1, "No name associated with %s.", ipstr); + +printf("Name associated with %s is %s.\\n", ipstr, hp->h_name); +.Ed +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr err 3 , +.Xr gethostbyaddr 3 , +.Xr gethostbyname 3 , +.Xr gethostbyname2 3 , +.Xr getnameinfo 3, +.Xr nv 3 , +.Xr capsicum 4 +.Sh AUTHORS +The +.Nm cap_dns +service was implemented by +.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. +.Pp +This manual page was written by +.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Jan 8 10:23:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9D51E62495; Mon, 8 Jan 2018 10:23:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A17367444A; Mon, 8 Jan 2018 10:23:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D385F2E65C; Mon, 8 Jan 2018 10:23:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08ANVGv097684; Mon, 8 Jan 2018 10:23:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08ANVNi097681; Mon, 8 Jan 2018 10:23:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801081023.w08ANVNi097681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 8 Jan 2018 10:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327690 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 327690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 10:23:32 -0000 Author: andrew Date: Mon Jan 8 10:23:31 2018 New Revision: 327690 URL: https://svnweb.freebsd.org/changeset/base/327690 Log: Move some of the common thread switching code into C. This will help with future optimisations, e.g. using Address Space IDs (asid). MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/swtch.S head/sys/arm64/include/pmap.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Jan 8 09:20:08 2018 (r327689) +++ head/sys/arm64/arm64/pmap.c Mon Jan 8 10:23:31 2018 (r327690) @@ -4660,6 +4660,38 @@ pmap_activate(struct thread *td) critical_exit(); } +struct pcb * +pmap_switch(struct thread *old, struct thread *new) +{ + struct pcb *pcb; + + /* Store the new curthread */ + PCPU_SET(curthread, new); + + /* And the new pcb */ + pcb = new->td_pcb; + PCPU_SET(curpcb, pcb); + + /* + * TODO: We may need to flush the cache here if switching + * to a user process. + */ + + __asm __volatile( + /* Switch to the new pmap */ + "msr ttbr0_el1, %0 \n" + "isb \n" + + /* Invalidate the TLB */ + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(new->td_proc->p_md.md_l0addr)); + + return (pcb); +} + void pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz) { Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Mon Jan 8 09:20:08 2018 (r327689) +++ head/sys/arm64/arm64/swtch.S Mon Jan 8 10:23:31 2018 (r327690) @@ -70,33 +70,16 @@ ENTRY(cpu_throw) #ifdef VFP /* Backup the new thread pointer around a call to C code */ - mov x19, x1 + mov x19, x0 + mov x20, x1 bl vfp_discard - mov x1, x19 + mov x1, x20 + mov x0, x19 #endif - /* Store the new curthread */ - str x1, [x18, #PC_CURTHREAD] - /* And the new pcb */ - ldr x4, [x1, #TD_PCB] - str x4, [x18, #PC_CURPCB] + bl pmap_switch + mov x4, x0 - /* - * TODO: We may need to flush the cache here. - */ - - /* Switch to the new pmap */ - ldr x28, [x1, #TD_PROC] - ldr x5, [x28, #(P_MD + MD_L0ADDR)] - msr ttbr0_el1, x5 - isb - - /* Invalidate the TLB */ - dsb ishst - tlbi vmalle1 - dsb ish - isb - /* If we are single stepping, enable it */ ldr w5, [x4, #PCB_FLAGS] set_step_flag w5, x6 @@ -161,45 +144,25 @@ ENTRY(cpu_switch) ldr w5, [x4, #PCB_FLAGS] clear_step_flag w5, x6 -#ifdef VFP mov x19, x0 mov x20, x1 mov x21, x2 + +#ifdef VFP /* Load the pcb address */ mov x1, x4 bl vfp_save_state - mov x2, x21 mov x1, x20 mov x0, x19 #endif - /* Store the new curthread */ - str x1, [x18, #PC_CURTHREAD] + bl pmap_switch + /* Move the new pcb out of the way */ + mov x4, x0 - /* - * Restore the saved context and set it as curpcb. - */ - ldr x4, [x1, #TD_PCB] - str x4, [x18, #PC_CURPCB] - - /* - * TODO: We may need to flush the cache here if switching - * to a user process. - */ - - /* Load the new proc address */ - ldr x28, [x1, #TD_PROC] - - /* Switch to the new pmap */ - ldr x5, [x28, #(P_MD + MD_L0ADDR)] - msr ttbr0_el1, x5 - isb - - /* Invalidate the TLB */ - dsb ishst - tlbi vmalle1 - dsb ish - isb + mov x2, x21 + mov x1, x20 + mov x0, x19 /* * Release the old thread. This doesn't need to be a store-release Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Mon Jan 8 09:20:08 2018 (r327689) +++ head/sys/arm64/include/pmap.h Mon Jan 8 10:23:31 2018 (r327690) @@ -106,6 +106,8 @@ struct pv_chunk { typedef struct pmap *pmap_t; +struct thread; + #ifdef _KERNEL extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) @@ -155,6 +157,8 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * pd_entry_t **, pt_entry_t **); int pmap_fault(pmap_t, uint64_t, uint64_t); + +struct pcb *pmap_switch(struct thread *, struct thread *); #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) From owner-svn-src-all@freebsd.org Mon Jan 8 11:08:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE7D4E64645; Mon, 8 Jan 2018 11:08:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 918A175E20; Mon, 8 Jan 2018 11:08:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2DA32ECFB; Mon, 8 Jan 2018 11:08:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08B8j0G014904; Mon, 8 Jan 2018 11:08:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08B8jN5014903; Mon, 8 Jan 2018 11:08:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801081108.w08B8jN5014903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 8 Jan 2018 11:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327691 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 327691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 11:08:46 -0000 Author: andrew Date: Mon Jan 8 11:08:45 2018 New Revision: 327691 URL: https://svnweb.freebsd.org/changeset/base/327691 Log: Only install the new pagetable pointer into ttbr0_el1 when it differs from the existing value. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Jan 8 10:23:31 2018 (r327690) +++ head/sys/arm64/arm64/pmap.c Mon Jan 8 11:08:45 2018 (r327691) @@ -4677,17 +4677,20 @@ pmap_switch(struct thread *old, struct thread *new) * to a user process. */ - __asm __volatile( - /* Switch to the new pmap */ - "msr ttbr0_el1, %0 \n" - "isb \n" + if (old == NULL || + old->td_proc->p_md.md_l0addr != new->td_proc->p_md.md_l0addr) { + __asm __volatile( + /* Switch to the new pmap */ + "msr ttbr0_el1, %0 \n" + "isb \n" - /* Invalidate the TLB */ - "dsb ishst \n" - "tlbi vmalle1is \n" - "dsb ish \n" - "isb \n" - : : "r"(new->td_proc->p_md.md_l0addr)); + /* Invalidate the TLB */ + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(new->td_proc->p_md.md_l0addr)); + } return (pcb); } From owner-svn-src-all@freebsd.org Mon Jan 8 12:56:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F7DE6AB6B; Mon, 8 Jan 2018 12:56:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B3D79BD0; Mon, 8 Jan 2018 12:56:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 903532FE5E; Mon, 8 Jan 2018 12:56:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08CurnS067551; Mon, 8 Jan 2018 12:56:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08Cur5c067549; Mon, 8 Jan 2018 12:56:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801081256.w08Cur5c067549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Jan 2018 12:56:53 +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: r327694 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 12:56:54 -0000 Author: kib Date: Mon Jan 8 12:56:53 2018 New Revision: 327694 URL: https://svnweb.freebsd.org/changeset/base/327694 Log: MFC r327472: Avoid re-check of usermode condition. Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c ============================================================================== --- stable/11/sys/amd64/amd64/trap.c Mon Jan 8 11:45:56 2018 (r327693) +++ stable/11/sys/amd64/amd64/trap.c Mon Jan 8 12:56:53 2018 (r327694) @@ -606,7 +606,6 @@ trap_pfault(struct trapframe *frame, int usermode) td = curthread; p = td->td_proc; eva = frame->tf_addr; - rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* @@ -658,7 +657,7 @@ trap_pfault(struct trapframe *frame, int usermode) * Don't allow user-mode faults in kernel address space. */ if (usermode) - goto nogo; + return (SIGSEGV); map = kernel_map; } else { @@ -713,7 +712,6 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } -nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) { Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Mon Jan 8 11:45:56 2018 (r327693) +++ stable/11/sys/i386/i386/trap.c Mon Jan 8 12:56:53 2018 (r327694) @@ -742,7 +742,6 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ td = curthread; p = td->td_proc; - rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* @@ -803,7 +802,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ return (-2); #endif if (usermode) - goto nogo; + return (SIGSEGV); map = kernel_map; } else { @@ -860,7 +859,6 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ #endif return (0); } -nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) { From owner-svn-src-all@freebsd.org Mon Jan 8 13:19:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEB98E6BFAD; Mon, 8 Jan 2018 13:19:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89F8C7A932; Mon, 8 Jan 2018 13:19:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C42E31BC; Mon, 8 Jan 2018 13:19:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08DJFiL078100; Mon, 8 Jan 2018 13:19:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08DJFZT078099; Mon, 8 Jan 2018 13:19:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801081319.w08DJFZT078099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Jan 2018 13:19:15 +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: r327695 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 327695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 13:19:16 -0000 Author: kib Date: Mon Jan 8 13:19:15 2018 New Revision: 327695 URL: https://svnweb.freebsd.org/changeset/base/327695 Log: MFC r327468: Do not let vm_daemon run unbounded. Modified: stable/11/sys/vm/vm_swapout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_swapout.c ============================================================================== --- stable/11/sys/vm/vm_swapout.c Mon Jan 8 12:56:53 2018 (r327694) +++ stable/11/sys/vm/vm_swapout.c Mon Jan 8 13:19:15 2018 (r327695) @@ -201,6 +201,8 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj TAILQ_FOREACH(p, &object->memq, listq) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; + if (should_yield()) + goto unlock_return; if (vm_page_busied(p)) continue; PCPU_INC(cnt.v_pdpages); @@ -514,8 +516,10 @@ again: PRELE(p); } sx_sunlock(&allproc_lock); - if (tryagain != 0 && attempts <= 10) + if (tryagain != 0 && attempts <= 10) { + maybe_yield(); goto again; + } } } From owner-svn-src-all@freebsd.org Mon Jan 8 13:43:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 043FAE6D627; Mon, 8 Jan 2018 13:43:14 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D38527BE84; Mon, 8 Jan 2018 13:43:13 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D1EF69D; Mon, 8 Jan 2018 13:43:13 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08DhC2u094278; Mon, 8 Jan 2018 13:43:12 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08DhCjV094277; Mon, 8 Jan 2018 13:43:12 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201801081343.w08DhCjV094277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Mon, 8 Jan 2018 13:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327696 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: fabient X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 327696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 13:43:14 -0000 Author: fabient Date: Mon Jan 8 13:43:12 2018 New Revision: 327696 URL: https://svnweb.freebsd.org/changeset/base/327696 Log: Fix uninitialized crp_retw_id when using asynchronous crypto drivers with defered callbacks. Submitted by: emeric.poupon@stormshield.eu Reported by: mav@ Reviewed by: fabient@ Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon Jan 8 13:19:15 2018 (r327695) +++ head/sys/opencrypto/crypto.c Mon Jan 8 13:43:12 2018 (r327696) @@ -896,11 +896,12 @@ crypto_dispatch(struct cryptop *crp) binuptime(&crp->crp_tstamp); #endif + crp->crp_retw_id = crp->crp_sid % crypto_workers_num; + if (CRYPTOP_ASYNC(crp)) { if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) { struct crypto_ret_worker *ret_worker; - crp->crp_retw_id = crp->crp_sid % crypto_workers_num; ret_worker = CRYPTO_RETW(crp->crp_retw_id); CRYPTO_RETW_LOCK(ret_worker); From owner-svn-src-all@freebsd.org Mon Jan 8 15:14:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6353BE71D89 for ; Mon, 8 Jan 2018 15:14:14 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x232.google.com (mail-yb0-x232.google.com [IPv6:2607:f8b0:4002:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21BDB7F876 for ; Mon, 8 Jan 2018 15:14:14 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x232.google.com with SMTP id j7so4627233ybl.3 for ; Mon, 08 Jan 2018 07:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1vKUdDJF2q8Lg0HRJf6EmQK7A3e4gIX0T7O9lmc8wpM=; b=totnRVf9t4/2iTDP70DxOfw+qYHmQPLICZBhFf+9HP04t8zdDPkJf8w1tBUs26KXSI FkSVYRiszeOCqwWKueHftOjHvYV+TEnb0PqXto5B3r3ZTV1ZIBVo16M07s1WadmS6d6d yoVCra1G3qF/rxSTJEWiQbKmkJ0Te6Ouv4OKLkFLlnd3INBusyR9hjwWhLeBekBaj7ux hsWWIy2k+jLcGV2PuvRe9eC44X/l+s6lXIsqqaWoCVJFgwyrEZB0F13jtEjoAwNYsXuk TQVAVGkO5PlYEtQYa5AEaIUT8vADu7zdKFfu5Dl+btFoXXWai7rnla5rBX74U58hKxgE CJ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1vKUdDJF2q8Lg0HRJf6EmQK7A3e4gIX0T7O9lmc8wpM=; b=rFK7jHweVzz0f1tSUIKPltZFuguIK9ffbU5rBi+7VW6ubXmudVEuqW/2ktvoOmESDu woG/DZaKlGYRU0VS0F+K5ppzJQVSLwk4UnDtkXSPqBKvTFCHjIgru/9go81kCfdSh5Vs vS62GTAqW20Xo7bbfuSXGasM/o0hRdMROHSmu15X/AX5Vqsud0uBS6RCRO/eyzc6wDa+ 4UvkPUHqjgNfZHx7T91YDCrXjV1LG4NjlA2p1CIsO6JrPu3TbyW8ecowKAM1kwqGe6Hf Lb9vf6dZN2ohOJKyCSYhE5/0EiCACyJSI60BNfmTZjz0G9DTqvqAYThU3VQUTCqQGB7z RfNw== X-Gm-Message-State: AKGB3mJlEIgVknu3ce5X56tDY0OWXnH3ClSW9UaWyJsKYXUN1GAGsRdj Qw83CSLXJ2QfbLW2t+trJ0hkknf5GVXf1GpejMrV9A== X-Google-Smtp-Source: ACJfBouCUzYvMazQcVThk+pW/bwJWC9QEbRbMNrdrwKX8JSv++2Q6BzRBS0bD9+QeZHZACTdBKOIBm09a+gsbH2fLqY= X-Received: by 10.37.239.5 with SMTP id g5mr1841433ybd.226.1515424453231; Mon, 08 Jan 2018 07:14:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.85.17 with HTTP; Mon, 8 Jan 2018 07:13:42 -0800 (PST) In-Reply-To: <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> From: Ed Schouten Date: Mon, 8 Jan 2018 16:13:42 +0100 Message-ID: Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 To: Andrew Turner Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:14:14 -0000 Hi Andrew, 2018-01-08 8:37 GMT+01:00 Andrew Turner : > Won=E2=80=99t this lead to a NULL pointer dereference on overflow? malloc= array can return NULL even with M_WAITOK. Yes, it will, but an overflow shouldn't happen in the first place. ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an overflow would happen, this would cause a kernel panic due to a NULL pointer dereference later on, which is likely easier to debug than some piece of code that overruns a buffer. In this case, mallocarray() is preferred, because it makes it more obvious that we're allocating a buffer that is accessed as an array, as opposed to single structure. --=20 Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands From owner-svn-src-all@freebsd.org Mon Jan 8 15:29:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF9A2E72825 for ; Mon, 8 Jan 2018 15:29:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic304-35.consmr.mail.ne1.yahoo.com (sonic304-35.consmr.mail.ne1.yahoo.com [66.163.191.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2D1180157 for ; Mon, 8 Jan 2018 15:29:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515425343; bh=qCWPCvfC/NeNLjWqtNypZ1SEfRSYmXmJgxGyeOsPIyE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=K00ALrq6Qvc9AI3VNFKA/7MBdX2BsnoCYgPnVeoHdRR9uKBa0RvJgLESrCCM23NRQ5hJVl+dkfnb1LY3jeQ0Un1j/9GR19eW5DuK5Tll62ZJeWnURqUQ+uMZwOXhXlQqa52lO1wKJDJF45dEs5fvrzsTPW2+wlrJx+ZA5leoTi/m16MgP2fkhr+YGk9EF4HMv7vXqgjuJN+yzDiYW5IIOGgKMTOL3jol9iy31y8dq5aRXxPldBBn6oh615XLvE+ZsBwt8C+kUN5urPaKGqw5vEbWU+RhWs+X20eMtfzj3P4nML7BEytX/6hlRzebDt67aaK6n+K6BkB7ITsdAzbajw== X-YMail-OSG: fpEclCYVM1n7ws2ySi7L7Bhb7n4shomKURrrQznn_oOW8JEjSJUpAq_fzixQD2x w0u1lS3spC03zSwI6bHl1EDwuqVFaC0k3a9V.8Ybo0HDlcwhbX.tqSeDWPLoPXxZnRY8wL2awZgE Aq66IFfdDYubDicP6AjcOHyea3hj0On2U8JvDFCDOBcjzu6J.KgpJmDcCVGyuKnXSmJN..2szVpQ CmZtYnONDEJGtgTt9o3aGa6Zggrjop4PhTwiI7CdJ3UzieLomWfcKQhNtjJlge39Vta9Otl_oDRw jKPNCxYQme_7duPx02klzCj2P703RzWBPB8jouPjXQ57DNZuABAIsdxsFoP0O2r.x6sdk_wVOqpv m.3Z2WZ66LPdkBHz8F.uPqjRHJAzMzoiPPQ.XR0VTB4GGobk44nK17q0faUC0_7MO.YXgi3D.xGt lrOXISuUlHW1OxIBOmB2gzSG2rBj9wucvY_Gg5F0BZZilqqdc8V.IUQttuY_6QVltewMYuAXM Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Mon, 8 Jan 2018 15:29:03 +0000 Received: from smtpgate103.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([216.155.193.162]) by smtp414.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID f4ea58c48869a7f2ae5062e2c9ea97de; Mon, 08 Jan 2018 15:08:47 +0000 (UTC) Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 To: Andrew Turner , Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <191085f4-3496-e063-474f-3193a3188275@FreeBSD.org> Date: Mon, 8 Jan 2018 10:08:47 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:29:05 -0000 Hi; On 08/01/2018 02:37, Andrew Turner wrote: >> On 7 Jan 2018, at 22:38, Ed Schouten wrote: >> >> Author: ed >> Date: Sun Jan 7 22:38:45 2018 >> New Revision: 327684 >> URL: https://svnweb.freebsd.org/changeset/base/327684 >> >> Log: >> Use mallocarray(9) in CloudABI kernel code where possible. >> >> Submitted by: pfg@ >> >> Modified: >> head/sys/compat/cloudabi32/cloudabi32_sock.c >> head/sys/compat/cloudabi64/cloudabi64_sock.c >> >> Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c >> ============================================================================== >> --- head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 22:21:07 2018 (r327683) >> +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Jan 7 22:38:45 2018 (r327684) >> @@ -60,7 +60,7 @@ cloudabi32_sys_sock_recv(struct thread *td, >> /* Convert iovecs to native format. */ >> if (ri.ri_data_len > UIO_MAXIOV) >> return (EINVAL); >> - iov = malloc(ri.ri_data_len * sizeof(struct iovec), >> + iov = mallocarray(ri.ri_data_len, sizeof(struct iovec), >> M_SOCKET, M_WAITOK); > Won’t this lead to a NULL pointer dereference on overflow? mallocarray can return NULL even with M_WAITOK. I think you are right: for the M_WAITOK case we should do the check outside the malloc. Compilers and static checkers should be giving out a warning since mallocarray() has the __result_use_check attribute (is that working!?). In the case of malloc(9) we should remove the attribute since we can by using M_WAITOK. And yes, this patch should be reverted. Pedro. From owner-svn-src-all@freebsd.org Mon Jan 8 15:37:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25880E72FC9 for ; Mon, 8 Jan 2018 15:37:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic304-35.consmr.mail.ne1.yahoo.com (sonic304-35.consmr.mail.ne1.yahoo.com [66.163.191.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC165808A5 for ; Mon, 8 Jan 2018 15:37:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515425864; bh=4cazRHlfbyA+0ug4ZwsxSG7jbOfiBLQTLjefHHmXOc0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=D5pftbG52co1bqUuUQz4atjrKX/EwnBAEKVW0F8XKcJnaCIc12v+nnwp+LfqiJvV/wKX6UryUPMU03mHqXSeWY7HLsjnjDqCHgbgH4GLvi67zNpyRj/gt5M3uSm2sy+rNjXL4bjIQk903/L9SOKge4rlMHInh5amKMK6yztnPCvw3n49VgzJVtW+vg6A3vju4FlB/uriIqK+7NNbWIB3hvbEWwF8gWD3voE7KtoC7S5KseeQw0x80jThVgLR2h6n7ccwX6bzgVMpfJd9fE/JgMTLQB44r8VcGK24AykmB70BNoDI98JtnyApoHmElLdTHNCwxa9gNYNDwRQG9tTV6g== X-YMail-OSG: BCiWKAYVM1n8XErNf.XQW7lDpwoDCLHrJHxYWxTXYROPOdYcz_nB2ZZ9yPF6rm. vp0QHs7yabK4Gp.mEJ7OR0vNbisuiymlt_hcTkbkjiaTKR5Un6K4843IkC4GVXzFSC60.LxRnwx6 FTiA45l_Fz9EYKgIcFVJdeke.4W.0HKSrTO9KfTKB.bzuXgg.hRr2fpPeUVNwyQ0dfF1Q6PJbwH0 kK4iNmx21IScKtyNb4WEAmzm1szm8AoxFcJXlJytdlNM2ueOduhOOoYzNRTupzQJIqTw6J0RjHOp wO3I_MUGfIJrGHQua.V0Zrs9eesiffmh1Ddzq5VyMLXlgTOcWJI3aAbEAmpn.3cIe6VZuTYM6uTX PfJto5ElDEiumklfZ1R2o_NSjmBnU.v1y4AAmSxzHuZ7msw6VZG24Vp.Tpiiwg47GAGpmhT9vAE9 w9Eia857PZu8ZsI5rZ0VWpceJKaJKRZbquF_MmEEuzHp1Syd4rLXGnkdk9Aa5J3Lxh7Stihb. Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Mon, 8 Jan 2018 15:37:44 +0000 Received: from smtpgate105.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([216.155.193.135]) by smtp403.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 9d400679ba3fce3720889955d9c8c284; Mon, 08 Jan 2018 15:37:41 +0000 (UTC) Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 To: Ed Schouten , Andrew Turner Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> From: Pedro Giffuni Message-ID: <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> Date: Mon, 8 Jan 2018 10:37:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:37:46 -0000 On 01/08/18 10:13, Ed Schouten wrote: > Hi Andrew, > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : >> Won’t this lead to a NULL pointer dereference on overflow? mallocarray can return NULL even with M_WAITOK. > Yes, it will, but an overflow shouldn't happen in the first place. > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an > overflow would happen, this would cause a kernel panic due to a NULL > pointer dereference later on, which is likely easier to debug than > some piece of code that overruns a buffer. > > In this case, mallocarray() is preferred, because it makes it more > obvious that we're allocating a buffer that is accessed as an array, > as opposed to single structure. > OK... The behavior of mallocarray() somewhat inconsistent with malloc(9), realloc(9) and reallocf(9) but this is clearly documented., so we just assume the developer knows what he/she is doing :). Pedro. From owner-svn-src-all@freebsd.org Mon Jan 8 15:41:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4677DE73372; Mon, 8 Jan 2018 15:41:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224F380D62; Mon, 8 Jan 2018 15:41:50 +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 754A719ED; Mon, 8 Jan 2018 15:41:49 +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 w08FfnEG052773; Mon, 8 Jan 2018 15:41:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08Ffn7M052772; Mon, 8 Jan 2018 15:41:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801081541.w08Ffn7M052772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jan 2018 15:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327698 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 327698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:41:50 -0000 Author: markj Date: Mon Jan 8 15:41:49 2018 New Revision: 327698 URL: https://svnweb.freebsd.org/changeset/base/327698 Log: Release the queue lock before restarting the worker loop. Reported and tested by: pho MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Mon Jan 8 15:41:48 2018 (r327697) +++ head/sys/geom/mirror/g_mirror.c Mon Jan 8 15:41:49 2018 (r327698) @@ -1964,8 +1964,10 @@ g_mirror_worker(void *arg) continue; } } - if (g_mirror_event_first(sc) != NULL) + if (g_mirror_event_first(sc) != NULL) { + mtx_unlock(&sc->sc_queue_mtx); continue; + } sx_xunlock(&sc->sc_lock); MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:w1", timeout * hz); From owner-svn-src-all@freebsd.org Mon Jan 8 15:41:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A35D7E7336F; Mon, 8 Jan 2018 15:41:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8053D80D60; Mon, 8 Jan 2018 15:41:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C85C219EC; Mon, 8 Jan 2018 15:41:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08FfmBF052730; Mon, 8 Jan 2018 15:41:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08Ffmm0052729; Mon, 8 Jan 2018 15:41:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801081541.w08Ffmm0052729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 8 Jan 2018 15:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327697 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 327697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:41:49 -0000 Author: pfg Date: Mon Jan 8 15:41:48 2018 New Revision: 327697 URL: https://svnweb.freebsd.org/changeset/base/327697 Log: malloc(9): drop the __result_use_check attribute for the kernel allocator. The __result_use_check attribute was brought to the kernel malloc in r281203 for consistency with the userland malloc. For the case of the M_WAITOK flag, the kernel malloc(), realloc(), and reallocf() cannot return NULL so in that case the __result_use_check attribute makes no sense. We don't have any way of conditionalizing such attributes so just drop it. MFC after: 3 days Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Mon Jan 8 13:43:12 2018 (r327696) +++ head/sys/sys/malloc.h Mon Jan 8 15:41:48 2018 (r327697) @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags) - __malloc_like __result_use_check __alloc_size(1); + __malloc_like __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1) __alloc_size(2); @@ -187,7 +187,7 @@ void malloc_type_freed(struct malloc_type *type, unsig void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); void *realloc(void *addr, unsigned long size, struct malloc_type *type, - int flags) __result_use_check __alloc_size(2); + int flags) __alloc_size(2); void *reallocf(void *addr, unsigned long size, struct malloc_type *type, int flags) __alloc_size(2); From owner-svn-src-all@freebsd.org Mon Jan 8 15:54:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A986E73DF1; Mon, 8 Jan 2018 15:54:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D732481906; Mon, 8 Jan 2018 15:54:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 257B41BF9; Mon, 8 Jan 2018 15:54:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08FsUwN058394; Mon, 8 Jan 2018 15:54:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08FsUvX058393; Mon, 8 Jan 2018 15:54:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801081554.w08FsUvX058393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 8 Jan 2018 15:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327699 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 327699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:54:31 -0000 Author: pfg Date: Mon Jan 8 15:54:29 2018 New Revision: 327699 URL: https://svnweb.freebsd.org/changeset/base/327699 Log: Revert r327697: malloc(9): drop the __result_use_check attribute for the kernel allocator. My bad: __result_use_check just checks the for the general and we always want to make sure allocated memory is used, not only checked for nullness. Add it to reallocf since that was missing. Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags) - __malloc_like __alloc_size(1); + __malloc_like __result_use_check __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1) __alloc_size(2); @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type *type, unsig void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); void *realloc(void *addr, unsigned long size, struct malloc_type *type, - int flags) __alloc_size(2); + int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, unsigned long size, struct malloc_type *type, - int flags) __alloc_size(2); + int flags) __result_use_check __alloc_size(2); struct malloc_type *malloc_desc2type(const char *desc); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Mon Jan 8 15:56:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA7CE73FB7; Mon, 8 Jan 2018 15:56:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390D881AC0; Mon, 8 Jan 2018 15:56:42 +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 6DE821BFA; Mon, 8 Jan 2018 15:56:41 +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 w08Fufe7058539; Mon, 8 Jan 2018 15:56:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08FufTl058537; Mon, 8 Jan 2018 15:56:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801081556.w08FufTl058537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jan 2018 15:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327700 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 327700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:56:42 -0000 Author: markj Date: Mon Jan 8 15:56:40 2018 New Revision: 327700 URL: https://svnweb.freebsd.org/changeset/base/327700 Log: Sort and remove unneeded includes. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Mon Jan 8 15:54:29 2018 (r327699) +++ head/sys/geom/mirror/g_mirror.c Mon Jan 8 15:56:40 2018 (r327700) @@ -31,22 +31,22 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include -#include +#include #include #include +#include #include -#include +#include #include +#include +#include #include -#include -#include -#include + #include -#include -#include -#include #include FEATURE(geom_mirror, "GEOM mirroring support"); Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Mon Jan 8 15:54:29 2018 (r327699) +++ head/sys/geom/mirror/g_mirror_ctl.c Mon Jan 8 15:56:40 2018 (r327700) @@ -31,24 +31,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include #include #include -#include -#include -#include -#include #include -#include -#include -#include +#include +#include + #include #include -#include -#include #include - static struct g_mirror_softc * g_mirror_find_device(struct g_class *mp, const char *name) From owner-svn-src-all@freebsd.org Mon Jan 8 15:58:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D989E7410D for ; Mon, 8 Jan 2018 15:58:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic312-35.consmr.mail.ne1.yahoo.com (sonic312-35.consmr.mail.ne1.yahoo.com [66.163.191.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6CAD81C57 for ; Mon, 8 Jan 2018 15:58:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515427100; bh=yAzStCyWs8ONtL+8q4Nxb5AoFkj+V+evVoU8JrYSGVg=; h=Subject:From:To:References:Date:In-Reply-To:From:Subject; b=dmRX50hmw9xdaTe75Xu4xZafRYW6WvXZ0S38tg/U1oL1unOmhzIDQrR23xEPK24AVD/AiLYRlMrUHQHYtgCzGcRTy6TlRq3cNVenim6dnZtjgzfTrx6HSLAU0hnK+W+nwp+ntADCvKSO5P4EE5bkYDoYOXTvcQgIB7FFPiJ+OhoJ3Df6O1aQPQUeMpFyEmXHNQCrzvNMxak+3nhtqjtrj+stuUQFV7Xe6hENtFwo+TB/Mtw4BDJLO+kEAYLjgcWQ8rNa4J2UjZPwc3uwdLnUoBZhDw9jidzg/YnazxhVdykrcKWG3WOfvTItuQbCA6YzktiemlUx5BVcha7Lp6DW9A== X-YMail-OSG: KYFlW.YVM1mPY6R7By2zeBKxgkMBCj6pcYUIX541P0aXisX7lPJtQSVHjPl_2pu aNh6pMmI4s7ofI2SjR2gD4aoirJZGzHP9Pgy9ktESJXrFdeuaSqPHk5pn1eiB_Ro55aMhPQdVy7k XrdKSBtz0TeZndZS58dhxA029FjULHUDgXCTjRvtE2p6.F87e4dJK58nmE5wGQMVlXiPRWsyUB.4 UL_Y9TRtuVrE10fXXKLtXPaaBCERwDbz94WmQ9X0VwtBuQlWLOpq35RTcVKcgPNojMq58aRns_34 lI8y2eBT2q8Krk_B7g_rC3A36aOInTXQMHy0h9WxnrjAX2ESCp6uJzctEbMXKKPCdss_tcDsyG4z 5CUPqk77TfsTBcCGp8zllgKNHTnH1nFle3xOMghmjCQQ3UjShfZH97NeY7tdjImS_3Kx3xXXMWTD D3NJWkpq9P9a53QO9vfiTbKHyDrB98TiV0hoif3MKvGj7RcqKJsaW9sL5nJy_1N6BFqMBLbur Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Mon, 8 Jan 2018 15:58:20 +0000 Received: from smtpgate103.mail.ne1.yahoo.com (EHLO [192.168.0.6]) ([216.155.193.162]) by smtp401.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID ae7b781f65a9251b0c615b8e61e02acf; Mon, 08 Jan 2018 15:58:16 +0000 (UTC) Subject: Re: svn commit: r327697 - head/sys/sys From: Pedro Giffuni To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801081541.w08Ffmm0052729@repo.freebsd.org> Message-ID: Date: Mon, 8 Jan 2018 10:58:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801081541.w08Ffmm0052729@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 15:58:22 -0000 On 01/08/18 10:41, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Jan 8 15:41:48 2018 > New Revision: 327697 > URL: https://svnweb.freebsd.org/changeset/base/327697 > > Log: > malloc(9): drop the __result_use_check attribute for the kernel allocator. > > The __result_use_check attribute was brought to the kernel malloc in > r281203 for consistency with the userland malloc. > > For the case of the M_WAITOK flag, the kernel malloc(), realloc(), and > reallocf() cannot return NULL so in that case the __result_use_check > attribute makes no sense. Bah ... I misinterpreted the attribute (hate it when that happens) reverted in r327697, sorry for the code churn. Pedro. From owner-svn-src-all@freebsd.org Mon Jan 8 16:09:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E46D8E74A3C; Mon, 8 Jan 2018 16:09:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A005F824ED; Mon, 8 Jan 2018 16:09:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w08G99DU022352; Mon, 8 Jan 2018 08:09:09 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w08G9941022351; Mon, 8 Jan 2018 08:09:09 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327699 - head/sys/sys In-Reply-To: <201801081554.w08FsUvX058393@repo.freebsd.org> To: "Pedro F. Giffuni" Date: Mon, 8 Jan 2018 08:09:08 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 16:09:12 -0000 > Author: pfg > Date: Mon Jan 8 15:54:29 2018 > New Revision: 327699 > URL: https://svnweb.freebsd.org/changeset/base/327699 > > Log: > Revert r327697: > malloc(9): drop the __result_use_check attribute for the kernel allocator. > > My bad: __result_use_check just checks the for the general and we always > want to make sure allocated memory is used, not only checked for nullness. > > Add it to reallocf since that was missing. Please try not to combine a revert with an add, it makes it messy to try and figure out things in the future when only the svn log is being used to analyze stuff as digging in mail archives becomes painful. Revert, then commit the add standalone, is the better sequence in this type of situation. > > Modified: > head/sys/sys/malloc.h > > Modified: head/sys/sys/malloc.h > ============================================================================== > --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) > +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) > @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t > __alloc_size(1) __alloc_align(6); > void free(void *addr, struct malloc_type *type); > void *malloc(unsigned long size, struct malloc_type *type, int flags) > - __malloc_like __alloc_size(1); > + __malloc_like __result_use_check __alloc_size(1); > void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, > int flags) __malloc_like __result_use_check > __alloc_size(1) __alloc_size(2); > @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type *type, unsig > void malloc_type_list(malloc_type_list_func_t *, void *); > void malloc_uninit(void *); > void *realloc(void *addr, unsigned long size, struct malloc_type *type, > - int flags) __alloc_size(2); > + int flags) __result_use_check __alloc_size(2); > void *reallocf(void *addr, unsigned long size, struct malloc_type *type, > - int flags) __alloc_size(2); > + int flags) __result_use_check __alloc_size(2); > > struct malloc_type *malloc_desc2type(const char *desc); > #endif /* _KERNEL */ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Jan 8 16:13:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4167E74FEE for ; Mon, 8 Jan 2018 16:13:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B25F782D1E for ; Mon, 8 Jan 2018 16:13:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id w188so14727956iod.10 for ; Mon, 08 Jan 2018 08:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=U2dO0pIfCdQu/wrL3eiThJHNpORugumxOOcai+t91Ao=; b=L86bI7P+kyp0LqV6YMiQ+YTEv8a4rDczkiL0jqGKT7983zkAbIXeflpwG/CLqK+TEN BzRuTNa2+KuaF8o5jjL9buJxYGB8udKyyqziVOfOB7oX2PS17RsCo3XCtRG1iS1XZfSE eGFotCJlNSoKvfsXM6t60+p9xAnDOWxA5kJrN3/2sjhBeAOA3vTc5tXbCCjvWpI1wpwL 4UaeJEhqVQ6Zdc10qtmErOKwzTDS1AKGEtRhZFLbr3Lw6+gm3jW4Lz6N5F7IGJdYFY/l oqpwEANhtwoSMoThcbcvqb6vn732rDe9AXR9MCOO5Ri1SKcCzng39pl056psCr1jtIzm Inqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=U2dO0pIfCdQu/wrL3eiThJHNpORugumxOOcai+t91Ao=; b=HCPEmccz/02U4Y4cl3Y0Vwnk13duvj/dj4LGCD33Kmfb01cV9l7P7HXB0JCvrMt4RW cummNar8EE0m56zO1+ANQvVEHlhsa3yioDh/p18sdGJIVCmnsP/NCOYfylwr6Qm1qZEx /RIZiK8yZ+HePOePPfNvVoFh34OI9XKlkR5JilzI/lv05hhbccp3kw+Qz8taVpNS26Ml 117y/Hs8R0DvG7ctGEDMESUlEBXv9qnBZsgSjrRXPemF3zL9wA3u2Was8HbQBkG8goLw EM0EdwLGo6QttaT/l1U+s9/A8Er2eVvzXiKo9Gk1Z8ZPwSsNh/prVDe0A0m60S4eW5g6 4nhw== X-Gm-Message-State: AKGB3mKq+ubk2fJ6W+mI/mntAgPE6sDH6lSWWyqD3ByF5swYiAwxb00j usiAUjNVSVw5gLKPhaglLByVfJyEiEHFcNrhX2UWnQ== X-Google-Smtp-Source: ACJfBos8I1+y5+c194BRf/4iuCmIysd4xsSPPVcrHvm4+Y6bEMTNquMhBzJbmlGemSIr7m2JAvabxw0JbWVL45FV9tI= X-Received: by 10.36.3.144 with SMTP id e138mr12011934ite.97.1515428027019; Mon, 08 Jan 2018 08:13:47 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Mon, 8 Jan 2018 08:13:46 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:a84a:1e5c:a3af:9943] Received: by 10.79.160.217 with HTTP; Mon, 8 Jan 2018 08:13:46 -0800 (PST) In-Reply-To: <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> From: Warner Losh Date: Mon, 8 Jan 2018 09:13:46 -0700 X-Google-Sender-Auth: 2GrbBeM6NyxWZTmwilXOd65Ynnw Message-ID: Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 To: Pedro Giffuni Cc: Ed Schouten , Andrew Turner , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 16:13:48 -0000 On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: On 01/08/18 10:13, Ed Schouten wrote: > Hi Andrew, > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > >> Won=E2=80=99t this lead to a NULL pointer dereference on overflow? mallo= carray >> can return NULL even with M_WAITOK. >> > Yes, it will, but an overflow shouldn't happen in the first place. > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an > overflow would happen, this would cause a kernel panic due to a NULL > pointer dereference later on, which is likely easier to debug than > some piece of code that overruns a buffer. > > In this case, mallocarray() is preferred, because it makes it more > obvious that we're allocating a buffer that is accessed as an array, > as opposed to single structure. > > OK... The behavior of mallocarray() somewhat inconsistent with malloc(9), realloc(9) and reallocf(9) but this is clearly documented., so we just assume the developer knows what he/she is doing :). This is one reason it didn't go in before... the error semantics suck... we re are a poor match for existing code. Warner From owner-svn-src-all@freebsd.org Mon Jan 8 16:18:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB7D5E75500 for ; Mon, 8 Jan 2018 16:18:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B9C383134 for ; Mon, 8 Jan 2018 16:18:36 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 84a4b9c7-f48f-11e7-8486-0934409070aa X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 84a4b9c7-f48f-11e7-8486-0934409070aa; Mon, 08 Jan 2018 16:18:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w08GISK5002547; Mon, 8 Jan 2018 09:18:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1515428308.44630.2.camel@freebsd.org> Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 From: Ian Lepore To: Warner Losh , Pedro Giffuni Cc: Ed Schouten , Andrew Turner , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 08 Jan 2018 09:18:28 -0700 In-Reply-To: References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 16:18:36 -0000 On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > > On 01/08/18 10:13, Ed Schouten wrote: > > > > > Hi Andrew, > > > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > > > > > > > Won¢t this lead to a NULL pointer dereference on overflow? mallocarray > > > can return NULL even with M_WAITOK. > > > > > Yes, it will, but an overflow shouldn't happen in the first place. > > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an > > overflow would happen, this would cause a kernel panic due to a NULL > > pointer dereference later on, which is likely easier to debug than > > some piece of code that overruns a buffer. > > > > In this case, mallocarray() is preferred, because it makes it more > > obvious that we're allocating a buffer that is accessed as an array, > > as opposed to single structure. > > > > OK... > The behavior of mallocarray() somewhat inconsistent with malloc(9), > realloc(9) and reallocf(9) but this is clearly documented., so we just > assume the developer knows what he/she is doing :). > > > This is one reason it didn't go in before... the error semantics suck... we > re are a poor match for existing code. > > Warner Yeah, having a bunch of functions with malloc in the name, all taking the same M_WAITOK flag, but that flag has different implications for calling code in regards to just one of the malloc functions... that's just a recipe for creating bugs.  It makes this whole function a bad idea. -- Ian From owner-svn-src-all@freebsd.org Mon Jan 8 16:29:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA269E75FDE; Mon, 8 Jan 2018 16:29:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CE0683C06; Mon, 8 Jan 2018 16:29:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x233.google.com with SMTP id w184so6657538qka.2; Mon, 08 Jan 2018 08:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Im9tOxLlSvn4x7toFrNKTqrwnJWBNtBzr8+nJnv26Ug=; b=NRdP5O7fMCKczxgMGYbEo94auOqhWq97hbwf9FoEsqiXCJbZh/pKPsOEGVHDRR8mag I42KSlw6Tdv9xKDC+kXYKXJ6iFtQDwUKHsvONZWLbWMu/XqWOzQ5Mn9r6XbSISqLdQNR oKf7wfJ5znbmkP5yRlBsbM9uSIhdp/rroTCankcT3FZagXzATg05oLxEOHfWY+cJC2ZL 1FYeDdsECV4jQlv9odUdQcnWq7URXbMqaS9QGcGuSTklWkBK+FsS2RZ/sj7hH8g4Ebke pG0HfhHeQslK9tOCD6/5ZJWkdgRBfkcUBoV5AumqV4BM5sECeYCN4pbA76knAtnZ/SB+ APZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Im9tOxLlSvn4x7toFrNKTqrwnJWBNtBzr8+nJnv26Ug=; b=ODHB3hc8oqDlRhyc1/sg53xIyiKYayXTTS+NBfmnq5z/t3SOgV9zvWOypiLpabIjJr CadESgf7kqDAujtAzfgwHOo+7hzTMDfymdI8/1HzKnLxLWRF810suNBQQDYQsLFw+GjS FUUZ2m0tVC6Q59QL/6stxGjW2vnNwZErojx36TMOuTmTZm48zF3EGyb+deyj63xS53vI E0ShYapwyrj3OB2wtrGmCqeWDlwlpKQ7qAvM7Zc3TKRgZkNAcPCPkL5ZB5rXqNyndme6 KxaDvCfijkWbSEzVPAMd9SFIEdAP5zgxhGuGt6cWyuL+Y1zMorOjG9c3GHTKEunmHKFI Ur7A== X-Gm-Message-State: AKwxytdUCOe+ph+92mycNeC4sKTzOPcN7QRGCOAT6vCdqDBFCg3FXf0n q7039yPC2niPrhfwruauamN4OOSd X-Google-Smtp-Source: ACJfBos+tSxR5x9fb7SUN8NXBIVAOgwBe/3uH6iF2UmdNo15o7Sy3ukER2R+aamjNIZu9qS2upNacA== X-Received: by 10.55.143.193 with SMTP id r184mr16078526qkd.193.1515428982259; Mon, 08 Jan 2018 08:29:42 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id m44sm7797504qtc.9.2018.01.08.08.29.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 08:29:41 -0800 (PST) Sender: Mark Johnston Date: Mon, 8 Jan 2018 11:29:38 -0500 From: Mark Johnston To: Ian Lepore Cc: Warner Losh , Pedro Giffuni , Ed Schouten , Andrew Turner , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 Message-ID: <20180108162938.GD2412@raichu> References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> <1515428308.44630.2.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1515428308.44630.2.camel@freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 16:29:44 -0000 On Mon, Jan 08, 2018 at 09:18:28AM -0700, Ian Lepore wrote: > On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > On 01/08/18 10:13, Ed Schouten wrote: > > > > > > > > Hi Andrew, > > > > > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > > > > > > > > > > Won’t this lead to a NULL pointer dereference on overflow? mallocarray > > > > can return NULL even with M_WAITOK. > > > > > > > Yes, it will, but an overflow shouldn't happen in the first place. > > > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an > > > overflow would happen, this would cause a kernel panic due to a NULL > > > pointer dereference later on, which is likely easier to debug than > > > some piece of code that overruns a buffer. > > > > > > In this case, mallocarray() is preferred, because it makes it more > > > obvious that we're allocating a buffer that is accessed as an array, > > > as opposed to single structure. > > > > > > OK... > > The behavior of mallocarray() somewhat inconsistent with malloc(9), > > realloc(9) and reallocf(9) but this is clearly documented., so we just > > assume the developer knows what he/she is doing :). > > > > > > This is one reason it didn't go in before... the error semantics suck... we > > re are a poor match for existing code. > > > > Warner > > Yeah, having a bunch of functions with malloc in the name, all taking > the same M_WAITOK flag, but that flag has different implications for > calling code in regards to just one of the malloc functions... contigmalloc(M_WAITOK) isn't guaranteed to succeed either. In that case, M_WAITOK just means "try harder to defragment physical memory in the request space before giving up." > that's just a recipe for creating bugs.  It makes this whole function a bad > idea. A NULL return value from mallocarray() indicates a bug in the caller. I don't see why it isn't preferable to crash quickly and loudly in that case. From owner-svn-src-all@freebsd.org Mon Jan 8 16:36:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A45E765F8; Mon, 8 Jan 2018 16:36:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD98E38C; Mon, 8 Jan 2018 16:36:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CEA2227A; Mon, 8 Jan 2018 16:36:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08GaXkk075694; Mon, 8 Jan 2018 16:36:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08GaXWC075691; Mon, 8 Jan 2018 16:36:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801081636.w08GaXWC075691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jan 2018 16:36:33 +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: r327701 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 327701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 16:36:35 -0000 Author: markj Date: Mon Jan 8 16:36:33 2018 New Revision: 327701 URL: https://svnweb.freebsd.org/changeset/base/327701 Log: MFC r322547: Add vm_page_alloc_after(). Modified: stable/11/sys/vm/vm_kern.c stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_page.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Mon Jan 8 15:56:40 2018 (r327700) +++ stable/11/sys/vm/vm_kern.c Mon Jan 8 16:36:33 2018 (r327701) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -329,7 +330,7 @@ int kmem_back(vm_object_t object, vm_offset_t addr, vm_size_t size, int flags) { vm_offset_t offset, i; - vm_page_t m; + vm_page_t m, mpred; int pflags; KASSERT(object == kmem_object || object == kernel_object, @@ -338,10 +339,13 @@ kmem_back(vm_object_t object, vm_offset_t addr, vm_siz offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; - VM_OBJECT_WLOCK(object); - for (i = 0; i < size; i += PAGE_SIZE) { + i = 0; retry: - m = vm_page_alloc(object, atop(offset + i), pflags); + VM_OBJECT_WLOCK(object); + mpred = vm_radix_lookup_le(&object->rtree, atop(offset + i)); + for (; i < size; i += PAGE_SIZE, mpred = m) { + m = vm_page_alloc_after(object, atop(offset + i), pflags, + mpred); /* * Ran out of space, free everything up and return. Don't need @@ -352,7 +356,6 @@ retry: VM_OBJECT_WUNLOCK(object); if ((flags & M_NOWAIT) == 0) { VM_WAIT; - VM_OBJECT_WLOCK(object); goto retry; } kmem_unback(object, addr, i); Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Mon Jan 8 15:56:40 2018 (r327700) +++ stable/11/sys/vm/vm_page.c Mon Jan 8 16:36:33 2018 (r327701) @@ -1583,15 +1583,32 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm vm_page_t vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) { - vm_page_t m, mpred; + + return (vm_page_alloc_after(object, pindex, req, object != NULL ? + vm_radix_lookup_le(&object->rtree, pindex) : NULL)); +} + +/* + * Allocate a page in the specified object with the given page index. To + * optimize insertion of the page into the object, the caller must also specifiy + * the resident page in the object with largest index smaller than the given + * page index, or NULL if no such page exists. + */ +vm_page_t +vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, int req, + vm_page_t mpred) +{ + vm_page_t m; int flags, req_class; - mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("vm_page_alloc: inconsistent object(%p)/req(%x)", object, req)); + ("inconsistent object(%p)/req(%x)", object, req)); + KASSERT(mpred == NULL || mpred->pindex < pindex, + ("mpred %p doesn't precede pindex 0x%jx", mpred, + (uintmax_t)pindex)); if (object != NULL) VM_OBJECT_ASSERT_WLOCKED(object); @@ -1606,12 +1623,6 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) req_class = VM_ALLOC_SYSTEM; - if (object != NULL) { - mpred = vm_radix_lookup_le(&object->rtree, pindex); - KASSERT(mpred == NULL || mpred->pindex != pindex, - ("vm_page_alloc: pindex already allocated")); - } - /* * Allocate a page if the number of free pages exceeds the minimum * for the request class. @@ -1658,7 +1669,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, /* * At this point we had better have found a good page. */ - KASSERT(m != NULL, ("vm_page_alloc: missing page")); + KASSERT(m != NULL, ("missing page")); vm_phys_freecnt_adj(m, -1); if ((m->flags & PG_ZERO) != 0) vm_page_zero_count--; @@ -3261,7 +3272,7 @@ int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count) { - vm_page_t m; + vm_page_t m, mpred; int i; bool sleep; @@ -3278,7 +3289,12 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin return (0); i = 0; retrylookup: - m = vm_page_lookup(object, pindex + i); + m = vm_radix_lookup_le(&object->rtree, pindex + i); + if (m == NULL || m->pindex != pindex + i) { + mpred = m; + m = NULL; + } else + mpred = TAILQ_PREV(m, pglist, listq); for (; i < count; i++) { if (m != NULL) { sleep = (allocflags & VM_ALLOC_IGN_SBUSY) != 0 ? @@ -3310,8 +3326,9 @@ retrylookup: if ((allocflags & VM_ALLOC_SBUSY) != 0) vm_page_sbusy(m); } else { - m = vm_page_alloc(object, pindex + i, (allocflags & - ~VM_ALLOC_IGN_SBUSY) | VM_ALLOC_COUNT(count - i)); + m = vm_page_alloc_after(object, pindex + i, + (allocflags & ~VM_ALLOC_IGN_SBUSY) | + VM_ALLOC_COUNT(count - i), mpred); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) break; @@ -3326,7 +3343,7 @@ retrylookup: pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; } - ma[i] = m; + ma[i] = mpred = m; m = vm_page_next(m); } return (i); Modified: stable/11/sys/vm/vm_page.h ============================================================================== --- stable/11/sys/vm/vm_page.h Mon Jan 8 15:56:40 2018 (r327700) +++ stable/11/sys/vm/vm_page.h Mon Jan 8 16:36:33 2018 (r327701) @@ -462,7 +462,8 @@ void vm_page_free_zero(vm_page_t m); void vm_page_activate (vm_page_t); void vm_page_advise(vm_page_t m, int advice); -vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t); vm_page_t vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); From owner-svn-src-all@freebsd.org Mon Jan 8 17:02:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9E1FE77CEF for ; Mon, 8 Jan 2018 17:02:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89AB02A08 for ; Mon, 8 Jan 2018 17:02:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id n14so15068977iob.4 for ; Mon, 08 Jan 2018 09:02:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=unTpTTy5P5yekblp+kxMeO/ogtZMPUK2fYnEk0u73O0=; b=XCecOU/uNDpaoqlC80WBaaJWOwROagFQdlQwNbJ3k199hnna+jKuknyX2ddmkHiIIL rk/b1EYpSA8xhZqcLJGO92tAqz8t7bAt9FNcLY6Om9q9yCfTStjvUVQYcI0PuFq3TOrl KtP7hS1DfRIQn7qdPSz9eMFkAjdGSLrDqP5bivbibrTO4G0lRXi11fW85oEBcRRp4JCy VxpRcD1Y5tRyxLrDvpQYdwCXVDYQoDofNxEnhcDq1D+H4VcRl5XNzGftdlIIu4axoDfZ JzSDqdQlVma+Y6H/xuio60MA3jwAD6qv+JQwr8XkftleWudWnbIrDVIkBSa9nRzTA9oX QAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=unTpTTy5P5yekblp+kxMeO/ogtZMPUK2fYnEk0u73O0=; b=N70JavB4zmLyYGvcE1s/KhXeG33PJuxam5M12VebUIvLRue6vmVXaD9Q28ldrW7AA8 0ur3KYvytzCfx9NGSIii23QBGaZAvpfn7J8UWyBSSlFlxYsowHR9l365kS6UdkwjTmQo nUmNoTxp+FQOFRUtMeZNpV5ZmbGF4olm3lZineXCVz0P/HNTjtO01g/g2lsXmZS8Ofo4 rRfa3Ned4YCNwN8uHkGqNxaBVxsXw1FFLz4M8sCDAVSWKcqrV2pMQ2kvnYFlsLyVFLOv TG1D6b2DxdkayfcOsmkEPeyKbc99+EJ0RZrSTI9jVvEdCm4NZYzpnEpC7reHWJMxF8FI suiA== X-Gm-Message-State: AKwxytfsm2Us5BtUjPeaxO4zI4VkgkdGFU9NT5HBP9rN3xnbOZJefWJF xYijlV7MAN467ae6De3UH34pvYaxY1HLFNOv7ox9iA== X-Google-Smtp-Source: ACJfBot5MLf47CGTojacU1hu8Zxwg3+gS8wBCrYqgTMujYBR8G0WRHXTK6o8VfSxKTZtihBNbnZ3Y4loIv1p23MJmz4= X-Received: by 10.36.91.210 with SMTP id g201mr8912782itb.50.1515430965869; Mon, 08 Jan 2018 09:02:45 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Mon, 8 Jan 2018 09:02:45 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180108162938.GD2412@raichu> References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> <0a6ad324-46f2-9270-5abd-dbc3e734cc8b@FreeBSD.org> <1515428308.44630.2.camel@freebsd.org> <20180108162938.GD2412@raichu> From: Warner Losh Date: Mon, 8 Jan 2018 10:02:45 -0700 X-Google-Sender-Auth: H2NfmkKECbc5gxtf5L3fpojOZjk Message-ID: Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 To: Mark Johnston Cc: Ian Lepore , Pedro Giffuni , Ed Schouten , Andrew Turner , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 17:02:46 -0000 On Mon, Jan 8, 2018 at 9:29 AM, Mark Johnston wrote: > On Mon, Jan 08, 2018 at 09:18:28AM -0700, Ian Lepore wrote: > > On Mon, 2018-01-08 at 09:13 -0700, Warner Losh wrote: > > > On Jan 8, 2018 8:37 AM, "Pedro Giffuni" wrote: > > > On 01/08/18 10:13, Ed Schouten wrote: > > > > > > > > > > > Hi Andrew, > > > > > > > > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > > > > > > > > > > > > > Won=E2=80=99t this lead to a NULL pointer dereference on overflow= ? > mallocarray > > > > > can return NULL even with M_WAITOK. > > > > > > > > > Yes, it will, but an overflow shouldn't happen in the first place. > > > > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if = an > > > > overflow would happen, this would cause a kernel panic due to a NUL= L > > > > pointer dereference later on, which is likely easier to debug than > > > > some piece of code that overruns a buffer. > > > > > > > > In this case, mallocarray() is preferred, because it makes it more > > > > obvious that we're allocating a buffer that is accessed as an array= , > > > > as opposed to single structure. > > > > > > > > OK... > > > The behavior of mallocarray() somewhat inconsistent with malloc(9), > > > realloc(9) and reallocf(9) but this is clearly documented., so we jus= t > > > assume the developer knows what he/she is doing :). > > > > > > > > > This is one reason it didn't go in before... the error semantics > suck... we > > > re are a poor match for existing code. > > > > > > Warner > > > > Yeah, having a bunch of functions with malloc in the name, all taking > > the same M_WAITOK flag, but that flag has different implications for > > calling code in regards to just one of the malloc functions... > > contigmalloc(M_WAITOK) isn't guaranteed to succeed either. In that case, > M_WAITOK just means "try harder to defragment physical memory in the > request space before giving up." > > > that's just a recipe for creating bugs. It makes this whole function a > bad > > idea. > > A NULL return value from mallocarray() indicates a bug in the caller. I > don't see why it isn't preferable to crash quickly and loudly in that > case. > When this came up before, people wanted a check_mallocarray(a, b) so they could centralize all the integer overflow knowledge in one place... Seems like we're creating ABIs that are more error prone than the problem we're trying to catch... Warner From owner-svn-src-all@freebsd.org Mon Jan 8 17:28:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16929E794AC; Mon, 8 Jan 2018 17:28:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFB146367D; Mon, 8 Jan 2018 17:28:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id B39975A9F15; Mon, 8 Jan 2018 17:28:50 +0000 (UTC) Date: Mon, 8 Jan 2018 17:28:50 +0000 From: Brooks Davis To: Ed Schouten Cc: Andrew Turner , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327684 - in head/sys/compat: cloudabi32 cloudabi64 Message-ID: <20180108172850.GI95035@spindle.one-eyed-alien.net> References: <201801072238.w07McjLP099234@repo.freebsd.org> <8D8CA434-2A87-44D9-AC27-5166802FBBC2@fubar.geek.nz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SUk9VBj82R8Xhb8H" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 17:28:53 -0000 --SUk9VBj82R8Xhb8H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 08, 2018 at 04:13:42PM +0100, Ed Schouten wrote: > Hi Andrew, >=20 > 2018-01-08 8:37 GMT+01:00 Andrew Turner : > > Won???t this lead to a NULL pointer dereference on overflow? mallocarra= y can return NULL even with M_WAITOK. >=20 > Yes, it will, but an overflow shouldn't happen in the first place. > ri_data_len is compared with UIO_MAXIOV a few lines above. Even if an > overflow would happen, this would cause a kernel panic due to a NULL > pointer dereference later on, which is likely easier to debug than > some piece of code that overruns a buffer. Given that the overflow is due to a bug, there's an argument we should panic rather than returning NULL even in the M_NOWAIT case so we produce a useful message in exactly the right place. -- Brooks --SUk9VBj82R8Xhb8H Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaU6pSAAoJEKzQXbSebgfAoBkH/1qw/k1rmZfSDF2NG9MK26VK iYSOYHlCQsy/H50X5a1QIeXWvWJvHPrctqS40i5l5R32lo9I9NEolAmEy2/TI2CW 9VlMG7zqQ9jPTtK0wbKg/rZtcxX4pSTRLRFnFNm0HDUzqqXCHUoJ/+7SRhYvnRkI ZXbgKm9XCKKyBAVazu1Cu1UmmwhUS30+xx6zxX1KVjFB8pgsk6ildJGEf7xp2sR8 VRmAyCKy3KW+1iqx4/BgSd1zuJIPbXU74fCSp/ueFKOkSPay6XktmgKzraeGzYh+ /hZXqIf444h/+QO1m+GYW862T8/fNom017D9xnl23F6yA5yLRaLyabLPMSdoAtY= =KNFw -----END PGP SIGNATURE----- --SUk9VBj82R8Xhb8H-- From owner-svn-src-all@freebsd.org Mon Jan 8 18:08:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D8FE7BBF1; Mon, 8 Jan 2018 18:08:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB1076A48F; Mon, 8 Jan 2018 18:08:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-x232.google.com with SMTP id q188so15567700iod.1; Mon, 08 Jan 2018 10:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vzmIsZVqzoC8kFyncDcqshvN9zlsRaDR3B2vkRk4KTU=; b=mBsMP1PPPm1YVByBbmFBN990pqVKFMSP7+RLr15gGJPw/nNgEsBbE4c5UmaNDohkWs 5FTm/vXsmFj6Id+CbUmKvw/8NUih+lh+3R55PUNnZDjCvf+aJ/ry2VTnX3XYrMRlquLJ DxTVnVRnepD6vLrXoZAZbv2re9URh6cyobUATh233QN+HySLccpTIM9gX8xX18ZBwnSC KYPxYSZ33/oAbii1EJXTu9OK6R/kVnVJF3N3E9A7eHFGDPvyATWezrPk+ATxDDcDSbUv M5l/GcCYXlLsxW/hwnpwQRv5aG+GdWWrG92uLyLRFkbK4Oew8chXHx+SfuRuzF82IePt 2ntQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vzmIsZVqzoC8kFyncDcqshvN9zlsRaDR3B2vkRk4KTU=; b=YXni+AX6ObE5uUHlhohw0IA6nIrXuSTehGaNBn62tP+q4xYzIENLjXOCydhICRZDK6 VCwvZhoNKmTO5oYo3qroW1CTN0w3PGH28by8dyfk3ZQNID03ZO23aG4LAHwokqPVe/by 38xSbapzhfcH2iK0l1jf51XvATHHTxoSobPRU1MTr89n6m9RpThpYQiBAcYHTvuoTsGY QNo5xqNjrSRd0lZkthKIazKuG0YGFRBagS5IXccwiHX1XdDmmUhCKzGHt2fVYFt/gD1y 83FnFlrc+CQZU3pljUUUTaznv00B7KPswnq0Wd7dvt7+0bWVn64oFHKC83/xbr9M48hq 0n/w== X-Gm-Message-State: AKGB3mK7mmKrj7sjxNzF8xUMMK1tCpb7jJyhKt2ONIWO7qFQblQqxnJe YvR6e1c51Qc3KdwnKCLx/6a81ncVy9zSQjpH2em9ERVW X-Google-Smtp-Source: ACJfBouIYKdvxerTQ5qC6SjOyrfgrnqjZKy681McOKVn4XjZoMEa9DiMp89Cz8/as2mzLGQyv+whV6osL8W5bby540Q= X-Received: by 10.36.47.207 with SMTP id j198mr12381787itj.119.1515434888913; Mon, 08 Jan 2018 10:08:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.15.193 with HTTP; Mon, 8 Jan 2018 10:08:08 -0800 (PST) In-Reply-To: <201801081541.w08Ffmm0052729@repo.freebsd.org> References: <201801081541.w08Ffmm0052729@repo.freebsd.org> From: Conrad Meyer Date: Mon, 8 Jan 2018 10:08:08 -0800 Message-ID: Subject: Re: svn commit: r327697 - head/sys/sys To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 18:08:10 -0000 Hi, Response inline. On Mon, Jan 8, 2018 at 7:41 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Jan 8 15:41:48 2018 > New Revision: 327697 > URL: https://svnweb.freebsd.org/changeset/base/327697 > > Log: > malloc(9): drop the __result_use_check attribute for the kernel allocator. > > The __result_use_check attribute was brought to the kernel malloc in > r281203 for consistency with the userland malloc. > > For the case of the M_WAITOK flag, the kernel malloc(), realloc(), and > reallocf() cannot return NULL so in that case the __result_use_check > attribute makes no sense. > > We don't have any way of conditionalizing such attributes so just drop it. Could we conditionalize the attribute using two different names and a macro that inspected the (typically) constant flags argument? Something like this: #define malloc(s, t, f) \ (__builtin_constant_p(f) && (f & M_WAITOK) != 0) ? _malloc_waitok(s, t, f) : _malloc(s, t, f) void *_malloc(...) __malloc_like __alloc_size(1); void *_malloc_waitok(...) __malloc_like __result_use_check __alloc_size(1); The two names would just be aliases, or one could invoke the other as an inline function. Best, Conrad From owner-svn-src-all@freebsd.org Mon Jan 8 18:44:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C32E7DF4F; Mon, 8 Jan 2018 18:44:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 638F36C532; Mon, 8 Jan 2018 18:44:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B90A3C16; Mon, 8 Jan 2018 18:44:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08IiaxV033486; Mon, 8 Jan 2018 18:44:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08Iia97033485; Mon, 8 Jan 2018 18:44:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801081844.w08Iia97033485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Jan 2018 18:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327703 - head/stand/mips/beri/boot2 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/stand/mips/beri/boot2 X-SVN-Commit-Revision: 327703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 18:44:37 -0000 Author: jhb Date: Mon Jan 8 18:44:36 2018 New Revision: 327703 URL: https://svnweb.freebsd.org/changeset/base/327703 Log: Define __dmadat after #include'ing ufsread.c. The __dmadat variable is a statically allocated I/O buffer. The type is declared in the ufsread.c source file and clang warns if a variable is defined before it's type is declared. Sponsored by: DARPA / AFRL Modified: head/stand/mips/beri/boot2/boot2.c Modified: head/stand/mips/beri/boot2/boot2.c ============================================================================== --- head/stand/mips/beri/boot2/boot2.c Mon Jan 8 18:42:40 2018 (r327702) +++ head/stand/mips/beri/boot2/boot2.c Mon Jan 8 18:44:36 2018 (r327703) @@ -118,8 +118,6 @@ static const unsigned char flags[NOPT] = { static const char *const dev_nm[] = {"dram", "cfi", "sdcard"}; static const u_int dev_nm_count = nitems(dev_nm); -static struct dmadat __dmadat; - static struct dsk { unsigned type; /* BOOTINFO_DEV_TYPE_x object type. */ uintptr_t unitptr; /* Unit number or pointer to object. */ @@ -149,9 +147,10 @@ static int dskread(void *, unsigned, unsigned); static int xputc(int); static int xgetc(int); - #define UFS_SMALL_CGBASE #include "ufsread.c" + +static struct dmadat __dmadat; static inline int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) From owner-svn-src-all@freebsd.org Mon Jan 8 18:46:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F16CE7E08A; Mon, 8 Jan 2018 18:46:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E36906C715; Mon, 8 Jan 2018 18:46:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9D263C17; Mon, 8 Jan 2018 18:46:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08IkAV7033599; Mon, 8 Jan 2018 18:46:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08IkApk033598; Mon, 8 Jan 2018 18:46:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801081846.w08IkApk033598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Jan 2018 18:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327704 - head/stand/mips/beri/loader X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/stand/mips/beri/loader X-SVN-Commit-Revision: 327704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 18:46:12 -0000 Author: jhb Date: Mon Jan 8 18:46:10 2018 New Revision: 327704 URL: https://svnweb.freebsd.org/changeset/base/327704 Log: Fix printf missing format variables warnings. Include the failing kernel file name for errors in beri_elf64_exec(). Sponsored by: DARPA / AFRL Modified: head/stand/mips/beri/loader/exec.c Modified: head/stand/mips/beri/loader/exec.c ============================================================================== --- head/stand/mips/beri/loader/exec.c Mon Jan 8 18:44:36 2018 (r327703) +++ head/stand/mips/beri/loader/exec.c Mon Jan 8 18:46:10 2018 (r327704) @@ -80,14 +80,14 @@ beri_elf64_exec(struct preloaded_file *fp) md = file_findmetadata(fp, MODINFOMD_ELFHDR); if (md == NULL) { - printf("%s: file_findmetadata failed\n"); + printf("%s: file_findmetadata failed\n", fp->f_name); return (EFTYPE); } ehdr = (Elf_Ehdr *)md->md_data; error = md_load64(fp->f_args, &mdp); if (error) { - printf("%s: md_load64 failed\n"); + printf("%s: md_load64 failed\n", fp->f_name); return (error); } From owner-svn-src-all@freebsd.org Mon Jan 8 18:47:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D90E7E262; Mon, 8 Jan 2018 18:47:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC1446C96E; Mon, 8 Jan 2018 18:47:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14DE83C1D; Mon, 8 Jan 2018 18:47:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08IlZnT033685; Mon, 8 Jan 2018 18:47:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08IlZ7F033684; Mon, 8 Jan 2018 18:47:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801081847.w08IlZ7F033684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Jan 2018 18:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327705 - head/stand/mips/beri/common X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/stand/mips/beri/common X-SVN-Commit-Revision: 327705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 18:47:37 -0000 Author: jhb Date: Mon Jan 8 18:47:35 2018 New Revision: 327705 URL: https://svnweb.freebsd.org/changeset/base/327705 Log: Use instead of and in boot code. In the freestanding boot compile environment, standard headers are not available. Curiously, only building with clang exposed this as compiles with external GCC still succeeded. Sponsored by: DARPA / AFRL Modified: head/stand/mips/beri/common/sdcard.c Modified: head/stand/mips/beri/common/sdcard.c ============================================================================== --- head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:46:10 2018 (r327704) +++ head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:47:35 2018 (r327705) @@ -33,8 +33,7 @@ #include #include -#include -#include +#include /* From owner-svn-src-all@freebsd.org Mon Jan 8 19:02:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD6FE59230 for ; Mon, 8 Jan 2018 19:02:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E65EE6D9D7 for ; Mon, 8 Jan 2018 19:02:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id b77so5483355itd.0 for ; Mon, 08 Jan 2018 11:02:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=RIaf12sFUpJVrwa1KFQE11SGUvvMkEGGgvsWdlkrxqw=; b=SMdqxwXlBlksJychW225RJeHBQjmUqLRzmOKNqvexmKRljMi0qXBvAnzDn+KNTgiC+ 1hAMwY2vF9m4g0AHZAVNFhNBwFR9EXKsWd5RjgW3wVdKFml0txFOjKaV6ERn9JwoIU96 H5+ECPX5asYsn/ACy7ZkNKiVuHPBfkk0II09NeeicoHZ3V1d+c2ZHYBWz9cPUAqqkhP1 wCQsLmagjMRQDfr+unCZfP7hPFVrYSG4PWMy8zs5DiWR451XAvdUNf2iZGSUdJtTWQ8A XI9dS/wvFKI/Csu6/wXQgVZEnXEXN2PyFiCEr3yQtrxs+OqOIjUDK/18pEifYcywgKcW r07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RIaf12sFUpJVrwa1KFQE11SGUvvMkEGGgvsWdlkrxqw=; b=DUVhQmCHjllEdR3hOxZBfMGbkvdzdt7MtOu8x9PwA2geDWOmPZeIkJ9HAxnhHuMMth bT/as76vZSSjrboTGqL9JDV7XiUli/dSssHsdCC9lgEcyMGXbQ0+Zvaf+qu7A/u5eKs8 g0ytUp+yejHhDbI8+xiEqyADkf9Gr86vJYQ1wdSk1Mvouahe/1ljIo3opXAZIHrR47xr shXkXzzTDGhTWm7SS9Sq6lPB6749ilrxxN8rTRjpT6rjusCFAMIsX9y76EP4pmOt6TRV sW5dTJE03GtbDWGHXaROQE4s8iiunClNba8gGNQNRzUzhfQ6XSaK3BkIK3DttYcFMdui 8Jog== X-Gm-Message-State: AKGB3mLeVmNx+xmHy0ylxNhAgwwNq29Df/l4zOHTX9/pSLL+RTctAQoU HU7v/8n5lMDCwDzYaGb94+4LF4cSRwkT8Wk7fqLoYQ== X-Google-Smtp-Source: ACJfBovjMjZdTdjyofvO5b2rBPBK6Xo7201Z18c/4/rvXjnhp5nexQpzu4zPjADphOI2hU+VqjpEJwbSf/UHmYDJPUo= X-Received: by 10.36.1.16 with SMTP id 16mr5920178itk.115.1515438130141; Mon, 08 Jan 2018 11:02:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Mon, 8 Jan 2018 11:02:09 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201801081847.w08IlZ7F033684@repo.freebsd.org> References: <201801081847.w08IlZ7F033684@repo.freebsd.org> From: Warner Losh Date: Mon, 8 Jan 2018 12:02:09 -0700 X-Google-Sender-Auth: G_NiX0Xu7iCpuPdpkPnQQzuty3U Message-ID: Subject: Re: svn commit: r327705 - head/stand/mips/beri/common To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 19:02:11 -0000 This should have been a nop... libsa specifically creates 'safe' headers for all the standard ones. Ah, libsa creates a perfectly fine stdint.h, but not a inttypes.h... Warner On Mon, Jan 8, 2018 at 11:47 AM, John Baldwin wrote: > Author: jhb > Date: Mon Jan 8 18:47:35 2018 > New Revision: 327705 > URL: https://svnweb.freebsd.org/changeset/base/327705 > > Log: > Use instead of and in boot code. > > In the freestanding boot compile environment, standard headers are not > available. Curiously, only building with clang exposed this as compiles > with external GCC still succeeded. > > Sponsored by: DARPA / AFRL > > Modified: > head/stand/mips/beri/common/sdcard.c > > Modified: head/stand/mips/beri/common/sdcard.c > ============================================================ > ================== > --- head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:46:10 2018 > (r327704) > +++ head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:47:35 2018 > (r327705) > @@ -33,8 +33,7 @@ > #include > #include > > -#include > -#include > +#include > > > /* > > From owner-svn-src-all@freebsd.org Mon Jan 8 20:08:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6933E5E129 for ; Mon, 8 Jan 2018 20:08:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-36.consmr.mail.gq1.yahoo.com (sonic302-36.consmr.mail.gq1.yahoo.com [98.137.68.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C14527136A for ; Mon, 8 Jan 2018 20:08:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515442088; bh=mUMIJf2mzkP+cCeDslERQ+/yADweFxTy/aJRum1lRbM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Tk4mpd8WhyhH4HiOp9YpAQk51OeoVyZmIGg5iWcBaa1fC9O2pMlRkvYmtWEw1Y871hSUmJwgbqYHfEy+VKd219xkZWnskDX9xHhTWFXjfm+yCBNDqeQTg8J4yVe0G/pQ769lQSnLGhyo9tw4LPAU4vNRrP1b6luL/B4FBRcW0D7zBD18VKgVQ5zUKRBV8V9tIqrxwPc9sn/7dhZLvDdeO4DJNDAWsVzrumpPDi+1re5UvqhYPZd4IIWRmok63WPeKWw/dL85VllfE2JgC+u+oGLJVvXqdGZGgtKMiG05urpoT6eT8gttOYnpN0jFrWk7s0BX3/t60Q4/WRav3327KQ== X-YMail-OSG: pPdtcRkVM1ms67vhmjHuuRBCOnLToajNqaerhKu6JvOl4ZquSbttYP.cf_nUMwc 55r2P5AOSdO3B0K3UH02_lGZ5zm3uy5z4NkESlgWujX27XrYxYqmgFjmWHAkDZNVZ8xHz9qBbmxY yC0AS9jQXIkfxiCWVoGYd5TRqj6lw1v6djJmEwTgMB39U2hufvX0c.QQggJL0yDwKDE_mdnkd1OB NqywQnGr4MHW8OGPUX8I.xUeEf.0j7BVBCzYRRJ1xWufK8cjHUyz7POlrbIgfE6jB3LvO8RzBC0Z ElWOq4wP5QeZaSJxoU84rs_D.UyCNHy_8oNUpeEkGaZiagKUu2EFGSX5HsIo6p7jSZBeHlgvHmIM 9lRM0V5V4TYNoVAxFeXbjza_ueSoOWMvGz5FGyco9.MpvyCzwWTo4Rgny0PagdOJkWZzlXeKzIDC NEBcgyt0EAV25kTYoyVrprQNOAk3naZfoKRJXVTdWIvpta6MHDk8bBQo_ZJw46frGJxeCwIGg Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jan 2018 20:08:08 +0000 Received: from smtp102.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.6]) ([216.39.57.211]) by smtp410.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID c1b5a2f9f5d40448375d855a6ae635ce; Mon, 08 Jan 2018 20:08:04 +0000 (UTC) Subject: Re: svn commit: r327697 - head/sys/sys To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801081541.w08Ffmm0052729@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <1665ddb4-64ad-5d01-902e-2a77a8f5b50c@FreeBSD.org> Date: Mon, 8 Jan 2018 15:08:04 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 20:08:16 -0000 Hi; On 08/01/2018 13:08, Conrad Meyer wrote: > Hi, > > Response inline. > > On Mon, Jan 8, 2018 at 7:41 AM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Jan 8 15:41:48 2018 >> New Revision: 327697 >> URL: https://svnweb.freebsd.org/changeset/base/327697 >> >> Log: >> malloc(9): drop the __result_use_check attribute for the kernel allocator. >> >> The __result_use_check attribute was brought to the kernel malloc in >> r281203 for consistency with the userland malloc. >> >> For the case of the M_WAITOK flag, the kernel malloc(), realloc(), and >> reallocf() cannot return NULL so in that case the __result_use_check >> attribute makes no sense. >> >> We don't have any way of conditionalizing such attributes so just drop it. > Could we conditionalize the attribute using two different names and a > macro that inspected the (typically) constant flags argument? > Something like this: > > #define malloc(s, t, f) \ > (__builtin_constant_p(f) && (f & M_WAITOK) != 0) ? > _malloc_waitok(s, t, f) : _malloc(s, t, f) > void *_malloc(...) __malloc_like __alloc_size(1); > void *_malloc_waitok(...) __malloc_like __result_use_check __alloc_size(1); > > The two names would just be aliases, or one could invoke the other as > an inline function. That would work but I completely misunderstood the GCC attribute. Quoting the GCC documentation: ____ warn_unused_result The warn_unused_result attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is useful for functions where not checking the result is either a security problem or always a bug, such as realloc. ____ Retrospectively, our attribute is badly named but it was very difficult to come up with a good name. Pedro. From owner-svn-src-all@freebsd.org Mon Jan 8 20:14:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38458E5E836; Mon, 8 Jan 2018 20:14:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 124A7718B0; Mon, 8 Jan 2018 20:14:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FC6D4B9D; Mon, 8 Jan 2018 20:14:17 +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 w08KEHVf071636; Mon, 8 Jan 2018 20:14:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08KEGv8071627; Mon, 8 Jan 2018 20:14:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801082014.w08KEGv8071627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 8 Jan 2018 20:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327706 - in head/sys: conf contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 20:14:18 -0000 Author: cem Date: Mon Jan 8 20:14:16 2018 New Revision: 327706 URL: https://svnweb.freebsd.org/changeset/base/327706 Log: Integrate zstd into the kernel Mock userspace headers and include mocked headers first in compilation command to inject kernel headers and override e.g., malloc(3) with malloc(9). Submitted by: allanjude Reviewed by: imp (earlier version), bapt (earlier version) Differential Revision: https://reviews.freebsd.org/D10407 Added: head/sys/contrib/zstd/lib/freebsd/ head/sys/contrib/zstd/lib/freebsd/stddef.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/stdint.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/stdio.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/stdlib.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/string.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h (contents, props changed) head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c (contents, props changed) Modified: head/sys/conf/files head/sys/conf/kern.pre.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 8 18:47:35 2018 (r327705) +++ head/sys/conf/files Mon Jan 8 20:14:16 2018 (r327706) @@ -626,6 +626,23 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional nga compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" +# Zstd +contrib/zstd/lib/freebsd/zstd_kmalloc.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/common/zstd_common.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/common/fse_decompress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/common/entropy_common.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/common/error_private.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/common/xxhash.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/fse_compress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/huf_compress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_double_fast.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_fast.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_lazy.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_ldm.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_opt.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_decompress.c standard compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/huf_decompress.c standard compile-with ${ZSTD_C} crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Jan 8 18:47:35 2018 (r327705) +++ head/sys/conf/kern.pre.mk Mon Jan 8 20:14:16 2018 (r327706) @@ -132,6 +132,9 @@ NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-missing-prototypes ${PROF} ${.IMPSRC} + # Common for dtrace / zfs CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas CDDL_CFLAGS+= -include $S/cddl/compat/opensolaris/sys/debug_compat.h Added: head/sys/contrib/zstd/lib/freebsd/stddef.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/stddef.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include "zstd_kfreebsd.h" Added: head/sys/contrib/zstd/lib/freebsd/stdint.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/stdint.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include "zstd_kfreebsd.h" Added: head/sys/contrib/zstd/lib/freebsd/stdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/stdio.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include "zstd_kfreebsd.h" Added: head/sys/contrib/zstd/lib/freebsd/stdlib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/stdlib.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include "zstd_kfreebsd.h" Added: head/sys/contrib/zstd/lib/freebsd/string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/string.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include "zstd_kfreebsd.h" Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2014-2015 Allan Jude + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef ZSTD_KFREEBSD_H +#define ZSTD_KFREEBSD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _KERNEL +#include /* size_t */ +#include /* memcpy, memset */ +#ifndef BUILDING_ZFS +#include /* ptrdiff_t */ +#endif +#include + +MALLOC_DECLARE(M_ZSTD); + +#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) +#define free(x) (free)((x), M_ZSTD) +/* in zstd's use of calloc, a is always 1 */ +#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZSTD_KFREEBSD_H */ Added: head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c Mon Jan 8 20:14:16 2018 (r327706) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2016-2017 Allan Jude + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +MALLOC_DEFINE(M_ZSTD, "zstd", "ZSTD Compressor"); From owner-svn-src-all@freebsd.org Mon Jan 8 20:18:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43B0E5EF20 for ; Mon, 8 Jan 2018 20:18:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-36.consmr.mail.gq1.yahoo.com (sonic302-36.consmr.mail.gq1.yahoo.com [98.137.68.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFBF471E6F for ; Mon, 8 Jan 2018 20:18:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515442733; bh=IXOnRaga6Kz0tUV0s9PivkXdauWg6Ns6jiUL+zpiKjg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=fe1oN27GNz4Q8jLFpMv6liZsN1fQOldICEdmoyxhhQ6TfXrnukr0b+LFiXl8VU6W6ckwHvHVS+oQ31qzEt7vtj11t1vk0NyYBTxJ5Bbm5CcoNrg582cKnReRUaGesselLnxO4VMw8j4lfXge3nkKQUyUxic4/rwiDScl/H9csBQGvkaaZANqwJrbgNQ/eB9qU7vTdmUF7T5YPWi1Vt2Z5DN5KQTs3oIkN5WkCVPAvh5eWyeY98rSHvaq/PxPAwJ9yhQ+seraAMponLVEQJNHBRh6Czpv2XpYYlJo24pN4fSM1sTVi0qpZw1B2FHenzzgy/C4l17VzuHbFnFveId8Ew== X-YMail-OSG: uD4CU.AVM1nUTsvejlLAS4b15.dXuUh8xP6euafbnd896MPdDkxo3J0XsVrMU0A ECJ2COnjqOvcP6MU_P5d9zYb6OEzoUJUV2_AegZOySxVY6jNPM18g5A0_91NSAA1L43RI3lNATpz jQP1dwCdWkTcf550gTeNKl8zkli6hhJk5hShJqu5zrLjzkxZ2hQ.4DTn_3GFrCaDoT2r0Rt0tW9l rlktlSuBLbrtxiYresnluiwXDTd.18SWO4bfNog3nUh.i5lm4Ql4g1i3pshLj36bcW7yLIdEKQOU C4eW8zQXXXUjIcYkBtr5kDC6SOm1AAOizwlTkRXO0v737HbkhDCDFD3UY7y9Q.KDOHRzLdI9._hK 7VqNQKb1CSzyRQeDuNt35cOxNELcMIZ4zCPbyESlgHPHbwaLDZUc5Sanb3G8qdxcIuWQj8QoJC1f zyo1x7.BuhNfDw5W9A64adp2elvq4Pg60hFTZGAqZs7DGblSp_9HBDSgn3jpIa1XCRhwrQ_E. Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jan 2018 20:18:53 +0000 Received: from smtp110.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.6]) ([216.39.57.225]) by smtp415.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 37dde62ddfb6676b2daab4b6d9436738; Mon, 08 Jan 2018 20:18:49 +0000 (UTC) Subject: Re: svn commit: r327699 - head/sys/sys To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Mon, 8 Jan 2018 15:18:50 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 20:18:54 -0000 On 08/01/2018 11:09, Rodney W. Grimes wrote: >> Author: pfg >> Date: Mon Jan 8 15:54:29 2018 >> New Revision: 327699 >> URL: https://svnweb.freebsd.org/changeset/base/327699 >> >> Log: >> Revert r327697: >> malloc(9): drop the __result_use_check attribute for the kernel allocator. >> >> My bad: __result_use_check just checks the for the general and we always >> want to make sure allocated memory is used, not only checked for nullness. >> >> Add it to reallocf since that was missing. > Please try not to combine a revert with an add, it makes it messy > to try and figure out things in the future when only the svn log > is being used to analyze stuff as digging in mail archives becomes > painful. > > Revert, then commit the add standalone, is the better sequence in > this type of situation. Not that any of this is defined in our committers guide but IMHO "svn revert" is just a tool, pretty much as "svn move" and "svn copy". The idea is to make a committers' life easier: making two commits for such a simple change is not "easier". In this case the change is rather consistent: I added __result_use_check to the three functions that needed it. The commit log is not only clear on why the revert happened but also explains the additional one line change. When I MFC it, I will merge both changes for repository consistency but the log will basically mention that I am adding __result_use_check to reallocf(). Pedro. >> Modified: >> head/sys/sys/malloc.h >> >> Modified: head/sys/sys/malloc.h >> ============================================================================== >> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) >> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) >> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t >> __alloc_size(1) __alloc_align(6); >> void free(void *addr, struct malloc_type *type); >> void *malloc(unsigned long size, struct malloc_type *type, int flags) >> - __malloc_like __alloc_size(1); >> + __malloc_like __result_use_check __alloc_size(1); >> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, >> int flags) __malloc_like __result_use_check >> __alloc_size(1) __alloc_size(2); >> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type *type, unsig >> void malloc_type_list(malloc_type_list_func_t *, void *); >> void malloc_uninit(void *); >> void *realloc(void *addr, unsigned long size, struct malloc_type *type, >> - int flags) __alloc_size(2); >> + int flags) __result_use_check __alloc_size(2); >> void *reallocf(void *addr, unsigned long size, struct malloc_type *type, >> - int flags) __alloc_size(2); >> + int flags) __result_use_check __alloc_size(2); >> >> struct malloc_type *malloc_desc2type(const char *desc); >> #endif /* _KERNEL */ >> >> Pedro. From owner-svn-src-all@freebsd.org Mon Jan 8 20:28:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D657EE5F8DA; Mon, 8 Jan 2018 20:28:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A65F3728F1; Mon, 8 Jan 2018 20:27:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f170.google.com with SMTP id z130so15986617ioe.13; Mon, 08 Jan 2018 12:27:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=eicwRyrtt8nnK8urFqWz+x5fXTQF6E0niTcCr2g8N4c=; b=HIXlU8tRNQBpYHK1NTH9HlHQ6vOCelYQ4+zKcGs33iQGkCFnOgedh2yPKh64HukQmx Ly3CNt8t1pjKr7Zc48Dz7/kVbhsu+g1JvTsqsiobhSxFFK2rZS4SyezJ+VCopJG2Q67v uyp6pNYg8fEth4iy7OVoG9zky2r+bbrttfv6yDQkOB6f7manKpU9D/ZB9Dvaj7KR37LP HNF75N1LFlj0XbkTd/iuQJpFfRPVeNgtP46ZQvrUR1b1RwetsNQa3y+j5ZA+C5OKn9YI a3s2y88npZGwYoa0+AzQFqWmDc5seGIHpoxXRbTrGZ1EQtkk4JJGUMX0XxdUuhMNWPN7 sAbQ== X-Gm-Message-State: AKGB3mITyh1feL5Acfv9YFk0i3Rkq2EOc27LWTnDTKCU3ICHMmB6GRum /HAsLcMDmPa/bJmRO7t57yvlrRp5 X-Google-Smtp-Source: ACJfBosEL/M5T9/a+cQreHvPIOjVorAhaviVOm1sYK3JKgvJqYfDUL/VYiq/qt3pXqSe5UpidBfIAg== X-Received: by 10.107.180.201 with SMTP id d192mr12086813iof.270.1515443279018; Mon, 08 Jan 2018 12:27:59 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id v19sm7566758ite.4.2018.01.08.12.27.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 12:27:58 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id p124so1904745ite.1; Mon, 08 Jan 2018 12:27:58 -0800 (PST) X-Received: by 10.36.7.65 with SMTP id f62mr13307198itf.75.1515443278518; Mon, 08 Jan 2018 12:27:58 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Mon, 8 Jan 2018 12:27:58 -0800 (PST) In-Reply-To: References: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Mon, 8 Jan 2018 12:27:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327699 - head/sys/sys To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 20:28:00 -0000 I'm (again, atypically) with rgrimes here. Revert has a specific meaning and shouldn't be used like this. Making a commit with the subject "Revert rXXX" that does more than just "svn revert rXXX" makes life harder for developers looking at code history after you. Making two separate commits for two different changes (revert, then add the annotation) is not burdensome. Best, Conrad On Mon, Jan 8, 2018 at 12:18 PM, Pedro Giffuni wrote: > > On 08/01/2018 11:09, Rodney W. Grimes wrote: >>> >>> Author: pfg >>> Date: Mon Jan 8 15:54:29 2018 >>> New Revision: 327699 >>> URL: https://svnweb.freebsd.org/changeset/base/327699 >>> >>> Log: >>> Revert r327697: >>> malloc(9): drop the __result_use_check attribute for the kernel >>> allocator. >>> My bad: __result_use_check just checks the for the general and we >>> always >>> want to make sure allocated memory is used, not only checked for >>> nullness. >>> Add it to reallocf since that was missing. >> >> Please try not to combine a revert with an add, it makes it messy >> to try and figure out things in the future when only the svn log >> is being used to analyze stuff as digging in mail archives becomes >> painful. >> >> Revert, then commit the add standalone, is the better sequence in >> this type of situation. > > > Not that any of this is defined in our committers guide but IMHO "svn > revert" is just a tool, pretty much as "svn move" and "svn copy". The idea > is to make a committers' life easier: making two commits for such a simple > change is not "easier". > > In this case the change is rather consistent: I added __result_use_check to > the three functions that needed it. > The commit log is not only clear on why the revert happened but also > explains the additional one line change. > > When I MFC it, I will merge both changes for repository consistency but the > log will basically mention that I am adding __result_use_check to > reallocf(). > > > Pedro. > >>> Modified: >>> head/sys/sys/malloc.h >>> >>> Modified: head/sys/sys/malloc.h >>> >>> ============================================================================== >>> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) >>> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) >>> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct >>> malloc_t >>> __alloc_size(1) __alloc_align(6); >>> void free(void *addr, struct malloc_type *type); >>> void *malloc(unsigned long size, struct malloc_type *type, int flags) >>> - __malloc_like __alloc_size(1); >>> + __malloc_like __result_use_check __alloc_size(1); >>> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, >>> int flags) __malloc_like __result_use_check >>> __alloc_size(1) __alloc_size(2); >>> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type >>> *type, unsig >>> void malloc_type_list(malloc_type_list_func_t *, void *); >>> void malloc_uninit(void *); >>> void *realloc(void *addr, unsigned long size, struct malloc_type >>> *type, >>> - int flags) __alloc_size(2); >>> + int flags) __result_use_check __alloc_size(2); >>> void *reallocf(void *addr, unsigned long size, struct malloc_type >>> *type, >>> - int flags) __alloc_size(2); >>> + int flags) __result_use_check __alloc_size(2); >>> struct malloc_type *malloc_desc2type(const char *desc); >>> #endif /* _KERNEL */ >>> >>> > > Pedro. > From owner-svn-src-all@freebsd.org Mon Jan 8 20:54:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4E7E6194E for ; Mon, 8 Jan 2018 20:54:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-37.consmr.mail.gq1.yahoo.com (sonic303-37.consmr.mail.gq1.yahoo.com [98.137.64.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B33527428B for ; Mon, 8 Jan 2018 20:54:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515444889; bh=iEC/mt6zffQ+/zwfu+XtNCn6QggpYN7DB0vLjNpx4Ws=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=V07PXJcfkm47eaik4k7gF2/SJIhHsM3H8TFJTxN2cltxnVgYRgddgxTUGULdVZkUCGVIUEZmefodoWZBuM0kF772ANCEmioQwuRtVrdrLZptUbG9gzDE0aaSM2FDe8GfpdUV//m3+saNpdk9jLdxvdrZYIHFEBtrMbAAa5sV3HHFVcz8vvWenum7IAt4RZxTHhivrU0a/h6yppyVX/fGxE5/jwYOwOjtcl9etmRuKGNCPbCN3kGb/cw/gz7z39Nk3rtKatVsr2hT/DR+UD/z+F9pywuZzlfs+VhfhdnESRlMQxznEY2euQYRrIVQB+ZRAlzA8mhzIxtcYxRGHVSnxg== X-YMail-OSG: 6.QGtxEVM1kQ1RUq5HhxbejaQEeRXzn8VKD6Sgy5vqN3tzwG8LY3iqyKk.ehc4x orCik4LmWzlB92KKOwD8ti8.0Ilpc7O88Fm.PJE58zC2JTh4FLRiGFDUpfq3kuV8MKasO3N7Yrc5 ZEMFzcaojYaYQN1Fb3GLYRch0Gg2GfzLXEZQion5NMvgzZ5hCH_3G62wf7z1s2kML6yQ0eMB3Hii BXemOhFxAxwUFzTWYdh1xCeAiv1XofxQA2kb57WYz0Cil.40n.rlxIurmZG4oqhIKzxsI1kLFJkj y6ikDan8z9VyOTyFE7o70HhqLbh64gW12yOPf449LbKySjvnjewvyAjDXfS4Ff7RnyhOb3qcpJnJ NSwJIz_p2GDVjQm8xiG8Fz8q2AXVAeS56Ywc3v9e73IdlHlADus0DHNseEP_JyVfmxWWA6wT._Bk TPes_0L.Hjq6YAJpi.Gx8rMmgKp2bmMLTF62SDNuZGrL.RIO.JWNMcwU075zG_d30ZOWRW3J. Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jan 2018 20:54:49 +0000 Received: from smtp110.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.6]) ([216.39.57.225]) by smtp403.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 281cf99df4003b4738c94627c89ec3de; Mon, 08 Jan 2018 20:54:44 +0000 (UTC) Subject: Re: svn commit: r327699 - head/sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <89964e3f-a982-f0e5-a7ff-9c13a5ebe61c@FreeBSD.org> Date: Mon, 8 Jan 2018 15:54:45 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 20:54:56 -0000 Hello; On 08/01/2018 15:27, Conrad Meyer wrote: > I'm (again, atypically) with rgrimes here. Revert has a specific > meaning and shouldn't be used like this. Making a commit with the > subject "Revert rXXX" that does more than just "svn revert rXXX" makes > life harder for developers looking at code history after you. Making > two separate commits for two different changes (revert, then add the > annotation) is not burdensome. > > Best, > Conrad Yeah, I understand where that comes from and I will take it into account for future commits, but I think it should be *documented* and not assume that everybody  thinks that is the way version control is supposed to be used. Pedro. > On Mon, Jan 8, 2018 at 12:18 PM, Pedro Giffuni wrote: >> On 08/01/2018 11:09, Rodney W. Grimes wrote: >>>> Author: pfg >>>> Date: Mon Jan 8 15:54:29 2018 >>>> New Revision: 327699 >>>> URL: https://svnweb.freebsd.org/changeset/base/327699 >>>> >>>> Log: >>>> Revert r327697: >>>> malloc(9): drop the __result_use_check attribute for the kernel >>>> allocator. >>>> My bad: __result_use_check just checks the for the general and we >>>> always >>>> want to make sure allocated memory is used, not only checked for >>>> nullness. >>>> Add it to reallocf since that was missing. >>> Please try not to combine a revert with an add, it makes it messy >>> to try and figure out things in the future when only the svn log >>> is being used to analyze stuff as digging in mail archives becomes >>> painful. >>> >>> Revert, then commit the add standalone, is the better sequence in >>> this type of situation. >> >> Not that any of this is defined in our committers guide but IMHO "svn >> revert" is just a tool, pretty much as "svn move" and "svn copy". The idea >> is to make a committers' life easier: making two commits for such a simple >> change is not "easier". >> >> In this case the change is rather consistent: I added __result_use_check to >> the three functions that needed it. >> The commit log is not only clear on why the revert happened but also >> explains the additional one line change. >> >> When I MFC it, I will merge both changes for repository consistency but the >> log will basically mention that I am adding __result_use_check to >> reallocf(). >> >> >> Pedro. >> >>>> Modified: >>>> head/sys/sys/malloc.h >>>> >>>> Modified: head/sys/sys/malloc.h >>>> >>>> ============================================================================== >>>> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) >>>> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) >>>> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct >>>> malloc_t >>>> __alloc_size(1) __alloc_align(6); >>>> void free(void *addr, struct malloc_type *type); >>>> void *malloc(unsigned long size, struct malloc_type *type, int flags) >>>> - __malloc_like __alloc_size(1); >>>> + __malloc_like __result_use_check __alloc_size(1); >>>> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, >>>> int flags) __malloc_like __result_use_check >>>> __alloc_size(1) __alloc_size(2); >>>> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type >>>> *type, unsig >>>> void malloc_type_list(malloc_type_list_func_t *, void *); >>>> void malloc_uninit(void *); >>>> void *realloc(void *addr, unsigned long size, struct malloc_type >>>> *type, >>>> - int flags) __alloc_size(2); >>>> + int flags) __result_use_check __alloc_size(2); >>>> void *reallocf(void *addr, unsigned long size, struct malloc_type >>>> *type, >>>> - int flags) __alloc_size(2); >>>> + int flags) __result_use_check __alloc_size(2); >>>> struct malloc_type *malloc_desc2type(const char *desc); >>>> #endif /* _KERNEL */ >>>> >>>> >> Pedro. >> From owner-svn-src-all@freebsd.org Mon Jan 8 21:09:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED4F4E626E9; Mon, 8 Jan 2018 21:09:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC10174D9B; Mon, 8 Jan 2018 21:09:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f41.google.com with SMTP id b77so5905020itd.0; Mon, 08 Jan 2018 13:09:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=UtIY/7oD1qfTcaZMU3aWih/Uu4InNUC3exw7PTOwpnQ=; b=qAvwdIZEtEhL9iiTFMrFtmvWQbbwI3mtle0x0qA65Ba1QePRJbmNB08aVV1C206Oxc BNlsrI3EW3jg5roOfgr6aQLbaaTQ71P35zVGYs+4FME+1zWM7pGOBn+2wWh78n46tkMt 50gQMTke1fDtDzPXbCrNod88EpWh43Z/ZoR+0xYu5VyDuCmLJ2BWsOKyZ8s52Bi50YgS 8sXLgRmN+JrMBebd3oMJIMR3r2Mf1Lc9sf067m8EePYJs3Bc/tmza+avtDoo+nZrZ14P sLH/cbhiZla+RatSvigWR6n93/+xRav+jbVPYUozBD+ElRCFqgXRvE/Qp1ht2XIdGHCi Rs8Q== X-Gm-Message-State: AKwxytdsIFRj0liZ3vbr0IYxDp5WjQcuneogYZeHNzJm0UlwWe0cL1cm WzSxUDks1QB3oD3OUj5SX1U89A0h X-Google-Smtp-Source: ACJfBouR3Tu89hnY0HZEL8oFEpdzsp/9/VjihhrDtlh7MXGqS1Tj1FlyS7tYT6++GmT5w5S/i4dtBQ== X-Received: by 10.36.79.132 with SMTP id c126mr5922694itb.45.1515445782952; Mon, 08 Jan 2018 13:09:42 -0800 (PST) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com. [209.85.223.176]) by smtp.gmail.com with ESMTPSA id p68sm7192688itc.26.2018.01.08.13.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 13:09:42 -0800 (PST) Received: by mail-io0-f176.google.com with SMTP id e20so16116976iof.12; Mon, 08 Jan 2018 13:09:42 -0800 (PST) X-Received: by 10.107.53.223 with SMTP id k92mr13296236ioo.38.1515445782501; Mon, 08 Jan 2018 13:09:42 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Mon, 8 Jan 2018 13:09:42 -0800 (PST) In-Reply-To: <89964e3f-a982-f0e5-a7ff-9c13a5ebe61c@FreeBSD.org> References: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> <89964e3f-a982-f0e5-a7ff-9c13a5ebe61c@FreeBSD.org> From: Conrad Meyer Date: Mon, 8 Jan 2018 13:09:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327699 - head/sys/sys To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 21:09:50 -0000 On Mon, Jan 8, 2018 at 12:54 PM, Pedro Giffuni wrote: > Yeah, I understand where that comes from and I will take it into account = for > future commits, but I think it should be *documented* and not assume that > everybody thinks that is the way version control is supposed to be used. If you want to document it somewhere, I don't think anyone will stop you. In general, we do have a bunch of unwritten guidelines that are either inferred from reading SVN log / source or explicitly requested via review (pre- or post-commit). I don't think it would hurt to document. I don't know if this specific topic is really a FreeBSD guideline or not, but it's a good practice when using any version control system. (You could do the same thing with 'git revert' =E2=80=94 make additions on = top of the revert commit =E2=80=94 and it would be equally a bad practice with that tool.) The only downsides I see are: 0. No one is interested in spending time writing this down and dealing with the inevitable bikeshedding, 1. Consensus may shift over time, and 2. People don't want to spend a ton of time reading rules Best, Conrad From owner-svn-src-all@freebsd.org Mon Jan 8 21:27:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A76D7E63A6A; Mon, 8 Jan 2018 21:27:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF2975EDA; Mon, 8 Jan 2018 21:27:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99C4B5771; Mon, 8 Jan 2018 21:27:42 +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 w08LRg0G001649; Mon, 8 Jan 2018 21:27:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08LRfqm001641; Mon, 8 Jan 2018 21:27:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801082127.w08LRfqm001641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jan 2018 21:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327707 - in head: share/man/man5 sys/conf sys/ddb sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man5 sys/conf sys/ddb sys/kern sys/sys X-SVN-Commit-Revision: 327707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Jan 2018 21:27:43 -0000 Author: markj Date: Mon Jan 8 21:27:41 2018 New Revision: 327707 URL: https://svnweb.freebsd.org/changeset/base/327707 Log: Generalize the gzio API. We currently use a set of subroutines in kern_gzio.c to perform compression of user and kernel core dumps. In the interest of adding support for other compression algorithms (zstd) in this role without complicating the API consumers, add a simple compressor API which can be used to select an algorithm. Also change the (non-default) GZIO kernel option to not enable compressed user cores by default. It's not clear that such a default would be desirable with support for multiple algorithms implemented, and it's inconsistent in that it isn't applied to kernel dumps. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D13632 Added: head/sys/kern/subr_compressor.c - copied, changed from r327706, head/sys/kern/kern_gzio.c head/sys/sys/compressor.h - copied, changed from r327706, head/sys/sys/gzio.h Deleted: head/sys/kern/kern_gzio.c head/sys/sys/gzio.h Modified: head/share/man/man5/core.5 head/sys/conf/files head/sys/ddb/db_textdump.c head/sys/kern/imgact_elf.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/sys/conf.h head/sys/sys/imgact.h Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Mon Jan 8 20:14:16 2018 (r327706) +++ head/share/man/man5/core.5 Mon Jan 8 21:27:41 2018 (r327707) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd October 5, 2015 +.Dd January 8, 2018 .Dt CORE 5 .Os .Sh NAME @@ -67,8 +67,8 @@ generating it). .Pp The following format specifiers may be used in the .Va kern.corefile -sysctl to insert additional information into the resulting core file -name: +sysctl to insert additional information into the resulting core +filename: .Bl -tag -width "1234567890" -compact -offset "12345" .It Em \&%H Machine hostname. @@ -108,17 +108,17 @@ is included in the kernel configuration file: GZIO .El .Pp -When the GZIO option is included, the following sysctls control whether core -files will be compressed: -.Bl -tag -width "kern.compress_user_cores_gzlevel" -compact -offset "12345" -.It Em kern.compress_user_cores_gzlevel -Gzip compression level. -Defaults to 6. +The following sysctl control core file compression: +.Bl -tag -width "kern.compress_user_cores_level" -compact -offset "12345" .It Em kern.compress_user_cores -Actually compress user cores. -Compressed core files will have a suffix of +Enable compression of user cores. +A value of 1 configures gzip compression. +gzip-compressed core files will have a suffix of .Ql .gz -appended to them. +appended to their filenames. +.It Em kern.compress_user_cores_level +Compression level. +Defaults to 6. .El .Sh NOTES Corefiles are written with open file descriptor information as an ELF note. @@ -153,6 +153,7 @@ command can be used: .Dl sysctl kern.corefile=/var/coredumps/\&%U/\&%N.core .Sh SEE ALSO .Xr gdb 1 , +.Xr gzip 1 , .Xr kgdb 1 , .Xr setrlimit 2 , .Xr sigaction 2 , Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 8 20:14:16 2018 (r327706) +++ head/sys/conf/files Mon Jan 8 21:27:41 2018 (r327707) @@ -3767,7 +3767,6 @@ kern/kern_exit.c standard kern/kern_fail.c standard kern/kern_ffclock.c standard kern/kern_fork.c standard -kern/kern_gzio.c optional gzio kern/kern_hhook.c standard kern/kern_idle.c standard kern/kern_intr.c standard @@ -3843,6 +3842,7 @@ kern/subr_bus_dma.c standard kern/subr_bufring.c standard kern/subr_capability.c standard kern/subr_clock.c standard +kern/subr_compressor.c standard kern/subr_counter.c standard kern/subr_devstat.c standard kern/subr_disk.c standard Modified: head/sys/ddb/db_textdump.c ============================================================================== --- head/sys/ddb/db_textdump.c Mon Jan 8 20:14:16 2018 (r327706) +++ head/sys/ddb/db_textdump.c Mon Jan 8 21:27:41 2018 (r327707) @@ -454,8 +454,8 @@ textdump_dumpsys(struct dumperinfo *di) /* * Disable EKCD because we don't provide encrypted textdumps. */ - kdc = di->kdc; - di->kdc = NULL; + kdc = di->kdcrypto; + di->kdcrypto = NULL; /* * Position the start of the dump so that we'll write the kernel dump @@ -512,7 +512,7 @@ textdump_dumpsys(struct dumperinfo *di) /* * Restore EKCD status. */ - di->kdc = kdc; + di->kdcrypto = kdc; } /*- Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Jan 8 20:14:16 2018 (r327706) +++ head/sys/kern/imgact_elf.c Mon Jan 8 21:27:41 2018 (r327707) @@ -36,13 +36,12 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include "opt_compat.h" -#include "opt_gzio.h" #include #include +#include #include #include -#include #include #include #include @@ -1185,9 +1184,12 @@ struct coredump_params { struct ucred *file_cred; struct thread *td; struct vnode *vp; - struct gzio_stream *gzs; + struct compressor *comp; }; +extern int compress_user_cores; +extern int compress_user_cores_level; + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static int core_write(struct coredump_params *, const void *, size_t, off_t, @@ -1219,9 +1221,6 @@ static void note_procstat_rlimit(void *, struct sbuf * static void note_procstat_umask(void *, struct sbuf *, size_t *); static void note_procstat_vmmap(void *, struct sbuf *, size_t *); -#ifdef GZIO -extern int compress_user_cores_gzlevel; - /* * Write out a core segment to the compression stream. */ @@ -1241,7 +1240,7 @@ compress_chunk(struct coredump_params *p, char *base, error = copyin(base, buf, chunk_len); if (error != 0) bzero(buf, chunk_len); - error = gzio_write(p->gzs, buf, chunk_len); + error = compressor_write(p->comp, buf, chunk_len); if (error != 0) break; base += chunk_len; @@ -1251,13 +1250,12 @@ compress_chunk(struct coredump_params *p, char *base, } static int -core_gz_write(void *base, size_t len, off_t offset, void *arg) +core_compressed_write(void *base, size_t len, off_t offset, void *arg) { return (core_write((struct coredump_params *)arg, base, len, offset, UIO_SYSSPACE)); } -#endif /* GZIO */ static int core_write(struct coredump_params *p, const void *base, size_t len, @@ -1275,10 +1273,9 @@ core_output(void *base, size_t len, off_t offset, stru { int error; -#ifdef GZIO - if (p->gzs != NULL) + if (p->comp != NULL) return (compress_chunk(p, base, tmpbuf, len)); -#endif + /* * EFAULT is a non-fatal error that we can get, for example, * if the segment is backed by a file but extends beyond its @@ -1323,11 +1320,9 @@ sbuf_drain_core_output(void *arg, const char *data, in locked = PROC_LOCKED(p->td->td_proc); if (locked) PROC_UNLOCK(p->td->td_proc); -#ifdef GZIO - if (p->gzs != NULL) - error = gzio_write(p->gzs, __DECONST(char *, data), len); + if (p->comp != NULL) + error = compressor_write(p->comp, __DECONST(char *, data), len); else -#endif error = core_write(p, __DECONST(void *, data), len, p->offset, UIO_SYSSPACE); if (locked) @@ -1362,11 +1357,7 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, struct note_info *ninfo; void *hdr, *tmpbuf; size_t hdrsize, notesz, coresize; -#ifdef GZIO - boolean_t compress; - compress = (flags & IMGACT_CORE_COMPRESS) != 0; -#endif hdr = NULL; tmpbuf = NULL; TAILQ_INIT(¬elst); @@ -1391,7 +1382,7 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, params.file_cred = NOCRED; params.td = td; params.vp = vp; - params.gzs = NULL; + params.comp = NULL; #ifdef RACCT if (racct_enable) { @@ -1409,18 +1400,17 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, goto done; } -#ifdef GZIO /* Create a compression stream if necessary. */ - if (compress) { - params.gzs = gzio_init(core_gz_write, GZIO_DEFLATE, - CORE_BUF_SIZE, compress_user_cores_gzlevel, ¶ms); - if (params.gzs == NULL) { + if (compress_user_cores != 0) { + params.comp = compressor_init(core_compressed_write, + compress_user_cores, CORE_BUF_SIZE, + compress_user_cores_level, ¶ms); + if (params.comp == NULL) { error = EFAULT; goto done; } tmpbuf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO); } -#endif /* * Allocate memory for building the header, fill it up, @@ -1446,10 +1436,8 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, offset += php->p_filesz; php++; } -#ifdef GZIO - if (error == 0 && compress) - error = gzio_flush(params.gzs); -#endif + if (error == 0 && params.comp != NULL) + error = compressor_flush(params.comp); } if (error) { log(LOG_WARNING, @@ -1458,13 +1446,9 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, } done: -#ifdef GZIO - if (compress) { - free(tmpbuf, M_TEMP); - if (params.gzs != NULL) - gzio_fini(params.gzs); - } -#endif + free(tmpbuf, M_TEMP); + if (params.comp != NULL) + compressor_fini(params.comp); while ((ninfo = TAILQ_FIRST(¬elst)) != NULL) { TAILQ_REMOVE(¬elst, ninfo, link); free(ninfo, M_TEMP); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Jan 8 20:14:16 2018 (r327706) +++ head/sys/kern/kern_shutdown.c Mon Jan 8 21:27:41 2018 (r327707) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_ekcd.h" -#include "opt_gzio.h" #include "opt_kdb.h" #include "opt_panic.h" #include "opt_sched.h" @@ -52,10 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include #include @@ -174,23 +173,21 @@ struct kerneldumpcrypto { }; #endif -#ifdef GZIO -struct kerneldumpgz { - struct gzio_stream *kdgz_stream; - uint8_t *kdgz_buf; - size_t kdgz_resid; +struct kerneldumpcomp { + struct compressor *kdc_stream; + uint8_t *kdc_buf; + size_t kdc_resid; }; -static struct kerneldumpgz *kerneldumpgz_create(struct dumperinfo *di, +static struct kerneldumpcomp *kerneldumpcomp_create(struct dumperinfo *di, uint8_t compression); -static void kerneldumpgz_destroy(struct dumperinfo *di); -static int kerneldumpgz_write_cb(void *cb, size_t len, off_t off, void *arg); +static void kerneldumpcomp_destroy(struct dumperinfo *di); +static int kerneldumpcomp_write_cb(void *base, size_t len, off_t off, void *arg); static int kerneldump_gzlevel = 6; SYSCTL_INT(_kern, OID_AUTO, kerneldump_gzlevel, CTLFLAG_RWTUN, &kerneldump_gzlevel, 0, - "Kernel crash dump gzip compression level"); -#endif /* GZIO */ + "Kernel crash dump compression level"); /* * Variable panicstr contains argument to first call to panic; used as flag @@ -986,39 +983,37 @@ kerneldumpcrypto_dumpkeysize(const struct kerneldumpcr } #endif /* EKCD */ -#ifdef GZIO -static struct kerneldumpgz * -kerneldumpgz_create(struct dumperinfo *di, uint8_t compression) +static struct kerneldumpcomp * +kerneldumpcomp_create(struct dumperinfo *di, uint8_t compression) { - struct kerneldumpgz *kdgz; + struct kerneldumpcomp *kdcomp; if (compression != KERNELDUMP_COMP_GZIP) return (NULL); - kdgz = malloc(sizeof(*kdgz), M_DUMPER, M_WAITOK | M_ZERO); - kdgz->kdgz_stream = gzio_init(kerneldumpgz_write_cb, GZIO_DEFLATE, - di->maxiosize, kerneldump_gzlevel, di); - if (kdgz->kdgz_stream == NULL) { - free(kdgz, M_DUMPER); + kdcomp = malloc(sizeof(*kdcomp), M_DUMPER, M_WAITOK | M_ZERO); + kdcomp->kdc_stream = compressor_init(kerneldumpcomp_write_cb, + COMPRESS_GZIP, di->maxiosize, kerneldump_gzlevel, di); + if (kdcomp->kdc_stream == NULL) { + free(kdcomp, M_DUMPER); return (NULL); } - kdgz->kdgz_buf = malloc(di->maxiosize, M_DUMPER, M_WAITOK | M_NODUMP); - return (kdgz); + kdcomp->kdc_buf = malloc(di->maxiosize, M_DUMPER, M_WAITOK | M_NODUMP); + return (kdcomp); } static void -kerneldumpgz_destroy(struct dumperinfo *di) +kerneldumpcomp_destroy(struct dumperinfo *di) { - struct kerneldumpgz *kdgz; + struct kerneldumpcomp *kdcomp; - kdgz = di->kdgz; - if (kdgz == NULL) + kdcomp = di->kdcomp; + if (kdcomp == NULL) return; - gzio_fini(kdgz->kdgz_stream); - explicit_bzero(kdgz->kdgz_buf, di->maxiosize); - free(kdgz->kdgz_buf, M_DUMPER); - free(kdgz, M_DUMPER); + compressor_fini(kdcomp->kdc_stream); + explicit_bzero(kdcomp->kdc_buf, di->maxiosize); + free(kdcomp->kdc_buf, M_DUMPER); + free(kdcomp, M_DUMPER); } -#endif /* GZIO */ /* Registration of dumpers */ int @@ -1041,14 +1036,14 @@ set_dumper(struct dumperinfo *di, const char *devname, return (EBUSY); dumper = *di; dumper.blockbuf = NULL; - dumper.kdc = NULL; - dumper.kdgz = NULL; + dumper.kdcrypto = NULL; + dumper.kdcomp = NULL; if (encryption != KERNELDUMP_ENC_NONE) { #ifdef EKCD - dumper.kdc = kerneldumpcrypto_create(di->blocksize, encryption, - key, encryptedkeysize, encryptedkey); - if (dumper.kdc == NULL) { + dumper.kdcrypto = kerneldumpcrypto_create(di->blocksize, + encryption, key, encryptedkeysize, encryptedkey); + if (dumper.kdcrypto == NULL) { error = EINVAL; goto cleanup; } @@ -1065,7 +1060,6 @@ set_dumper(struct dumperinfo *di, const char *devname, } if (compression != KERNELDUMP_COMP_NONE) { -#ifdef GZIO /* * We currently can't support simultaneous encryption and * compression. @@ -1074,31 +1068,25 @@ set_dumper(struct dumperinfo *di, const char *devname, error = EOPNOTSUPP; goto cleanup; } - dumper.kdgz = kerneldumpgz_create(&dumper, compression); - if (dumper.kdgz == NULL) { + dumper.kdcomp = kerneldumpcomp_create(&dumper, compression); + if (dumper.kdcomp == NULL) { error = EINVAL; goto cleanup; } -#else - error = EOPNOTSUPP; - goto cleanup; -#endif } dumper.blockbuf = malloc(di->blocksize, M_DUMPER, M_WAITOK | M_ZERO); return (0); cleanup: #ifdef EKCD - if (dumper.kdc != NULL) { - explicit_bzero(dumper.kdc, sizeof(*dumper.kdc) + - dumper.kdc->kdc_dumpkeysize); - free(dumper.kdc, M_EKCD); + if (dumper.kdcrypto != NULL) { + explicit_bzero(dumper.kdcrypto, sizeof(*dumper.kdcrypto) + + dumper.kdcrypto->kdc_dumpkeysize); + free(dumper.kdcrypto, M_EKCD); } #endif -#ifdef GZIO - kerneldumpgz_destroy(&dumper); -#endif + kerneldumpcomp_destroy(&dumper); if (dumper.blockbuf != NULL) { explicit_bzero(dumper.blockbuf, dumper.blocksize); @@ -1168,7 +1156,7 @@ dump_encrypted_write(struct dumperinfo *di, void *virt int error; size_t nbytes; - kdc = di->kdc; + kdc = di->kdcrypto; while (length > 0) { nbytes = MIN(length, sizeof(buf)); @@ -1194,7 +1182,7 @@ dump_write_key(struct dumperinfo *di, off_t offset) { struct kerneldumpcrypto *kdc; - kdc = di->kdc; + kdc = di->kdcrypto; if (kdc == NULL) return (0); return (dump_write(di, kdc->kdc_dumpkey, 0, offset, @@ -1202,9 +1190,8 @@ dump_write_key(struct dumperinfo *di, off_t offset) } #endif /* EKCD */ -#ifdef GZIO static int -kerneldumpgz_write_cb(void *base, size_t length, off_t offset, void *arg) +kerneldumpcomp_write_cb(void *base, size_t length, off_t offset, void *arg) { struct dumperinfo *di; size_t resid, rlength; @@ -1227,12 +1214,11 @@ kerneldumpgz_write_cb(void *base, size_t length, off_t } resid = length - rlength; memmove(di->blockbuf, (uint8_t *)base + rlength, resid); - di->kdgz->kdgz_resid = resid; + di->kdcomp->kdc_resid = resid; return (EAGAIN); } return (_dump_append(di, base, 0, length)); } -#endif /* GZIO */ /* * Write a kerneldumpheader at the specified offset. The header structure is 512 @@ -1290,10 +1276,10 @@ dump_start(struct dumperinfo *di, struct kerneldumphea uint32_t keysize; #ifdef EKCD - int error = kerneldumpcrypto_init(di->kdc); + int error = kerneldumpcrypto_init(di->kdcrypto); if (error != 0) return (error); - keysize = kerneldumpcrypto_dumpkeysize(di->kdc); + keysize = kerneldumpcrypto_dumpkeysize(di->kdcrypto); #else keysize = 0; #endif @@ -1301,8 +1287,7 @@ dump_start(struct dumperinfo *di, struct kerneldumphea dumpextent = dtoh64(kdh->dumpextent); if (di->mediasize < SIZEOF_METADATA + dumpextent + 2 * di->blocksize + keysize) { -#ifdef GZIO - if (di->kdgz != NULL) { + if (di->kdcomp != NULL) { /* * We don't yet know how much space the compressed dump * will occupy, so try to use the whole swap partition @@ -1315,7 +1300,6 @@ dump_start(struct dumperinfo *di, struct kerneldumphea 2 * di->blocksize - keysize; kdh->dumpextent = htod64(dumpextent); } else -#endif return (E2BIG); } @@ -1333,7 +1317,7 @@ _dump_append(struct dumperinfo *di, void *virtual, vm_ int error; #ifdef EKCD - if (di->kdc != NULL) + if (di->kdcrypto != NULL) error = dump_encrypted_write(di, virtual, physical, di->dumpoff, length); else @@ -1353,18 +1337,16 @@ int dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, size_t length) { -#ifdef GZIO void *buf; - if (di->kdgz != NULL) { - /* Bounce through a buffer to avoid gzip CRC errors. */ + if (di->kdcomp != NULL) { + /* Bounce through a buffer to avoid CRC errors. */ if (length > di->maxiosize) return (EINVAL); - buf = di->kdgz->kdgz_buf; + buf = di->kdcomp->kdc_buf; memmove(buf, virtual, length); - return (gzio_write(di->kdgz->kdgz_stream, buf, length)); + return (compressor_write(di->kdcomp->kdc_stream, buf, length)); } -#endif return (_dump_append(di, virtual, physical, length)); } @@ -1399,20 +1381,19 @@ dump_finish(struct dumperinfo *di, struct kerneldumphe extent = dtoh64(kdh->dumpextent); #ifdef EKCD - keysize = kerneldumpcrypto_dumpkeysize(di->kdc); + keysize = kerneldumpcrypto_dumpkeysize(di->kdcrypto); #else keysize = 0; #endif -#ifdef GZIO - if (di->kdgz != NULL) { - error = gzio_flush(di->kdgz->kdgz_stream); + if (di->kdcomp != NULL) { + error = compressor_flush(di->kdcomp->kdc_stream); if (error == EAGAIN) { /* We have residual data in di->blockbuf. */ error = dump_write(di, di->blockbuf, 0, di->dumpoff, di->blocksize); - di->dumpoff += di->kdgz->kdgz_resid; - di->kdgz->kdgz_resid = 0; + di->dumpoff += di->kdcomp->kdc_resid; + di->kdcomp->kdc_resid = 0; } if (error != 0) return (error); @@ -1426,9 +1407,8 @@ dump_finish(struct dumperinfo *di, struct kerneldumphe kdh->parity = 0; kdh->parity = kerneldump_parity(kdh); - gzio_reset(di->kdgz->kdgz_stream); + compressor_reset(di->kdcomp->kdc_stream); } -#endif /* * Write kerneldump headers at the beginning and end of the dump extent. @@ -1471,7 +1451,7 @@ dump_init_header(const struct dumperinfo *di, struct k kdh->dumpextent = kdh->dumplength; kdh->dumptime = htod64(time_second); #ifdef EKCD - kdh->dumpkeysize = htod32(kerneldumpcrypto_dumpkeysize(di->kdc)); + kdh->dumpkeysize = htod32(kerneldumpcrypto_dumpkeysize(di->kdcrypto)); #else kdh->dumpkeysize = 0; #endif @@ -1482,10 +1462,8 @@ dump_init_header(const struct dumperinfo *di, struct k kdh->versionstring[dstsize - 2] = '\n'; if (panicstr != NULL) strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); -#ifdef GZIO - if (di->kdgz != NULL) + if (di->kdcomp != NULL) kdh->compression = KERNELDUMP_COMP_GZIP; -#endif kdh->parity = kerneldump_parity(kdh); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Jan 8 20:14:16 2018 (r327706) +++ head/sys/kern/kern_sig.c Mon Jan 8 21:27:41 2018 (r327707) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_gzio.h" #include "opt_ktrace.h" #include @@ -51,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3255,18 +3255,31 @@ SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLF #define GZ_SUFFIX ".gz" -#ifdef GZIO -static int compress_user_cores = 1; -SYSCTL_INT(_kern, OID_AUTO, compress_user_cores, CTLFLAG_RWTUN, - &compress_user_cores, 0, "Compression of user corefiles"); +int compress_user_cores = 0; -int compress_user_cores_gzlevel = 6; -SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_gzlevel, CTLFLAG_RWTUN, - &compress_user_cores_gzlevel, 0, "Corefile gzip compression level"); -#else -static int compress_user_cores = 0; -#endif +static int +sysctl_compress_user_cores(SYSCTL_HANDLER_ARGS) +{ + int error, val; + val = compress_user_cores; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (val != 0 && !compressor_avail(val)) + return (EINVAL); + compress_user_cores = val; + return (error); +} +SYSCTL_PROC(_kern, OID_AUTO, compress_user_cores, CTLTYPE_INT | CTLFLAG_RWTUN, + 0, sizeof(int), sysctl_compress_user_cores, "I", + "Enable compression of user corefiles (" __XSTRING(COMPRESS_GZIP) " = gzip)"); + +int compress_user_cores_level = 6; +SYSCTL_INT(_kern, OID_AUTO, compress_user_cores_level, CTLFLAG_RWTUN, + &compress_user_cores_level, 0, + "Corefile compression level"); + /* * Protect the access to corefilename[] by allproc_lock. */ @@ -3363,7 +3376,7 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, } sx_sunlock(&corefilename_lock); free(hostname, M_TEMP); - if (compress) + if (compress == COMPRESS_GZIP) sbuf_printf(&sb, GZ_SUFFIX); if (sbuf_error(&sb) != 0) { log(LOG_ERR, "pid %ld (%s), uid (%lu): corename is too " @@ -3529,8 +3542,7 @@ coredump(struct thread *td) PROC_UNLOCK(p); if (p->p_sysent->sv_coredump != NULL) { - error = p->p_sysent->sv_coredump(td, vp, limit, - compress_user_cores ? IMGACT_CORE_COMPRESS : 0); + error = p->p_sysent->sv_coredump(td, vp, limit, 0); } else { error = ENOSYS; } Copied and modified: head/sys/kern/subr_compressor.c (from r327706, head/sys/kern/kern_gzio.c) ============================================================================== --- head/sys/kern/kern_gzio.c Mon Jan 8 20:14:16 2018 (r327706, copy source) +++ head/sys/kern/subr_compressor.c Mon Jan 8 21:27:41 2018 (r327707) @@ -1,6 +1,8 @@ /*- - * Copyright (c) 2014 Mark Johnston + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2014, 2017 Mark Johnston + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: @@ -24,56 +26,88 @@ * SUCH DAMAGE. */ +/* + * Subroutines used for writing compressed user process and kernel core dumps. + */ + #include __FBSDID("$FreeBSD$"); +#include "opt_gzio.h" + #include -#include +#include #include +#include #include -#include -#define KERN_GZ_HDRLEN 10 /* gzip header length */ -#define KERN_GZ_TRAILERLEN 8 /* gzip trailer length */ -#define KERN_GZ_MAGIC1 0x1f /* first magic byte */ -#define KERN_GZ_MAGIC2 0x8b /* second magic byte */ +MALLOC_DEFINE(M_COMPRESS, "compressor", "kernel compression subroutines"); -MALLOC_DEFINE(M_GZIO, "gzio", "zlib state"); +struct compressor_methods { + int format; + void *(* const init)(size_t, int); + void (* const reset)(void *); + int (* const write)(void *, void *, size_t, compressor_cb_t, void *); + void (* const fini)(void *); +}; -struct gzio_stream { - uint8_t * gz_buffer; /* output buffer */ - size_t gz_bufsz; /* total buffer size */ +struct compressor { + const struct compressor_methods *methods; + compressor_cb_t cb; + void *priv; + void *arg; +}; + +SET_DECLARE(compressors, struct compressor_methods); + +#ifdef GZIO + +#include + +struct gz_stream { + uint8_t *gz_buffer; /* output buffer */ + size_t gz_bufsz; /* output buffer size */ off_t gz_off; /* offset into the output stream */ - enum gzio_mode gz_mode; /* stream mode */ uint32_t gz_crc; /* stream CRC32 */ - gzio_cb gz_cb; /* output callback */ - void * gz_arg; /* private callback arg */ z_stream gz_stream; /* zlib state */ }; -static void * gz_alloc(void *, u_int, u_int); -static void gz_free(void *, void *); -static int gz_write(struct gzio_stream *, void *, u_int, int); +static void *gz_init(size_t maxiosize, int level); +static void gz_reset(void *stream); +static int gz_write(void *stream, void *data, size_t len, compressor_cb_t, + void *); +static void gz_fini(void *stream); -struct gzio_stream * -gzio_init(gzio_cb cb, enum gzio_mode mode, size_t bufsz, int level, void *arg) +static void * +gz_alloc(void *arg __unused, u_int n, u_int sz) { - struct gzio_stream *s; - int error; - if (bufsz < KERN_GZ_HDRLEN) - return (NULL); - if (mode != GZIO_DEFLATE) - return (NULL); + /* + * Memory for zlib state is allocated using M_NODUMP since it may be + * used to compress a kernel dump, and we don't want zlib to attempt to + * compress its own state. + */ + return (malloc(n * sz, M_COMPRESS, M_WAITOK | M_ZERO | M_NODUMP)); +} - s = gz_alloc(NULL, 1, sizeof(*s)); - s->gz_bufsz = bufsz; - s->gz_buffer = gz_alloc(NULL, 1, s->gz_bufsz); - s->gz_mode = mode; - s->gz_cb = cb; - s->gz_arg = arg; +static void +gz_free(void *arg __unused, void *ptr) +{ + free(ptr, M_COMPRESS); +} + +static void * +gz_init(size_t maxiosize, int level) +{ + struct gz_stream *s; + int error; + + s = gz_alloc(NULL, 1, roundup2(sizeof(*s), PAGE_SIZE)); + s->gz_buffer = gz_alloc(NULL, 1, maxiosize); + s->gz_bufsz = maxiosize; + s->gz_stream.zalloc = gz_alloc; s->gz_stream.zfree = gz_free; s->gz_stream.opaque = NULL; @@ -85,98 +119,57 @@ gzio_init(gzio_cb cb, enum gzio_mode mode, size_t bufs if (error != 0) goto fail; - gzio_reset(s); + gz_reset(s); return (s); fail: - gz_free(NULL, s->gz_buffer); gz_free(NULL, s); return (NULL); } -void -gzio_reset(struct gzio_stream *s) +static void +gz_reset(void *stream) { + struct gz_stream *s; uint8_t *hdr; + const size_t hdrlen = 10; - (void)deflateReset(&s->gz_stream); - + s = stream; s->gz_off = 0; s->gz_crc = ~0U; + (void)deflateReset(&s->gz_stream); s->gz_stream.avail_out = s->gz_bufsz; s->gz_stream.next_out = s->gz_buffer; /* Write the gzip header to the output buffer. */ hdr = s->gz_buffer; - memset(hdr, 0, KERN_GZ_HDRLEN); - hdr[0] = KERN_GZ_MAGIC1; - hdr[1] = KERN_GZ_MAGIC2; + memset(hdr, 0, hdrlen); + hdr[0] = 0x1f; + hdr[1] = 0x8b; hdr[2] = Z_DEFLATED; hdr[9] = OS_CODE; - s->gz_stream.next_out += KERN_GZ_HDRLEN; - s->gz_stream.avail_out -= KERN_GZ_HDRLEN; + s->gz_stream.next_out += hdrlen; + s->gz_stream.avail_out -= hdrlen; } -int -gzio_write(struct gzio_stream *s, void *data, u_int len) -{ - - return (gz_write(s, data, len, Z_NO_FLUSH)); -} - -int -gzio_flush(struct gzio_stream *s) -{ - - return (gz_write(s, NULL, 0, Z_FINISH)); -} - -void -gzio_fini(struct gzio_stream *s) -{ - - (void)deflateEnd(&s->gz_stream); - gz_free(NULL, s->gz_buffer); - gz_free(NULL, s); -} - -static void * -gz_alloc(void *arg __unused, u_int n, u_int sz) -{ - - /* - * Memory for zlib state is allocated using M_NODUMP since it may be - * used to compress a kernel dump, and we don't want zlib to attempt to - * compress its own state. - */ - return (malloc(n * sz, M_GZIO, M_WAITOK | M_ZERO | M_NODUMP)); -} - -static void -gz_free(void *arg __unused, void *ptr) -{ - - free(ptr, M_GZIO); -} - static int -gz_write(struct gzio_stream *s, void *buf, u_int len, int zflag) +gz_write(void *stream, void *data, size_t len, compressor_cb_t cb, + void *arg) { - uint8_t trailer[KERN_GZ_TRAILERLEN]; + struct gz_stream *s; + uint8_t trailer[8]; size_t room; - int error, zerror; + int error, zerror, zflag; - KASSERT(zflag == Z_FINISH || zflag == Z_NO_FLUSH, - ("unexpected flag %d", zflag)); - KASSERT(s->gz_mode == GZIO_DEFLATE, - ("invalid stream mode %d", s->gz_mode)); + s = stream; + zflag = data == NULL ? Z_FINISH : Z_NO_FLUSH; if (len > 0) { s->gz_stream.avail_in = len; - s->gz_stream.next_in = buf; - s->gz_crc = crc32_raw(buf, len, s->gz_crc); + s->gz_stream.next_in = data; + s->gz_crc = crc32_raw(data, len, s->gz_crc); } else s->gz_crc ^= ~0U; @@ -202,14 +195,13 @@ gz_write(struct gzio_stream *s, void *buf, u_int len, ((uint32_t *)trailer)[0] = s->gz_crc; ((uint32_t *)trailer)[1] = s->gz_stream.total_in; - room = MIN(KERN_GZ_TRAILERLEN, + room = MIN(sizeof(trailer), s->gz_bufsz - len); memcpy(s->gz_buffer + len, trailer, room); len += room; } - error = s->gz_cb(s->gz_buffer, len, s->gz_off, - s->gz_arg); + error = cb(s->gz_buffer, len, s->gz_off, arg); if (error != 0) break; @@ -221,13 +213,103 @@ gz_write(struct gzio_stream *s, void *buf, u_int len, * If we couldn't pack the trailer into the output * buffer, write it out now. */ - if (zerror == Z_STREAM_END && room < KERN_GZ_TRAILERLEN) - error = s->gz_cb(trailer + room, - KERN_GZ_TRAILERLEN - room, s->gz_off, - s->gz_arg); + if (zerror == Z_STREAM_END && room < sizeof(trailer)) + error = cb(trailer + room, + sizeof(trailer) - room, s->gz_off, arg); } } while (zerror != Z_STREAM_END && (zflag == Z_FINISH || s->gz_stream.avail_in > 0)); return (error); +} + +static void +gz_fini(void *stream) +{ + struct gz_stream *s; + + s = stream; + (void)deflateEnd(&s->gz_stream); + gz_free(NULL, s->gz_buffer); + gz_free(NULL, s); +} + +struct compressor_methods gzip_methods = { + .format = COMPRESS_GZIP, + .init = gz_init, + .reset = gz_reset, + .write = gz_write, + .fini = gz_fini, +}; +DATA_SET(compressors, gzip_methods); + +#endif /* GZIO */ + +bool +compressor_avail(int format) +{ + struct compressor_methods **iter; + + SET_FOREACH(iter, compressors) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 9 00:00:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744B0E6CBDE; Tue, 9 Jan 2018 00:00:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEC07BF6B; Tue, 9 Jan 2018 00:00:56 +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 916087000; Tue, 9 Jan 2018 00:00:55 +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 w0900twW068920; Tue, 9 Jan 2018 00:00:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0900t4Y068919; Tue, 9 Jan 2018 00:00:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801090000.w0900t4Y068919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 00:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327709 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 327709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 00:00:56 -0000 Author: scottl Date: Tue Jan 9 00:00:55 2018 New Revision: 327709 URL: https://svnweb.freebsd.org/changeset/base/327709 Log: Protect against a possible NULL deference from an accessor function. Obtained from: Netflix Modified: head/sys/cam/cam_periph.h Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Mon Jan 8 22:59:36 2018 (r327708) +++ head/sys/cam/cam_periph.h Tue Jan 9 00:00:55 2018 (r327709) @@ -202,7 +202,10 @@ int cam_periph_error(union ccb *ccb, cam_flags camfla static __inline struct mtx * cam_periph_mtx(struct cam_periph *periph) { - return (xpt_path_mtx(periph->path)); + if (periph != NULL) + return (xpt_path_mtx(periph->path)); + else + return (NULL); } #define cam_periph_owned(periph) \ From owner-svn-src-all@freebsd.org Tue Jan 9 00:11:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 780C0E6DA76; Tue, 9 Jan 2018 00:11:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5326D7C82E; Tue, 9 Jan 2018 00:11:00 +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 A739271AF; Tue, 9 Jan 2018 00:10:59 +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 w090Axab071499; Tue, 9 Jan 2018 00:10:59 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w090AxKX071496; Tue, 9 Jan 2018 00:10:59 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801090010.w090AxKX071496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 00:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327710 - in head/sys/cam: . ata scsi X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/cam: . ata scsi X-SVN-Commit-Revision: 327710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 00:11:00 -0000 Author: scottl Date: Tue Jan 9 00:10:59 2018 New Revision: 327710 URL: https://svnweb.freebsd.org/changeset/base/327710 Log: Don't hold the periph lock when calling into cam_periph_runccb() from the ada and da dump routines. This avoids difficult locking problems from needing to be handled. While it might seem like this would leave the periphs unprotected during dump, they were aleady at risk of unexpected removal due to the dump functions not keeping refcount state across the many calls that come in during a dump. This is an exercise for future work. Obtained from: Netflix Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jan 9 00:00:55 2018 (r327709) +++ head/sys/cam/ata/ata_da.c Tue Jan 9 00:10:59 2018 (r327710) @@ -1062,15 +1062,12 @@ adadump(void *arg, void *virtual, vm_offset_t physical dp = arg; periph = dp->d_drv1; softc = (struct ada_softc *)periph->softc; - cam_periph_lock(periph); secsize = softc->params.secsize; lba = offset / secsize; count = length / secsize; - if ((periph->flags & CAM_PERIPH_INVALID) != 0) { - cam_periph_unlock(periph); + if ((periph->flags & CAM_PERIPH_INVALID) != 0) return (ENXIO); - } memset(&ataio, 0, sizeof(ataio)); if (length > 0) { @@ -1098,7 +1095,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical if (error != 0) printf("Aborting dump due to I/O error.\n"); - cam_periph_unlock(periph); return (error); } @@ -1129,7 +1125,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); } - cam_periph_unlock(periph); return (error); } Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Jan 9 00:00:55 2018 (r327709) +++ head/sys/cam/cam_periph.c Tue Jan 9 00:10:59 2018 (r327710) @@ -1160,8 +1160,6 @@ cam_periph_runccb(union ccb *ccb, struct bintime ltime; int error; bool must_poll; - struct mtx *periph_mtx; - struct cam_periph *periph; uint32_t timeout = 1; starttime = NULL; @@ -1188,20 +1186,20 @@ cam_periph_runccb(union ccb *ccb, * stopped for dumping, except when we call doadump from ddb. While the * scheduler is running in this case, we still need to poll the I/O to * avoid sleeping waiting for the ccb to complete. + * + * XXX To avoid locking problems, dumping/polling callers must call + * without a periph lock held. */ must_poll = dumping; ccb->ccb_h.cbfcnp = cam_periph_done; - periph = xpt_path_periph(ccb->ccb_h.path); - periph_mtx = cam_periph_mtx(periph); /* * If we're polling, then we need to ensure that we have ample resources - * in the periph. We also need to drop the periph lock while we're polling. + * in the periph. * cam_periph_error can reschedule the ccb by calling xpt_action and returning * ERESTART, so we have to effect the polling in the do loop below. */ if (must_poll) { - mtx_unlock(periph_mtx); timeout = xpt_poll_setup(ccb); } @@ -1226,9 +1224,6 @@ cam_periph_runccb(union ccb *ccb, error = 0; } while (error == ERESTART); } - - if (must_poll) - mtx_lock(periph_mtx); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { cam_release_devq(ccb->ccb_h.path, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jan 9 00:00:55 2018 (r327709) +++ head/sys/cam/scsi/scsi_da.c Tue Jan 9 00:10:59 2018 (r327710) @@ -1647,13 +1647,10 @@ dadump(void *arg, void *virtual, vm_offset_t physical, dp = arg; periph = dp->d_drv1; softc = (struct da_softc *)periph->softc; - cam_periph_lock(periph); secsize = softc->params.secsize; - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { - cam_periph_unlock(periph); + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) return (ENXIO); - } memset(&csio, 0, sizeof(csio)); if (length > 0) { @@ -1676,7 +1673,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) printf("Aborting dump due to I/O error.\n"); - cam_periph_unlock(periph); return (error); } @@ -1700,7 +1696,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); } - cam_periph_unlock(periph); return (error); } From owner-svn-src-all@freebsd.org Tue Jan 9 00:17:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B2BE6DEE0; Tue, 9 Jan 2018 00:17:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9777CBA2; Tue, 9 Jan 2018 00:17:16 +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 EA858730F; Tue, 9 Jan 2018 00:17:15 +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 w090HFCO074104; Tue, 9 Jan 2018 00:17:15 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w090HFkx074103; Tue, 9 Jan 2018 00:17:15 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801090017.w090HFkx074103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 00:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327711 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 327711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 00:17:16 -0000 Author: scottl Date: Tue Jan 9 00:17:15 2018 New Revision: 327711 URL: https://svnweb.freebsd.org/changeset/base/327711 Log: Don't hold the periph locks during dump. Obtained from: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Jan 9 00:10:59 2018 (r327710) +++ head/sys/cam/nvme/nvme_da.c Tue Jan 9 00:17:15 2018 (r327711) @@ -388,15 +388,12 @@ ndadump(void *arg, void *virtual, vm_offset_t physical dp = arg; periph = dp->d_drv1; softc = (struct nda_softc *)periph->softc; - cam_periph_lock(periph); secsize = softc->disk->d_sectorsize; lba = offset / secsize; count = length / secsize; - if ((periph->flags & CAM_PERIPH_INVALID) != 0) { - cam_periph_unlock(periph); + if ((periph->flags & CAM_PERIPH_INVALID) != 0) return (ENXIO); - } /* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */ memset(&nvmeio, 0, sizeof(nvmeio)); @@ -408,7 +405,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) printf("Aborting dump due to I/O error %d.\n", error); - cam_periph_unlock(periph); return (error); } @@ -422,7 +418,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) xpt_print(periph->path, "flush cmd failed\n"); - cam_periph_unlock(periph); return (error); } From owner-svn-src-all@freebsd.org Tue Jan 9 00:27:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2C94E6E9B6; Tue, 9 Jan 2018 00:27:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCA847D32D; Tue, 9 Jan 2018 00:27:03 +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 117B374CC; Tue, 9 Jan 2018 00:27:03 +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 w090R2IO078211; Tue, 9 Jan 2018 00:27:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w090R2hm078210; Tue, 9 Jan 2018 00:27:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801090027.w090R2hm078210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jan 2018 00:27: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: r327712 - stable/11/contrib/elftoolchain/elfcopy X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 327712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 00:27:04 -0000 Author: emaste Date: Tue Jan 9 00:27:02 2018 New Revision: 327712 URL: https://svnweb.freebsd.org/changeset/base/327712 Log: MFC r327489: elfcopy: copy raw (untranslated) contents to binary output Previously elfcopy used elf_getdata to obtain data from ELF sections being copied to binary output, but elf_getdata returns data that has been translated - that is, data is in host byte order. When the host and target differ in endianness (e.g., converting a big-endian MIPS ELF object to binary on an x86 host) this resulted in byte-swapped data in certain sections such as .dynamic. Instead use elf_rawdata to keep data in the original, target endianness. Reported by: Hiroki Mori , Bill Yuan Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/elftoolchain/elfcopy/binary.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/binary.c Tue Jan 9 00:17:15 2018 (r327711) +++ stable/11/contrib/elftoolchain/elfcopy/binary.c Tue Jan 9 00:27:02 2018 (r327712) @@ -101,10 +101,10 @@ create_binary(int ifd, int ofd) sh.sh_size == 0) continue; (void) elf_errno(); - if ((d = elf_getdata(scn, NULL)) == NULL) { + if ((d = elf_rawdata(scn, NULL)) == NULL) { elferr = elf_errno(); if (elferr != 0) - warnx("elf_getdata failed: %s", elf_errmsg(-1)); + warnx("elf_rawdata failed: %s", elf_errmsg(-1)); continue; } if (d->d_buf == NULL || d->d_size == 0) From owner-svn-src-all@freebsd.org Tue Jan 9 01:47:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E18E7573D; Tue, 9 Jan 2018 01:47:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4348165D; Tue, 9 Jan 2018 01:47:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w091lkck024683; Mon, 8 Jan 2018 17:47:46 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w091lkxB024682; Mon, 8 Jan 2018 17:47:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801090147.w091lkxB024682@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327699 - head/sys/sys In-Reply-To: To: Pedro Giffuni Date: Mon, 8 Jan 2018 17:47:46 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 01:47:49 -0000 [ Charset UTF-8 unsupported, converting... ] > > On 08/01/2018 11:09, Rodney W. Grimes wrote: > >> Author: pfg > >> Date: Mon Jan 8 15:54:29 2018 > >> New Revision: 327699 > >> URL: https://svnweb.freebsd.org/changeset/base/327699 > >> > >> Log: > >> Revert r327697: > >> malloc(9): drop the __result_use_check attribute for the kernel allocator. > >> > >> My bad: __result_use_check just checks the for the general and we always > >> want to make sure allocated memory is used, not only checked for nullness. > >> > >> Add it to reallocf since that was missing. > > Please try not to combine a revert with an add, it makes it messy > > to try and figure out things in the future when only the svn log > > is being used to analyze stuff as digging in mail archives becomes > > painful. > > > > Revert, then commit the add standalone, is the better sequence in > > this type of situation. > > Not that any of this is defined in our committers guide but IMHO "svn > revert" is just a tool, pretty much as "svn move" and "svn copy". The > idea is to make a committers' life easier: making two commits for such a > simple change is not "easier". It is easier for other commiters to clearly see now, and in the future, exactly what was what. Please do not only think of yourself making the commit, think of all the others that try to read the diffs and understand exactly what is being done and why it is being done. By seperating the revert from the change one reading these can quickly go, yep that simple reverted what was done and move past it. And then when the commit for the new change comes in it is clear that yes, that does exactly what it says it does. Also your now forced to merge a bad commit, and a revert of that bad commit+delta to do a MFC. If this had been done with a pure revert only and then a commit of the correct fix you could of just merged the correct fix. > > In this case the change is rather consistent: I added __result_use_check > to the three functions that needed it. The change is mixed in with the noise of a revert. > The commit log is not only clear on why the revert happened but also > explains the additional one line change. I did not say the commit log was unclear, your correct, it is clear, I am saying that the operation mechanism here is general just a poor way to work in a vcs. > When I MFC it, I will merge both changes for repository consistency but > the log will basically mention that I am adding __result_use_check to > reallocf(). And what well the mergeinfo be? > > Pedro. > >> Modified: > >> head/sys/sys/malloc.h > >> > >> Modified: head/sys/sys/malloc.h > >> ============================================================================== > >> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) > >> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) > >> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct malloc_t > >> __alloc_size(1) __alloc_align(6); > >> void free(void *addr, struct malloc_type *type); > >> void *malloc(unsigned long size, struct malloc_type *type, int flags) > >> - __malloc_like __alloc_size(1); > >> + __malloc_like __result_use_check __alloc_size(1); > >> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, > >> int flags) __malloc_like __result_use_check > >> __alloc_size(1) __alloc_size(2); > >> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type *type, unsig > >> void malloc_type_list(malloc_type_list_func_t *, void *); > >> void malloc_uninit(void *); > >> void *realloc(void *addr, unsigned long size, struct malloc_type *type, > >> - int flags) __alloc_size(2); > >> + int flags) __result_use_check __alloc_size(2); > >> void *reallocf(void *addr, unsigned long size, struct malloc_type *type, > >> - int flags) __alloc_size(2); > >> + int flags) __result_use_check __alloc_size(2); > >> > >> struct malloc_type *malloc_desc2type(const char *desc); > >> #endif /* _KERNEL */ > >> > >> > > Pedro. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jan 9 02:08:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1A6E77667; Tue, 9 Jan 2018 02:08:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85BCB828B1; Tue, 9 Jan 2018 02:08:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w0928Ihr024761; Mon, 8 Jan 2018 18:08:18 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w0928IvH024760; Mon, 8 Jan 2018 18:08:18 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801090208.w0928IvH024760@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327699 - head/sys/sys In-Reply-To: <89964e3f-a982-f0e5-a7ff-9c13a5ebe61c@FreeBSD.org> To: Pedro Giffuni Date: Mon, 8 Jan 2018 18:08:18 -0800 (PST) CC: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 02:08:19 -0000 [ Charset UTF-8 unsupported, converting... ] > Hello; > > On 08/01/2018 15:27, Conrad Meyer wrote: > > I'm (again, atypically) with rgrimes here. Revert has a specific > > meaning and shouldn't be used like this. Making a commit with the > > subject "Revert rXXX" that does more than just "svn revert rXXX" makes > > life harder for developers looking at code history after you. Making > > two separate commits for two different changes (revert, then add the > > annotation) is not burdensome. > > > > Best, > > Conrad > > Yeah, I understand where that comes from and I will take it into account > for future commits, but I think it should be *documented* and not assume > that everybody?s I agree, we should have a section in the commiters guide on doing reverts. We should also have one on how to merge code to other branches and how to format commit messages for merged code. Most of these things should be taught during mentorship, perhaps even a check list for mentor/mentee to make sure they have done most, if not all, of some specific set of things before they are releaesed. I would also like to see a standardize of the revert log format by adding a Revert: line to the template so that it is there in a very standard form that this reverts revision rXXXXXX > thinks that is the way version control is supposed to be > used. My background taught me that this is how document control should be used. Vcs is just an automated form of document control. We should also try to do more seperatation of style changes vs functional changes. It just makes things easier to both review and understand. Same with a function add done with a refactor of code, mixing the two in one commit, even in one differential review, makes it harder to understand what is just simply a refactor, and what is the new code. Nothing wrong with making 3 commits in a row to the same area, style, refactor, functional change. This makes it very easy to analyze the changes and IMHO could reduce the rate of breakage. I believe phabricator has the tooling to stack these as well? Dependent diffs or some such thing? > Pedro. > > > On Mon, Jan 8, 2018 at 12:18 PM, Pedro Giffuni wrote: > >> On 08/01/2018 11:09, Rodney W. Grimes wrote: > >>>> Author: pfg > >>>> Date: Mon Jan 8 15:54:29 2018 > >>>> New Revision: 327699 > >>>> URL: https://svnweb.freebsd.org/changeset/base/327699 > >>>> > >>>> Log: > >>>> Revert r327697: > >>>> malloc(9): drop the __result_use_check attribute for the kernel > >>>> allocator. > >>>> My bad: __result_use_check just checks the for the general and we > >>>> always > >>>> want to make sure allocated memory is used, not only checked for > >>>> nullness. > >>>> Add it to reallocf since that was missing. > >>> Please try not to combine a revert with an add, it makes it messy > >>> to try and figure out things in the future when only the svn log > >>> is being used to analyze stuff as digging in mail archives becomes > >>> painful. > >>> > >>> Revert, then commit the add standalone, is the better sequence in > >>> this type of situation. > >> > >> Not that any of this is defined in our committers guide but IMHO "svn > >> revert" is just a tool, pretty much as "svn move" and "svn copy". The idea > >> is to make a committers' life easier: making two commits for such a simple > >> change is not "easier". > >> > >> In this case the change is rather consistent: I added __result_use_check to > >> the three functions that needed it. > >> The commit log is not only clear on why the revert happened but also > >> explains the additional one line change. > >> > >> When I MFC it, I will merge both changes for repository consistency but the > >> log will basically mention that I am adding __result_use_check to > >> reallocf(). > >> > >> > >> Pedro. > >> > >>>> Modified: > >>>> head/sys/sys/malloc.h > >>>> > >>>> Modified: head/sys/sys/malloc.h > >>>> > >>>> ============================================================================== > >>>> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) > >>>> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) > >>>> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct > >>>> malloc_t > >>>> __alloc_size(1) __alloc_align(6); > >>>> void free(void *addr, struct malloc_type *type); > >>>> void *malloc(unsigned long size, struct malloc_type *type, int flags) > >>>> - __malloc_like __alloc_size(1); > >>>> + __malloc_like __result_use_check __alloc_size(1); > >>>> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, > >>>> int flags) __malloc_like __result_use_check > >>>> __alloc_size(1) __alloc_size(2); > >>>> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type > >>>> *type, unsig > >>>> void malloc_type_list(malloc_type_list_func_t *, void *); > >>>> void malloc_uninit(void *); > >>>> void *realloc(void *addr, unsigned long size, struct malloc_type > >>>> *type, > >>>> - int flags) __alloc_size(2); > >>>> + int flags) __result_use_check __alloc_size(2); > >>>> void *reallocf(void *addr, unsigned long size, struct malloc_type > >>>> *type, > >>>> - int flags) __alloc_size(2); > >>>> + int flags) __result_use_check __alloc_size(2); > >>>> struct malloc_type *malloc_desc2type(const char *desc); > >>>> #endif /* _KERNEL */ > >>>> > >>>> > >> Pedro. > >> > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jan 9 03:28:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23704E7DB7E; Tue, 9 Jan 2018 03:28:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 009E92FCD; Tue, 9 Jan 2018 03:28:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58ED611602; Tue, 9 Jan 2018 03:28:24 +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 w093SOUs053960; Tue, 9 Jan 2018 03:28:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w093SOVW053959; Tue, 9 Jan 2018 03:28:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801090328.w093SOVW053959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 9 Jan 2018 03:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327715 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 327715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 03:28:25 -0000 Author: cem Date: Tue Jan 9 03:28:24 2018 New Revision: 327715 URL: https://svnweb.freebsd.org/changeset/base/327715 Log: Fix Zstd kernel build with GCC 4.2 By disabling the -Winline warning. Fixes the powerpc and sparc64 build after r327706. Note: MIPS and RISCV builds still broken due to absense of __ctzdi2 (aka __builtin_ctzll) in their libgcc or libcompiler-rt libraries. Reported by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 9 01:41:55 2018 (r327714) +++ head/sys/conf/kern.pre.mk Tue Jan 9 03:28:24 2018 (r327715) @@ -133,7 +133,7 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -war -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) -ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-missing-prototypes ${PROF} ${.IMPSRC} +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} ${.IMPSRC} # Common for dtrace / zfs CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas From owner-svn-src-all@freebsd.org Tue Jan 9 05:11:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E98E6142F; Tue, 9 Jan 2018 05:11:48 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 332A169A09; Tue, 9 Jan 2018 05:11:48 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id s3so485640qtb.10; Mon, 08 Jan 2018 21:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fFMkpVIAXWaK8qOG0m8lNr+VRLMKk6MpR4muKf/9ydo=; b=UqKjTFXVNBY1DuwXruJCCIXZ4Qa7aPGDTR/HHta0RWnLGmpXaFIZufy58UuzG2eqXJ mC1dEBkWuYlCzw0a+LW1CPHu1JPIolabXEPVrxmWCuX9gJub304Jlo7x9fxggpsY45EX xSeNuBCZfntVL8Chyg5dYm9wWxwQVBeUaAkjqe7IKdX+xIgeAdRloUw1Z3y7j3PgM1iR 3UGWXsDcq+1t2m6Tmg50WK1Cw6j/7ayZYQS/6Wvi41feSu9tRXSVU2jkZp8omJhh7Lsq O3F9dB9ZRFvAfbd0ZIYw4yr967lV9S27RMeQBACaLSHhcXd/Mcv/zDO+rpRq8ccilERj ZLkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fFMkpVIAXWaK8qOG0m8lNr+VRLMKk6MpR4muKf/9ydo=; b=aDHi3kW2nVo8yMb4unp8CrH06Lf3PrxMpetrBKO7chvFkykrkNL135LxyFLKl22ovJ g/WB1N3z75of60OPw7nHFioptySyYdA+90vA3OweyZ8Z/13YeDqcXRwB+JNOXyF3U7ze pBVohnSX6Hk9A5WYADXbl9/oB3wAfChPp3N2vRydbz9nM5v2zf2255Qj4vUdzO4zQs19 /CjO+zin0sP39tbQUpzkukcJBP9SMoJg9OtEnaPvcWlA1i1FOEQHeNVTnHHcKGUkC9ZA 5iOgr/GePeB1zM8XrJZ8xQbz6svfAjG5dYqyito4KyXq4krNQrcv+KaGcHjeEvyB+ims GCwg== X-Gm-Message-State: AKwxytd5RYX9FYYQY+JK6fLn0aTlPEMiF6BxCrbO1trcdorbs2j2LmEh +BX8buYh8mEAzs/kxAjiQLQ7mynU3Wa1JKl1DMEB6w== X-Google-Smtp-Source: ACJfBouJy/ITyoitLH7i+EvyoiQZUBcwP4ie6V2yYbGevbebDsdJbdWwaMzF3tad6LPoYgwtyioDB9Qhzf+2350/JUE= X-Received: by 10.200.41.1 with SMTP id y1mr18736304qty.162.1515474707181; Mon, 08 Jan 2018 21:11:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.89.244 with HTTP; Mon, 8 Jan 2018 21:11:46 -0800 (PST) In-Reply-To: <201801090328.w093SOVW053959@repo.freebsd.org> References: <201801090328.w093SOVW053959@repo.freebsd.org> From: Michael Zhilin Date: Tue, 9 Jan 2018 08:11:46 +0300 Message-ID: Subject: Re: svn commit: r327715 - head/sys/conf To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 05:11:48 -0000 Hi, Could you please tell what is plan to back MIPS works? Thanks! On Tue, Jan 9, 2018 at 6:28 AM, Conrad Meyer wrote: > Author: cem > Date: Tue Jan 9 03:28:24 2018 > New Revision: 327715 > URL: https://svnweb.freebsd.org/changeset/base/327715 > > Log: > Fix Zstd kernel build with GCC 4.2 > > By disabling the -Winline warning. Fixes the powerpc and sparc64 build > after r327706. > > Note: MIPS and RISCV builds still broken due to absense of __ctzdi2 (aka > __builtin_ctzll) in their libgcc or libcompiler-rt libraries. > > Reported by: markj > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/kern.pre.mk > ============================================================ > ================== > --- head/sys/conf/kern.pre.mk Tue Jan 9 01:41:55 2018 (r327714) > +++ head/sys/conf/kern.pre.mk Tue Jan 9 03:28:24 2018 (r327715) > @@ -133,7 +133,7 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -war > -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} > > # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) > -ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd > ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} > -Wno-missing-prototypes ${PROF} ${.IMPSRC} > +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd > ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} > -Wno-inline -Wno-missing-prototypes ${PROF} ${.IMPSRC} > > # Common for dtrace / zfs > CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris > -I$S/cddl/contrib/opensolaris/uts/common -I$S > -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas > -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual > -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces > -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith > -Wno-unknown-pragmas > > From owner-svn-src-all@freebsd.org Tue Jan 9 06:07:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93F6E64A4B; Tue, 9 Jan 2018 06:07:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8478D6B45D; Tue, 9 Jan 2018 06:07:52 +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 D609B12FB5; Tue, 9 Jan 2018 06:07:51 +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 w0967pGV020940; Tue, 9 Jan 2018 06:07:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0967pdY020939; Tue, 9 Jan 2018 06:07:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801090607.w0967pdY020939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 06:07:51 +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: r327716 - in stable: 10/sys/netinet 11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/netinet 11/sys/netinet X-SVN-Commit-Revision: 327716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:07:52 -0000 Author: cy Date: Tue Jan 9 06:07:51 2018 New Revision: 327716 URL: https://svnweb.freebsd.org/changeset/base/327716 Log: MFC r327336: Correct the comment describing badrs which is bad router solicitiation, not bad router advertisement. Modified: stable/11/sys/netinet/icmp6.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/netinet/icmp6.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/netinet/icmp6.h ============================================================================== --- stable/11/sys/netinet/icmp6.h Tue Jan 9 03:28:24 2018 (r327715) +++ stable/11/sys/netinet/icmp6.h Tue Jan 9 06:07:51 2018 (r327716) @@ -626,7 +626,7 @@ struct icmp6stat { uint64_t icp6s_nd_badopt; /* bad ND options */ uint64_t icp6s_badns; /* bad neighbor solicitation */ uint64_t icp6s_badna; /* bad neighbor advertisement */ - uint64_t icp6s_badrs; /* bad router advertisement */ + uint64_t icp6s_badrs; /* bad router solicitation */ uint64_t icp6s_badra; /* bad router advertisement */ uint64_t icp6s_badredirect; /* bad redirect message */ }; From owner-svn-src-all@freebsd.org Tue Jan 9 06:07:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032E0E64A55; Tue, 9 Jan 2018 06:07:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D24D26B45E; Tue, 9 Jan 2018 06:07:52 +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 1659112FB6; Tue, 9 Jan 2018 06:07:52 +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 w0967pNc020946; Tue, 9 Jan 2018 06:07:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0967pR7020945; Tue, 9 Jan 2018 06:07:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801090607.w0967pR7020945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 06:07:51 +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: r327716 - in stable: 10/sys/netinet 11/sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/netinet 11/sys/netinet X-SVN-Commit-Revision: 327716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:07:53 -0000 Author: cy Date: Tue Jan 9 06:07:51 2018 New Revision: 327716 URL: https://svnweb.freebsd.org/changeset/base/327716 Log: MFC r327336: Correct the comment describing badrs which is bad router solicitiation, not bad router advertisement. Modified: stable/10/sys/netinet/icmp6.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/netinet/icmp6.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/netinet/icmp6.h ============================================================================== --- stable/10/sys/netinet/icmp6.h Tue Jan 9 03:28:24 2018 (r327715) +++ stable/10/sys/netinet/icmp6.h Tue Jan 9 06:07:51 2018 (r327716) @@ -623,7 +623,7 @@ struct icmp6stat { uint64_t icp6s_nd_badopt; /* bad ND options */ uint64_t icp6s_badns; /* bad neighbor solicitation */ uint64_t icp6s_badna; /* bad neighbor advertisement */ - uint64_t icp6s_badrs; /* bad router advertisement */ + uint64_t icp6s_badrs; /* bad router solicitation */ uint64_t icp6s_badra; /* bad router advertisement */ uint64_t icp6s_badredirect; /* bad redirect message */ }; From owner-svn-src-all@freebsd.org Tue Jan 9 06:10:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC27E64D35; Tue, 9 Jan 2018 06:10:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38A206B78C; Tue, 9 Jan 2018 06:10:58 +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 795DD12FD0; Tue, 9 Jan 2018 06:10:57 +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 w096AvCx021873; Tue, 9 Jan 2018 06:10:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w096AvE7021872; Tue, 9 Jan 2018 06:10:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801090610.w096AvE7021872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 06:10:57 +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: r327717 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 327717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:10:58 -0000 Author: cy Date: Tue Jan 9 06:10:57 2018 New Revision: 327717 URL: https://svnweb.freebsd.org/changeset/base/327717 Log: MFC r327540: Correct function name in description block. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:07:51 2018 (r327716) +++ stable/11/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:10:57 2018 (r327717) @@ -483,7 +483,7 @@ ipf_state_soft_fini(softc, arg) /* ------------------------------------------------------------------------ */ -/* Function: ipf_state_set_lock */ +/* Function: ipf_state_setlock */ /* Returns: Nil */ /* Parameters: arg(I) - pointer to local context to use */ /* tmp(I) - new value for lock */ From owner-svn-src-all@freebsd.org Tue Jan 9 06:10:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 823BCE64D40; Tue, 9 Jan 2018 06:10:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2706B78D; Tue, 9 Jan 2018 06:10:58 +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 AE9BE12FD1; Tue, 9 Jan 2018 06:10:57 +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 w096AvM9021879; Tue, 9 Jan 2018 06:10:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w096Avss021878; Tue, 9 Jan 2018 06:10:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801090610.w096Avss021878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 06:10:57 +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: r327717 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 327717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:10:58 -0000 Author: cy Date: Tue Jan 9 06:10:57 2018 New Revision: 327717 URL: https://svnweb.freebsd.org/changeset/base/327717 Log: MFC r327540: Correct function name in description block. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:07:51 2018 (r327716) +++ stable/10/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:10:57 2018 (r327717) @@ -483,7 +483,7 @@ ipf_state_soft_fini(softc, arg) /* ------------------------------------------------------------------------ */ -/* Function: ipf_state_set_lock */ +/* Function: ipf_state_setlock */ /* Returns: Nil */ /* Parameters: arg(I) - pointer to local context to use */ /* tmp(I) - new value for lock */ From owner-svn-src-all@freebsd.org Tue Jan 9 06:44:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C2EE66FA8; Tue, 9 Jan 2018 06:44:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B63E6CB20; Tue, 9 Jan 2018 06:44:00 +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 3280913627; Tue, 9 Jan 2018 06:43:59 +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 w096hxRV037347; Tue, 9 Jan 2018 06:43:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w096hxBt037346; Tue, 9 Jan 2018 06:43:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801090643.w096hxBt037346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 06:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327718 - 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: 327718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:44:00 -0000 Author: cy Date: Tue Jan 9 06:43:58 2018 New Revision: 327718 URL: https://svnweb.freebsd.org/changeset/base/327718 Log: When growing the state, also grow the seed array. Otherwise memory that was not allocated will be accessed. This necessitated refactoring state seed allocation from ipf_state_soft_init() into a new common ipf_state_seed_alloc() function as it is now also used by ipf_state_rehash() when changing the size of the state hash table in addition to by ipf_state_soft_init() during initialization. According to Christos Zoulas : The bug was encountered by a NetBSD vendor who's customer machines had large ipfilter states. The bug was reliably triggered by resizing the state variables using "ipf -T". Submitted by: Christos Zoulas Reviewed by: delphij, rgrimes Obtained from: NetBSD ip_state.c CVS revs r1.9 and r1.10 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13755 Modified: head/sys/contrib/ipfilter/netinet/ip_state.c Modified: head/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:10:57 2018 (r327717) +++ head/sys/contrib/ipfilter/netinet/ip_state.c Tue Jan 9 06:43:58 2018 (r327718) @@ -301,7 +301,33 @@ ipf_state_soft_destroy(softc, arg) KFREE(softs); } +static void * +ipf_state_seed_alloc(u_int state_size, u_int state_max) +{ + u_int i; + u_long *state_seed; + KMALLOCS(state_seed, u_long *, state_size * sizeof(*state_seed)); + if (state_seed == NULL) + return NULL; + for (i = 0; i < state_size; i++) { + /* + * XXX - ipf_state_seed[X] should be a random number of sorts. + */ +#if FREEBSD_GE_REV(400000) + state_seed[i] = arc4random(); +#else + state_seed[i] = ((u_long)state_seed + i) * state_size; + state_seed[i] ^= 0xa5a55a5a; + state_seed[i] *= (u_long)state_seed; + state_seed[i] ^= 0x5a5aa5a5; + state_seed[i] *= state_max; +#endif + } + return state_seed; +} + + /* ------------------------------------------------------------------------ */ /* Function: ipf_state_soft_init */ /* Returns: int - 0 == success, -1 == failure */ @@ -333,27 +359,11 @@ ipf_state_soft_init(softc, arg) bzero((char *)softs->ipf_state_table, softs->ipf_state_size * sizeof(ipstate_t *)); - KMALLOCS(softs->ipf_state_seed, u_long *, - softs->ipf_state_size * sizeof(*softs->ipf_state_seed)); + softs->ipf_state_seed = ipf_state_seed_alloc(softs->ipf_state_size, + softs->ipf_state_max); if (softs->ipf_state_seed == NULL) return -2; - for (i = 0; i < softs->ipf_state_size; i++) { - /* - * XXX - ipf_state_seed[X] should be a random number of sorts. - */ -#if FREEBSD_GE_REV(400000) - softs->ipf_state_seed[i] = arc4random(); -#else - softs->ipf_state_seed[i] = ((u_long)softs->ipf_state_seed + i) * - softs->ipf_state_size; - softs->ipf_state_seed[i] ^= 0xa5a55a5a; - softs->ipf_state_seed[i] *= (u_long)softs->ipf_state_seed; - softs->ipf_state_seed[i] ^= 0x5a5aa5a5; - softs->ipf_state_seed[i] *= softs->ipf_state_max; -#endif - } - KMALLOCS(softs->ipf_state_stats.iss_bucketlen, u_int *, softs->ipf_state_size * sizeof(u_int)); if (softs->ipf_state_stats.iss_bucketlen == NULL) @@ -5259,6 +5269,7 @@ ipf_state_rehash(softc, t, p) { ipf_state_softc_t *softs = softc->ipf_state_soft; ipstate_t **newtab, *is; + u_long *newseed; u_int *bucketlens; u_int maxbucket; u_int newsize; @@ -5285,6 +5296,14 @@ ipf_state_rehash(softc, t, p) return ENOMEM; } + newseed = ipf_state_seed_alloc(newsize, softs->ipf_state_max); + if (newseed == NULL) { + KFREES(bucketlens, newsize * sizeof(*bucketlens)); + KFREES(newtab, newsize * sizeof(*newtab)); + IPFERROR(100037); + return ENOMEM; + } + for (maxbucket = 0, i = newsize; i > 0; i >>= 1) maxbucket++; maxbucket *= 2; @@ -5299,6 +5318,12 @@ ipf_state_rehash(softc, t, p) softs->ipf_state_size * sizeof(*softs->ipf_state_table)); } softs->ipf_state_table = newtab; + + if (softs->ipf_state_seed != NULL) { + KFREES(softs->ipf_state_seed, + softs->ipf_state_size * sizeof(*softs->ipf_state_seed)); + } + softs->ipf_state_seed = newseed; if (softs->ipf_state_stats.iss_bucketlen != NULL) { KFREES(softs->ipf_state_stats.iss_bucketlen, From owner-svn-src-all@freebsd.org Tue Jan 9 06:51:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10893E6771B; Tue, 9 Jan 2018 06:51:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E04376CF1B; Tue, 9 Jan 2018 06:51:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D398137A8; Tue, 9 Jan 2018 06:51:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w096pgWv038362; Tue, 9 Jan 2018 06:51:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w096pghv038361; Tue, 9 Jan 2018 06:51:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801090651.w096pghv038361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 9 Jan 2018 06:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327719 - head/sbin/ldconfig X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/ldconfig X-SVN-Commit-Revision: 327719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 06:51:43 -0000 Author: eadler Date: Tue Jan 9 06:51:41 2018 New Revision: 327719 URL: https://svnweb.freebsd.org/changeset/base/327719 Log: ldconfig(8): use .Nm instead of 'ldconfig' Modified: head/sbin/ldconfig/ldconfig.8 Modified: head/sbin/ldconfig/ldconfig.8 ============================================================================== --- head/sbin/ldconfig/ldconfig.8 Tue Jan 9 06:43:58 2018 (r327718) +++ head/sbin/ldconfig/ldconfig.8 Tue Jan 9 06:51:41 2018 (r327719) @@ -159,9 +159,10 @@ file. In particular, the .Ev LD_LIBRARY_PATH is not used to search for libraries. -Thus, the role of ldconfig is dual. -In -addition to building a set of hints for quick lookup, it also serves to +Thus, the role of +.Nm +is dual. +In addition to building a set of hints for quick lookup, it also serves to specify the trusted collection of directories from which shared objects can be safely loaded. .Sh FILES From owner-svn-src-all@freebsd.org Tue Jan 9 09:26:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 493BFE710B5; Tue, 9 Jan 2018 09:26:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23A947303B; Tue, 9 Jan 2018 09:26:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 735B21505F; Tue, 9 Jan 2018 09:26:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w099QGgZ005803; Tue, 9 Jan 2018 09:26:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w099QGvp005802; Tue, 9 Jan 2018 09:26:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801090926.w099QGvp005802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jan 2018 09:26:16 +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: r327720 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 327720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 09:26:17 -0000 Author: kib Date: Tue Jan 9 09:26:16 2018 New Revision: 327720 URL: https://svnweb.freebsd.org/changeset/base/327720 Log: MFC r327625: Document kern.smp.disabled tunable. Modified: stable/11/share/man/man4/smp.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/smp.4 ============================================================================== --- stable/11/share/man/man4/smp.4 Tue Jan 9 06:51:41 2018 (r327719) +++ stable/11/share/man/man4/smp.4 Tue Jan 9 09:26:16 2018 (r327720) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2008 +.Dd January 6, 2017 .Dt SMP 4 .Os .Sh NAME @@ -56,6 +56,11 @@ i386 also requires The .Xr mptable 1 command may be used to view the status of multi-processor support. +.Pp +.Nm +support can be disabled by setting the loader tunable +.Va kern.smp.disabled +to 1. .Pp The number of CPUs detected by the system is available in the read-only sysctl variable From owner-svn-src-all@freebsd.org Tue Jan 9 09:47:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5645E724FB; Tue, 9 Jan 2018 09:47:49 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3494F73E68; Tue, 9 Jan 2018 09:47:48 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mh6lB-1eDCur1wMT-00MIsq; Tue, 09 Jan 2018 10:47:40 +0100 Date: Tue, 9 Jan 2018 10:47:39 +0100 From: "O. Hartmann" To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327706 - in head/sys: conf contrib/zstd/lib/freebsd Message-ID: <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201801082014.w08KEGv8071627@repo.freebsd.org> References: <201801082014.w08KEGv8071627@repo.freebsd.org> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:LCiGe+WMAl9TJzSyGS2IyLeOBsZzTiXOMD9x0yCW9W/ELr0CzWL 8NDCMQG6mb9htltt0RmrpZVWFHSGUut+GLOzRf/5gZjvZ3Vhlmjrf2nvhbeeQDoyGnZ/zTm d4C6FDAHfW1vwLOMWtuHv9fHsEEEMGC+y/Saq9CGh3k5/64LABCVFOG8GwPnNzKPidG3Seg 2rWIGIjLFVG+Mq6hefPPQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:kN61OvadJds=:yJmWFM7gmP11c+Y8uGl4us UzMXNbA8l+lR8U+1AfZthJ6PhtQSpAmdrsdz18fHWK/q4I/RE2kwvHmKcEsCO4wCvbeh0YOv3 4OwATJ9kAUZXVq3w3tgdzUv8E1jik15N+0CPEg1qMC9G6eHNvNzzzWFbgfHvykYvFSuMrUdMD Rizt7CXse0YqEbyrY1WHm0jvHdZK+H00YbMpNCumpyvMEPDOzGTs4U18lRXeHy0g6qTbnPv3s 2CN5IeRrwtbnY8CoroSaLc46XV6W+H9DnBziKXv2WjI1QmJdpJ7ArtFrChVRH9j7ij1/7uSdC +hMZ6JTR4Q7q46YYpGMfkLduz6l0oymGCU/aEW/BqiOYKhJU8p58Z5iM6eIemKyg+mfbeW6/o h8O0iy4xwXIeEZRBCazUZxZz0sUin0V3PWDMKmX2aAdEuJWZGZe2KdMXStmr+Y3MCpB0WNSv9 DPRj0o3lqZ9hAMxYUFnSYzonFFcr0o+UtoMpHj3Y2eYl3vViBVjP9ldPwjFcDEtTcvLBnoDDX yOBojLeaqvszOgm86f7RBlL3TdcuiZbGXssymve/6WwQH6tcaNXu2/VnQNz8wKGxQGwbLg2sk 0ni89J6yDXdRNDeDiqRMps71/5pcbrYabcMd70qmDlS8RZzbVh1NrUkSf/zU7jPsCgloH7BfS /ssyGDVMdWngeQcDLndH9yG0gXqXv5RieMNjRbskOvay307HtxfWBFYf4apMp2pFM/JGEM3pF lXd5+jHC6iH3jR1WFBmGDBT4iAiqeAX71UzjV02KCzSJNlvyJ7+RPCWcudvGl+Xp22elJVmFF wOopGDx0TEVlnwmp9RumlVUuOtVAnExgWL8CLlp8jvNPhkVldY= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 09:47:49 -0000 On Mon, 8 Jan 2018 20:14:16 +0000 (UTC) Conrad Meyer wrote: > Author: cem > Date: Mon Jan 8 20:14:16 2018 > New Revision: 327706 > URL: https://svnweb.freebsd.org/changeset/base/327706 > > Log: > Integrate zstd into the kernel > > Mock userspace headers and include mocked headers first in compilation > command to inject kernel headers and override e.g., malloc(3) with > malloc(9). > > Submitted by: allanjude > Reviewed by: imp (earlier version), bapt (earlier version) > Differential Revision: https://reviews.freebsd.org/D10407 > > Added: > head/sys/contrib/zstd/lib/freebsd/ > head/sys/contrib/zstd/lib/freebsd/stddef.h (contents, props changed) > head/sys/contrib/zstd/lib/freebsd/stdint.h (contents, props changed) > head/sys/contrib/zstd/lib/freebsd/stdio.h (contents, props changed) > head/sys/contrib/zstd/lib/freebsd/stdlib.h (contents, props changed) > head/sys/contrib/zstd/lib/freebsd/string.h (contents, props changed) > head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h (contents, props > changed) head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c (contents, props > changed) Modified: > head/sys/conf/files > head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Mon Jan 8 18:47:35 2018 (r327705) > +++ head/sys/conf/files Mon Jan 8 20:14:16 2018 (r327706) > @@ -626,6 +626,23 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional nga > compile-with "${NORMAL_C} -I$S/contrib/ngatm" > contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ > compile-with "${NORMAL_C} -I$S/contrib/ngatm" > +# Zstd > +contrib/zstd/lib/freebsd/zstd_kmalloc.c standard compile-with > ${ZSTD_C} +contrib/zstd/lib/common/zstd_common.c standard > compile-with ${ZSTD_C} +contrib/zstd/lib/common/fse_decompress.c > standard compile-with ${ZSTD_C} > +contrib/zstd/lib/common/entropy_common.c standard compile-with > ${ZSTD_C} +contrib/zstd/lib/common/error_private.c standard > compile-with ${ZSTD_C} +contrib/zstd/lib/common/xxhash.c > standard compile-with ${ZSTD_C} > +contrib/zstd/lib/compress/zstd_compress.c standard compile-with > ${ZSTD_C} +contrib/zstd/lib/compress/fse_compress.c standard > compile-with ${ZSTD_C} +contrib/zstd/lib/compress/huf_compress.c > standard compile-with ${ZSTD_C} > +contrib/zstd/lib/compress/zstd_double_fast.c standard compile-with > ${ZSTD_C} +contrib/zstd/lib/compress/zstd_fast.c standard > compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_lazy.c > standard compile-with ${ZSTD_C} > +contrib/zstd/lib/compress/zstd_ldm.c standard compile-with > ${ZSTD_C} +contrib/zstd/lib/compress/zstd_opt.c standard > compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_decompress.c > standard compile-with ${ZSTD_C} > +contrib/zstd/lib/decompress/huf_decompress.c standard compile-with > ${ZSTD_C} crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support > crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support > crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Mon Jan 8 18:47:35 2018 (r327705) > +++ head/sys/conf/kern.pre.mk Mon Jan 8 20:14:16 2018 (r327706) > @@ -132,6 +132,9 @@ NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} > NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ > -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} > > +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) > +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} > -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} > -Wno-missing-prototypes ${PROF} ${.IMPSRC} + # Common for dtrace / zfs > CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc > -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S > -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas > -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual > -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized > -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas > CDDL_CFLAGS+= -include $S/cddl/compat/opensolaris/sys/debug_compat.h > > Added: head/sys/contrib/zstd/lib/freebsd/stddef.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/stddef.h Mon Jan 8 20:14:16 > 2018 (r327706) @@ -0,0 +1,3 @@ > +/* This file is in the public domain */ > +/* $FreeBSD$ */ > +#include "zstd_kfreebsd.h" > > Added: head/sys/contrib/zstd/lib/freebsd/stdint.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/stdint.h Mon Jan 8 20:14:16 > 2018 (r327706) @@ -0,0 +1,3 @@ > +/* This file is in the public domain */ > +/* $FreeBSD$ */ > +#include "zstd_kfreebsd.h" > > Added: head/sys/contrib/zstd/lib/freebsd/stdio.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/stdio.h Mon Jan 8 20:14:16 > 2018 (r327706) @@ -0,0 +1,3 @@ > +/* This file is in the public domain */ > +/* $FreeBSD$ */ > +#include "zstd_kfreebsd.h" > > Added: head/sys/contrib/zstd/lib/freebsd/stdlib.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/stdlib.h Mon Jan 8 20:14:16 > 2018 (r327706) @@ -0,0 +1,3 @@ > +/* This file is in the public domain */ > +/* $FreeBSD$ */ > +#include "zstd_kfreebsd.h" > > Added: head/sys/contrib/zstd/lib/freebsd/string.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/string.h Mon Jan 8 20:14:16 > 2018 (r327706) @@ -0,0 +1,3 @@ > +/* This file is in the public domain */ > +/* $FreeBSD$ */ > +#include "zstd_kfreebsd.h" > > Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Mon Jan 8 > 20:14:16 2018 (r327706) @@ -0,0 +1,56 @@ > +/*- > + * Copyright (c) 2014-2015 Allan Jude > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef ZSTD_KFREEBSD_H > +#define ZSTD_KFREEBSD_H > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#ifdef _KERNEL > +#include /* size_t */ > +#include /* memcpy, memset */ > +#ifndef BUILDING_ZFS > +#include /* ptrdiff_t */ > +#endif > +#include > + > +MALLOC_DECLARE(M_ZSTD); > + > +#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) > +#define free(x) (free)((x), M_ZSTD) > +/* in zstd's use of calloc, a is always 1 */ > +#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) > +#endif > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* ZSTD_KFREEBSD_H */ > > Added: head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c Mon Jan 8 > 20:14:16 2018 (r327706) @@ -0,0 +1,33 @@ > +/*- > + * Copyright (c) 2016-2017 Allan Jude > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include > +#include > +#include > + > +MALLOC_DEFINE(M_ZSTD, "zstd", "ZSTD Compressor"); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" It seems that CURRENT is unwilling to build due to the error shown below: [...] --- fse_decompress.o --- In file included from /usr/src/sys/contrib/zstd/lib/common/fse_decompress.c:41: /usr/src/sys/contrib/zstd/lib/common/bitstream.h:71:12: fatal error: 'immintrin.h' file not found # include /* support for bextr (experimental) */ ^~~~~~~~~~~~~ --- modules-all --- From owner-svn-src-all@freebsd.org Tue Jan 9 10:33:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96392E74E5A; Tue, 9 Jan 2018 10:33:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5865375DD5; Tue, 9 Jan 2018 10:33:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB91115BD6; Tue, 9 Jan 2018 10:33:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09AXBXw034579; Tue, 9 Jan 2018 10:33:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09AXBdC034578; Tue, 9 Jan 2018 10:33:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801091033.w09AXBdC034578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jan 2018 10:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327721 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 327721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 10:33:12 -0000 Author: kib Date: Tue Jan 9 10:33:11 2018 New Revision: 327721 URL: https://svnweb.freebsd.org/changeset/base/327721 Log: Postpone the disassotiation of the background write buffer with devvp so that buf_complete() sees fully constructed buffer. This is a NOP right now, but will be needed by the forthcoming SU change. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 9 09:26:16 2018 (r327720) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 9 10:33:11 2018 (r327721) @@ -2045,7 +2045,6 @@ ffs_backgroundwritedone(struct buf *bp) /* * Process dependencies then return any unfinished ones. */ - pbrelvp(bp); if (!LIST_EMPTY(&bp->b_dep) && (bp->b_ioflags & BIO_ERROR) == 0) buf_complete(bp); #ifdef SOFTUPDATES @@ -2058,6 +2057,7 @@ ffs_backgroundwritedone(struct buf *bp) */ bp->b_flags |= B_NOCACHE; bp->b_flags &= ~B_CACHE; + pbrelvp(bp); /* * Prevent brelse() from trying to keep and re-dirtying bp on From owner-svn-src-all@freebsd.org Tue Jan 9 10:44:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C0AE75701; Tue, 9 Jan 2018 10:44:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3E9763C0; Tue, 9 Jan 2018 10:44:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9031E15D84; Tue, 9 Jan 2018 10:44:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09AiHcm038616; Tue, 9 Jan 2018 10:44:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09AiHJN038615; Tue, 9 Jan 2018 10:44:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801091044.w09AiHJN038615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jan 2018 10:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327722 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 327722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 10:44:18 -0000 Author: kib Date: Tue Jan 9 10:44:17 2018 New Revision: 327722 URL: https://svnweb.freebsd.org/changeset/base/327722 Log: When handling write completion, take SU lock around calls to handle_written_XXX() in case of processing the buffer with an error. Tested by: pho (as part of the bigger patch) Reviewed by: mckusick (as part of the bigger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Jan 9 10:33:11 2018 (r327721) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Jan 9 10:44:17 2018 (r327722) @@ -10978,12 +10978,17 @@ softdep_disk_write_complete(bp) struct freeblks *freeblks; struct buf *sbp; + if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + return; + ump = VFSTOUFS(wk->wk_mp); + /* * If an error occurred while doing the write, then the data * has not hit the disk and the dependencies cannot be processed. * But we do have to go through and roll forward any dependencies * that were rolled back before the disk write. */ + ACQUIRE_LOCK(ump); if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { @@ -11011,18 +11016,15 @@ softdep_disk_write_complete(bp) continue; } } + FREE_LOCK(ump); return; } - if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) - return; - ump = VFSTOUFS(wk->wk_mp); LIST_INIT(&reattach); /* * This lock must not be released anywhere in this code segment. */ sbp = NULL; owk = NULL; - ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { WORKLIST_REMOVE(wk); atomic_add_long(&dep_write[wk->wk_type], 1); From owner-svn-src-all@freebsd.org Tue Jan 9 10:51:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BD1E75CCF; Tue, 9 Jan 2018 10:51:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 700FE769A7; Tue, 9 Jan 2018 10:51:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADAA515ED2; Tue, 9 Jan 2018 10:51:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09ApieC040460; Tue, 9 Jan 2018 10:51:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09ApiRW040458; Tue, 9 Jan 2018 10:51:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801091051.w09ApiRW040458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jan 2018 10:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327723 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 327723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 10:51:45 -0000 Author: kib Date: Tue Jan 9 10:51:44 2018 New Revision: 327723 URL: https://svnweb.freebsd.org/changeset/base/327723 Log: Generalize the fix from r322757 and apply it to several more places. The code accesses bp->b_dep without owning the ufs mount softdep lock, which makes it possible for the derefenced workitem to be freed in parallel. In particular, the deallocate_dependencies(), softdep_disk_io_initiation() and softdep_disk_write_complete() are affected. Move the code to safely calculate ump from the buffer with dependencies into the helper softdep_bp_to_mp() and use it for all found cases. Tested by: pho (as part of the bigger patch) Reviewed by: mckusick (as part of the bigger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Jan 9 10:44:17 2018 (r327722) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Jan 9 10:51:44 2018 (r327723) @@ -906,6 +906,7 @@ static int request_cleanup(struct mount *, int); static int softdep_request_cleanup_flush(struct mount *, struct ufsmount *); static void schedule_cleanup(struct mount *); static void softdep_ast_cleanup_proc(struct thread *); +static struct ufsmount *softdep_bp_to_mp(struct buf *bp); static int process_worklist_item(struct mount *, int, int); static void process_removes(struct vnode *); static void process_truncates(struct vnode *); @@ -7249,9 +7250,9 @@ deallocate_dependencies(bp, freeblks, off) struct worklist *wk, *wkn; struct ufsmount *ump; - if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + ump = softdep_bp_to_mp(bp); + if (ump == NULL) goto done; - ump = VFSTOUFS(wk->wk_mp); ACQUIRE_LOCK(ump); LIST_FOREACH_SAFE(wk, &bp->b_dep, wk_list, wkn) { switch (wk->wk_type) { @@ -9976,9 +9977,9 @@ softdep_disk_io_initiation(bp) panic("softdep_disk_io_initiation: Writing buffer with " "background write in progress: %p", bp); - if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + ump = softdep_bp_to_mp(bp); + if (ump == NULL) return; - ump = VFSTOUFS(wk->wk_mp); marker.wk_type = D_LAST + 1; /* Not a normal workitem */ PHOLD(curproc); /* Don't swap out kernel stack */ @@ -10978,9 +10979,9 @@ softdep_disk_write_complete(bp) struct freeblks *freeblks; struct buf *sbp; - if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + ump = softdep_bp_to_mp(bp); + if (ump == NULL) return; - ump = VFSTOUFS(wk->wk_mp); /* * If an error occurred while doing the write, then the data @@ -11020,8 +11021,9 @@ softdep_disk_write_complete(bp) return; } LIST_INIT(&reattach); + /* - * This lock must not be released anywhere in this code segment. + * Ump SU lock must not be released anywhere in this code segment. */ sbp = NULL; owk = NULL; @@ -13895,6 +13897,39 @@ softdep_freework(wkhd) FREE_LOCK(ump); } +static struct ufsmount * +softdep_bp_to_mp(bp) + struct buf *bp; +{ + struct mount *mp; + struct vnode *vp; + + if (LIST_EMPTY(&bp->b_dep)) + return (NULL); + vp = bp->b_vp; + + /* + * The ump mount point is stable after we get a correct + * pointer, since bp is locked and this prevents unmount from + * proceeding. But to get to it, we cannot dereference bp->b_dep + * head wk_mp, because we do not yet own SU ump lock and + * workitem might be freed while dereferenced. + */ +retry: + if (vp->v_type == VCHR) { + VI_LOCK(vp); + mp = vp->v_type == VCHR ? vp->v_rdev->si_mountpt : NULL; + VI_UNLOCK(vp); + if (mp == NULL) + goto retry; + } else if (vp->v_type == VREG || vp->v_type == VDIR) { + mp = vp->v_mount; + } else { + return (NULL); + } + return (VFSTOUFS(mp)); +} + /* * Function to determine if the buffer has outstanding dependencies * that will cause a roll-back if the buffer is written. If wantcount @@ -13918,36 +13953,12 @@ softdep_count_dependencies(bp, wantcount) struct newblk *newblk; struct mkdir *mkdir; struct diradd *dap; - struct vnode *vp; - struct mount *mp; int i, retval; - retval = 0; - if (LIST_EMPTY(&bp->b_dep)) + ump = softdep_bp_to_mp(bp); + if (ump == NULL) return (0); - vp = bp->b_vp; - - /* - * The ump mount point is stable after we get a correct - * pointer, since bp is locked and this prevents unmount from - * proceed. But to get to it, we cannot dereference bp->b_dep - * head wk_mp, because we do not yet own SU ump lock and - * workitem might be freed while dereferenced. - */ -retry: - if (vp->v_type == VCHR) { - VI_LOCK(vp); - mp = vp->v_type == VCHR ? vp->v_rdev->si_mountpt : NULL; - VI_UNLOCK(vp); - if (mp == NULL) - goto retry; - } else if (vp->v_type == VREG) { - mp = vp->v_mount; - } else { - return (0); - } - ump = VFSTOUFS(mp); - + retval = 0; ACQUIRE_LOCK(ump); LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { From owner-svn-src-all@freebsd.org Tue Jan 9 13:42:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30ED8E7DEAC; Tue, 9 Jan 2018 13:42:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5DB7CF81; Tue, 9 Jan 2018 13:42:10 +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 4B86617A35; Tue, 9 Jan 2018 13:42:09 +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 w09Dg9SF013507; Tue, 9 Jan 2018 13:42:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09Dg97C013506; Tue, 9 Jan 2018 13:42:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801091342.w09Dg97C013506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 9 Jan 2018 13:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327724 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 327724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 13:42:10 -0000 Author: avg Date: Tue Jan 9 13:42:08 2018 New Revision: 327724 URL: https://svnweb.freebsd.org/changeset/base/327724 Log: usbdevs: add ASMedia vendor ID MFC after: 1 week Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jan 9 10:51:44 2018 (r327723) +++ head/sys/dev/usb/usbdevs Tue Jan 9 13:42:08 2018 (r327724) @@ -707,6 +707,7 @@ vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless vendor SEL 0x1adb Schweitzer Engineering Laboratories vendor CORSAIR 0x1b1c Corsair +vendor ASM 0x1b21 ASMedia Technology vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TML 0x1b91 The Mobility Lab From owner-svn-src-all@freebsd.org Tue Jan 9 13:43:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57050E7DF6D; Tue, 9 Jan 2018 13:43: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 309A47D112; Tue, 9 Jan 2018 13:43:05 +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 629DF17A64; Tue, 9 Jan 2018 13:43: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 w09Dh462013585; Tue, 9 Jan 2018 13:43:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09Dh489013584; Tue, 9 Jan 2018 13:43:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801091343.w09Dh489013584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 9 Jan 2018 13:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327725 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 327725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 13:43:05 -0000 Author: avg Date: Tue Jan 9 13:43:04 2018 New Revision: 327725 URL: https://svnweb.freebsd.org/changeset/base/327725 Log: zfs_mount: restore a bit of ifdef-out illumos code And correctly mark the end of the replacement FreeBSD code. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Jan 9 13:42:08 2018 (r327724) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Jan 9 13:43:04 2018 (r327725) @@ -1629,13 +1629,21 @@ zfs_mount(vfs_t *vfsp) * can be interrogated. */ if ((uap->flags & MS_DATA) && uap->datalen > 0) + return (SET_ERROR(EINVAL)); + + /* + * Get the objset name (the "special" mount argument). + */ + if (error = pn_get(uap->spec, fromspace, &spn)) + return (error); + + osname = spn.pn_path; #else /* !illumos */ if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_ZFS)) return (SET_ERROR(EPERM)); if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL)) return (SET_ERROR(EINVAL)); -#endif /* illumos */ /* * If full-owner-access is enabled and delegated administration is @@ -1645,6 +1653,7 @@ zfs_mount(vfs_t *vfsp) dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr) != ECANCELED) { secpolicy_fs_mount_clearopts(cr, vfsp); } +#endif /* illumos */ /* * Check for mount privilege? From owner-svn-src-all@freebsd.org Tue Jan 9 14:22:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FBBAE7F75C; Tue, 9 Jan 2018 14:22:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EED117E7CC; Tue, 9 Jan 2018 14:22:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FE11180CC; Tue, 9 Jan 2018 14:22:19 +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 w09EMJb5029554; Tue, 9 Jan 2018 14:22:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09EMJpB029552; Tue, 9 Jan 2018 14:22:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801091422.w09EMJpB029552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 9 Jan 2018 14:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327726 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 327726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 14:22:20 -0000 Author: avg Date: Tue Jan 9 14:22:18 2018 New Revision: 327726 URL: https://svnweb.freebsd.org/changeset/base/327726 Log: vmm/svm: contigmalloc of the whole svm_softc is excessive This is a followup to r307903. struct svm_softc takes more than 200 kilobytes while what we really need is 3 contiguous pages for I/O permission map and 2 contiguous pages for MSR permission map. Other physically mapped structures have a size of a single page, so a proper alignment is sufficient for their correct mapping. Thus, only the permission maps are allocated with contigmalloc now, the softc is allocated with a regular malloc. Additionally, this commit adds a check that malloc returns memory with the expected page alignment and that contigmalloc does not fail. Unfortunately, at present svm_vminit() is expected to always succeed and there is no way to report an error. So, a contigmalloc failure leads to a panic. We should probably fix this. MFC after: 2 weeks Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/svm_softc.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Tue Jan 9 13:43:04 2018 (r327725) +++ head/sys/amd64/vmm/amd/svm.c Tue Jan 9 14:22:18 2018 (r327726) @@ -517,15 +517,26 @@ svm_vminit(struct vm *vm, pmap_t pmap) vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; - svm_sc = contigmalloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO, - 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); + if (((uintptr_t)svm_sc & PAGE_MASK) != 0) + panic("malloc of svm_softc not aligned on page boundary"); + + svm_sc->msr_bitmap = contigmalloc(SVM_MSR_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->msr_bitmap == NULL) + panic("contigmalloc of SVM MSR bitmap failed"); + svm_sc->iopm_bitmap = contigmalloc(SVM_IO_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->iopm_bitmap == NULL) + panic("contigmalloc of SVM IO bitmap failed"); + svm_sc->vm = vm; svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4); /* * Intercept read and write accesses to all MSRs. */ - memset(svm_sc->msr_bitmap, 0xFF, sizeof(svm_sc->msr_bitmap)); + memset(svm_sc->msr_bitmap, 0xFF, SVM_MSR_BITMAP_SIZE); /* * Access to the following MSRs is redirected to the VMCB when the @@ -553,7 +564,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) svm_msr_rd_ok(svm_sc->msr_bitmap, MSR_EFER); /* Intercept access to all I/O ports. */ - memset(svm_sc->iopm_bitmap, 0xFF, sizeof(svm_sc->iopm_bitmap)); + memset(svm_sc->iopm_bitmap, 0xFF, SVM_IO_BITMAP_SIZE); iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); @@ -2043,7 +2054,9 @@ svm_vmcleanup(void *arg) { struct svm_softc *sc = arg; - contigfree(sc, sizeof (*sc), M_SVM); + contigfree(sc->iopm_bitmap, SVM_IO_BITMAP_SIZE, M_SVM); + contigfree(sc->msr_bitmap, SVM_MSR_BITMAP_SIZE, M_SVM); + free(sc, M_SVM); } static register_t * Modified: head/sys/amd64/vmm/amd/svm_softc.h ============================================================================== --- head/sys/amd64/vmm/amd/svm_softc.h Tue Jan 9 13:43:04 2018 (r327725) +++ head/sys/amd64/vmm/amd/svm_softc.h Tue Jan 9 14:22:18 2018 (r327726) @@ -56,13 +56,13 @@ struct svm_vcpu { * SVM softc, one per virtual machine. */ struct svm_softc { - uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ - uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ uint8_t apic_page[VM_MAXCPU][PAGE_SIZE]; struct svm_vcpu vcpu[VM_MAXCPU]; vm_offset_t nptp; /* nested page table */ + uint8_t *iopm_bitmap; /* shared by all vcpus */ + uint8_t *msr_bitmap; /* shared by all vcpus */ struct vm *vm; -} __aligned(PAGE_SIZE); +}; CTASSERT((offsetof(struct svm_softc, nptp) & PAGE_MASK) == 0); From owner-svn-src-all@freebsd.org Tue Jan 9 14:33:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 427F7E7FCA7; Tue, 9 Jan 2018 14:33:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6C97EF85; Tue, 9 Jan 2018 14:33:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A22A182AA; Tue, 9 Jan 2018 14:33:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09EX6Zb034745; Tue, 9 Jan 2018 14:33:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09EX5ef034740; Tue, 9 Jan 2018 14:33:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801091433.w09EX5ef034740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Jan 2018 14:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327727 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf X-SVN-Commit-Revision: 327727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 14:33:07 -0000 Author: andrew Date: Tue Jan 9 14:33:05 2018 New Revision: 327727 URL: https://svnweb.freebsd.org/changeset/base/327727 Log: Add a framework to install CPU errata on arm64. Each erratum can encode a mask and value to compare with the Main ID Register. If these match then a function is called to handle the installation of the erratum workaround. No errata are currently handled, however this will change soon in a future commit. MFC after: 1 week Sponsored by: DARPA, AFRL Added: head/sys/arm64/arm64/cpu_errata.c (contents, props changed) Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/cpu.h head/sys/conf/files.arm64 Added: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/cpu_errata.c Tue Jan 9 14:33:05 2018 (r327727) @@ -0,0 +1,68 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 + +typedef void (cpu_quirk_install)(void); +struct cpu_quirks { + cpu_quirk_install *quirk_install; + u_int midr_mask; + u_int midr_value; +}; + +static cpu_quirk_install install_psci_bp_hardening; + +static struct cpu_quirks cpu_quirks[] = { +}; + +void +install_cpu_errata(void) +{ + u_int midr; + size_t i; + + midr = get_midr(); + + for (i = 0; i < nitems(cpu_quirks); i++) { + if ((midr & cpu_quirks[i].midr_mask) == + cpu_quirks[i].midr_value) { + cpu_quirks[i].quirk_install(); + } + } +} Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Tue Jan 9 14:22:18 2018 (r327726) +++ head/sys/arm64/arm64/machdep.c Tue Jan 9 14:33:05 2018 (r327727) @@ -172,6 +172,7 @@ cpu_startup(void *dummy) undef_init(); identify_cpu(); + install_cpu_errata(); vm_ksubmap_init(&kmi); bufinit(); Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue Jan 9 14:22:18 2018 (r327726) +++ head/sys/arm64/arm64/mp_machdep.c Tue Jan 9 14:33:05 2018 (r327727) @@ -282,6 +282,7 @@ init_secondary(uint64_t cpu) * runtime chip identification. */ identify_cpu(); + install_cpu_errata(); intr_pic_init_secondary(); Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Tue Jan 9 14:22:18 2018 (r327726) +++ head/sys/arm64/include/cpu.h Tue Jan 9 14:33:05 2018 (r327727) @@ -150,6 +150,7 @@ void cpu_halt(void) __dead2; void cpu_reset(void) __dead2; void fork_trampoline(void); void identify_cpu(void); +void install_cpu_errata(void); void print_cpu_features(u_int); void swi_vm(void *v); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Jan 9 14:22:18 2018 (r327726) +++ head/sys/conf/files.arm64 Tue Jan 9 14:33:05 2018 (r327727) @@ -96,6 +96,7 @@ arm64/arm64/bzero.S standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard arm64/arm64/copystr.c standard +arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb From owner-svn-src-all@freebsd.org Tue Jan 9 15:57:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D7DE6015D; Tue, 9 Jan 2018 15:57:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE7182CEE; Tue, 9 Jan 2018 15:57:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1888118FBB; Tue, 9 Jan 2018 15:57:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09Fv9Ne069137; Tue, 9 Jan 2018 15:57:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09Fv9Z2069135; Tue, 9 Jan 2018 15:57:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801091557.w09Fv9Z2069135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 9 Jan 2018 15:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327728 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 327728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 15:57:12 -0000 Author: andrew Date: Tue Jan 9 15:57:09 2018 New Revision: 327728 URL: https://svnweb.freebsd.org/changeset/base/327728 Log: Add a function to find the PSCI version the firmware implements from outside the PSCI driver. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c head/sys/dev/psci/psci.h Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Tue Jan 9 14:33:05 2018 (r327727) +++ head/sys/dev/psci/psci.c Tue Jan 9 15:57:09 2018 (r327728) @@ -314,7 +314,7 @@ psci_attach(device_t dev, psci_initfn_t psci_init) } static int -psci_get_version(struct psci_softc *sc) +_psci_get_version(struct psci_softc *sc) { uint32_t fnid; @@ -326,6 +326,15 @@ psci_get_version(struct psci_softc *sc) return (PSCI_RETVAL_NOT_SUPPORTED); } +int +psci_get_version(void) +{ + + if (psci_softc == NULL) + return (PSCI_RETVAL_NOT_SUPPORTED); + return (_psci_get_version(psci_softc)); +} + #ifdef FDT static int psci_fdt_callfn(psci_callfn_t *callfn) @@ -487,7 +496,7 @@ psci_v0_2_init(device_t dev) sc->psci_fnids[PSCI_FN_SYSTEM_OFF] = PSCI_FNID_SYSTEM_OFF; sc->psci_fnids[PSCI_FN_SYSTEM_RESET] = PSCI_FNID_SYSTEM_RESET; - version = psci_get_version(sc); + version = _psci_get_version(sc); if (version == PSCI_RETVAL_NOT_SUPPORTED) return (1); Modified: head/sys/dev/psci/psci.h ============================================================================== --- head/sys/dev/psci/psci.h Tue Jan 9 14:33:05 2018 (r327727) +++ head/sys/dev/psci/psci.h Tue Jan 9 15:57:09 2018 (r327728) @@ -41,6 +41,7 @@ int psci_cpu_on(unsigned long, unsigned long, unsigned int psci_hvc_despatch(register_t, register_t, register_t, register_t); int psci_smc_despatch(register_t, register_t, register_t, register_t); +int psci_get_version(void); /* * PSCI return codes. From owner-svn-src-all@freebsd.org Tue Jan 9 16:11:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDA4E60F04; Tue, 9 Jan 2018 16:11:35 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED0BA83AE4; Tue, 9 Jan 2018 16:11:34 +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 38E83192A4; Tue, 9 Jan 2018 16:11:34 +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 w09GBY1L076190; Tue, 9 Jan 2018 16:11:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09GBYV5076188; Tue, 9 Jan 2018 16:11:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801091611.w09GBYV5076188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 9 Jan 2018 16:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327729 - in head/sys: cam/scsi i386/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam/scsi i386/isa X-SVN-Commit-Revision: 327729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 16:11:35 -0000 Author: imp Date: Tue Jan 9 16:11:33 2018 New Revision: 327729 URL: https://svnweb.freebsd.org/changeset/base/327729 Log: Remove ccbque.h from i386/isa. inline ccbque.h into scsi_low.h. The file isn't MD, so shouldn't live in i386/isa. It's only used by scsi_low, so move it there so no new clients accidentally grow. scsi_low may not even still work, and the locking here is still SPL based. CAM should do the right thing, but I've received no reports of these cards still working. At least it compiles still and there's one fewer files in sys/i386/isa. While I'm here, ansify and de-splize. CCB_MWANTED appears to be a clear-only flag, but I've not changed that. Differential Review: https://reviews.freebsd.org/D13672 Deleted: head/sys/i386/isa/ccbque.h Modified: head/sys/cam/scsi/scsi_low.c head/sys/cam/scsi/scsi_low.h Modified: head/sys/cam/scsi/scsi_low.c ============================================================================== --- head/sys/cam/scsi/scsi_low.c Tue Jan 9 15:57:09 2018 (r327728) +++ head/sys/cam/scsi/scsi_low.c Tue Jan 9 16:11:33 2018 (r327729) @@ -88,6 +88,65 @@ __FBSDID("$FreeBSD$"); #include /************************************************************** + * CCB Macros + **************************************************************/ + +/* (II) static allocated memory */ +#define GENERIC_CCB_STATIC_ALLOC(DEV, CCBTYPE) \ +static struct CCBTYPE##que CCBTYPE##que; + +/* (III) functions */ +#define GENERIC_CCB(DEV, CCBTYPE, CHAIN) \ + \ +void \ +DEV##_init_ccbque(int count) \ +{ \ + if (CCBTYPE##que.maxccb == 0) \ + TAILQ_INIT(&CCBTYPE##que.CCBTYPE##tab); \ + CCBTYPE##que.maxccb += count; \ +} \ + \ +struct CCBTYPE * \ +DEV##_get_ccb(void) \ +{ \ + struct CCBTYPE *cb; \ + \ + if (CCBTYPE##que.count < CCBTYPE##que.maxccb) \ + { \ + CCBTYPE##que.count ++; \ + cb = TAILQ_FIRST(&(CCBTYPE##que.CCBTYPE##tab)); \ + if (cb != NULL) { \ + TAILQ_REMOVE(&CCBTYPE##que.CCBTYPE##tab, cb, CHAIN);\ + goto out; \ + } else { \ + cb = malloc(sizeof(*cb), M_DEVBUF, M_NOWAIT | M_ZERO); \ + if (cb != NULL) \ + goto out; \ + } \ + CCBTYPE##que.count --; \ + } \ + \ + cb = NULL; \ + \ +out: \ + return cb; \ +} \ + \ +void \ +DEV##_free_ccb(struct CCBTYPE *cb) \ +{ \ + \ + TAILQ_INSERT_TAIL(&CCBTYPE##que.CCBTYPE##tab, cb, CHAIN); \ + CCBTYPE##que.count --; \ + \ + if (CCBTYPE##que.flags & CCB_MWANTED) \ + { \ + CCBTYPE##que.flags &= ~CCB_MWANTED; \ + wakeup ((caddr_t) &CCBTYPE##que.count); \ + } \ +} + +/************************************************************** * Constants **************************************************************/ #define SCSI_LOW_POLL_HZ 1000 Modified: head/sys/cam/scsi/scsi_low.h ============================================================================== --- head/sys/cam/scsi/scsi_low.h Tue Jan 9 15:57:09 2018 (r327728) +++ head/sys/cam/scsi/scsi_low.h Tue Jan 9 16:11:33 2018 (r327729) @@ -57,7 +57,61 @@ #include #include -#include +/************ ccbque.h ***************************/ + +/* $NetBSD$ */ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * [NetBSD for NEC PC98 series] + * Copyright (c) 1994, 1995, 1996 NetBSD/pc98 porting staff. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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$ + */ +/* + * Common command control queue funcs. + * Written by N. Honda. + */ + +#define CCB_MWANTED 0x01 + +/* (I) structure and prototype */ +#define GENERIC_CCB_ASSERT(DEV, CCBTYPE) \ +TAILQ_HEAD(CCBTYPE##tab, CCBTYPE); \ +struct CCBTYPE##que { \ + struct CCBTYPE##tab CCBTYPE##tab; \ + int count; \ + int maxccb; \ + u_int flags; \ +}; \ + \ +void DEV##_init_ccbque(int); \ +struct CCBTYPE *DEV##_get_ccb(void); \ +void DEV##_free_ccb(struct CCBTYPE *); /******** functions macro ************************/ From owner-svn-src-all@freebsd.org Tue Jan 9 16:28:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F298E61D03; Tue, 9 Jan 2018 16:28:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFA4A61; Tue, 9 Jan 2018 16:28:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6378919495; Tue, 9 Jan 2018 16:28:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09GSkEH082295; Tue, 9 Jan 2018 16:28:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09GSkxc082294; Tue, 9 Jan 2018 16:28:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801091628.w09GSkxc082294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jan 2018 16:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327730 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 16:28:47 -0000 Author: kib Date: Tue Jan 9 16:28:45 2018 New Revision: 327730 URL: https://svnweb.freebsd.org/changeset/base/327730 Log: Fix year. Noted by: oshogbo Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/share/man/man4/smp.4 Modified: head/share/man/man4/smp.4 ============================================================================== --- head/share/man/man4/smp.4 Tue Jan 9 16:11:33 2018 (r327729) +++ head/share/man/man4/smp.4 Tue Jan 9 16:28:45 2018 (r327730) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2017 +.Dd January 6, 2018 .Dt SMP 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Tue Jan 9 16:42:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E36E628E6; Tue, 9 Jan 2018 16:42:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00A471E1E; Tue, 9 Jan 2018 16:42: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 4169E197AE; Tue, 9 Jan 2018 16:42:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09GgPAi091363; Tue, 9 Jan 2018 16:42:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09GgP5B091362; Tue, 9 Jan 2018 16:42:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801091642.w09GgP5B091362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 9 Jan 2018 16:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327731 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 327731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 16:42:26 -0000 Author: imp Date: Tue Jan 9 16:42:24 2018 New Revision: 327731 URL: https://svnweb.freebsd.org/changeset/base/327731 Log: Consolidate two identical copies of sysres_ids. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Jan 9 16:28:45 2018 (r327730) +++ head/sys/dev/acpica/acpi.c Tue Jan 9 16:42:24 2018 (r327731) @@ -95,6 +95,9 @@ struct acpi_interface { int num; }; +static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; +static char *pcilink_ids[] = { "PNP0C0F", NULL }; + /* Global mutex for locking access to the ACPI subsystem. */ struct mtx acpi_mutex; struct callout acpi_sleep_timer; @@ -1168,7 +1171,6 @@ acpi_sysres_alloc(device_t dev) struct resource_list *rl; struct resource_list_entry *rle; struct rman *rm; - char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; device_t *children; int child_count, i; @@ -1215,9 +1217,6 @@ acpi_sysres_alloc(device_t dev) } return (0); } - -static char *pcilink_ids[] = { "PNP0C0F", NULL }; -static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; /* * Reserve declared resources for devices found during attach once system From owner-svn-src-all@freebsd.org Tue Jan 9 17:43:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62270E66349; Tue, 9 Jan 2018 17:43:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DECF63CD9; Tue, 9 Jan 2018 17:43:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 19B8810A8C2; Tue, 9 Jan 2018 12:43:52 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327705 - head/stand/mips/beri/common Date: Tue, 09 Jan 2018 09:05:56 -0800 Message-ID: <1620808.I0a57TDRna@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801081847.w08IlZ7F033684@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 09 Jan 2018 12:43:52 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 17:43:53 -0000 On Monday, January 08, 2018 12:02:09 PM Warner Losh wrote: > This should have been a nop... libsa specifically creates 'safe' headers > for all the standard ones. > > Ah, libsa creates a perfectly fine stdint.h, but not a inttypes.h... Would you prefer it to use stdint.h and stdio.h rather than stand.h? > Warner > > On Mon, Jan 8, 2018 at 11:47 AM, John Baldwin wrote: > > > Author: jhb > > Date: Mon Jan 8 18:47:35 2018 > > New Revision: 327705 > > URL: https://svnweb.freebsd.org/changeset/base/327705 > > > > Log: > > Use instead of and in boot code. > > > > In the freestanding boot compile environment, standard headers are not > > available. Curiously, only building with clang exposed this as compiles > > with external GCC still succeeded. > > > > Sponsored by: DARPA / AFRL > > > > Modified: > > head/stand/mips/beri/common/sdcard.c > > > > Modified: head/stand/mips/beri/common/sdcard.c > > ============================================================ > > ================== > > --- head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:46:10 2018 > > (r327704) > > +++ head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:47:35 2018 > > (r327705) > > @@ -33,8 +33,7 @@ > > #include > > #include > > > > -#include > > -#include > > +#include > > > > > > /* > > > > -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jan 9 17:48:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0967AE66727 for ; Tue, 9 Jan 2018 17:48:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0A2F63F99 for ; Tue, 9 Jan 2018 17:48:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id u62so12574290ita.2 for ; Tue, 09 Jan 2018 09:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=uA8gvuG8XsN5vBKk5CKpE9fdUEEYCKwKpQRxIkuKqNg=; b=URxWOIHKeQ5cYWtDoG0N8yPNsLXNwSbeiCT7K31Zy21izxo6MwrZpAav2I0I6BLT5o OJZXqxyOU4IVcQ+XO0IIqYNoxR/kMzWvrHgG/q2YF1miKhYh4M/SoIabj8DKw6zQZGag AMkZA8pAGL3Zt4Xmu4BNZ512LTUMPnsNRATSPSHJmcAxI3N2zA8s7cHmx+iQTGFTOhiB hXXJ0o/RXFjFu5A00z7RQ8k0d+XQDoAc6JXXgquxgH3+GNKh96WD7AAFA9m5GDkM1imj HYanU8869uIXH4VFs8qJiX7Wn45R+IQeoVT+cMrjdUha9kot33CVMCOrdT+C7JkgQrSA Pp/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=uA8gvuG8XsN5vBKk5CKpE9fdUEEYCKwKpQRxIkuKqNg=; b=M09lsWgYWaorXGPwsqYYd8zZqa0nY89R9xAI2iM2rw1wLpXo58DWiVWijf+zb4ZDFn XbQMu8lBbmIMngOtOgTb79hVMDOijGo4Xzfek9qtgLiUlkpodXum1JQn1+118ShtXQkr ALKOFzHtbJXfaqs9sOcXOx89IfVu4+pAV4XWngBQMSlLwEFXWq365Rdun/ypV5vw1JBU cE6R7Iatn34xqVYhP7WUD4br/IQ8+dT5Q7HdhFkXRgGAXH2klW17fx3aGcb5t7juhEaL QDbiAthF3XwNkp/gM4yNzbPEZoLMBnzulJ6+ed9fmnoq9qSTILw5+M7NwPPkL9PzIiUi VclQ== X-Gm-Message-State: AKGB3mL9fM8+YEhNBLL2tuU3wzzLOG4TaQnN/RBJg2oEEWdpEbe3MCyO LLI+d93JaLQAzpIgyXuosf4KSztGAvBjjZgYXrnT+w== X-Google-Smtp-Source: ACJfBouWn8LLRwpGP7K7bW/Cx37XEXo211orzaCH2Xp92uHYSGH2jLDGcAECHZpR41Cwl1y+BmFCmhD/rdmh0O5CZ5s= X-Received: by 10.36.74.200 with SMTP id k191mr17037618itb.69.1515520110840; Tue, 09 Jan 2018 09:48:30 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Tue, 9 Jan 2018 09:48:30 -0800 (PST) X-Originating-IP: [50.253.109.65] In-Reply-To: <1620808.I0a57TDRna@ralph.baldwin.cx> References: <201801081847.w08IlZ7F033684@repo.freebsd.org> <1620808.I0a57TDRna@ralph.baldwin.cx> From: Warner Losh Date: Tue, 9 Jan 2018 10:48:30 -0700 X-Google-Sender-Auth: _7LeqX-G8ElTKISAwH5jLcrZtRU Message-ID: Subject: Re: svn commit: r327705 - head/stand/mips/beri/common To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 17:48:32 -0000 On Tue, Jan 9, 2018 at 10:05 AM, John Baldwin wrote: > On Monday, January 08, 2018 12:02:09 PM Warner Losh wrote: > > This should have been a nop... libsa specifically creates 'safe' headers > > for all the standard ones. > > > > Ah, libsa creates a perfectly fine stdint.h, but not a inttypes.h... > > Would you prefer it to use stdint.h and stdio.h rather than stand.h? No. stand.h is fine. I just wondered why you hit issues at all with stdio.h. inttypes.h isn't supported because we don't implement the extra functions defined there over stdint.h, so it should have given an error when included. I'm just surprised I didn't catch it in my universe.sh script that I use to build all loaders though... Warner > > Warner > > > > On Mon, Jan 8, 2018 at 11:47 AM, John Baldwin wrote: > > > > > Author: jhb > > > Date: Mon Jan 8 18:47:35 2018 > > > New Revision: 327705 > > > URL: https://svnweb.freebsd.org/changeset/base/327705 > > > > > > Log: > > > Use instead of and in boot code. > > > > > > In the freestanding boot compile environment, standard headers are > not > > > available. Curiously, only building with clang exposed this as > compiles > > > with external GCC still succeeded. > > > > > > Sponsored by: DARPA / AFRL > > > > > > Modified: > > > head/stand/mips/beri/common/sdcard.c > > > > > > Modified: head/stand/mips/beri/common/sdcard.c > > > ============================================================ > > > ================== > > > --- head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:46:10 > 2018 > > > (r327704) > > > +++ head/stand/mips/beri/common/sdcard.c Mon Jan 8 18:47:35 > 2018 > > > (r327705) > > > @@ -33,8 +33,7 @@ > > > #include > > > #include > > > > > > -#include > > > -#include > > > +#include > > > > > > > > > /* > > > > > > > > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Tue Jan 9 19:02:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DBFFE6AE66; Tue, 9 Jan 2018 19:02:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18FDA6B3D1; Tue, 9 Jan 2018 19:02:43 +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 6B5C71AF67; Tue, 9 Jan 2018 19:02:42 +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 w09J2g1T049858; Tue, 9 Jan 2018 19:02:42 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09J2gRS049857; Tue, 9 Jan 2018 19:02:42 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201801091902.w09J2gRS049857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 9 Jan 2018 19:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327735 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 327735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 19:02:43 -0000 Author: kp Date: Tue Jan 9 19:02:42 2018 New Revision: 327735 URL: https://svnweb.freebsd.org/changeset/base/327735 Log: pf tests: Fix pft_ping.py to work with scapy 2.3.3 Scapy requires the Raw payload to be a string, which was not the case. This caused the pft_ping.py script to fail, which in turn caused the test to fail. Modified: head/tests/sys/netpfil/pf/pft_ping.py Modified: head/tests/sys/netpfil/pf/pft_ping.py ============================================================================== --- head/tests/sys/netpfil/pf/pft_ping.py Tue Jan 9 17:41:34 2018 (r327734) +++ head/tests/sys/netpfil/pf/pft_ping.py Tue Jan 9 19:02:42 2018 (r327735) @@ -79,7 +79,7 @@ def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) icmp = sp.ICMP(type='echo-request') - raw = sp.Raw(PAYLOAD_MAGIC) + raw = sp.Raw(str(PAYLOAD_MAGIC)) if args.send_tos: ip.tos = int(args.send_tos[0]) From owner-svn-src-all@freebsd.org Tue Jan 9 19:41:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E66E6D615; Tue, 9 Jan 2018 19:41:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BAC46CBEB; Tue, 9 Jan 2018 19:41:11 +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 DC43B1B56D; Tue, 9 Jan 2018 19:41:10 +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 w09JfAh4064371; Tue, 9 Jan 2018 19:41:10 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09JfAvF064370; Tue, 9 Jan 2018 19:41:10 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801091941.w09JfAvF064370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 9 Jan 2018 19:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327736 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 327736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 19:41:11 -0000 Author: nwhitehorn Date: Tue Jan 9 19:41:10 2018 New Revision: 327736 URL: https://svnweb.freebsd.org/changeset/base/327736 Log: Add XHCI support to powerpc64 GENERIC. This is useful to get input devices supported on newer POWER hardware and in graphical VMs run on the same, which are typically XHCI-only. The 32-bit GENERIC kernel, which does not run on hardware made in the last decade and is unlikely to encounter XHCI devices, is left unchanged. PR: kern/224940 Submitted by: Gustavo Romero MFC after: 1 week Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Tue Jan 9 19:02:42 2018 (r327735) +++ head/sys/powerpc/conf/GENERIC64 Tue Jan 9 19:41:10 2018 (r327736) @@ -173,6 +173,7 @@ options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface +device xhci # XHCI PCI->USB interface device usb # USB Bus (required) device uhid # "Human Interface Devices" device ukbd # Keyboard From owner-svn-src-all@freebsd.org Tue Jan 9 20:06:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BB71E6EC13; Tue, 9 Jan 2018 20:06:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5A16DCF2; Tue, 9 Jan 2018 20:06:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r327706 - in head/sys: conf contrib/zstd/lib/freebsd To: "O. Hartmann" , Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801082014.w08KEGv8071627@repo.freebsd.org> <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> From: Jung-uk Kim Message-ID: Date: Tue, 9 Jan 2018 15:06:23 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OjetDBMHcicdtFM2d9KFQ5unK6VeKr8gi" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 20:06:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OjetDBMHcicdtFM2d9KFQ5unK6VeKr8gi Content-Type: multipart/mixed; boundary="hlOuFXcISLJWP5wSum5yijB0ocDxzKtlj"; protected-headers="v1" From: Jung-uk Kim To: "O. Hartmann" , Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r327706 - in head/sys: conf contrib/zstd/lib/freebsd References: <201801082014.w08KEGv8071627@repo.freebsd.org> <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> --hlOuFXcISLJWP5wSum5yijB0ocDxzKtlj Content-Type: multipart/mixed; boundary="------------7E711460D23535621727A074" Content-Language: en-US This is a multi-part message in MIME format. --------------7E711460D23535621727A074 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2018 04:47, O. Hartmann wrote: > On Mon, 8 Jan 2018 20:14:16 +0000 (UTC) > Conrad Meyer wrote: >=20 >> Author: cem >> Date: Mon Jan 8 20:14:16 2018 >> New Revision: 327706 >> URL: https://svnweb.freebsd.org/changeset/base/327706 >> >> Log: >> Integrate zstd into the kernel >> =20 >> Mock userspace headers and include mocked headers first in compilati= on >> command to inject kernel headers and override e.g., malloc(3) with >> malloc(9). >> =20 >> Submitted by: allanjude >> Reviewed by: imp (earlier version), bapt (earlier version) >> Differential Revision: https://reviews.freebsd.org/D10407 >> >> Added: >> head/sys/contrib/zstd/lib/freebsd/ >> head/sys/contrib/zstd/lib/freebsd/stddef.h (contents, props change= d) >> head/sys/contrib/zstd/lib/freebsd/stdint.h (contents, props change= d) >> head/sys/contrib/zstd/lib/freebsd/stdio.h (contents, props changed= ) >> head/sys/contrib/zstd/lib/freebsd/stdlib.h (contents, props change= d) >> head/sys/contrib/zstd/lib/freebsd/string.h (contents, props change= d) >> head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h (contents, props= >> changed) head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c (contents,= props >> changed) Modified: >> head/sys/conf/files >> head/sys/conf/kern.pre.mk =2E.. > It seems that CURRENT is unwilling to build due to the error shown belo= w: >=20 > [...] > --- fse_decompress.o --- > In file included from /usr/src/sys/contrib/zstd/lib/common/fse_decompre= ss.c:41: > /usr/src/sys/contrib/zstd/lib/common/bitstream.h:71:12: fatal error: > 'immintrin.h' file not found # include /* support for = bextr > (experimental) */ ^~~~~~~~~~~~~ > --- modules-all --- I reported the same problem yesterday but I didn't get any reply yet. Basically, if CPUTYPE is set in /etc/make.conf and the CPU supports BMI instructions, it breaks. You can use the attached patch as a stopgap. Please note the patch was updated after r327715. Jung-uk Kim --------------7E711460D23535621727A074 Content-Type: text/x-patch; name="zstd.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zstd.diff" Index: sys/conf/kern.pre.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/conf/kern.pre.mk (revision 327736) +++ sys/conf/kern.pre.mk (working copy) @@ -133,7 +133,7 @@ NORMAL_FWO=3D ${LD} -b binary --no-warn-mismatch -d -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} =20 # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) -ZSTD_C=3D ${CC} -c -DZSTD_HEAPMODE=3D1 -I$S/contrib/zstd/lib/freebsd ${C= FLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-= inline -Wno-missing-prototypes ${PROF} ${.IMPSRC} +ZSTD_C=3D ${CC} -c -DZSTD_HEAPMODE=3D1 -U__BMI__ -I$S/contrib/zstd/lib/f= reebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WER= ROR} -Wno-inline -Wno-missing-prototypes ${PROF} ${.IMPSRC} =20 # Common for dtrace / zfs CDDL_CFLAGS=3D -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolari= s -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensol= aris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-u= ndef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundan= t-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -W= no-switch -Wno-pointer-arith -Wno-unknown-pragmas --------------7E711460D23535621727A074-- --hlOuFXcISLJWP5wSum5yijB0ocDxzKtlj-- --OjetDBMHcicdtFM2d9KFQ5unK6VeKr8gi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlpVIL8ACgkQfJ+WJvzb 8UaONwgAj4jnrogWEJ4FIIvf7qwgtnyX7jrcEq5VaHWVE2KS1lN5hfuuYGAFgwM+ NbClJVCxN7FVKaxha8aCgJFOJgIDX4gESTi++YL3b+29FbzOuCh379vjdB5AIYYg oiMKqsdj8PyvR08QWttl6gpfkQ5G/Goo6n8t+ouxwCHz/c4Mrmb7/24GwaTXuwMf fRjcwK3Poc9APgQaP6oJRnfgcTtP1ggOZuSu+s6zRl3C68eY0VRXv36yOIDFjiVo gEVn5AjYhXfeiz782ouPDaIc3N3To5bl3W0jOr0nzxda6Vr4xXAYuw/9GoSXgqCg DaS3cRrKtJvKvnJVT6HyYwqsr4dWMw== =vAtt -----END PGP SIGNATURE----- --OjetDBMHcicdtFM2d9KFQ5unK6VeKr8gi-- From owner-svn-src-all@freebsd.org Tue Jan 9 20:20:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B95E6FC1B; Tue, 9 Jan 2018 20:20:02 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 315826E904; Tue, 9 Jan 2018 20:20:01 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.187.186]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MTO3f-1ePPpu0BgF-00SKqP; Tue, 09 Jan 2018 21:19:53 +0100 Date: Tue, 9 Jan 2018 21:19:12 +0100 From: "O. Hartmann" To: Jung-uk Kim Cc: "O. Hartmann" , Conrad Meyer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r327706 - in head/sys: conf contrib/zstd/lib/freebsd Message-ID: <20180109211939.1c4dc54e@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201801082014.w08KEGv8071627@repo.freebsd.org> <20180109104739.3fc77a44@freyja.zeit4.iv.bundesimmobilien.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Mmi/ZVwQtN6Pz_uT3+x_xTl"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:8Geq15TH/TiQ97G44TgfpDNJoMHscMNTvE2Nlv8JIs3u5isgh9E Q70XP58Y2Am1Flo7bLJjBJWDU7eQkCMRNjR1eUTqIxyTgbzkXaoQEQqlSLNX2DvzJnf6/18 sIuP0YXa2LRT5HfW466T6ul+S9CL8iLheMvH14evWAZuIm6gpWR/o/e9dnvxmFgSjdYQCqM xPZ6rua8FqwdnH/N7giGQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:JLRue7ufKqE=:tydmPbY5kk8kanHMW7A1Ee RzF0AY4xKtGn1qFeNoEv0yNQj/MQSp8lgJPBuf+VDeoiwHaX59NsVKsYFAnF4s2HGDP5pMBnj tgIk6cx50yuImzDSyEG23IQDYY3c80q2A6YX4xTibptkvV8GLgZSi8KE1/oAV3bgSgiSIki5k Nfc0bQZ06I8DcOgbQgbK+gXPLMyUD7NbQWHShptTsFRM862yrafFWtDxMjrloK0evWUeS6jDc W5OeSznbiZy6WxglSm9w8JoCbha9RbITeku1RjNrFPd0/Uzb9xylAHWHZXK2BjaRIgghGKLgJ vxZUyvR/2XBbR9hfC19AG/KvFfqgHw8PBDZbM9zdefEcxGFuTIne3JUxw6i2K0GzsBJPLhhpY A4b0rmgSV6GQPS3jI0+liG6MmgMDTKeB5iMGJxHVzXRQYeF21FwVEkZYWTG7OKCDFzKopfUvc iLjoQFuFAQynz9jYfMhm1OkLuHYKfAAGpV/zOWJZWZ53ymtbgeJBP57cUzmBWW4KnlF9DszZt i5t+I8alUx0dExiaaOgCt3EwsPaYxPz2sDBdYk3nE5KdQBGEA56q37HbkIAmvl6CA10snJg0S gVk3I9Co11dixAOFcKoiAoYCgtd2iDkSVff+fZ/0gn7f1zRDH4fIJdqKRMzWQQ8mTZMpWmbaU i22QDNa5UYlR/bNzvfHXv60cMsmivlBOD6mUJUk0NGHmxr0SrCqCfE2x2HB6WJhZJjTlrQYic /yi2j9Si1dHIdayJ/jTGTJiOOK11TFaOwIh0q8afYliRPy7bOk0oWcqIWoC5uqtwoaZ2Yh2Dy L4vIwUq7Q8EME/1ms5uYyuNk0dv+Q== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 20:20:02 -0000 --Sig_/Mmi/ZVwQtN6Pz_uT3+x_xTl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Tue, 9 Jan 2018 15:06:23 -0500 Jung-uk Kim schrieb: > On 01/09/2018 04:47, O. Hartmann wrote: > > On Mon, 8 Jan 2018 20:14:16 +0000 (UTC) > > Conrad Meyer wrote: > > =20 > >> Author: cem > >> Date: Mon Jan 8 20:14:16 2018 > >> New Revision: 327706 > >> URL: https://svnweb.freebsd.org/changeset/base/327706 > >> > >> Log: > >> Integrate zstd into the kernel > >> =20 > >> Mock userspace headers and include mocked headers first in compilati= on > >> command to inject kernel headers and override e.g., malloc(3) with > >> malloc(9). > >> =20 > >> Submitted by: allanjude > >> Reviewed by: imp (earlier version), bapt (earlier version) > >> Differential Revision: https://reviews.freebsd.org/D10407 > >> > >> Added: > >> head/sys/contrib/zstd/lib/freebsd/ > >> head/sys/contrib/zstd/lib/freebsd/stddef.h (contents, props change= d) > >> head/sys/contrib/zstd/lib/freebsd/stdint.h (contents, props change= d) > >> head/sys/contrib/zstd/lib/freebsd/stdio.h (contents, props changed) > >> head/sys/contrib/zstd/lib/freebsd/stdlib.h (contents, props change= d) > >> head/sys/contrib/zstd/lib/freebsd/string.h (contents, props change= d) > >> head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h (contents, props > >> changed) head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c (contents,= props > >> changed) Modified: > >> head/sys/conf/files > >> head/sys/conf/kern.pre.mk =20 >=20 > ... >=20 > > It seems that CURRENT is unwilling to build due to the error shown belo= w: > >=20 > > [...] > > --- fse_decompress.o --- > > In file included from /usr/src/sys/contrib/zstd/lib/common/fse_decompre= ss.c:41: > > /usr/src/sys/contrib/zstd/lib/common/bitstream.h:71:12: fatal error: > > 'immintrin.h' file not found # include /* support for = bextr > > (experimental) */ ^~~~~~~~~~~~~ > > --- modules-all --- =20 >=20 > I reported the same problem yesterday but I didn't get any reply yet. > Basically, if CPUTYPE is set in /etc/make.conf and the CPU supports BMI > instructions, it breaks. You can use the attached patch as a stopgap. > Please note the patch was updated after r327715. >=20 > Jung-uk Kim Thank you very much. Didn't receive any answere, too, so far. Indeed, CPUTYPE is set and compilation breaks on all >=3D Haswell CPUs, whi= le C2D and IvyBridge do ... Regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/Mmi/ZVwQtN6Pz_uT3+x_xTl Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWlUj2wAKCRDS528fyFhY lHSWAgCS8DrlD3TrszNjlhkGAfP/X+Gw6vdIaqKyAf2Sx+Kdy1V3hOeS2nhQ4XvZ ThxYtmeNUYgPMH8capRo1DrHOoIHAf9sI5TCDIjbnUx+fPSEiYltjf4Gi2T/XW0S TVLgCAe+oovU8LWoJMbEYdvwgAJ3gTIeQMwhq97rw9WN6hdnTl9l =SB9O -----END PGP SIGNATURE----- --Sig_/Mmi/ZVwQtN6Pz_uT3+x_xTl-- From owner-svn-src-all@freebsd.org Tue Jan 9 20:35:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A2EEE709E1; Tue, 9 Jan 2018 20:35:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 543FD6F611; Tue, 9 Jan 2018 20:35:59 +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 910561BE73; Tue, 9 Jan 2018 20:35:58 +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 w09KZwUd089334; Tue, 9 Jan 2018 20:35:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09KZwUs089333; Tue, 9 Jan 2018 20:35:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801092035.w09KZwUs089333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 9 Jan 2018 20:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327737 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 327737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 20:35:59 -0000 Author: cy Date: Tue Jan 9 20:35:58 2018 New Revision: 327737 URL: https://svnweb.freebsd.org/changeset/base/327737 Log: USNO and possibly others have misinterpreted the maining of the leapseconds last-update field and incorrectly increment it when changing the file even though the leapsecond data has not changed. For instance, if a leapsecond file is obtained from USNO, when it expires it will not be replaced by a newer file from other sources because it has an incorrect later last-update (version). This corrects r304780. PR: 225029 Submitted by: ian MFC after: 3 days Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Tue Jan 9 19:41:10 2018 (r327736) +++ head/etc/rc.d/ntpd Tue Jan 9 20:35:58 2018 (r327737) @@ -144,9 +144,9 @@ ntpd_fetch_leapfile() { done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) ntp_expiry_tmp=$(get_ntp_leapfile_expiry $ntp_tmp_leapfile) - if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" -o \ - "$ntp_ver_no_tmp" -eq "$ntp_ver_no_db" -a \ - "$ntp_expiry_tmp" -gt "$ntp_expiry_db" ]; then + if [ "$ntp_expiry_tmp" -gt "$ntp_expiry_db" -o \ + "$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \ + "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then $verbose using $url as $ntp_db_leapfile mv $ntp_tmp_leapfile $ntp_db_leapfile else From owner-svn-src-all@freebsd.org Tue Jan 9 20:53:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A756E71D86; Tue, 9 Jan 2018 20:53:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6317073F; Tue, 9 Jan 2018 20:53:32 +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 357991C1DE; Tue, 9 Jan 2018 20:53:31 +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 w09KrVYv098503; Tue, 9 Jan 2018 20:53:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09KrV2L098502; Tue, 9 Jan 2018 20:53:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801092053.w09KrV2L098502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 9 Jan 2018 20:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327738 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 327738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 20:53:32 -0000 Author: cem Date: Tue Jan 9 20:53:30 2018 New Revision: 327738 URL: https://svnweb.freebsd.org/changeset/base/327738 Log: Fix Zstd x86 kernel build with -march= Disable Zstd experimental support for __BMI__ intrinsics, when built with -march=foo supporting such intrinsics, to avoid attempting to include immintrin.h. If a later Zstd marks the support non-experimental, we may want to revisit this approach. Submitted by: jkim Reported by: jkim, "Oliver Hartmann" Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 9 20:35:58 2018 (r327737) +++ head/sys/conf/kern.pre.mk Tue Jan 9 20:53:30 2018 (r327738) @@ -133,7 +133,7 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -war -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) -ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} ${.IMPSRC} +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC} # Common for dtrace / zfs CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas From owner-svn-src-all@freebsd.org Tue Jan 9 21:02:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FFAE7268C; Tue, 9 Jan 2018 21:02:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D16870F35; Tue, 9 Jan 2018 21:02:41 +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 8073C1C385; Tue, 9 Jan 2018 21:02:40 +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 w09L2efk002943; Tue, 9 Jan 2018 21:02:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09L2eGm002942; Tue, 9 Jan 2018 21:02:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801092102.w09L2eGm002942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 9 Jan 2018 21:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327739 - head/contrib/subversion/subversion/svn svnadmin/hooks/scripts X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/subversion/subversion/svn svnadmin/hooks/scripts X-SVN-Commit-Revision: 327739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 21:02:41 -0000 Author: asomers Date: Tue Jan 9 21:02:39 2018 New Revision: 327739 URL: https://svnweb.freebsd.org/changeset/base/327739 Log: Add Pull Request to the Subversion commit template Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13178 Modified: head/contrib/subversion/subversion/svn/util.c Changes in other areas also in this revision: Modified: svnadmin/hooks/scripts/log-police.py Modified: head/contrib/subversion/subversion/svn/util.c ============================================================================== --- head/contrib/subversion/subversion/svn/util.c Tue Jan 9 20:53:30 2018 (r327738) +++ head/contrib/subversion/subversion/svn/util.c Tue Jan 9 21:02:39 2018 (r327739) @@ -352,6 +352,7 @@ static const char *prefixes[] = { "Relnotes:", "Security:", "Sponsored by:", + "Pull Request:", "Differential Revision:", }; @@ -443,6 +444,7 @@ svn_cl__get_log_message(const char **log_msg, if (sponsored_by != NULL) svn_stringbuf_appendcstr(default_msg, sponsored_by); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Pull Request:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Differential Revision:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); @@ -458,6 +460,7 @@ svn_cl__get_log_message(const char **log_msg, svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Pull Request: https://github.com/freebsd/freebsd/pull/### (*full* GitHub URL needed)." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed)." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be automatically removed." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); From owner-svn-src-all@freebsd.org Tue Jan 9 21:02:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42012E72689; Tue, 9 Jan 2018 21:02:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D33670F34; Tue, 9 Jan 2018 21:02:41 +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 651731C384; Tue, 9 Jan 2018 21:02:40 +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 w09L2eQk002936; Tue, 9 Jan 2018 21:02:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09L2ewO002935; Tue, 9 Jan 2018 21:02:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801092102.w09L2ewO002935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 9 Jan 2018 21:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r327739 - head/contrib/subversion/subversion/svn svnadmin/hooks/scripts X-SVN-Group: svnadmin X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/subversion/subversion/svn svnadmin/hooks/scripts X-SVN-Commit-Revision: 327739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 21:02:41 -0000 Author: asomers Date: Tue Jan 9 21:02:39 2018 New Revision: 327739 URL: https://svnweb.freebsd.org/changeset/base/327739 Log: Add Pull Request to the Subversion commit template Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13178 Modified: svnadmin/hooks/scripts/log-police.py Changes in other areas also in this revision: Modified: head/contrib/subversion/subversion/svn/util.c Modified: svnadmin/hooks/scripts/log-police.py ============================================================================== --- svnadmin/hooks/scripts/log-police.py Tue Jan 9 20:53:30 2018 (r327738) +++ svnadmin/hooks/scripts/log-police.py Tue Jan 9 21:02:39 2018 (r327739) @@ -57,6 +57,7 @@ def fix_log_message(log_message): if line == "Changes:": continue if line == "With hat:": continue if line == "Sponsored by:": continue + if line == "Pull Request:": continue if line == "Differential Revision:": continue s = s + line + "\n" s = s.rstrip() + "\n" From owner-svn-src-all@freebsd.org Tue Jan 9 21:12:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 924FAE73024; Tue, 9 Jan 2018 21:12:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D89571862; Tue, 9 Jan 2018 21:12:54 +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 AC3601C56B; Tue, 9 Jan 2018 21:12:53 +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 w09LCrhj007090; Tue, 9 Jan 2018 21:12:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09LCrHT007089; Tue, 9 Jan 2018 21:12:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801092112.w09LCrHT007089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 9 Jan 2018 21:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327740 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 327740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 21:12:54 -0000 Author: bdrewery Date: Tue Jan 9 21:12:53 2018 New Revision: 327740 URL: https://svnweb.freebsd.org/changeset/base/327740 Log: Bump version for r327597 adding cpucontrol -e support Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jan 9 21:02:39 2018 (r327739) +++ head/sys/sys/param.h Tue Jan 9 21:12:53 2018 (r327740) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200054 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200055 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Jan 9 21:23:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 816DBE7395D; Tue, 9 Jan 2018 21:23:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56BDB7205B; Tue, 9 Jan 2018 21:23:17 +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 5F6F41C749; Tue, 9 Jan 2018 21:23:16 +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 w09LNGXP011540; Tue, 9 Jan 2018 21:23:16 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09LNGV1011539; Tue, 9 Jan 2018 21:23:16 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801092123.w09LNGV1011539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327741 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 327741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 21:23:17 -0000 Author: scottl Date: Tue Jan 9 21:23:16 2018 New Revision: 327741 URL: https://svnweb.freebsd.org/changeset/base/327741 Log: Hold a refcount on the periph while running the allocation queue. This will allow sub-transports to release their probe pseudo-device with fewer convoluted restrictions. Obtained from: Netflix Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jan 9 21:12:53 2018 (r327740) +++ head/sys/cam/cam_xpt.c Tue Jan 9 21:23:16 2018 (r327741) @@ -3383,6 +3383,7 @@ xpt_run_allocq(struct cam_periph *periph, int sleep) cam_periph_assert(periph, MA_OWNED); if (periph->periph_allocating) return; + cam_periph_doacquire(periph); periph->periph_allocating = 1; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_allocq(%p)\n", periph)); device = periph->path->device; @@ -3426,6 +3427,7 @@ restart: if (ccb != NULL) xpt_release_ccb(ccb); periph->periph_allocating = 0; + cam_periph_release_locked(periph); } static void From owner-svn-src-all@freebsd.org Tue Jan 9 21:24:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20114E73B88; Tue, 9 Jan 2018 21:24:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CFC772235; Tue, 9 Jan 2018 21:24:06 +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 DC2321C74E; Tue, 9 Jan 2018 21:24:05 +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 w09LO5VJ011612; Tue, 9 Jan 2018 21:24:05 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09LO5l3011611; Tue, 9 Jan 2018 21:24:05 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801092124.w09LO5l3011611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 21:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327742 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 327742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 21:24:07 -0000 Author: scottl Date: Tue Jan 9 21:24:05 2018 New Revision: 327742 URL: https://svnweb.freebsd.org/changeset/base/327742 Log: Release the held refcount on the probe periph when probing is done, now that r327741 lets this happen. Obtained from: Netflix Modified: head/sys/cam/nvme/nvme_xpt.c Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Tue Jan 9 21:23:16 2018 (r327741) +++ head/sys/cam/nvme/nvme_xpt.c Tue Jan 9 21:24:05 2018 (r327742) @@ -318,8 +318,7 @@ nvme_probe_start(struct cam_periph *periph, union ccb xpt_done(start_ccb); } cam_periph_invalidate(periph); - /* Can't release periph since we hit a (possibly bogus) assertion */ -// cam_periph_release_locked(periph); + cam_periph_release_locked(periph); } static void From owner-svn-src-all@freebsd.org Tue Jan 9 22:48:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733E3E77DF7; Tue, 9 Jan 2018 22:48:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E29C756ED; Tue, 9 Jan 2018 22:48:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BB011D468; Tue, 9 Jan 2018 22:48:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09MmDSw046085; Tue, 9 Jan 2018 22:48:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09MmDG1046084; Tue, 9 Jan 2018 22:48:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801092248.w09MmDG1046084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 9 Jan 2018 22:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327751 - head/include X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 327751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 22:48:14 -0000 Author: pfg Date: Tue Jan 9 22:48:13 2018 New Revision: 327751 URL: https://svnweb.freebsd.org/changeset/base/327751 Log: Use the __result_use_check attribute also for reallocf(3). The GCC attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. Unlike the traditional realloc, with reallocf(3) we don't have to check for NULL values but we still have to make sure the result is used. MFC after: 3 days Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Tue Jan 9 22:00:06 2018 (r327750) +++ head/include/stdlib.h Tue Jan 9 22:48:13 2018 (r327751) @@ -304,7 +304,7 @@ int radixsort(const unsigned char **, int, const unsi unsigned); void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2) __alloc_size(3); -void *reallocf(void *, size_t) __alloc_size(2); +void *reallocf(void *, size_t) __result_use_check __alloc_size(2); int rpmatch(const char *); void setprogname(const char *); int sradixsort(const unsigned char **, int, const unsigned char *, From owner-svn-src-all@freebsd.org Tue Jan 9 23:57:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BF84E7B726; Tue, 9 Jan 2018 23:57:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3867277D47; Tue, 9 Jan 2018 23:57:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BB821DFA6; Tue, 9 Jan 2018 23:57:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w09NvTaU075280; Tue, 9 Jan 2018 23:57:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09NvTFO075279; Tue, 9 Jan 2018 23:57:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801092357.w09NvTFO075279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 9 Jan 2018 23:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327752 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Jan 2018 23:57:30 -0000 Author: jhb Date: Tue Jan 9 23:57:29 2018 New Revision: 327752 URL: https://svnweb.freebsd.org/changeset/base/327752 Log: Add a counter to track in-flight AIO requests using unmapped I/O. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Tue Jan 9 22:48:13 2018 (r327751) +++ head/sys/kern/vfs_aio.c Tue Jan 9 23:57:29 2018 (r327752) @@ -150,6 +150,11 @@ static int num_buf_aio = 0; SYSCTL_INT(_vfs_aio, OID_AUTO, num_buf_aio, CTLFLAG_RD, &num_buf_aio, 0, "Number of aio requests presently handled by the buf subsystem"); +static int num_unmapped_aio = 0; +SYSCTL_INT(_vfs_aio, OID_AUTO, num_unmapped_aio, CTLFLAG_RD, &num_unmapped_aio, + 0, + "Number of aio requests presently handled by unmapped I/O buffers"); + /* Number of async I/O processes in the process of being started */ /* XXX This should be local to aio_aqueue() */ static int num_aio_resv_start = 0; @@ -1305,6 +1310,7 @@ aio_qphysio(struct proc *p, struct kaiocb *job) bp->bio_ma_offset = poff; bp->bio_data = unmapped_buf; bp->bio_flags |= BIO_UNMAPPED; + atomic_add_int(&num_unmapped_aio, 1); } /* Perform transfer. */ @@ -2365,7 +2371,8 @@ aio_physwakeup(struct bio *bp) AIO_LOCK(ki); ki->kaio_buffer_count--; AIO_UNLOCK(ki); - } + } else + atomic_subtract_int(&num_unmapped_aio, 1); vm_page_unhold_pages(job->pages, job->npages); bp = job->bp; From owner-svn-src-all@freebsd.org Wed Jan 10 00:02:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1AB5E7BC77; Wed, 10 Jan 2018 00:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD41D782CC; Wed, 10 Jan 2018 00:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2192F1E13A; Wed, 10 Jan 2018 00:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0A027C1079443; Wed, 10 Jan 2018 00:02:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A026Oi079442; Wed, 10 Jan 2018 00:02:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801100002.w0A026Oi079442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Jan 2018 00:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327753 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 00:02:08 -0000 Author: jhb Date: Wed Jan 10 00:02:06 2018 New Revision: 327753 URL: https://svnweb.freebsd.org/changeset/base/327753 Log: Simplify some logic by merging an if test with a subsequent switch. Specifically, in aio_queue_file() the code was doing this: if (opcode == LIO_SYNC) { ... } switch (opcode) { ... case LIO_SYNC: ... } This moves the body of the if statement into the LIO_SYNC case of the switch statement. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Tue Jan 9 23:57:29 2018 (r327752) +++ head/sys/kern/vfs_aio.c Wed Jan 10 00:02:06 2018 (r327753) @@ -1736,7 +1736,13 @@ queueit: return (EOPNOTSUPP); } - if (opcode == LIO_SYNC) { + switch (job->uaiocb.aio_lio_opcode) { + case LIO_READ: + case LIO_WRITE: + aio_schedule(job, aio_process_rw); + error = 0; + break; + case LIO_SYNC: AIO_LOCK(ki); TAILQ_FOREACH(job2, &ki->kaio_jobqueue, plist) { if (job2->fd_file == job->fd_file && @@ -1758,15 +1764,6 @@ queueit: return (0); } AIO_UNLOCK(ki); - } - - switch (opcode) { - case LIO_READ: - case LIO_WRITE: - aio_schedule(job, aio_process_rw); - error = 0; - break; - case LIO_SYNC: aio_schedule(job, aio_process_sync); error = 0; break; From owner-svn-src-all@freebsd.org Wed Jan 10 00:08:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D80AE7C2C2; Wed, 10 Jan 2018 00:08:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2861878691; Wed, 10 Jan 2018 00:08:58 +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 78A4C1E15B; Wed, 10 Jan 2018 00:08:57 +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 w0A08v6s079688; Wed, 10 Jan 2018 00:08:57 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A08veS079687; Wed, 10 Jan 2018 00:08:57 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201801100008.w0A08veS079687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 10 Jan 2018 00:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327754 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 327754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 00:08:58 -0000 Author: jtl Date: Wed Jan 10 00:08:57 2018 New Revision: 327754 URL: https://svnweb.freebsd.org/changeset/base/327754 Log: Fix backwards MD_VERIFY logic for md devices. If the MD_VERIFY flag is set, we should use O_VERIFY. If the MD_VERIFY flag is not set, we should not. Reviewed by: stevek Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13814 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Jan 10 00:02:06 2018 (r327753) +++ head/sys/dev/md/md.c Wed Jan 10 00:08:57 2018 (r327754) @@ -1392,7 +1392,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, * set the FWRITE mask before trying to open the backing store. */ flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \ - | ((mdio->md_options & MD_VERIFY) ? 0 : O_VERIFY); + | ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0); NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); error = vn_open(&nd, &flags, 0, NULL); if (error != 0) From owner-svn-src-all@freebsd.org Wed Jan 10 00:18:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A4BE7CAE1; Wed, 10 Jan 2018 00:18:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC5B78CF1; Wed, 10 Jan 2018 00:18:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5599D1E2FB; Wed, 10 Jan 2018 00:18:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0A0Imb1083684; Wed, 10 Jan 2018 00:18:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A0ImEb083683; Wed, 10 Jan 2018 00:18:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801100018.w0A0ImEb083683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Jan 2018 00:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327755 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 00:18:49 -0000 Author: jhb Date: Wed Jan 10 00:18:47 2018 New Revision: 327755 URL: https://svnweb.freebsd.org/changeset/base/327755 Log: Allow the fast-path for disk AIO requests to fail requests. - If aio_qphysio() returns a non-zero error code, fail the request rather than queueing it to the AIO kproc pool to be retried via the slow path. Currently this means that if vm_fault_quick_hold_pages() reports an error, EFAULT is returned from the fast-path rather than retrying the request in the slow path where it will still fail with EFAULT. - If aio_qphysio() wishes to use the fast path for a device that doesn't support unmapped I/O but there are already the maximum number of such requests in flight, fail with EAGAIN as we do for other AIO resource limits rather than queueing the request to the AIO kproc pool. - Move the opcode check for aio_qphysio() out of the caller and into aio_qphysio() to simplify some logic and remove two goto's while here. It also uses a whitelist (only supported for LIO_READ / LIO_WRITE) rather than a blacklist (skipped for LIO_SYNC). PR: 217261 Submitted by: jkim (an earlier version) MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Jan 10 00:08:57 2018 (r327754) +++ head/sys/kern/vfs_aio.c Wed Jan 10 00:18:47 2018 (r327755) @@ -1228,6 +1228,9 @@ aio_qphysio(struct proc *p, struct kaiocb *job) cb = &job->uaiocb; fp = job->fd_file; + if (!(cb->aio_lio_opcode == LIO_WRITE || + cb->aio_lio_opcode == LIO_READ)) + return (-1); if (fp == NULL || fp->f_type != DTYPE_VNODE) return (-1); @@ -1268,7 +1271,7 @@ aio_qphysio(struct proc *p, struct kaiocb *job) goto unref; } if (ki->kaio_buffer_count >= ki->kaio_ballowed_count) { - error = -1; + error = EAGAIN; goto unref; } @@ -1700,27 +1703,13 @@ aio_queue_file(struct file *fp, struct kaiocb *job) struct kaiocb *job2; struct vnode *vp; struct mount *mp; - int error, opcode; + int error; bool safe; ki = job->userproc->p_aioinfo; - opcode = job->uaiocb.aio_lio_opcode; - if (opcode == LIO_SYNC) - goto queueit; - - if ((error = aio_qphysio(job->userproc, job)) == 0) - goto done; -#if 0 - /* - * XXX: This means qphysio() failed with EFAULT. The current - * behavior is to retry the operation via fo_read/fo_write. - * Wouldn't it be better to just complete the request with an - * error here? - */ - if (error > 0) - goto done; -#endif -queueit: + error = aio_qphysio(job->userproc, job); + if (error >= 0) + return (error); safe = false; if (fp->f_type == DTYPE_VNODE) { vp = fp->f_vnode; @@ -1770,7 +1759,6 @@ queueit: default: error = EINVAL; } -done: return (error); } From owner-svn-src-all@freebsd.org Wed Jan 10 02:28:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E3ACE5CECB; Wed, 10 Jan 2018 02:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1667D23E; Wed, 10 Jan 2018 02:28: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 97E611F862; Wed, 10 Jan 2018 02:28: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 w0A2SAY9038026; Wed, 10 Jan 2018 02:28:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A2SA4k038025; Wed, 10 Jan 2018 02:28:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801100228.w0A2SA4k038025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 10 Jan 2018 02:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327756 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 327756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 02:28:11 -0000 Author: ian Date: Wed Jan 10 02:28:10 2018 New Revision: 327756 URL: https://svnweb.freebsd.org/changeset/base/327756 Log: Bugfix: on RTC chips with a 32-bit binary counter, after reading the time, return immediately rather than falling through to the logic that reads BCD-encoded time. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 00:18:47 2018 (r327755) +++ head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 02:28:10 2018 (r327756) @@ -364,9 +364,8 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) /* If the chip counts time in binary, we just read and return it. */ if (sc->flags & SC_F_BINARY) { - if ((err = read_timeword(sc, &ts->tv_sec)) != 0) - return (err); ts->tv_nsec = 0; + return (read_timeword(sc, &ts->tv_sec)); } /* From owner-svn-src-all@freebsd.org Wed Jan 10 02:32:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B03EAE5D490; Wed, 10 Jan 2018 02:32:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2367D772; Wed, 10 Jan 2018 02:32: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 E74E91F9C0; Wed, 10 Jan 2018 02:31:59 +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 w0A2Vxsp038912; Wed, 10 Jan 2018 02:31:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A2Vx0h038911; Wed, 10 Jan 2018 02:31:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801100231.w0A2Vx0h038911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 10 Jan 2018 02:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327757 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 327757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 02:32:00 -0000 Author: ian Date: Wed Jan 10 02:31:59 2018 New Revision: 327757 URL: https://svnweb.freebsd.org/changeset/base/327757 Log: Bugfix: don't lose the am/pm mode flag when setting the time. Unlike most RTC chips that have a control register bit for am/pm mode, the DS13xx series uses one of the high bits in the hour register. Thus, when setting the time in am/pm mode, the am/pm mode flag has to be ORed into the hour. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 02:28:10 2018 (r327756) +++ head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 02:31:59 2018 (r327757) @@ -415,7 +415,7 @@ ds13rtc_settime(device_t dev, struct timespec *ts) struct time_regs tregs; struct ds13rtc_softc *sc; int err; - uint8_t cflag, statreg, pmflag; + uint8_t cflag, statreg, pmflags; sc = device_get_softc(dev); @@ -432,11 +432,12 @@ ds13rtc_settime(device_t dev, struct timespec *ts) clock_ts_to_ct(ts, &ct); /* If the chip is in AMPM mode deal with the PM flag. */ - pmflag = 0; + pmflags = 0; if (sc->flags & SC_F_AMPM) { + pmflags = DS13xx_B_HOUR_AMPM; if (ct.hour >= 12) { ct.hour -= 12; - pmflag = DS13xx_B_HOUR_PM; + pmflags |= DS13xx_B_HOUR_PM; } if (ct.hour == 0) ct.hour = 12; @@ -451,7 +452,7 @@ ds13rtc_settime(device_t dev, struct timespec *ts) tregs.sec = TOBCD(ct.sec); tregs.min = TOBCD(ct.min); - tregs.hour = TOBCD(ct.hour) | pmflag; + tregs.hour = TOBCD(ct.hour) | pmflags; tregs.day = TOBCD(ct.day); tregs.month = TOBCD(ct.mon) | cflag; tregs.year = TOBCD(ct.year % 100); From owner-svn-src-all@freebsd.org Wed Jan 10 02:57:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76594E608EB; Wed, 10 Jan 2018 02:57:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8387E236; Wed, 10 Jan 2018 02:57:04 +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 8B6221FD0B; Wed, 10 Jan 2018 02:57:03 +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 w0A2v3S1050274; Wed, 10 Jan 2018 02:57:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A2v3Sj050273; Wed, 10 Jan 2018 02:57:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801100257.w0A2v3Sj050273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 10 Jan 2018 02:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327758 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 327758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 02:57:04 -0000 Author: ian Date: Wed Jan 10 02:57:03 2018 New Revision: 327758 URL: https://svnweb.freebsd.org/changeset/base/327758 Log: Convert a collection of unrelated bitwise flags to a collection of boolean vars in the softc. It makes the code more compact and readable, and actually uses less memory too. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 02:31:59 2018 (r327757) +++ head/sys/dev/iicbus/ds13rtc.c Wed Jan 10 02:57:03 2018 (r327758) @@ -162,16 +162,14 @@ struct time_regs { struct ds13rtc_softc { device_t dev; device_t busdev; - u_int flags; /* SC_F_* flags */ u_int chiptype; /* Type of DS13xx chip */ uint8_t secaddr; /* Address of seconds register */ uint8_t osfaddr; /* Address of register with OSF */ + bool use_ampm; /* Use AM/PM mode. */ + bool use_century; /* Use the Century bit. */ + bool is_binary_counter; /* Chip has 32-bit binary counter. */ }; -#define SC_F_BINARY (1u << 0) /* Time is 32-bit binary counter */ -#define SC_F_AMPM (1u << 1) /* Use PM flag in hours reg */ -#define SC_F_CENTURY (1u << 2) /* Use century bit */ - /* * We use the compat_data table to look up hint strings in the non-FDT case, so * define the struct locally when we don't get it from ofw_bus_subr.h. @@ -326,14 +324,14 @@ ds13rtc_start(void *arg) * chips that do AM/PM mode, the flag bit is in the hours register, * which is secaddr+2. */ - if ((sc->chiptype != TYPE_DS1340) && !(sc->flags & SC_F_BINARY)) { + if ((sc->chiptype != TYPE_DS1340) && !sc->is_binary_counter) { if (read_reg(sc, sc->secaddr + 2, &statreg) != 0) { device_printf(sc->dev, "cannot read RTC clock AM/PM bit\n"); return; } if (statreg & DS13xx_B_HOUR_AMPM) - sc->flags |= SC_F_AMPM; + sc->use_ampm = true; } /* @@ -363,7 +361,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) return (EINVAL); /* hardware is good, time is not. */ /* If the chip counts time in binary, we just read and return it. */ - if (sc->flags & SC_F_BINARY) { + if (sc->is_binary_counter) { ts->tv_nsec = 0; return (read_timeword(sc, &ts->tv_sec)); } @@ -376,7 +374,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) return (err); } - if (sc->flags & SC_F_AMPM) + if (sc->use_ampm) hourmask = DS13xx_M_12HOUR; else hourmask = DS13xx_M_24HOUR; @@ -389,7 +387,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) ct.year = FROMBCD(tregs.year & DS13xx_M_YEAR); ct.nsec = 0; - if (sc->flags & SC_F_AMPM) { + if (sc->use_ampm) { if (ct.hour == 12) ct.hour = 0; if (tregs.hour & DS13xx_B_HOUR_PM) @@ -400,7 +398,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) * If this chip has a century bit, honor it. Otherwise let * clock_ct_to_ts() infer the century from the 2-digit year. */ - if (sc->flags & SC_F_CENTURY) + if (sc->use_century) ct.year += (tregs.month & DS13xx_B_MONTH_CENTURY) ? 2000 : 1900; err = clock_ct_to_ts(&ct, ts); @@ -426,14 +424,14 @@ ds13rtc_settime(device_t dev, struct timespec *ts) ts->tv_sec -= utc_offset(); /* If the chip counts time in binary, store tv_sec and we're done. */ - if (sc->flags & SC_F_BINARY) + if (sc->is_binary_counter) return (write_timeword(sc, ts->tv_sec)); clock_ts_to_ct(ts, &ct); /* If the chip is in AMPM mode deal with the PM flag. */ pmflags = 0; - if (sc->flags & SC_F_AMPM) { + if (sc->use_ampm) { pmflags = DS13xx_B_HOUR_AMPM; if (ct.hour >= 12) { ct.hour -= 12; @@ -445,7 +443,7 @@ ds13rtc_settime(device_t dev, struct timespec *ts) /* If the chip has a century bit, set it as needed. */ cflag = 0; - if (sc->flags & SC_F_CENTURY) { + if (sc->use_century) { if (ct.year >= 2000) cflag |= DS13xx_B_MONTH_CENTURY; } @@ -572,7 +570,7 @@ ds13rtc_attach(device_t dev) case TYPE_DS1342: case TYPE_DS1375: sc->osfaddr = DS133x_R_STATUS; - sc->flags |= SC_F_CENTURY; + sc->use_century = true; break; case TYPE_DS1340: sc->osfaddr = DS1340_R_STATUS; @@ -581,7 +579,7 @@ ds13rtc_attach(device_t dev) case TYPE_DS1372: case TYPE_DS1374: sc->osfaddr = DS137x_R_STATUS; - sc->flags |= SC_F_BINARY; + sc->is_binary_counter = true; break; case TYPE_DS1388: sc->osfaddr = DS1388_R_STATUS; From owner-svn-src-all@freebsd.org Wed Jan 10 02:57:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 253E6E60984; Wed, 10 Jan 2018 02:57:24 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F26997E379; Wed, 10 Jan 2018 02:57:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3030B1FD0C; Wed, 10 Jan 2018 02:57:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0A2vNEv050328; Wed, 10 Jan 2018 02:57:23 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A2vN6Q050327; Wed, 10 Jan 2018 02:57:23 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201801100257.w0A2vN6Q050327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 10 Jan 2018 02:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327759 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 327759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 02:57:24 -0000 Author: oshogbo Date: Wed Jan 10 02:57:22 2018 New Revision: 327759 URL: https://svnweb.freebsd.org/changeset/base/327759 Log: Fix markup. Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Wed Jan 10 02:57:03 2018 (r327758) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Wed Jan 10 02:57:22 2018 (r327759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2018 +.Dd January 10, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -59,7 +59,7 @@ The functions .Fn cap_gethostbyname2 , .Fn cep_gethostbyaddr and -.Xr cap_getnameinfo +.Fn cap_getnameinfo are respectively equivalent to .Xr gethostbyname 2 , .Xr gethostbyname2 2 , From owner-svn-src-all@freebsd.org Wed Jan 10 05:06:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C85BE67A15; Wed, 10 Jan 2018 05:06:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 580B482BFB; Wed, 10 Jan 2018 05:06:22 +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 8FE4C2128E; Wed, 10 Jan 2018 05:06: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 w0A56LYj005132; Wed, 10 Jan 2018 05:06:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A56Lp7005131; Wed, 10 Jan 2018 05:06:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801100506.w0A56Lp7005131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 05:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327760 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 327760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 05:06:22 -0000 Author: markj Date: Wed Jan 10 05:06:21 2018 New Revision: 327760 URL: https://svnweb.freebsd.org/changeset/base/327760 Log: Avoid referencing a possibly freed consumer after r327496. g_mirror_regular_request() may free the gmirror consumer for a disk if that disk is being disconnected, after which we must not dereference the consumer pointer. CID: 1384280 X-MFC with: r327496 Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jan 10 02:57:22 2018 (r327759) +++ head/sys/geom/mirror/g_mirror.c Wed Jan 10 05:06:21 2018 (r327760) @@ -906,16 +906,12 @@ g_mirror_done(struct bio *bp) } static void -g_mirror_regular_request_error(struct g_mirror_softc *sc, struct bio *bp) +g_mirror_regular_request_error(struct g_mirror_softc *sc, + struct g_mirror_disk *disk, struct bio *bp) { - struct g_mirror_disk *disk; - disk = bp->bio_from->private; - if (bp->bio_cmd == BIO_FLUSH && bp->bio_error == EOPNOTSUPP) return; - if (disk == NULL) - return; if ((disk->d_flags & G_MIRROR_DISK_FLAG_BROKEN) == 0) { disk->d_flags |= G_MIRROR_DISK_FLAG_BROKEN; @@ -942,6 +938,7 @@ g_mirror_regular_request_error(struct g_mirror_softc * static void g_mirror_regular_request(struct g_mirror_softc *sc, struct bio *bp) { + struct g_mirror_disk *disk; struct bio *pbp; g_topology_assert_not(); @@ -952,7 +949,8 @@ g_mirror_regular_request(struct g_mirror_softc *sc, st bp->bio_from->index--; if (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_DELETE) sc->sc_writes--; - if (bp->bio_from->private == NULL) { + disk = bp->bio_from->private; + if (disk == NULL) { g_topology_lock(); g_mirror_kill_consumer(sc, bp->bio_from); g_topology_unlock(); @@ -999,7 +997,8 @@ g_mirror_regular_request(struct g_mirror_softc *sc, st } else if (bp->bio_error != 0) { if (pbp->bio_error == 0) pbp->bio_error = bp->bio_error; - g_mirror_regular_request_error(sc, bp); + if (disk != NULL) + g_mirror_regular_request_error(sc, disk, bp); switch (pbp->bio_cmd) { case BIO_DELETE: case BIO_WRITE: From owner-svn-src-all@freebsd.org Wed Jan 10 05:29:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441E0E68B88; Wed, 10 Jan 2018 05:29:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0446E836B1; Wed, 10 Jan 2018 05:29:04 +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 390F0215C2; Wed, 10 Jan 2018 05:29:03 +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 w0A5T3R2013625; Wed, 10 Jan 2018 05:29:03 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A5T33b013624; Wed, 10 Jan 2018 05:29:03 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801100529.w0A5T33b013624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 10 Jan 2018 05:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327761 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 327761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 05:29:04 -0000 Author: scottl Date: Wed Jan 10 05:29:02 2018 New Revision: 327761 URL: https://svnweb.freebsd.org/changeset/base/327761 Log: Implement the ability to query NVME for its controller data so that it will be shown when issueing the 'camcontrol devlist' command. Obtained from: Netflix Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Jan 10 05:06:21 2018 (r327760) +++ head/sbin/camcontrol/camcontrol.c Wed Jan 10 05:29:02 2018 (r327761) @@ -275,6 +275,7 @@ camcontrol_optret getoption(struct camcontrol_opts *ta static int getdevlist(struct cam_device *device); #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); +static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, int retry_count, int timeout, int quiet); @@ -623,6 +624,12 @@ getdevtree(int argc, char **argv, char *combinedopt) sizeof(fw)); sprintf(tmpstr, "<%s %s %s %s>", vendor, product, revision, fw); + } else if (dev_result->protocol == PROTO_NVME) { + if (print_dev_nvme(dev_result, + &tmpstr[0]) != 0) { + skip_device = 1; + break; + } } else { sprintf(tmpstr, "<>"); } @@ -676,6 +683,58 @@ getdevtree(int argc, char **argv, char *combinedopt) close(fd); return (error); +} + +static int +print_dev_nvme(struct device_match_result *dev_result, char *tmpstr) +{ + union ccb *ccb; + struct ccb_dev_advinfo *advi; + struct cam_device *dev; + struct nvme_controller_data cdata; + char vendor[64], product[64]; + + dev = cam_open_btl(dev_result->path_id, dev_result->target_id, + dev_result->target_lun, O_RDWR, NULL); + if (dev == NULL) { + warnx("%s", cam_errbuf); + return (1); + } + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + cam_close_device(dev); + return (1); + } + + advi = &ccb->cdai; + advi->ccb_h.flags = CAM_DIR_IN; + advi->ccb_h.func_code = XPT_DEV_ADVINFO; + advi->flags = CDAI_FLAG_NONE; + advi->buftype = CDAI_TYPE_NVME_CNTRL; + advi->bufsiz = sizeof(struct nvme_controller_data); + advi->buf = (uint8_t *)&cdata; + + if (cam_send_ccb(dev, ccb) < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + cam_freeccb(ccb); + cam_close_device(dev); + return(1); + } + if (advi->ccb_h.status != CAM_REQ_CMP) { + warnx("got CAM error %#x", advi->ccb_h.status); + cam_freeccb(ccb); + cam_close_device(dev); + return(1); + } + cam_strvis(vendor, cdata.mn, sizeof(cdata.mn), sizeof(vendor)); + cam_strvis(product, cdata.fr, sizeof(cdata.fr), sizeof(product)); + sprintf(tmpstr, "<%s %s>", vendor, product); + + cam_freeccb(ccb); + cam_close_device(dev); + return (0); } #ifndef MINIMALISTIC From owner-svn-src-all@freebsd.org Wed Jan 10 05:52:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C22F9E69D88; Wed, 10 Jan 2018 05:52:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84E6584258; Wed, 10 Jan 2018 05:52:25 +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 CD71821A7C; Wed, 10 Jan 2018 05:52:24 +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 w0A5qOxo025757; Wed, 10 Jan 2018 05:52:24 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A5qOrc025756; Wed, 10 Jan 2018 05:52:24 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801100552.w0A5qOrc025756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 10 Jan 2018 05:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327762 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 327762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 05:52:25 -0000 Author: scottl Date: Wed Jan 10 05:52:24 2018 New Revision: 327762 URL: https://svnweb.freebsd.org/changeset/base/327762 Log: Refactor code related to 'camcontrol devlist' Obtained from: Netflix Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Jan 10 05:29:02 2018 (r327761) +++ head/sbin/camcontrol/camcontrol.c Wed Jan 10 05:52:24 2018 (r327762) @@ -275,6 +275,11 @@ camcontrol_optret getoption(struct camcontrol_opts *ta static int getdevlist(struct cam_device *device); #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); +static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr); +static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr); +static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); +static int print_dev_mmcsd(struct device_match_result *dev_result, + char *tmpstr); static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, @@ -555,8 +560,7 @@ getdevtree(int argc, char **argv, char *combinedopt) } case DEV_MATCH_DEVICE: { struct device_match_result *dev_result; - char vendor[16], product[48], revision[16]; - char fw[5], tmpstr[256]; + char tmpstr[256]; if (busonly == 1) break; @@ -573,57 +577,30 @@ getdevtree(int argc, char **argv, char *combinedopt) skip_device = 0; if (dev_result->protocol == PROTO_SCSI) { - cam_strvis(vendor, dev_result->inq_data.vendor, - sizeof(dev_result->inq_data.vendor), - sizeof(vendor)); - cam_strvis(product, - dev_result->inq_data.product, - sizeof(dev_result->inq_data.product), - sizeof(product)); - cam_strvis(revision, - dev_result->inq_data.revision, - sizeof(dev_result->inq_data.revision), - sizeof(revision)); - sprintf(tmpstr, "<%s %s %s>", vendor, product, - revision); + if (print_dev_scsi(dev_result, + &tmpstr[0]) != 0) { + skip_device = 1; + break; + } } else if (dev_result->protocol == PROTO_ATA || dev_result->protocol == PROTO_SATAPM) { - cam_strvis(product, - dev_result->ident_data.model, - sizeof(dev_result->ident_data.model), - sizeof(product)); - cam_strvis(revision, - dev_result->ident_data.revision, - sizeof(dev_result->ident_data.revision), - sizeof(revision)); - sprintf(tmpstr, "<%s %s>", product, - revision); - } else if (dev_result->protocol == PROTO_MMCSD) { - if (strlen(dev_result->mmc_ident_data.model) > 0) { - sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); - } else { - sprintf(tmpstr, "<%s card>", - dev_result->mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown"); + if (print_dev_ata(dev_result, + &tmpstr[0]) != 0) { + skip_device = 1; + break; } + } else if (dev_result->protocol == PROTO_MMCSD){ + if (print_dev_mmcsd(dev_result, + &tmpstr[0]) != 0) { + skip_device = 1; + break; + } } else if (dev_result->protocol == PROTO_SEMB) { - struct sep_identify_data *sid; - - sid = (struct sep_identify_data *) - &dev_result->ident_data; - cam_strvis(vendor, sid->vendor_id, - sizeof(sid->vendor_id), - sizeof(vendor)); - cam_strvis(product, sid->product_id, - sizeof(sid->product_id), - sizeof(product)); - cam_strvis(revision, sid->product_rev, - sizeof(sid->product_rev), - sizeof(revision)); - cam_strvis(fw, sid->firmware_rev, - sizeof(sid->firmware_rev), - sizeof(fw)); - sprintf(tmpstr, "<%s %s %s %s>", - vendor, product, revision, fw); + if (print_dev_semb(dev_result, + &tmpstr[0]) != 0) { + skip_device = 1; + break; + } } else if (dev_result->protocol == PROTO_NVME) { if (print_dev_nvme(dev_result, &tmpstr[0]) != 0) { @@ -683,6 +660,70 @@ getdevtree(int argc, char **argv, char *combinedopt) close(fd); return (error); +} + +static int +print_dev_scsi(struct device_match_result *dev_result, char *tmpstr) +{ + char vendor[16], product[48], revision[16]; + + cam_strvis(vendor, dev_result->inq_data.vendor, + sizeof(dev_result->inq_data.vendor), sizeof(vendor)); + cam_strvis(product, dev_result->inq_data.product, + sizeof(dev_result->inq_data.product), sizeof(product)); + cam_strvis(revision, dev_result->inq_data.revision, + sizeof(dev_result->inq_data.revision), sizeof(revision)); + sprintf(tmpstr, "<%s %s %s>", vendor, product, revision); + + return (0); +} + +static int +print_dev_ata(struct device_match_result *dev_result, char *tmpstr) +{ + char product[48], revision[16]; + + cam_strvis(product, dev_result->ident_data.model, + sizeof(dev_result->ident_data.model), sizeof(product)); + cam_strvis(revision, dev_result->ident_data.revision, + sizeof(dev_result->ident_data.revision), sizeof(revision)); + sprintf(tmpstr, "<%s %s>", product, revision); + + return (0); +} + +static int +print_dev_semb(struct device_match_result *dev_result, char *tmpstr) +{ + struct sep_identify_data *sid; + char vendor[16], product[48], revision[16], fw[5]; + + sid = (struct sep_identify_data *)&dev_result->ident_data; + cam_strvis(vendor, sid->vendor_id, + sizeof(sid->vendor_id), sizeof(vendor)); + cam_strvis(product, sid->product_id, + sizeof(sid->product_id), sizeof(product)); + cam_strvis(revision, sid->product_rev, + sizeof(sid->product_rev), sizeof(revision)); + cam_strvis(fw, sid->firmware_rev, + sizeof(sid->firmware_rev), sizeof(fw)); + sprintf(tmpstr, "<%s %s %s %s>", vendor, product, revision, fw); + + return (0); +} + +static int +print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr) +{ + + if (strlen(dev_result->mmc_ident_data.model) > 0) { + sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model); + } else { + sprintf(tmpstr, "<%s card>", + dev_result->mmc_ident_data.card_features & + CARD_FEATURE_SDIO ? "SDIO" : "unknown"); + } + return (0); } static int From owner-svn-src-all@freebsd.org Wed Jan 10 06:31:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74B4E6B7B5; Wed, 10 Jan 2018 06:31:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B175537C; Wed, 10 Jan 2018 06:31:00 +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 D6A7F21F52; Wed, 10 Jan 2018 06:30:59 +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 w0A6UxJG041387; Wed, 10 Jan 2018 06:30:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A6UxLT041383; Wed, 10 Jan 2018 06:30:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801100630.w0A6UxLT041383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 10 Jan 2018 06:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 06:31:00 -0000 Author: cem Date: Wed Jan 10 06:30:59 2018 New Revision: 327763 URL: https://svnweb.freebsd.org/changeset/base/327763 Log: Finally, fix Zstd kernel build on MIPS and RISC-V Add an implementation of the intrinsics invoked by __builtin_ctz{,ll} and __builtin_clz{,ll}, and include this compilation unit on platforms that lack assembly intrinsics for those builtins (MIPS and RISC-V). Future cleanup work might involve bringing these into a mini libcompiler-rt for the standalone kernel environment. Or cleaning up the approach upstream takes for builtins in standalone environments (or just FreeBSD). For now, at least this builds, and doesn't require modifying the vendor code. Reported by: jeff, markj, mizhka Reviewed by: jhb (earlier version), rpokala (comment text earlier version) Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/conf/files.riscv Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.mips Wed Jan 10 06:30:59 2018 (r327763) @@ -112,3 +112,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/mips/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/mips/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/mips/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.riscv Wed Jan 10 06:30:59 2018 (r327763) @@ -56,3 +56,6 @@ riscv/riscv/uio_machdep.c standard riscv/riscv/uma_machdep.c standard riscv/riscv/unwind.c optional ddb | kdtrace_hooks | stack riscv/riscv/vm_machdep.c standard + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Wed Jan 10 06:30:59 2018 (r327763) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2018 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. + * + * $FreeBSD$ + */ + +#include "zstd_kfreebsd.h" + +/* + * The kernel as a standalone target does not link against libgcc or + * libcompiler-rt. On platforms (e.g., MIPS and RISCV) that do not have a + * direct assembly implementation of the relevant builtin functions that zstd + * references, the compiler converts them into calls to the runtime library + * intrinsics. Since the kernel does not link against the runtime libraries, + * this results in a failure to link the kernel. + * + * The goal of the following definitions is to use supported kernel constructs + * to implement the same functionality, without adding diff to the Zstd contrib + * code. + * + * A subsequent enhancement might create a mini compiler-rt library for kernel + * use and move these over there instead. + */ + +/* Count trailing zeros */ +int +__ctzsi2(int x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffs(x) - 1); +} + +long long +__ctzdi2(long long x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffsll(x) - 1); +} + +/* Count leading zeros */ +int +__clzsi2(int x) +{ + return (sizeof(x) * NBBY - fls(x)); +} + +long long +__clzdi2(long long x) +{ + return (sizeof(x) * NBBY - flsll(x)); +} From owner-svn-src-all@freebsd.org Wed Jan 10 08:10:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64CE4E70CE2; Wed, 10 Jan 2018 08:10:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F9FF63C9E; Wed, 10 Jan 2018 08:10:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D72122F4B; Wed, 10 Jan 2018 08:10:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0A8AI10081960; Wed, 10 Jan 2018 08:10:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A8AI7T081959; Wed, 10 Jan 2018 08:10:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801100810.w0A8AI7T081959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 10 Jan 2018 08:10:18 +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: r327764 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 327764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 08:10:19 -0000 Author: kib Date: Wed Jan 10 08:10:18 2018 New Revision: 327764 URL: https://svnweb.freebsd.org/changeset/base/327764 Log: MFC r327517: Use the new SDM-approved way to serialize x2APIC MSR writes. Modified: stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Wed Jan 10 06:30:59 2018 (r327763) +++ stable/11/sys/x86/x86/local_apic.c Wed Jan 10 08:10:18 2018 (r327764) @@ -211,6 +211,7 @@ lapic_write32(enum LAPIC_REGISTERS reg, uint32_t val) if (x2apic_mode) { mfence(); + lfence(); wrmsr(MSR_APIC_000 + reg, val); } else { *(volatile uint32_t *)(lapic_map + reg * LAPIC_MEM_MUL) = val; From owner-svn-src-all@freebsd.org Wed Jan 10 09:06:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80D94E739F6; Wed, 10 Jan 2018 09:06:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0B069C3E; Wed, 10 Jan 2018 09:06:09 +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 AE5DA238D4; Wed, 10 Jan 2018 09:06:08 +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 w0A968TC006857; Wed, 10 Jan 2018 09:06:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0A968CB006853; Wed, 10 Jan 2018 09:06:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201801100906.w0A968CB006853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 10 Jan 2018 09:06: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: r327765 - in stable/11: etc/mail libexec/dma/dmagent share/man/man5 usr.bin/mail X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: etc/mail libexec/dma/dmagent share/man/man5 usr.bin/mail X-SVN-Commit-Revision: 327765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 09:06:09 -0000 Author: delphij Date: Wed Jan 10 09:06:07 2018 New Revision: 327765 URL: https://svnweb.freebsd.org/changeset/base/327765 Log: MFC r327236: Replace send-mail with the more standarized sendmail, we do not create links for send-mail in mailwrapper so it did not work anyway. Modified: stable/11/etc/mail/mailer.conf stable/11/libexec/dma/dmagent/mailer.conf stable/11/share/man/man5/mailer.conf.5 stable/11/usr.bin/mail/names.c Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mail/mailer.conf ============================================================================== --- stable/11/etc/mail/mailer.conf Wed Jan 10 08:10:18 2018 (r327764) +++ stable/11/etc/mail/mailer.conf Wed Jan 10 09:06:07 2018 (r327765) @@ -3,7 +3,6 @@ # Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail # sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail hoststat /usr/libexec/sendmail/sendmail Modified: stable/11/libexec/dma/dmagent/mailer.conf ============================================================================== --- stable/11/libexec/dma/dmagent/mailer.conf Wed Jan 10 08:10:18 2018 (r327764) +++ stable/11/libexec/dma/dmagent/mailer.conf Wed Jan 10 09:06:07 2018 (r327765) @@ -1,5 +1,4 @@ # $FreeBSD$ sendmail /usr/libexec/dma -send-mail /usr/libexec/dma mailq /usr/libexec/dma Modified: stable/11/share/man/man5/mailer.conf.5 ============================================================================== --- stable/11/share/man/man5/mailer.conf.5 Wed Jan 10 08:10:18 2018 (r327764) +++ stable/11/share/man/man5/mailer.conf.5 Wed Jan 10 09:06:07 2018 (r327765) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2016 +.Dd December 26, 2017 .Dt MAILER.CONF 5 .Os .Sh NAME @@ -96,7 +96,6 @@ program: # Execute the "real" sendmail program located in # /usr/libexec/sendmail/sendmail sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail .Ed @@ -109,7 +108,6 @@ to replace .Bd -literal -offset indent # Emulate sendmail using postfix sendmail /usr/local/sbin/sendmail -send-mail /usr/local/sbin/sendmail mailq /usr/local/sbin/sendmail newaliases /usr/local/sbin/sendmail .Ed @@ -122,7 +120,6 @@ to replace .Bd -literal -offset indent # Emulate sendmail using exim sendmail /usr/local/sbin/exim -send-mail /usr/local/sbin/exim mailq /usr/local/sbin/exim -bp newaliases /usr/bin/true rmail /usr/local/sbin/exim -i -oee @@ -136,7 +133,6 @@ to replace .Bd -literal -offset indent # Send outgoing mail to a smart relay using mini_sendmail sendmail /usr/local/bin/mini_sendmail -srelayhost -send-mail /usr/local/bin/mini_sendmail -srelayhost .Ed .Pp Using @@ -146,7 +142,6 @@ to replace .Bd -literal -offset indent # Execute dma instead of sendmail sendmail /usr/libexec/dma -send-mail /usr/libexec/dma mailq /usr/libexec/dma newaliases /usr/libexec/dma rmail /usr/libexec/dma Modified: stable/11/usr.bin/mail/names.c ============================================================================== --- stable/11/usr.bin/mail/names.c Wed Jan 10 08:10:18 2018 (r327764) +++ stable/11/usr.bin/mail/names.c Wed Jan 10 09:06:07 2018 (r327765) @@ -573,7 +573,7 @@ unpack(struct name *np) extra++; top = (char **)salloc((t + extra) * sizeof(*top)); ap = top; - *ap++ = "send-mail"; + *ap++ = "sendmail"; *ap++ = "-i"; if (metoo) *ap++ = "-m"; From owner-svn-src-all@freebsd.org Wed Jan 10 14:59:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709E1E60366; Wed, 10 Jan 2018 14:59:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44A0E78638; Wed, 10 Jan 2018 14:59:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D73A270E7; Wed, 10 Jan 2018 14:58:59 +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 w0AEwxwU054950; Wed, 10 Jan 2018 14:58:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AEwxLJ054948; Wed, 10 Jan 2018 14:58:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101458.w0AEwxLJ054948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 14:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327766 - in head: . sys/sys usr.sbin usr.sbin/digictl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/sys usr.sbin usr.sbin/digictl X-SVN-Commit-Revision: 327766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 14:59:00 -0000 Author: imp Date: Wed Jan 10 14:58:58 2018 New Revision: 327766 URL: https://svnweb.freebsd.org/changeset/base/327766 Log: Remove vestiges of digi(4) driver, first attempted in r305235 with more in r317426. There's nothing in the tree that references digiio.h (apart from digictl(8)), so no driver implements it. Since digictl(8) was only used to control digi(4) devices, it too should go. Deleted: head/sys/sys/digiio.h head/usr.sbin/digictl/Makefile head/usr.sbin/digictl/Makefile.depend head/usr.sbin/digictl/digictl.8 head/usr.sbin/digictl/digictl.c Modified: head/ObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 10 09:06:07 2018 (r327765) +++ head/ObsoleteFiles.inc Wed Jan 10 14:58:58 2018 (r327766) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180109: Remove vestiges of digi(4) driver +OLD_FILES+=usr/include/sys/digiio.h +OLD_FILES+=usr/sbin/digictl +OLD_FILES+=usr/share/man/man8/digictl.8.gz # 20180107: Convert remaining geli(8) tests to ATF OLD_FILES+=tests/sys/geom/class/eli/nokey_test.sh OLD_FILES+=tests/sys/geom/class/eli/readonly_test.sh Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Jan 10 09:06:07 2018 (r327765) +++ head/usr.sbin/Makefile Wed Jan 10 14:58:58 2018 (r327766) @@ -22,7 +22,6 @@ SUBDIR= adduser \ devctl \ devinfo \ devmatch \ - digictl \ diskinfo \ dumpcis \ etcupdate \ From owner-svn-src-all@freebsd.org Wed Jan 10 14:59:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD230E603EB; Wed, 10 Jan 2018 14:59:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A74AD78789; Wed, 10 Jan 2018 14:59:20 +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 E498C270E8; Wed, 10 Jan 2018 14:59:19 +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 w0AExJmF055029; Wed, 10 Jan 2018 14:59:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AExJWM055025; Wed, 10 Jan 2018 14:59:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101459.w0AExJWM055025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 14:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf i386/bios i386/conf i386/isa X-SVN-Commit-Revision: 327767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 14:59:20 -0000 Author: imp Date: Wed Jan 10 14:59:19 2018 New Revision: 327767 URL: https://svnweb.freebsd.org/changeset/base/327767 Log: Retire pmtimer driver. Move time fixing into apm driver. Move Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly work. Call tc_settime() with our estimate of the delta we've been alseep (the one we print) to adjust the time. Not sure what to do about callouts, so keep the small #ifdef in place there. Differential Revision: https://reviews.freebsd.org/D13823 Deleted: head/sys/i386/isa/pmtimer.c Modified: head/sys/conf/files.i386 head/sys/i386/bios/apm.c head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jan 10 14:58:58 2018 (r327766) +++ head/sys/conf/files.i386 Wed Jan 10 14:59:19 2018 (r327767) @@ -520,7 +520,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux Modified: head/sys/i386/bios/apm.c ============================================================================== --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) @@ -16,6 +16,32 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) */ +/*- + * Copyright (c) 2000 Mitsuru IWASAKI + * 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$"); @@ -38,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -205,7 +232,7 @@ static int apm_driver_version(int version) { struct apm_softc *sc = &apm_softc; - + sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; sc->bios.r.ebx = 0x0; sc->bios.r.ecx = version; @@ -220,28 +247,28 @@ apm_driver_version(int version) return (1); } - + /* engage/disengage power management (APM 1.1 or later) */ static int apm_engage_disengage_pm(int engage) { struct apm_softc *sc = &apm_softc; - + sc->bios.r.eax = (APM_BIOS << 8) | APM_ENGAGEDISENGAGEPM; sc->bios.r.ebx = PMDV_ALLDEV; sc->bios.r.ecx = engage; sc->bios.r.edx = 0; return (apm_bioscall()); } - + /* get PM event */ static u_int apm_getevent(void) { struct apm_softc *sc = &apm_softc; - + sc->bios.r.eax = (APM_BIOS << 8) | APM_GETPMEVENT; - + sc->bios.r.ebx = 0; sc->bios.r.ecx = 0; sc->bios.r.edx = 0; @@ -249,18 +276,18 @@ apm_getevent(void) return (PMEV_NOEVENT); return (sc->bios.r.ebx & 0xffff); } - + /* suspend entire system */ static int apm_suspend_system(int state) { struct apm_softc *sc = &apm_softc; - + sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; sc->bios.r.ebx = PMDV_ALLDEV; sc->bios.r.ecx = state; sc->bios.r.edx = 0; - + if (apm_bioscall()) { printf("Entire system suspend failure: errcode = %d\n", 0xff & (sc->bios.r.eax >> 8)); @@ -280,7 +307,7 @@ int apm_display(int newstate) { struct apm_softc *sc = &apm_softc; - + sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; sc->bios.r.ebx = PMDV_DISP0; sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; @@ -331,12 +358,10 @@ apm_battery_low(void) static struct apmhook * apm_add_hook(struct apmhook **list, struct apmhook *ah) { - int s; struct apmhook *p, *prev; APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); - s = splhigh(); if (ah == NULL) panic("illegal apm_hook!"); prev = NULL; @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook *ah ah->ah_next = prev->ah_next; prev->ah_next = ah; } - splx(s); return ah; } static void apm_del_hook(struct apmhook **list, struct apmhook *ah) { - int s; struct apmhook *p, *prev; - s = splhigh(); prev = NULL; for (p = *list; p != NULL; prev = p, p = p->ah_next) if (p == ah) goto deleteit; panic("Tried to delete unregistered apm_hook."); - goto nosuchnode; + return; deleteit: if (prev != NULL) prev->ah_next = p->ah_next; else *list = p->ah_next; -nosuchnode: - splx(s); } @@ -468,7 +488,7 @@ apm_do_standby(void) sc->standbys = sc->standby_countdown = 0; /* - * As far as standby, we don't need to execute + * As far as standby, we don't need to execute * all of suspend hooks. */ if (apm_suspend_system(PMST_STANDBY) == 0) @@ -1047,6 +1067,53 @@ apm_processevent(void) } while (apm_event != PMEV_NOEVENT); } +static struct timeval suspend_time; +static struct timeval diff_time; + +static int +apm_rtc_suspend(void *arg __unused) +{ + + microtime(&diff_time); + inittodr(0); + microtime(&suspend_time); + timevalsub(&diff_time, &suspend_time); + return (0); +} + +static int +apm_rtc_resume(void *arg __unused) +{ + u_int second, minute, hour; + struct timeval resume_time, tmp_time; + struct timespec ts; + + /* modified for adjkerntz */ + timer_restore(); /* restore the all timers */ + inittodr(0); /* adjust time to RTC */ + microtime(&resume_time); + getmicrotime(&tmp_time); + timevaladd(&tmp_time, &diff_time); + /* Calculate the delta time suspended */ + timevalsub(&resume_time, &suspend_time); + + second = ts.tv_sec = resume_time.tv_sec; + ts.tv_nsec = 0; + tc_setclock(&ts); + +#ifdef PMTIMER_FIXUP_CALLTODO + /* Fixup the calltodo list with the delta time. */ + adjust_timeout_calltodo(&resume_time); +#endif /* PMTIMER_FIXUP_CALLTODO */ + hour = second / 3600; + second %= 3600; + minute = second / 60; + second %= 60; + log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", + hour, minute, second); + return (0); +} + /* * Attach APM: * @@ -1128,7 +1195,7 @@ apm_attach(device_t dev) } /* Power the system off using APM */ - EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, + EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, SHUTDOWN_PRI_LAST); /* Register APM again to pass the correct argument of pm_func. */ @@ -1142,6 +1209,15 @@ apm_attach(device_t dev) UID_ROOT, GID_OPERATOR, 0664, "apm"); make_dev(&apm_cdevsw, APMDEV_CTL, UID_ROOT, GID_OPERATOR, 0660, "apmctl"); + + sc->sc_suspend.ah_fun = apm_rtc_suspend; + sc->sc_suspend.ah_arg = sc; + apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); + + sc->sc_resume.ah_fun = apm_rtc_resume; + sc->sc_resume.ah_arg = sc; + apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); + return 0; } @@ -1362,7 +1438,7 @@ apmwrite(struct cdev *dev, struct uio *uio, int ioflag if ((error = uiomove((caddr_t)&event_type, sizeof(u_int), uio))) return(error); - if (event_type < 0 || event_type >= APM_NPMEV) + if (event_type >= APM_NPMEV) return(EINVAL); if (sc->event_filter[event_type] == 0) { Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Jan 10 14:58:58 2018 (r327766) +++ head/sys/i386/conf/GENERIC Wed Jan 10 14:59:19 2018 (r327767) @@ -207,8 +207,6 @@ device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm -# Add suspend/resume support for the i8254. -device pmtimer # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Jan 10 14:58:58 2018 (r327766) +++ head/sys/i386/conf/NOTES Wed Jan 10 14:59:19 2018 (r327767) @@ -774,7 +774,6 @@ device hyperv # HyperV drivers # smapi: System Management Application Program Interface driver # smbios: DMI/SMBIOS entry point # vpd: Vital Product Data kernel interface -# pmtimer: Adjust system timer at wakeup time # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver @@ -808,7 +807,6 @@ device ipmi device smapi device smbios device vpd -device pmtimer device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" From owner-svn-src-all@freebsd.org Wed Jan 10 15:21:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CBC1E6180E; Wed, 10 Jan 2018 15:21:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3838979582; Wed, 10 Jan 2018 15:21:37 +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 800B327493; Wed, 10 Jan 2018 15:21:36 +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 w0AFLaFn067563; Wed, 10 Jan 2018 15:21:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AFLanA067562; Wed, 10 Jan 2018 15:21:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801101521.w0AFLanA067562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 15:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327768 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 327768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 15:21:37 -0000 Author: markj Date: Wed Jan 10 15:21:36 2018 New Revision: 327768 URL: https://svnweb.freebsd.org/changeset/base/327768 Log: Clarify the use of the gmirror flag mask constants. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Jan 10 14:59:19 2018 (r327767) +++ head/sys/geom/mirror/g_mirror.h Wed Jan 10 15:21:36 2018 (r327768) @@ -62,6 +62,8 @@ #define G_MIRROR_DISK_FLAG_HARDCODED 0x0000000000000010ULL #define G_MIRROR_DISK_FLAG_BROKEN 0x0000000000000020ULL #define G_MIRROR_DISK_FLAG_CANDELETE 0x0000000000000040ULL + +/* Per-disk flags which are recorded in on-disk metadata. */ #define G_MIRROR_DISK_FLAG_MASK (G_MIRROR_DISK_FLAG_DIRTY | \ G_MIRROR_DISK_FLAG_SYNCHRONIZING | \ G_MIRROR_DISK_FLAG_FORCE_SYNC | \ @@ -70,6 +72,8 @@ #define G_MIRROR_DEVICE_FLAG_NOAUTOSYNC 0x0000000000000001ULL #define G_MIRROR_DEVICE_FLAG_NOFAILSYNC 0x0000000000000002ULL + +/* Mirror flags which are recorded in on-disk metadata. */ #define G_MIRROR_DEVICE_FLAG_MASK (G_MIRROR_DEVICE_FLAG_NOAUTOSYNC | \ G_MIRROR_DEVICE_FLAG_NOFAILSYNC) From owner-svn-src-all@freebsd.org Wed Jan 10 15:55:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76002E63DD3; Wed, 10 Jan 2018 15:55:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462127B519; Wed, 10 Jan 2018 15:55:09 +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 5E9B827A96; Wed, 10 Jan 2018 15:55:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AFt85O081321; Wed, 10 Jan 2018 15:55:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AFt82v081320; Wed, 10 Jan 2018 15:55:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801101555.w0AFt82v081320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 15:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327769 - in head/tests/sys/geom/class: eli mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/tests/sys/geom/class: eli mirror X-SVN-Commit-Revision: 327769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 15:55:09 -0000 Author: markj Date: Wed Jan 10 15:55:07 2018 New Revision: 327769 URL: https://svnweb.freebsd.org/changeset/base/327769 Log: Remove the executable bit from some recently added test scripts. Modified: Directory Properties: head/tests/sys/geom/class/eli/attach_test.sh (props changed) head/tests/sys/geom/class/eli/configure_test.sh (props changed) head/tests/sys/geom/class/eli/detach_test.sh (props changed) head/tests/sys/geom/class/eli/integrity_test.sh (props changed) head/tests/sys/geom/class/mirror/10_test.sh (props changed) head/tests/sys/geom/class/mirror/11_test.sh (props changed) head/tests/sys/geom/class/mirror/12_test.sh (props changed) head/tests/sys/geom/class/mirror/13_test.sh (props changed) From owner-svn-src-all@freebsd.org Wed Jan 10 16:01:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6659E644D1; Wed, 10 Jan 2018 16:01:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1437BB21; Wed, 10 Jan 2018 16:01: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 C7BD027BDC; Wed, 10 Jan 2018 16:01:25 +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 w0AG1P5W084527; Wed, 10 Jan 2018 16:01:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AG1PQ9084525; Wed, 10 Jan 2018 16:01:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801101601.w0AG1PQ9084525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Jan 2018 16:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327770 - head/usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/lld X-SVN-Commit-Revision: 327770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:01:26 -0000 Author: emaste Date: Wed Jan 10 16:01:25 2018 New Revision: 327770 URL: https://svnweb.freebsd.org/changeset/base/327770 Log: lld: introduce basic man page Upstream lld has no man page. Introduce a basic one for FreeBSD based on ld.lld --help, with a brief introduction and additional detail for some options. We'll continue refining this in FreeBSD, and then submit it upstream once the first round of edits are complete. Submitted by: krion, Arshan Khanifar, emaste, bjk MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13813 Added: head/usr.bin/clang/lld/ld.lld.1 (contents, props changed) Modified: head/usr.bin/clang/lld/Makefile Modified: head/usr.bin/clang/lld/Makefile ============================================================================== --- head/usr.bin/clang/lld/Makefile Wed Jan 10 15:55:07 2018 (r327769) +++ head/usr.bin/clang/lld/Makefile Wed Jan 10 16:01:25 2018 (r327770) @@ -7,9 +7,10 @@ LLD_SRCS= ${LLVM_SRCS}/tools/lld PACKAGE= lld PROG_CXX= ld.lld -MAN= + .if ${MK_LLD_IS_LD} != "no" SYMLINKS= ${PROG_CXX} ${BINDIR}/ld +MLINKS= ld.lld.1 ld.1 .endif CFLAGS+= -I${LLD_SRCS}/ELF Added: head/usr.bin/clang/lld/ld.lld.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/lld/ld.lld.1 Wed Jan 10 16:01:25 2018 (r327770) @@ -0,0 +1,364 @@ +.\"- +.\" Copyright (c) 2018 Kirill Ponomarev +.\" Copyright (c) 2018 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 AUTHORS 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 AUTHORS 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 January 10, 2018 +.Dt LD.LLD 1 +.Os +.Sh NAME +.Nm ld.lld +.Nd ELF linker from the LLVM project +.Sh SYNOPSIS +.Nm ld.lld +.Op Ar options +.Ar objfile ... +.Sh DESCRIPTION +A linker takes one or more object, archive and library files, and combines +them into an output file (an executable, a shared library, or another object +file). +It relocates code and data from the input files and resolves symbol +references between them. +.Pp +.Nm +is a drop-in replacement for the GNU BFD and gold linkers. +It accepts most of the same command line arguments and linker scripts +as GNU linkers. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl -allow-multiple-definition +Allow multiple definitions. +.It Fl -as-needed +Only set +.Dv DT_NEEDED +for shared libraries if used. +.It Fl -auxiliary Ar value +Set the +.Dv DT_AUXILIARY +field to the specified name. +.It Fl -Bdynamic +Link against shared libraries. +.It Fl -Bstatic +Do not link against shared libraries. +.It Fl -Bsymbolic-functions +Bind defined function symbols locally. +.It Fl -Bsymbolic +Bind defined symbols locally. +.It Fl -build-id= Ns Ar value +Generate a build ID note. +.It Fl -build-id +Generate a build ID note. +.It Fl -color-diagnostics= Ns Ar value +Use colors in diagnostics. +.It Fl -color-diagnostics +Use colors in diagnostics. +.It Fl -compress-debug-sections= Ns Ar value +Compress DWARF debug sections. +.It Fl -define-common +Assign space to common symbols. +.It Fl -defsym= Ns Ar value +Define a symbol alias. +.It Fl -demangle +Demangle symbol names. +.It Fl -disable-new-dtags +Disable new dynamic tags. +.It Fl -discard-all +Delete all local symbols. +.It Fl -discard-locals +Delete temporary local symbols. +.It Fl -discard-none +Keep all symbols in the symbol table. +.It Fl -dynamic-linker Ar value +Specify the dynamic linker to be used for a dynamically linked executable. +This is recorded in an ELF segment of type +.Dv PT_INTERP . +.It Fl -dynamic-list Ar value +Read a list of dynamic symbols. +.It Fl -eh-frame-hdr +Request creation of +.Li .eh_frame_hdr +section and +.Dv PT_GNU_EH_FRAME +segment header. +.It Fl -emit-relocs +Generate relocations in the output. +.It Fl -enable-new-dtags +Enable new dynamic tags. +.It Fl -end-lib +End a grouping of objects that should be treated as if they were together +in an archive. +.It Fl -entry Ar entry +Name of entry point symbol. +.It Fl -error-limit Ar value +Maximum number of errors to emit before stopping. +A value of zero indicates that there is no limit. +.It Fl -error-unresolved-symbols +Report unresolved symbols as errors. +.It Fl -exclude-libs Ar value +Exclude static libraries from automatic export. +.It Fl -export-dynamic-symbol Ar value +Put a symbol in the dynamic symbol table. +.It Fl -export-dynamic +Put symbols in the dynamic symbol table. +.It Fl -fatal-warnings +Treat warnings as errors. +.It Fl -filter= Ns Ar value +Set the +.Dv DT_FILTER +field to the specified value. +.It Fl -fini Ar symbol +Specify a finalizer function. +.It Fl -format= Ns Ar input-format +Change the input format of the inputs following this option. +.It Fl -full-shutdown +Perform a full shutdown instead of calling +.Fn _exit . +.It Fl -gc-sections +Enable garbage collection of unused sections. +.It Fl -gdb-index +Generate +.Li .gdb_index +section. +.It Fl -hash-style Ar value +Specify hash style (sysv, gnu or both). +.It Fl -help +Print a usage message. +.It Fl -icf=all +Enable identical code folding. +.It Fl -icf=none +Disable identical code folding. +.It Fl -image-base= Ns Ar value +Set the base address to +.Ar value . +.It Fl -init Ar symbol +Specify an initializer function. +.It Fl -lto-aa-pipeline= Ns Ar value +AA pipeline to run during LTO. +Used in conjunction with +.Fl -lto-newpm-passes . +.It Fl -lto-newpm-passes= Ns Ar value +Passes to run during LTO. +.It Fl -lto-O Ar opt-level +Optimization level for LTO. +.It Fl -lto-partitions= Ns Ar value +Number of LTO codegen partitions. +.It Fl L Ar dir +Add a directory to the library search path. +.It Fl l Ar libName +Root name of library to use. +.It Fl -Map Ar value +Print a link map to the specified file. +.It Fl m Ar value +Set target emulation. +.It Fl -no-as-needed +Always set +.Dv DT_NEEDED +for shared libraries. +.It Fl -no-color-diagnostics +Do not use colors in diagnostics. +.It Fl -no-define-common +Do not assign space to common symbols. +.It Fl -no-demangle +Do not demangle symbol names. +.It Fl -no-dynamic-linker +Inhibit output of an +.Li .interp +section. +.It Fl -no-gc-sections +Disable garbage collection of unused sections. +.It Fl -no-gnu-unique +Disable STB_GNU_UNIQUE symbol binding. +.It Fl -no-rosegment +Do not put read-only non-executable sections in their own segment. +.It Fl -no-threads +Do not run the linker multi-threaded. +.It Fl -no-undefined-version +Report version scripts that refer undefined symbols. +.It Fl -no-undefined +Report unresolved symbols even if the linker is creating a shared library. +.It Fl -no-whole-archive +Restores the default behavior of loading archive members. +.It Fl -noinhibit-exec +Retain the executable output file whenever it is still usable. +.It Fl -nopie +Do not create a position independent executable. +.It Fl -nostdlib +Only search directories specified on the command line. +.It Fl -oformat Ar format +Specify the binary format for the output object file. +.It Fl -omagic +Set the text and data sections to be readable and writable. +.It Fl -opt-remarks-filename Ar value +YAML output file for optimization remarks. +.It Fl -opt-remarks-with-hotness +Include hotness information in the optimization remarks file. +.It Fl O Ar value +Optimize output file size. +.It Fl o Ar path +Write the output executable, library or object to +.Ar path . +If not specified, +.Dv a.out +is used as a default. +.It Fl -pie +Create a position independent executable. +.It Fl -print-gc-sections +List removed unused sections. +.It Fl -print-map +Print a link map to the standard output. +.It Fl -relocatable +Create relocatable object file. +.It Fl -reproduce Ar value +Dump linker invocation and input files for debugging. +.It Fl -retain-symbols-file= Ns Ar file +Retain only the symbols listed in the file. +.It Fl -rpath Ar value +Add a +.Dv DT_RUNPATH +to the output. +.It Fl -rsp-quoting= Ns Ar value +Quoting style for response files. +The supported values are +.Ar windows +and +.Ar posix . +.It Fl -script Ar value +Read linker script from the path +.Ar value . +.It Fl -section-start Ar address +Set address of section. +.It Fl -shared +Build a shared object. +.It Fl -soname= Ns Ar value +Set +.Dv DT_SONAME +to +.Ar value . +.It Fl -sort-section Ar value +Specifies sections sorting rule when linkerscript is used. +.It Fl -start-lib +Start a grouping of objects that should be treated as if they were together +in an archive. +.It Fl -strip-all +Strip all symbols. +.It Fl -strip-debug +Strip debugging information. +.It Fl -symbol-ordering-file Ar value +Lay out sections in the order specified by the symbol file. +.It Fl -sysroot= Ns Ar value +Set the system root. +.It Fl -target1-abs +Interpret +.Dv R_ARM_TARGET1 +as +.Dv R_ARM_ABS32 . +.It Fl -target1-rel +Interpret +.Dv R_ARM_TARGET1 +as +.Dv R_ARM_REL32 . +.It Fl -target2=type +Interpret +.Dv R_ARM_TARGET2 +as +.Ar type , +where +.Ar type +is one of +.Li rel , +.Li abs , +or +.Li got-rel . +.It Fl -Tbss Ar value +Same as +.Fl -section-start +with +.Li .bss +as the sectionname. +.It Fl -Tdata Ar value +Same as +.Fl -section-start +with +.Li .data +as the sectionname. +.It Fl -thinlto-cache-dir= Ns Ar value +Path to ThinLTO cached object file directory. +.It Fl -thinlto-cache-policy Ar value +Pruning policy for the ThinLTO cache. +.It Fl -thinlto-jobs= Ns Ar value +Number of ThinLTO jobs. +.It Fl -threads +Run the linker multi-threaded. +.It Fl -trace-symbol Ar value +Trace references to symbols. +.It Fl -trace +Print the names of the input files. +.It Fl -Ttext Ar value +Same as +.Fl -section-start +with +.Li .text +as the sectionname. +.It Fl -undefined Ar value +Force undefined symbol during linking. +.It Fl -unresolved-symbols= Ns Ar value +Determine how to handle unresolved symbols. +.It Fl -verbose +Verbose mode. +.It Fl -version-script Ar value +Read a version script. +.It Fl V , Fl -version +Display the version number and exit. +.It Fl v +Display the version number, and proceed with linking if object files are +specified. +.It Fl -warn-common +Warn about duplicate common symbols. +.It Fl -warn-unresolved-symbols +Report unresolved symbols as warnings. +.It Fl -whole-archive +Force load of all members in a static library. +.It Fl -wrap Ar symbol +Use wrapper functions for symbol. +.It Fl z Ar option +Linker option extensions. +.Bl -tag -width indent +.It Cm notext +Allow relocations against read-only segments. +Sets the +.Dv DT_TEXTREL flag in the +.Dv DYNAMIC +section. +.It Cm text +Do not allow relocations against read-only segments. +This is the default. +.El +.El +.Sh IMPLEMENTATION NOTES +The targets supported by +.Nm +are: +elf32-i386 elf32-iamcu elf32-littlearm elf32-ntradbigmips elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips elf32-tradlittlemips elf32-x86-64 elf64-amdgpu elf64-littleaarch64 elf64-powerpc elf64-tradbigmips elf64-tradlittlemips elf64-x86-64 From owner-svn-src-all@freebsd.org Wed Jan 10 16:31:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F23FE65F45; Wed, 10 Jan 2018 16:31:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566547CF4C; Wed, 10 Jan 2018 16:31:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w0AGVBc5032088; Wed, 10 Jan 2018 08:31:11 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w0AGVAEV032087; Wed, 10 Jan 2018 08:31:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa In-Reply-To: <201801101459.w0AExJWM055025@repo.freebsd.org> To: Warner Losh Date: Wed, 10 Jan 2018 08:31:10 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:31:20 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Wed Jan 10 14:59:19 2018 > New Revision: 327767 > URL: https://svnweb.freebsd.org/changeset/base/327767 > > Log: > Retire pmtimer driver. Move time fixing into apm driver. Move > Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly > work. Call tc_settime() with our estimate of the delta we've been > alseep (the one we print) to adjust the time. Not sure what to do > about callouts, so keep the small #ifdef in place there. > > Differential Revision: https://reviews.freebsd.org/D13823 RELNOTES: ? Reason I ask is this effects custom kernel config file(s) > Deleted: > head/sys/i386/isa/pmtimer.c > Modified: > head/sys/conf/files.i386 > head/sys/i386/bios/apm.c > head/sys/i386/conf/GENERIC > head/sys/i386/conf/NOTES > > Modified: head/sys/conf/files.i386 > ============================================================================== > --- head/sys/conf/files.i386 Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/conf/files.i386 Wed Jan 10 14:59:19 2018 (r327767) > @@ -520,7 +520,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 > i386/ibcs2/ibcs2_xenix.c optional ibcs2 > i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 > i386/ibcs2/imgact_coff.c optional ibcs2 > -i386/isa/pmtimer.c optional pmtimer > i386/isa/prof_machdep.c optional profiling-routine > i386/linux/imgact_linux.c optional compat_linux > i386/linux/linux_dummy.c optional compat_linux > > Modified: head/sys/i386/bios/apm.c > ============================================================================== > --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) > @@ -16,6 +16,32 @@ > * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) > */ > > +/*- > + * Copyright (c) 2000 Mitsuru IWASAKI > + * 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$"); > > @@ -38,6 +64,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -205,7 +232,7 @@ static int > apm_driver_version(int version) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; > sc->bios.r.ebx = 0x0; > sc->bios.r.ecx = version; > @@ -220,28 +247,28 @@ apm_driver_version(int version) > > return (1); > } > - > + > /* engage/disengage power management (APM 1.1 or later) */ > static int > apm_engage_disengage_pm(int engage) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_ENGAGEDISENGAGEPM; > sc->bios.r.ebx = PMDV_ALLDEV; > sc->bios.r.ecx = engage; > sc->bios.r.edx = 0; > return (apm_bioscall()); > } > - > + > /* get PM event */ > static u_int > apm_getevent(void) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_GETPMEVENT; > - > + > sc->bios.r.ebx = 0; > sc->bios.r.ecx = 0; > sc->bios.r.edx = 0; > @@ -249,18 +276,18 @@ apm_getevent(void) > return (PMEV_NOEVENT); > return (sc->bios.r.ebx & 0xffff); > } > - > + > /* suspend entire system */ > static int > apm_suspend_system(int state) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; > sc->bios.r.ebx = PMDV_ALLDEV; > sc->bios.r.ecx = state; > sc->bios.r.edx = 0; > - > + > if (apm_bioscall()) { > printf("Entire system suspend failure: errcode = %d\n", > 0xff & (sc->bios.r.eax >> 8)); > @@ -280,7 +307,7 @@ int > apm_display(int newstate) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; > sc->bios.r.ebx = PMDV_DISP0; > sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; > @@ -331,12 +358,10 @@ apm_battery_low(void) > static struct apmhook * > apm_add_hook(struct apmhook **list, struct apmhook *ah) > { > - int s; > struct apmhook *p, *prev; > > APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); > > - s = splhigh(); > if (ah == NULL) > panic("illegal apm_hook!"); > prev = NULL; > @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook *ah > ah->ah_next = prev->ah_next; > prev->ah_next = ah; > } > - splx(s); > return ah; > } > > static void > apm_del_hook(struct apmhook **list, struct apmhook *ah) > { > - int s; > struct apmhook *p, *prev; > > - s = splhigh(); > prev = NULL; > for (p = *list; p != NULL; prev = p, p = p->ah_next) > if (p == ah) > goto deleteit; > panic("Tried to delete unregistered apm_hook."); > - goto nosuchnode; > + return; > deleteit: > if (prev != NULL) > prev->ah_next = p->ah_next; > else > *list = p->ah_next; > -nosuchnode: > - splx(s); > } > > > @@ -468,7 +488,7 @@ apm_do_standby(void) > sc->standbys = sc->standby_countdown = 0; > > /* > - * As far as standby, we don't need to execute > + * As far as standby, we don't need to execute > * all of suspend hooks. > */ > if (apm_suspend_system(PMST_STANDBY) == 0) > @@ -1047,6 +1067,53 @@ apm_processevent(void) > } while (apm_event != PMEV_NOEVENT); > } > > +static struct timeval suspend_time; > +static struct timeval diff_time; > + > +static int > +apm_rtc_suspend(void *arg __unused) > +{ > + > + microtime(&diff_time); > + inittodr(0); > + microtime(&suspend_time); > + timevalsub(&diff_time, &suspend_time); > + return (0); > +} > + > +static int > +apm_rtc_resume(void *arg __unused) > +{ > + u_int second, minute, hour; > + struct timeval resume_time, tmp_time; > + struct timespec ts; > + > + /* modified for adjkerntz */ > + timer_restore(); /* restore the all timers */ > + inittodr(0); /* adjust time to RTC */ > + microtime(&resume_time); > + getmicrotime(&tmp_time); > + timevaladd(&tmp_time, &diff_time); > + /* Calculate the delta time suspended */ > + timevalsub(&resume_time, &suspend_time); > + > + second = ts.tv_sec = resume_time.tv_sec; > + ts.tv_nsec = 0; > + tc_setclock(&ts); > + > +#ifdef PMTIMER_FIXUP_CALLTODO > + /* Fixup the calltodo list with the delta time. */ > + adjust_timeout_calltodo(&resume_time); > +#endif /* PMTIMER_FIXUP_CALLTODO */ > + hour = second / 3600; > + second %= 3600; > + minute = second / 60; > + second %= 60; > + log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", > + hour, minute, second); > + return (0); > +} > + > /* > * Attach APM: > * > @@ -1128,7 +1195,7 @@ apm_attach(device_t dev) > } > > /* Power the system off using APM */ > - EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, > + EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, > SHUTDOWN_PRI_LAST); > > /* Register APM again to pass the correct argument of pm_func. */ > @@ -1142,6 +1209,15 @@ apm_attach(device_t dev) > UID_ROOT, GID_OPERATOR, 0664, "apm"); > make_dev(&apm_cdevsw, APMDEV_CTL, > UID_ROOT, GID_OPERATOR, 0660, "apmctl"); > + > + sc->sc_suspend.ah_fun = apm_rtc_suspend; > + sc->sc_suspend.ah_arg = sc; > + apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); > + > + sc->sc_resume.ah_fun = apm_rtc_resume; > + sc->sc_resume.ah_arg = sc; > + apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); > + > return 0; > } > > @@ -1362,7 +1438,7 @@ apmwrite(struct cdev *dev, struct uio *uio, int ioflag > if ((error = uiomove((caddr_t)&event_type, sizeof(u_int), uio))) > return(error); > > - if (event_type < 0 || event_type >= APM_NPMEV) > + if (event_type >= APM_NPMEV) > return(EINVAL); > > if (sc->event_filter[event_type] == 0) { > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/i386/conf/GENERIC Wed Jan 10 14:59:19 2018 (r327767) > @@ -207,8 +207,6 @@ device agp # support several AGP chipsets > > # Power management support (see NOTES for more options) > #device apm > -# Add suspend/resume support for the i8254. > -device pmtimer > > # PCCARD (PCMCIA) support > # PCMCIA and cardbus bridge support > > Modified: head/sys/i386/conf/NOTES > ============================================================================== > --- head/sys/i386/conf/NOTES Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/i386/conf/NOTES Wed Jan 10 14:59:19 2018 (r327767) > @@ -774,7 +774,6 @@ device hyperv # HyperV drivers > # smapi: System Management Application Program Interface driver > # smbios: DMI/SMBIOS entry point > # vpd: Vital Product Data kernel interface > -# pmtimer: Adjust system timer at wakeup time > # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) > # asmc: Apple System Management Controller > # si: Specialix International SI/XIO or SX intelligent serial card driver > @@ -808,7 +807,6 @@ device ipmi > device smapi > device smbios > device vpd > -device pmtimer > device pbio > hint.pbio.0.at="isa" > hint.pbio.0.port="0x360" > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jan 10 16:48:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3ACBE66DDA for ; Wed, 10 Jan 2018 16:48:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62E757D9BC for ; Wed, 10 Jan 2018 16:48:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id p139so143542itb.1 for ; Wed, 10 Jan 2018 08:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6diGcD6B09T3qQZPIjt4mPFdA2juNNGJT/pXzdNH4h4=; b=l4oJs0hMdUbwEFplaaEeqbrVlmRZpbOaaDNhnjLV7wb+Pom8vYAQLhkOxxdAt6nMk/ 6lfzBoLrvXb5+MQVV8J3S5gMjyrolni8gZF/0djOeDlKuuVZWtlXAG5HcX63cI6oqCv/ 7xqlKvhUmxQdHqQw/mBbf8a+dXddSg5JqHCDViYv7CgLckuCSdYqiww7ePFIkpAlLNeC 7/6jCnYgo6uYLZfWGD0k8aXEGnNVVzxR/UKLIuHGmHHYvbwLnPrlNumFm7rphi/A3pUg N/nQECuJirG2b8BGWTciZTCIl8xk3U60YMMg/UYjIoz5Jf5I79IjkK1FSj9cu4PITDiS jCiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6diGcD6B09T3qQZPIjt4mPFdA2juNNGJT/pXzdNH4h4=; b=jsR0QLucCw9BeTOth43RoE+GcpM26if5kB0cwdKIrdAKfUX58O17VqVfW1FBzljuVU dBQNFcFPvEIJzJtNXEgcMcUuWBV9RbpyMjw6eSHSOUEZhTNGyfvg2RWiHEiOGjWBGE9l axHLscGLx57269jlsdwKCiYleSQXkMVKuAFaRBOwjUY214fTKdVtXQqw27xo1NeA/2X2 ZGOM1ND0iBMHVFZng/6jNAFMY2P8I8tupW+jX1cJdG6PBiOFXJo0Ssxne4Q3XFMaBMqz 8uaqEU53IrEOgf7Qn6cn3EsUcZlmBUZ+FZMOOvkcX1nGYomRE4aaUxYxDXdhhk9lpmYk XlIg== X-Gm-Message-State: AKGB3mLWNp6Oq4/KBCYz04hkIYl5FnZEgpCcbW3lg1YFPtYWHGya/IGC eRyk6XHznhYNfV7FUraOzQDAGKPYK89VFTSdSh7KXA== X-Google-Smtp-Source: ACJfBosjKkc9u0QdUeN3wcvhjSnfeWblrLei5EBsw6DvXHwFjwb7XvPVBBt4tJrdS39tEBa15I+qnc2eiR4Y0K1d0tc= X-Received: by 10.36.74.200 with SMTP id k191mr20594083itb.69.1515602886457; Wed, 10 Jan 2018 08:48:06 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 08:48:05 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 10 Jan 2018 09:48:05 -0700 X-Google-Sender-Auth: R1yjYNAk42gSJ5vUU2d2FTFL4XE Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:48:07 -0000 On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Wed Jan 10 14:59:19 2018 > > New Revision: 327767 > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > Log: > > Retire pmtimer driver. Move time fixing into apm driver. Move > > Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly > > work. Call tc_settime() with our estimate of the delta we've been > > alseep (the one we print) to adjust the time. Not sure what to do > > about callouts, so keep the small #ifdef in place there. > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > RELNOTES: ? > Reason I ask is this effects custom kernel config file(s) Don't know. We don't normally document every kernel config file changes that's required. Warner > > Deleted: > > head/sys/i386/isa/pmtimer.c > > Modified: > > head/sys/conf/files.i386 > > head/sys/i386/bios/apm.c > > head/sys/i386/conf/GENERIC > > head/sys/i386/conf/NOTES > > > > Modified: head/sys/conf/files.i386 > > ============================================================ > ================== > > --- head/sys/conf/files.i386 Wed Jan 10 14:58:58 2018 (r327766) > > +++ head/sys/conf/files.i386 Wed Jan 10 14:59:19 2018 (r327767) > > @@ -520,7 +520,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 > > i386/ibcs2/ibcs2_xenix.c optional ibcs2 > > i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 > > i386/ibcs2/imgact_coff.c optional ibcs2 > > -i386/isa/pmtimer.c optional pmtimer > > i386/isa/prof_machdep.c optional profiling-routine > > i386/linux/imgact_linux.c optional compat_linux > > i386/linux/linux_dummy.c optional compat_linux > > > > Modified: head/sys/i386/bios/apm.c > > ============================================================ > ================== > > --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) > > +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) > > @@ -16,6 +16,32 @@ > > * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) > > */ > > > > +/*- > > + * Copyright (c) 2000 Mitsuru IWASAKI > > + * 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$"); > > > > @@ -38,6 +64,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > > > @@ -205,7 +232,7 @@ static int > > apm_driver_version(int version) > > { > > struct apm_softc *sc = &apm_softc; > > - > > + > > sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; > > sc->bios.r.ebx = 0x0; > > sc->bios.r.ecx = version; > > @@ -220,28 +247,28 @@ apm_driver_version(int version) > > > > return (1); > > } > > - > > + > > /* engage/disengage power management (APM 1.1 or later) */ > > static int > > apm_engage_disengage_pm(int engage) > > { > > struct apm_softc *sc = &apm_softc; > > - > > + > > sc->bios.r.eax = (APM_BIOS << 8) | APM_ENGAGEDISENGAGEPM; > > sc->bios.r.ebx = PMDV_ALLDEV; > > sc->bios.r.ecx = engage; > > sc->bios.r.edx = 0; > > return (apm_bioscall()); > > } > > - > > + > > /* get PM event */ > > static u_int > > apm_getevent(void) > > { > > struct apm_softc *sc = &apm_softc; > > - > > + > > sc->bios.r.eax = (APM_BIOS << 8) | APM_GETPMEVENT; > > - > > + > > sc->bios.r.ebx = 0; > > sc->bios.r.ecx = 0; > > sc->bios.r.edx = 0; > > @@ -249,18 +276,18 @@ apm_getevent(void) > > return (PMEV_NOEVENT); > > return (sc->bios.r.ebx & 0xffff); > > } > > - > > + > > /* suspend entire system */ > > static int > > apm_suspend_system(int state) > > { > > struct apm_softc *sc = &apm_softc; > > - > > + > > sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; > > sc->bios.r.ebx = PMDV_ALLDEV; > > sc->bios.r.ecx = state; > > sc->bios.r.edx = 0; > > - > > + > > if (apm_bioscall()) { > > printf("Entire system suspend failure: errcode = %d\n", > > 0xff & (sc->bios.r.eax >> 8)); > > @@ -280,7 +307,7 @@ int > > apm_display(int newstate) > > { > > struct apm_softc *sc = &apm_softc; > > - > > + > > sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; > > sc->bios.r.ebx = PMDV_DISP0; > > sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; > > @@ -331,12 +358,10 @@ apm_battery_low(void) > > static struct apmhook * > > apm_add_hook(struct apmhook **list, struct apmhook *ah) > > { > > - int s; > > struct apmhook *p, *prev; > > > > APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); > > > > - s = splhigh(); > > if (ah == NULL) > > panic("illegal apm_hook!"); > > prev = NULL; > > @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook > *ah > > ah->ah_next = prev->ah_next; > > prev->ah_next = ah; > > } > > - splx(s); > > return ah; > > } > > > > static void > > apm_del_hook(struct apmhook **list, struct apmhook *ah) > > { > > - int s; > > struct apmhook *p, *prev; > > > > - s = splhigh(); > > prev = NULL; > > for (p = *list; p != NULL; prev = p, p = p->ah_next) > > if (p == ah) > > goto deleteit; > > panic("Tried to delete unregistered apm_hook."); > > - goto nosuchnode; > > + return; > > deleteit: > > if (prev != NULL) > > prev->ah_next = p->ah_next; > > else > > *list = p->ah_next; > > -nosuchnode: > > - splx(s); > > } > > > > > > @@ -468,7 +488,7 @@ apm_do_standby(void) > > sc->standbys = sc->standby_countdown = 0; > > > > /* > > - * As far as standby, we don't need to execute > > + * As far as standby, we don't need to execute > > * all of suspend hooks. > > */ > > if (apm_suspend_system(PMST_STANDBY) == 0) > > @@ -1047,6 +1067,53 @@ apm_processevent(void) > > } while (apm_event != PMEV_NOEVENT); > > } > > > > +static struct timeval suspend_time; > > +static struct timeval diff_time; > > + > > +static int > > +apm_rtc_suspend(void *arg __unused) > > +{ > > + > > + microtime(&diff_time); > > + inittodr(0); > > + microtime(&suspend_time); > > + timevalsub(&diff_time, &suspend_time); > > + return (0); > > +} > > + > > +static int > > +apm_rtc_resume(void *arg __unused) > > +{ > > + u_int second, minute, hour; > > + struct timeval resume_time, tmp_time; > > + struct timespec ts; > > + > > + /* modified for adjkerntz */ > > + timer_restore(); /* restore the all timers */ > > + inittodr(0); /* adjust time to RTC */ > > + microtime(&resume_time); > > + getmicrotime(&tmp_time); > > + timevaladd(&tmp_time, &diff_time); > > + /* Calculate the delta time suspended */ > > + timevalsub(&resume_time, &suspend_time); > > + > > + second = ts.tv_sec = resume_time.tv_sec; > > + ts.tv_nsec = 0; > > + tc_setclock(&ts); > > + > > +#ifdef PMTIMER_FIXUP_CALLTODO > > + /* Fixup the calltodo list with the delta time. */ > > + adjust_timeout_calltodo(&resume_time); > > +#endif /* PMTIMER_FIXUP_CALLTODO */ > > + hour = second / 3600; > > + second %= 3600; > > + minute = second / 60; > > + second %= 60; > > + log(LOG_NOTICE, "wakeup from sleeping state (slept > %02d:%02d:%02d)\n", > > + hour, minute, second); > > + return (0); > > +} > > + > > /* > > * Attach APM: > > * > > @@ -1128,7 +1195,7 @@ apm_attach(device_t dev) > > } > > > > /* Power the system off using APM */ > > - EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, > > + EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, > > SHUTDOWN_PRI_LAST); > > > > /* Register APM again to pass the correct argument of pm_func. */ > > @@ -1142,6 +1209,15 @@ apm_attach(device_t dev) > > UID_ROOT, GID_OPERATOR, 0664, "apm"); > > make_dev(&apm_cdevsw, APMDEV_CTL, > > UID_ROOT, GID_OPERATOR, 0660, "apmctl"); > > + > > + sc->sc_suspend.ah_fun = apm_rtc_suspend; > > + sc->sc_suspend.ah_arg = sc; > > + apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); > > + > > + sc->sc_resume.ah_fun = apm_rtc_resume; > > + sc->sc_resume.ah_arg = sc; > > + apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); > > + > > return 0; > > } > > > > @@ -1362,7 +1438,7 @@ apmwrite(struct cdev *dev, struct uio *uio, int > ioflag > > if ((error = uiomove((caddr_t)&event_type, sizeof(u_int), uio))) > > return(error); > > > > - if (event_type < 0 || event_type >= APM_NPMEV) > > + if (event_type >= APM_NPMEV) > > return(EINVAL); > > > > if (sc->event_filter[event_type] == 0) { > > > > Modified: head/sys/i386/conf/GENERIC > > ============================================================ > ================== > > --- head/sys/i386/conf/GENERIC Wed Jan 10 14:58:58 2018 > (r327766) > > +++ head/sys/i386/conf/GENERIC Wed Jan 10 14:59:19 2018 > (r327767) > > @@ -207,8 +207,6 @@ device agp # support > several AGP chipsets > > > > # Power management support (see NOTES for more options) > > #device apm > > -# Add suspend/resume support for the i8254. > > -device pmtimer > > > > # PCCARD (PCMCIA) support > > # PCMCIA and cardbus bridge support > > > > Modified: head/sys/i386/conf/NOTES > > ============================================================ > ================== > > --- head/sys/i386/conf/NOTES Wed Jan 10 14:58:58 2018 (r327766) > > +++ head/sys/i386/conf/NOTES Wed Jan 10 14:59:19 2018 (r327767) > > @@ -774,7 +774,6 @@ device hyperv # HyperV drivers > > # smapi: System Management Application Program Interface driver > > # smbios: DMI/SMBIOS entry point > > # vpd: Vital Product Data kernel interface > > -# pmtimer: Adjust system timer at wakeup time > > # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech > PCL-724) > > # asmc: Apple System Management Controller > > # si: Specialix International SI/XIO or SX intelligent serial card > driver > > @@ -808,7 +807,6 @@ device ipmi > > device smapi > > device smbios > > device vpd > > -device pmtimer > > device pbio > > hint.pbio.0.at="isa" > > hint.pbio.0.port="0x360" > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Wed Jan 10 16:51:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25ABAE67133; Wed, 10 Jan 2018 16:51:37 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08E0E7DD2C; Wed, 10 Jan 2018 16:51:37 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2C00E00KJ9MD00@mr11p00im-asmtp004.me.com>; Wed, 10 Jan 2018 16:51:29 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1515603089; bh=m2jknCVbn89Ark0avQyFBKq277y6M5dRFYJ81klTME0=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=ETpoOBd4pl6yvqBfIG/iIyvqtH2o9fg2emkwy8zxKSHHlVXgqEzEQ1bZG/aP/zCbj Vu+oSUeRdTJS/sCtCe7eEu1tqrWmIux0or5AWG3ABCAEktmtKO63rOg5OoAFw0lktf q6UYcQwdPR5Y72kiTqPSn+sdSm22fVEpTdyOj7JLZp29p1jVQBlm+iEjM9wXY9EvpA eMVl9ZjXaexyAgmsIQiFibACmqY/MLxDxW14CW8V7M5VT3GqNq8wYUgnmyFMVMyvIQ 30thRlJbQ5gxT1mpqpuzKw0sS0b+lDRz0FYKPWeMNSSfZhO7cJ6NpYFfDhql9Axwfq aMZDz1hJ2YUjQ== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2C00P57MTR3B00@mr11p00im-asmtp004.me.com>; Wed, 10 Jan 2018 16:51:28 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-10_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801100236 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Wed, 10 Jan 2018 08:51:27 -0800 Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd From: Ravi Pokala To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd References: <201801100630.w0A6UxLT041383@repo.freebsd.org> In-reply-to: <201801100630.w0A6UxLT041383@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:51:37 -0000 Hi Conrad, Alas, this still doesn't look right on RISC-V: zstd_kfreebsd.o: In function `__ctzdi2': /usr/home/rpokala/freebsd/clean/base/head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c:58: undefined reference to `ffsll' I got substantively the same error both before and after `pkg upgrade' brought in updated RISC-V stuff: riscv64-binutils (2.29.51.20170726 -> 2.29_20180105,1) riscv64-gcc (7.1.1 -> 7.2.0) Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Conrad Meyer Date: 2018-01-09, Tuesday at 22:30 To: , , Subject: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd Author: cem Date: Wed Jan 10 06:30:59 2018 New Revision: 327763 URL: https://svnweb.freebsd.org/changeset/base/327763 Log: Finally, fix Zstd kernel build on MIPS and RISC-V Add an implementation of the intrinsics invoked by __builtin_ctz{,ll} and __builtin_clz{,ll}, and include this compilation unit on platforms that lack assembly intrinsics for those builtins (MIPS and RISC-V). Future cleanup work might involve bringing these into a mini libcompiler-rt for the standalone kernel environment. Or cleaning up the approach upstream takes for builtins in standalone environments (or just FreeBSD). For now, at least this builds, and doesn't require modifying the vendor code. Reported by: jeff, markj, mizhka Reviewed by: jhb (earlier version), rpokala (comment text earlier version) Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/conf/files.riscv Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.mips Wed Jan 10 06:30:59 2018 (r327763) @@ -112,3 +112,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/mips/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/mips/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/mips/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.riscv Wed Jan 10 06:30:59 2018 (r327763) @@ -56,3 +56,6 @@ riscv/riscv/uio_machdep.c standard riscv/riscv/uma_machdep.c standard riscv/riscv/unwind.c optional ddb | kdtrace_hooks | stack riscv/riscv/vm_machdep.c standard + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Wed Jan 10 06:30:59 2018 (r327763) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2018 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. + * + * $FreeBSD$ + */ + +#include "zstd_kfreebsd.h" + +/* + * The kernel as a standalone target does not link against libgcc or + * libcompiler-rt. On platforms (e.g., MIPS and RISCV) that do not have a + * direct assembly implementation of the relevant builtin functions that zstd + * references, the compiler converts them into calls to the runtime library + * intrinsics. Since the kernel does not link against the runtime libraries, + * this results in a failure to link the kernel. + * + * The goal of the following definitions is to use supported kernel constructs + * to implement the same functionality, without adding diff to the Zstd contrib + * code. + * + * A subsequent enhancement might create a mini compiler-rt library for kernel + * use and move these over there instead. + */ + +/* Count trailing zeros */ +int +__ctzsi2(int x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffs(x) - 1); +} + +long long +__ctzdi2(long long x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffsll(x) - 1); +} + +/* Count leading zeros */ +int +__clzsi2(int x) +{ + return (sizeof(x) * NBBY - fls(x)); +} + +long long +__clzdi2(long long x) +{ + return (sizeof(x) * NBBY - flsll(x)); +} From owner-svn-src-all@freebsd.org Wed Jan 10 16:51:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C1DEE671B9; Wed, 10 Jan 2018 16:51:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 157227DFA6; Wed, 10 Jan 2018 16:51:57 +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 47501484; Wed, 10 Jan 2018 16:51:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AGpu6f004968; Wed, 10 Jan 2018 16:51:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AGpu91004966; Wed, 10 Jan 2018 16:51:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101651.w0AGpu91004966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327771 - in head/sys: conf i386/i386 i386/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf i386/i386 i386/isa X-SVN-Commit-Revision: 327771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:51:57 -0000 Author: imp Date: Wed Jan 10 16:51:55 2018 New Revision: 327771 URL: https://svnweb.freebsd.org/changeset/base/327771 Log: Move prof_machdep.c to it's more traditional place under i386/i386. Added: head/sys/i386/i386/prof_machdep.c (contents, props changed) - copied, changed from r327770, head/sys/i386/isa/prof_machdep.c Deleted: head/sys/i386/isa/ Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jan 10 16:01:25 2018 (r327770) +++ head/sys/conf/files.i386 Wed Jan 10 16:51:55 2018 (r327771) @@ -493,6 +493,7 @@ i386/i386/mpboot.s optional smp i386/i386/npx.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard +i386/i386/prof_machdep.c optional profiling-routine i386/i386/ptrace_machdep.c standard i386/i386/support.s standard i386/i386/swtch.s standard @@ -520,7 +521,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux Copied and modified: head/sys/i386/i386/prof_machdep.c (from r327770, head/sys/i386/isa/prof_machdep.c) ============================================================================== From owner-svn-src-all@freebsd.org Wed Jan 10 16:52:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D781E67368; Wed, 10 Jan 2018 16:52:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3F87DFD2; Wed, 10 Jan 2018 16:52:02 +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 496DE48A; Wed, 10 Jan 2018 16:52:01 +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 w0AGq10o005026; Wed, 10 Jan 2018 16:52:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AGq1e2005025; Wed, 10 Jan 2018 16:52:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101652.w0AGq1e2005025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 16:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327772 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:52:02 -0000 Author: imp Date: Wed Jan 10 16:52:00 2018 New Revision: 327772 URL: https://svnweb.freebsd.org/changeset/base/327772 Log: Docuent pmtimer driver removal. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 10 16:51:55 2018 (r327771) +++ head/UPDATING Wed Jan 10 16:52:00 2018 (r327772) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180110: + On i386, pmtimer has been removed. It's functionality has been folded + into apm. It was a nop on ACPI. Users may need to remove it from kernel + config files. + 20180104: The use of RSS hash from the network card aka flowid has been disabled by default for lagg(4) as it's currently incompatible with From owner-svn-src-all@freebsd.org Wed Jan 10 16:56:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8C5E67686; Wed, 10 Jan 2018 16:56:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D983D7E359; Wed, 10 Jan 2018 16:56:03 +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 E9F924B4; Wed, 10 Jan 2018 16:56:02 +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 w0AGu2Tl007600; Wed, 10 Jan 2018 16:56:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AGu2OV007599; Wed, 10 Jan 2018 16:56:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101656.w0AGu2OV007599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 16:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327773 - head/usr.sbin/digictl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/digictl X-SVN-Commit-Revision: 327773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:56:04 -0000 Author: imp Date: Wed Jan 10 16:56:02 2018 New Revision: 327773 URL: https://svnweb.freebsd.org/changeset/base/327773 Log: Catchup to removing this directory Deleted: head/usr.sbin/digictl/ From owner-svn-src-all@freebsd.org Wed Jan 10 16:58:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E4DE6791F; Wed, 10 Jan 2018 16:58:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22A297E4FF; Wed, 10 Jan 2018 16:58:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 612CBAEEB; Wed, 10 Jan 2018 16:58:21 +0000 (UTC) Date: Wed, 10 Jan 2018 16:58:21 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa Message-ID: <20180110165821.GA69465@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 16:58:22 -0000 On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: > > > New Revision: 327767 > > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > > > Log: > > > Retire pmtimer driver. Move time fixing into apm driver. Move > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly > > > work. Call tc_settime() with our estimate of the delta we've been > > > alseep (the one we print) to adjust the time. Not sure what to do > > > about callouts, so keep the small #ifdef in place there. > > > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > > > RELNOTES: ? > > Reason I ask is this effects custom kernel config file(s) > > Don't know. We don't normally document every kernel config file changes > that's required. Well, `pmtimer' is a bit special. It is required in the kernel config in order to preserve time counting during suspend (not sure about amd64, but at least on i386, "device pmtimer" is required to be in kernel config for timekeeping while sleeping). ./danfe From owner-svn-src-all@freebsd.org Wed Jan 10 17:01:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CE49E67BD0 for ; Wed, 10 Jan 2018 17:01:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E00697E7EA for ; Wed, 10 Jan 2018 17:01:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id f143so208932itb.0 for ; Wed, 10 Jan 2018 09:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Z14fbbqa3TKgxQR8UqCfTxtroV0hsH2kORlUZktUpiI=; b=K6bz6sYwT+2/rKUjUYtL8jBXv2xIKH7S71dYGjntfQ2OjHZG9eaamqVujiIVcZ/Zei +l71v21rMNx0qhxK2468T5tOOZw+HBqmTtb6Awq6OpjQaZMA5K5gahrtKZYDJ5NVXyG2 tW2pRG8DOk0WBwXr2eAtoiTuMLA90R8TQmCFjyR0kcQNjSPuUBUTnfT8fWwaUF17FOW9 jUbobDmfmVd6MssKIbdXU+0J16ANoB8dJ/OqmX/3WhC91rJtsrU3Bp9ETC9Fd0Y3SLyV MObympXuH24h8ucZIKh8EkuWL9M8SLpoOs0dhBChZqdIsCtQRfnKrtbwo2IzBkUi9JCP EVfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Z14fbbqa3TKgxQR8UqCfTxtroV0hsH2kORlUZktUpiI=; b=kt08ht4edIqMpf2rfIDdNemHcC7i6A7TFVsHCD835c+CTfFwsHDohWqQKyj9dcxsJd gawMjmaj5JfUZei22fU4RduNSc5S7mTXnUTyiXdbGknhzOp34UCgdrAsPdsQQ//VqVEk PZ+5FPffTq9aN+20R49gnrU0rhfi+njEPHZSRJIKXBFLq3varU5zlY+rAcAEmJh3dxoa Sb5nFy1hChTMdqS9Nzg90Dwoc8SSVTx1mUFWyPEPL7TfY9iH28t+J7ukPx+26JecbhWL Lj564tS2w8cuz2c7BsAuvwocpKxuGrgpnkOav6snWgRpwZ9A8uUC8p+9h7TD2DmLcSCu IvfA== X-Gm-Message-State: AKGB3mJ9YyyitQAsfI5CoLIhBE1CgkPyAeAmMpzK45rvZnL9a4pdHJNu izw+psM/dqcIpbSg1mrlYNFQct7gx0YYJtboQ9qOyg== X-Google-Smtp-Source: ACJfBovfhmrzyD1ijZf8vQ17Q37dMTkkVmP3w7EWj0uzHTtYhpp2V1J1xmv4zSgMilOfr8qg7LBMbPfMhHs4MDIM80s= X-Received: by 10.36.74.200 with SMTP id k191mr20637676itb.69.1515603702200; Wed, 10 Jan 2018 09:01:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 09:01:41 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180110165821.GA69465@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> From: Warner Losh Date: Wed, 10 Jan 2018 10:01:41 -0700 X-Google-Sender-Auth: hPMWm9T2XPeWbx6rHoMnrMaz5PA Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: Alexey Dokuchaev Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:01:43 -0000 On Wed, Jan 10, 2018 at 9:58 AM, Alexey Dokuchaev wrote: > On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: > > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: > > > > New Revision: 327767 > > > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > > > > > Log: > > > > Retire pmtimer driver. Move time fixing into apm driver. Move > > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't > possibly > > > > work. Call tc_settime() with our estimate of the delta we've been > > > > alseep (the one we print) to adjust the time. Not sure what to do > > > > about callouts, so keep the small #ifdef in place there. > > > > > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > > > > > RELNOTES: ? > > > Reason I ask is this effects custom kernel config file(s) > > > > Don't know. We don't normally document every kernel config file changes > > that's required. > > Well, `pmtimer' is a bit special. It is required in the kernel config in > order to preserve time counting during suspend (not sure about amd64, but > at least on i386, "device pmtimer" is required to be in kernel config for > timekeeping while sleeping). > It's only required for APM. ACPI it's a nop. And it didn't (until I believe that I fixed it) even adjust the time for APM. On APM it just prints how long the sleep was. Warner From owner-svn-src-all@freebsd.org Wed Jan 10 17:14:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B38E68C2E for ; Wed, 10 Jan 2018 17:14:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420817F41A for ; Wed, 10 Jan 2018 17:14:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id e20so173057iof.12 for ; Wed, 10 Jan 2018 09:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PgKNrTscNkp8UxoP4w7DSfx+ZuSqkCCN7q6zUWgka0E=; b=lu8CDv05+o1IJePZlDOGlRyfSBHpaYh/0gXd6aLjIMu1Eit9dia9NQ4EMd2YaIC2wA /s5G0RE5/A7fL0SXnZVXPPjk9RB2M/LZd4aJLq3A5G3I+it+2+AFZ2L1+dZpOVSaESTw 0SXslHSmqeMjaz8PoNKGgvuOS76XggF7MTr8meMwnKGiUZwRB5Ix5+Cg0IPXY98ufN+v O9mygwBnlnKBErBLBEmfhON/aDFetuEGTvJsinJU04WL4eMlQP7Y6yvz1GNLfiHIS06F dc/KmVCI7hlFKK1GYT+4tj2uBWl8s+9mdlvgEDZNLiKTQtduhgJn3YYY6x4VeqDEDt14 JYLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PgKNrTscNkp8UxoP4w7DSfx+ZuSqkCCN7q6zUWgka0E=; b=R+Ede7Bt9t+c6aKC1iKbD/rtQmXw173oesmXRC8p0+sTasveMtexnbeDA/zzdE9dWg 9yyntfF4L7wcPq1p2otf1ubx6hAop5m0NtEVUXLLJ8I7cqvD5Je8+D7tbuK88x7DV5h5 lCSc9Wa0DFqLZ1JB4H778Uz5FaK1VTC6OdHzza35pJQGUEDMwO60DVXibCjW/JssQtY+ jC75f7LoFx9klch+T8lS78g9+bPRfpoAMeFcmfH7pfX7a+Ajd8W14ArWdZcSixO4sqFD TXqu7BmSLdBBX/Uzc0xnvBS7FbwgUbWvHDkEB+677/QoIhq6341kgqrnNzdOtgB72tll LesQ== X-Gm-Message-State: AKGB3mL/vvE1+LFwoX+5GqbXbiXmhB/iGvKGoXmyo6uJE+FC1oTA5kJp ZDclho29/lnK4Hhwa0egYCqHXd9LhN+uvJu+GxXtQA== X-Google-Smtp-Source: ACJfBou2DTy6RO/inYTEroPyYqBgax5B7sms7y1NolrwH3kuhaLhgV8uVJt7KW4fZp2BhPBdj2fTfmQ9/SncCzcXOrs= X-Received: by 10.107.180.151 with SMTP id d145mr17227961iof.136.1515604465415; Wed, 10 Jan 2018 09:14:25 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 09:14:24 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> From: Warner Losh Date: Wed, 10 Jan 2018 10:14:24 -0700 X-Google-Sender-Auth: GEuAve0McutLQipCKoo8O41IStY Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: Alexey Dokuchaev Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:14:26 -0000 On Wed, Jan 10, 2018 at 10:01 AM, Warner Losh wrote: > > > On Wed, Jan 10, 2018 at 9:58 AM, Alexey Dokuchaev > wrote: > >> On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: >> > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: >> > > > New Revision: 327767 >> > > > URL: https://svnweb.freebsd.org/changeset/base/327767 >> > > > >> > > > Log: >> > > > Retire pmtimer driver. Move time fixing into apm driver. Move >> > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't >> possibly >> > > > work. Call tc_settime() with our estimate of the delta we've been >> > > > alseep (the one we print) to adjust the time. Not sure what to do >> > > > about callouts, so keep the small #ifdef in place there. >> > > > >> > > > Differential Revision: https://reviews.freebsd.org/D13823 >> > > >> > > RELNOTES: ? >> > > Reason I ask is this effects custom kernel config file(s) >> > >> > Don't know. We don't normally document every kernel config file changes >> > that's required. >> >> Well, `pmtimer' is a bit special. It is required in the kernel config in >> order to preserve time counting during suspend (not sure about amd64, but >> at least on i386, "device pmtimer" is required to be in kernel config for >> timekeeping while sleeping). >> > > It's only required for APM. ACPI it's a nop. > This part is true. Well, it was only required for APM. Not it's not required at all since, like ACPI, APM sets the time internally. > And it didn't (until I believe that I fixed it) even adjust the time for > APM. On APM it just prints how long the sleep was. > That last bit of what I wrote was wrong. The FIXME lead me to believe time wasn't being set, but the inittodr(0) sets time. Warner From owner-svn-src-all@freebsd.org Wed Jan 10 17:14:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E708E68CA2; Wed, 10 Jan 2018 17:14:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9437F566; Wed, 10 Jan 2018 17:14:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 7938AB74F; Wed, 10 Jan 2018 17:14:44 +0000 (UTC) Date: Wed, 10 Jan 2018 17:14:44 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa Message-ID: <20180110171444.GA85022@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:14:45 -0000 On Wed, Jan 10, 2018 at 10:01:41AM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 9:58 AM, Alexey Dokuchaev wrote: > > On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: > > > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: > > > > > New Revision: 327767 > > > > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > > > > > > > Log: > > > > > Retire pmtimer driver. Move time fixing into apm driver. Move > > > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't > > possibly > > > > > work. Call tc_settime() with our estimate of the delta we've been > > > > > alseep (the one we print) to adjust the time. Not sure what to do > > > > > about callouts, so keep the small #ifdef in place there. > > > > > > > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > > > > > > > RELNOTES: ? > > > > Reason I ask is this effects custom kernel config file(s) > > > > > > Don't know. We don't normally document every kernel config file changes > > > that's required. > > > > Well, `pmtimer' is a bit special. It is required in the kernel config in > > order to preserve time counting during suspend (not sure about amd64, but > > at least on i386, "device pmtimer" is required to be in kernel config for > > timekeeping while sleeping). > > It's only required for APM. ACPI it's a nop. > > And it didn't (until I believe that I fixed it) even adjust the time for > APM. On APM it just prints how long the sleep was. Not sure of now, but at least back in 2013 pmtimer was required on my i386 ACPI-ish laptop (it is still required now, but I just don't run -CURRENT): https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html ./danfe From owner-svn-src-all@freebsd.org Wed Jan 10 17:20:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72577E691E7 for ; Wed, 10 Jan 2018 17:20:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E9697F957 for ; Wed, 10 Jan 2018 17:20:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id x42so242212ita.4 for ; Wed, 10 Jan 2018 09:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ro03w/bqno8X+23SQeloL4vwPWyl0URLsEIMVhLDumE=; b=SlEyT49iSFZPChNC74dIfMldKcsVz9+pB3tx++TpppC3tyyFOYW29nDHK9d1yVpJ61 8CDk4ZTskgbKbf1f0dkNpIjmQlhW5szNjfd4fytszvVCTSHpGOx88sj+ZoKkIPVy2JXp JqqwyWzzay6aJPLDk7rCSKjTJPu4/n1rjTnwEhI8d8uW6zXCZPpKyxsKLTzcagvUb7bx LiaO2lFRbM6F18G2rrbQuCv9nku4K6yTeOLE1fQu5y1VGLnya8qSz4qN3X/7UzOnXSvy FoWZSlDLmV8efmpgpikFyx9PFq9AX9lR8vUeVy7YF2TvbYMCDC76G5TgqzpeyEQRQRmA c21Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Ro03w/bqno8X+23SQeloL4vwPWyl0URLsEIMVhLDumE=; b=egIgfoP9XFf5zHxZvJjqxbM6QnuGOFt9kGJqh33lPlhO1FlmMgWub3MpzURsypAZhJ bMCrWexPpRn11O/Ibaa4AiE6xnBoOqMWpc0VvRAzM6VEYhk/onXrqjHfpegfbGizxxEC HMpbVrexJMouyDF941KcjqWWkku5yO1Bw4ZpkLixBP2SjN5Vg1HOGOQxi0wTmhUIDnp9 1dEQzbM8sMvk5MyBG9GPRVoNE1rKefj9we2oM9ftlrJpk2EWT5N51V+AqwM42o+o7psk EQ/lfBYC94w9W7n2TKMz7Mkdou0o54h3QojXhrcVXeonzJNhDAG680Zj3kQFL2qM+G3o JE9A== X-Gm-Message-State: AKGB3mLV6MvBUWj/yzqAhhIimX/NQK5O07tX9prGV7PjR08O8XfJU93l oXho6uzKs/tUQ5srPf/wzXtKhPtYCBdUvjvW6Oxn8g== X-Google-Smtp-Source: ACJfBosBg5tqtdCZb487OTKas90l+0/Ft8JdZdbxQLkrFrwzfCos7SiFmisyxGb4I8llqeqAVc0gU4M2nN7mDCISHZg= X-Received: by 10.36.74.200 with SMTP id k191mr20706107itb.69.1515604818300; Wed, 10 Jan 2018 09:20:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 09:20:17 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180110171444.GA85022@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> <20180110171444.GA85022@FreeBSD.org> From: Warner Losh Date: Wed, 10 Jan 2018 10:20:17 -0700 X-Google-Sender-Auth: x4k1i6h9bIC6F_07sEh7qmRo_ls Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: Alexey Dokuchaev Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:20:19 -0000 On Wed, Jan 10, 2018 at 10:14 AM, Alexey Dokuchaev wrote: > On Wed, Jan 10, 2018 at 10:01:41AM -0700, Warner Losh wrote: > > On Wed, Jan 10, 2018 at 9:58 AM, Alexey Dokuchaev > wrote: > > > On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: > > > > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: > > > > > > New Revision: 327767 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > > > > > > > > > Log: > > > > > > Retire pmtimer driver. Move time fixing into apm driver. Move > > > > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't > > > possibly > > > > > > work. Call tc_settime() with our estimate of the delta we've > been > > > > > > alseep (the one we print) to adjust the time. Not sure what to > do > > > > > > about callouts, so keep the small #ifdef in place there. > > > > > > > > > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > > > > > > > > > RELNOTES: ? > > > > > Reason I ask is this effects custom kernel config file(s) > > > > > > > > Don't know. We don't normally document every kernel config file > changes > > > > that's required. > > > > > > Well, `pmtimer' is a bit special. It is required in the kernel config > in > > > order to preserve time counting during suspend (not sure about amd64, > but > > > at least on i386, "device pmtimer" is required to be in kernel config > for > > > timekeeping while sleeping). > > > > It's only required for APM. ACPI it's a nop. > > > > And it didn't (until I believe that I fixed it) even adjust the time for > > APM. On APM it just prints how long the sleep was. > > Not sure of now, but at least back in 2013 pmtimer was required on my i386 > ACPI-ish laptop (it is still required now, but I just don't run -CURRENT): > > https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html It's been a nop in ACPI only on -current. Prior to making it a nop on current ACPI set the time, it was a nop for amd64. Warner From owner-svn-src-all@freebsd.org Wed Jan 10 17:25:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F14A7E6969E; Wed, 10 Jan 2018 17:25:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB63C7FE56; Wed, 10 Jan 2018 17:25:09 +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 14EF8986; Wed, 10 Jan 2018 17:25:09 +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 w0AHP8Jh020381; Wed, 10 Jan 2018 17:25:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AHP8Ca020379; Wed, 10 Jan 2018 17:25:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801101725.w0AHP8Ca020379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 10 Jan 2018 17:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327774 - in head: . sys/i386/bios X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/i386/bios X-SVN-Commit-Revision: 327774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:25:10 -0000 Author: imp Date: Wed Jan 10 17:25:08 2018 New Revision: 327774 URL: https://svnweb.freebsd.org/changeset/base/327774 Log: inittodr(0) actually sets the time, so there's no need to call tc_setclock(). It's redundant. Tweak UPDATING based on code review of past releases. Relnotes: yes (for the removal of pmtimer) Modified: head/UPDATING head/sys/i386/bios/apm.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 10 16:56:02 2018 (r327773) +++ head/UPDATING Wed Jan 10 17:25:08 2018 (r327774) @@ -53,8 +53,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20180110: On i386, pmtimer has been removed. It's functionality has been folded - into apm. It was a nop on ACPI. Users may need to remove it from kernel - config files. + into apm. It was a nop on ACPI in current for a while now (but was still + needed on i386 in FreeBSD 11 and earlier). Users may need to remove it + from kernel config files. 20180104: The use of RSS hash from the network card aka flowid has been Modified: head/sys/i386/bios/apm.c ============================================================================== --- head/sys/i386/bios/apm.c Wed Jan 10 16:56:02 2018 (r327773) +++ head/sys/i386/bios/apm.c Wed Jan 10 17:25:08 2018 (r327774) @@ -1086,7 +1086,6 @@ apm_rtc_resume(void *arg __unused) { u_int second, minute, hour; struct timeval resume_time, tmp_time; - struct timespec ts; /* modified for adjkerntz */ timer_restore(); /* restore the all timers */ @@ -1097,14 +1096,11 @@ apm_rtc_resume(void *arg __unused) /* Calculate the delta time suspended */ timevalsub(&resume_time, &suspend_time); - second = ts.tv_sec = resume_time.tv_sec; - ts.tv_nsec = 0; - tc_setclock(&ts); - #ifdef PMTIMER_FIXUP_CALLTODO /* Fixup the calltodo list with the delta time. */ adjust_timeout_calltodo(&resume_time); #endif /* PMTIMER_FIXUP_CALLTODO */ + second = resume_time.tv_sec; hour = second / 3600; second %= 3600; minute = second / 60; From owner-svn-src-all@freebsd.org Wed Jan 10 17:30:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9899E69AED; Wed, 10 Jan 2018 17:30:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8639B801FC; Wed, 10 Jan 2018 17:30:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D7903BF5C; Wed, 10 Jan 2018 17:30:13 +0000 (UTC) Date: Wed, 10 Jan 2018 17:30:13 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa Message-ID: <20180110173013.GB85022@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> <20180110171444.GA85022@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:30:14 -0000 On Wed, Jan 10, 2018 at 10:20:17AM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 10:14 AM, Alexey Dokuchaev wrote: > > ... > > Not sure of now, but at least back in 2013 pmtimer was required on my > > i386 ACPI-ish laptop (it is still required now, but I just don't run > > -CURRENT): > > > > https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html > > It's been a nop in ACPI only on -current. Ah, OK, that probably explains it then. I'll try it out later on amd64 laptop running fresh -CURRENT and report of any problems. Thanks, ./danfe From owner-svn-src-all@freebsd.org Wed Jan 10 17:32:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9BBE69E31 for ; Wed, 10 Jan 2018 17:32:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5D1806FD for ; Wed, 10 Jan 2018 17:32:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id b5so295165itc.3 for ; Wed, 10 Jan 2018 09:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CLiDO2f8N3ngeMlof5YxRzo6ISPp+AxaoikvtFnDn/0=; b=g+gFC1o81EPBek8Hi9NpWerztNn1NPWTcNHt8nTK+AxlBA3TN7PQa/5rJaSmak8NQm HpXLTDlt/A+/cOXPBOrV/kKEY7MDwMxAFdYDgGYxjl3M2/tBl+A9yyOv/KJR8yTal5lP dlxiLkd+tj6COhGBXClG/OBYyXXBARmuGRwsmqlj9kVOlVY8npVUlM04TsC5TPiFDPUG /DIxNN5RuHGQcMjTJXcJB5iqrQbDnXcH/V0PW7SGeFR6JM/0n8C0vY4za1+8DxJ4iag3 3k/tojAoZ34vPbuyMgIQyjuRFVKPwxnVOCNNAWrvY0ztJAxft3TOLl+1+lwUtfwJjHly 18Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CLiDO2f8N3ngeMlof5YxRzo6ISPp+AxaoikvtFnDn/0=; b=Yv8bc+zmzGEsCwst/6dYGYvt/2wjm5M8ri7tlbrv+9grOPEfEpbG0hFmPVIv9balpH YifPsrPzBXtW7ihWDV3R19NwefXoQp/xRnqMMsXwiFeu4JJeqEiPWujEXQE1hEbPT+F0 9VhAAnYL1ZPLr5VbjoSdWFvvEv+20XfF0jr/c/Klv9b+d737KIY6kGjGF7y+wuOIBBSO srmo9+WvEyjudGPysoBG082flylIgjaZZYx/QjZ/teG8RAqqBAnKhCUvBHB8TDnsvNNJ pyYxdmUaMOdkv4/mjXzQbAz+8PEwSC06XhRnBYa6Ia/RI1zotV0H1/hCttjHDrVPTEKX rKMg== X-Gm-Message-State: AKGB3mLWqlyaOmsULwm40GdBKDgL/QHW+hKKcMcg9qurlYHjCtdJc/7K PFAtSnPw8lY8UPQ99xgiRL8AdCAEdArAO2JJA5gn5Q== X-Google-Smtp-Source: ACJfBotvCNvsYQwRiUyKR23XzcaoyGKveMdmTy01iyt6f5F1mbttc5eobkbJNARSwmruyE1Hv6+CY4fG4ctzNSWNyVw= X-Received: by 10.36.74.200 with SMTP id k191mr20747595itb.69.1515605567412; Wed, 10 Jan 2018 09:32:47 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 09:32:46 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180110173013.GB85022@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> <20180110171444.GA85022@FreeBSD.org> <20180110173013.GB85022@FreeBSD.org> From: Warner Losh Date: Wed, 10 Jan 2018 10:32:46 -0700 X-Google-Sender-Auth: I6fliNITA_a1EITP9mYz3YC7b4w Message-ID: Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa To: Alexey Dokuchaev Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:32:48 -0000 On Wed, Jan 10, 2018 at 10:30 AM, Alexey Dokuchaev wrote: > On Wed, Jan 10, 2018 at 10:20:17AM -0700, Warner Losh wrote: > > On Wed, Jan 10, 2018 at 10:14 AM, Alexey Dokuchaev wrote: > > > ... > > > Not sure of now, but at least back in 2013 pmtimer was required on my > > > i386 ACPI-ish laptop (it is still required now, but I just don't run > > > -CURRENT): > > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html > > > > It's been a nop in ACPI only on -current. > > Ah, OK, that probably explains it then. I'll try it out later on amd64 > laptop running fresh -CURRENT and report of any problems. Thanks, > pmtimer was removed from amd64 some time ago... Please let me know if you hit any snags. Warner From owner-svn-src-all@freebsd.org Wed Jan 10 17:35:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ACB4E6A0C1; Wed, 10 Jan 2018 17:35:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77177808FB; Wed, 10 Jan 2018 17:35:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9BF1B35; Wed, 10 Jan 2018 17:35:00 +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 w0AHZ0FQ024904; Wed, 10 Jan 2018 17:35:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AHZ02v024903; Wed, 10 Jan 2018 17:35:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201801101735.w0AHZ02v024903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 10 Jan 2018 17:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327775 - head/sys/dev/amdsbwd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/amdsbwd X-SVN-Commit-Revision: 327775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:35:01 -0000 Author: avg Date: Wed Jan 10 17:35:00 2018 New Revision: 327775 URL: https://svnweb.freebsd.org/changeset/base/327775 Log: amdsbwd: fix handling of timeout values beyond the supported range The driver now fully observes watchdog(9) protocol. Previously a too large timeout was silently clamped while the correct behavior is to disable the watchdog and leave the error as is (i.e. to not report success). Also, previously a too small value caused the timer to stop while the correct behavior is to use the minimal supported value. MFC after: 2 weeks Modified: head/sys/dev/amdsbwd/amdsbwd.c Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 10 17:25:08 2018 (r327774) +++ head/sys/dev/amdsbwd/amdsbwd.c Wed Jan 10 17:35:00 2018 (r327775) @@ -210,21 +210,30 @@ static void amdsbwd_event(void *arg, unsigned int cmd, int *error) { struct amdsbwd_softc *sc = arg; - unsigned int timeout; + uint64_t timeout; - /* convert from power-of-two-ns to WDT ticks */ - cmd &= WD_INTERVAL; - if (cmd < WD_TO_1SEC) - cmd = 0; - if (cmd) { - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (cmd != 0) { + timeout = 0; + cmd &= WD_INTERVAL; + if (cmd >= WD_TO_1MS) { + timeout = (uint64_t)1 << (cmd - WD_TO_1MS); + timeout = timeout / sc->ms_per_tick; + } + /* For a too short timeout use 1 tick. */ + if (timeout == 0) + timeout = 1; + /* For a too long timeout stop the timer. */ if (timeout > sc->max_ticks) - timeout = sc->max_ticks; - if (timeout != sc->timeout) { + timeout = 0; + } else { + timeout = 0; + } + + if (timeout != 0) { + if (timeout != sc->timeout) amdsbwd_tmr_set(sc, timeout); - if (!sc->active) - amdsbwd_tmr_enable(sc); - } + if (!sc->active) + amdsbwd_tmr_enable(sc); amdsbwd_tmr_reload(sc); *error = 0; } else { From owner-svn-src-all@freebsd.org Wed Jan 10 17:36:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37587E6A265; Wed, 10 Jan 2018 17:36:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12D4580ABF; Wed, 10 Jan 2018 17:36:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AF2CB36; Wed, 10 Jan 2018 17:36:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AHaiJt025021; Wed, 10 Jan 2018 17:36:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AHai3n025020; Wed, 10 Jan 2018 17:36:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801101736.w0AHai3n025020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Jan 2018 17:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327776 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 327776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:36:45 -0000 Author: jhb Date: Wed Jan 10 17:36:43 2018 New Revision: 327776 URL: https://svnweb.freebsd.org/changeset/base/327776 Log: Include ffsll() on riscv kernels. Modified: head/sys/conf/files.riscv Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Jan 10 17:35:00 2018 (r327775) +++ head/sys/conf/files.riscv Wed Jan 10 17:36:43 2018 (r327776) @@ -14,6 +14,7 @@ kern/subr_dummy_vdso_tc.c standard libkern/bcmp.c standard libkern/ffs.c standard libkern/ffsl.c standard +libkern/ffsll.c standard libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard From owner-svn-src-all@freebsd.org Wed Jan 10 17:39:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C578E6A566; Wed, 10 Jan 2018 17:39:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBAE880DD0; Wed, 10 Jan 2018 17:38:59 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 32E7FC676; Wed, 10 Jan 2018 17:38:59 +0000 (UTC) Date: Wed, 10 Jan 2018 17:38:59 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , "Rodney W. Grimes" Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa Message-ID: <20180110173859.GC85022@FreeBSD.org> References: <201801101459.w0AExJWM055025@repo.freebsd.org> <201801101631.w0AGVAEV032087@pdx.rh.CN85.dnsmgr.net> <20180110165821.GA69465@FreeBSD.org> <20180110171444.GA85022@FreeBSD.org> <20180110173013.GB85022@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:39:00 -0000 On Wed, Jan 10, 2018 at 10:32:46AM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 10:30 AM, Alexey Dokuchaev wrote: > > On Wed, Jan 10, 2018 at 10:20:17AM -0700, Warner Losh wrote: > > > On Wed, Jan 10, 2018 at 10:14 AM, Alexey Dokuchaev wrote: > > > > ... > > > > Not sure of now, but at least back in 2013 pmtimer was required on my > > > > i386 ACPI-ish laptop (it is still required now, but I just don't run > > > > -CURRENT): > > > > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html > > > > > > It's been a nop in ACPI only on -current. > > > > Ah, OK, that probably explains it then. I'll try it out later on amd64 > > laptop running fresh -CURRENT and report of any problems. Thanks, > > pmtimer was removed from amd64 some time ago... Please let me know if you > hit any snags. Right. I'll also try fresh -CURRENT on that i386 laptop of mine, just to make sure we've covered all it. ./danfe From owner-svn-src-all@freebsd.org Wed Jan 10 17:51:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A69E6B063; Wed, 10 Jan 2018 17:51:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE1581A80; Wed, 10 Jan 2018 17:51:03 +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 E809CD20; Wed, 10 Jan 2018 17:51:02 +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 w0AHp246029823; Wed, 10 Jan 2018 17:51:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AHp2gw029822; Wed, 10 Jan 2018 17:51:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201801101751.w0AHp2gw029822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 10 Jan 2018 17:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327777 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 327777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:51:03 -0000 Author: trasz Date: Wed Jan 10 17:51:02 2018 New Revision: 327777 URL: https://svnweb.freebsd.org/changeset/base/327777 Log: Make nullfs properly report MNT_AUTOMOUNTED set on the nullfs mount itself, instead of copying from the underlying filesystem. PR: 224851 Reported by: Jamie Landeg-Jones Tested by: Jamie Landeg-Jones MFC after: 2 weeks Modified: head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Wed Jan 10 17:36:43 2018 (r327776) +++ head/sys/fs/nullfs/null_vfsops.c Wed Jan 10 17:51:02 2018 (r327777) @@ -320,7 +320,8 @@ nullfs_statfs(mp, sbp) /* now copy across the "interesting" information and fake the rest */ sbp->f_type = mstat->f_type; sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID | - MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat->f_flags & ~MNT_ROOTFS); + MNT_UNION | MNT_NOSYMFOLLOW | MNT_AUTOMOUNTED)) | + (mstat->f_flags & ~(MNT_ROOTFS | MNT_AUTOMOUNTED)); sbp->f_bsize = mstat->f_bsize; sbp->f_iosize = mstat->f_iosize; sbp->f_blocks = mstat->f_blocks; From owner-svn-src-all@freebsd.org Wed Jan 10 17:55:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0163E6B4B1; Wed, 10 Jan 2018 17:55:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E3B81D9F; Wed, 10 Jan 2018 17:55:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E703910A7DB; Wed, 10 Jan 2018 12:55:45 -0500 (EST) From: John Baldwin To: Warner Losh Cc: Alexey Dokuchaev , "Rodney W. Grimes" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa Date: Wed, 10 Jan 2018 09:38:46 -0800 Message-ID: <5012765.tdQagMdlRk@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801101459.w0AExJWM055025@repo.freebsd.org> <20180110171444.GA85022@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 10 Jan 2018 12:55:46 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:55:54 -0000 On Wednesday, January 10, 2018 10:20:17 AM Warner Losh wrote: > On Wed, Jan 10, 2018 at 10:14 AM, Alexey Dokuchaev > wrote: > > > On Wed, Jan 10, 2018 at 10:01:41AM -0700, Warner Losh wrote: > > > On Wed, Jan 10, 2018 at 9:58 AM, Alexey Dokuchaev > > wrote: > > > > On Wed, Jan 10, 2018 at 09:48:05AM -0700, Warner Losh wrote: > > > > > On Wed, Jan 10, 2018 at 9:31 AM, Rodney W. Grimes wrote: > > > > > > > New Revision: 327767 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/327767 > > > > > > > > > > > > > > Log: > > > > > > > Retire pmtimer driver. Move time fixing into apm driver. Move > > > > > > > Iwasaki-san's copyright over. Remove FIXME code that couldn't > > > > possibly > > > > > > > work. Call tc_settime() with our estimate of the delta we've > > been > > > > > > > alseep (the one we print) to adjust the time. Not sure what to > > do > > > > > > > about callouts, so keep the small #ifdef in place there. > > > > > > > > > > > > > > Differential Revision: https://reviews.freebsd.org/D13823 > > > > > > > > > > > > RELNOTES: ? > > > > > > Reason I ask is this effects custom kernel config file(s) > > > > > > > > > > Don't know. We don't normally document every kernel config file > > changes > > > > > that's required. > > > > > > > > Well, `pmtimer' is a bit special. It is required in the kernel config > > in > > > > order to preserve time counting during suspend (not sure about amd64, > > but > > > > at least on i386, "device pmtimer" is required to be in kernel config > > for > > > > timekeeping while sleeping). > > > > > > It's only required for APM. ACPI it's a nop. > > > > > > And it didn't (until I believe that I fixed it) even adjust the time for > > > APM. On APM it just prints how long the sleep was. > > > > Not sure of now, but at least back in 2013 pmtimer was required on my i386 > > ACPI-ish laptop (it is still required now, but I just don't run -CURRENT): > > > > https://lists.freebsd.org/pipermail/svn-src-all/2013-May/069020.html > > > It's been a nop in ACPI only on -current. Prior to making it a nop on > current ACPI set the time, it was a nop for amd64. Then it probably does warrant a relnotes entry if the effect going from 11 to 12 is that pmtimer has become non-optional / standard, so the kernel config option is obsolete. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 10 17:55:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1A6EE6B4BB; Wed, 10 Jan 2018 17:55:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE0681DA0; Wed, 10 Jan 2018 17:55:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DD42F10AF2A; Wed, 10 Jan 2018 12:55:48 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327705 - head/stand/mips/beri/common Date: Wed, 10 Jan 2018 09:20:05 -0800 Message-ID: <46003356.LuRHu4Xbkq@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801081847.w08IlZ7F033684@repo.freebsd.org> <1620808.I0a57TDRna@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 10 Jan 2018 12:55:49 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:55:55 -0000 On Tuesday, January 09, 2018 10:48:30 AM Warner Losh wrote: > On Tue, Jan 9, 2018 at 10:05 AM, John Baldwin wrote: > > > On Monday, January 08, 2018 12:02:09 PM Warner Losh wrote: > > > This should have been a nop... libsa specifically creates 'safe' headers > > > for all the standard ones. > > > > > > Ah, libsa creates a perfectly fine stdint.h, but not a inttypes.h... > > > > Would you prefer it to use stdint.h and stdio.h rather than stand.h? > > > No. stand.h is fine. I just wondered why you hit issues at all with > stdio.h. inttypes.h isn't supported because we don't implement the extra > functions defined there over stdint.h, so it should have given an error > when included. I'm just surprised I didn't catch it in my universe.sh > script that I use to build all loaders though... FWIW, compiling with external GCC did not trip over this (so in-tree GCC probably didn't either). Only compiling with clang (for which I still have some out-of-tree patches) tripped over this. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 10 17:55:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD15AE6B4B0; Wed, 10 Jan 2018 17:55:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E0081D9E; Wed, 10 Jan 2018 17:55:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7539710AC13; Wed, 10 Jan 2018 12:55:47 -0500 (EST) From: John Baldwin To: Ravi Pokala Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd Date: Wed, 10 Jan 2018 09:37 -0800 Message-ID: <9917534.mS5UWR88gL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201801100630.w0A6UxLT041383@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 10 Jan 2018 12:55:47 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 17:55:54 -0000 On Wednesday, January 10, 2018 08:51:27 AM Ravi Pokala wrote: > Hi Conrad, > > Alas, this still doesn't look right on RISC-V: > > zstd_kfreebsd.o: In function `__ctzdi2': > /usr/home/rpokala/freebsd/clean/base/head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c:58: undefined reference to `ffsll' > > I got substantively the same error both before and after `pkg upgrade' brought in updated RISC-V stuff: > > riscv64-binutils (2.29.51.20170726 -> 2.29_20180105,1) > riscv64-gcc (7.1.1 -> 7.2.0) > > Thanks, Try r327776. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 10 18:15:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2E2E6C978; Wed, 10 Jan 2018 18:15:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDAC83054; Wed, 10 Jan 2018 18:15:01 +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 706821208; Wed, 10 Jan 2018 18:15:00 +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 w0AIF0mr042198; Wed, 10 Jan 2018 18:15:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AIF0SX042197; Wed, 10 Jan 2018 18:15:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801101815.w0AIF0SX042197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Jan 2018 18:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327778 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 327778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 18:15:01 -0000 Author: emaste Date: Wed Jan 10 18:15:00 2018 New Revision: 327778 URL: https://svnweb.freebsd.org/changeset/base/327778 Log: src.conf.5: regen after r325692 and r326888 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jan 10 17:51:02 2018 (r327777) +++ head/share/man/man5/src.conf.5 Wed Jan 10 18:15:00 2018 (r327778) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd November 2, 2017 +.Dd January 10, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -996,6 +996,11 @@ Set to use LLVM's libunwind stack unwinder (instead of .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_LOADER_FIREWIRE +Enable firewire support in /boot/loader and /boot/zfsloader on x86. +This option is a nop on all other platforms. +.It Va WITHOUT_LOADER_GELI +Disable inclusion of GELI crypto support in the boot chain binaries. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . From owner-svn-src-all@freebsd.org Wed Jan 10 18:39:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67749E6E22A; Wed, 10 Jan 2018 18:39:30 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA8F38D; Wed, 10 Jan 2018 18:39:30 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2C00G00QVKBL00@mr11p00im-asmtp003.me.com>; Wed, 10 Jan 2018 18:39:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1515609541; bh=3tLPCJRupHM6ks8p1T2ZVR5d++6JU5a/P9MxrP7Y+gI=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=xaUmMNwch76I3xTWPzyrepfxjm0ENzSgO8UBoatsc/IscwhvyCqb+eFSUi37MmbO3 958hcefSXKz6GsxIAv75YfryiG2OrHmI5i8GLHPNuR0xluyfbbJ/n/FPfW8IiXhNO1 QxmEaSegr+tXOOTJRWZpixGAITvzhIysBmHqHoYhFeaDKIN1x4Bi/0BKuyQaDldVje v5oCYmnxDRnt6/2FjTNT1jQwNJVrNC9rux/4SLDPVBstdhzJxJhTyMpIivLm87K1ce 11VPFBjjnv2Rz32gAAJbn9IlwVlA4qCUfgeeZxTBO7BinF2BhrfNTGgHz9e5nc9QoL PakW5NlONa6IQ== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2C009E7RSYRY30@mr11p00im-asmtp003.me.com>; Wed, 10 Jan 2018 18:39:00 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-10_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801100260 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Wed, 10 Jan 2018 10:38:58 -0800 Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd From: Ravi Pokala To: Conrad Meyer , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <042A7C15-5EEA-497C-AF81-4F9960FE988A@mac.com> Thread-topic: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd References: <201801100630.w0A6UxLT041383@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 18:39:30 -0000 Ah, it looks like r327776 fixed this. Thanks John! -Ravi (rpokala@) -----Original Message----- From: on behalf of Ravi Pokala Date: 2018-01-10, Wednesday at 08:51 To: Conrad Meyer , , , Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd Hi Conrad, Alas, this still doesn't look right on RISC-V: zstd_kfreebsd.o: In function `__ctzdi2': /usr/home/rpokala/freebsd/clean/base/head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c:58: undefined reference to `ffsll' I got substantively the same error both before and after `pkg upgrade' brought in updated RISC-V stuff: riscv64-binutils (2.29.51.20170726 -> 2.29_20180105,1) riscv64-gcc (7.1.1 -> 7.2.0) Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Conrad Meyer Date: 2018-01-09, Tuesday at 22:30 To: , , Subject: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd Author: cem Date: Wed Jan 10 06:30:59 2018 New Revision: 327763 URL: https://svnweb.freebsd.org/changeset/base/327763 Log: Finally, fix Zstd kernel build on MIPS and RISC-V Add an implementation of the intrinsics invoked by __builtin_ctz{,ll} and __builtin_clz{,ll}, and include this compilation unit on platforms that lack assembly intrinsics for those builtins (MIPS and RISC-V). Future cleanup work might involve bringing these into a mini libcompiler-rt for the standalone kernel environment. Or cleaning up the approach upstream takes for builtins in standalone environments (or just FreeBSD). For now, at least this builds, and doesn't require modifying the vendor code. Reported by: jeff, markj, mizhka Reviewed by: jhb (earlier version), rpokala (comment text earlier version) Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/conf/files.riscv Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.mips Wed Jan 10 06:30:59 2018 (r327763) @@ -112,3 +112,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/mips/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/mips/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/mips/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Jan 10 05:52:24 2018 (r327762) +++ head/sys/conf/files.riscv Wed Jan 10 06:30:59 2018 (r327763) @@ -56,3 +56,6 @@ riscv/riscv/uio_machdep.c standard riscv/riscv/uma_machdep.c standard riscv/riscv/unwind.c optional ddb | kdtrace_hooks | stack riscv/riscv/vm_machdep.c standard + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C} Added: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Wed Jan 10 06:30:59 2018 (r327763) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2018 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. + * + * $FreeBSD$ + */ + +#include "zstd_kfreebsd.h" + +/* + * The kernel as a standalone target does not link against libgcc or + * libcompiler-rt. On platforms (e.g., MIPS and RISCV) that do not have a + * direct assembly implementation of the relevant builtin functions that zstd + * references, the compiler converts them into calls to the runtime library + * intrinsics. Since the kernel does not link against the runtime libraries, + * this results in a failure to link the kernel. + * + * The goal of the following definitions is to use supported kernel constructs + * to implement the same functionality, without adding diff to the Zstd contrib + * code. + * + * A subsequent enhancement might create a mini compiler-rt library for kernel + * use and move these over there instead. + */ + +/* Count trailing zeros */ +int +__ctzsi2(int x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffs(x) - 1); +} + +long long +__ctzdi2(long long x) +{ + if (x == 0) + return (sizeof(x) * NBBY); + return (ffsll(x) - 1); +} + +/* Count leading zeros */ +int +__clzsi2(int x) +{ + return (sizeof(x) * NBBY - fls(x)); +} + +long long +__clzdi2(long long x) +{ + return (sizeof(x) * NBBY - flsll(x)); +} From owner-svn-src-all@freebsd.org Wed Jan 10 18:41:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16D4DE6E474; Wed, 10 Jan 2018 18:41:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from pv33p00im-asmtp001.mac.com (pv33p00im-asmtp001.me.com [17.142.194.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBE90AE1; Wed, 10 Jan 2018 18:41:28 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp001.me.com by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2C00800QL9SF00@pv33p00im-asmtp001.me.com>; Wed, 10 Jan 2018 18:41:15 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1515609675; bh=4YGJ57iffFWaMuC64ooTwH6U+m8hEPM1TozmrrZKF7o=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=cmO/fZr+LEHPKhf+h2razFA6HapvnSBv4Cse1F66qRX7sUKGfFjaRfbCJg5QBy9C8 LwxwtjHnQSx+VH5XUPYCYHd9bBKPGuXSb+Wjr0PVIiLg/buCjlDOUNeuQt2bvcR0g8 jvZrXdLIBzB/Y6rD9yqZANUCSHKV4F3G5C0YGgi8VvZBRZpa59FD5CpyQ9hesgMiX4 2+JndwzKg6NO0b/N0rD/9qjqcb6T6p7/YBK6F5J/zfiE1XrGXloqq8G9+UU1DFqBmX Y562uDwAmpF3YWR9eeZB1an9t3LUFXvg2bY19Zl5RHqAVI1Ag/35JtuYXcjNrplgMO 6FtUolLEXayMg== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2C00EORRWN9U10@pv33p00im-asmtp001.me.com>; Wed, 10 Jan 2018 18:41:12 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-10_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801100260 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Wed, 10 Jan 2018 10:41:10 -0800 Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd From: Ravi Pokala To: John Baldwin Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <02206EC7-EEA0-4461-ACD2-BA9B06B201D7@mac.com> Thread-topic: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd References: <201801100630.w0A6UxLT041383@repo.freebsd.org> <9917534.mS5UWR88gL@ralph.baldwin.cx> In-reply-to: <9917534.mS5UWR88gL@ralph.baldwin.cx> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 18:41:29 -0000 Yup, that did the trick. Thank you sir! -Ravi (rpokala@) -----Original Message----- From: on behalf of John Baldwin Date: 2018-01-10, Wednesday at 09:37 To: Ravi Pokala Cc: Conrad Meyer , , , Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd On Wednesday, January 10, 2018 08:51:27 AM Ravi Pokala wrote: > Hi Conrad, > > Alas, this still doesn't look right on RISC-V: > > zstd_kfreebsd.o: In function `__ctzdi2': > /usr/home/rpokala/freebsd/clean/base/head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c:58: undefined reference to `ffsll' > > I got substantively the same error both before and after `pkg upgrade' brought in updated RISC-V stuff: > > riscv64-binutils (2.29.51.20170726 -> 2.29_20180105,1) > riscv64-gcc (7.1.1 -> 7.2.0) > > Thanks, Try r327776. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 10 19:35:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3890E71CC9; Wed, 10 Jan 2018 19:35:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B244B6348F; Wed, 10 Jan 2018 19:35:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id b5so725782itc.3; Wed, 10 Jan 2018 11:35:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Pmr18K8QdlmxvmhYRJ97NTvhEjW0wyMR06plzCbCJgY=; b=W8MAzgtmLzhclysapWrvCHVAgT4NW5PjniIbw/EuOd2mfbOW/nPzIIbMRikcRjVYXB CXod+xINhBVDE1+pqaq3v74S34cSSRBqp4GsnD8WTOeyQ60HfxU78ZWDXI2URHu5d+Rm KsqmD5lI81Z2hVdICP8oYUrIvkBvV1faUh6DweYgH7/pofuD5QsKhbuSf6fdn5a10Xdj 4fxcmA9qj64428IoadTyJPECjpwe/AQZ2bta0JCfNsHap3+D215YCmQAAnoMxtH/wko+ tgIxrn5MVBc1A3pSrcmjBlYfyszJeRjVcMjd/NcN9swl0x/FjGMpJmBpDn029/xOGeNB OzYg== X-Gm-Message-State: AKGB3mL2v+KR8a0icc8nq8rtQXZZkNN1fJE4As+ghwcH4NiH7jfCEfhb FEbzDsXv+IN7unTkFtrO6GYI7hyv X-Google-Smtp-Source: ACJfBotRBX2h5Dx9BRY3UqJ1BHa3H9WZwrRhJc3VxbLUYACWqNe66LMym3cJZ3ezZPGLkmcDi+41qg== X-Received: by 10.36.25.140 with SMTP id b134mr17942837itb.21.1515612940257; Wed, 10 Jan 2018 11:35:40 -0800 (PST) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com. [209.85.223.179]) by smtp.gmail.com with ESMTPSA id p124sm3998668ite.11.2018.01.10.11.35.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 11:35:40 -0800 (PST) Received: by mail-io0-f179.google.com with SMTP id 14so665083iou.2; Wed, 10 Jan 2018 11:35:39 -0800 (PST) X-Received: by 10.107.25.207 with SMTP id 198mr18062634ioz.226.1515612939786; Wed, 10 Jan 2018 11:35:39 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Wed, 10 Jan 2018 11:35:39 -0800 (PST) In-Reply-To: <9917534.mS5UWR88gL@ralph.baldwin.cx> References: <201801100630.w0A6UxLT041383@repo.freebsd.org> <9917534.mS5UWR88gL@ralph.baldwin.cx> From: Conrad Meyer Date: Wed, 10 Jan 2018 11:35:39 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327763 - in head/sys: conf contrib/zstd/lib/freebsd To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 19:35:42 -0000 Thank you. On Wed, Jan 10, 2018 at 9:37 AM, John Baldwin wrote: > On Wednesday, January 10, 2018 08:51:27 AM Ravi Pokala wrote: >> Hi Conrad, >> >> Alas, this still doesn't look right on RISC-V: >> >> zstd_kfreebsd.o: In function `__ctzdi2': >> /usr/home/rpokala/freebsd/clean/base/head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c:58: undefined reference to `ffsll' >> >> I got substantively the same error both before and after `pkg upgrade' brought in updated RISC-V stuff: >> >> riscv64-binutils (2.29.51.20170726 -> 2.29_20180105,1) >> riscv64-gcc (7.1.1 -> 7.2.0) >> >> Thanks, > > Try r327776. > > -- > John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 10 19:37:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADC1CE71E87; Wed, 10 Jan 2018 19:37:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 848DA6366D; Wed, 10 Jan 2018 19:37:22 +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 95D991F98; Wed, 10 Jan 2018 19:37: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 w0AJbLp0077586; Wed, 10 Jan 2018 19:37:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AJbLJa077585; Wed, 10 Jan 2018 19:37:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801101937.w0AJbLJa077585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 19:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327779 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 327779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 19:37:22 -0000 Author: markj Date: Wed Jan 10 19:37:21 2018 New Revision: 327779 URL: https://svnweb.freebsd.org/changeset/base/327779 Log: Fix handling of read errors during mirror synchronization. We would previously just free the request BIO, which would either cause the disk to stay stuck in the SYNCHRONIZING state, or result in synchronization completing without having copied the block which returned an error. With this change, if the disk which returned an error is the only active disk in the mirror, the synchronizing disk is kicked out. Otherwise, the read is retried. Reported and tested by: pho (previous version) MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jan 10 18:15:00 2018 (r327778) +++ head/sys/geom/mirror/g_mirror.c Wed Jan 10 19:37:21 2018 (r327779) @@ -110,6 +110,8 @@ static int g_mirror_update_disk(struct g_mirror_disk * static void g_mirror_update_device(struct g_mirror_softc *sc, bool force); static void g_mirror_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_mirror_sync_reinit(const struct g_mirror_disk *disk, + struct bio *bp, off_t offset); static void g_mirror_sync_stop(struct g_mirror_disk *disk, int type); static void g_mirror_register_request(struct g_mirror_softc *sc, struct bio *bp); @@ -1298,10 +1300,11 @@ g_mirror_sync_request_free(struct g_mirror_disk *disk, /* * Handle synchronization requests. - * Every synchronization request is two-steps process: first, READ request is - * send to active provider and then WRITE request (with read data) to the provider - * being synchronized. When WRITE is finished, new synchronization request is - * send. + * Every synchronization request is a two-step process: first, a read request is + * sent to the mirror provider via the sync consumer. If that request completes + * successfully, it is converted to a write and sent to the disk being + * synchronized. If the write also completes successfully, the synchronization + * offset is advanced and a new read request is submitted. */ static void g_mirror_sync_request(struct g_mirror_softc *sc, struct bio *bp) @@ -1326,13 +1329,16 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc return; } + sync = &disk->d_sync; + /* * Synchronization request. */ switch (bp->bio_cmd) { - case BIO_READ: - { + case BIO_READ: { + struct g_mirror_disk *d; struct g_consumer *cp; + int readable; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_read, bp->bio_error); @@ -1341,7 +1347,33 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc G_MIRROR_LOGREQ(0, bp, "Synchronization request failed (error=%d).", bp->bio_error); - g_mirror_sync_request_free(disk, bp); + + /* + * If there's at least one other disk from which we can + * read the block, retry the request. + */ + readable = 0; + LIST_FOREACH(d, &sc->sc_disks, d_next) + if (d->d_state == G_MIRROR_DISK_STATE_ACTIVE && + !(d->d_flags & G_MIRROR_DISK_FLAG_BROKEN)) + readable++; + + /* + * The read error will trigger a syncid bump, so there's + * no need to do that here. + * + * If we can retry the read from another disk, do so. + * Otherwise, all we can do is kick out the new disk. + */ + if (readable == 0) { + g_mirror_sync_request_free(disk, bp); + g_mirror_event_send(disk, + G_MIRROR_DISK_STATE_DISCONNECTED, + G_MIRROR_EVENT_DONTWAIT); + } else { + g_mirror_sync_reinit(disk, bp, bp->bio_offset); + goto retry_read; + } return; } G_MIRROR_LOGREQ(3, bp, @@ -1355,12 +1387,10 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc cp->index++; g_io_request(bp, cp); return; - } - case BIO_WRITE: - { + } + case BIO_WRITE: { off_t offset; - void *data; - int i, idx; + int i; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_write, bp->bio_error); @@ -1377,7 +1407,6 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc return; } G_MIRROR_LOGREQ(3, bp, "Synchronization request finished."); - sync = &disk->d_sync; if (sync->ds_offset >= sc->sc_mediasize || sync->ds_consumer == NULL || (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { @@ -1397,20 +1426,13 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc } /* Send next synchronization request. */ - data = bp->bio_data; - idx = (int)(uintptr_t)bp->bio_caller1; - g_reset_bio(bp); - bp->bio_cmd = BIO_READ; - bp->bio_offset = sync->ds_offset; - bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); + g_mirror_sync_reinit(disk, bp, sync->ds_offset); sync->ds_offset += bp->bio_length; - bp->bio_done = g_mirror_sync_done; - bp->bio_data = data; - bp->bio_from = sync->ds_consumer; - bp->bio_to = sc->sc_provider; - bp->bio_caller1 = (void *)(uintptr_t)idx; + +retry_read: G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); sync->ds_consumer->index++; + /* * Delay the request if it is colliding with a regular request. */ @@ -1436,11 +1458,9 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc sync->ds_update_ts = time_uptime; } return; - } + } default: - KASSERT(1 == 0, ("Invalid command here: %u (device=%s)", - bp->bio_cmd, sc->sc_name)); - break; + panic("Invalid I/O request %p", bp); } } @@ -2031,15 +2051,39 @@ g_mirror_update_idle(struct g_mirror_softc *sc, struct } static void +g_mirror_sync_reinit(const struct g_mirror_disk *disk, struct bio *bp, + off_t offset) +{ + void *data; + int idx; + + data = bp->bio_data; + idx = (int)(uintptr_t)bp->bio_caller1; + g_reset_bio(bp); + + bp->bio_cmd = BIO_READ; + bp->bio_data = data; + bp->bio_done = g_mirror_sync_done; + bp->bio_from = disk->d_sync.ds_consumer; + bp->bio_to = disk->d_softc->sc_provider; + bp->bio_caller1 = (void *)(uintptr_t)idx; + bp->bio_offset = offset; + bp->bio_length = MIN(MAXPHYS, + disk->d_softc->sc_mediasize - bp->bio_offset); +} + +static void g_mirror_sync_start(struct g_mirror_disk *disk) { struct g_mirror_softc *sc; + struct g_mirror_disk_sync *sync; struct g_consumer *cp; struct bio *bp; int error, i; g_topology_assert_not(); sc = disk->d_softc; + sync = &disk->d_sync; sx_assert(&sc->sc_lock, SX_LOCKED); KASSERT(disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING, @@ -2065,54 +2109,48 @@ g_mirror_sync_start(struct g_mirror_disk *disk) g_mirror_get_diskname(disk)); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_NOFAILSYNC) == 0) disk->d_flags |= G_MIRROR_DISK_FLAG_DIRTY; - KASSERT(disk->d_sync.ds_consumer == NULL, + KASSERT(sync->ds_consumer == NULL, ("Sync consumer already exists (device=%s, disk=%s).", sc->sc_name, g_mirror_get_diskname(disk))); - disk->d_sync.ds_consumer = cp; - disk->d_sync.ds_consumer->private = disk; - disk->d_sync.ds_consumer->index = 0; + sync->ds_consumer = cp; + sync->ds_consumer->private = disk; + sync->ds_consumer->index = 0; /* * Allocate memory for synchronization bios and initialize them. */ - disk->d_sync.ds_bios = malloc(sizeof(struct bio *) * g_mirror_syncreqs, + sync->ds_bios = malloc(sizeof(struct bio *) * g_mirror_syncreqs, M_MIRROR, M_WAITOK); for (i = 0; i < g_mirror_syncreqs; i++) { bp = g_alloc_bio(); - disk->d_sync.ds_bios[i] = bp; - bp->bio_parent = NULL; - bp->bio_cmd = BIO_READ; + sync->ds_bios[i] = bp; + bp->bio_data = malloc(MAXPHYS, M_MIRROR, M_WAITOK); - bp->bio_cflags = 0; - bp->bio_offset = disk->d_sync.ds_offset; - bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); - disk->d_sync.ds_offset += bp->bio_length; - bp->bio_done = g_mirror_sync_done; - bp->bio_from = disk->d_sync.ds_consumer; - bp->bio_to = sc->sc_provider; bp->bio_caller1 = (void *)(uintptr_t)i; + g_mirror_sync_reinit(disk, bp, sync->ds_offset); + sync->ds_offset += bp->bio_length; } /* Increase the number of disks in SYNCHRONIZING state. */ sc->sc_sync.ds_ndisks++; /* Set the number of in-flight synchronization requests. */ - disk->d_sync.ds_inflight = g_mirror_syncreqs; + sync->ds_inflight = g_mirror_syncreqs; /* * Fire off first synchronization requests. */ for (i = 0; i < g_mirror_syncreqs; i++) { - bp = disk->d_sync.ds_bios[i]; + bp = sync->ds_bios[i]; G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); - disk->d_sync.ds_consumer->index++; + sync->ds_consumer->index++; /* * Delay the request if it is colliding with a regular request. */ if (g_mirror_regular_collision(sc, bp)) g_mirror_sync_delay(sc, bp); else - g_io_request(bp, disk->d_sync.ds_consumer); + g_io_request(bp, sync->ds_consumer); } } From owner-svn-src-all@freebsd.org Wed Jan 10 19:41:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F441E720ED; Wed, 10 Jan 2018 19:41:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57F5963917; Wed, 10 Jan 2018 19:41:06 +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 9594C1FC4; Wed, 10 Jan 2018 19:41:05 +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 w0AJf5wS079935; Wed, 10 Jan 2018 19:41:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AJf5SR079933; Wed, 10 Jan 2018 19:41:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801101941.w0AJf5SR079933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 19:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327780 - head/tests/sys/geom/class/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/geom/class/mirror X-SVN-Commit-Revision: 327780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 19:41:06 -0000 Author: markj Date: Wed Jan 10 19:41:05 2018 New Revision: 327780 URL: https://svnweb.freebsd.org/changeset/base/327780 Log: Add regression tests for r327779. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Added: head/tests/sys/geom/class/mirror/sync_error.sh (contents, props changed) Modified: head/tests/sys/geom/class/mirror/Makefile Modified: head/tests/sys/geom/class/mirror/Makefile ============================================================================== --- head/tests/sys/geom/class/mirror/Makefile Wed Jan 10 19:37:21 2018 (r327779) +++ head/tests/sys/geom/class/mirror/Makefile Wed Jan 10 19:41:05 2018 (r327780) @@ -18,6 +18,8 @@ TAP_TESTS_SH+= 11_test TAP_TESTS_SH+= 12_test TAP_TESTS_SH+= 13_test +ATF_TESTS_SH+= sync_error + ${PACKAGE}FILES+= conf.sh .for t in ${TAP_TESTS_SH} Added: head/tests/sys/geom/class/mirror/sync_error.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/mirror/sync_error.sh Wed Jan 10 19:41:05 2018 (r327780) @@ -0,0 +1,110 @@ +# $FreeBSD$ + +REG_READ_FP=debug.fail_point.g_mirror_regular_request_read + +atf_test_case sync_read_error_2_disks cleanup +sync_read_error_2_disks_head() +{ + atf_set "descr" \ + "Ensure that we properly handle read errors during synchronization." + atf_set "require.user" "root" +} +sync_read_error_2_disks_body() +{ + . $(atf_get_srcdir)/conf.sh + + f1=$(mktemp ${base}.XXXXXX) + f2=$(mktemp ${base}.XXXXXX) + + atf_check dd if=/dev/zero bs=1M count=32 of=$f1 status=none + atf_check truncate -s 32M $f2 + + md1=$(attach_md -t vnode -f ${f1}) + md2=$(attach_md -t vnode -f ${f2}) + + atf_check gmirror label $name $md1 + devwait + + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + + # If a read error occurs while synchronizing and the mirror contains + # a single active disk, gmirror has no choice but to fail the + # synchronization and kick the new disk out of the mirror. + atf_check gmirror insert $name $md2 + sleep 0.1 + syncwait + atf_check [ $(gmirror status -s $name | wc -l) -eq 1 ] + atf_check -s exit:0 -o match:"DEGRADED $md1 \(ACTIVE\)" \ + gmirror status -s $name +} +sync_read_error_2_disks_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='off' + gmirror_test_cleanup +} + +atf_test_case sync_read_error_3_disks cleanup +sync_read_error_3_disks_head() +{ + atf_set "descr" \ + "Ensure that we properly handle read errors during synchronization." + atf_set "require.user" "root" +} +sync_read_error_3_disks_body() +{ + . $(atf_get_srcdir)/conf.sh + + f1=$(mktemp ${base}.XXXXXX) + f2=$(mktemp ${base}.XXXXXX) + f3=$(mktemp ${base}.XXXXXX) + + atf_check dd if=/dev/random bs=1M count=32 of=$f1 status=none + atf_check truncate -s 32M $f2 + atf_check truncate -s 32M $f3 + + md1=$(attach_md -t vnode -f ${f1}) + md2=$(attach_md -t vnode -f ${f2}) + md3=$(attach_md -t vnode -f ${f3}) + + atf_check gmirror label $name $md1 + devwait + + atf_check gmirror insert $name $md2 + syncwait + + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='1*return(5)' + + # If a read error occurs while synchronizing a new disk, and we have + # multiple active disks, we retry the read after an error. The disk + # which returned the read error is kicked out of the mirror. + atf_check gmirror insert $name $md3 + syncwait + atf_check [ $(gmirror status -s $name | wc -l) -eq 2 ] + atf_check -s exit:0 -o match:"DEGRADED $md3 \(ACTIVE\)" \ + gmirror status -s $name + + # Make sure that the two active disks are identical. Destroy the + # mirror first so that the metadata sectors are wiped. + if $(gmirror status -s $name | grep -q $md1); then + active=$md1 + else + active=$md2 + fi + atf_check gmirror destroy $name + atf_check cmp /dev/$active /dev/$md3 +} +sync_read_error_3_disks_cleanup() +{ + . $(atf_get_srcdir)/conf.sh + + atf_check -s exit:0 -e empty -o not-empty sysctl ${REG_READ_FP}='off' + gmirror_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case sync_read_error_2_disks + atf_add_test_case sync_read_error_3_disks +} From owner-svn-src-all@freebsd.org Wed Jan 10 19:45:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59802E72729; Wed, 10 Jan 2018 19:45:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 353B5680AE; Wed, 10 Jan 2018 19:45:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72951212B; Wed, 10 Jan 2018 19:45:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AJjcdX081889; Wed, 10 Jan 2018 19:45:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AJjc7C081888; Wed, 10 Jan 2018 19:45:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801101945.w0AJjc7C081888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 19:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327781 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 327781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 19:45:39 -0000 Author: pfg Date: Wed Jan 10 19:45:38 2018 New Revision: 327781 URL: https://svnweb.freebsd.org/changeset/base/327781 Log: Use mallocarray(9) in dirhash. Basic use of mallocarray to prevent overflows. Here allocation is done with M_NOWAIT so the code is prepared for the possibility of returning NULL values. Since mallocarray expects unsigned parameters, unsign some related variables to minimize sign conversions. Reviewed by: mckusick Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Wed Jan 10 19:41:05 2018 (r327780) +++ head/sys/ufs/ufs/ufs_dirhash.c Wed Jan 10 19:45:38 2018 (r327781) @@ -349,7 +349,8 @@ ufsdirhash_build(struct inode *ip) struct direct *ep; struct vnode *vp; doff_t bmask, pos; - int dirblocks, i, j, memreqd, nblocks, narrays, nslots, slot; + int j, memreqd, slot; + u_int dirblocks, i, nblocks, narrays, nslots; /* Take care of a decreased sysctl value. */ while (ufs_dirhashmem > ufs_dirhashmaxmem) { @@ -415,11 +416,11 @@ ufsdirhash_build(struct inode *ip) * Use non-blocking mallocs so that we will revert to a linear * lookup on failure rather than potentially blocking forever. */ - dh->dh_hash = malloc(narrays * sizeof(dh->dh_hash[0]), + dh->dh_hash = mallocarray(narrays, sizeof(dh->dh_hash[0]), M_DIRHASH, M_NOWAIT | M_ZERO); if (dh->dh_hash == NULL) goto fail; - dh->dh_blkfree = malloc(nblocks * sizeof(dh->dh_blkfree[0]), + dh->dh_blkfree = mallocarray(nblocks, sizeof(dh->dh_blkfree[0]), M_DIRHASH, M_NOWAIT); if (dh->dh_blkfree == NULL) goto fail; From owner-svn-src-all@freebsd.org Wed Jan 10 20:05:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1766EE73A4F; Wed, 10 Jan 2018 20:05:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E789869298; Wed, 10 Jan 2018 20:05:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BDC5246C; Wed, 10 Jan 2018 20:05:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AK5Kcm091358; Wed, 10 Jan 2018 20:05:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AK5JRv091356; Wed, 10 Jan 2018 20:05:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801102005.w0AK5JRv091356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 20:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327782 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 327782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:05:21 -0000 Author: pfg Date: Wed Jan 10 20:05:19 2018 New Revision: 327782 URL: https://svnweb.freebsd.org/changeset/base/327782 Log: dev/bxe: make use of mallocarray(9). Use mallocarray in a couple of cases where a calloc-like operation is taking place. Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Wed Jan 10 19:45:38 2018 (r327781) +++ head/sys/dev/bxe/bxe.c Wed Jan 10 20:05:19 2018 (r327782) @@ -12018,7 +12018,8 @@ bxe_set_mc_list(struct bxe_softc *sc) } bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count)); - mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, (M_NOWAIT | M_ZERO)); + mc_mac = mallocarray(mc_count, sizeof(*mc_mac), M_DEVBUF, + (M_NOWAIT | M_ZERO)); mc_mac_start = mc_mac; if (!mc_mac) { Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Wed Jan 10 19:45:38 2018 (r327781) +++ head/sys/dev/bxe/ecore_sp.h Wed Jan 10 20:05:19 2018 (r327782) @@ -159,7 +159,7 @@ typedef struct mtx ECORE_MUTEX_SPIN; malloc(_size, M_TEMP, (M_NOWAIT | M_ZERO)) #define ECORE_CALLOC(_len, _size, _flags, _sc) \ - malloc(_len * _size, M_TEMP, (M_NOWAIT | M_ZERO)) + mallocarray(_len, _size, M_TEMP, (M_NOWAIT | M_ZERO)) #define ECORE_FREE(_s, _buf, _size) free(_buf, M_TEMP) From owner-svn-src-all@freebsd.org Wed Jan 10 20:24:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2FEE748D5; Wed, 10 Jan 2018 20:24:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 128A16A362; Wed, 10 Jan 2018 20:24:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id b76so731634qkc.1; Wed, 10 Jan 2018 12:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VGvx1XGNiffxY602nqDUfObLUT3uUo9jL6Kfos3bBks=; b=EdkIivCh9xqp072ELJWTmfhWOgzbsb87Jv915yjzaGuWU8AQAlxJi3+eC84pjWZ1Ys URCATvIdPMbvHyFCXk8x88RGNRaTQiJk3D4uEO/4N/Vv8ek3KUUX+ECWCcwLn9Zrj1g7 GILv07+KUvxlZzmPWK7/DNLx9mLCRfWpR8GaNDxfIek/6072j5Teh8oGPkSpLIzd+Whe DKKJGSz+8dSMtt4Ay87YlM3/B5Gi2/hy1cu1ufNaP43QQRzYE4y1zGJzLJF4tl0n45vP c9m0gWpTHzDu3MuNDTNP8AiEJ7TMX/twqRQtjzQMvE8gwFchSRfm7vw55dFjBcsUFrca pR9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VGvx1XGNiffxY602nqDUfObLUT3uUo9jL6Kfos3bBks=; b=cvEiAW0L8JzqO1TlfO6inNn/lLGYhUepXVyJNtcfGw3DE+UFP6NpFjDkT/AD3KUCwJ t4mmgJtEsL66AEylEbMFKw2/5tg2UmgVuIpmov5JNRAscH4suYzTLj6pxJRjke2h3T+u ItBAzBmSEoju6jY8tXSdv/J0rPtnK+6ytXFR1IzkD+5fS40D38MbkpNJVIu1tmfk1JO1 nATm2A7xLjv3AS2HiSjAFyfMNPovEqpSJojn7PI8kW+qfw3M0+8qpACGFCxTUuJ9EWvC 4bAo/ztgE9hDjF4vPfNrWZnazd3PIGOZ+6dQg8eOMsqlIj9NeTyEhAR3ClUlsDL1z2VN t+kg== X-Gm-Message-State: AKwxytfMnzLXH/M6SX/f6HtgglgtyXS4xkGifU4zw/UyrsYwGPE/iVff 9EXIACDpTVXb3O2IRXNZt4E7sw== X-Google-Smtp-Source: ACJfBotP+tj+YC3GE2Vaw7P+KiT+Lm7fApKFWXTJI2xATmPOHYTw8rAVQrtbjHjbkTKXQ0yFZX2qVQ== X-Received: by 10.237.62.205 with SMTP id o13mr4264308qtf.316.1515615885681; Wed, 10 Jan 2018 12:24:45 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id h55sm11376753qta.75.2018.01.10.12.24.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 12:24:44 -0800 (PST) Sender: Mark Johnston Date: Wed, 10 Jan 2018 15:24:42 -0500 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326964 - head/sys/cam Message-ID: <20180110202442.GC78524@raichu> References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712190413.vBJ4DMY9090982@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:24:47 -0000 On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: > Author: imp > Date: Tue Dec 19 04:13:22 2017 > New Revision: 326964 > URL: https://svnweb.freebsd.org/changeset/base/326964 > > Log: > When doing a dump, the scheduler is normally not running, so this > changed worked to capture dumps for me. However, the test for > SCHEDULER_STOPPED() isn't right. We can also call the dump routine > from ddb, in which case the scheduler is still running. This leads to > an assertion panic that we're sleeping when we shouldn't. Instead, use > the proper test for dumping or not. This brings us in line with other > places that do special things while we're doing polled I/O like this. > > Noticed by: pho@ > Differential Revision: https://reviews.freebsd.org/D13531 > > Modified: > head/sys/cam/cam_periph.c > > Modified: head/sys/cam/cam_periph.c > ============================================================================== > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 (r326963) > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 (r326964) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, > struct bintime *starttime; > struct bintime ltime; > int error; > - bool sched_stopped; > + bool must_poll; > struct mtx *periph_mtx; > struct cam_periph *periph; > uint32_t timeout = 1; > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, > devstat_start_transaction(ds, starttime); > } > > - sched_stopped = SCHEDULER_STOPPED(); > + /* > + * We must poll the I/O while we're dumping. The scheduler is normally > + * stopped for dumping, except when we call doadump from ddb. While the > + * scheduler is running in this case, we still need to poll the I/O to > + * avoid sleeping waiting for the ccb to complete. > + */ > + must_poll = dumping; Hmm, unfortunately this introduces a new problem: after a panic we call adashutdown() as part of the shutdown_post_sync event. This occurs before we call doadump(), so dumping == 0 and we don't poll for the spindown command's completion. But since we've panicked, the scheduler is stopped, and so we just hang. From owner-svn-src-all@freebsd.org Wed Jan 10 20:28:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B65DCE74B29; Wed, 10 Jan 2018 20:28:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90BC26A560; Wed, 10 Jan 2018 20:28:02 +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 CDB0627C8; Wed, 10 Jan 2018 20:28:01 +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 w0AKS17w000455; Wed, 10 Jan 2018 20:28:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKS1UA000454; Wed, 10 Jan 2018 20:28:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801102028.w0AKS1UA000454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Jan 2018 20:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327783 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 327783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:28:02 -0000 Author: emaste Date: Wed Jan 10 20:28:01 2018 New Revision: 327783 URL: https://svnweb.freebsd.org/changeset/base/327783 Log: Enable ld.lld as bootstrap linker by default on amd64 For some time we have been planning to migrate to LLVM's lld linker. Having a man page was the last blocking issue for using ld.lld to link the base system kernel + userland, now addressed by r327770. Link the kernel and userland libraries and binaries with ld.lld by default, for additional test coverage. This has been a long time in the making. On 2013-04-13 I submitted an upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's system linker. Since then 85 individual issues were identified, and submitted as dependencies. These have been addressed along with two and a half years of other lld development and improvement. I'd like to express deep gratitude to upstream lld developers Rui Ueyama, Rafael Espindola, George Rimar and Davide Italiano. They put in substantial effort in addressing the issues we found affecting FreeBSD/amd64. To revert to using ld.bfd as the bootstrap linker, in /etc/src.conf set WITHOUT_LLD_BOOTSTRAP=yes If you need to set this, please follow up with a PR or post to the freebsd-toolchain mailing list explaining how default WITH_LLD_BOOTSTRAP failed for your use case. Note that GNU ld.bfd is still installed as /usr/bin/ld, and will still be used for linking ports. ld.lld can be installed as /usr/bin/ld by setting in /etc/src.conf WITH_LLD_IS_LLD=yes A followup commit will set WITH_LLD_IS_LD by default, possibly after Clang/LLVM/lld 6.0 is merged to FreeBSD. Release notes: Yes Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jan 10 20:05:19 2018 (r327782) +++ head/share/mk/src.opts.mk Wed Jan 10 20:28:01 2018 (r327783) @@ -253,6 +253,9 @@ __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "aarch64" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD +.elif ${__T} == "amd64" +__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP +__DEFAULT_NO_OPTIONS+=LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .endif From owner-svn-src-all@freebsd.org Wed Jan 10 20:32:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C060E75090 for ; Wed, 10 Jan 2018 20:32:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C42566ABF3 for ; Wed, 10 Jan 2018 20:32:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id c16so897149itc.5 for ; Wed, 10 Jan 2018 12:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QLeTXcaKlmlKRqZoTO2AiryDYTCXIynLq4E2RfEHrV0=; b=UHNqCHgFHegghKqKZgh8rdK5yELtIbNMRUvoGv3vff46hPfjPyIcEaLoe3k9vcOx1M z99k05i+45P9bt04N4z64UxX4gi0L76cipzOqMWKdkgnWyxdJGFIyizw5wUNpxn+Rir7 XqLR3CK36e375p2dyd+DhyC5Fi7rlXxeeSBFx1+E4Iezrnboxj0O61+A0m5deJiVHTJv UtdyNXEFTLUSWjaJVYKZdeCyNHsNfDLIQJGPQvjnmoxAaYokBut3NfdoJchhhFT5hpvs TM4X1yRyOyS1Ci1h6cVQNEZDyWWAia3SzKTXvjHjhh/o/5rqzXa8JAdZHf7UGgcYPkq1 K/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QLeTXcaKlmlKRqZoTO2AiryDYTCXIynLq4E2RfEHrV0=; b=uRqE5z3YKF/VAk604Z2YBJOvighfyuq9MFhzFgjDhREedioBe3CoBTkbH5QEz2kvFW X2BO0XEpZjrpKOd1Y6WRPdO19HalBfOoMouyyG5AzY0AdJ9riEKEqQEK5SeIApg/ayh2 eNmjKgby5eo/e8u/A4A+fC8jwxGFRDds+YR7MKsKCf4mMps7l+zSn0nZPy9ctCFkEEWD 8hfTChds+W7yGsVHMgdsOFL1462HdQ+ro0g0BIvrJvc0uUOa+ZmoG6rlM/e6OfW2wXw/ kGm1Xq1Vu1OCR3/xo7xZXEGIrCdzH52sNAqDbFUK/x/ihYW17hjaRHDxxfJqC5FhccLe VYzQ== X-Gm-Message-State: AKwxyte3WtZSTS2vBfJT7CcbJAo+cLxjMjcCW2FT1NFIIwPPe/EUGuRX XX22vK4dIDxrohCVUd9D9BK1ynzX5gY8xub1KCbPew== X-Google-Smtp-Source: ACJfBosnAQpAdj8hJzTtXpodJH5lE6X9mKm59SnDlXPmLY8l86bxOFbgn6auDeUPNARkKaHt35PNxjOJENVk5hBe6Zc= X-Received: by 10.36.1.16 with SMTP id 16mr7357577itk.115.1515616350047; Wed, 10 Jan 2018 12:32:30 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 12:32:29 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180110202442.GC78524@raichu> References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> <20180110202442.GC78524@raichu> From: Warner Losh Date: Wed, 10 Jan 2018 13:32:29 -0700 X-Google-Sender-Auth: agO5VnT3ukwNwwvE3W1CcyLzM5w Message-ID: Subject: Re: svn commit: r326964 - head/sys/cam To: Mark Johnston Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:32:31 -0000 On Wed, Jan 10, 2018 at 1:24 PM, Mark Johnston wrote: > On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: > > Author: imp > > Date: Tue Dec 19 04:13:22 2017 > > New Revision: 326964 > > URL: https://svnweb.freebsd.org/changeset/base/326964 > > > > Log: > > When doing a dump, the scheduler is normally not running, so this > > changed worked to capture dumps for me. However, the test for > > SCHEDULER_STOPPED() isn't right. We can also call the dump routine > > from ddb, in which case the scheduler is still running. This leads to > > an assertion panic that we're sleeping when we shouldn't. Instead, use > > the proper test for dumping or not. This brings us in line with other > > places that do special things while we're doing polled I/O like this. > > > > Noticed by: pho@ > > Differential Revision: https://reviews.freebsd.org/D13531 > > > > Modified: > > head/sys/cam/cam_periph.c > > > > Modified: head/sys/cam/cam_periph.c > > ============================================================ > ================== > > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 (r326963) > > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 (r326964) > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, > > struct bintime *starttime; > > struct bintime ltime; > > int error; > > - bool sched_stopped; > > + bool must_poll; > > struct mtx *periph_mtx; > > struct cam_periph *periph; > > uint32_t timeout = 1; > > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, > > devstat_start_transaction(ds, starttime); > > } > > > > - sched_stopped = SCHEDULER_STOPPED(); > > + /* > > + * We must poll the I/O while we're dumping. The scheduler is > normally > > + * stopped for dumping, except when we call doadump from ddb. > While the > > + * scheduler is running in this case, we still need to poll the > I/O to > > + * avoid sleeping waiting for the ccb to complete. > > + */ > > + must_poll = dumping; > > Hmm, unfortunately this introduces a new problem: after a panic we call > adashutdown() as part of the shutdown_post_sync event. This occurs > before we call doadump(), so dumping == 0 and we don't poll for the > spindown command's completion. But since we've panicked, the scheduler > is stopped, and so we just hang. > So "dumping || SCHEDULER_STOPPED()" then is needed? Warner From owner-svn-src-all@freebsd.org Wed Jan 10 20:35:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2F7E75605; Wed, 10 Jan 2018 20:35:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 869546AF1D; Wed, 10 Jan 2018 20:35:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x22b.google.com with SMTP id w1so789229qka.2; Wed, 10 Jan 2018 12:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6HOrR4qmfAakZ/7uWsrl1Qukt1zxw5O/8qjsnvuz+Bs=; b=g+HK7bjrrGWrc8iuQwpgspEKKboVIut7FsT2Ch8VJRaPWYjqntmjED6ylJJU3Cj8/Z sGfc+rz8UXD2tv92BVRmqgo32SmDwxTW8sVu2qpxPj2g1u0708MzHKM1bahbDNaLxiR1 8VxPfKgJk6BpkIyhlfmxidFXZDAT9A+8u+U7jI4m5tq1uWwhPKgRuD4A4yEHL7mlUv7/ tRDiDEUrv3jBSZs/IALjObVR6G9LC8yBB18qBE5/7tB40P2QEf6EExA0vz6xWW1WKPBr Mwaa2qtL1szjVFdOvWTzNltViljQ7wlhmogs8Waih1dV/8B2x2uAfHb4sj/JAHM5Gwzn 2SlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6HOrR4qmfAakZ/7uWsrl1Qukt1zxw5O/8qjsnvuz+Bs=; b=PPF16l6bIM1ezVgJm3UCW4NbPX1Y94c/CAPbPgs3lIxdDPV089hkY2IKUBt0vQRFRo FHwE38AQ4f6XwnfBB0mbIS34nc1N4YMHpFDBoXYcF3a1D8BiOlOuX9BsreoIQNZHNo/z nLACoNK05rSwdB+u12wcdqe39SPjbkkelB6TkiEgCguDVQfz0AdHUIabmDyuZBDFjRi/ /JDC8BKlt3VduamgF0QpFM3Lh5S0LDwYLMaUNXB71+tBqXnpPiJr7i8y2iNSjP1fagff hjCdmMuPRw73Q7QqoQ+de3ug3KJNd6YEzdRoZ/I93quzX9cXYwzg+Hyd7PFF7sJh73eg GELQ== X-Gm-Message-State: AKGB3mKdsuEKmq0oc6smz92kdPR+Gkq953qDVfL/zw0/z2PuL5RdyKjO D4poysrrgqJd0OBK79nUEfFQcw== X-Google-Smtp-Source: ACJfBovwPVcokub9JpMkPWfKZiyCfCQfI+hSdDtOJsR6iSZy+FL/o5Misguf0IT3pXOxv4n2wHkq+g== X-Received: by 10.55.77.65 with SMTP id a62mr28256181qkb.249.1515616518335; Wed, 10 Jan 2018 12:35:18 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id w41sm11122582qtc.19.2018.01.10.12.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 12:35:17 -0800 (PST) Sender: Mark Johnston Date: Wed, 10 Jan 2018 15:35:15 -0500 From: Mark Johnston To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326964 - head/sys/cam Message-ID: <20180110203515.GD78524@raichu> References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> <20180110202442.GC78524@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:35:19 -0000 On Wed, Jan 10, 2018 at 01:32:29PM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 1:24 PM, Mark Johnston wrote: > > > On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Tue Dec 19 04:13:22 2017 > > > New Revision: 326964 > > > URL: https://svnweb.freebsd.org/changeset/base/326964 > > > > > > Log: > > > When doing a dump, the scheduler is normally not running, so this > > > changed worked to capture dumps for me. However, the test for > > > SCHEDULER_STOPPED() isn't right. We can also call the dump routine > > > from ddb, in which case the scheduler is still running. This leads to > > > an assertion panic that we're sleeping when we shouldn't. Instead, use > > > the proper test for dumping or not. This brings us in line with other > > > places that do special things while we're doing polled I/O like this. > > > > > > Noticed by: pho@ > > > Differential Revision: https://reviews.freebsd.org/D13531 > > > > > > Modified: > > > head/sys/cam/cam_periph.c > > > > > > Modified: head/sys/cam/cam_periph.c > > > ============================================================ > > ================== > > > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 (r326963) > > > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 (r326964) > > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, > > > struct bintime *starttime; > > > struct bintime ltime; > > > int error; > > > - bool sched_stopped; > > > + bool must_poll; > > > struct mtx *periph_mtx; > > > struct cam_periph *periph; > > > uint32_t timeout = 1; > > > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, > > > devstat_start_transaction(ds, starttime); > > > } > > > > > > - sched_stopped = SCHEDULER_STOPPED(); > > > + /* > > > + * We must poll the I/O while we're dumping. The scheduler is > > normally > > > + * stopped for dumping, except when we call doadump from ddb. > > While the > > > + * scheduler is running in this case, we still need to poll the > > I/O to > > > + * avoid sleeping waiting for the ccb to complete. > > > + */ > > > + must_poll = dumping; > > > > Hmm, unfortunately this introduces a new problem: after a panic we call > > adashutdown() as part of the shutdown_post_sync event. This occurs > > before we call doadump(), so dumping == 0 and we don't poll for the > > spindown command's completion. But since we've panicked, the scheduler > > is stopped, and so we just hang. > > > > So "dumping || SCHEDULER_STOPPED()" then is needed? It seems so, unfortunately. From owner-svn-src-all@freebsd.org Wed Jan 10 20:36:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A890E75704; Wed, 10 Jan 2018 20:36:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA9A6B098; Wed, 10 Jan 2018 20:36:17 +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 EF0DA298E; Wed, 10 Jan 2018 20:36:16 +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 w0AKaGBg004643; Wed, 10 Jan 2018 20:36:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKaG0m004642; Wed, 10 Jan 2018 20:36:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801102036.w0AKaG0m004642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Jan 2018 20:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327784 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 327784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:36:18 -0000 Author: emaste Date: Wed Jan 10 20:36:16 2018 New Revision: 327784 URL: https://svnweb.freebsd.org/changeset/base/327784 Log: regen src.conf.5 after r327783, WITH_LLD_BOOTSTRAP default (I missed the Reviewed by and review link from r327783.) Reviewed by: brooks, dim, bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13827 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jan 10 20:28:01 2018 (r327783) +++ head/share/man/man5/src.conf.5 Wed Jan 10 20:36:16 2018 (r327784) @@ -970,12 +970,12 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on -arm64/aarch64. +amd64/amd64 and arm64/aarch64. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp From owner-svn-src-all@freebsd.org Wed Jan 10 20:38:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912B6E758CF for ; Wed, 10 Jan 2018 20:38:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50DCD6B275 for ; Wed, 10 Jan 2018 20:38:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id i143so854452ioa.3 for ; Wed, 10 Jan 2018 12:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=o+GxQjTiTgITleNCtYMx1lifaM3dDR5D7DFusdwSoMk=; b=EGFP+AmcC/ED63DZlgVspheANBjUNaEZxNvakr9uYA3F7KqKfFpK4YeYJPtFB+8Et1 p1n0NDM2fOoXZUNVSFEyhtluWq5uLJloEbb8ze8mULl1Z7+4irt+SoquEW9+MXxyqqwY wBukZ3n+A82kraCrjlAuAxMCxs0hcyPPaP/oJfkRf7VGLKnv0JM/SL77pPFdnuRYkNmT O64Vj37a8fEu+5/jYPhnPAndF+frGGhkePW0bxJ2HQVKBbnbQao832qOkc6o+gjVLD0s Z9wa9O0cx2JoEbhdPpJKmX/VWKIvlLraOs0lazcJBKscdyV8Pkz6h0IytKOdGAbgNUJu tYxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=o+GxQjTiTgITleNCtYMx1lifaM3dDR5D7DFusdwSoMk=; b=N4MigAdAfaCp3X+4LeW14AAA8HHTQ9828jzzlRZld3vxxjRFkmqTuB7nnCEOTXYWAM iJSiJ/ut1UsDX+ETdReBZXf8BaiAYw7EbelA2gHQDETtqPAPzhzWIynWweFr6WL15n7C l0QCY8gTzAFjBteGaiwPDrb6Hoo9y58jjZLHW9MOPCOsfiK4/eboIXB+84GMKatV/AQ/ sN8aEkcR71aOnfFNQ+ODWLf5/ZhkvJsyqE06Vgj+QRRTWMCt5tpk+RDumO5DBo1msnDj 4tBuJitwoto9W1Y6eMGjX1qB63eMCbKbq3m53u35oD4oCnaiZqH2ahuLaXrNNH3DJFGo ypgQ== X-Gm-Message-State: AKwxytc/d7sGONSUyvPzl5OirCcWmQyLrzc0S/bWwaesOrdioe+sCnoc LYaka+4C1ZSzUGhJoeqRYL1t7rUpdhFkDCW3nVt9kQ== X-Google-Smtp-Source: ACJfBouoUN+nCz1vFsGuF16k6JneidFy5TaVvKa7bHPCFBnlWkyuGcwJnh8eGjS/RHj4DjHsSbuy04ClhbYpQ383e4Y= X-Received: by 10.107.78.12 with SMTP id c12mr18638544iob.63.1515616722417; Wed, 10 Jan 2018 12:38:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.160.217 with HTTP; Wed, 10 Jan 2018 12:38:41 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180110203515.GD78524@raichu> References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> <20180110202442.GC78524@raichu> <20180110203515.GD78524@raichu> From: Warner Losh Date: Wed, 10 Jan 2018 13:38:41 -0700 X-Google-Sender-Auth: OBqgHLB2JPLS9WkHQP1QHPnuj5M Message-ID: Subject: Re: svn commit: r326964 - head/sys/cam To: Mark Johnston Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:38:43 -0000 On Wed, Jan 10, 2018 at 1:35 PM, Mark Johnston wrote: > On Wed, Jan 10, 2018 at 01:32:29PM -0700, Warner Losh wrote: > > On Wed, Jan 10, 2018 at 1:24 PM, Mark Johnston > wrote: > > > > > On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Tue Dec 19 04:13:22 2017 > > > > New Revision: 326964 > > > > URL: https://svnweb.freebsd.org/changeset/base/326964 > > > > > > > > Log: > > > > When doing a dump, the scheduler is normally not running, so this > > > > changed worked to capture dumps for me. However, the test for > > > > SCHEDULER_STOPPED() isn't right. We can also call the dump routine > > > > from ddb, in which case the scheduler is still running. This leads > to > > > > an assertion panic that we're sleeping when we shouldn't. Instead, > use > > > > the proper test for dumping or not. This brings us in line with > other > > > > places that do special things while we're doing polled I/O like > this. > > > > > > > > Noticed by: pho@ > > > > Differential Revision: https://reviews.freebsd.org/D13531 > > > > > > > > Modified: > > > > head/sys/cam/cam_periph.c > > > > > > > > Modified: head/sys/cam/cam_periph.c > > > > ============================================================ > > > ================== > > > > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 > (r326963) > > > > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 > (r326964) > > > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > > > > #include > > > > #include > > > > #include > > > > +#include > > > > #include > > > > #include > > > > #include > > > > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, > > > > struct bintime *starttime; > > > > struct bintime ltime; > > > > int error; > > > > - bool sched_stopped; > > > > + bool must_poll; > > > > struct mtx *periph_mtx; > > > > struct cam_periph *periph; > > > > uint32_t timeout = 1; > > > > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, > > > > devstat_start_transaction(ds, starttime); > > > > } > > > > > > > > - sched_stopped = SCHEDULER_STOPPED(); > > > > + /* > > > > + * We must poll the I/O while we're dumping. The scheduler is > > > normally > > > > + * stopped for dumping, except when we call doadump from ddb. > > > While the > > > > + * scheduler is running in this case, we still need to poll the > > > I/O to > > > > + * avoid sleeping waiting for the ccb to complete. > > > > + */ > > > > + must_poll = dumping; > > > > > > Hmm, unfortunately this introduces a new problem: after a panic we call > > > adashutdown() as part of the shutdown_post_sync event. This occurs > > > before we call doadump(), so dumping == 0 and we don't poll for the > > > spindown command's completion. But since we've panicked, the scheduler > > > is stopped, and so we just hang. > > > > > > > So "dumping || SCHEDULER_STOPPED()" then is needed? > > It seems so, unfortunately. > OK. Sounds good. I'll make the change today. From owner-svn-src-all@freebsd.org Wed Jan 10 20:39:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E15E75947; Wed, 10 Jan 2018 20:39:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69ABB6B3D3; Wed, 10 Jan 2018 20:39:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D7C229A8; Wed, 10 Jan 2018 20:39:28 +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 w0AKdSjW004798; Wed, 10 Jan 2018 20:39:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKdQCU004776; Wed, 10 Jan 2018 20:39:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801102039.w0AKdQCU004776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 20:39:26 +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: r327785 - in stable/11/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu X-SVN-Commit-Revision: 327785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:39:30 -0000 Author: markj Date: Wed Jan 10 20:39:26 2018 New Revision: 327785 URL: https://svnweb.freebsd.org/changeset/base/327785 Log: MFC r325530 (jeff), r325566 (kib), r325588 (kib): Replace many instances of VM_WAIT with blocking page allocation flags. Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/amd64/amd64/uma_machdep.c stable/11/sys/arm64/arm64/uma_machdep.c stable/11/sys/fs/tmpfs/tmpfs_subr.c stable/11/sys/kern/uipc_shm.c stable/11/sys/kern/vfs_bio.c stable/11/sys/mips/mips/uma_machdep.c stable/11/sys/powerpc/aim/mmu_oea64.c stable/11/sys/powerpc/aim/slb.c stable/11/sys/powerpc/powerpc/uma_machdep.c stable/11/sys/sparc64/sparc64/vm_machdep.c stable/11/sys/vm/phys_pager.c stable/11/sys/vm/swap_pager.c stable/11/sys/vm/uma.h stable/11/sys/vm/uma_core.c stable/11/sys/vm/vm_kern.c stable/11/sys/vm/vm_object.c stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_page.h stable/11/sys/vm/vm_radix.c stable/11/sys/vm/vm_radix.h stable/11/sys/x86/iommu/intel_utils.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/amd64/amd64/pmap.c Wed Jan 10 20:39:26 2018 (r327785) @@ -2416,9 +2416,8 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i /* * allocate the page directory page */ - while ((pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) - VM_WAIT; + pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); pml4phys = VM_PAGE_TO_PHYS(pml4pg); pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pml4phys); Modified: stable/11/sys/amd64/amd64/uma_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/uma_machdep.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/amd64/amd64/uma_machdep.c Wed Jan 10 20:39:26 2018 (r327785) @@ -46,20 +46,12 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in vm_page_t m; vm_paddr_t pa; void *va; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); Modified: stable/11/sys/arm64/arm64/uma_machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/uma_machdep.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/arm64/arm64/uma_machdep.c Wed Jan 10 20:39:26 2018 (r327785) @@ -46,20 +46,12 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in vm_page_t m; vm_paddr_t pa; void *va; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 10 20:39:26 2018 (r327785) @@ -1401,13 +1401,10 @@ retry: goto retry; MPASS(m->valid == VM_PAGE_BITS_ALL); } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) { - m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL); - if (m == NULL) { - VM_OBJECT_WUNLOCK(uobj); - VM_WAIT; - VM_OBJECT_WLOCK(uobj); + m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL | + VM_ALLOC_WAITFAIL); + if (m == NULL) goto retry; - } rv = vm_pager_get_pages(uobj, &m, 1, NULL, NULL); vm_page_lock(m); Modified: stable/11/sys/kern/uipc_shm.c ============================================================================== --- stable/11/sys/kern/uipc_shm.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/kern/uipc_shm.c Wed Jan 10 20:39:26 2018 (r327785) @@ -448,13 +448,10 @@ retry: if (vm_page_sleep_if_busy(m, "shmtrc")) goto retry; } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL); - if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); + m = vm_page_alloc(object, idx, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); + if (m == NULL) goto retry; - } rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); vm_page_lock(m); Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/kern/vfs_bio.c Wed Jan 10 20:39:26 2018 (r327785) @@ -4470,18 +4470,14 @@ vm_hold_load_pages(struct buf *bp, vm_offset_t from, v index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; for (pg = from; pg < to; pg += PAGE_SIZE, index++) { -tryagain: /* * note: must allocate system pages since blocking here * could interfere with paging I/O, no matter which * process we are. */ p = vm_page_alloc(NULL, 0, VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT)); - if (p == NULL) { - VM_WAIT; - goto tryagain; - } + VM_ALLOC_WIRED | VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT) | + VM_ALLOC_WAITOK); pmap_qenter(pg, &p, 1); bp->b_pages[index] = p; } Modified: stable/11/sys/mips/mips/uma_machdep.c ============================================================================== --- stable/11/sys/mips/mips/uma_machdep.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/mips/mips/uma_machdep.c Wed Jan 10 20:39:26 2018 (r327785) @@ -50,6 +50,10 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in *flags = UMA_SLAB_PRIV; pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; +#ifndef __mips_n64 + pflags &= ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; +#endif for (;;) { m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags); Modified: stable/11/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/11/sys/powerpc/aim/mmu_oea64.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/powerpc/aim/mmu_oea64.c Wed Jan 10 20:39:26 2018 (r327785) @@ -1515,7 +1515,7 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes struct pvo_entry *pvo; vm_offset_t va; vm_page_t m; - int pflags, needed_lock; + int needed_lock; /* * This entire routine is a horrible hack to avoid bothering kmem @@ -1526,17 +1526,11 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes *flags = UMA_SLAB_PRIV; needed_lock = !PMAP_LOCKED(kernel_pmap); - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); va = VM_PAGE_TO_PHYS(m); Modified: stable/11/sys/powerpc/aim/slb.c ============================================================================== --- stable/11/sys/powerpc/aim/slb.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/powerpc/aim/slb.c Wed Jan 10 20:39:26 2018 (r327785) @@ -483,24 +483,16 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, u static vm_offset_t realmax = 0; void *va; vm_page_t m; - int pflags; if (realmax == 0) realmax = platform_real_maxaddr(); *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - - for (;;) { - m = vm_page_alloc_contig(NULL, 0, pflags, 1, 0, realmax, - PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc_contig(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, + 1, 0, realmax, PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); + if (m == NULL) + return (NULL); va = (void *) VM_PAGE_TO_PHYS(m); Modified: stable/11/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- stable/11/sys/powerpc/powerpc/uma_machdep.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/powerpc/powerpc/uma_machdep.c Wed Jan 10 20:39:26 2018 (r327785) @@ -55,20 +55,13 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in void *va; vm_paddr_t pa; vm_page_t m; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); pa = VM_PAGE_TO_PHYS(m); Modified: stable/11/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/11/sys/sparc64/sparc64/vm_machdep.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/sparc64/sparc64/vm_machdep.c Wed Jan 10 20:39:26 2018 (r327785) @@ -394,24 +394,16 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in { vm_paddr_t pa; vm_page_t m; - int pflags; void *va; PMAP_STATS_INC(uma_nsmall_alloc); *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { Modified: stable/11/sys/vm/phys_pager.c ============================================================================== --- stable/11/sys/vm/phys_pager.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/phys_pager.c Wed Jan 10 20:39:26 2018 (r327785) @@ -209,13 +209,10 @@ retry: if (m == NULL) { ahead = MIN(end - i, PHYSALLOC); m = vm_page_alloc(object, i, VM_ALLOC_NORMAL | - VM_ALLOC_ZERO | VM_ALLOC_COUNT(ahead)); - if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); + VM_ALLOC_ZERO | VM_ALLOC_WAITFAIL | + VM_ALLOC_COUNT(ahead)); + if (m == NULL) goto retry; - } if ((m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/swap_pager.c Wed Jan 10 20:39:26 2018 (r327785) @@ -1808,7 +1808,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonxb", 10); } else - VM_WAIT; + uma_zwait(swblk_zone); VM_OBJECT_WLOCK(object); sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); @@ -1838,7 +1838,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonxp", 10); } else - VM_WAIT; + uma_zwait(swpctrie_zone); VM_OBJECT_WLOCK(object); sb1 = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); Modified: stable/11/sys/vm/uma.h ============================================================================== --- stable/11/sys/vm/uma.h Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/uma.h Wed Jan 10 20:39:26 2018 (r327785) @@ -366,6 +366,11 @@ uma_zfree(uma_zone_t zone, void *item) } /* + * Wait until the specified zone can allocate an item. + */ +void uma_zwait(uma_zone_t zone); + +/* * XXX The rest of the prototypes in this header are h0h0 magic for the VM. * If you think you need to use it for a normal zone you're probably incorrect. */ Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/uma_core.c Wed Jan 10 20:39:26 2018 (r327785) @@ -1127,7 +1127,9 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t npages = howmany(bytes, PAGE_SIZE); while (npages > 0) { p = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | - VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + VM_ALLOC_WIRED | VM_ALLOC_NOOBJ | + ((wait & M_WAITOK) != 0 ? VM_ALLOC_WAITOK : + VM_ALLOC_NOWAIT)); if (p != NULL) { /* * Since the page does not belong to an object, its @@ -1137,11 +1139,6 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t npages--; continue; } - if (wait & M_WAITOK) { - VM_WAIT; - continue; - } - /* * Page allocation failed, free intermediate pages and * exit. @@ -2080,6 +2077,15 @@ uma_zdestroy(uma_zone_t zone) sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); sx_sunlock(&uma_drain_lock); +} + +void +uma_zwait(uma_zone_t zone) +{ + void *item; + + item = uma_zalloc_arg(zone, NULL, M_WAITOK); + uma_zfree(zone, item); } /* See uma.h */ Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_kern.c Wed Jan 10 20:39:26 2018 (r327785) @@ -172,6 +172,8 @@ kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flag return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += PAGE_SIZE) { tries = 0; @@ -227,6 +229,8 @@ kmem_alloc_contig(struct vmem *vmem, vm_size_t size, i return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; npages = atop(size); VM_OBJECT_WLOCK(object); tries = 0; @@ -338,10 +342,13 @@ kmem_back(vm_object_t object, vm_offset_t addr, vm_siz offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + if (flags & M_WAITOK) + pflags |= VM_ALLOC_WAITFAIL; i = 0; -retry: VM_OBJECT_WLOCK(object); +retry: mpred = vm_radix_lookup_le(&object->rtree, atop(offset + i)); for (; i < size; i += PAGE_SIZE, mpred = m) { m = vm_page_alloc_after(object, atop(offset + i), pflags, @@ -353,11 +360,9 @@ retry: * aren't on any queues. */ if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - if ((flags & M_NOWAIT) == 0) { - VM_WAIT; + if ((flags & M_NOWAIT) == 0) goto retry; - } + VM_OBJECT_WUNLOCK(object); kmem_unback(object, addr, i); return (KERN_NO_SPACE); } Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_object.c Wed Jan 10 20:39:26 2018 (r327785) @@ -1461,7 +1461,7 @@ retry: if (vm_page_rename(m, new_object, idx)) { VM_OBJECT_WUNLOCK(new_object); VM_OBJECT_WUNLOCK(orig_object); - VM_WAIT; + vm_radix_wait(); VM_OBJECT_WLOCK(orig_object); VM_OBJECT_WLOCK(new_object); goto retry; @@ -1523,8 +1523,9 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_pa vm_page_lock(p); VM_OBJECT_WUNLOCK(object); VM_OBJECT_WUNLOCK(backing_object); + /* The page is only NULL when rename fails. */ if (p == NULL) - VM_WAIT; + vm_radix_wait(); else vm_page_busy_sleep(p, "vmocol", false); VM_OBJECT_WLOCK(object); Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_page.c Wed Jan 10 20:39:26 2018 (r327785) @@ -167,6 +167,7 @@ static void vm_page_insert_radixdone(vm_page_t m, vm_o vm_page_t mpred); static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, vm_paddr_t high); +static int vm_page_alloc_fail(vm_object_t object, int req); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init_fakepg, NULL); @@ -1606,6 +1607,8 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("inconsistent object(%p)/req(%x)", object, req)); + KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, + ("Can't sleep and retry object insertion.")); KASSERT(mpred == NULL || mpred->pindex < pindex, ("mpred %p doesn't precede pindex 0x%jx", mpred, (uintmax_t)pindex)); @@ -1627,6 +1630,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * Allocate a page if the number of free pages exceeds the minimum * for the request class. */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && @@ -1659,10 +1663,8 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi /* * Not allocatable, give up. */ - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, - max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); + if (vm_page_alloc_fail(object, req)) + goto again; return (NULL); } @@ -1716,6 +1718,11 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi m->busy_lock = VPB_UNBUSIED; /* Don't change PG_ZERO. */ vm_page_free_toq(m); + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } return (NULL); } @@ -1793,6 +1800,8 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("vm_page_alloc_contig: inconsistent object(%p)/req(%x)", object, req)); + KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, + ("Can't sleep and retry object insertion.")); if (object != NULL) { VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_FICTITIOUS) == 0, @@ -1818,6 +1827,7 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p * Can we allocate the pages without the number of free pages falling * below the lower bound for the allocation class? */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && @@ -1839,9 +1849,8 @@ retry: m_ret = vm_phys_alloc_contig(npages, low, high, alignment, boundary); } else { - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, npages); - pagedaemon_wakeup(); + if (vm_page_alloc_fail(object, req)) + goto again; return (NULL); } if (m_ret != NULL) { @@ -1910,6 +1919,11 @@ retry: /* Don't change PG_ZERO. */ vm_page_free_toq(m); } + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } return (NULL); } mpred = m; @@ -1982,18 +1996,17 @@ vm_page_alloc_freelist(int flind, int req) /* * Do not allocate reserved pages unless the req has asked for it. */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count > 0)) + vm_cnt.v_free_count > 0)) { m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); - else { - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, - max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); + } else { + if (vm_page_alloc_fail(NULL, req)) + goto again; return (NULL); } if (m == NULL) { @@ -2557,11 +2570,11 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd * Sleep until free pages are available for allocation. * - Called in various places before memory allocations. */ -void -vm_wait(void) +static void +_vm_wait(void) { - mtx_lock(&vm_page_queue_free_mtx); + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); if (curproc == pageproc) { vm_pageout_pages_needed = 1; msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx, @@ -2579,7 +2592,47 @@ vm_wait(void) } } +void +vm_wait(void) +{ + + mtx_lock(&vm_page_queue_free_mtx); + _vm_wait(); +} + /* + * vm_page_alloc_fail: + * + * Called when a page allocation function fails. Informs the + * pagedaemon and performs the requested wait. Requires the + * page_queue_free and object lock on entry. Returns with the + * object lock held and free lock released. Returns an error when + * retry is necessary. + * + */ +static int +vm_page_alloc_fail(vm_object_t object, int req) +{ + + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + + atomic_add_int(&vm_pageout_deficit, + max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); + pagedaemon_wakeup(); + if (req & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) { + if (object != NULL) + VM_OBJECT_WUNLOCK(object); + _vm_wait(); + if (object != NULL) + VM_OBJECT_WLOCK(object); + if (req & VM_ALLOC_WAITOK) + return (EAGAIN); + } else + mtx_unlock(&vm_page_queue_free_mtx); + return (0); +} + +/* * vm_waitpfault: (also see VM_WAITPFAULT macro) * * Sleep until free pages are available for allocation. @@ -3190,11 +3243,16 @@ vm_page_grab(vm_object_t object, vm_pindex_t pindex, i { vm_page_t m; int sleep; + int pflags; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || (allocflags & VM_ALLOC_IGN_SBUSY) != 0, ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch")); + pflags = allocflags & + ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + if ((allocflags & VM_ALLOC_NOWAIT) == 0) + pflags |= VM_ALLOC_WAITFAIL; retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { sleep = (allocflags & VM_ALLOC_IGN_SBUSY) != 0 ? @@ -3228,13 +3286,10 @@ retrylookup: return (m); } } - m = vm_page_alloc(object, pindex, allocflags); + m = vm_page_alloc(object, pindex, pflags); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) return (NULL); - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); goto retrylookup; } if (allocflags & VM_ALLOC_ZERO && (m->flags & PG_ZERO) == 0) @@ -3273,6 +3328,7 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin vm_page_t *ma, int count) { vm_page_t m, mpred; + int pflags; int i; bool sleep; @@ -3287,6 +3343,10 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin ("vm_page_grab_pages: VM_ALLOC_SBUSY/IGN_SBUSY mismatch")); if (count == 0) return (0); + pflags = allocflags & ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | + VM_ALLOC_WAITFAIL | VM_ALLOC_IGN_SBUSY); + if ((allocflags & VM_ALLOC_NOWAIT) == 0) + pflags |= VM_ALLOC_WAITFAIL; i = 0; retrylookup: m = vm_radix_lookup_le(&object->rtree, pindex + i); @@ -3327,14 +3387,10 @@ retrylookup: vm_page_sbusy(m); } else { m = vm_page_alloc_after(object, pindex + i, - (allocflags & ~VM_ALLOC_IGN_SBUSY) | - VM_ALLOC_COUNT(count - i), mpred); + pflags | VM_ALLOC_COUNT(count - i), mpred); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) break; - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); goto retrylookup; } } Modified: stable/11/sys/vm/vm_page.h ============================================================================== --- stable/11/sys/vm/vm_page.h Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_page.h Wed Jan 10 20:39:26 2018 (r327785) @@ -408,6 +408,8 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_INTERRUPT 1 #define VM_ALLOC_SYSTEM 2 #define VM_ALLOC_CLASS_MASK 3 +#define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */ +#define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ #define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ @@ -417,7 +419,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ -#define VM_ALLOC_NOWAIT 0x8000 /* (gp) Do not sleep */ +#define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */ #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) @@ -436,6 +438,10 @@ malloc2vm_flags(int malloc_flags) pflags |= VM_ALLOC_ZERO; if ((malloc_flags & M_NODUMP) != 0) pflags |= VM_ALLOC_NODUMP; + if ((malloc_flags & M_NOWAIT)) + pflags |= VM_ALLOC_NOWAIT; + if ((malloc_flags & M_WAITOK)) + pflags |= VM_ALLOC_WAITOK; return (pflags); } #endif Modified: stable/11/sys/vm/vm_radix.c ============================================================================== --- stable/11/sys/vm/vm_radix.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_radix.c Wed Jan 10 20:39:26 2018 (r327785) @@ -775,6 +775,12 @@ vm_radix_replace(struct vm_radix *rtree, vm_page_t new panic("%s: original replacing page not found", __func__); } +void +vm_radix_wait(void) +{ + uma_zwait(vm_radix_node_zone); +} + #ifdef DDB /* * Show details about the given radix node. Modified: stable/11/sys/vm/vm_radix.h ============================================================================== --- stable/11/sys/vm/vm_radix.h Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/vm/vm_radix.h Wed Jan 10 20:39:26 2018 (r327785) @@ -36,6 +36,7 @@ #ifdef _KERNEL int vm_radix_insert(struct vm_radix *rtree, vm_page_t page); +void vm_radix_wait(void); boolean_t vm_radix_is_singleton(struct vm_radix *rtree); vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index); Modified: stable/11/sys/x86/iommu/intel_utils.c ============================================================================== --- stable/11/sys/x86/iommu/intel_utils.c Wed Jan 10 20:36:16 2018 (r327784) +++ stable/11/sys/x86/iommu/intel_utils.c Wed Jan 10 20:39:26 2018 (r327785) @@ -257,9 +257,12 @@ vm_page_t dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) { vm_page_t m; - int zeroed; + int zeroed, aflags; zeroed = (flags & DMAR_PGF_ZERO) != 0 ? VM_ALLOC_ZERO : 0; + aflags = zeroed | VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | + ((flags & DMAR_PGF_WAITOK) != 0 ? VM_ALLOC_WAITFAIL : + VM_ALLOC_NOWAIT); for (;;) { if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WLOCK(obj); @@ -269,8 +272,7 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla VM_OBJECT_WUNLOCK(obj); break; } - m = vm_page_alloc_contig(obj, idx, VM_ALLOC_NOBUSY | - VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | zeroed, 1, 0, + m = vm_page_alloc_contig(obj, idx, aflags, 1, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); @@ -282,11 +284,6 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla } if ((flags & DMAR_PGF_WAITOK) == 0) break; - if ((flags & DMAR_PGF_OBJL) != 0) - VM_OBJECT_WUNLOCK(obj); - VM_WAIT; - if ((flags & DMAR_PGF_OBJL) != 0) - VM_OBJECT_WLOCK(obj); } return (m); } From owner-svn-src-all@freebsd.org Wed Jan 10 20:48:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5993FE76081; Wed, 10 Jan 2018 20:48:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34E536BA2E; Wed, 10 Jan 2018 20:48:22 +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 8D8922B48; Wed, 10 Jan 2018 20:48: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 w0AKmLHY008990; Wed, 10 Jan 2018 20:48:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKmL12008986; Wed, 10 Jan 2018 20:48:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801102048.w0AKmL12008986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 20:48:21 +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: r327786 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 327786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:48:22 -0000 Author: markj Date: Wed Jan 10 20:48:21 2018 New Revision: 327786 URL: https://svnweb.freebsd.org/changeset/base/327786 Log: MFC r327168, r327213: Fix two problems with the page daemon control loop. Modified: stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_pageout.c stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Wed Jan 10 20:39:26 2018 (r327785) +++ stable/11/sys/vm/vm_page.c Wed Jan 10 20:48:21 2018 (r327786) @@ -2580,15 +2580,9 @@ _vm_wait(void) msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx, PDROP | PSWP, "VMWait", 0); } else { - if (__predict_false(pageproc == NULL)) + if (pageproc == NULL) panic("vm_wait in early boot"); - if (!vm_pageout_wanted) { - vm_pageout_wanted = true; - wakeup(&vm_pageout_wanted); - } - vm_pages_needed = true; - msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PVM, - "vmwait", 0); + pagedaemon_wait(PVM, "vmwait"); } } @@ -2618,7 +2612,6 @@ vm_page_alloc_fail(vm_object_t object, int req) atomic_add_int(&vm_pageout_deficit, max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); if (req & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) { if (object != NULL) VM_OBJECT_WUNLOCK(object); @@ -2627,8 +2620,10 @@ vm_page_alloc_fail(vm_object_t object, int req) VM_OBJECT_WLOCK(object); if (req & VM_ALLOC_WAITOK) return (EAGAIN); - } else + } else { mtx_unlock(&vm_page_queue_free_mtx); + pagedaemon_wakeup(); + } return (0); } @@ -2647,13 +2642,7 @@ vm_waitpfault(void) { mtx_lock(&vm_page_queue_free_mtx); - if (!vm_pageout_wanted) { - vm_pageout_wanted = true; - wakeup(&vm_pageout_wanted); - } - vm_pages_needed = true; - msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PUSER, - "pfault", 0); + pagedaemon_wait(PUSER, "pfault"); } struct vm_pagequeue * Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Wed Jan 10 20:39:26 2018 (r327785) +++ stable/11/sys/vm/vm_pageout.c Wed Jan 10 20:48:21 2018 (r327786) @@ -1768,10 +1768,16 @@ vm_pageout_worker(void *arg) pass++; } else { /* - * Yes. Sleep until pages need to be reclaimed or + * Yes. If threads are still sleeping in VM_WAIT + * then we immediately start a new scan. Otherwise, + * sleep until the next wakeup or until pages need to * have their reference stats updated. */ - if (mtx_sleep(&vm_pageout_wanted, + if (vm_pages_needed) { + mtx_unlock(&vm_page_queue_free_mtx); + if (pass == 0) + pass++; + } else if (mtx_sleep(&vm_pageout_wanted, &vm_page_queue_free_mtx, PDROP | PVM, "psleep", hz) == 0) { PCPU_INC(cnt.v_pdwakeups); @@ -1879,17 +1885,42 @@ vm_pageout(void) } /* - * Unless the free page queue lock is held by the caller, this function - * should be regarded as advisory. Specifically, the caller should - * not msleep() on &vm_cnt.v_free_count following this function unless - * the free page queue lock is held until the msleep() is performed. + * Perform an advisory wakeup of the page daemon. */ void pagedaemon_wakeup(void) { + mtx_assert(&vm_page_queue_free_mtx, MA_NOTOWNED); + if (!vm_pageout_wanted && curthread->td_proc != pageproc) { vm_pageout_wanted = true; wakeup(&vm_pageout_wanted); } +} + +/* + * Wake up the page daemon and wait for it to reclaim free pages. + * + * This function returns with the free queues mutex unlocked. + */ +void +pagedaemon_wait(int pri, const char *wmesg) +{ + + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + + /* + * vm_pageout_wanted may have been set by an advisory wakeup, but if the + * page daemon is running on a CPU, the wakeup will have been lost. + * Thus, deliver a potentially spurious wakeup to ensure that the page + * daemon has been notified of the shortage. + */ + if (!vm_pageout_wanted || !vm_pages_needed) { + vm_pageout_wanted = true; + wakeup(&vm_pageout_wanted); + } + vm_pages_needed = true; + msleep(&vm_cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | pri, + wmesg, 0); } Modified: stable/11/sys/vm/vm_pageout.h ============================================================================== --- stable/11/sys/vm/vm_pageout.h Wed Jan 10 20:39:26 2018 (r327785) +++ stable/11/sys/vm/vm_pageout.h Wed Jan 10 20:48:21 2018 (r327786) @@ -94,11 +94,12 @@ extern bool vm_pages_needed; * Signal pageout-daemon and wait for it. */ -extern void pagedaemon_wakeup(void); +void pagedaemon_wait(int pri, const char *wmesg); +void pagedaemon_wakeup(void); #define VM_WAIT vm_wait() #define VM_WAITPFAULT vm_waitpfault() -extern void vm_wait(void); -extern void vm_waitpfault(void); +void vm_wait(void); +void vm_waitpfault(void); #ifdef _KERNEL int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); From owner-svn-src-all@freebsd.org Wed Jan 10 20:49:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B44CE76158; Wed, 10 Jan 2018 20:49:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6788D6BB90; Wed, 10 Jan 2018 20:49:02 +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 A780F2B4D; Wed, 10 Jan 2018 20:49:01 +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 w0AKn1TV009057; Wed, 10 Jan 2018 20:49:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKn1ce009056; Wed, 10 Jan 2018 20:49:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801102049.w0AKn1ce009056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 10 Jan 2018 20:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327787 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:49:02 -0000 Author: emaste Date: Wed Jan 10 20:49:01 2018 New Revision: 327787 URL: https://svnweb.freebsd.org/changeset/base/327787 Log: Mention switch to ld.lld for amd64 in UPDATING Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 10 20:48:21 2018 (r327786) +++ head/UPDATING Wed Jan 10 20:49:01 2018 (r327787) @@ -52,6 +52,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** 20180110: + LLVM's lld linker is now used as the FreeBSD/amd64 bootstrap linker. + This means it is used to link the kernel and userland libraries and + executables, but is not yet installed as /usr/bin/ld by default. + + To revert to ld.bfd as the bootstrap linker, in /etc/src.conf set + WITHOUT_LLD_BOOTSTRAP=yes + +20180110: On i386, pmtimer has been removed. It's functionality has been folded into apm. It was a nop on ACPI in current for a while now (but was still needed on i386 in FreeBSD 11 and earlier). Users may need to remove it From owner-svn-src-all@freebsd.org Wed Jan 10 20:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59E5EE7622A; Wed, 10 Jan 2018 20:50:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34D566BD0C; Wed, 10 Jan 2018 20:50:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 761062B51; Wed, 10 Jan 2018 20:50:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AKo6ia009156; Wed, 10 Jan 2018 20:50:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKo65b009155; Wed, 10 Jan 2018 20:50:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801102050.w0AKo65b009155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 20:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327788 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 327788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 20:50:07 -0000 Author: pfg Date: Wed Jan 10 20:50:06 2018 New Revision: 327788 URL: https://svnweb.freebsd.org/changeset/base/327788 Log: linuxkpi: Simplify kmalloc_array. kmalloc_array seems what we call mallocarray(9). Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:49:01 2018 (r327787) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:50:06 2018 (r327788) @@ -121,9 +121,7 @@ vmalloc_32(size_t size) static inline void * kmalloc_array(size_t n, size_t size, gfp_t flags) { - if (size != 0 && n > (SIZE_MAX / size)) - return (NULL); - return (malloc(n * size, M_KMALLOC, linux_check_m_flags(flags))); + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } static inline void * From owner-svn-src-all@freebsd.org Wed Jan 10 21:05:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BB8E76E5E; Wed, 10 Jan 2018 21:05:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7456C8BF; Wed, 10 Jan 2018 21:05:47 +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 6E9962EA7; Wed, 10 Jan 2018 21:05:46 +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 w0AL5kZa017094; Wed, 10 Jan 2018 21:05:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AL5kYW017092; Wed, 10 Jan 2018 21:05:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801102105.w0AL5kYW017092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 21:05: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: r327789 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/ufs/ufs X-SVN-Commit-Revision: 327789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:05:47 -0000 Author: markj Date: Wed Jan 10 21:05:46 2018 New Revision: 327789 URL: https://svnweb.freebsd.org/changeset/base/327789 Log: MFC r327525: Add missing newlines to a couple of error messages. Modified: stable/11/sys/ufs/ufs/ufs_lookup.c stable/11/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jan 10 20:50:06 2018 (r327788) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jan 10 21:05:46 2018 (r327789) @@ -1124,8 +1124,9 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); if (error != 0) - vn_printf(dvp, "ufs_direnter: failed to truncate " - "err %d", error); + vn_printf(dvp, + "ufs_direnter: failed to truncate, error %d\n", + error); #ifdef UFS_DIRHASH if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Wed Jan 10 20:50:06 2018 (r327788) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Wed Jan 10 21:05:46 2018 (r327789) @@ -1544,8 +1544,9 @@ unlockout: error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred); if (error != 0) - vn_printf(tdvp, "ufs_rename: failed to truncate " - "err %d", error); + vn_printf(tdvp, + "ufs_rename: failed to truncate, error %d\n", + error); #ifdef UFS_DIRHASH else if (tdp->i_dirhash != NULL) ufsdirhash_dirtrunc(tdp, endoff); From owner-svn-src-all@freebsd.org Wed Jan 10 21:08:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D183E770BF; Wed, 10 Jan 2018 21:08:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4F076CA99; Wed, 10 Jan 2018 21:08:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3291A2EA8; Wed, 10 Jan 2018 21:08:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AL8huN017248; Wed, 10 Jan 2018 21:08:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AL8hm8017244; Wed, 10 Jan 2018 21:08:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801102108.w0AL8hm8017244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Jan 2018 21:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327790 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 327790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:08:45 -0000 Author: jhb Date: Wed Jan 10 21:08:43 2018 New Revision: 327790 URL: https://svnweb.freebsd.org/changeset/base/327790 Log: Set the 'FR' bit in the status register for N32 kernels. This permits N32 hard-float binaries to use 64-bit floating point registers (which is what N32 binaries expect) matching the N64 ABI. Reviewed by: imp, jmallett Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D13830 Modified: head/sys/mips/mips/exception.S head/sys/mips/mips/locore.S head/sys/mips/mips/swtch.S head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Wed Jan 10 21:05:46 2018 (r327789) +++ head/sys/mips/mips/exception.S Wed Jan 10 21:08:43 2018 (r327790) @@ -1110,7 +1110,7 @@ NESTED(MipsFPTrap, CALLFRAME_SIZ, ra) REG_S ra, CALLFRAME_RA(sp) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) -#if defined(__mips_n64) +#if defined(__mips_n32) || defined(__mips_n64) or t1, t0, MIPS_SR_COP_1_BIT | MIPS_SR_FR #else or t1, t0, MIPS_SR_COP_1_BIT Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Wed Jan 10 21:05:46 2018 (r327789) +++ head/sys/mips/mips/locore.S Wed Jan 10 21:08:43 2018 (r327790) @@ -117,8 +117,11 @@ VECTOR(_locore, unknown) * Enable FPU */ li t1, MIPS_SR_COP_1_BIT +#if defined(__mips_n32) || defined(__mips_n64) + or t1, MIPS_SR_FR +#endif #ifdef __mips_n64 - or t1, MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS_SR_FR + or t1, MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX #endif #endif /* Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Wed Jan 10 21:05:46 2018 (r327789) +++ head/sys/mips/mips/swtch.S Wed Jan 10 21:08:43 2018 (r327790) @@ -416,7 +416,7 @@ LEAF(MipsSwitchFPState) .set hardfloat mfc0 t1, MIPS_COP_0_STATUS # Save old SR HAZARD_DELAY -#if defined(__mips_n64) +#if defined(__mips_n32) || defined(__mips_n64) or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor #else or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor @@ -546,7 +546,7 @@ LEAF(MipsFPID) .set hardfloat mfc0 t1, MIPS_COP_0_STATUS # Save the status register. HAZARD_DELAY -#if defined(__mips_n64) +#if defined(__mips_n32) || defined(__mips_n64) or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR #else or t0, t1, MIPS_SR_COP_1_BIT @@ -585,7 +585,7 @@ LEAF(MipsSaveCurFPState) PTR_L a0, TD_PCB(a0) # get pointer to pcb for thread mfc0 t1, MIPS_COP_0_STATUS # Disable interrupts and HAZARD_DELAY -#if defined(__mips_n64) +#if defined(__mips_n32) || defined(__mips_n64) or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor #else or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Jan 10 21:05:46 2018 (r327789) +++ head/sys/mips/mips/trap.c Wed Jan 10 21:08:43 2018 (r327790) @@ -983,7 +983,7 @@ dofault: addr = trapframe->pc; MipsSwitchFPState(PCPU_GET(fpcurthread), td->td_frame); PCPU_SET(fpcurthread, td); -#if defined(__mips_n64) +#if defined(__mips_n32) || defined(__mips_n64) td->td_frame->sr |= MIPS_SR_COP_1_BIT | MIPS_SR_FR; #else td->td_frame->sr |= MIPS_SR_COP_1_BIT; From owner-svn-src-all@freebsd.org Wed Jan 10 21:17:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 929EFE7776B; Wed, 10 Jan 2018 21:17:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3376D104; Wed, 10 Jan 2018 21:17:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A939E3044; Wed, 10 Jan 2018 21:17:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ALHX2Q021577; Wed, 10 Jan 2018 21:17:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALHXHN021574; Wed, 10 Jan 2018 21:17:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801102117.w0ALHXHN021574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 21:17:33 +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: r327791 - stable/11/libexec/rpc.sprayd X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/libexec/rpc.sprayd X-SVN-Commit-Revision: 327791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:17:34 -0000 Author: pfg Date: Wed Jan 10 21:17:33 2018 New Revision: 327791 URL: https://svnweb.freebsd.org/changeset/base/327791 Log: MFC r327289: rpc.sprayd: Bring some changes from NetBSD. Most notable, other than some style issues: CVS 1.11: do not use LOG_CONS. CVS 1.13: consistently use exit instead of return in main(). use LOG_WARNING instead of LOG_ERR for non critical errors. Obtained from: NetBSD Modified: stable/11/libexec/rpc.sprayd/rpc.sprayd.8 stable/11/libexec/rpc.sprayd/sprayd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rpc.sprayd/rpc.sprayd.8 ============================================================================== --- stable/11/libexec/rpc.sprayd/rpc.sprayd.8 Wed Jan 10 21:08:43 2018 (r327790) +++ stable/11/libexec/rpc.sprayd/rpc.sprayd.8 Wed Jan 10 21:17:33 2018 (r327791) @@ -1,3 +1,4 @@ +.\" $NetBSD: rpc.sprayd.8,v 1.9 2003/02/25 10:34:50 wiz Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -29,11 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 1994 +.Dd December 27, 2017 .Dt RPC.SPRAYD 8 .Os .Sh NAME -.Nm rpc.sprayd +.Nm rpc.sprayd , +.Nm sprayd .Nd spray server .Sh SYNOPSIS .Nm /usr/libexec/rpc.sprayd Modified: stable/11/libexec/rpc.sprayd/sprayd.c ============================================================================== --- stable/11/libexec/rpc.sprayd/sprayd.c Wed Jan 10 21:08:43 2018 (r327790) +++ stable/11/libexec/rpc.sprayd/sprayd.c Wed Jan 10 21:17:33 2018 (r327791) @@ -1,3 +1,5 @@ +/* $NetBSD: sprayd.c,v 1.14 2006/05/09 20:18:07 mrg Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -62,7 +64,7 @@ static int from_inetd = 1; void cleanup(int sig __unused) { - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); exit(0); } @@ -91,17 +93,17 @@ main(int argc, char *argv[]) if (!from_inetd) { daemon(0, 0); - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); - (void) signal(SIGINT, cleanup); - (void) signal(SIGTERM, cleanup); - (void) signal(SIGHUP, cleanup); + (void)signal(SIGINT, cleanup); + (void)signal(SIGTERM, cleanup); + (void)signal(SIGHUP, cleanup); } else { - (void) signal(SIGALRM, die); + (void)signal(SIGALRM, die); alarm(TIMEOUT); } - openlog("rpc.sprayd", LOG_CONS|LOG_PID, LOG_DAEMON); + openlog("rpc.sprayd", LOG_PID, LOG_DAEMON); if (from_inetd) { transp = svc_tli_create(0, NULL, NULL, 0, 0); @@ -118,7 +120,7 @@ main(int argc, char *argv[]) syslog(LOG_ERR, "unable to register (SPRAYPROG, SPRAYVERS, %s)", (!from_inetd)?"udp":"(inetd)"); - return 1; + exit(1); } svc_run(); @@ -136,7 +138,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) switch (rqstp->rq_proc) { case SPRAYPROC_CLEAR: scum.counter = 0; - (void) gettimeofday(&clear, 0); + (void)gettimeofday(&clear, 0); /*FALLTHROUGH*/ case NULLPROC: @@ -148,7 +150,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) return; case SPRAYPROC_GET: - (void) gettimeofday(&get, 0); + (void)gettimeofday(&get, 0); timersub(&get, &clear, &get); scum.clock.sec = get.tv_sec; scum.clock.usec = get.tv_usec; @@ -161,6 +163,6 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, &scum)) { svcerr_systemerr(transp); - syslog(LOG_ERR, "bad svc_sendreply"); + syslog(LOG_WARNING, "bad svc_sendreply"); } } From owner-svn-src-all@freebsd.org Wed Jan 10 21:18:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC24DE7785C; Wed, 10 Jan 2018 21:18:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 873B96D262; Wed, 10 Jan 2018 21:18:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEF173045; Wed, 10 Jan 2018 21:18:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ALIkUU021661; Wed, 10 Jan 2018 21:18:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALIkMi021660; Wed, 10 Jan 2018 21:18:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801102118.w0ALIkMi021660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 10 Jan 2018 21:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327792 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:18:47 -0000 Author: jhb Date: Wed Jan 10 21:18:46 2018 New Revision: 327792 URL: https://svnweb.freebsd.org/changeset/base/327792 Log: Don't store shadow copies of per-process AIO limits. Previously the AIO subsystem would save a snapshot of the currently configured per-process limits the first time a process used AIO. The process would continue to use the snapshotted limits ignoring any changes to the global limits during the rest of its lifetime. This change removes the snapshotted values and changes the AIO code to always check the global values which can be toggled at runtime. This means an administrator can now change the effective limits of existing processes. This is more consistent with how other limits configured via sysctl work in FreeBSD. Reviewed by: asomers, kib MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13819 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Jan 10 21:17:33 2018 (r327791) +++ head/sys/kern/vfs_aio.c Wed Jan 10 21:18:46 2018 (r327792) @@ -166,16 +166,16 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, aiod_lifetime, CTLFLAG_ static int max_aio_per_proc = MAX_AIO_PER_PROC; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_per_proc, CTLFLAG_RW, &max_aio_per_proc, 0, - "Maximum active aio requests per process (stored in the process)"); + "Maximum active aio requests per process"); static int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue_per_proc, CTLFLAG_RW, &max_aio_queue_per_proc, 0, - "Maximum queued aio requests per process (stored in the process)"); + "Maximum queued aio requests per process"); static int max_buf_aio = MAX_BUF_AIO; SYSCTL_INT(_vfs_aio, OID_AUTO, max_buf_aio, CTLFLAG_RW, &max_buf_aio, 0, - "Maximum buf aio requests per process (stored in the process)"); + "Maximum buf aio requests per process"); /* * Though redundant with vfs.aio.max_aio_queue_per_proc, POSIX requires @@ -268,11 +268,8 @@ struct aioliojob { struct kaioinfo { struct mtx kaio_mtx; /* the lock to protect this struct */ int kaio_flags; /* (a) per process kaio flags */ - int kaio_maxactive_count; /* (*) maximum number of AIOs */ int kaio_active_count; /* (c) number of currently used AIOs */ - int kaio_qallowed_count; /* (*) maxiumu size of AIO queue */ int kaio_count; /* (a) size of AIO queue */ - int kaio_ballowed_count; /* (*) maximum number of buffers */ int kaio_buffer_count; /* (a) number of physio buffers */ TAILQ_HEAD(,kaiocb) kaio_all; /* (a) all AIOs in a process */ TAILQ_HEAD(,kaiocb) kaio_done; /* (a) done queue for process */ @@ -445,11 +442,8 @@ aio_init_aioinfo(struct proc *p) ki = uma_zalloc(kaio_zone, M_WAITOK); mtx_init(&ki->kaio_mtx, "aiomtx", NULL, MTX_DEF | MTX_NEW); ki->kaio_flags = 0; - ki->kaio_maxactive_count = max_aio_per_proc; ki->kaio_active_count = 0; - ki->kaio_qallowed_count = max_aio_queue_per_proc; ki->kaio_count = 0; - ki->kaio_ballowed_count = max_buf_aio; ki->kaio_buffer_count = 0; TAILQ_INIT(&ki->kaio_all); TAILQ_INIT(&ki->kaio_done); @@ -708,7 +702,7 @@ restart: userp = job->userproc; ki = userp->p_aioinfo; - if (ki->kaio_active_count < ki->kaio_maxactive_count) { + if (ki->kaio_active_count < max_aio_per_proc) { TAILQ_REMOVE(&aio_jobs, job, list); if (!aio_clear_cancel_function(job)) goto restart; @@ -1270,7 +1264,7 @@ aio_qphysio(struct proc *p, struct kaiocb *job) error = -1; goto unref; } - if (ki->kaio_buffer_count >= ki->kaio_ballowed_count) { + if (ki->kaio_buffer_count >= max_buf_aio) { error = EAGAIN; goto unref; } @@ -1479,7 +1473,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru ops->store_kernelinfo(ujob, -1); if (num_queue_count >= max_queue_count || - ki->kaio_count >= ki->kaio_qallowed_count) { + ki->kaio_count >= max_aio_queue_per_proc) { ops->store_error(ujob, EAGAIN); return (EAGAIN); } @@ -1774,8 +1768,7 @@ aio_kick_nowait(struct proc *userp) aiop->aioprocflags &= ~AIOP_FREE; wakeup(aiop->aioproc); } else if (num_aio_resv_start + num_aio_procs < max_aio_procs && - ki->kaio_active_count + num_aio_resv_start < - ki->kaio_maxactive_count) { + ki->kaio_active_count + num_aio_resv_start < max_aio_per_proc) { taskqueue_enqueue(taskqueue_aiod_kick, &ki->kaio_task); } } @@ -1794,8 +1787,7 @@ retryproc: aiop->aioprocflags &= ~AIOP_FREE; wakeup(aiop->aioproc); } else if (num_aio_resv_start + num_aio_procs < max_aio_procs && - ki->kaio_active_count + num_aio_resv_start < - ki->kaio_maxactive_count) { + ki->kaio_active_count + num_aio_resv_start < max_aio_per_proc) { num_aio_resv_start++; mtx_unlock(&aio_job_mtx); error = aio_newproc(&num_aio_resv_start); From owner-svn-src-all@freebsd.org Wed Jan 10 21:24:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87908E77E30; Wed, 10 Jan 2018 21:24:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 603B76D943; Wed, 10 Jan 2018 21:24:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4A8F31D9; Wed, 10 Jan 2018 21:24:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ALO3S6025879; Wed, 10 Jan 2018 21:24:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALO3KV025877; Wed, 10 Jan 2018 21:24:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801102124.w0ALO3KV025877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 21:24:03 +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: r327793 - stable/10/libexec/rpc.sprayd X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/libexec/rpc.sprayd X-SVN-Commit-Revision: 327793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:24:04 -0000 Author: pfg Date: Wed Jan 10 21:24:03 2018 New Revision: 327793 URL: https://svnweb.freebsd.org/changeset/base/327793 Log: MFC r327289: rpc.sprayd: Bring some changes from NetBSD. Most notable, other than some style issues: CVS 1.11: do not use LOG_CONS. CVS 1.13: consistently use exit instead of return in main(). use LOG_WARNING instead of LOG_ERR for non critical errors. Obtained from: NetBSD Modified: stable/10/libexec/rpc.sprayd/rpc.sprayd.8 stable/10/libexec/rpc.sprayd/sprayd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rpc.sprayd/rpc.sprayd.8 ============================================================================== --- stable/10/libexec/rpc.sprayd/rpc.sprayd.8 Wed Jan 10 21:18:46 2018 (r327792) +++ stable/10/libexec/rpc.sprayd/rpc.sprayd.8 Wed Jan 10 21:24:03 2018 (r327793) @@ -1,3 +1,4 @@ +.\" $NetBSD: rpc.sprayd.8,v 1.9 2003/02/25 10:34:50 wiz Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -29,11 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 1994 +.Dd December 27, 2017 .Dt RPC.SPRAYD 8 .Os .Sh NAME -.Nm rpc.sprayd +.Nm rpc.sprayd , +.Nm sprayd .Nd spray server .Sh SYNOPSIS .Nm /usr/libexec/rpc.sprayd Modified: stable/10/libexec/rpc.sprayd/sprayd.c ============================================================================== --- stable/10/libexec/rpc.sprayd/sprayd.c Wed Jan 10 21:18:46 2018 (r327792) +++ stable/10/libexec/rpc.sprayd/sprayd.c Wed Jan 10 21:24:03 2018 (r327793) @@ -1,3 +1,5 @@ +/* $NetBSD: sprayd.c,v 1.14 2006/05/09 20:18:07 mrg Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -62,7 +64,7 @@ static int from_inetd = 1; void cleanup(int sig __unused) { - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); exit(0); } @@ -91,17 +93,17 @@ main(int argc, char *argv[]) if (!from_inetd) { daemon(0, 0); - (void) rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); + (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); - (void) signal(SIGINT, cleanup); - (void) signal(SIGTERM, cleanup); - (void) signal(SIGHUP, cleanup); + (void)signal(SIGINT, cleanup); + (void)signal(SIGTERM, cleanup); + (void)signal(SIGHUP, cleanup); } else { - (void) signal(SIGALRM, die); + (void)signal(SIGALRM, die); alarm(TIMEOUT); } - openlog("rpc.sprayd", LOG_CONS|LOG_PID, LOG_DAEMON); + openlog("rpc.sprayd", LOG_PID, LOG_DAEMON); if (from_inetd) { transp = svc_tli_create(0, NULL, NULL, 0, 0); @@ -118,7 +120,7 @@ main(int argc, char *argv[]) syslog(LOG_ERR, "unable to register (SPRAYPROG, SPRAYVERS, %s)", (!from_inetd)?"udp":"(inetd)"); - return 1; + exit(1); } svc_run(); @@ -136,7 +138,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) switch (rqstp->rq_proc) { case SPRAYPROC_CLEAR: scum.counter = 0; - (void) gettimeofday(&clear, 0); + (void)gettimeofday(&clear, 0); /*FALLTHROUGH*/ case NULLPROC: @@ -148,7 +150,7 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) return; case SPRAYPROC_GET: - (void) gettimeofday(&get, 0); + (void)gettimeofday(&get, 0); timersub(&get, &clear, &get); scum.clock.sec = get.tv_sec; scum.clock.usec = get.tv_usec; @@ -161,6 +163,6 @@ spray_service(struct svc_req *rqstp, SVCXPRT *transp) if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, &scum)) { svcerr_systemerr(transp); - syslog(LOG_ERR, "bad svc_sendreply"); + syslog(LOG_WARNING, "bad svc_sendreply"); } } From owner-svn-src-all@freebsd.org Wed Jan 10 21:37:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 949E2E786FF; Wed, 10 Jan 2018 21:37:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5016E03A; Wed, 10 Jan 2018 21:37:12 +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 A650933BD; Wed, 10 Jan 2018 21:37:11 +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 w0ALbBHr029985; Wed, 10 Jan 2018 21:37:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALbBUs029984; Wed, 10 Jan 2018 21:37:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801102137.w0ALbBUs029984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 21:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327794 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 327794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:37:12 -0000 Author: markj Date: Wed Jan 10 21:37:11 2018 New Revision: 327794 URL: https://svnweb.freebsd.org/changeset/base/327794 Log: Fix an off-by-one in dt_opt_setenv(). The bug would cause incorrect behaviour when attempting to override an already set environment variable with -x setenv, as long as the variable is not the last one in the array. Reported by: Samuel Lepetit MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Wed Jan 10 21:24:03 2018 (r327793) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Wed Jan 10 21:37:11 2018 (r327794) @@ -415,7 +415,7 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint { char **p; char *var; - int i; + int nvars; /* * We can't effectively set environment variables from #pragma lines @@ -430,7 +430,7 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint if (!option && strchr(arg, '=') != NULL) return (dt_set_errno(dtp, EDT_BADOPTVAL)); - for (i = 1, p = dtp->dt_proc_env; *p != NULL; i++, p++) + for (nvars = 0, p = dtp->dt_proc_env; *p != NULL; nvars++, p++) continue; for (p = dtp->dt_proc_env; *p != NULL; p++) { @@ -439,9 +439,9 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint var = *p + strlen(*p); if (strncmp(*p, arg, var - *p) == 0) { dt_free(dtp, *p); - *p = dtp->dt_proc_env[i - 1]; - dtp->dt_proc_env[i - 1] = NULL; - i--; + *p = dtp->dt_proc_env[nvars - 1]; + dtp->dt_proc_env[nvars - 1] = NULL; + nvars--; } } @@ -449,17 +449,18 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint if ((var = strdup(arg)) == NULL) return (dt_set_errno(dtp, EDT_NOMEM)); - if ((p = dt_alloc(dtp, sizeof (char *) * (i + 1))) == NULL) { + nvars++; + if ((p = dt_alloc(dtp, sizeof(char *) * (nvars + 1))) == NULL) { dt_free(dtp, var); return (dt_set_errno(dtp, EDT_NOMEM)); } - bcopy(dtp->dt_proc_env, p, sizeof (char *) * i); + bcopy(dtp->dt_proc_env, p, sizeof(char *) * nvars); dt_free(dtp, dtp->dt_proc_env); dtp->dt_proc_env = p; - dtp->dt_proc_env[i - 1] = var; - dtp->dt_proc_env[i] = NULL; + dtp->dt_proc_env[nvars - 1] = var; + dtp->dt_proc_env[nvars] = NULL; } return (0); From owner-svn-src-all@freebsd.org Wed Jan 10 21:40:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D702E78936; Wed, 10 Jan 2018 21:40:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0AA66E23F; Wed, 10 Jan 2018 21:40:37 +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 BDDDB33C6; Wed, 10 Jan 2018 21:40:36 +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 w0ALeaoR030150; Wed, 10 Jan 2018 21:40:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALeag8030147; Wed, 10 Jan 2018 21:40:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801102140.w0ALeag8030147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 10 Jan 2018 21:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327795 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/env usr.sbin/dtrace/tests/common/env X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/env usr.sbin/dtrace/tests/common/env X-SVN-Commit-Revision: 327795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:40:38 -0000 Author: markj Date: Wed Jan 10 21:40:36 2018 New Revision: 327795 URL: https://svnweb.freebsd.org/changeset/base/327795 Log: Add a regression test for r327794. MFC after: 2 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out Modified: head/cddl/usr.sbin/dtrace/tests/common/env/Makefile Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh Wed Jan 10 21:40:36 2018 (r327795) @@ -0,0 +1,34 @@ +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Reset an environment variable we already know to be set. +# Regression test for FreeBSD r327794. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xsetenv=PATH=/foo -c '/usr/bin/printenv PATH' + +exit $? Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out Wed Jan 10 21:40:36 2018 (r327795) @@ -0,0 +1,2 @@ +/foo + Modified: head/cddl/usr.sbin/dtrace/tests/common/env/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/env/Makefile Wed Jan 10 21:37:11 2018 (r327794) +++ head/cddl/usr.sbin/dtrace/tests/common/env/Makefile Wed Jan 10 21:40:36 2018 (r327795) @@ -15,6 +15,8 @@ ${PACKAGE}FILES= \ tst.setenv1.ksh.out \ tst.setenv2.ksh \ tst.setenv2.ksh.out \ + tst.setenv3.ksh \ + tst.setenv3.ksh.out \ tst.unsetenv1.ksh \ tst.unsetenv1.ksh.out \ tst.unsetenv2.ksh \ From owner-svn-src-all@freebsd.org Wed Jan 10 21:49:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61693E7914A; Wed, 10 Jan 2018 21:49: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21B4B6E940; Wed, 10 Jan 2018 21:49: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 5EE7F38D4; Wed, 10 Jan 2018 21:49: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 w0ALnkTF034412; Wed, 10 Jan 2018 21:49:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALnjwa034409; Wed, 10 Jan 2018 21:49:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801102149.w0ALnjwa034409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 10 Jan 2018 21:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327796 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 327796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:49:47 -0000 Author: cem Date: Wed Jan 10 21:49:45 2018 New Revision: 327796 URL: https://svnweb.freebsd.org/changeset/base/327796 Log: mallocarray(9): panic if the requested allocation would overflow Additionally, move the overflow check logic out to WOULD_OVERFLOW() for consumers to have a common means of testing for overflowing allocations. WOULD_OVERFLOW() should be a secondary check -- on 64-bit platforms, just because an allocation won't overflow size_t does not mean it is a sane size to request. Callers should be imposing reasonable allocation limits far, far, below overflow. Discussed with: emaste, jhb, kp Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/malloc.9 head/sys/kern/kern_malloc.c head/sys/sys/malloc.h Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Wed Jan 10 21:40:36 2018 (r327795) +++ head/share/man/man9/malloc.9 Wed Jan 10 21:49:45 2018 (r327796) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd November 19, 2015 +.Dd January 10, 2018 .Dt MALLOC 9 .Os .Sh NAME @@ -154,6 +154,7 @@ If the request cannot be immediately fulfilled, the cu to sleep to wait for resources to be released by other processes. The .Fn malloc , +.Fn mallocarray , .Fn realloc , and .Fn reallocf @@ -162,15 +163,13 @@ functions cannot return if .Dv M_WAITOK is specified. -The -.Fn mallocarray -function can return -.Dv NULL if the multiplication of .Fa nmemb and .Fa size -would cause an integer overflow. +would cause an integer overflow, the +.Fn mallocarray +function induces a panic. .It Dv M_USE_RESERVE Indicates that the system can use its reserve of memory to satisfy the request. Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Wed Jan 10 21:40:36 2018 (r327795) +++ head/sys/kern/kern_malloc.c Wed Jan 10 21:49:45 2018 (r327796) @@ -535,18 +535,12 @@ malloc(unsigned long size, struct malloc_type *mtp, in return ((void *) va); } -/* - * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX - * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW - */ -#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 8 / 2)) void * mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) { - if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && - nmemb > 0 && SIZE_MAX / nmemb < size) - return (NULL); + if (WOULD_OVERFLOW(nmemb, size)) + panic("mallocarray: %zu * %zu overflowed", nmemb, size); return (malloc(size * nmemb, type, flags)); } Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Wed Jan 10 21:40:36 2018 (r327795) +++ head/sys/sys/malloc.h Wed Jan 10 21:49:45 2018 (r327796) @@ -41,6 +41,7 @@ #include #include #include +#include #define MINALLOCSIZE UMA_SMALLEST_UNIT @@ -192,6 +193,20 @@ void *reallocf(void *addr, unsigned long size, struct int flags) __result_use_check __alloc_size(2); struct malloc_type *malloc_desc2type(const char *desc); + +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 8 / 2)) +static inline bool +WOULD_OVERFLOW(size_t nmemb, size_t size) +{ + + return ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + nmemb > 0 && __SIZE_T_MAX / nmemb < size); +} +#undef MUL_NO_OVERFLOW #endif /* _KERNEL */ #endif /* !_SYS_MALLOC_H_ */ From owner-svn-src-all@freebsd.org Wed Jan 10 21:59:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D791FE7983E; Wed, 10 Jan 2018 21:59:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B22336EECB; Wed, 10 Jan 2018 21:59:22 +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 07E093B73; Wed, 10 Jan 2018 21:59:22 +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 w0ALxLgH038444; Wed, 10 Jan 2018 21:59:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ALxLb5038443; Wed, 10 Jan 2018 21:59:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801102159.w0ALxLb5038443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 10 Jan 2018 21:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r327797 - stable/9/gnu/usr.bin/binutils/ld X-SVN-Group: stable-9 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/9/gnu/usr.bin/binutils/ld X-SVN-Commit-Revision: 327797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 21:59:22 -0000 Author: bdrewery Date: Wed Jan 10 21:59:21 2018 New Revision: 327797 URL: https://svnweb.freebsd.org/changeset/base/327797 Log: MFC r289410: Avoid warning race with creating 'ldscripts' directory during build. Modified: stable/9/gnu/usr.bin/binutils/ld/genscripts.sh Directory Properties: stable/9/gnu/usr.bin/binutils/ (props changed) Modified: stable/9/gnu/usr.bin/binutils/ld/genscripts.sh ============================================================================== --- stable/9/gnu/usr.bin/binutils/ld/genscripts.sh Wed Jan 10 21:49:45 2018 (r327796) +++ stable/9/gnu/usr.bin/binutils/ld/genscripts.sh Wed Jan 10 21:59:21 2018 (r327797) @@ -50,8 +50,7 @@ fi if test -d ldscripts; then true else - rm -f ldscripts - mkdir ldscripts + mkdir -p ldscripts fi # Set some flags for the emultempl scripts. USE_LIBPATH will From owner-svn-src-all@freebsd.org Wed Jan 10 22:19:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C0CE7A52F; Wed, 10 Jan 2018 22:19:13 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 441A26FC78; Wed, 10 Jan 2018 22:19:13 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C85C3EF6; Wed, 10 Jan 2018 22:19:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AMJCb9046924; Wed, 10 Jan 2018 22:19:12 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AMJC8L046922; Wed, 10 Jan 2018 22:19:12 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201801102219.w0AMJC8L046922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 10 Jan 2018 22:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327798 - head/sys/powerpc/powermac X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/powerpc/powermac X-SVN-Commit-Revision: 327798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 22:19:13 -0000 Author: landonf Date: Wed Jan 10 22:19:11 2018 New Revision: 327798 URL: https://svnweb.freebsd.org/changeset/base/327798 Log: Fix minor locking issues in the Power Mac Uninorth PCI bridge driver. - Call resource_int_value() once during attach, rather than within the pci_(read|write)_config() code path; this avoids taking a blocking mutex to read kenv variables. - Use a spin lock to protect non-atomic config space accesses; this matches the behavior of Darwin's AppleMacRiscPCI driver. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D13839 Modified: head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Wed Jan 10 21:59:21 2018 (r327797) +++ head/sys/powerpc/powermac/uninorthpci.c Wed Jan 10 22:19:11 2018 (r327798) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -134,13 +136,17 @@ uninorth_attach(device_t dev) { struct uninorth_softc *sc; const char *compatible; + const char *name; phandle_t node; uint32_t reg[3]; uint64_t regbase; cell_t acells; + int unit; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + name = device_get_name(dev); + unit = device_get_unit(dev); if (OF_getprop(node, "reg", reg, sizeof(reg)) < 8) return (ENXIO); @@ -164,6 +170,11 @@ uninorth_attach(device_t dev) sc->sc_addr = (vm_offset_t)pmap_mapdev(regbase + 0x800000, PAGE_SIZE); sc->sc_data = (vm_offset_t)pmap_mapdev(regbase + 0xc00000, PAGE_SIZE); + if (resource_int_value(name, unit, "skipslot", &sc->sc_skipslot) != 0) + sc->sc_skipslot = -1; + + mtx_init(&sc->sc_cfg_mtx, "uninorth pcicfg", NULL, MTX_SPIN); + return (ofw_pci_attach(dev)); } @@ -173,25 +184,29 @@ uninorth_read_config(device_t dev, u_int bus, u_int sl { struct uninorth_softc *sc; vm_offset_t caoff; + u_int32_t val; sc = device_get_softc(dev); caoff = sc->sc_data + (reg & 0x07); + val = 0xffffffff; + mtx_lock_spin(&sc->sc_cfg_mtx); if (uninorth_enable_config(sc, bus, slot, func, reg) != 0) { switch (width) { case 1: - return (in8rb(caoff)); + val = in8rb(caoff); break; case 2: - return (in16rb(caoff)); + val = in16rb(caoff); break; case 4: - return (in32rb(caoff)); + val = in32rb(caoff); break; } } + mtx_unlock_spin(&sc->sc_cfg_mtx); - return (0xffffffff); + return (val); } static void @@ -204,6 +219,7 @@ uninorth_write_config(device_t dev, u_int bus, u_int s sc = device_get_softc(dev); caoff = sc->sc_data + (reg & 0x07); + mtx_lock_spin(&sc->sc_cfg_mtx); if (uninorth_enable_config(sc, bus, slot, func, reg)) { switch (width) { case 1: @@ -217,6 +233,7 @@ uninorth_write_config(device_t dev, u_int bus, u_int s break; } } + mtx_unlock_spin(&sc->sc_cfg_mtx); } static int @@ -224,13 +241,11 @@ uninorth_enable_config(struct uninorth_softc *sc, u_in u_int func, u_int reg) { uint32_t cfgval; - uint32_t pass; - if (resource_int_value(device_get_name(sc->pci_sc.sc_dev), - device_get_unit(sc->pci_sc.sc_dev), "skipslot", &pass) == 0) { - if (pass == slot) - return (0); - } + mtx_assert(&sc->sc_cfg_mtx, MA_OWNED); + + if (sc->sc_skipslot == slot) + return (0); /* * Issue type 0 configuration space accesses for the root bus. Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Wed Jan 10 21:59:21 2018 (r327797) +++ head/sys/powerpc/powermac/uninorthvar.h Wed Jan 10 22:19:11 2018 (r327798) @@ -39,6 +39,8 @@ struct uninorth_softc { vm_offset_t sc_addr; vm_offset_t sc_data; int sc_ver; + int sc_skipslot; + struct mtx sc_cfg_mtx; }; struct unin_chip_softc { From owner-svn-src-all@freebsd.org Wed Jan 10 22:19:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE11E7A56C; Wed, 10 Jan 2018 22:19:25 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE946FD8C; Wed, 10 Jan 2018 22:19:24 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A10B3EF8; Wed, 10 Jan 2018 22:19:24 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AMJNEt046977; Wed, 10 Jan 2018 22:19:23 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AMJNs4046976; Wed, 10 Jan 2018 22:19:23 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201801102219.w0AMJNs4046976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Wed, 10 Jan 2018 22:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r327799 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: matthew X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 327799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 22:19:26 -0000 Author: matthew (ports committer) Date: Wed Jan 10 22:19:23 2018 New Revision: 327799 URL: https://svnweb.freebsd.org/changeset/base/327799 Log: Take in kevlo's commit bit, at his own request. Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Jan 10 22:19:11 2018 (r327798) +++ svnadmin/conf/access Wed Jan 10 22:19:23 2018 (r327799) @@ -126,7 +126,6 @@ kan karels ken kevans -kevlo kib kibab kp From owner-svn-src-all@freebsd.org Wed Jan 10 22:20:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C1CE7A6B5; Wed, 10 Jan 2018 22:20:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E80416FF77; Wed, 10 Jan 2018 22:20:50 +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 3C1943F17; Wed, 10 Jan 2018 22:20:50 +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 w0AMKoEs047821; Wed, 10 Jan 2018 22:20:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AMKoLC047797; Wed, 10 Jan 2018 22:20:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801102220.w0AMKoLC047797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 10 Jan 2018 22:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327800 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 327800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 22:20:51 -0000 Author: cem Date: Wed Jan 10 22:20:49 2018 New Revision: 327800 URL: https://svnweb.freebsd.org/changeset/base/327800 Log: malloc.9: Fix minor typo from rewording in r327796 Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/malloc.9 Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Wed Jan 10 22:19:23 2018 (r327799) +++ head/share/man/man9/malloc.9 Wed Jan 10 22:20:49 2018 (r327800) @@ -163,7 +163,7 @@ functions cannot return if .Dv M_WAITOK is specified. -if the multiplication of +If the multiplication of .Fa nmemb and .Fa size From owner-svn-src-all@freebsd.org Wed Jan 10 22:41:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B650E7B365; Wed, 10 Jan 2018 22:41:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA67A70C8A; Wed, 10 Jan 2018 22:41:01 +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 273FD42D2; Wed, 10 Jan 2018 22:41:01 +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 w0AMf0U3055831; Wed, 10 Jan 2018 22:41:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AMf0Xc055829; Wed, 10 Jan 2018 22:41:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801102241.w0AMf0Xc055829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 10 Jan 2018 22:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327801 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 22:41:02 -0000 Author: cem Date: Wed Jan 10 22:41:00 2018 New Revision: 327801 URL: https://svnweb.freebsd.org/changeset/base/327801 Log: x86: Document purpose of _safe variants of {rd,wr}msr() Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed Jan 10 22:20:49 2018 (r327800) +++ head/sys/amd64/amd64/support.S Wed Jan 10 22:41:00 2018 (r327801) @@ -763,7 +763,8 @@ ENTRY(longjmp) END(longjmp) /* - * Support for reading MSRs in the safe manner. + * Support for reading MSRs in the safe manner. (Instead of panic on #gp, + * return an error.) */ ENTRY(rdmsr_safe) /* int rdmsr_safe(u_int msr, uint64_t *data) */ @@ -783,7 +784,8 @@ ENTRY(rdmsr_safe) ret /* - * Support for writing MSRs in the safe manner. + * Support for writing MSRs in the safe manner. (Instead of panic on #gp, + * return an error.) */ ENTRY(wrmsr_safe) /* int wrmsr_safe(u_int msr, uint64_t data) */ Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed Jan 10 22:20:49 2018 (r327800) +++ head/sys/i386/i386/support.s Wed Jan 10 22:41:00 2018 (r327801) @@ -790,7 +790,8 @@ ENTRY(longjmp) END(longjmp) /* - * Support for reading MSRs in the safe manner. + * Support for reading MSRs in the safe manner. (Instead of panic on #gp, + * return an error.) */ ENTRY(rdmsr_safe) /* int rdmsr_safe(u_int msr, uint64_t *data) */ @@ -810,7 +811,8 @@ ENTRY(rdmsr_safe) ret /* - * Support for writing MSRs in the safe manner. + * Support for writing MSRs in the safe manner. (Instead of panic on #gp, + * return an error.) */ ENTRY(wrmsr_safe) /* int wrmsr_safe(u_int msr, uint64_t data) */ From owner-svn-src-all@freebsd.org Wed Jan 10 23:15:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80D16E7D00B for ; Wed, 10 Jan 2018 23:15:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F49A72451 for ; Wed, 10 Jan 2018 23:15:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x234.google.com with SMTP id r78so2052307wme.0 for ; Wed, 10 Jan 2018 15:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=FIAMWdC0wvtcQyMSQ61FebtVcC32SrYSLEVK7fbhgIc=; b=T+ivfSG3ICxVilXqT/KdWSObmKD+UgZFGK8rDilZ7qV5FPFpOKQqwp9M29HxG7Ja63 bi7q51ty9U9F2rKT3lUMy6epYvrszjFjoz/N5Uj3AUY1AyD79ehf3UkjaNmpsCjg77EM XAzCgFT7Yh6sByg3lDBEAhKetcGRNd20zdz4y5z6ZCSm3Qw57L0+QE8+ATBJEIqfNrrW BVd1fhMDIR4judznXuLSiLmkxlq6h//nMSb8oVS1zDuPnqavFs0OdkX5msCAiju2+dMS yZ3S420jFEbz6+s+XDRAAwkW3qZ2b6khzyysSRJcYfcCAZss4eoezJ5iRzhhUh5oiBnZ J4UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=FIAMWdC0wvtcQyMSQ61FebtVcC32SrYSLEVK7fbhgIc=; b=qD8zE2ZItG/hcS4iKqn+HPV6/4TmMbnCltZHwLKK7qc8TzM5ER6ss25VPgmoHjGPuF CT4OKfovB66SkHJp9zJ01oqw9ycJUHoEpSQt4CJTN5pY+i6PKhcj2A83hmkRVPU6M+zs MAQbI5Gyj/q/CC6Q4V4kq0Ejkz/DPy/lp1pSNFEYI3ZcCIZIkvAcVunaPDQcgek68tyF Z38iuNGemVGxcZiMuibLE/TDWaNlJqzgYHtY7fGTukEXCwJyy4+fP95aEDaB2qZc0OhD 6XpAnIlNiCgE9boi6HAWQC4Y0lScApbwc65dT2Y/s0Sfnz0HByNxSZ5YFelkaqPHg2zG 6JPg== X-Gm-Message-State: AKGB3mJ+yyBCYGgIPBSRhClWPd2Jld3usD5rXBKBD8E18FeOfccKO/cI WG0XsCiml92Bh1A3V5dEXQZi0yWdg2r8+xbFACEm5g== X-Google-Smtp-Source: ACJfBosyhcgLYqHxhhbVvUXLe7+sYC+R4drfecDC+s6lbDEmgLSo8/IA8Qo3soTGH4FMliLAV4jEYF9lw0zT+1sFuTk= X-Received: by 10.80.171.225 with SMTP id u88mr27582522edc.167.1515626153915; Wed, 10 Jan 2018 15:15:53 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.88 with HTTP; Wed, 10 Jan 2018 15:15:53 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> <20180110202442.GC78524@raichu> <20180110203515.GD78524@raichu> From: Warner Losh Date: Wed, 10 Jan 2018 16:15:53 -0700 X-Google-Sender-Auth: IBU_qxRbBjGJD-dLuEq6ASY_XL8 Message-ID: Subject: Re: svn commit: r326964 - head/sys/cam To: Mark Johnston Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 23:15:56 -0000 On Wed, Jan 10, 2018 at 1:38 PM, Warner Losh wrote: > > > On Wed, Jan 10, 2018 at 1:35 PM, Mark Johnston wrote: > >> On Wed, Jan 10, 2018 at 01:32:29PM -0700, Warner Losh wrote: >> > On Wed, Jan 10, 2018 at 1:24 PM, Mark Johnston >> wrote: >> > >> > > On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: >> > > > Author: imp >> > > > Date: Tue Dec 19 04:13:22 2017 >> > > > New Revision: 326964 >> > > > URL: https://svnweb.freebsd.org/changeset/base/326964 >> > > > >> > > > Log: >> > > > When doing a dump, the scheduler is normally not running, so this >> > > > changed worked to capture dumps for me. However, the test for >> > > > SCHEDULER_STOPPED() isn't right. We can also call the dump routine >> > > > from ddb, in which case the scheduler is still running. This >> leads to >> > > > an assertion panic that we're sleeping when we shouldn't. >> Instead, use >> > > > the proper test for dumping or not. This brings us in line with >> other >> > > > places that do special things while we're doing polled I/O like >> this. >> > > > >> > > > Noticed by: pho@ >> > > > Differential Revision: https://reviews.freebsd.org/D13531 >> > > > >> > > > Modified: >> > > > head/sys/cam/cam_periph.c >> > > > >> > > > Modified: head/sys/cam/cam_periph.c >> > > > ============================================================ >> > > ================== >> > > > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 >> (r326963) >> > > > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 >> (r326964) >> > > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); >> > > > #include >> > > > #include >> > > > #include >> > > > +#include >> > > > #include >> > > > #include >> > > > #include >> > > > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, >> > > > struct bintime *starttime; >> > > > struct bintime ltime; >> > > > int error; >> > > > - bool sched_stopped; >> > > > + bool must_poll; >> > > > struct mtx *periph_mtx; >> > > > struct cam_periph *periph; >> > > > uint32_t timeout = 1; >> > > > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, >> > > > devstat_start_transaction(ds, starttime); >> > > > } >> > > > >> > > > - sched_stopped = SCHEDULER_STOPPED(); >> > > > + /* >> > > > + * We must poll the I/O while we're dumping. The scheduler is >> > > normally >> > > > + * stopped for dumping, except when we call doadump from ddb. >> > > While the >> > > > + * scheduler is running in this case, we still need to poll >> the >> > > I/O to >> > > > + * avoid sleeping waiting for the ccb to complete. >> > > > + */ >> > > > + must_poll = dumping; >> > > >> > > Hmm, unfortunately this introduces a new problem: after a panic we >> call >> > > adashutdown() as part of the shutdown_post_sync event. This occurs >> > > before we call doadump(), so dumping == 0 and we don't poll for the >> > > spindown command's completion. But since we've panicked, the scheduler >> > > is stopped, and so we just hang. >> > > >> > >> > So "dumping || SCHEDULER_STOPPED()" then is needed? >> >> It seems so, unfortunately. >> > > OK. Sounds good. I'll make the change today. > https://reviews.freebsd.org/D13845 is up, if anybody wants to take a look. Warner From owner-svn-src-all@freebsd.org Wed Jan 10 23:19:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3106E7D2FB; Wed, 10 Jan 2018 23:19:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6E2E72712; Wed, 10 Jan 2018 23:19:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04DE44992; Wed, 10 Jan 2018 23:19:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ANJWTS072438; Wed, 10 Jan 2018 23:19:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0ANJWYU072437; Wed, 10 Jan 2018 23:19:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801102319.w0ANJWYU072437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 10 Jan 2018 23:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327802 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 327802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 23:19:34 -0000 Author: cem Date: Wed Jan 10 23:19:32 2018 New Revision: 327802 URL: https://svnweb.freebsd.org/changeset/base/327802 Log: Add encrypt+authenticate modes to cryptotest tool Like jhb's cryptocheck (uncommitted so far), express encrypt+authenticate modes as "-a +". Example use with aesni(4) on AMD Zen family: $ ./cryptotest -d aesni0 -a aes256 10000 $((128*1024)) 2.331 sec, 20000 aes256 crypts, 131072 bytes, 1124707930 byte/sec, 8580.8 Mb/sec $ ./cryptotest -d aesni0 -a sha256 10000 $((128*1024)) 1.109 sec, 10000 sha256 crypts, 131072 bytes, 1181577161 byte/sec, 9014.7 Mb/sec $ ./cryptotest -d aesni0 -a aes256+sha256 10000 $((128*1024)) 3.805 sec, 10000 sha256+aes256 crypts, 131072 bytes, 344460116 byte/sec, 2628.0 Mb/sec Reported by: jhb Sponsored by: Dell EMC Isilon Modified: head/tools/tools/crypto/cryptotest.c Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Wed Jan 10 22:41:00 2018 (r327801) +++ head/tools/tools/crypto/cryptotest.c Wed Jan 10 23:19:32 2018 (r327802) @@ -147,6 +147,8 @@ usage(const char* cmd) printf("where algorithm is one of:\n"); printf(" null des 3des (default) blowfish cast skipjack rij\n"); printf(" aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n"); + printf(" or an encryption algorithm concatented with authentication\n"); + printf(" algorithm with '+' in the middle, e.g., aes+sha1.\n"); printf("count is the number of encrypt/decrypt ops to do\n"); printf("size is the number of bytes of text to encrypt+decrypt\n"); printf("\n"); @@ -248,7 +250,7 @@ rdigit(void) } void -runtest(struct alg *alg, int count, int size, u_long cmd, struct timeval *tv) +runtest(struct alg *ealg, struct alg *alg, int count, int size, u_long cmd, struct timeval *tv) { int i, fd = crget(); struct timeval start, stop, dt; @@ -256,18 +258,26 @@ runtest(struct alg *alg, int count, int size, u_long c struct session2_op sop; struct crypt_op cop; char iv[EALG_MAX_BLOCK_LEN]; + char digest[512/8]; + /* Canonicalize 'ealg' to crypt alg and 'alg' to authentication alg. */ + if (ealg == NULL && !alg->ishash) { + ealg = alg; + alg = NULL; + } + bzero(&sop, sizeof(sop)); - if (!alg->ishash) { - sop.keylen = (alg->minkeylen + alg->maxkeylen)/2; + if (ealg != NULL) { + sop.keylen = (ealg->minkeylen + ealg->maxkeylen)/2; key = (char *) malloc(sop.keylen); if (key == NULL) err(1, "malloc (key)"); for (i = 0; i < sop.keylen; i++) key[i] = rdigit(); sop.key = key; - sop.cipher = alg->code; - } else { + sop.cipher = ealg->code; + } + if (alg != NULL) { sop.mackeylen = (alg->minkeylen + alg->maxkeylen)/2; key = (char *) malloc(sop.mackeylen); if (key == NULL) @@ -277,12 +287,16 @@ runtest(struct alg *alg, int count, int size, u_long c sop.mackey = key; sop.mac = alg->code; } + sop.crid = crid; if (ioctl(fd, cmd, &sop) < 0) { if (cmd == CIOCGSESSION || cmd == CIOCGSESSION2) { close(fd); if (verbose) { - printf("cipher %s", alg->name); + printf("cipher %s%s%s", ealg? ealg->name : "", + (ealg && alg) ? "+" : "", + alg? alg->name : ""); + if (alg->ishash) printf(" mackeylen %u\n", sop.mackeylen); else @@ -292,8 +306,9 @@ runtest(struct alg *alg, int count, int size, u_long c /* hardware doesn't support algorithm; skip it */ return; } - printf("cipher %s keylen %u mackeylen %u\n", - alg->name, sop.keylen, sop.mackeylen); + printf("cipher %s%s%s keylen %u mackeylen %u\n", + ealg? ealg->name : "", (ealg && alg) ? "+" : "", + alg? alg->name : "", sop.keylen, sop.mackeylen); err(1, "CIOCGSESSION"); } @@ -312,7 +327,7 @@ runtest(struct alg *alg, int count, int size, u_long c printf("session = 0x%x\n", sop.ses); printf("device = %s\n", crfind(sop.crid)); printf("count = %d, size = %d\n", count, size); - if (!alg->ishash) { + if (ealg) { printf("iv:"); hexdump(iv, sizeof iv); } @@ -321,15 +336,18 @@ runtest(struct alg *alg, int count, int size, u_long c } gettimeofday(&start, NULL); - if (!alg->ishash) { + if (ealg) { for (i = 0; i < count; i++) { cop.ses = sop.ses; cop.op = COP_ENCRYPT; - cop.flags = opflags; + cop.flags = opflags | COP_F_CIPHER_FIRST; cop.len = size; cop.src = cleartext; cop.dst = ciphertext; - cop.mac = 0; + if (alg) + cop.mac = digest; + else + cop.mac = 0; cop.iv = iv; if (ioctl(fd, CIOCCRYPT, &cop) < 0) @@ -347,7 +365,10 @@ runtest(struct alg *alg, int count, int size, u_long c cop.len = size; cop.src = ciphertext; cop.dst = cleartext; - cop.mac = 0; + if (alg) + cop.mac = digest; + else + cop.mac = 0; cop.iv = iv; if (ioctl(fd, CIOCCRYPT, &cop) < 0) @@ -432,7 +453,7 @@ printt(const char* tag, struct cryptotstat *ts) #endif void -runtests(struct alg *alg, int count, int size, u_long cmd, int threads, int profile) +runtests(struct alg *ealg, struct alg *alg, int count, int size, u_long cmd, int threads, int profile) { int i, status; double t; @@ -441,11 +462,13 @@ runtests(struct alg *alg, int count, int size, u_long struct timeval total; int otiming; - if (size % alg->blocksize) { + if (size % alg->blocksize || (ealg && size % ealg->blocksize)) { if (verbose) printf("skipping blocksize %u 'cuz not a multiple of " - "%s blocksize %u\n", - size, alg->name, alg->blocksize); + "%s blocksize %u (or %s blocksize %u)\n", + size, alg->name, alg->blocksize, + ealg ? ealg->name : "n/a", + ealg ? ealg->blocksize : 0); return; } @@ -476,13 +499,13 @@ runtests(struct alg *alg, int count, int size, u_long CPU_SET(i, &mask); cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(mask), &mask); - runtest(alg, count, size, cmd, &tvp[i]); + runtest(ealg, alg, count, size, cmd, &tvp[i]); exit(0); } while (waitpid(WAIT_MYPGRP, &status, 0) != -1) ; } else - runtest(alg, count, size, cmd, tvp); + runtest(ealg, alg, count, size, cmd, tvp); t = 0; for (i = 0; i < threads; i++) @@ -491,8 +514,9 @@ runtests(struct alg *alg, int count, int size, u_long int nops = alg->ishash ? count : 2*count; nops *= threads; - printf("%8.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", - t, nops, alg->name, size, (double)nops*size / t, + printf("%8.3lf sec, %7d %6s%s%6s crypts, %7d bytes, %8.0lf byte/sec, %7.1lf Mb/sec\n", + t, nops, alg->name, ealg? "+" : "", ealg? ealg->name : "", + size, (double)nops*size / t, (double)nops*size / t * 8 / 1024 / 1024); } #ifdef __FreeBSD__ @@ -519,7 +543,8 @@ runtests(struct alg *alg, int count, int size, u_long int main(int argc, char **argv) { - struct alg *alg = NULL; + struct alg *alg = NULL, *ealg = NULL; + char *tmp; int count = 1; int sizes[128], nsizes = 0; u_long cmd = CIOCGSESSION2; @@ -539,13 +564,23 @@ main(int argc, char **argv) verbose++; break; case 'a': + tmp = strchr(optarg, '+'); + if (tmp != NULL) { + *tmp = '\0'; + ealg = getalgbyname(optarg); + if (ealg == NULL || ealg->ishash) + usage(argv[0]); + optarg = tmp + 1; + } + alg = getalgbyname(optarg); if (alg == NULL) { if (streq(optarg, "rijndael")) alg = getalgbyname("aes"); else usage(argv[0]); - } + } else if (ealg != NULL && !alg->ishash) + usage(argv[0]); break; case 'd': crid = crlookup(optarg); @@ -602,13 +637,13 @@ main(int argc, char **argv) int j; alg = &algorithms[i]; for (j = 0; j < nsizes; j++) - runtests(alg, count, sizes[j], cmd, maxthreads, profile); + runtests(ealg, alg, count, sizes[j], cmd, maxthreads, profile); } } else { if (alg == NULL) alg = getalgbycode(CRYPTO_3DES_CBC); for (i = 0; i < nsizes; i++) - runtests(alg, count, sizes[i], cmd, maxthreads, profile); + runtests(ealg, alg, count, sizes[i], cmd, maxthreads, profile); } return (0); From owner-svn-src-all@freebsd.org Wed Jan 10 23:36:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E731EE7DCB4; Wed, 10 Jan 2018 23:36:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFEAA73055; Wed, 10 Jan 2018 23:36:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x231.google.com with SMTP id p139so1429959itb.1; Wed, 10 Jan 2018 15:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=UMNHRSae2AxaCu8nvCMD5d4KKTfGO7R4Fcg3oGIJhNI=; b=J3xJGlcHIl/tYgkpGBM7xDO5gpggzUBuIqPmmLopvP8kHrLRJbn0mD1L5hlnR6xyAi 5wzPAVYOwWwCKsy1S8rIgjuoIUVTGt7b/+NLYkk0QzTr+2ie6IUO8tDE7rXWeDPcebN7 ceLK6DlxcCr2NHRouYOBw/VGHXdwDp+nCpVnjo/r5yR9aFZwoeA3DJQ2YUjW0tTQLGxT fhtJM+VPWE87AbO9B3RXM76rm4QBkIJZcjc1G6aIcibMjPpCVlf3EGfWT6qbfHEq/G9a XPGttrJUVW/v83o1yK9T0EArUhXqyGMzibrMruo5WBdrRgChcgn2XUCABvMjEg5q4LS+ FU+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=UMNHRSae2AxaCu8nvCMD5d4KKTfGO7R4Fcg3oGIJhNI=; b=gIk38UlbUbyxsLFTzsrVjfzroyST5MJunJNgeqDdQdLoBHtsuCM3ZOv2C4bBuxAsnd B+y2vQeJrDymi+lbuzI9YRCpgUsNaLugNxLs4UEmbn9qaPda/4rpMBmyD+LJUa14beJo OOpG/5GSAm6YB+wxJaxiyzuIm8+wbq0BW57qDoZqJnGjljtZuUMYOgSPs8gf8/9/pETN dnusQF18LX60KAlG3Eb57sNMMS7fPU9AtFGoLUxWhqjWx4HBMz4o3k2XWSGHfsGlqmYT BEwr0L3lorKmt0OsFRAn7IOUkeMiE5zlRLJvpCyBBNkB6mXC6KV8cs52hjiFI5xpDTJh 6ZgA== X-Gm-Message-State: AKGB3mLUMpbo49EHj8PrQIZqbwZWQDuqLl5VqWYuj9NTuAL70ebOkjZ4 zZiEQ9sp/YFE0nIcsBPNL84XcCo+Ib9QAU6UEy7Aqg== X-Google-Smtp-Source: ACJfBotMf0gFMlYLWfFB1MyyGmuWXoaHb1MAQjhxAB/qsbB06apnv/VOsSdNS4722yuBNB8Sdfbk+f4GiTQEQvq0pFk= X-Received: by 10.36.145.208 with SMTP id i199mr19611102ite.81.1515627400705; Wed, 10 Jan 2018 15:36:40 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.131.163 with HTTP; Wed, 10 Jan 2018 15:36:19 -0800 (PST) In-Reply-To: <201801102028.w0AKS1UA000454@repo.freebsd.org> References: <201801102028.w0AKS1UA000454@repo.freebsd.org> From: Ed Maste Date: Wed, 10 Jan 2018 18:36:19 -0500 X-Google-Sender-Auth: g2PTWS7t26jyO92Qv7nQUnKrfoQ Message-ID: Subject: Re: svn commit: r327783 - head/share/mk To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Jan 2018 23:36:42 -0000 On 10 January 2018 at 15:28, Ed Maste wrote: > Author: emaste > Date: Wed Jan 10 20:28:01 2018 > New Revision: 327783 > URL: https://svnweb.freebsd.org/changeset/base/327783 > > Log: > Enable ld.lld as bootstrap linker by default on amd64 > ... > This has been a long time in the making. On 2013-04-13 I submitted an > upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's > system linker. This has been in the works for a long time, but not quite as long as my typo suggests; the tracking bug was submitted on 2015-04-13, a bit over two and a half years ago. I started looking at lld as a possible system linker in 2014. Many folks have been running with this change (and also WITH_LLD_IS_LD, so that lld is installed as /usr/bin/ld) for some time and I expect this change will be transparent for regular use (other than lld taking much less time to link, compared to ld.bfd). However, if you do encounter any trouble please set WITHOUT_LLD_BOOTSTRAP=yes in /etc/src.conf and let me know what the problem was. From owner-svn-src-all@freebsd.org Thu Jan 11 00:22:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3EDCE9A18D; Thu, 11 Jan 2018 00:22:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 657A074983; Thu, 11 Jan 2018 00:22:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6DB95568; Thu, 11 Jan 2018 00:22:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B0MOlY001244; Thu, 11 Jan 2018 00:22:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B0MONG001243; Thu, 11 Jan 2018 00:22:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801110022.w0B0MONG001243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Jan 2018 00:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327803 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 327803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 00:22:25 -0000 Author: jhb Date: Thu Jan 11 00:22:24 2018 New Revision: 327803 URL: https://svnweb.freebsd.org/changeset/base/327803 Log: Flesh out static dtrace probes for /dev/crypto ioctl errors. In particular, no probes were present for AEAD requests, but also for some other error cases in other ioctl requests. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Jan 10 23:19:32 2018 (r327802) +++ head/sys/opencrypto/cryptodev.c Thu Jan 11 00:22:24 2018 (r327803) @@ -443,6 +443,7 @@ cryptof_ioctl( default: CRYPTDEB("invalid cipher"); + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } @@ -490,6 +491,7 @@ cryptof_ioctl( break; default: CRYPTDEB("invalid mac"); + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } @@ -503,6 +505,8 @@ cryptof_ioctl( sop->keylen < txform->minkey) { CRYPTDEB("invalid cipher parameters"); error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); goto bail; } @@ -511,6 +515,8 @@ cryptof_ioctl( if ((error = copyin(sop->key, crie.cri_key, crie.cri_klen / 8))) { CRYPTDEB("invalid key"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); goto bail; } if (thash) @@ -524,6 +530,8 @@ cryptof_ioctl( sop->mackeylen > thash->keysize) { CRYPTDEB("invalid mac key length"); error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); goto bail; } @@ -533,6 +541,8 @@ cryptof_ioctl( if ((error = copyin(sop->mackey, cria.cri_key, cria.cri_klen / 8))) { CRYPTDEB("invalid mac key"); + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); goto bail; } } @@ -548,6 +558,8 @@ cryptof_ioctl( error = checkforsoftware(&crid); if (error) { CRYPTDEB("checkforsoftware"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); goto bail; } } else @@ -555,6 +567,7 @@ cryptof_ioctl( error = crypto_newsession(&sid, (txform ? &crie : &cria), crid); if (error) { CRYPTDEB("crypto_newsession"); + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } @@ -565,6 +578,7 @@ cryptof_ioctl( if (cse == NULL) { crypto_freesession(sid); error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); CRYPTDEB("csecreate"); goto bail; } @@ -597,8 +611,10 @@ bail: case CIOCFSESSION: ses = *(u_int32_t *)data; cse = csefind(fcr, ses); - if (cse == NULL) + if (cse == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } csedelete(fcr, cse); error = csefree(cse); break; @@ -628,8 +644,10 @@ bail: case CIOCKEY32: case CIOCKEY232: #endif - if (!crypto_userasymcrypto) + if (!crypto_userasymcrypto) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EPERM); /* XXX compat? */ + } #ifdef COMPAT_FREEBSD32 if (cmd == CIOCKEY32 || cmd == CIOCKEY232) { kop = &kopc; @@ -663,8 +681,12 @@ bail: * fallback to doing them in software. */ *(int *)data = 0; - } else + } else { error = crypto_getfeat((int *)data); + if (error) + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); + } break; case CIOCFINDDEV: error = cryptodev_find((struct crypt_find_op *)data); @@ -672,12 +694,15 @@ bail: case CIOCCRYPTAEAD: caead = (struct crypt_aead *)data; cse = csefind(fcr, caead->ses); - if (cse == NULL) + if (cse == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } error = cryptodev_aead(cse, caead, active_cred, td); break; default: error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); break; } return (error); @@ -892,12 +917,16 @@ cryptodev_aead( struct cryptodesc *crde = NULL, *crda = NULL; int error; - if (caead->len > 256*1024-4 || caead->aadlen > 256*1024-4) + if (caead->len > 256*1024-4 || caead->aadlen > 256*1024-4) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (E2BIG); + } if (cse->txform == NULL || cse->thash == NULL || caead->tag == NULL || - (caead->len % cse->txform->blocksize) != 0) + (caead->len % cse->txform->blocksize) != 0) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } uio = &cse->uio; uio->uio_iov = &cse->iovec; @@ -915,6 +944,7 @@ cryptodev_aead( crp = crypto_getreq(2); if (crp == NULL) { error = ENOMEM; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } @@ -927,12 +957,16 @@ cryptodev_aead( } if ((error = copyin(caead->aad, cse->uio.uio_iov[0].iov_base, - caead->aadlen))) + caead->aadlen))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } if ((error = copyin(caead->src, (char *)cse->uio.uio_iov[0].iov_base + - caead->aadlen, caead->len))) + caead->aadlen, caead->len))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } /* * For GCM, crd_len covers only the AAD. For other ciphers @@ -973,11 +1007,14 @@ cryptodev_aead( if (caead->iv) { if (caead->ivlen > sizeof cse->tmp_iv) { error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - if ((error = copyin(caead->iv, cse->tmp_iv, caead->ivlen))) + if ((error = copyin(caead->iv, cse->tmp_iv, caead->ivlen))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } bcopy(cse->tmp_iv, crde->crd_iv, caead->ivlen); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; } else { @@ -987,8 +1024,10 @@ cryptodev_aead( } if ((error = copyin(caead->tag, (caddr_t)cse->uio.uio_iov[0].iov_base + - caead->len + caead->aadlen, cse->thash->hashsize))) + caead->len + caead->aadlen, cse->thash->hashsize))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } again: /* * Let the dispatch run unlocked, then, interlock against the @@ -1003,8 +1042,10 @@ again: error = msleep(crp, &cse->lock, PWAIT, "crydev", 0); mtx_unlock(&cse->lock); - if (error != 0) + if (error != 0) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } if (crp->crp_etype == EAGAIN) { crp->crp_etype = 0; @@ -1014,22 +1055,28 @@ again: if (crp->crp_etype != 0) { error = crp->crp_etype; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } if (cse->error) { error = cse->error; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } if (caead->dst && (error = copyout( (caddr_t)cse->uio.uio_iov[0].iov_base + caead->aadlen, caead->dst, - caead->len))) + caead->len))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } if ((error = copyout((caddr_t)cse->uio.uio_iov[0].iov_base + - caead->aadlen + caead->len, caead->tag, cse->thash->hashsize))) + caead->aadlen + caead->len, caead->tag, cse->thash->hashsize))) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; + } bail: crypto_freereq(crp); @@ -1068,6 +1115,7 @@ cryptodev_key(struct crypt_kop *kop) int in, out, size, i; if (kop->crk_iparams + kop->crk_oparams > CRK_MAXPARAM) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EFBIG); } @@ -1077,30 +1125,38 @@ cryptodev_key(struct crypt_kop *kop) case CRK_MOD_EXP: if (in == 3 && out == 1) break; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); case CRK_MOD_EXP_CRT: if (in == 6 && out == 1) break; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); case CRK_DSA_SIGN: if (in == 5 && out == 2) break; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); case CRK_DSA_VERIFY: if (in == 7 && out == 0) break; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); case CRK_DH_COMPUTE_KEY: if (in == 3 && out == 1) break; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); default: + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } krp = (struct cryptkop *)malloc(sizeof *krp, M_XDATA, M_WAITOK|M_ZERO); - if (!krp) + if (!krp) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (ENOMEM); + } krp->krp_op = kop->crk_op; krp->krp_status = kop->crk_status; krp->krp_iparams = kop->crk_iparams; @@ -1110,9 +1166,11 @@ cryptodev_key(struct crypt_kop *kop) krp->krp_callback = (int (*) (struct cryptkop *)) cryptodevkey_cb; for (i = 0; i < CRK_MAXPARAM; i++) { - if (kop->crk_param[i].crp_nbits > 65536) + if (kop->crk_param[i].crp_nbits > 65536) { /* Limit is the same as in OpenBSD */ + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; + } krp->krp_param[i].crp_nbits = kop->crk_param[i].crp_nbits; } for (i = 0; i < krp->krp_iparams + krp->krp_oparams; i++) { @@ -1123,22 +1181,28 @@ cryptodev_key(struct crypt_kop *kop) if (i >= krp->krp_iparams) continue; error = copyin(kop->crk_param[i].crp_p, krp->krp_param[i].crp_p, size); - if (error) + if (error) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; + } } error = crypto_kdispatch(krp); - if (error) + if (error) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; + } error = tsleep(krp, PSOCK, "crydev", 0); if (error) { /* XXX can this happen? if so, how do we recover? */ + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; } kop->crk_crid = krp->krp_crid; /* device that did the work */ if (krp->krp_status != 0) { error = krp->krp_status; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; } @@ -1147,8 +1211,10 @@ cryptodev_key(struct crypt_kop *kop) if (size == 0) continue; error = copyout(krp->krp_param[i].crp_p, kop->crk_param[i].crp_p, size); - if (error) + if (error) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto fail; + } } fail: From owner-svn-src-all@freebsd.org Thu Jan 11 00:54:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A1AEA4C85; Thu, 11 Jan 2018 00:54:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B66675D25; Thu, 11 Jan 2018 00:54: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 A78C25A77; Thu, 11 Jan 2018 00:54:54 +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 w0B0ssto014574; Thu, 11 Jan 2018 00:54:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B0sslu014573; Thu, 11 Jan 2018 00:54:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801110054.w0B0sslu014573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Jan 2018 00:54:54 +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: r327804 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/geom/mirror X-SVN-Commit-Revision: 327804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 00:54:55 -0000 Author: markj Date: Thu Jan 11 00:54:54 2018 New Revision: 327804 URL: https://svnweb.freebsd.org/changeset/base/327804 Log: MFC r327698: Release the queue lock before restarting the worker loop. Modified: stable/11/sys/geom/mirror/g_mirror.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Thu Jan 11 00:22:24 2018 (r327803) +++ stable/11/sys/geom/mirror/g_mirror.c Thu Jan 11 00:54:54 2018 (r327804) @@ -1954,8 +1954,10 @@ g_mirror_worker(void *arg) continue; } } - if (g_mirror_event_first(sc) != NULL) + if (g_mirror_event_first(sc) != NULL) { + mtx_unlock(&sc->sc_queue_mtx); continue; + } sx_xunlock(&sc->sc_lock); MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:w1", timeout * hz); From owner-svn-src-all@freebsd.org Thu Jan 11 03:11:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC5EDE66A38; Thu, 11 Jan 2018 03:11:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7DEE7B673; Thu, 11 Jan 2018 03:11:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0125171CC; Thu, 11 Jan 2018 03:11:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B3BfVe073745; Thu, 11 Jan 2018 03:11:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B3BfB7073744; Thu, 11 Jan 2018 03:11:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801110311.w0B3BfB7073744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 11 Jan 2018 03:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327805 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 327805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 03:11:43 -0000 Author: imp Date: Thu Jan 11 03:11:41 2018 New Revision: 327805 URL: https://svnweb.freebsd.org/changeset/base/327805 Log: When we crash, we'll stop the scheduler before we call the shutdown_post_sync event. For adashutdown, this causes problems because we need to poll for completion of the commands, but we're not yet officially dumping yet, so the code from r326964 assumed we could use the interrupt-driven commands rather than the polled ones. This lead to a hang. Prevent this by also checking to see if the scheduler is stopped to do the polling. Reported by: markj@ Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D13845 Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Jan 11 00:54:54 2018 (r327804) +++ head/sys/cam/cam_periph.c Thu Jan 11 03:11:41 2018 (r327805) @@ -1187,10 +1187,16 @@ cam_periph_runccb(union ccb *ccb, * scheduler is running in this case, we still need to poll the I/O to * avoid sleeping waiting for the ccb to complete. * - * XXX To avoid locking problems, dumping/polling callers must call + * A panic triggered dump stops the scheduler, any callback from the + * shutdown_post_sync event will run with the scheduler stopped, but + * before we're officially dumping. To avoid hanging in adashutdown + * initiated commands (or other similar situations), we have to test for + * either SCHEDULER_STOPPED() here as well. + * + * To avoid locking problems, dumping/polling callers must call * without a periph lock held. */ - must_poll = dumping; + must_poll = dumping || SCHEDULER_STOPPED(); ccb->ccb_h.cbfcnp = cam_periph_done; /* From owner-svn-src-all@freebsd.org Thu Jan 11 05:36:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1739CE6EB2D; Thu, 11 Jan 2018 05:36:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD44F7FA93; Thu, 11 Jan 2018 05:36:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2588810A2B; Thu, 11 Jan 2018 05:36:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B5aEIl032454; Thu, 11 Jan 2018 05:36:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B5aDJZ032451; Thu, 11 Jan 2018 05:36:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801110536.w0B5aDJZ032451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 11 Jan 2018 05:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327806 - in head: etc/mtree usr.bin/awk usr.bin/awk/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree usr.bin/awk usr.bin/awk/tests X-SVN-Commit-Revision: 327806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 05:36:15 -0000 Author: kevans Date: Thu Jan 11 05:36:13 2018 New Revision: 327806 URL: https://svnweb.freebsd.org/changeset/base/327806 Log: awk(1): Add necessary bits for connecting tests, but leave disconnected The NetBSD test suite has 24 tests for awk, and we pass exactly 4 of them. Add the necessary pieces for interested parties to easily connect the tests and run them, but leave them disconnected for the time being. Some of these tests outright segfault in our awk, others just exhibit the wrong behavior. Added: head/usr.bin/awk/tests/ head/usr.bin/awk/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/awk/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jan 11 03:11:41 2018 (r327805) +++ head/etc/mtree/BSD.tests.dist Thu Jan 11 05:36:13 2018 (r327806) @@ -536,6 +536,8 @@ usr.bin apply .. + awk + .. basename .. bmake Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Thu Jan 11 03:11:41 2018 (r327805) +++ head/usr.bin/awk/Makefile Thu Jan 11 05:36:13 2018 (r327806) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + AWKSRC= ${SRCTOP}/contrib/one-true-awk .PATH: ${AWKSRC} @@ -27,5 +29,9 @@ proctab.c: maketab build-tools: maketab maketab: ytab.h maketab.c ${BUILD_TOOLS_META} + +# awk needs some work before we can connect these tests to the build +#HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Added: head/usr.bin/awk/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/awk/tests/Makefile Thu Jan 11 05:36:13 2018 (r327806) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +PACKAGE= tests + +NETBSD_ATF_TESTS_SH= awk_test + +${PACKAGE}FILES+= d_assign_NF.awk +${PACKAGE}FILES+= d_assign_NF.in +${PACKAGE}FILES+= d_assign_NF.out +${PACKAGE}FILES+= d_big_regexp.awk +${PACKAGE}FILES+= d_big_regexp.in +${PACKAGE}FILES+= d_big_regexp.out +${PACKAGE}FILES+= d_end1.awk +${PACKAGE}FILES+= d_end1.in +${PACKAGE}FILES+= d_end1.out +${PACKAGE}FILES+= d_end2.awk +${PACKAGE}FILES+= d_end2.in +${PACKAGE}FILES+= d_end2.out +${PACKAGE}FILES+= d_period.awk +${PACKAGE}FILES+= d_period.in +${PACKAGE}FILES+= d_period.out +${PACKAGE}FILES+= d_string1.awk +${PACKAGE}FILES+= d_string1.out +${PACKAGE}FILES+= d_tolower.awk +${PACKAGE}FILES+= d_tolower.in +${PACKAGE}FILES+= d_tolower.out +${PACKAGE}FILES+= d_toupper.awk +${PACKAGE}FILES+= d_toupper.in +${PACKAGE}FILES+= d_toupper.out + +.include + +.include From owner-svn-src-all@freebsd.org Thu Jan 11 05:53:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25B3DE6F946 for ; Thu, 11 Jan 2018 05:53:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C168036A for ; Thu, 11 Jan 2018 05:53:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x233.google.com with SMTP id 143so3020652wma.5 for ; Wed, 10 Jan 2018 21:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oHKmsq07jISm9Kl6v9i9y4x6agf4QbT4JwXZNhMEyYo=; b=aecqhenHEtht0PEeai1amGQcISrfPW5d8/mfcnhwUGWnaANSiMATQLdXMtd8ZvDxC8 z3dYhztigvtbYY/wDVH5QWbotOGFT7a5qsIo9xGLu6X4iTc3hh1irLXmL52AAwNO/vLO sEBfC9VrmFaYHlbEU/p9hyp3TQsPloI9PY81oZF447mPQXLVXidZVkZhlF08KOACEnX2 eZZzOxe2Fp9JpeE0Ktm3cKtMl5rN39EosfxY699cMqWMJKaFzQdAMmNESSpN/65S0jzi aarFbEvIdkFPWT6/oR2lbcjdlRfSeRSIy7H/X7gU1hgtuXR89w7ywovnAX01ySxqZMgj Xvvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=oHKmsq07jISm9Kl6v9i9y4x6agf4QbT4JwXZNhMEyYo=; b=ufYMPnSp2JWVBokQYsGvB6Ijt7kQu32HwO+/2JBTfn0MGSsWh+Wg4KG34rEexzANVE YkcHXs9Os1t0IWVP9TlPhVYaYfUbpLa43K9gH3T+kjNDEUzrmyPhPwm5lQ+SNQdT/4MF GrVPt/HWoVdUknD/UK/Xr9kpBlOK4DLRB5MECYCTCFw2t6HWmfyzswv9+qUA3TlxbOy8 ql80alC7XuvAmJd3d1MRn/4oYGhYpJ9pL29STkgKD6hJB7DOC6jFcSiYnX8VfRlYVtsr j4frHh3WMuun6AxL/GrifL0OarUXBVxhz5grblKxfOvMOZ7RZNu3rcDBlxFu2zKGbmCB pZew== X-Gm-Message-State: AKGB3mLIYn9q948aU7F0XBuN/XAZbvnw/CndGWlZ1KcpLH86cXsUkONO 87Cw3KYjyv+B3Ev8Z/bc8FQdquvwzp6jHorLUz+1wQ== X-Google-Smtp-Source: ACJfBovG5B+pez4Jh+3h7hJ69Q46qvbviPHIISUO3O4Ps6P0eFDEtxJQvilmL8iGcJFfnn/ujl713Rimpt3rnfbeG0A= X-Received: by 10.80.179.76 with SMTP id r12mr28869852edd.118.1515649987761; Wed, 10 Jan 2018 21:53:07 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.88 with HTTP; Wed, 10 Jan 2018 21:53:07 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201801110536.w0B5aDJZ032451@repo.freebsd.org> References: <201801110536.w0B5aDJZ032451@repo.freebsd.org> From: Warner Losh Date: Wed, 10 Jan 2018 22:53:07 -0700 X-Google-Sender-Auth: PE_eQuSb6f_uuo1IvKQaIIygYF0 Message-ID: Subject: Re: svn commit: r327806 - in head: etc/mtree usr.bin/awk usr.bin/awk/tests To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 05:53:10 -0000 On Wed, Jan 10, 2018 at 10:36 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Jan 11 05:36:13 2018 > New Revision: 327806 > URL: https://svnweb.freebsd.org/changeset/base/327806 > > Log: > awk(1): Add necessary bits for connecting tests, but leave disconnected > > The NetBSD test suite has 24 tests for awk, and we pass exactly 4 of > them. > Add the necessary pieces for interested parties to easily connect the > tests and run them, but leave them disconnected for the time being. > > Some of these tests outright segfault in our awk, others just exhibit the > wrong behavior. > How many tests does NetBSD's awk pass? At least one of their patches causes our .m compiler awk script to fail, if I've applied it correctly. Warner > Added: > head/usr.bin/awk/tests/ > head/usr.bin/awk/tests/Makefile (contents, props changed) > Modified: > head/etc/mtree/BSD.tests.dist > head/usr.bin/awk/Makefile > > Modified: head/etc/mtree/BSD.tests.dist > ============================================================ > ================== > --- head/etc/mtree/BSD.tests.dist Thu Jan 11 03:11:41 2018 > (r327805) > +++ head/etc/mtree/BSD.tests.dist Thu Jan 11 05:36:13 2018 > (r327806) > @@ -536,6 +536,8 @@ > usr.bin > apply > .. > + awk > + .. > basename > .. > bmake > > Modified: head/usr.bin/awk/Makefile > ============================================================ > ================== > --- head/usr.bin/awk/Makefile Thu Jan 11 03:11:41 2018 (r327805) > +++ head/usr.bin/awk/Makefile Thu Jan 11 05:36:13 2018 (r327806) > @@ -1,5 +1,7 @@ > # $FreeBSD$ > > +.include > + > AWKSRC= ${SRCTOP}/contrib/one-true-awk > .PATH: ${AWKSRC} > > @@ -27,5 +29,9 @@ proctab.c: maketab > > build-tools: maketab > maketab: ytab.h maketab.c ${BUILD_TOOLS_META} > + > +# awk needs some work before we can connect these tests to the build > +#HAS_TESTS= > +SUBDIR.${MK_TESTS}+= tests > > .include > > Added: head/usr.bin/awk/tests/Makefile > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/awk/tests/Makefile Thu Jan 11 05:36:13 2018 > (r327806) > @@ -0,0 +1,33 @@ > +# $FreeBSD$ > + > +PACKAGE= tests > + > +NETBSD_ATF_TESTS_SH= awk_test > + > +${PACKAGE}FILES+= d_assign_NF.awk > +${PACKAGE}FILES+= d_assign_NF.in > +${PACKAGE}FILES+= d_assign_NF.out > +${PACKAGE}FILES+= d_big_regexp.awk > +${PACKAGE}FILES+= d_big_regexp.in > +${PACKAGE}FILES+= d_big_regexp.out > +${PACKAGE}FILES+= d_end1.awk > +${PACKAGE}FILES+= d_end1.in > +${PACKAGE}FILES+= d_end1.out > +${PACKAGE}FILES+= d_end2.awk > +${PACKAGE}FILES+= d_end2.in > +${PACKAGE}FILES+= d_end2.out > +${PACKAGE}FILES+= d_period.awk > +${PACKAGE}FILES+= d_period.in > +${PACKAGE}FILES+= d_period.out > +${PACKAGE}FILES+= d_string1.awk > +${PACKAGE}FILES+= d_string1.out > +${PACKAGE}FILES+= d_tolower.awk > +${PACKAGE}FILES+= d_tolower.in > +${PACKAGE}FILES+= d_tolower.out > +${PACKAGE}FILES+= d_toupper.awk > +${PACKAGE}FILES+= d_toupper.in > +${PACKAGE}FILES+= d_toupper.out > + > +.include > + > +.include > > From owner-svn-src-all@freebsd.org Thu Jan 11 06:30:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51F14E715B8; Thu, 11 Jan 2018 06:30:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D44A81466; Thu, 11 Jan 2018 06:30:51 +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 6AAFE1129C; Thu, 11 Jan 2018 06:30:50 +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 w0B6UoZA053315; Thu, 11 Jan 2018 06:30:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B6UoFg053314; Thu, 11 Jan 2018 06:30:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801110630.w0B6UoFg053314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 11 Jan 2018 06:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327807 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 06:30:51 -0000 Author: cem Date: Thu Jan 11 06:30:50 2018 New Revision: 327807 URL: https://svnweb.freebsd.org/changeset/base/327807 Log: Zstd: Add bswap intrinsics for small MIPS systems (e.g., Onion Omega) Reported by: mizhka Sponsored by: Dell EMC Isilon Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Thu Jan 11 05:36:13 2018 (r327806) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c Thu Jan 11 06:30:50 2018 (r327807) @@ -27,6 +27,7 @@ */ #include "zstd_kfreebsd.h" +#include /* * The kernel as a standalone target does not link against libgcc or @@ -43,6 +44,19 @@ * A subsequent enhancement might create a mini compiler-rt library for kernel * use and move these over there instead. */ + +/* Swap endianness */ +int +__bswapsi2(int x) +{ + return (bswap32(x)); +} + +long long +__bswapdi2(long long x) +{ + return (bswap64(x)); +} /* Count trailing zeros */ int From owner-svn-src-all@freebsd.org Thu Jan 11 07:06:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A91DE73327; Thu, 11 Jan 2018 07:06:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0586F8269F; Thu, 11 Jan 2018 07:06:24 +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 287BB118EF; Thu, 11 Jan 2018 07:06:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B76Ncu069539; Thu, 11 Jan 2018 07:06:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B76Na8069538; Thu, 11 Jan 2018 07:06:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201801110706.w0B76Na8069538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 11 Jan 2018 07:06:23 +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: r327808 - stable/11/usr.bin/mail X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/mail X-SVN-Commit-Revision: 327808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 07:06:24 -0000 Author: delphij Date: Thu Jan 11 07:06:22 2018 New Revision: 327808 URL: https://svnweb.freebsd.org/changeset/base/327808 Log: MFC r327235: Don't initialize lastlong before assigning it. Modified: stable/11/usr.bin/mail/collect.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mail/collect.c ============================================================================== --- stable/11/usr.bin/mail/collect.c Thu Jan 11 06:30:50 2018 (r327807) +++ stable/11/usr.bin/mail/collect.c Thu Jan 11 07:06:22 2018 (r327808) @@ -131,7 +131,6 @@ collect(struct header *hp, int printheaders) escape = ESCAPE; eofcount = 0; hadintr = 0; - lastlong = 0; longline = 0; if (!setjmp(colljmp)) { From owner-svn-src-all@freebsd.org Thu Jan 11 07:40:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A56F7E749EF; Thu, 11 Jan 2018 07:40:08 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D62A836CC; Thu, 11 Jan 2018 07:40:08 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AABBC11DF5; Thu, 11 Jan 2018 07:40:07 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B7e7Sw082466; Thu, 11 Jan 2018 07:40:07 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B7e6hN082458; Thu, 11 Jan 2018 07:40:06 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110740.w0B7e6hN082458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 07:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327810 - in head/sys: conf powerpc/conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/conf powerpc/powernv X-SVN-Commit-Revision: 327810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 07:40:08 -0000 Author: wma Date: Thu Jan 11 07:40:06 2018 New Revision: 327810 URL: https://svnweb.freebsd.org/changeset/base/327810 Log: PowerNV: initial support for OPAL OPAL is a dedicated firmware acting as a hypervisor. Add generic functions to provide all access. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Added: head/sys/powerpc/powernv/ head/sys/powerpc/powernv/opal.c (contents, props changed) head/sys/powerpc/powernv/opal.h (contents, props changed) head/sys/powerpc/powernv/opal_console.c (contents, props changed) head/sys/powerpc/powernv/opalcall.S (contents, props changed) head/sys/powerpc/powernv/platform_powernv.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc head/sys/powerpc/conf/GENERIC64 Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Jan 11 07:35:14 2018 (r327809) +++ head/sys/conf/files.powerpc Thu Jan 11 07:40:06 2018 (r327810) @@ -183,6 +183,10 @@ powerpc/powermac/smusat.c optional powermac smu powerpc/powermac/uninorth.c optional powermac powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac +powerpc/powernv/opal.c optional powernv +powerpc/powernv/opal_console.c optional powernv +powerpc/powernv/opalcall.S optional powernv +powerpc/powernv/platform_powernv.c optional powernv powerpc/powerpc/altivec.c optional powerpc | powerpc64 powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Thu Jan 11 07:35:14 2018 (r327809) +++ head/sys/conf/options.powerpc Thu Jan 11 07:40:06 2018 (r327810) @@ -23,6 +23,7 @@ MPC85XX opt_platform.h POWERMAC opt_platform.h PS3 opt_platform.h MAMBO +POWERNV PSERIES PSIM Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jan 11 07:35:14 2018 (r327809) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 11 07:40:06 2018 (r327810) @@ -31,6 +31,7 @@ options POWERMAC #NewWorld Apple PowerMacs options PS3 #Sony Playstation 3 options MAMBO #IBM Mambo Full System Simulator options PSERIES #PAPR-compliant systems (e.g. IBM p) +options POWERNV #Non-virtualized OpenPOWER systems options FDT #Flattened Device Tree options SCHED_ULE #ULE scheduler Added: head/sys/powerpc/powernv/opal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal.c Thu Jan 11 07:40:06 2018 (r327810) @@ -0,0 +1,66 @@ +/*- + * Copyright (C) 2015 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include "opal.h" + +extern uint64_t opal_entrypoint; +extern uint64_t opal_data; +extern uint64_t opal_msr; + +static int opal_initialized = 0; + +int +opal_check(void) +{ + phandle_t opal; + cell_t val[2]; + + if (opal_initialized) + return (0); + + opal = OF_finddevice("/ibm,opal"); + if (opal == -1) + return (ENOENT); + + if (!OF_hasprop(opal, "opal-base-address") || + !OF_hasprop(opal, "opal-entry-address")) + return (ENOENT); + + OF_getencprop(opal, "opal-base-address", val, sizeof(val)); + opal_data = ((uint64_t)val[0] << 32) | val[1]; + OF_getencprop(opal, "opal-entry-address", val, sizeof(val)); + opal_entrypoint = ((uint64_t)val[0] << 32) | val[1]; + + opal_msr = mfmsr() & ~(PSL_EE | PSL_IR | PSL_DR | PSL_SE); + + opal_initialized = 1; + + return (0); +} + Added: head/sys/powerpc/powernv/opal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal.h Thu Jan 11 07:40:06 2018 (r327810) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2015 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _POWERNV_OPAL_H +#define _POWERNV_OPAL_H + +#include +#include + +/* Check if OPAL is correctly instantiated. Will try to instantiate it. */ +int opal_check(void); + +/* Call an OPAL method. Any pointers passed must be real-mode accessible! */ +int opal_call(uint64_t token, ...); + +#define OPAL_CONSOLE_WRITE 1 +#define OPAL_CONSOLE_READ 2 +#define OPAL_START_CPU 41 + +#define OPAL_SUCCESS 0 +#define OPAL_BUSY_EVENT -12 + +#endif Added: head/sys/powerpc/powernv/opal_console.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_console.c Thu Jan 11 07:40:06 2018 (r327810) @@ -0,0 +1,441 @@ +/*- + * Copyright (C) 2011,2015 by Nathan Whitehorn. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "opal.h" +#include "uart_if.h" + +struct uart_opal_softc { + device_t dev; + phandle_t node; + int vtermid; + + struct tty *tp; + struct resource *irqres; + int irqrid; + struct callout callout; + void *sc_icookie; + int polltime; + + struct mtx sc_mtx; + int protocol; + + char opal_inbuf[16]; + uint64_t inbuflen; + uint8_t outseqno; +}; + +static struct uart_opal_softc *console_sc = NULL; +#if defined(KDB) +static int alt_break_state; +#endif + +enum { + OPAL_RAW, OPAL_HVSI +}; + +#define VS_DATA_PACKET_HEADER 0xff +#define VS_CONTROL_PACKET_HEADER 0xfe +#define VSV_SET_MODEM_CTL 0x01 +#define VSV_MODEM_CTL_UPDATE 0x02 +#define VSV_RENEGOTIATE_CONNECTION 0x03 +#define VS_QUERY_PACKET_HEADER 0xfd +#define VSV_SEND_VERSION_NUMBER 0x01 +#define VSV_SEND_MODEM_CTL_STATUS 0x02 +#define VS_QUERY_RESPONSE_PACKET_HEADER 0xfc + +static int uart_opal_probe(device_t dev); +static int uart_opal_attach(device_t dev); +static void uart_opal_intr(void *v); + +static device_method_t uart_opal_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, uart_opal_probe), + DEVMETHOD(device_attach, uart_opal_attach), + + DEVMETHOD_END +}; + +static driver_t uart_opal_driver = { + "uart", + uart_opal_methods, + sizeof(struct uart_opal_softc), +}; + +DRIVER_MODULE(uart_opal, opalcons, uart_opal_driver, uart_devclass, 0, 0); + +static cn_probe_t uart_opal_cnprobe; +static cn_init_t uart_opal_cninit; +static cn_term_t uart_opal_cnterm; +static cn_getc_t uart_opal_cngetc; +static cn_putc_t uart_opal_cnputc; +static cn_grab_t uart_opal_cngrab; +static cn_ungrab_t uart_opal_cnungrab; + +CONSOLE_DRIVER(uart_opal); + +static void uart_opal_ttyoutwakeup(struct tty *tp); + +static struct ttydevsw uart_opal_tty_class = { + .tsw_flags = TF_INITLOCK|TF_CALLOUT, + .tsw_outwakeup = uart_opal_ttyoutwakeup, +}; + +static int +uart_opal_probe_node(struct uart_opal_softc *sc) +{ + phandle_t node = sc->node; + uint32_t reg; + char buf[64]; + + sc->inbuflen = 0; + sc->outseqno = 0; + + if (OF_getprop(node, "device_type", buf, sizeof(buf)) <= 0) + return (ENXIO); + if (strcmp(buf, "serial") != 0) + return (ENXIO); + + reg = -1; + OF_getprop(node, "reg", ®, sizeof(reg)); + if (reg == -1) + return (ENXIO); + sc->vtermid = reg; + sc->node = node; + + if (OF_getprop(node, "compatible", buf, sizeof(buf)) <= 0) + return (ENXIO); + if (strcmp(buf, "ibm,opal-console-raw") == 0) { + sc->protocol = OPAL_RAW; + return (0); + } else if (strcmp(buf, "ibm,opal-console-hvsi") == 0) { + sc->protocol = OPAL_HVSI; + return (0); + } + + return (ENXIO); +} + +static int +uart_opal_probe(device_t dev) +{ + struct uart_opal_softc sc; + int err; + + sc.node = ofw_bus_get_node(dev); + err = uart_opal_probe_node(&sc); + if (err != 0) + return (err); + + device_set_desc(dev, "OPAL Serial Port"); + + return (err); +} + +static void +uart_opal_cnprobe(struct consdev *cp) +{ + char buf[64]; + phandle_t input, chosen; + static struct uart_opal_softc sc; + + if (opal_check() != 0) + goto fail; + + if ((chosen = OF_finddevice("/chosen")) == -1) + goto fail; + + /* Check if OF has an active stdin/stdout */ + if (OF_getprop(chosen, "linux,stdout-path", buf, sizeof(buf)) <= 0) + goto fail; + + input = OF_finddevice(buf); + if (input == -1) + goto fail; + + sc.node = input; + if (uart_opal_probe_node(&sc) != 0) + goto fail; + mtx_init(&sc.sc_mtx, "uart_opal", NULL, MTX_SPIN | MTX_QUIET | + MTX_NOWITNESS); + + cp->cn_pri = CN_NORMAL; + console_sc = ≻ + return; + +fail: + cp->cn_pri = CN_DEAD; + return; +} + +static int +uart_opal_attach(device_t dev) +{ + struct uart_opal_softc *sc; + int unit; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->node = ofw_bus_get_node(dev); + uart_opal_probe_node(sc); + + unit = device_get_unit(dev); + sc->tp = tty_alloc(&uart_opal_tty_class, sc); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, + MTX_SPIN | MTX_QUIET | MTX_NOWITNESS); + + if (console_sc != NULL && console_sc->vtermid == sc->vtermid) { + sc->outseqno = console_sc->outseqno; + console_sc = sc; + sprintf(uart_opal_consdev.cn_name, "ttyu%r", unit); + tty_init_console(sc->tp, 0); + } + + sc->irqrid = 0; + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqrid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->irqres != NULL) { + bus_setup_intr(dev, sc->irqres, INTR_TYPE_TTY | INTR_MPSAFE, + NULL, uart_opal_intr, sc, &sc->sc_icookie); + } else { + callout_init(&sc->callout, CALLOUT_MPSAFE); + sc->polltime = hz / 20; + if (sc->polltime < 1) + sc->polltime = 1; + callout_reset(&sc->callout, sc->polltime, uart_opal_intr, sc); + } + + tty_makedev(sc->tp, NULL, "u%r", unit); + + return (0); +} + +static void +uart_opal_cninit(struct consdev *cp) +{ + + strcpy(cp->cn_name, "opalcons"); +} + +static void +uart_opal_cnterm(struct consdev *cp) +{ +} + +static int +uart_opal_get(struct uart_opal_softc *sc, void *buffer, size_t bufsize) +{ + int err; + int hdr = 0; + + if (sc->protocol == OPAL_RAW) { + uint64_t len = bufsize; + uint64_t olen = (uint64_t)&len; + uint64_t obuf = (uint64_t)buffer; + + if (pmap_bootstrapped) { + olen = vtophys(&len); + obuf = vtophys(buffer); + } + + err = opal_call(OPAL_CONSOLE_READ, sc->vtermid, olen, obuf); + if (err != OPAL_SUCCESS) + return (-1); + + bufsize = len; + } else { + uart_lock(&sc->sc_mtx); + if (sc->inbuflen == 0) { + err = opal_call(OPAL_CONSOLE_READ, sc->vtermid, + &sc->inbuflen, sc->opal_inbuf); + if (err != OPAL_SUCCESS) { + uart_unlock(&sc->sc_mtx); + return (-1); + } + hdr = 1; + } + + if (sc->inbuflen == 0) { + uart_unlock(&sc->sc_mtx); + return (0); + } + + if (bufsize > sc->inbuflen) + bufsize = sc->inbuflen; + + if (hdr == 1) { + sc->inbuflen = sc->inbuflen - 4; + /* The HVSI protocol has a 4 byte header, skip it */ + memmove(&sc->opal_inbuf[0], &sc->opal_inbuf[4], + sc->inbuflen); + } + + memcpy(buffer, sc->opal_inbuf, bufsize); + sc->inbuflen -= bufsize; + if (sc->inbuflen > 0) + memmove(&sc->opal_inbuf[0], &sc->opal_inbuf[bufsize], + sc->inbuflen); + + uart_unlock(&sc->sc_mtx); + } + + return (bufsize); +} + +static int +uart_opal_put(struct uart_opal_softc *sc, void *buffer, size_t bufsize) +{ + uint16_t seqno; + uint64_t len = bufsize; + char cbuf[16]; + int err; + uint64_t olen = (uint64_t)&len; + uint64_t obuf = (uint64_t)cbuf; + + if (pmap_bootstrapped) + olen = vtophys(&len); + + if (sc->protocol == OPAL_RAW) { + if (pmap_bootstrapped) + obuf = vtophys(buffer); + else + obuf = (uint64_t)(buffer); + + err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); + } else { + if (pmap_bootstrapped) + obuf = vtophys(cbuf); + uart_lock(&sc->sc_mtx); + if (bufsize > 12) + bufsize = 12; + seqno = sc->outseqno++; + cbuf[0] = VS_DATA_PACKET_HEADER; + cbuf[1] = 4 + bufsize; /* total length */ + cbuf[2] = (seqno >> 8) & 0xff; + cbuf[3] = seqno & 0xff; + memcpy(&cbuf[4], buffer, bufsize); + len = 4 + bufsize; + err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); + uart_unlock(&sc->sc_mtx); + + len -= 4; + } + +#if 0 + if (err != OPAL_SUCCESS) + len = 0; +#endif + + return (len); +} + +static int +uart_opal_cngetc(struct consdev *cp) +{ + unsigned char c; + int retval; + + retval = uart_opal_get(console_sc, &c, 1); + if (retval != 1) + return (-1); +#if defined(KDB) + kdb_alt_break(c, &alt_break_state); +#endif + + return (c); +} + +static void +uart_opal_cnputc(struct consdev *cp, int c) +{ + unsigned char ch = c; + uart_opal_put(console_sc, &ch, 1); +} + +static void +uart_opal_cngrab(struct consdev *cp) +{ +} + +static void +uart_opal_cnungrab(struct consdev *cp) +{ +} + +static void +uart_opal_ttyoutwakeup(struct tty *tp) +{ + struct uart_opal_softc *sc; + char buffer[8]; + int len; + + sc = tty_softc(tp); + + while ((len = ttydisc_getc(tp, buffer, sizeof(buffer))) != 0) + uart_opal_put(sc, buffer, len); +} + +static void +uart_opal_intr(void *v) +{ + struct uart_opal_softc *sc = v; + struct tty *tp = sc->tp; + unsigned char c; + int len; + + tty_lock(tp); + while ((len = uart_opal_get(sc, &c, 1)) > 0) + ttydisc_rint(tp, c, 0); + ttydisc_rint_done(tp); + tty_unlock(tp); + + if (sc->irqres == NULL) + callout_reset(&sc->callout, sc->polltime, uart_opal_intr, sc); +} + Added: head/sys/powerpc/powernv/opalcall.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opalcall.S Thu Jan 11 07:40:06 2018 (r327810) @@ -0,0 +1,99 @@ +/*- + * Copyright (C) 2015 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +GLOBAL(opal_entrypoint) + .llong 0 +GLOBAL(opal_data) + .llong 0 +GLOBAL(opal_msr) + .llong 0 + +TOC_ENTRY(opal_entrypoint) +TOC_ENTRY(opal_data) +TOC_ENTRY(opal_msr) + +ASENTRY(opal_call) + /* Args: + * r3: opal token + * r4-r10 opal arguments + */ + + /* Save call stuff on stack */ + mflr %r0 + std %r0,16(%r1) + std %r2,-16(%r1) + mfcr %r0 + std %r0,8(%r1) + + /* Load OPAL entry information */ + mr %r0,%r3 + ld %r3,TOC_REF(opal_entrypoint)(%r2) + ld %r3,0(%r3) + mtctr %r3 + + /* Save MSR in non-volatile scratch register and turn off translation */ + std %r31,-8(%r1) + mfmsr %r31 + + /* Load last bits from the TOC */ + ld %r3,TOC_REF(opal_msr)(%r2) + ld %r3,0(%r3) + ld %r2,TOC_REF(opal_data)(%r2) + ld %r2,0(%r2) + + mtmsrd %r3 + isync + + /* Shift registers over */ + mr %r3,%r4 + mr %r4,%r5 + mr %r5,%r6 + mr %r6,%r7 + mr %r7,%r8 + mr %r8,%r9 + mr %r9,%r10 + + /* Call OPAL */ + bctrl + + /* Restore MSR */ + mtmsrd %r31 + isync + ld %r31,-8(%r1) + + /* Restore call stuff from stack */ + ld %r0,16(%r1) + mtlr %r0 + ld %r2,-16(%r1) + ld %r0,8(%r1) + mtcr %r0 + + /* And return */ + blr + Added: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 07:40:06 2018 (r327810) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2015 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "platform_if.h" +#include "opal.h" + +#ifdef SMP +extern void *ap_pcpu; +#endif + +static int powernv_probe(platform_t); +static int powernv_attach(platform_t); +void powernv_mem_regions(platform_t, struct mem_region *phys, int *physsz, + struct mem_region *avail, int *availsz); +static u_long powernv_timebase_freq(platform_t, struct cpuref *cpuref); +static int powernv_smp_first_cpu(platform_t, struct cpuref *cpuref); +static int powernv_smp_next_cpu(platform_t, struct cpuref *cpuref); +static int powernv_smp_get_bsp(platform_t, struct cpuref *cpuref); +static void powernv_smp_ap_init(platform_t); +#ifdef SMP +static int powernv_smp_start_cpu(platform_t, struct pcpu *cpu); +static struct cpu_group *powernv_smp_topo(platform_t plat); +#endif +static void powernv_reset(platform_t); + +static platform_method_t powernv_methods[] = { + PLATFORMMETHOD(platform_probe, powernv_probe), + PLATFORMMETHOD(platform_attach, powernv_attach), + PLATFORMMETHOD(platform_mem_regions, powernv_mem_regions), + PLATFORMMETHOD(platform_timebase_freq, powernv_timebase_freq), + + PLATFORMMETHOD(platform_smp_ap_init, powernv_smp_ap_init), + PLATFORMMETHOD(platform_smp_first_cpu, powernv_smp_first_cpu), + PLATFORMMETHOD(platform_smp_next_cpu, powernv_smp_next_cpu), + PLATFORMMETHOD(platform_smp_get_bsp, powernv_smp_get_bsp), +#ifdef SMP + PLATFORMMETHOD(platform_smp_start_cpu, powernv_smp_start_cpu), + PLATFORMMETHOD(platform_smp_topo, powernv_smp_topo), +#endif + + PLATFORMMETHOD(platform_reset, powernv_reset), + + { 0, 0 } +}; + +static platform_def_t powernv_platform = { + "powernv", + powernv_methods, + 0 +}; + +PLATFORM_DEF(powernv_platform); + +static int +powernv_probe(platform_t plat) +{ + if (opal_check() == 0) + return (BUS_PROBE_SPECIFIC); + + return (ENXIO); +} + +static int +powernv_attach(platform_t plat) +{ + /* Ping OPAL again just to make sure */ + opal_check(); + + return (0); +} + +void +powernv_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, + struct mem_region *avail, int *availsz) +{ + + ofw_mem_regions(phys, physsz, avail, availsz); +} + +static u_long +powernv_timebase_freq(platform_t plat, struct cpuref *cpuref) +{ + phandle_t phandle; + int32_t ticks = -1; + + phandle = cpuref->cr_hwref; + + OF_getprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); + + if (ticks <= 0) + panic("Unable to determine timebase frequency!"); + + return (ticks); +} + +static int +powernv_smp_first_cpu(platform_t plat, struct cpuref *cpuref) +{ + char buf[8]; + phandle_t cpu, dev, root; + int res, cpuid; + + root = OF_peer(0); + + dev = OF_child(root); + while (dev != 0) { + res = OF_getprop(dev, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpus") == 0) + break; + dev = OF_peer(dev); + } + if (dev == 0) { + /* + * psim doesn't have a name property on the /cpus node, + * but it can be found directly + */ + dev = OF_finddevice("/cpus"); + if (dev == 0) + return (ENOENT); + } + + cpu = OF_child(dev); + + while (cpu != 0) { + res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + cpu = OF_peer(cpu); + } + if (cpu == 0) + return (ENOENT); + + cpuref->cr_hwref = cpu; + res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + sizeof(cpuid)); + if (res <= 0) + res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + cpuref->cr_cpuid = cpuid; + + return (0); +} + +static int +powernv_smp_next_cpu(platform_t plat, struct cpuref *cpuref) +{ + char buf[8]; + phandle_t cpu; + int i, res, cpuid; + + /* Check for whether it should be the next thread */ + res = OF_getproplen(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s"); + if (res > 0) { + cell_t interrupt_servers[res/sizeof(cell_t)]; + OF_getprop(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s", + interrupt_servers, res); + for (i = 0; i < res/sizeof(cell_t) - 1; i++) { + if (interrupt_servers[i] == cpuref->cr_cpuid) { + cpuref->cr_cpuid = interrupt_servers[i+1]; + return (0); + } + } + } + + /* Next CPU core/package */ + cpu = OF_peer(cpuref->cr_hwref); + while (cpu != 0) { + res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + cpu = OF_peer(cpu); + } + if (cpu == 0) + return (ENOENT); + + cpuref->cr_hwref = cpu; + res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + sizeof(cpuid)); + if (res <= 0) + res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + cpuref->cr_cpuid = cpuid; + + return (0); +} + +static int +powernv_smp_get_bsp(platform_t plat, struct cpuref *cpuref) +{ + phandle_t chosen; + int cpuid, res; + struct cpuref i; + + chosen = OF_finddevice("/chosen"); + if (chosen == 0) + return (ENOENT); + + res = OF_getencprop(chosen, "fdtbootcpu", &cpuid, sizeof(cpuid)); + if (res < 0) + return (ENOENT); + + cpuref->cr_cpuid = cpuid; + + if (powernv_smp_first_cpu(plat, &i) != 0) + return (ENOENT); + cpuref->cr_hwref = i.cr_hwref; + + do { + if (i.cr_cpuid == cpuid) { + cpuref->cr_hwref = i.cr_hwref; + break; + } + } while (powernv_smp_next_cpu(plat, &i) == 0); + + return (0); +} + +#ifdef SMP +static int +powernv_smp_start_cpu(platform_t plat, struct pcpu *pc) +{ + int result, err, timeout; + + ap_pcpu = pc; + powerpc_sync(); + + result = opal_call(OPAL_START_CPU, pc->pc_cpuid, EXC_RST); + if (result < 0 || err != 0) { + printf("OPAL error (%d/%d): unable to start AP %d\n", + result, err, pc->pc_cpuid); + return (ENXIO); + } + + timeout = 10000; + while (!pc->pc_awake && timeout--) + DELAY(100); + + return ((pc->pc_awake) ? 0 : EBUSY); +} + +static struct cpu_group * +powernv_smp_topo(platform_t plat) +{ + struct pcpu *pc, *last_pc; + int i, ncores, ncpus; + + ncores = ncpus = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 11 09:17:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1749E7983A; Thu, 11 Jan 2018 09:17:03 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99A8B335E; Thu, 11 Jan 2018 09:17:03 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D733B12E09; Thu, 11 Jan 2018 09:17:02 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B9H2pC024046; Thu, 11 Jan 2018 09:17:02 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B9H2if024045; Thu, 11 Jan 2018 09:17:02 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110917.w0B9H2if024045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 09:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327811 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 327811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 09:17:03 -0000 Author: wma Date: Thu Jan 11 09:17:02 2018 New Revision: 327811 URL: https://svnweb.freebsd.org/changeset/base/327811 Log: CXGBE: fix get_filt to be endianness-aware Unconditional 32-bit shift is not endianness-safe. Modify the logic to work both on LE and BE. Submitted by: Wojciech Macek Reviewed by: np Obtained from: Semihalf Sponsored by: IBM, QCM Technologies Differential revision: https://reviews.freebsd.org/D13102 Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jan 11 07:40:06 2018 (r327810) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jan 11 09:17:02 2018 (r327811) @@ -4754,13 +4754,13 @@ get_flit(struct sglist_seg *segs, int nsegs, int idx) switch (idx % 3) { case 0: { - __be64 rc; + uint64_t rc; - rc = htobe32(segs[i].ss_len); + rc = (uint64_t)segs[i].ss_len << 32; if (i + 1 < nsegs) - rc |= (uint64_t)htobe32(segs[i + 1].ss_len) << 32; + rc |= (uint64_t)(segs[i + 1].ss_len); - return (rc); + return (htobe64(rc)); } case 1: return (htobe64(segs[i].ss_paddr)); From owner-svn-src-all@freebsd.org Thu Jan 11 09:26:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05CE6E7A008; Thu, 11 Jan 2018 09:26:30 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D20273B85; Thu, 11 Jan 2018 09:26:29 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 138BB12FE9; Thu, 11 Jan 2018 09:26:29 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B9QSvr028029; Thu, 11 Jan 2018 09:26:28 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B9QSW3028025; Thu, 11 Jan 2018 09:26:28 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110926.w0B9QSW3028025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 09:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327812 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 327812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 09:26:30 -0000 Author: wma Date: Thu Jan 11 09:26:28 2018 New Revision: 327812 URL: https://svnweb.freebsd.org/changeset/base/327812 Log: PowerNV: add reset, poweroff, OPAL console Add basic power control (reset, power off) and bind ttyuX to opal console so that init will start login there. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Added: head/sys/powerpc/powernv/opal_dev.c (contents, props changed) Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_console.c head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Thu Jan 11 09:17:02 2018 (r327811) +++ head/sys/powerpc/powernv/opal.h Thu Jan 11 09:26:28 2018 (r327812) @@ -40,6 +40,8 @@ int opal_call(uint64_t token, ...); #define OPAL_CONSOLE_WRITE 1 #define OPAL_CONSOLE_READ 2 +#define OPAL_CEC_POWER_DOWN 5 +#define OPAL_CEC_REBOOT 6 #define OPAL_START_CPU 41 #define OPAL_SUCCESS 0 Modified: head/sys/powerpc/powernv/opal_console.c ============================================================================== --- head/sys/powerpc/powernv/opal_console.c Thu Jan 11 09:17:02 2018 (r327811) +++ head/sys/powerpc/powernv/opal_console.c Thu Jan 11 09:26:28 2018 (r327812) @@ -439,3 +439,76 @@ uart_opal_intr(void *v) callout_reset(&sc->callout, sc->polltime, uart_opal_intr, sc); } +static int +opalcons_probe(device_t dev) +{ + const char *name; + + name = ofw_bus_get_name(dev); + if (name == NULL || strcmp(name, "consoles") != 0) + return (ENXIO); + + device_set_desc(dev, "OPAL Consoles"); + return (BUS_PROBE_SPECIFIC); +} + +static int +opalcons_attach(device_t dev) +{ + phandle_t child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +opalcons_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +static device_method_t opalcons_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opalcons_probe), + DEVMETHOD(device_attach, opalcons_attach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, opalcons_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 +}; + +static driver_t opalcons_driver = { + "opalcons", + opalcons_methods, + 0 +}; + +static devclass_t opalcons_devclass; + +DRIVER_MODULE(opalcons, opal, opalcons_driver, opalcons_devclass, 0, 0); + Added: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_dev.c Thu Jan 11 09:26:28 2018 (r327812) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2015 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "opal.h" + +static int opaldev_probe(device_t); +static int opaldev_attach(device_t); +/* clock interface */ +static int opal_gettime(device_t dev, struct timespec *ts); +static int opal_settime(device_t dev, struct timespec *ts); +/* ofw bus interface */ +static const struct ofw_bus_devinfo *opaldev_get_devinfo(device_t dev, + device_t child); + +static void opal_shutdown(void *arg, int howto); + +static device_method_t opaldev_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opaldev_probe), + DEVMETHOD(device_attach, opaldev_attach), + + /* clock interface */ + DEVMETHOD(clock_gettime, opal_gettime), + DEVMETHOD(clock_settime, opal_settime), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, opaldev_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 +}; + +static driver_t opaldev_driver = { + "opal", + opaldev_methods, + 0 +}; + +static devclass_t opaldev_devclass; + +DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev_devclass, 0, 0); + +static int +opaldev_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ibm,opal-v3")) + return (ENXIO); + if (opal_check() != 0) + return (ENXIO); + + device_set_desc(dev, "OPAL Abstraction Firmware"); + return (BUS_PROBE_SPECIFIC); +} + +static int +opaldev_attach(device_t dev) +{ + phandle_t child; + device_t cdev; + struct ofw_bus_devinfo *dinfo; + + if (0 /* XXX NOT YET TEST FOR RTC */) + clock_register(dev, 2000); + + EVENTHANDLER_REGISTER(shutdown_final, opal_shutdown, NULL, + SHUTDOWN_PRI_LAST); + + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static int +opal_gettime(device_t dev, struct timespec *ts) { + return (ENXIO); +} + +static int +opal_settime(device_t dev, struct timespec *ts) +{ + return (0); +} + +static const struct ofw_bus_devinfo * +opaldev_get_devinfo(device_t dev, device_t child) +{ + return (device_get_ivars(child)); +} + +static void +opal_shutdown(void *arg, int howto) +{ + + if (howto & RB_HALT) + opal_call(OPAL_CEC_POWER_DOWN, 0 /* Normal power off */); + else + opal_call(OPAL_CEC_REBOOT); +} + Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:17:02 2018 (r327811) +++ head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:26:28 2018 (r327812) @@ -324,6 +324,8 @@ powernv_smp_topo(platform_t plat) static void powernv_reset(platform_t platform) { + + opal_call(OPAL_CEC_REBOOT); } static void From owner-svn-src-all@freebsd.org Thu Jan 11 09:34:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1227AE7A5EA; Thu, 11 Jan 2018 09:34:35 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15C7633DC; Thu, 11 Jan 2018 09:34:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 137061317C; Thu, 11 Jan 2018 09:34:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B9YX3R032078; Thu, 11 Jan 2018 09:34:33 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B9YXuk032077; Thu, 11 Jan 2018 09:34:33 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110934.w0B9YXuk032077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 09:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327813 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 327813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 09:34:35 -0000 Author: wma Date: Thu Jan 11 09:34:33 2018 New Revision: 327813 URL: https://svnweb.freebsd.org/changeset/base/327813 Log: PowerNV: correctly start secondary CPUs Fix AP startup, which was broken. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:26:28 2018 (r327812) +++ head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:34:33 2018 (r327813) @@ -71,6 +71,7 @@ static int powernv_smp_start_cpu(platform_t, struct pc static struct cpu_group *powernv_smp_topo(platform_t plat); #endif static void powernv_reset(platform_t); +static void powernv_cpu_idle(sbintime_t sbt); static platform_method_t powernv_methods[] = { PLATFORMMETHOD(platform_probe, powernv_probe), @@ -115,6 +116,8 @@ powernv_attach(platform_t plat) /* Ping OPAL again just to make sure */ opal_check(); + cpu_idle_hook = powernv_cpu_idle; + return (0); } @@ -270,23 +273,19 @@ powernv_smp_get_bsp(platform_t plat, struct cpuref *cp static int powernv_smp_start_cpu(platform_t plat, struct pcpu *pc) { - int result, err, timeout; + int result; ap_pcpu = pc; powerpc_sync(); result = opal_call(OPAL_START_CPU, pc->pc_cpuid, EXC_RST); - if (result < 0 || err != 0) { - printf("OPAL error (%d/%d): unable to start AP %d\n", - result, err, pc->pc_cpuid); + if (result != OPAL_SUCCESS) { + printf("OPAL error (%d): unable to start AP %d\n", + result, pc->pc_cpuid); return (ENXIO); } - timeout = 10000; - while (!pc->pc_awake && timeout--) - DELAY(100); - - return ((pc->pc_awake) ? 0 : EBUSY); + return (0); } static struct cpu_group * @@ -333,3 +332,7 @@ powernv_smp_ap_init(platform_t platform) { } +static void +powernv_cpu_idle(sbintime_t sbt) +{ +} From owner-svn-src-all@freebsd.org Thu Jan 11 09:39:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E976DE7A991; Thu, 11 Jan 2018 09:39:39 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3DC563635; Thu, 11 Jan 2018 09:39:39 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F6CE13182; Thu, 11 Jan 2018 09:39:39 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B9dcmV032282; Thu, 11 Jan 2018 09:39:38 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B9dcMW032280; Thu, 11 Jan 2018 09:39:38 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110939.w0B9dcMW032280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 09:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327814 - in head/sys/powerpc: include powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys/powerpc: include powernv X-SVN-Commit-Revision: 327814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 09:39:40 -0000 Author: wma Date: Thu Jan 11 09:39:38 2018 New Revision: 327814 URL: https://svnweb.freebsd.org/changeset/base/327814 Log: PowerNV: set LPCR[LPES] correctly Make sure to set LPCR[LPES] so that external interrupts set SRR0 and SRR1 instead of HSRR0 and HSRR1. Without this, external interrupt handlers would get the wrong MSR value when executing, causing eventual madness. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/include/spr.h head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Thu Jan 11 09:34:33 2018 (r327813) +++ head/sys/powerpc/include/spr.h Thu Jan 11 09:39:38 2018 (r327814) @@ -199,6 +199,9 @@ #define FSL_E300C3 0x8085 #define FSL_E300C4 0x8086 +#define SPR_LPCR 0x13e /* Logical Partitioning Control */ +#define LPCR_LPES 0x008 /* Bit 60 */ + #define SPR_EPCR 0x133 #define EPCR_EXTGS 0x80000000 #define EPCR_DTLBGS 0x40000000 Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:34:33 2018 (r327813) +++ head/sys/powerpc/powernv/platform_powernv.c Thu Jan 11 09:39:38 2018 (r327814) @@ -118,6 +118,9 @@ powernv_attach(platform_t plat) cpu_idle_hook = powernv_cpu_idle; + /* Direct interrupts to SRR instead of HSRR */ + mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_LPES); + return (0); } From owner-svn-src-all@freebsd.org Thu Jan 11 09:42:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2756FE7AC44; Thu, 11 Jan 2018 09:42:26 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD32063A3B; Thu, 11 Jan 2018 09:42:25 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CFA213305; Thu, 11 Jan 2018 09:42:25 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0B9gOUP036448; Thu, 11 Jan 2018 09:42:24 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0B9gOMd036447; Thu, 11 Jan 2018 09:42:24 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801110942.w0B9gOMd036447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 11 Jan 2018 09:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327815 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 327815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 09:42:26 -0000 Author: wma Date: Thu Jan 11 09:42:24 2018 New Revision: 327815 URL: https://svnweb.freebsd.org/changeset/base/327815 Log: PowerNV: add buffer for OPAL console Avoid the lock in vtophys() by providing a static direct-mapped spinlock- protected output buffer to use when the console driver cannot acquire locks for some reason. This allows the idle thread to use printf() (e.g. the SMP startup messages) without crashing the kernel. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/powernv/opal_console.c Modified: head/sys/powerpc/powernv/opal_console.c ============================================================================== --- head/sys/powerpc/powernv/opal_console.c Thu Jan 11 09:39:38 2018 (r327814) +++ head/sys/powerpc/powernv/opal_console.c Thu Jan 11 09:42:24 2018 (r327815) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -72,6 +73,7 @@ struct uart_opal_softc { }; static struct uart_opal_softc *console_sc = NULL; + #if defined(KDB) static int alt_break_state; #endif @@ -127,6 +129,48 @@ static struct ttydevsw uart_opal_tty_class = { .tsw_outwakeup = uart_opal_ttyoutwakeup, }; +static struct { + char tmpbuf[16]; + uint64_t size; + struct mtx mtx; +} escapehatch; + +static void +uart_opal_real_map_outbuffer(uint64_t *bufferp, uint64_t *lenp) +{ + + if (!mtx_initialized(&escapehatch.mtx)) + mtx_init(&escapehatch.mtx, "uart_opal", NULL, MTX_SPIN | MTX_QUIET | + MTX_NOWITNESS); + + if (!pmap_bootstrapped) + return; + + if (TD_IS_IDLETHREAD(curthread)) { + escapehatch.size = *(uint64_t *)(*lenp) = + min(sizeof(escapehatch.tmpbuf), *(uint64_t *)(*lenp)); + mtx_lock_spin(&escapehatch.mtx); + memcpy(escapehatch.tmpbuf, (void *)(*bufferp), *(uint64_t *)(*lenp)); + *bufferp = (uint64_t)escapehatch.tmpbuf; + *lenp = (uint64_t)&escapehatch.size; + } + + *bufferp = vtophys(*bufferp); + *lenp = vtophys(*lenp); +} + +static void +uart_opal_real_unmap_outbuffer(uint64_t lenp, uint64_t *origlen) +{ + + if (!pmap_bootstrapped || !TD_IS_IDLETHREAD(curthread)) + return; + + mtx_assert(&escapehatch.mtx, MA_OWNED); + *origlen = escapehatch.size; + mtx_unlock_spin(&escapehatch.mtx); +} + static int uart_opal_probe_node(struct uart_opal_softc *sc) { @@ -231,6 +275,7 @@ uart_opal_attach(device_t dev) MTX_SPIN | MTX_QUIET | MTX_NOWITNESS); if (console_sc != NULL && console_sc->vtermid == sc->vtermid) { + device_printf(dev, "console\n"); sc->outseqno = console_sc->outseqno; console_sc = sc; sprintf(uart_opal_consdev.cn_name, "ttyu%r", unit); @@ -332,25 +377,20 @@ static int uart_opal_put(struct uart_opal_softc *sc, void *buffer, size_t bufsize) { uint16_t seqno; - uint64_t len = bufsize; + uint64_t len; char cbuf[16]; int err; uint64_t olen = (uint64_t)&len; uint64_t obuf = (uint64_t)cbuf; - if (pmap_bootstrapped) - olen = vtophys(&len); - if (sc->protocol == OPAL_RAW) { - if (pmap_bootstrapped) - obuf = vtophys(buffer); - else - obuf = (uint64_t)(buffer); + obuf = (uint64_t)buffer; + len = bufsize; + uart_opal_real_map_outbuffer(&obuf, &olen); err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); + uart_opal_real_unmap_outbuffer(olen, &len); } else { - if (pmap_bootstrapped) - obuf = vtophys(cbuf); uart_lock(&sc->sc_mtx); if (bufsize > 12) bufsize = 12; @@ -361,7 +401,11 @@ uart_opal_put(struct uart_opal_softc *sc, void *buffer cbuf[3] = seqno & 0xff; memcpy(&cbuf[4], buffer, bufsize); len = 4 + bufsize; + + uart_opal_real_map_outbuffer(&obuf, &olen); err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); + uart_opal_real_unmap_outbuffer(olen, &len); + uart_unlock(&sc->sc_mtx); len -= 4; From owner-svn-src-all@freebsd.org Thu Jan 11 12:07:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01A24EA53C9; Thu, 11 Jan 2018 12:07:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF5D56C8E7; Thu, 11 Jan 2018 12:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CE7F149CC; Thu, 11 Jan 2018 12:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BC7O2v094921; Thu, 11 Jan 2018 12:07:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BC7O9p094919; Thu, 11 Jan 2018 12:07:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111207.w0BC7O9p094919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 12:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327816 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 12:07:26 -0000 Author: kib Date: Thu Jan 11 12:07:24 2018 New Revision: 327816 URL: https://svnweb.freebsd.org/changeset/base/327816 Log: Update comment explaining the check, to reality. Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Thu Jan 11 09:42:24 2018 (r327815) +++ head/sys/amd64/amd64/support.S Thu Jan 11 12:07:24 2018 (r327816) @@ -249,12 +249,10 @@ ENTRY(copyout) jz done_copyout /* - * Check explicitly for non-user addresses. If 486 write protection - * is being used, this check is essential because we are in kernel - * mode so the h/w does not provide any protection against writing - * kernel addresses. + * Check explicitly for non-user addresses. This check is essential + * because it prevents usermode from writing into kernel. We do not + * verify that user did not specified a rogue address anywhere else. */ - /* * First, prevent address wrapping. */ Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Thu Jan 11 09:42:24 2018 (r327815) +++ head/sys/i386/i386/support.s Thu Jan 11 12:07:24 2018 (r327816) @@ -291,12 +291,10 @@ ENTRY(copyout) jz done_copyout /* - * Check explicitly for non-user addresses. If 486 write protection - * is being used, this check is essential because we are in kernel - * mode so the h/w does not provide any protection against writing - * kernel addresses. + * Check explicitly for non-user addresses. This check is essential + * because it prevents usermode from writing into kernel. We do not + * verify that user did not specified a rogue address anywhere else. */ - /* * First, prevent address wrapping. */ From owner-svn-src-all@freebsd.org Thu Jan 11 12:28:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AFEDE5BC89; Thu, 11 Jan 2018 12:28:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 051EE6D7FF; Thu, 11 Jan 2018 12:28:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BEC914D54; Thu, 11 Jan 2018 12:28:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BCS9P8003379; Thu, 11 Jan 2018 12:28:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BCS9Mu003377; Thu, 11 Jan 2018 12:28:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111228.w0BCS9Mu003377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 12:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327817 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 327817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 12:28:10 -0000 Author: kib Date: Thu Jan 11 12:28:08 2018 New Revision: 327817 URL: https://svnweb.freebsd.org/changeset/base/327817 Log: Rename COMMON_TSS_RSP0 to TSS_RSP0. The symbol is just an offset in the hardware TSS structure, it is not limited to the common_tss instance. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/genassym.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Thu Jan 11 12:07:24 2018 (r327816) +++ head/sys/amd64/amd64/cpu_switch.S Thu Jan 11 12:28:08 2018 (r327817) @@ -215,7 +215,7 @@ done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ - movq %r8,COMMON_TSS_RSP0(%rdx) + movq %r8,TSS_RSP0(%rdx) movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Thu Jan 11 12:07:24 2018 (r327816) +++ head/sys/amd64/amd64/genassym.c Thu Jan 11 12:28:08 2018 (r327817) @@ -153,7 +153,7 @@ ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_32BIT, PCB_32BIT); -ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0)); +ASSYM(TSS_RSP0, offsetof(struct amd64tss, tss_rsp0)); ASSYM(TF_R15, offsetof(struct trapframe, tf_r15)); ASSYM(TF_R14, offsetof(struct trapframe, tf_r14)); From owner-svn-src-all@freebsd.org Thu Jan 11 12:40:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C811CE5C5E1; Thu, 11 Jan 2018 12:40:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A24006E0B2; Thu, 11 Jan 2018 12:40:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDC4314F32; Thu, 11 Jan 2018 12:40:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BCehwK008192; Thu, 11 Jan 2018 12:40:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BCehuj008189; Thu, 11 Jan 2018 12:40:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111240.w0BCehuj008189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 12:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327818 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 327818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 12:40:44 -0000 Author: kib Date: Thu Jan 11 12:40:43 2018 New Revision: 327818 URL: https://svnweb.freebsd.org/changeset/base/327818 Log: Move the hardware setup for fast syscalls into a common function. Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/md_var.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Jan 11 12:28:08 2018 (r327817) +++ head/sys/amd64/amd64/machdep.c Thu Jan 11 12:40:43 2018 (r327818) @@ -1512,6 +1512,22 @@ amd64_kdb_init(void) #endif } +/* Set up the fast syscall stuff */ +void +amd64_conf_fast_syscall(void) +{ + uint64_t msr; + + msr = rdmsr(MSR_EFER) | EFER_SCE; + wrmsr(MSR_EFER, msr); + wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); + wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); + msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | + ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); + wrmsr(MSR_STAR, msr); + wrmsr(MSR_SF_MASK, PSL_NT | PSL_T | PSL_I | PSL_C | PSL_D); +} + u_int64_t hammer_time(u_int64_t modulep, u_int64_t physfree) { @@ -1520,7 +1536,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) struct pcpu *pc; struct nmi_pcpu *np; struct xstate_hdr *xhdr; - u_int64_t msr; char *env; size_t kstack0_sz; int late_console; @@ -1663,15 +1678,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); - /* Set up the fast syscall stuff */ - msr = rdmsr(MSR_EFER) | EFER_SCE; - wrmsr(MSR_EFER, msr); - wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); - wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); - msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | - ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); - wrmsr(MSR_STAR, msr); - wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); + amd64_conf_fast_syscall(); /* * Temporary forge some valid pointer to PCB, for exception Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Jan 11 12:28:08 2018 (r327817) +++ head/sys/amd64/amd64/mp_machdep.c Thu Jan 11 12:40:43 2018 (r327818) @@ -89,8 +89,6 @@ extern struct pcpu __pcpu[]; char *doublefault_stack; char *nmi_stack; -extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); - /* * Local data and functions. */ @@ -190,7 +188,7 @@ init_secondary(void) { struct pcpu *pc; struct nmi_pcpu *np; - u_int64_t msr, cr0; + u_int64_t cr0; int cpu, gsel_tss, x; struct region_descriptor ap_gdt; @@ -265,15 +263,7 @@ init_secondary(void) cr0 &= ~(CR0_CD | CR0_NW | CR0_EM); load_cr0(cr0); - /* Set up the fast syscall stuff */ - msr = rdmsr(MSR_EFER) | EFER_SCE; - wrmsr(MSR_EFER, msr); - wrmsr(MSR_LSTAR, (u_int64_t)IDTVEC(fast_syscall)); - wrmsr(MSR_CSTAR, (u_int64_t)IDTVEC(fast_syscall32)); - msr = ((u_int64_t)GSEL(GCODE_SEL, SEL_KPL) << 32) | - ((u_int64_t)GSEL(GUCODE32_SEL, SEL_UPL) << 48); - wrmsr(MSR_STAR, msr); - wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); + amd64_conf_fast_syscall(); /* signal our startup to the BSP. */ mp_naps++; Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Thu Jan 11 12:28:08 2018 (r327817) +++ head/sys/amd64/include/md_var.h Thu Jan 11 12:40:43 2018 (r327818) @@ -42,6 +42,7 @@ extern int hw_lower_amd64_sharedpage; struct savefpu; struct sysentvec; +void amd64_conf_fast_syscall(void); void amd64_db_resume_dbreg(void); void amd64_lower_shared_page(struct sysentvec *); void amd64_syscall(struct thread *td, int traced); From owner-svn-src-all@freebsd.org Thu Jan 11 12:54:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16B8DE5D3F6; Thu, 11 Jan 2018 12:54:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5EB26EA5A; Thu, 11 Jan 2018 12:54:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A97A15247; Thu, 11 Jan 2018 12:54:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BCsYub016213; Thu, 11 Jan 2018 12:54:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BCsYvQ016212; Thu, 11 Jan 2018 12:54:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111254.w0BCsYvQ016212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 12:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327819 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 327819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 12:54:35 -0000 Author: kib Date: Thu Jan 11 12:54:33 2018 New Revision: 327819 URL: https://svnweb.freebsd.org/changeset/base/327819 Log: Do not clear %RFLAGS.DF on fast syscall entry. Hardware already did it for us due to the mask loaded into the MSR_SF_MASK msr register. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13838 Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu Jan 11 12:40:43 2018 (r327818) +++ head/sys/amd64/amd64/exception.S Thu Jan 11 12:54:33 2018 (r327819) @@ -410,7 +410,6 @@ IDTVEC(fast_syscall) movq %r14,TF_R14(%rsp) /* C preserved */ movq %r15,TF_R15(%rsp) /* C preserved */ movl $TF_HASSEGS,TF_FLAGS(%rsp) - cld FAKE_MCOUNT(TF_RIP(%rsp)) movq PCPU(CURTHREAD),%rdi movq %rsp,TD_FRAME(%rdi) From owner-svn-src-all@freebsd.org Thu Jan 11 13:22:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0C28E60FBB; Thu, 11 Jan 2018 13:22:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C81826FCB2; Thu, 11 Jan 2018 13:22:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B9815706; Thu, 11 Jan 2018 13:22:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BDMDAs028232; Thu, 11 Jan 2018 13:22:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BDMDvk028230; Thu, 11 Jan 2018 13:22:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111322.w0BDMDvk028230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 13:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327820 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 13:22:15 -0000 Author: kib Date: Thu Jan 11 13:22:13 2018 New Revision: 327820 URL: https://svnweb.freebsd.org/changeset/base/327820 Log: Remove redundand CLD instructions. We already clear %RFLAGS.DF on the kernel entry due to the compiler's ABI requirements. Suggested by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Thu Jan 11 12:54:33 2018 (r327819) +++ head/sys/amd64/amd64/support.S Thu Jan 11 13:22:13 2018 (r327820) @@ -50,7 +50,6 @@ ENTRY(bzero) movq %rsi,%rcx xorl %eax,%eax shrq $3,%rcx - cld rep stosq movq %rsi,%rcx @@ -100,7 +99,6 @@ ENTRY(bcmp) PUSH_FRAME_POINTER movq %rdx,%rcx shrq $3,%rcx - cld /* compare forwards */ repe cmpsq jne 1f @@ -132,7 +130,6 @@ ENTRY(bcopy) jb 1f shrq $3,%rcx /* copy by 64-bit words */ - cld /* nope, copy forwards */ rep movsq movq %rdx,%rcx @@ -171,7 +168,6 @@ ENTRY(memcpy) movq %rdi,%rax movq %rdx,%rcx shrq $3,%rcx /* copy by 64-bit words */ - cld /* copy forwards */ rep movsq movq %rdx,%rcx @@ -218,7 +214,6 @@ ENTRY(fillw) movq %rdi,%rax movq %rsi,%rdi movq %rdx,%rcx - cld rep stosw POP_FRAME_POINTER @@ -274,7 +269,6 @@ ENTRY(copyout) movq %rdx,%rcx shrq $3,%rcx - cld rep movsq movb %dl,%cl @@ -323,7 +317,6 @@ ENTRY(copyin) movq %rdx,%rcx movb %cl,%al shrq $3,%rcx /* copy longword-wise */ - cld rep movsq movb %al,%cl @@ -620,7 +613,6 @@ ENTRY(copyinstr) movq %rax,%r8 1: incq %rdx - cld 2: decq %rdx @@ -671,7 +663,6 @@ ENTRY(copystr) xchgq %rdi,%rsi incq %rdx - cld 1: decq %rdx jz 4f Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Thu Jan 11 12:54:33 2018 (r327819) +++ head/sys/i386/i386/support.s Thu Jan 11 13:22:13 2018 (r327820) @@ -50,7 +50,6 @@ ENTRY(bzero) movl 12(%esp),%ecx xorl %eax,%eax shrl $2,%ecx - cld rep stosl movl 12(%esp),%ecx @@ -90,7 +89,6 @@ ENTRY(i686_pagezero) movl 12(%esp),%edi movl $1024,%ecx - cld ALIGN_TEXT 1: @@ -141,7 +139,6 @@ ENTRY(fillw) movl 8(%esp),%eax movl 12(%esp),%edi movl 16(%esp),%ecx - cld rep stosw popl %edi @@ -158,7 +155,6 @@ ENTRY(bcopyb) subl %esi,%eax cmpl %ecx,%eax /* overlapping && src < dst? */ jb 1f - cld /* nope, copy forwards */ rep movsb popl %edi @@ -199,7 +195,6 @@ ENTRY(bcopy) jb 1f shrl $2,%ecx /* copy by 32-bit words */ - cld /* nope, copy forwards */ rep movsl movl 16(%ebp),%ecx @@ -245,7 +240,6 @@ ENTRY(memcpy) movl 20(%esp),%ecx movl %edi,%eax shrl $2,%ecx /* copy by 32-bit words */ - cld /* nope, copy forwards */ rep movsl movl 20(%esp),%ecx @@ -314,7 +308,6 @@ ENTRY(copyout) movl %ebx,%ecx shrl $2,%ecx - cld rep movsl movb %bl,%cl @@ -365,7 +358,6 @@ ENTRY(copyin) movb %cl,%al shrl $2,%ecx /* copy longword-wise */ - cld rep movsl movb %al,%cl @@ -582,7 +574,6 @@ ENTRY(copyinstr) movl %eax,20(%esp) 1: incl %edx - cld 2: decl %edx @@ -635,7 +626,6 @@ ENTRY(copystr) movl 16(%esp),%edi /* %edi = to */ movl 20(%esp),%edx /* %edx = maxlen */ incl %edx - cld 1: decl %edx jz 4f @@ -675,7 +665,6 @@ ENTRY(bcmp) movl %edx,%ecx shrl $2,%ecx - cld /* compare forwards */ repe cmpsl jne 1f From owner-svn-src-all@freebsd.org Thu Jan 11 13:37:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B965E620CB; Thu, 11 Jan 2018 13:37:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F0D708B3; Thu, 11 Jan 2018 13:37:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD9061591F; Thu, 11 Jan 2018 13:37:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BDbjpm033832; Thu, 11 Jan 2018 13:37:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BDbjDj033831; Thu, 11 Jan 2018 13:37:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111337.w0BDbjDj033831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 13:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327821 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 327821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 13:37:49 -0000 Author: kib Date: Thu Jan 11 13:37:45 2018 New Revision: 327821 URL: https://svnweb.freebsd.org/changeset/base/327821 Log: Softlink inodes can own buffers with dependencies. At least, softlinks longer than 120 bytes have data fragments. Submitted by: mckusick MFC after: 5 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Jan 11 13:22:13 2018 (r327820) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Jan 11 13:37:45 2018 (r327821) @@ -13922,7 +13922,8 @@ retry: VI_UNLOCK(vp); if (mp == NULL) goto retry; - } else if (vp->v_type == VREG || vp->v_type == VDIR) { + } else if (vp->v_type == VREG || vp->v_type == VDIR || + vp->v_type == VLNK) { mp = vp->v_mount; } else { return (NULL); From owner-svn-src-all@freebsd.org Thu Jan 11 13:57:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B43E63F78; Thu, 11 Jan 2018 13:57:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACDAD71FA4; Thu, 11 Jan 2018 13:57:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8DA615CA1; Thu, 11 Jan 2018 13:57:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BDvUgf042934; Thu, 11 Jan 2018 13:57:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BDvUdW042933; Thu, 11 Jan 2018 13:57:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111357.w0BDvUdW042933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 13:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327822 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 327822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 13:57:31 -0000 Author: kib Date: Thu Jan 11 13:57:30 2018 New Revision: 327822 URL: https://svnweb.freebsd.org/changeset/base/327822 Log: Skip IRELATIVE relocations when loader processes ELF files. ifuncs can be only called in the (early boot) kernel environment, so postpone resolving until early stage of the kernel boot. This commit is performed in advance to make loaders on most machines updated before ifuncs appear in the kernels. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13838 Modified: head/stand/common/reloc_elf.c Modified: head/stand/common/reloc_elf.c ============================================================================== --- head/stand/common/reloc_elf.c Thu Jan 11 13:37:45 2018 (r327821) +++ head/stand/common/reloc_elf.c Thu Jan 11 13:57:30 2018 (r327822) @@ -115,6 +115,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr /* XXX, definitions not available on i386. */ #define R_X86_64_64 1 #define R_X86_64_RELATIVE 8 +#define R_X86_64_IRELATIVE 37 switch (rtype) { case R_X86_64_64: /* S + A */ @@ -129,6 +130,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr val = addr; *where = val; break; + case R_X86_64_IRELATIVE: + /* leave it to kernel */ + break; default: printf("\nunhandled relocation type %u\n", (u_int)rtype); return (EFTYPE); @@ -173,6 +177,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr #define R_386_32 1 /* Add symbol value. */ #define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ #define R_386_RELATIVE 8 /* Add load address of shared object. */ +#define R_386_IRELATIVE 42 switch (rtype) { case R_386_RELATIVE: @@ -185,6 +190,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr return (ESRCH); val = addr + addend; *where = val; + break; + case R_386_IRELATIVE: + /* leave it to kernel */ break; default: printf("\nunhandled relocation type %u\n", (u_int)rtype); From owner-svn-src-all@freebsd.org Thu Jan 11 14:03:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C91E6470D; Thu, 11 Jan 2018 14:03:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6057C725B8; Thu, 11 Jan 2018 14:03:06 +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 87F1915E61; Thu, 11 Jan 2018 14:03:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BE35Of047104; Thu, 11 Jan 2018 14:03:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BE353l047103; Thu, 11 Jan 2018 14:03:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801111403.w0BE353l047103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Jan 2018 14:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327823 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 327823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 14:03:06 -0000 Author: emaste Date: Thu Jan 11 14:03:05 2018 New Revision: 327823 URL: https://svnweb.freebsd.org/changeset/base/327823 Log: Enable ld.lld as bootstrap linker by default on i386 Akin to r327783 for amd64. lld has been usable for amd64 for quite some time, but a couple of issues remained that affected i386. These were recently addressed upstream in lld and merged into FreeBSD (r326831, r326879, r326897, r326957), so we can now use ld.lld on i386 as well. Similarly to amd64 this change enables lld only as the bootstrap linker (used to link the kernel and userland libraries and executables), while GNU ld.bfd is still installed as /usr/bin/ld and used for ports builds. The ports collection is essentially ready to use lld as the system linker for amd64, but many ports still have trouble with lld on i386, because lld defaults to -ztext, disallowing relocations against readonly segments. Thus switching the system linker (WITH_LLD_IS_LD) will happen later on a per-arch basis. Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jan 11 13:57:30 2018 (r327822) +++ head/share/mk/src.opts.mk Thu Jan 11 14:03:05 2018 (r327823) @@ -253,7 +253,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "aarch64" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD -.elif ${__T} == "amd64" +.elif ${__T} == "amd64" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP __DEFAULT_NO_OPTIONS+=LLD_IS_LD .else From owner-svn-src-all@freebsd.org Thu Jan 11 14:21:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12B1E65829; Thu, 11 Jan 2018 14:21:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC39C73241; Thu, 11 Jan 2018 14:21:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E038916034; Thu, 11 Jan 2018 14:21:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BEL7RM056753; Thu, 11 Jan 2018 14:21:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BEL7pP056752; Thu, 11 Jan 2018 14:21:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801111421.w0BEL7pP056752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Jan 2018 14:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327824 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 327824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 14:21:09 -0000 Author: emaste Date: Thu Jan 11 14:21:07 2018 New Revision: 327824 URL: https://svnweb.freebsd.org/changeset/base/327824 Log: regen src.conf.5 after r327823, WITH_LLD_BOOTSTRAP for i386 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jan 11 14:03:05 2018 (r327823) +++ head/share/man/man5/src.conf.5 Thu Jan 11 14:21:07 2018 (r327824) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 10, 2018 +.Dd January 11, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -970,12 +970,12 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64 and arm64/aarch64. +amd64/amd64, arm64/aarch64 and i386/i386. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp From owner-svn-src-all@freebsd.org Thu Jan 11 14:21:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08FCE65839; Thu, 11 Jan 2018 14:21:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7168E73246; Thu, 11 Jan 2018 14:21:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-it0-f45.google.com with SMTP id f190so4629401ita.5; Thu, 11 Jan 2018 06:21:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1fwq4FNBtqU7kZ4qgJMWLiriBa0a7z93je3y1uXXNdE=; b=KxQLn8CQWcNtRkUOnhZKPGAt8NnqMtWWumwe5rnuGUtLDKndkS577L2lloC9e2daP9 UY+OU6tIO7GYMyI1+11FIbZncMUCtoKBPKDxpI7twqr7lwsugWgf9QJV3ZbUtVZGWtA9 Zq+9r1UzusnHbYJZIvWOx4rlG/197we3FRFCRhehDiPovIpL+WrIXDDYMVAA0b//vt9Z dvVzXo4bPF6ZYPWoDh+iRUInQ9ye3cjPFRteNECs6rqLqi8P3D9bp5rDsLdncyeOrfAc 3hIPa2VADNBU2V1o869IcX9qI8gZJAlCU8l2AGHHsBUFSJe0dhyxve9z/PA9nATqn0AD pGWQ== X-Gm-Message-State: AKwxytcePW6njj/8QrCVbBqpwoNwM2OWmQupQuSr6ygln96k+Yrpeipk 9/4s9E+pooJFxzplzsQvT9cslc1J X-Google-Smtp-Source: ACJfBotaw8A50/SqpAZuoGThM+3nP9jxCTi74WhF4t3TLY4mxmPEJ0Tyuk2J/nm6WR+NebBr6w46qQ== X-Received: by 10.36.219.195 with SMTP id c186mr1222073itg.61.1515680468610; Thu, 11 Jan 2018 06:21:08 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id w133sm707360itc.44.2018.01.11.06.21.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 06:21:08 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id f143so4654688itb.0; Thu, 11 Jan 2018 06:21:08 -0800 (PST) X-Received: by 10.107.5.142 with SMTP id 136mr22312069iof.239.1515680467890; Thu, 11 Jan 2018 06:21:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.149.147 with HTTP; Thu, 11 Jan 2018 06:20:47 -0800 (PST) In-Reply-To: References: <201801110536.w0B5aDJZ032451@repo.freebsd.org> From: Kyle Evans Date: Thu, 11 Jan 2018 08:20:47 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327806 - in head: etc/mtree usr.bin/awk usr.bin/awk/tests To: Warner Losh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 14:21:10 -0000 On Wed, Jan 10, 2018 at 11:53 PM, Warner Losh wrote: > On Wed, Jan 10, 2018 at 10:36 PM, Kyle Evans wrote: > >> Author: kevans >> Date: Thu Jan 11 05:36:13 2018 >> New Revision: 327806 >> URL: https://svnweb.freebsd.org/changeset/base/327806 >> >> Log: >> awk(1): Add necessary bits for connecting tests, but leave disconnected >> >> The NetBSD test suite has 24 tests for awk, and we pass exactly 4 of >> them. >> Add the necessary pieces for interested parties to easily connect the >> tests and run them, but leave them disconnected for the time being. >> >> Some of these tests outright segfault in our awk, others just exhibit the >> wrong behavior. >> > > How many tests does NetBSD's awk pass? At least one of their patches causes > our .m compiler awk script to fail, if I've applied it correctly. Presumably all of them, but I've not had a chance to check. Some of them were motivated by bugs they had previously, others just look like non-trivial awk usage that I wouldn't think would break, such as setting two-character RS. > > Warner > From owner-svn-src-all@freebsd.org Thu Jan 11 14:29:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9090DE660BC; Thu, 11 Jan 2018 14:29:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A84A73A51; Thu, 11 Jan 2018 14:29:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D6C161CC; Thu, 11 Jan 2018 14:29:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BETTp6058770; Thu, 11 Jan 2018 14:29:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BETTUl058769; Thu, 11 Jan 2018 14:29:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801111429.w0BETTUl058769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 11 Jan 2018 14:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327825 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 14:29:30 -0000 Author: kevans Date: Thu Jan 11 14:29:29 2018 New Revision: 327825 URL: https://svnweb.freebsd.org/changeset/base/327825 Log: if_awg: Support new emac bindings Highlights of the new bindings: - ahb clock is specified as 'stmmaceth' - The PHY to be used is now specified as phy-handle - We must now check the parent of the node phy-handle points to in order to discover if we're using internal PHY. - The ephy clk/reset will be specified on the PHY node, not the emac node. Care has been taken to ensure that we remain compatible with the older bindings that we were previously using. Tested on: Pine64 (A64, old bindings) Tested on: Pine64-LTS (A64, new bindings) [manu] Tested on: OrangePi-One (H3, internal PHY) [manu] Tested on: NanoPi M1 Plus (H3, external PHY) [manu] Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D13777 Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Thu Jan 11 14:21:07 2018 (r327824) +++ head/sys/arm/allwinner/if_awg.c Thu Jan 11 14:29:29 2018 (r327825) @@ -223,6 +223,8 @@ static void awg_txeof(struct awg_softc *sc); static uint32_t syscon_read_emac_clk_reg(device_t dev); static void syscon_write_emac_clk_reg(device_t dev, uint32_t val); +static phandle_t awg_get_phy_node(device_t dev); +static bool awg_has_internal_phy(device_t dev); static int awg_miibus_readreg(device_t dev, int phy, int reg) @@ -1186,6 +1188,35 @@ syscon_write_emac_clk_reg(device_t dev, uint32_t val) bus_write_4(sc->res[_RES_SYSCON], 0, val); } +static phandle_t +awg_get_phy_node(device_t dev) +{ + phandle_t node; + pcell_t phy_handle; + + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) <= 0) + return (0); + + return (OF_node_from_xref(phy_handle)); +} + +static bool +awg_has_internal_phy(device_t dev) +{ + phandle_t node, phy_node; + + node = ofw_bus_get_node(dev); + /* Legacy binding */ + if (OF_hasprop(node, "allwinner,use-internal-phy")) + return (true); + + phy_node = awg_get_phy_node(dev); + return (phy_node != 0 && ofw_bus_node_is_compatible(OF_parent(phy_node), + "allwinner,sun8i-h3-mdio-internal") != 0); +} + static int awg_setup_phy(device_t dev) { @@ -1241,7 +1272,7 @@ awg_setup_phy(device_t dev) } if (sc->type == EMAC_H3) { - if (OF_hasprop(node, "allwinner,use-internal-phy")) { + if (awg_has_internal_phy(dev)) { reg |= EMAC_CLK_EPHY_SELECT; reg &= ~EMAC_CLK_EPHY_SHUTDOWN; if (OF_hasprop(node, @@ -1308,7 +1339,7 @@ static int awg_setup_extres(device_t dev) { struct awg_softc *sc; - phandle_t node; + phandle_t node, phy_node; hwreset_t rst_ahb, rst_ephy; clk_t clk_ahb, clk_ephy; regulator_t reg; @@ -1320,22 +1351,37 @@ awg_setup_extres(device_t dev) clk_ahb = clk_ephy = NULL; reg = NULL; node = ofw_bus_get_node(dev); + phy_node = awg_get_phy_node(dev); + if (phy_node == 0 && OF_hasprop(node, "phy-handle")) { + error = ENXIO; + device_printf(dev, "cannot get phy handle\n"); + goto fail; + } + /* Get AHB clock and reset resources */ - error = hwreset_get_by_ofw_name(dev, 0, "ahb", &rst_ahb); + error = hwreset_get_by_ofw_name(dev, 0, "stmmaceth", &rst_ahb); + if (error != 0) + error = hwreset_get_by_ofw_name(dev, 0, "ahb", &rst_ahb); if (error != 0) { device_printf(dev, "cannot get ahb reset\n"); goto fail; } if (hwreset_get_by_ofw_name(dev, 0, "ephy", &rst_ephy) != 0) - rst_ephy = NULL; - error = clk_get_by_ofw_name(dev, 0, "ahb", &clk_ahb); + if (phy_node == 0 || hwreset_get_by_ofw_idx(dev, phy_node, 0, + &rst_ephy) != 0) + rst_ephy = NULL; + error = clk_get_by_ofw_name(dev, 0, "stmmaceth", &clk_ahb); + if (error != 0) + error = clk_get_by_ofw_name(dev, 0, "ahb", &clk_ahb); if (error != 0) { device_printf(dev, "cannot get ahb clock\n"); goto fail; } if (clk_get_by_ofw_name(dev, 0, "ephy", &clk_ephy) != 0) - clk_ephy = NULL; + if (phy_node == 0 || clk_get_by_ofw_index(dev, phy_node, 0, + &clk_ephy) != 0) + clk_ephy = NULL; if (OF_hasprop(node, "syscon") && syscon_get_by_ofw_property(dev, node, "syscon", &sc->syscon) != 0) { From owner-svn-src-all@freebsd.org Thu Jan 11 15:01:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5C53E67E8B; Thu, 11 Jan 2018 15:01:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90F9D74FCA; Thu, 11 Jan 2018 15:01:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D292E1682C; Thu, 11 Jan 2018 15:01:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BF1mhs075326; Thu, 11 Jan 2018 15:01:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BF1mKB075325; Thu, 11 Jan 2018 15:01:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801111501.w0BF1mKB075325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 11 Jan 2018 15:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327826 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 327826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:01:49 -0000 Author: kevans Date: Thu Jan 11 15:01:48 2018 New Revision: 327826 URL: https://svnweb.freebsd.org/changeset/base/327826 Log: patch(1): Don't check for NUL bytes in Plan A Plan A mmap()'s the entire input file and operates on it in memory. The map(2) call succeeded, so we shouldn't need to bother checking for the NUL byte as long as we're within our buffer space. This was clearly intentional to match "the behavior of the original code", but it creates a discrepancy between Plan A and Plan B that doesn't seem sensible and it's not inherently wrong to allow a NUL byte. This change was motivated by the gemspec in net/rubygem-grpc failing to patch, despite the patch being generated with diff, because a NUL byte was used as a delimiter in the header briefly in an otherwise text file. An alternative was considered: to fallback to plan B if plan A won't process the entire file due to a NUL byte, but I deemed this to be the better option since plan A isn't failing due to memory limitations and will fail later on if it's really dealing with a file it shouldn't be. PR: 224842 (exp-run) Reported by: swills Reviewed by: emaste, pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13738 Modified: head/usr.bin/patch/inp.c Modified: head/usr.bin/patch/inp.c ============================================================================== --- head/usr.bin/patch/inp.c Thu Jan 11 14:29:29 2018 (r327825) +++ head/usr.bin/patch/inp.c Thu Jan 11 15:01:48 2018 (r327826) @@ -213,8 +213,11 @@ plan_a(const char *filename) /* now scan the buffer and build pointer array */ iline = 1; i_ptr[iline] = i_womp; - /* test for NUL too, to maintain the behavior of the original code */ - for (s = i_womp, i = 0; i < i_size && *s != '\0'; s++, i++) { + /* + * Testing for NUL here actively breaks files that innocently use NUL + * for other reasons. mmap(2) succeeded, just scan the whole buffer. + */ + for (s = i_womp, i = 0; i < i_size; s++, i++) { if (*s == '\n') { if (iline == lines_allocated) { if (!reallocate_lines(&lines_allocated)) From owner-svn-src-all@freebsd.org Thu Jan 11 15:03:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C1B8E681DC; Thu, 11 Jan 2018 15:03:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57547752F3; Thu, 11 Jan 2018 15:03:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9498016882; Thu, 11 Jan 2018 15:03:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BF31Kk075432; Thu, 11 Jan 2018 15:03:01 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BF31fw075431; Thu, 11 Jan 2018 15:03:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201801111503.w0BF31fw075431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 11 Jan 2018 15:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327827 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 327827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:03:02 -0000 Author: mmel Date: Thu Jan 11 15:03:01 2018 New Revision: 327827 URL: https://svnweb.freebsd.org/changeset/base/327827 Log: Initialize CONTEXTIDR register on secondary cores by zero, not with undefined value from X1 register. MFC after: 1 month Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Thu Jan 11 15:01:48 2018 (r327826) +++ head/sys/arm64/arm64/locore.S Thu Jan 11 15:03:01 2018 (r327827) @@ -167,7 +167,7 @@ ENTRY(mpentry) bl drop_to_el1 /* Set the context id */ - msr contextidr_el1, x1 + msr contextidr_el1, xzr /* Load the kernel page table */ adr x24, pagetable_l0_ttbr1 From owner-svn-src-all@freebsd.org Thu Jan 11 15:25:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148CEE6974B; Thu, 11 Jan 2018 15:25:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E01E57618B; Thu, 11 Jan 2018 15:25:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0523516BC4; Thu, 11 Jan 2018 15:25:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BFPQYd084194; Thu, 11 Jan 2018 15:25:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BFPQDn084190; Thu, 11 Jan 2018 15:25:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801111525.w0BFPQDn084190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 11 Jan 2018 15:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327828 - in head/sys/dev: e1000 ixl X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/dev: e1000 ixl X-SVN-Commit-Revision: 327828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:25:28 -0000 Author: pfg Date: Thu Jan 11 15:25:26 2018 New Revision: 327828 URL: https://svnweb.freebsd.org/changeset/base/327828 Log: dev/(e1000,ixl): Make some use of mallocarray(9). Reviewed by: erj Differential Revision: https://reviews.freebsd.org/D13833 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl_pf_iov.c head/sys/dev/ixl/ixl_pf_main.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 11 15:03:01 2018 (r327827) +++ head/sys/dev/e1000/if_em.c Thu Jan 11 15:25:26 2018 (r327828) @@ -2835,9 +2835,9 @@ em_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u /* First allocate the top level queue structs */ if (!(adapter->tx_queues = - (struct em_tx_queue *) malloc(sizeof(struct em_tx_queue) * - adapter->tx_num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) { - device_printf(iflib_get_dev(ctx), "Unable to allocate queue memory\n"); + (struct em_tx_queue *) mallocarray(adapter->tx_num_queues, + sizeof(struct em_tx_queue), M_DEVBUF, M_NOWAIT | M_ZERO))) { + device_printf(iflib_get_dev(ctx), "Unable to allocate queue memory\n"); return(ENOMEM); } @@ -2849,7 +2849,8 @@ em_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u que->me = txr->me = i; /* Allocate report status array */ - if (!(txr->tx_rsq = (qidx_t *) malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_DEVBUF, M_NOWAIT | M_ZERO))) { + if (!(txr->tx_rsq = (qidx_t *) mallocarray(scctx->isc_ntxd[0], + sizeof(qidx_t), M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(iflib_get_dev(ctx), "failed to allocate rs_idxs memory\n"); error = ENOMEM; goto fail; @@ -2881,8 +2882,8 @@ em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u /* First allocate the top level queue structs */ if (!(adapter->rx_queues = - (struct em_rx_queue *) malloc(sizeof(struct em_rx_queue) * - adapter->rx_num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) { + (struct em_rx_queue *) mallocarray(adapter->rx_num_queues, + sizeof(struct em_rx_queue), M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(iflib_get_dev(ctx), "Unable to allocate queue memory\n"); error = ENOMEM; goto fail; Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu Jan 11 15:03:01 2018 (r327827) +++ head/sys/dev/ixl/if_ixlv.c Thu Jan 11 15:25:26 2018 (r327828) @@ -1637,8 +1637,8 @@ ixlv_setup_queues(struct ixlv_sc *sc) /* Get memory for the station queues */ if (!(vsi->queues = - (struct ixl_queue *) malloc(sizeof(struct ixl_queue) * - vsi->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) { + (struct ixl_queue *) mallocarray(vsi->num_queues, + sizeof(struct ixl_queue), M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate queue memory\n"); error = ENOMEM; goto early; Modified: head/sys/dev/ixl/ixl_pf_iov.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_iov.c Thu Jan 11 15:03:01 2018 (r327827) +++ head/sys/dev/ixl/ixl_pf_iov.c Thu Jan 11 15:25:26 2018 (r327828) @@ -1695,8 +1695,8 @@ ixl_iov_init(device_t dev, uint16_t num_vfs, const nvl pf_vsi = &pf->vsi; IXL_PF_LOCK(pf); - pf->vfs = malloc(sizeof(struct ixl_vf) * num_vfs, M_IXL, M_NOWAIT | - M_ZERO); + pf->vfs = mallocarray(num_vfs, sizeof(struct ixl_vf), M_IXL, + M_NOWAIT | M_ZERO); if (pf->vfs == NULL) { error = ENOMEM; Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Thu Jan 11 15:03:01 2018 (r327827) +++ head/sys/dev/ixl/ixl_pf_main.c Thu Jan 11 15:25:26 2018 (r327828) @@ -2431,8 +2431,8 @@ ixl_setup_stations(struct ixl_pf *pf) /* Get memory for the station queues */ if (!(vsi->queues = - (struct ixl_queue *) malloc(sizeof(struct ixl_queue) * - vsi->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) { + (struct ixl_queue *) mallocarray(vsi->num_queues, + sizeof(struct ixl_queue), M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate queue memory\n"); error = ENOMEM; return (error); @@ -3317,7 +3317,7 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int hw = &pf->hw; IXL_PF_LOCK_ASSERT(pf); - a = malloc(sizeof(struct i40e_aqc_add_macvlan_element_data) * cnt, + a = mallocarray(cnt, sizeof(struct i40e_aqc_add_macvlan_element_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (a == NULL) { device_printf(dev, "add_hw_filters failed to get memory\n"); @@ -3380,7 +3380,8 @@ ixl_del_hw_filters(struct ixl_vsi *vsi, int cnt) hw = &pf->hw; dev = pf->dev; - d = malloc(sizeof(struct i40e_aqc_remove_macvlan_element_data) * cnt, + d = mallocarray(cnt, + sizeof(struct i40e_aqc_remove_macvlan_element_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (d == NULL) { printf("del hw filter failed to get memory\n"); From owner-svn-src-all@freebsd.org Thu Jan 11 15:29:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D234E69B4E; Thu, 11 Jan 2018 15:29:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68B85763C5; Thu, 11 Jan 2018 15:29:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C35016BD7; Thu, 11 Jan 2018 15:29:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BFTTXk084409; Thu, 11 Jan 2018 15:29:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BFTTuN084406; Thu, 11 Jan 2018 15:29:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801111529.w0BFTTuN084406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 11 Jan 2018 15:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327829 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 327829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:29:30 -0000 Author: pfg Date: Thu Jan 11 15:29:29 2018 New Revision: 327829 URL: https://svnweb.freebsd.org/changeset/base/327829 Log: netpfil/ipfw: Make some use of mallocarray(9). Reviewed by: kp, ae Differential Revision: https://reviews.freebsd.org/D13834 Modified: head/sys/netpfil/ipfw/dn_heap.c head/sys/netpfil/ipfw/dn_sched_fq_codel.c head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: head/sys/netpfil/ipfw/dn_heap.c ============================================================================== --- head/sys/netpfil/ipfw/dn_heap.c Thu Jan 11 15:25:26 2018 (r327828) +++ head/sys/netpfil/ipfw/dn_heap.c Thu Jan 11 15:29:29 2018 (r327829) @@ -94,7 +94,7 @@ heap_resize(struct dn_heap *h, unsigned int new_size) #else new_size = (new_size + HEAP_INCREMENT ) & ~HEAP_INCREMENT; #endif - p = malloc(new_size * sizeof(*p), M_DN_HEAP, M_NOWAIT); + p = mallocarray(new_size, sizeof(*p), M_DN_HEAP, M_NOWAIT); if (p == NULL) { printf("--- %s, resize %d failed\n", __func__, new_size ); return 1; /* error */ Modified: head/sys/netpfil/ipfw/dn_sched_fq_codel.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_fq_codel.c Thu Jan 11 15:25:26 2018 (r327828) +++ head/sys/netpfil/ipfw/dn_sched_fq_codel.c Thu Jan 11 15:29:29 2018 (r327829) @@ -453,8 +453,8 @@ fq_codel_new_sched(struct dn_sch_inst *_si) q->fs = _si->sched->fs; /* allocate memory for flows array */ - si->flows = malloc(schk->cfg.flows_cnt * sizeof(struct fq_codel_flow), - M_DUMMYNET, M_NOWAIT | M_ZERO); + si->flows = mallocarray(schk->cfg.flows_cnt, + sizeof(struct fq_codel_flow), M_DUMMYNET, M_NOWAIT | M_ZERO); if (si->flows == NULL) { D("cannot allocate memory for fq_codel configuration parameters"); return ENOMEM ; Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c Thu Jan 11 15:25:26 2018 (r327828) +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c Thu Jan 11 15:29:29 2018 (r327829) @@ -1034,8 +1034,8 @@ fq_pie_new_sched(struct dn_sch_inst *_si) return ENOMEM ; } /* allocate memory for flows array */ - si->si_extra->flows = malloc(schk->cfg.flows_cnt * sizeof(struct fq_pie_flow), - M_DUMMYNET, M_NOWAIT | M_ZERO); + si->si_extra->flows = mallocarray(schk->cfg.flows_cnt, + sizeof(struct fq_pie_flow), M_DUMMYNET, M_NOWAIT | M_ZERO); flows = si->si_extra->flows; if (flows == NULL) { free(si->si_extra, M_DUMMYNET); From owner-svn-src-all@freebsd.org Thu Jan 11 15:32:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2B5E6A003; Thu, 11 Jan 2018 15:32:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95DEE768FB; Thu, 11 Jan 2018 15:32:13 +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 D6FB316C65; Thu, 11 Jan 2018 15:32:12 +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 w0BFWCJH086913; Thu, 11 Jan 2018 15:32:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BFWC2V086896; Thu, 11 Jan 2018 15:32:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801111532.w0BFWC2V086896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Jan 2018 15:32:12 +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: r327830 - stable/11/sbin/mdmfs X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sbin/mdmfs X-SVN-Commit-Revision: 327830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:32:13 -0000 Author: markj Date: Thu Jan 11 15:32:12 2018 New Revision: 327830 URL: https://svnweb.freebsd.org/changeset/base/327830 Log: MFC r324125 (andreast): Initialize mdsize to make gcc happy again. Modified: stable/11/sbin/mdmfs/mdmfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mdmfs/mdmfs.c ============================================================================== --- stable/11/sbin/mdmfs/mdmfs.c Thu Jan 11 15:29:29 2018 (r327829) +++ stable/11/sbin/mdmfs/mdmfs.c Thu Jan 11 15:32:12 2018 (r327830) @@ -117,6 +117,7 @@ main(int argc, char **argv) mdtype = MD_SWAP; mdname = MD_NAME; mdnamelen = strlen(mdname); + mdsize = 0; /* * Can't set these to NULL. They may be passed to the * respective programs without modification. I.e., we may not From owner-svn-src-all@freebsd.org Thu Jan 11 15:44:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 703DAE6A82B; Thu, 11 Jan 2018 15:44:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB2376EA9; Thu, 11 Jan 2018 15:44:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A66B616F1F; Thu, 11 Jan 2018 15:44:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BFi3Ic092405; Thu, 11 Jan 2018 15:44:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BFi3cs092402; Thu, 11 Jan 2018 15:44:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801111544.w0BFi3cs092402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 11 Jan 2018 15:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327831 - in head/sys/dev/bhnd: bcma nvram siba X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/dev/bhnd: bcma nvram siba X-SVN-Commit-Revision: 327831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 15:44:04 -0000 Author: pfg Date: Thu Jan 11 15:44:03 2018 New Revision: 327831 URL: https://svnweb.freebsd.org/changeset/base/327831 Log: dev/bhnd: Make use of mallocarray(9). This makes a calloc-like definition check for overflows as is common practice. Modified: head/sys/dev/bhnd/bcma/bcma_erom.c head/sys/dev/bhnd/nvram/bhnd_nvram_private.h head/sys/dev/bhnd/siba/siba_erom.c Modified: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c Thu Jan 11 15:32:12 2018 (r327830) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Thu Jan 11 15:44:03 2018 (r327831) @@ -400,7 +400,7 @@ bcma_erom_get_core_table(bhnd_erom_t *erom, struct bhn } /* Allocate our output buffer */ - buffer = malloc(sizeof(struct bhnd_core_info) * count, M_BHND, + buffer = mallocarray(count, sizeof(struct bhnd_core_info), M_BHND, M_NOWAIT); if (buffer == NULL) { error = ENOMEM; Modified: head/sys/dev/bhnd/nvram/bhnd_nvram_private.h ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_nvram_private.h Thu Jan 11 15:32:12 2018 (r327830) +++ head/sys/dev/bhnd/nvram/bhnd_nvram_private.h Thu Jan 11 15:44:03 2018 (r327831) @@ -74,7 +74,7 @@ MALLOC_DECLARE(M_BHND_NVRAM); #define bhnd_nv_toupper(c) toupper(c) #define bhnd_nv_malloc(size) malloc((size), M_BHND_NVRAM, M_NOWAIT) -#define bhnd_nv_calloc(n, size) malloc((n) * (size), M_BHND_NVRAM, \ +#define bhnd_nv_calloc(n, size) mallocarray((n), (size), M_BHND_NVRAM, \ M_NOWAIT | M_ZERO) #define bhnd_nv_reallocf(buf, size) reallocf((buf), (size), M_BHND_NVRAM, \ M_NOWAIT) Modified: head/sys/dev/bhnd/siba/siba_erom.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_erom.c Thu Jan 11 15:32:12 2018 (r327830) +++ head/sys/dev/bhnd/siba/siba_erom.c Thu Jan 11 15:44:03 2018 (r327831) @@ -445,7 +445,7 @@ siba_erom_get_core_table(bhnd_erom_t *erom, struct bhn sc = (struct siba_erom *)erom; /* Allocate our core array */ - out = malloc(sizeof(*out) * sc->io.ncores, M_BHND, M_NOWAIT); + out = mallocarray(sc->io.ncores, sizeof(*out), M_BHND, M_NOWAIT); if (out == NULL) return (ENOMEM); From owner-svn-src-all@freebsd.org Thu Jan 11 16:04:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6ABE6BE1A; Thu, 11 Jan 2018 16:04:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19AC077E3F; Thu, 11 Jan 2018 16:04:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56ED317285; Thu, 11 Jan 2018 16:04:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BG45H5000990; Thu, 11 Jan 2018 16:04:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BG45sS000987; Thu, 11 Jan 2018 16:04:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801111604.w0BG45sS000987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 11 Jan 2018 16:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327832 - in head: etc/mtree usr.bin/vmstat usr.bin/vmstat/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree usr.bin/vmstat usr.bin/vmstat/tests X-SVN-Commit-Revision: 327832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 16:04:06 -0000 Author: kevans Date: Thu Jan 11 16:04:04 2018 New Revision: 327832 URL: https://svnweb.freebsd.org/changeset/base/327832 Log: vmstat(8): Hook up NetBSD tests The NetBSD tests for vmstat are basically just a smoke test, ensuring that executing `vmstat` and `vmstat -s` exit successfully. This is more than we test now, so go with it. Added: head/usr.bin/vmstat/tests/ head/usr.bin/vmstat/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/vmstat/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jan 11 15:44:03 2018 (r327831) +++ head/etc/mtree/BSD.tests.dist Thu Jan 11 16:04:04 2018 (r327832) @@ -736,6 +736,8 @@ .. uniq .. + vmstat + .. xargs .. xinstall Modified: head/usr.bin/vmstat/Makefile ============================================================================== --- head/usr.bin/vmstat/Makefile Thu Jan 11 15:44:03 2018 (r327831) +++ head/usr.bin/vmstat/Makefile Thu Jan 11 16:04:04 2018 (r327832) @@ -1,10 +1,15 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= vmstat MAN= vmstat.8 LIBADD= devstat kvm memstat xo util WARNS?= 6 + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Added: head/usr.bin/vmstat/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/vmstat/tests/Makefile Thu Jan 11 16:04:04 2018 (r327832) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PACKAGE= tests + +NETBSD_ATF_TESTS_SH= vmstat_test + +.include + +.include From owner-svn-src-all@freebsd.org Thu Jan 11 16:41:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE63E6DF69; Thu, 11 Jan 2018 16:41:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95B407971E; Thu, 11 Jan 2018 16:41:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C789D177A3; Thu, 11 Jan 2018 16:41:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BGf3eX017589; Thu, 11 Jan 2018 16:41:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BGf3rT017588; Thu, 11 Jan 2018 16:41:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801111641.w0BGf3rT017588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Jan 2018 16:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327833 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 327833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 16:41:04 -0000 Author: markj Date: Thu Jan 11 16:41:03 2018 New Revision: 327833 URL: https://svnweb.freebsd.org/changeset/base/327833 Log: Add mallocarray.9 to malloc.9's MLINKS. X-MFC with: r327674 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jan 11 16:04:04 2018 (r327832) +++ head/share/man/man9/Makefile Thu Jan 11 16:41:03 2018 (r327833) @@ -1262,6 +1262,7 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_p.9 \ make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ + malloc.9 mallocarray.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ malloc.9 realloc.9 \ From owner-svn-src-all@freebsd.org Thu Jan 11 16:50:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D917AE6E705; Thu, 11 Jan 2018 16:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B51B979C6C; Thu, 11 Jan 2018 16:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 092E717933; Thu, 11 Jan 2018 16:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BGo3rP018641; Thu, 11 Jan 2018 16:50:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BGo37W018639; Thu, 11 Jan 2018 16:50:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801111650.w0BGo37W018639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jan 2018 16:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327834 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 16:50:05 -0000 Author: kib Date: Thu Jan 11 16:50:03 2018 New Revision: 327834 URL: https://svnweb.freebsd.org/changeset/base/327834 Log: Fix grammar. Submitted by: alc MFC after: 3 days Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Thu Jan 11 16:41:03 2018 (r327833) +++ head/sys/amd64/amd64/support.S Thu Jan 11 16:50:03 2018 (r327834) @@ -245,8 +245,9 @@ ENTRY(copyout) /* * Check explicitly for non-user addresses. This check is essential - * because it prevents usermode from writing into kernel. We do not - * verify that user did not specified a rogue address anywhere else. + * because it prevents usermode from writing into the kernel. We do + * not verify anywhere else that the user did not specify a rogue + * address. */ /* * First, prevent address wrapping. Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Thu Jan 11 16:41:03 2018 (r327833) +++ head/sys/i386/i386/support.s Thu Jan 11 16:50:03 2018 (r327834) @@ -286,8 +286,9 @@ ENTRY(copyout) /* * Check explicitly for non-user addresses. This check is essential - * because it prevents usermode from writing into kernel. We do not - * verify that user did not specified a rogue address anywhere else. + * because it prevents usermode from writing into the kernel. We do + * not verify anywhere else that the user did not specify a rogue + * address. */ /* * First, prevent address wrapping. From owner-svn-src-all@freebsd.org Thu Jan 11 17:09:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F127E6F9B8; Thu, 11 Jan 2018 17:09:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695187A8D6; Thu, 11 Jan 2018 17:09:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A64B717C53; Thu, 11 Jan 2018 17:09:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BH9Djj027517; Thu, 11 Jan 2018 17:09:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BH9CrD027510; Thu, 11 Jan 2018 17:09:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801111709.w0BH9CrD027510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Jan 2018 17:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327835 - in head/sys: arm/arm arm64/arm64 conf dev/acpica X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 conf dev/acpica X-SVN-Commit-Revision: 327835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 17:09:14 -0000 Author: andrew Date: Thu Jan 11 17:09:12 2018 New Revision: 327835 URL: https://svnweb.freebsd.org/changeset/base/327835 Log: Add the start of INTRNG support for ACPI. This adds a new acpi_bus interface with a map_intr method. This is similar to the Open Firmware map_intr method and allows us to create the needed mapping from ACPI space to INTRNG space. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8617 Added: head/sys/dev/acpica/acpi_bus_if.m (contents, props changed) Modified: head/sys/arm/arm/generic_timer.c head/sys/arm64/arm64/nexus.c head/sys/conf/files.arm64 head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpivar.h Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/arm/arm/generic_timer.c Thu Jan 11 17:09:12 2018 (r327835) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_ACPI #include #include +#include "acpi_bus_if.h" #endif #define GT_CTRL_ENABLE (1 << 0) @@ -313,6 +314,15 @@ arm_tmr_fdt_probe(device_t dev) #ifdef DEV_ACPI static void +arm_tmr_acpi_add_irq(device_t parent, device_t dev, int rid, u_int irq) +{ + + irq = ACPI_BUS_MAP_INTR(parent, dev, irq, + INTR_TRIGGER_LEVEL, INTR_POLARITY_HIGH); + BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, rid, irq, 1); +} + +static void arm_tmr_acpi_identify(driver_t *driver, device_t parent) { ACPI_TABLE_GTDT *gtdt; @@ -336,12 +346,9 @@ arm_tmr_acpi_identify(driver_t *driver, device_t paren goto out; } - BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 0, - gtdt->SecureEl1Interrupt, 1); - BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 1, - gtdt->NonSecureEl1Interrupt, 1); - BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 2, - gtdt->VirtualTimerInterrupt, 1); + arm_tmr_acpi_add_irq(parent, dev, 0, gtdt->SecureEl1Interrupt); + arm_tmr_acpi_add_irq(parent, dev, 1, gtdt->NonSecureEl1Interrupt); + arm_tmr_acpi_add_irq(parent, dev, 2, gtdt->VirtualTimerInterrupt); out: acpi_unmap_table(gtdt); Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/arm64/arm64/nexus.c Thu Jan 11 17:09:12 2018 (r327835) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_ACPI #include #include +#include "acpi_bus_if.h" #endif extern struct bus_space memmap_bus; @@ -460,11 +461,16 @@ nexus_ofw_map_intr(device_t dev, device_t child, phand #endif #ifdef DEV_ACPI +static int nexus_acpi_map_intr(device_t dev, device_t child, u_int irq, int trig, int pol); + static device_method_t nexus_acpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_acpi_probe), DEVMETHOD(device_attach, nexus_acpi_attach), + /* ACPI interface */ + DEVMETHOD(acpi_bus_map_intr, nexus_acpi_map_intr), + DEVMETHOD_END, }; @@ -494,5 +500,31 @@ nexus_acpi_attach(device_t dev) nexus_add_child(dev, 10, "acpi", 0); return (nexus_attach(dev)); +} + +static int +nexus_acpi_map_intr(device_t dev, device_t child, u_int irq, int trig, int pol) +{ + struct intr_map_data_acpi *acpi_data; + size_t len; + + len = sizeof(*acpi_data); + acpi_data = (struct intr_map_data_acpi *)intr_alloc_map_data( + INTR_MAP_DATA_ACPI, len, M_WAITOK | M_ZERO); + acpi_data->irq = irq; + acpi_data->pol = pol; + acpi_data->trig = trig; + + /* + * TODO: This will only handle a single interrupt controller. + * ACPI will map multiple controllers into a single virtual IRQ + * space. Each controller has a System Vector Base to hold the + * first irq it handles in this space. As such the correct way + * to handle interrupts with ACPI is to search through the + * controllers for the largest base value that is no larger than + * the IRQ value. + */ + irq = intr_map_irq(NULL, 0, (struct intr_map_data *)acpi_data); + return (irq); } #endif Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/conf/files.arm64 Thu Jan 11 17:09:12 2018 (r327835) @@ -167,6 +167,7 @@ armv8_crypto_wrap.o optional armv8crypto \ clean "armv8_crypto_wrap.o" crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi dev/ahci/ahci_generic.c optional ahci dev/axgbe/if_axgbe.c optional axgbe Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/dev/acpica/acpi.c Thu Jan 11 17:09:12 2018 (r327835) @@ -1358,7 +1358,9 @@ static struct resource * acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#ifndef INTRNG ACPI_RESOURCE ares; +#endif struct acpi_device *ad; struct resource_list_entry *rle; struct resource_list *rl; @@ -1385,6 +1387,7 @@ acpi_alloc_resource(device_t bus, device_t child, int resource_list_add(rl, type, *rid, start, end, count); res = resource_list_alloc(rl, bus, child, type, rid, start, end, count, flags); +#ifndef INTRNG if (res != NULL && type == SYS_RES_IRQ) { /* * Since bus_config_intr() takes immediate effect, we cannot @@ -1397,6 +1400,7 @@ acpi_alloc_resource(device_t bus, device_t child, int if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares))) acpi_config_intr(child, &ares); } +#endif /* * If this is an allocation of the "default" range for a given Added: head/sys/dev/acpica/acpi_bus_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/acpica/acpi_bus_if.m Thu Jan 11 17:09:12 2018 (r327835) @@ -0,0 +1,67 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Andrew Turner 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$ + +#include +#include +#include + +INTERFACE acpi_bus; + +CODE { + static acpi_bus_map_intr_t acpi_bus_default_map_intr; + + int + acpi_bus_default_map_intr(device_t bus, device_t dev, u_int irq, + int trig, int pol) + { + device_t parent; + + /* Pass up the hierarchy */ + parent = device_get_parent(bus); + if (parent != NULL) + return (ACPI_BUS_MAP_INTR(parent, dev, irq, trig, pol)); + + panic("Unable to map interrupt %u", irq); + } +}; + +# Map an interrupt from ACPI space to the FreeBSD IRQ space. Note that +# both of these may be different than the pysical interrupt space as this +# may be local to each interrupt controller. +# +# This method also associates interrupt metadata with the interrupt, +# removing the need for a post hoc configure step. +METHOD int map_intr { + device_t bus; + device_t dev; + u_int irq; + int trig; + int pol; +} DEFAULT acpi_bus_default_map_intr; Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/dev/acpica/acpi_resource.c Thu Jan 11 17:09:12 2018 (r327835) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INTRNG +#include "acpi_bus_if.h" +#endif + /* Hooks for the ACPI CA debugging infrastructure */ #define _COMPONENT ACPI_BUS ACPI_MODULE_NAME("RESOURCE") @@ -556,6 +560,7 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; + rman_res_t intr; if (cp == NULL || irq == NULL) return; @@ -564,7 +569,14 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t if (count != 1) return; - bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1); +#ifdef INTRNG + intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, + (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, + (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); +#else + intr = *irq; +#endif + bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } static void @@ -572,6 +584,7 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; + rman_res_t intr; if (cp == NULL || irq == NULL) return; @@ -580,7 +593,14 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint if (count != 1) return; - bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1); +#ifdef INTRNG + intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, + (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, + (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); +#else + intr = *irq; +#endif + bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } static void Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Thu Jan 11 16:50:03 2018 (r327834) +++ head/sys/dev/acpica/acpivar.h Thu Jan 11 17:09:12 2018 (r327835) @@ -36,6 +36,9 @@ #include "acpi_if.h" #include "bus_if.h" #include +#ifdef INTRNG +#include +#endif #include #include #include @@ -90,6 +93,16 @@ struct acpi_device { /* Resources */ struct resource_list ad_rl; }; + +#ifdef INTRNG +struct intr_map_data_acpi { + struct intr_map_data hdr; + u_int irq; + u_int pol; + u_int trig; +}; + +#endif /* Track device (/dev/{apm,apmctl} and /dev/acpi) notification status. */ struct apm_clone_data { From owner-svn-src-all@freebsd.org Thu Jan 11 17:23:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 540C4E70670; Thu, 11 Jan 2018 17:23:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7A6F7B34E; Thu, 11 Jan 2018 17:23:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45BBA17FA3; Thu, 11 Jan 2018 17:23:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BHNPwq035847; Thu, 11 Jan 2018 17:23:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BHNO1X035839; Thu, 11 Jan 2018 17:23:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801111723.w0BHNO1X035839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Jan 2018 17:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327836 - in head/sys: arm/arm arm64/arm64 conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 conf X-SVN-Commit-Revision: 327836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 17:23:26 -0000 Author: andrew Date: Thu Jan 11 17:23:24 2018 New Revision: 327836 URL: https://svnweb.freebsd.org/changeset/base/327836 Log: iAdd ACPI attachments the the GIC and GICv3 interrupt controller drivers. For each we need to walk the MADT to find which we have, then add the driver as needed. As each may have a child they will each walk the same table to find these details. Reviewed by: mmel Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8720 Added: head/sys/arm/arm/gic_acpi.c (contents, props changed) head/sys/arm64/arm64/gic_v3_acpi.c (contents, props changed) Modified: head/sys/arm/arm/gic.c head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/gicv3_its.c head/sys/conf/files.arm64 Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Jan 11 17:09:12 2018 (r327835) +++ head/sys/arm/arm/gic.c Thu Jan 11 17:23:24 2018 (r327836) @@ -36,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_platform.h" #include @@ -68,6 +69,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DEV_ACPI +#include +#include +#endif + #include #include @@ -888,6 +894,9 @@ gic_map_intr(device_t dev, struct intr_map_data *data, #ifdef FDT struct intr_map_data_fdt *daf; #endif +#ifdef DEV_ACPI + struct intr_map_data_acpi *daa; +#endif sc = device_get_softc(dev); switch (data->type) { @@ -901,6 +910,14 @@ gic_map_intr(device_t dev, struct intr_map_data *data, (sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) == 0, ("%s: Attempting to map a MSI interrupt from FDT", __func__)); + break; +#endif +#ifdef DEV_ACPI + case INTR_MAP_DATA_ACPI: + daa = (struct intr_map_data_acpi *)data; + irq = daa->irq; + pol = daa->pol; + trig = daa->trig; break; #endif case INTR_MAP_DATA_MSI: Added: head/sys/arm/arm/gic_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/gic_acpi.c Thu Jan 11 17:23:24 2018 (r327836) @@ -0,0 +1,346 @@ +/*- + * Copyright (c) 2011,2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * Developed by Damjan Marion + * + * Based on OMAP4 GIC code by Ben Gray + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +struct gic_acpi_devinfo { + struct resource_list rl; +}; + +static device_identify_t gic_acpi_identify; +static device_probe_t gic_acpi_probe; +static device_attach_t gic_acpi_attach; +static bus_get_resource_list_t gic_acpi_get_resource_list; +static bool arm_gic_add_children(device_t); + +static device_method_t gic_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, gic_acpi_identify), + DEVMETHOD(device_probe, gic_acpi_probe), + DEVMETHOD(device_attach, gic_acpi_attach), + + /* Bus interface */ + DEVMETHOD(bus_get_resource_list, gic_acpi_get_resource_list), + + DEVMETHOD_END, +}; + +DEFINE_CLASS_1(gic, gic_acpi_driver, gic_acpi_methods, + sizeof(struct arm_gic_softc), arm_gic_driver); + +static devclass_t gic_acpi_devclass; + +EARLY_DRIVER_MODULE(gic, acpi, gic_acpi_driver, gic_acpi_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + +struct madt_table_data { + device_t parent; + ACPI_MADT_GENERIC_DISTRIBUTOR *dist; + ACPI_MADT_GENERIC_INTERRUPT *intr[MAXCPU]; +}; + +static void +madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + struct madt_table_data *madt_data; + ACPI_MADT_GENERIC_INTERRUPT *intr; + + madt_data = (struct madt_table_data *)arg; + + switch(entry->Type) { + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + if (madt_data->dist != NULL) { + if (bootverbose) + device_printf(madt_data->parent, + "gic: Already have a distributor table"); + } else + madt_data->dist = + (ACPI_MADT_GENERIC_DISTRIBUTOR *)entry; + break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + intr = (ACPI_MADT_GENERIC_INTERRUPT *)entry; + if (intr->CpuInterfaceNumber < MAXCPU) + madt_data->intr[intr->CpuInterfaceNumber] = intr; + break; + } +} + +static void +gic_acpi_identify(driver_t *driver, device_t parent) +{ + struct madt_table_data madt_data; + ACPI_MADT_GENERIC_INTERRUPT *intr; + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + device_t dev; + int i; + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return; + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + device_printf(parent, "gic: Unable to map the MADT\n"); + return; + } + + bzero(&madt_data, sizeof(madt_data)); + madt_data.parent = parent; + madt_data.dist = NULL; + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + madt_handler, &madt_data); + + /* Check the version of the GIC we have */ + switch (madt_data.dist->Version) { + case ACPI_MADT_GIC_VERSION_NONE: + case ACPI_MADT_GIC_VERSION_V1: + case ACPI_MADT_GIC_VERSION_V2: + break; + default: + goto out; + } + + intr = NULL; + for (i = 0; i < MAXCPU; i++) { + if (madt_data.intr[i] != NULL) { + if (intr == NULL) { + intr = madt_data.intr[i]; + } else if (intr->BaseAddress != + madt_data.intr[i]->BaseAddress) { + device_printf(parent, +"gic: Not all CPU interfaces at the same address, this may fail\n"); + } + } + } + if (intr == NULL) { + device_printf(parent, "gic: No CPU interfaces found\n"); + goto out; + } + + dev = BUS_ADD_CHILD(parent, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE, + "gic", -1); + if (dev == NULL) { + device_printf(parent, "add gic child failed\n"); + goto out; + } + + BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 0, + madt_data.dist->BaseAddress, 4 * 1024); + BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 1, + intr->BaseAddress, 4 * 1024); + + acpi_set_private(dev, (void *)(uintptr_t)madt_data.dist->Version); +out: + acpi_unmap_table(madt); +} + +static int +gic_acpi_probe(device_t dev) +{ + + switch((uintptr_t)acpi_get_private(dev)) { + case ACPI_MADT_GIC_VERSION_NONE: + case ACPI_MADT_GIC_VERSION_V1: + case ACPI_MADT_GIC_VERSION_V2: + break; + default: + return (ENXIO); + } + + device_set_desc(dev, "ARM Generic Interrupt Controller"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +gic_acpi_attach(device_t dev) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + intptr_t xref; + int err; + + sc->gic_bus = GIC_BUS_ACPI; + + err = arm_gic_attach(dev); + if (err != 0) + return (err); + + xref = 0; + + /* + * Now, when everything is initialized, it's right time to + * register interrupt controller to interrupt framefork. + */ + if (intr_pic_register(dev, xref) == NULL) { + device_printf(dev, "could not register PIC\n"); + goto cleanup; + } + + /* + * Controller is root: + */ + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, + GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + device_printf(dev, "could not set PIC as a root\n"); + intr_pic_deregister(dev, xref); + goto cleanup; + } + /* If we have children probe and attach them */ + if (arm_gic_add_children(dev)) { + bus_generic_probe(dev); + return (bus_generic_attach(dev)); + } + + return (0); + +cleanup: + arm_gic_detach(dev); + return(ENXIO); +} + +static struct resource_list * +gic_acpi_get_resource_list(device_t bus, device_t child) +{ + struct gic_acpi_devinfo *di; + + di = device_get_ivars(child); + KASSERT(di != NULL, ("gic_acpi_get_resource_list: No devinfo")); + + return (&di->rl); +} + +static void +madt_gicv2m_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + struct arm_gic_softc *sc; + ACPI_MADT_GENERIC_MSI_FRAME *msi; + struct gic_acpi_devinfo *dinfo; + device_t dev, cdev; + + if (entry->Type == ACPI_MADT_TYPE_GENERIC_MSI_FRAME) { + sc = arg; + dev = sc->gic_dev; + msi = (ACPI_MADT_GENERIC_MSI_FRAME *)entry; + + device_printf(dev, "frame: %x %lx %x %u %u\n", msi->MsiFrameId, + msi->BaseAddress, msi->Flags, msi->SpiCount, msi->SpiBase); + + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) + return; + + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + resource_list_init(&dinfo->rl); + resource_list_add(&dinfo->rl, SYS_RES_MEMORY, 0, + msi->BaseAddress, msi->BaseAddress + PAGE_SIZE - 1, + PAGE_SIZE); + device_set_ivars(cdev, dinfo); + } +} + +static bool +arm_gic_add_children(device_t dev) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + + /* This should return a valid address as it did in gic_acpi_identify */ + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return (false); + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + device_printf(dev, "gic: Unable to map the MADT\n"); + return (false); + } + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + madt_gicv2m_handler, sc); + + acpi_unmap_table(madt); + + return (true); +} + +static int +arm_gicv2m_acpi_probe(device_t dev) +{ + + if (gic_get_bus(dev) != GIC_BUS_ACPI) + return (EINVAL); + + if (gic_get_hw_rev(dev) > 2) + return (EINVAL); + + device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t arm_gicv2m_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, arm_gicv2m_acpi_probe), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gicv2m, arm_gicv2m_acpi_driver, arm_gicv2m_acpi_methods, + sizeof(struct arm_gicv2m_softc), arm_gicv2m_driver); + +static devclass_t arm_gicv2m_acpi_devclass; + +EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_acpi_driver, + arm_gicv2m_acpi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu Jan 11 17:09:12 2018 (r327835) +++ head/sys/arm64/arm64/gic_v3.c Thu Jan 11 17:23:24 2018 (r327836) @@ -30,6 +30,7 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" #include "opt_platform.h" #include @@ -63,6 +64,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DEV_ACPI +#include +#include +#endif + #include "pic_if.h" #include @@ -570,6 +576,9 @@ do_gic_v3_map_intr(device_t dev, struct intr_map_data #ifdef FDT struct intr_map_data_fdt *daf; #endif +#ifdef DEV_ACPI + struct intr_map_data_acpi *daa; +#endif u_int irq; sc = device_get_softc(dev); @@ -581,6 +590,14 @@ do_gic_v3_map_intr(device_t dev, struct intr_map_data if (gic_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, &trig) != 0) return (EINVAL); + break; +#endif +#ifdef DEV_ACPI + case INTR_MAP_DATA_ACPI: + daa = (struct intr_map_data_acpi *)data; + irq = daa->irq; + pol = daa->pol; + trig = daa->trig; break; #endif case INTR_MAP_DATA_MSI: Added: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/gic_v3_acpi.c Thu Jan 11 17:23:24 2018 (r327836) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * the sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "gic_v3_reg.h" +#include "gic_v3_var.h" + +struct gic_v3_acpi_devinfo { + struct resource_list di_rl; +}; + +static device_identify_t gic_v3_acpi_identify; +static device_probe_t gic_v3_acpi_probe; +static device_attach_t gic_v3_acpi_attach; +static bus_alloc_resource_t gic_v3_acpi_bus_alloc_res; + +static void gic_v3_acpi_bus_attach(device_t); + +static device_method_t gic_v3_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, gic_v3_acpi_identify), + DEVMETHOD(device_probe, gic_v3_acpi_probe), + DEVMETHOD(device_attach, gic_v3_acpi_attach), + + /* Bus interface */ + DEVMETHOD(bus_alloc_resource, gic_v3_acpi_bus_alloc_res), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gic, gic_v3_acpi_driver, gic_v3_acpi_methods, + sizeof(struct gic_v3_softc), gic_v3_driver); + +static devclass_t gic_v3_acpi_devclass; + +EARLY_DRIVER_MODULE(gic_v3, acpi, gic_v3_acpi_driver, gic_v3_acpi_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + + +struct madt_table_data { + device_t parent; + device_t dev; + ACPI_MADT_GENERIC_DISTRIBUTOR *dist; + int count; +}; + +static void +madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + struct madt_table_data *madt_data; + + madt_data = (struct madt_table_data *)arg; + + switch(entry->Type) { + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + if (madt_data->dist != NULL) { + if (bootverbose) + device_printf(madt_data->parent, + "gic: Already have a distributor table"); + break; + } + madt_data->dist = (ACPI_MADT_GENERIC_DISTRIBUTOR *)entry; + break; + + case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: + break; + + default: + break; + } +} + +static void +rdist_map(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + ACPI_MADT_GENERIC_REDISTRIBUTOR *redist; + struct madt_table_data *madt_data; + + madt_data = (struct madt_table_data *)arg; + + switch(entry->Type) { + case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: + redist = (ACPI_MADT_GENERIC_REDISTRIBUTOR *)entry; + + madt_data->count++; + BUS_SET_RESOURCE(madt_data->parent, madt_data->dev, + SYS_RES_MEMORY, madt_data->count, redist->BaseAddress, + redist->Length); + break; + + default: + break; + } +} + +static void +gic_v3_acpi_identify(driver_t *driver, device_t parent) +{ + struct madt_table_data madt_data; + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + device_t dev; + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return; + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + device_printf(parent, "gic: Unable to map the MADT\n"); + return; + } + + madt_data.parent = parent; + madt_data.dist = NULL; + madt_data.count = 0; + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + madt_handler, &madt_data); + if (madt_data.dist == NULL) { + device_printf(parent, + "No gic interrupt or distributor table\n"); + goto out; + } + /* This is for the wrong GIC version */ + if (madt_data.dist->Version != ACPI_MADT_GIC_VERSION_V3) + goto out; + + dev = BUS_ADD_CHILD(parent, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE, + "gic", -1); + if (dev == NULL) { + device_printf(parent, "add gic child failed\n"); + goto out; + } + + /* Add the MADT data */ + BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 0, + madt_data.dist->BaseAddress, 128 * 1024); + + madt_data.dev = dev; + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + rdist_map, &madt_data); + + acpi_set_private(dev, (void *)(uintptr_t)madt_data.dist->Version); + +out: + acpi_unmap_table(madt); +} + +static int +gic_v3_acpi_probe(device_t dev) +{ + + switch((uintptr_t)acpi_get_private(dev)) { + case ACPI_MADT_GIC_VERSION_V3: + break; + default: + return (ENXIO); + } + + device_set_desc(dev, GIC_V3_DEVSTR); + return (BUS_PROBE_NOWILDCARD); +} + +static int +gic_v3_acpi_attach(device_t dev) +{ + struct gic_v3_softc *sc; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->gic_bus = GIC_BUS_ACPI; + + /* TODO: Count these correctly */ + sc->gic_redists.nregions = 1; + + err = gic_v3_attach(dev); + if (err != 0) + goto error; + + sc->gic_pic = intr_pic_register(dev, 0); + if (sc->gic_pic == NULL) { + device_printf(dev, "could not register PIC\n"); + err = ENXIO; + goto error; + } + + if (intr_pic_claim_root(dev, 0, arm_gic_v3_intr, sc, + GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { + err = ENXIO; + goto error; + } + + /* + * Try to register the ITS driver to this GIC. The GIC will act as + * a bus in that case. Failure here will not affect the main GIC + * functionality. + */ + gic_v3_acpi_bus_attach(dev); + + return (0); + +error: + if (bootverbose) { + device_printf(dev, + "Failed to attach. Error %d\n", err); + } + /* Failure so free resources */ + gic_v3_detach(dev); + + return (err); +} + +static void +gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + ACPI_MADT_GENERIC_TRANSLATOR *gict; + struct gic_v3_acpi_devinfo *di; + device_t child, dev; + + if (entry->Type == ACPI_MADT_TYPE_GENERIC_TRANSLATOR) { + /* We have an ITS, add it as a child */ + gict = (ACPI_MADT_GENERIC_TRANSLATOR *)entry; + dev = arg; + + child = device_add_child(dev, "its", -1); + if (child == NULL) + return; + + di = malloc(sizeof(*di), M_GIC_V3, M_WAITOK | M_ZERO); + resource_list_init(&di->di_rl); + resource_list_add(&di->di_rl, SYS_RES_MEMORY, 0, + gict->BaseAddress, gict->BaseAddress + 128 * 1024 - 1, + 128 * 1024); + device_set_ivars(child, di); + } +} + +static void +gic_v3_acpi_bus_attach(device_t dev) +{ + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return; + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + device_printf(dev, "Unable to map the MADT to add children\n"); + return; + } + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + gic_v3_add_children, dev); + + acpi_unmap_table(madt); + + bus_generic_attach(dev); +} + +static struct resource * +gic_v3_acpi_bus_alloc_res(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct gic_v3_acpi_devinfo *di; + struct resource_list_entry *rle; + + /* We only allocate memory */ + if (type != SYS_RES_MEMORY) + return (NULL); + + if (RMAN_IS_DEFAULT_RANGE(start, end)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + + /* Find defaults for this rid */ + rle = resource_list_find(&di->di_rl, type, *rid); + if (rle == NULL) + return (NULL); + + start = rle->start; + end = rle->end; + count = rle->count; + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu Jan 11 17:09:12 2018 (r327835) +++ head/sys/arm64/arm64/gic_v3_var.h Thu Jan 11 17:23:24 2018 (r327836) @@ -32,6 +32,8 @@ #ifndef _GIC_V3_VAR_H_ #define _GIC_V3_VAR_H_ +#include + #define GIC_V3_DEVSTR "ARM Generic Interrupt Controller v3.0" DECLARE_CLASS(gic_v3_driver); @@ -92,10 +94,8 @@ struct gic_v3_devinfo { MALLOC_DECLARE(M_GIC_V3); /* ivars */ -enum { - GICV3_IVAR_NIRQS, - GICV3_IVAR_REDIST_VADDR, -}; +#define GICV3_IVAR_NIRQS 1000 +#define GICV3_IVAR_REDIST_VADDR 1001 __BUS_ACCESSOR(gicv3, nirqs, GICV3, NIRQS, u_int); __BUS_ACCESSOR(gicv3, redist_vaddr, GICV3, REDIST_VADDR, void *); Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu Jan 11 17:09:12 2018 (r327835) +++ head/sys/arm64/arm64/gicv3_its.c Thu Jan 11 17:23:24 2018 (r327836) @@ -30,6 +30,7 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" #include "opt_platform.h" #include @@ -1640,7 +1641,7 @@ DEFINE_CLASS_1(its, gicv3_its_fdt_driver, gicv3_its_fd #undef its_baseclasses static devclass_t gicv3_its_fdt_devclass; -EARLY_DRIVER_MODULE(its, gic, gicv3_its_fdt_driver, +EARLY_DRIVER_MODULE(its_fdt, gic, gicv3_its_fdt_driver, gicv3_its_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static int @@ -1682,6 +1683,65 @@ gicv3_its_fdt_attach(device_t dev) /* Register this device to handle MSI interrupts */ intr_msi_register(dev, xref); + + return (0); +} +#endif + +#ifdef DEV_ACPI +static device_probe_t gicv3_its_acpi_probe; +static device_attach_t gicv3_its_acpi_attach; + +static device_method_t gicv3_its_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gicv3_its_acpi_probe), + DEVMETHOD(device_attach, gicv3_its_acpi_attach), + + /* End */ + DEVMETHOD_END +}; + +#define its_baseclasses its_acpi_baseclasses +DEFINE_CLASS_1(its, gicv3_its_acpi_driver, gicv3_its_acpi_methods, + sizeof(struct gicv3_its_softc), gicv3_its_driver); +#undef its_baseclasses +static devclass_t gicv3_its_acpi_devclass; + +EARLY_DRIVER_MODULE(its_acpi, gic, gicv3_its_acpi_driver, + gicv3_its_acpi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + +static int +gicv3_its_acpi_probe(device_t dev) +{ + + if (gic_get_bus(dev) != GIC_BUS_ACPI) + return (EINVAL); + + if (gic_get_hw_rev(dev) < 3) + return (EINVAL); + + device_set_desc(dev, "ARM GIC Interrupt Translation Service"); + return (BUS_PROBE_DEFAULT); +} + +static int +gicv3_its_acpi_attach(device_t dev) +{ + struct gicv3_its_softc *sc; + int err; + + err = gicv3_its_attach(dev); + if (err != 0) + return (err); + + sc = device_get_softc(dev); + + sc->sc_pic = intr_pic_register(dev, 1); + intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, + gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS); + + /* Register this device to handle MSI interrupts */ + intr_msi_register(dev, 1); return (0); } Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jan 11 17:09:12 2018 (r327835) +++ head/sys/conf/files.arm64 Thu Jan 11 17:23:24 2018 (r327836) @@ -63,6 +63,7 @@ arm/annapurna/alpine/alpine_serdes.c optional al_serd compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" arm/arm/generic_timer.c standard arm/arm/gic.c standard +arm/arm/gic_acpi.c optional acpi arm/arm/gic_fdt.c optional fdt arm/arm/pmu.c standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ @@ -111,6 +112,7 @@ arm64/arm64/exception.S standard arm64/arm64/freebsd32_machdep.c optional compat_freebsd32 arm64/arm64/gicv3_its.c optional intrng fdt arm64/arm64/gic_v3.c standard +arm64/arm64/gic_v3_acpi.c optional acpi arm64/arm64/gic_v3_fdt.c optional fdt arm64/arm64/identcpu.c standard arm64/arm64/in_cksum.c optional inet | inet6 From owner-svn-src-all@freebsd.org Thu Jan 11 17:51:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D3B5E71D32; Thu, 11 Jan 2018 17:51:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8A4A7C54A; Thu, 11 Jan 2018 17:51:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C60F18326; Thu, 11 Jan 2018 17:51:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BHpMJC045905; Thu, 11 Jan 2018 17:51:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BHpMpw045899; Thu, 11 Jan 2018 17:51:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801111751.w0BHpMpw045899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 11 Jan 2018 17:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327837 - in stable/11: . share/man/man5 share/mk usr.bin X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11: . share/man/man5 share/mk usr.bin X-SVN-Commit-Revision: 327837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 17:51:24 -0000 Author: ian Date: Thu Jan 11 17:51:22 2018 New Revision: 327837 URL: https://svnweb.freebsd.org/changeset/base/327837 Log: Do not build lint(1) by default on stable-11, add WITH_LINT to enable building it. lint(1) is required on the host build system to build lint(1) libraries, and it is no longer available on FreeBSD 12. This prevents using a 12 or later host to build an 11 or earlier system, which causes problems for building jails and using poudriere. The problem could be fixed by treating lint as a bootstrap tool when building on 12+, but that just adds complexity and build time to build a broken tool that virtually nobody uses anymore. This is a direct commit to 11-stable because lint no longer exists in later branches. PR: 223892 Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13799 Modified: stable/11/UPDATING stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk stable/11/usr.bin/Makefile Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Thu Jan 11 17:23:24 2018 (r327836) +++ stable/11/UPDATING Thu Jan 11 17:51:22 2018 (r327837) @@ -16,6 +16,12 @@ 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. +20180108: + lint(1) binaries and library are no longer built by default. To + enable building them, define WITH_LINT in src.conf. If you are using + a FreeBSD 12 or later system to build 11-stable, you may need to + install a lint(1) binary to use WITH_LINT. + 20171003: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Thu Jan 11 17:23:24 2018 (r327836) +++ stable/11/share/man/man5/src.conf.5 Thu Jan 11 17:51:22 2018 (r327837) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 7, 2017 +.Dd January 8, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -927,6 +927,8 @@ Set to not build the .Nm libthr (1:1 threading) library. +.It Va WITH_LINT +Set to build the lint binaries and library. .It Va WITHOUT_LLD Set to not build LLVM's lld linker. .Pp Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Thu Jan 11 17:23:24 2018 (r327836) +++ stable/11/share/mk/src.opts.mk Thu Jan 11 17:51:22 2018 (r327837) @@ -187,6 +187,7 @@ __DEFAULT_NO_OPTIONS = \ EISA \ HESIOD \ LIBSOFT \ + LINT \ NAND \ OFED \ OPENLDAP \ Modified: stable/11/usr.bin/Makefile ============================================================================== --- stable/11/usr.bin/Makefile Thu Jan 11 17:23:24 2018 (r327836) +++ stable/11/usr.bin/Makefile Thu Jan 11 17:51:22 2018 (r327837) @@ -286,7 +286,7 @@ SUBDIR.${MK_TOOLCHAIN}+= readelf SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef SUBDIR.${MK_TOOLCHAIN}+= size -.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO xlint does not build +.if ${MK_LINT} != "no" && ${MACHINE_ARCH} != "aarch64" # ARM64TODO xlint does not build SUBDIR.${MK_TOOLCHAIN}+= xlint .endif SUBDIR.${MK_TOOLCHAIN}+= xstr From owner-svn-src-all@freebsd.org Thu Jan 11 18:07:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDDDBE72CB2; Thu, 11 Jan 2018 18:07:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8D917D31D; Thu, 11 Jan 2018 18:07:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D060C186B6; Thu, 11 Jan 2018 18:07:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BI7LtQ053222; Thu, 11 Jan 2018 18:07:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BI7L8q053221; Thu, 11 Jan 2018 18:07:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801111807.w0BI7L8q053221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Jan 2018 18:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327838 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 327838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 18:07:22 -0000 Author: jhb Date: Thu Jan 11 18:07:21 2018 New Revision: 327838 URL: https://svnweb.freebsd.org/changeset/base/327838 Log: Axe tmp_iv from the cryptodev session structure. Just copyin the IV into the crypto descriptor directly. This avoids copying the IV twice for each operation. Reviewed by: kib MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13847 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Jan 11 17:51:22 2018 (r327837) +++ head/sys/opencrypto/cryptodev.c Thu Jan 11 18:07:21 2018 (r327838) @@ -278,7 +278,6 @@ struct csession { caddr_t key; int keylen; - u_char tmp_iv[EALG_MAX_BLOCK_LEN]; caddr_t mackey; int mackeylen; @@ -823,12 +822,11 @@ cryptodev_op( error = EINVAL; goto bail; } - if ((error = copyin(cop->iv, cse->tmp_iv, + if ((error = copyin(cop->iv, crde->crd_iv, cse->txform->blocksize))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, cse->txform->blocksize); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; crde->crd_skip = 0; } else if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */ @@ -1005,17 +1003,16 @@ cryptodev_aead( crp->crp_opaque = (void *)cse; if (caead->iv) { - if (caead->ivlen > sizeof cse->tmp_iv) { + if (caead->ivlen > sizeof(crde->crd_iv)) { error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - if ((error = copyin(caead->iv, cse->tmp_iv, caead->ivlen))) { + if ((error = copyin(caead->iv, crde->crd_iv, caead->ivlen))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, caead->ivlen); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; } else { crde->crd_flags |= CRD_F_IV_PRESENT; From owner-svn-src-all@freebsd.org Thu Jan 11 18:09:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67037E72E7B; Thu, 11 Jan 2018 18:09:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 401057D5A3; Thu, 11 Jan 2018 18:09:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 717C6186BF; Thu, 11 Jan 2018 18:09:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BI9OeR053851; Thu, 11 Jan 2018 18:09:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BI9OI0053850; Thu, 11 Jan 2018 18:09:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801111809.w0BI9OI0053850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Jan 2018 18:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327839 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 327839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 18:09:25 -0000 Author: jhb Date: Thu Jan 11 18:09:24 2018 New Revision: 327839 URL: https://svnweb.freebsd.org/changeset/base/327839 Log: Change the type of 'crp_opaque' from caddr_t to void *. Opaque pointers should be void *. Note that this does not go through the tree removing all of the now-unnecessary casts. Reviewed by: kib Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13848 Modified: head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Thu Jan 11 18:07:21 2018 (r327838) +++ head/sys/opencrypto/cryptodev.h Thu Jan 11 18:09:24 2018 (r327839) @@ -426,7 +426,7 @@ struct cryptop { */ caddr_t crp_buf; /* Data to be processed */ - caddr_t crp_opaque; /* Opaque pointer, passed along */ + void * crp_opaque; /* Opaque pointer, passed along */ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */ int (*crp_callback)(struct cryptop *); /* Callback function */ From owner-svn-src-all@freebsd.org Thu Jan 11 19:08:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4427E7654F; Thu, 11 Jan 2018 19:08:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0DF280D64; Thu, 11 Jan 2018 19:08:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8F7B1911D; Thu, 11 Jan 2018 19:08:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BJ8hgG080871; Thu, 11 Jan 2018 19:08:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BJ8hjx080870; Thu, 11 Jan 2018 19:08:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801111908.w0BJ8hjx080870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 11 Jan 2018 19:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327840 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 327840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 19:08:44 -0000 Author: emaste Date: Thu Jan 11 19:08:43 2018 New Revision: 327840 URL: https://svnweb.freebsd.org/changeset/base/327840 Log: Temporarily disable VIMAGE on i386 An lld-linked i386 kernel hangs on boot, after em(4) starts. This seems similar to the issue that prompted us to disable VIMAGE on arm64 in r326179. Disable VIMAGE on i386 for now while we investigate. PR: 225077 Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/conf/GENERIC Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Jan 11 18:09:24 2018 (r327839) +++ head/sys/i386/conf/GENERIC Thu Jan 11 19:08:43 2018 (r327840) @@ -28,7 +28,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption -options VIMAGE # Subsystem virtualization, e.g. VNET +#options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security From owner-svn-src-all@freebsd.org Thu Jan 11 19:24:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BD64E773C4; Thu, 11 Jan 2018 19:24:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7424181A4D; Thu, 11 Jan 2018 19:24:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5A071947C; Thu, 11 Jan 2018 19:24:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BJOilU089231; Thu, 11 Jan 2018 19:24:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BJOicg089230; Thu, 11 Jan 2018 19:24:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801111924.w0BJOicg089230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 11 Jan 2018 19:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327841 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 19:24:45 -0000 Author: jhb Date: Thu Jan 11 19:24:44 2018 New Revision: 327841 URL: https://svnweb.freebsd.org/changeset/base/327841 Log: Allow MIPS lib32 to build with clang. Don't try to set -march as clang doesn't permit use of the O32 ABI with newer CPU microarchitectures like 'mips3'. In addition, clang doesn't permit the O32 ABI with the default N64 target, so use an explicit O32 -target for clang. Sponsored by: DARPA / AFRL Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Jan 11 19:08:43 2018 (r327840) +++ head/Makefile.libcompat Thu Jan 11 19:24:44 2018 (r327841) @@ -35,10 +35,19 @@ LIB32WMAKEFLAGS= \ OBJCOPY="${XOBJCOPY}" .elif ${TARGET_ARCH:Mmips64*} != "" +.if ${WANT_COMPILER_TYPE} == clang || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang) +.if ${TARGET_ARCH:Mmips64el*} != "" +LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0 +.else +LIB32CPUFLAGS= -target mips-unknown-freebsd12.0 +.endif +.else .if empty(TARGET_CPUTYPE) LIB32CPUFLAGS= -march=mips3 .else LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} +.endif .endif LIB32CPUFLAGS+= -mabi=32 LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips From owner-svn-src-all@freebsd.org Thu Jan 11 19:24:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C19CE773F1; Thu, 11 Jan 2018 19:24:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1143781A6B; Thu, 11 Jan 2018 19:24:53 +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 12AB21947D; Thu, 11 Jan 2018 19:24:52 +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 w0BJOp0j089283; Thu, 11 Jan 2018 19:24:51 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BJOp3e089282; Thu, 11 Jan 2018 19:24:51 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201801111924.w0BJOp3e089282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 11 Jan 2018 19:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327842 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 327842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 19:24:53 -0000 Author: erj Date: Thu Jan 11 19:24:51 2018 New Revision: 327842 URL: https://svnweb.freebsd.org/changeset/base/327842 Log: e1000: Fix typos in value written to register and a comment The value written to E1000_TARC(0) wasn't intended to have every bit but E1000_TARC0_CB_MULTIQ_3_REQ cleared; a ~ was missing. Also change the referenced spec update section in the comment to the correct section. Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 11 19:24:44 2018 (r327841) +++ head/sys/dev/e1000/if_em.c Thu Jan 11 19:24:51 2018 (r327842) @@ -3072,9 +3072,9 @@ em_initialize_transmit_unit(if_ctx_t ctx) reg = E1000_READ_REG(hw, E1000_IOSFPC); reg |= E1000_RCTL_RDMTS_HEX; E1000_WRITE_REG(hw, E1000_IOSFPC, reg); - /* i218-i219 Specification Update 1.5.4.4 */ + /* i218-i219 Specification Update 1.5.4.5 */ reg = E1000_READ_REG(hw, E1000_TARC(0)); - reg &= E1000_TARC0_CB_MULTIQ_3_REQ; + reg &= ~E1000_TARC0_CB_MULTIQ_3_REQ; reg |= E1000_TARC0_CB_MULTIQ_2_REQ; E1000_WRITE_REG(hw, E1000_TARC(0), reg); } From owner-svn-src-all@freebsd.org Thu Jan 11 19:41:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D0D9E78243; Thu, 11 Jan 2018 19:41: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47B2782551; Thu, 11 Jan 2018 19:41: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 901C119639; Thu, 11 Jan 2018 19:41: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 w0BJf0f5093793; Thu, 11 Jan 2018 19:41:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BJf0mn093791; Thu, 11 Jan 2018 19:41:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801111941.w0BJf0mn093791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 11 Jan 2018 19:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327843 - stable/11/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/tools/build/options X-SVN-Commit-Revision: 327843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 19:41:01 -0000 Author: ian Date: Thu Jan 11 19:41:00 2018 New Revision: 327843 URL: https://svnweb.freebsd.org/changeset/base/327843 Log: Add description files for WITH/WITHOUT_LINT. These should have been part of r327837. PR: 223892 Differential Revision: https://reviews.freebsd.org/D13799 Added: stable/11/tools/build/options/WITHOUT_LINT (contents, props changed) stable/11/tools/build/options/WITH_LINT (contents, props changed) Added: stable/11/tools/build/options/WITHOUT_LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_LINT Thu Jan 11 19:41:00 2018 (r327843) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build the lint binaries and library. +.\" $FreeBSD$ +Set to not build the lint binaries and library. Added: stable/11/tools/build/options/WITH_LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_LINT Thu Jan 11 19:41:00 2018 (r327843) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the lint binaries and library. +.\" $FreeBSD$ +Set to build the lint binaries and library. From owner-svn-src-all@freebsd.org Thu Jan 11 20:05:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC0ABE7934F for ; Thu, 11 Jan 2018 20:05:56 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1618357F for ; Thu, 11 Jan 2018 20:05:56 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x243.google.com with SMTP id i186so7817202wmi.4 for ; Thu, 11 Jan 2018 12:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xuw5FUrhGRCxXvr9tDjTogCKyVpQxV69nQ0WIzHxtBU=; b=dimssOkmJKb86io1Rof/ei0Cgl9XolYNL/Ec0yC1biJktH2r2vrx1qbh/7WMev9M6i W4oyeQy+SqMi2q8UbSCYZgrfhoFxgGMGP6LUidP0RtoQ3lZu1p8BT2ygm0YnijzCxhVN sLbx0vGxAL2DJohuQSyCKXoKjziBzR5Pykc6Hxsq0TT4Ntms//R1XIBdQx9qExWSpFN5 Sm2DnJWUzGONrBPrQbxLUIqChVF/+QFvlTQjCyPOaH/2FxBzRe5XSML8Ay7fuUP7a62o hS8IChVUcXwdwpfC9ass+hqPR2wdx9QQGrZ++6UvKYq+C6aFKyu7XBwdhFoRAr+H6iji cKCw== 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=xuw5FUrhGRCxXvr9tDjTogCKyVpQxV69nQ0WIzHxtBU=; b=lHsl1trRJRPUzJ1NUgRrYhwLKHC80kKjjlc9VGP67Cfhmls/X1/8HykH2ktSWx9hJt 8fGq7FpnzWUfxpqPGkton3iYrWuhEtFwLQtSxTBrC4QIOpov5sQ1Dsr1dFsa8E+YvRh1 8J8Etwt/1BIaDgAkkWG+J5SH1gSKgrrChXv++x+WRZwqJ5Q0nd6K/PTWOL85aaZzHtr0 zlMQugBPZPIc22cixHw0TXMwvzVUqCMhxN6+7NJ4bJOwKVcVCBZdrHwmdS8X+XhG2FSS Ot0L6yoLsjInlUM3fCn8GDlmaCJT/xydBghoDzt2G7HzjUmmawVCeB5layPR9wKjKPdZ xnIA== X-Gm-Message-State: AKwxytfrsmtQUQGrPXXn7oJ1yB9IafGXTQ590qxrSGn9V88QfdtPHfIh HZiNBRYSoB8uugC7Zl33dBJdogtKK/Y= X-Google-Smtp-Source: ACJfBotputH+SXuFvfTffbrCdgpgkfuDK/ytJH28J5z+fOyAWJ9gBkBWP3J+VUOjOonVOnCwV3lIag== X-Received: by 10.28.156.67 with SMTP id f64mr1792134wme.11.1515701154708; Thu, 11 Jan 2018 12:05:54 -0800 (PST) Received: from mutt-hbsd (chomsky.torservers.net. [77.247.181.162]) by smtp.gmail.com with ESMTPSA id p15sm1849459wre.47.2018.01.11.12.05.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 12:05:53 -0800 (PST) Date: Thu, 11 Jan 2018 15:05:45 -0500 From: Shawn Webb To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r327843 - stable/11/tools/build/options Message-ID: <20180111200545.ft4tv2v2oegf2np5@mutt-hbsd> References: <201801111941.w0BJf0mn093791@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b7gsidzvtiymopoy" Content-Disposition: inline In-Reply-To: <201801111941.w0BJf0mn093791@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171208 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 20:05:56 -0000 --b7gsidzvtiymopoy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 11, 2018 at 07:41:00PM +0000, Ian Lepore wrote: > Author: ian > Date: Thu Jan 11 19:41:00 2018 > New Revision: 327843 > URL: https://svnweb.freebsd.org/changeset/base/327843 >=20 > Log: > Add description files for WITH/WITHOUT_LINT. These should have been pa= rt > of r327837. > =20 > PR: 223892 > Differential Revision: https://reviews.freebsd.org/D13799 >=20 > Added: > stable/11/tools/build/options/WITHOUT_LINT (contents, props changed) > stable/11/tools/build/options/WITH_LINT (contents, props changed) Should src.conf.5 be regenerated as well? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --b7gsidzvtiymopoy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlpXw5YACgkQaoRlj1JF bu7e/BAAtupokIjZsyPCVs8/mHkzolcLdmL8IkQ5QauJ56nRXAz67OBLZTTCFtPu kmZZv50BDCiepxZ3wXTlBdpZNSx5DeKLFCH2mM49e/wRIJTJguWe7cfKrE1Hw4y0 wfvkUY/AXd+o3w5hM1omHRkFYhSjW9C1XpaiXpK1p1Y5bw4lVogD+Vuc5Bl28x+N EgjvesmXoECXIao4+VFv9azVs/BybujNLUPhYeNEOnBfMPimBqIeymHahuDjetnz GkLF/3ayIqoHQ/7Tm6SOfS2OErMETq+PfWY6KWZ/Pn36gToPMjXVbHHFWc2wDITj U1PeT25CR0h3VvNlR229PZpVstS9tTkcu44gIOO4NMMuWtJ53oBnNpUpTS6Fvt6c kcfU+vGoX0KLfEmhV/NGjE9Se6BIDdzIpf5FkbR9QlkCiWjY8eTMbMxv4BRqPLri 2lntPycvOBcZijnqxISucD07/dmCxsRMFUfT7mHtsqd5B+NsIlkUQzz7IY9ZOxFH JomLVqNqw+88zXT9QHkqBWWnuQ2dddep0cazbUee0RmAWncFZbKGrt8GQu0H+Gqa VBmVa4ENK8oY6T20OkJZUABPTFa8rCCs57aTfDE/kEoZH5JA5j2mCkohFw0m2B6m YGbMvnb8X1tnXQ2sDASazG9sl6pB3zg3cZmMzpkE5Dx6DGAxTQc= =t4li -----END PGP SIGNATURE----- --b7gsidzvtiymopoy-- From owner-svn-src-all@freebsd.org Thu Jan 11 20:18:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701A3E79D4C for ; Thu, 11 Jan 2018 20:18:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51CA083C05 for ; Thu, 11 Jan 2018 20:18:30 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 89e9e938-f70c-11e7-8486-0934409070aa X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 89e9e938-f70c-11e7-8486-0934409070aa; Thu, 11 Jan 2018 20:18:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w0BKISPn004241; Thu, 11 Jan 2018 13:18:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1515701908.44630.79.camel@freebsd.org> Subject: Re: svn commit: r327843 - stable/11/tools/build/options From: Ian Lepore To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Date: Thu, 11 Jan 2018 13:18:28 -0700 In-Reply-To: <20180111200545.ft4tv2v2oegf2np5@mutt-hbsd> References: <201801111941.w0BJf0mn093791@repo.freebsd.org> <20180111200545.ft4tv2v2oegf2np5@mutt-hbsd> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 20:18:31 -0000 On Thu, 2018-01-11 at 15:05 -0500, Shawn Webb wrote: > On Thu, Jan 11, 2018 at 07:41:00PM +0000, Ian Lepore wrote: > > > > Author: ian > > Date: Thu Jan 11 19:41:00 2018 > > New Revision: 327843 > > URL: https://svnweb.freebsd.org/changeset/base/327843 > > > > Log: > >   Add description files for WITH/WITHOUT_LINT.  These should have > > been part > >   of r327837. > >    > >   PR: 223892 > >   Differential Revision:  https://reviews.freebsd.org/D13799 > > > > Added: > >   stable/11/tools/build/options/WITHOUT_LINT   (contents, props > > changed) > >   stable/11/tools/build/options/WITH_LINT   (contents, props > > changed) > Should src.conf.5 be regenerated as well? > > Thanks, > It was, in r327837, using these description files.  I just forgot to do the 'svn add' for these files before committing r327837. -- Ian From owner-svn-src-all@freebsd.org Thu Jan 11 20:20:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B74E7A02A for ; Thu, 11 Jan 2018 20:20:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D40B83DE8 for ; Thu, 11 Jan 2018 20:20:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-lf0-x244.google.com with SMTP id y71so3919742lfd.12 for ; Thu, 11 Jan 2018 12:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TkUqiE8VA3dm3mSuZxJXY1I526YVjcy0ys0h4d+OP6Q=; b=xtapD6f17m1XAZN7RnVCZoVSd0SAGBk0pmVcprbFMKWFtiGhuaWw+uZkNKNm2mhR8V wBb/Qxaj5LbK2HmCmnBdM/uolEy2+wNANKXacFEXtIPFDKm3QlRBDSRZcjGlekNoRHEj xVPx3xuLI6lkplM/PRwuwtsIneXu/X/tr0tfC2j3gDwH1HdqvD4IK4Smkk1OTGAyUktu CepE7XVVUodKAxypvddt8V+3eODMh47mc0HoPCCa7A87BWx5sAsGIpwACHgckT6kjfqY 7sJSFkn4WLyADL1QlVDt5ROJyTvfpckDBRt7+wM45w8V/m/+x8yRziHwSMDvCM9nazSr 8S5g== 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=TkUqiE8VA3dm3mSuZxJXY1I526YVjcy0ys0h4d+OP6Q=; b=oQHQ5IHYoYCnQx1aY3fiY7EA1yHrP8Zy2KrFI82m3+J+FaTqeae2yIr8wB7PeUvIxc vlK9rSvV9iOzKf2pt5VysSPGNFoip9MprdHa8fIqMrX+04mPbb74qvgE9MgaJS3/2MGO ioaMWGqFePieDTEQ/vmgxwtNeLz89rxF7uTKOzbw00fKXs4mM2ULcTJtZmvVpbfLgHsm qhWC9CJ+zpgIjZKXy+5TFtiajNIfpDyMVm4RIR/XW47w/+Ro+3DpcbmvC8gsXy41YuS4 PqfLnrdd4Cfr1HBT1qlgyOPqwGjOHzReKmetPUJaEExYaycLrYv77u/Dxb908Gk6b5IQ rB1w== X-Gm-Message-State: AKwxytcVrzSYr9oYebEjet2S4r8cqCHVpnn7MQA1VXf21cMkuoWdq5aQ Yvrbi3Ei1+QDsVK3aqhZxwCBfw== X-Google-Smtp-Source: ACJfBot1OOfJzLZrkVsfFKPBAuDqejt/lzzlHTqDgZd+7UVo6aTLYOuJzuRwUeaTMt2gtSCa884EpA== X-Received: by 10.25.37.68 with SMTP id l65mr3351124lfl.71.1515702055829; Thu, 11 Jan 2018 12:20:55 -0800 (PST) Received: from mutt-hbsd (tor-exit-relay-1.anonymizing-proxy.digitalcourage.de. [31.185.104.21]) by smtp.gmail.com with ESMTPSA id l77sm2269822lfl.72.2018.01.11.12.20.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 12:20:55 -0800 (PST) Date: Thu, 11 Jan 2018 15:20:05 -0500 From: Shawn Webb To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r327843 - stable/11/tools/build/options Message-ID: <20180111202005.mkzziatjpmjuwgan@mutt-hbsd> References: <201801111941.w0BJf0mn093791@repo.freebsd.org> <20180111200545.ft4tv2v2oegf2np5@mutt-hbsd> <1515701908.44630.79.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zaf5uns5km5iatfz" Content-Disposition: inline In-Reply-To: <1515701908.44630.79.camel@freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171208 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 20:20:58 -0000 --zaf5uns5km5iatfz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 11, 2018 at 01:18:28PM -0700, Ian Lepore wrote: > On Thu, 2018-01-11 at 15:05 -0500, Shawn Webb wrote: > > On Thu, Jan 11, 2018 at 07:41:00PM +0000, Ian Lepore wrote: > > >=20 > > > Author: ian > > > Date: Thu Jan 11 19:41:00 2018 > > > New Revision: 327843 > > > URL: https://svnweb.freebsd.org/changeset/base/327843 > > >=20 > > > Log: > > > ? Add description files for WITH/WITHOUT_LINT.??These should have > > > been part > > > ? of r327837. > > > ?? > > > ? PR: 223892 > > > ? Differential Revision: ?https://reviews.freebsd.org/D13799 > > >=20 > > > Added: > > > ? stable/11/tools/build/options/WITHOUT_LINT???(contents, props > > > changed) > > > ? stable/11/tools/build/options/WITH_LINT???(contents, props > > > changed) > > Should src.conf.5 be regenerated as well? > >=20 > > Thanks, > >=20 >=20 > It was, in r327837, using these description files. ?I just forgot to do > the 'svn add' for these files before committing?r327837. Gotcha. Thanks for the clarification! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --zaf5uns5km5iatfz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlpXxvIACgkQaoRlj1JF bu6i8BAApF4z+UdYdae9t7LAoLzrMd6XBJAhGNAu/u8Febz1VhMT5c8tMbOiIsa0 c6Y10m8YHzxjKDetpL549M7R0zb+StM0mPoJAcLi+mF+UbXdZsSXrQqvdFHzXtn9 VA/LHtH11UQ+04McA6L7BXLeY2RLO8ZmqXZSSW39FLvJ+nE74mPp8lVZXN+eTDxx K9X0AlJBvMnOuHmz+oTzAuQUtDyFYLa9HYfMJ9gLjT9iWkDCwxhyh3z7H7tBYc+t USslAl8NHwLtPeJyQSRHZ5yhnFu4+ymHuS6xJMJGqO+NnO/w4ETr4OA6z6QQ/63E EJbIQu+F5gEkwyFmaq9YR98holb9TAlk08SbL6/VsHUBUqVppBLXrDcaZjOQ4ad/ ppK9Z0pg8zmdm+PT6uco3yxW2rbnY5Jkc57fNUSCS1TnCxRTeTlvof+VxCmLBhlk BKA5rg7VwJbWQzxw7LZj5OpS9IX9VzJW3iNcoLrAQCLByL076uu+JJ+1GLdwrqR/ fi3dD7wXnp9vWIK7COEDdSrbllELIv47RwmxDta6vQjqj9eluy7nAVAEYVG9pp5c UP6nlIMHFf1xRGJ67Flnw/7ImXJ843S4/cGxhpaYFGnysr9bw0kDkdFxiQMyOJm4 16bd7luui0BvxSGwaWB40fWEkWdqPVbFNPHyKvQ45zwLiLQ7Ug8= =T9re -----END PGP SIGNATURE----- --zaf5uns5km5iatfz-- From owner-svn-src-all@freebsd.org Thu Jan 11 20:26:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AB70E7A3D4; Thu, 11 Jan 2018 20:26:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 165A430C; Thu, 11 Jan 2018 20:26:19 +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 4155819E57; Thu, 11 Jan 2018 20:26:18 +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 w0BKQIx6014669; Thu, 11 Jan 2018 20:26:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BKQIT0014668; Thu, 11 Jan 2018 20:26:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801112026.w0BKQIT0014668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 11 Jan 2018 20:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327844 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 20:26:19 -0000 Author: tuexen Date: Thu Jan 11 20:26:17 2018 New Revision: 327844 URL: https://svnweb.freebsd.org/changeset/base/327844 Log: Ensure that the vnet is set when calling pru_sockaddr() and pru_peeraddr(). This is already true when called via kern_getsockname() and kern_getpeername(). This patch sets it also, when they arecalled via soo_fill_kinfo(). This is necessary, since the corresponding functions for SCTP require the vnet to be set. Without this, if a process having an wildcard bound SCTP socket is terminated and a core is written, the kernel panics. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D13652 Modified: head/sys/kern/sys_socket.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Thu Jan 11 19:41:00 2018 (r327843) +++ head/sys/kern/sys_socket.c Thu Jan 11 20:26:17 2018 (r327844) @@ -355,6 +355,7 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif kif->kf_type = KF_TYPE_SOCKET; so = fp->f_data; + CURVNET_SET(so->so_vnet); kif->kf_un.kf_sock.kf_sock_domain0 = so->so_proto->pr_domain->dom_family; kif->kf_un.kf_sock.kf_sock_type0 = so->so_type; @@ -407,6 +408,7 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif } strncpy(kif->kf_path, so->so_proto->pr_domain->dom_name, sizeof(kif->kf_path)); + CURVNET_RESTORE(); return (0); } From owner-svn-src-all@freebsd.org Thu Jan 11 21:12:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15209E7CD17; Thu, 11 Jan 2018 21:12:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E58142F91; Thu, 11 Jan 2018 21:12:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B5871A65E; Thu, 11 Jan 2018 21:12:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BLCO54035868; Thu, 11 Jan 2018 21:12:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BLCO0T035867; Thu, 11 Jan 2018 21:12:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801112112.w0BLCO0T035867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 11 Jan 2018 21:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327845 - head/contrib/llvm/lib/Support/Unix X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Support/Unix X-SVN-Commit-Revision: 327845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 21:12:25 -0000 Author: dim Date: Thu Jan 11 21:12:23 2018 New Revision: 327845 URL: https://svnweb.freebsd.org/changeset/base/327845 Log: Pull in r316581 from upstream llvm trunk (by John Baldwin): Don't try to use a non-existent header on FreeBSD/mips. Reviewers: dim Differential Revision: https://reviews.llvm.org/D38807 Requested by: jhb MFC after: 3 days Modified: head/contrib/llvm/lib/Support/Unix/Memory.inc Modified: head/contrib/llvm/lib/Support/Unix/Memory.inc ============================================================================== --- head/contrib/llvm/lib/Support/Unix/Memory.inc Thu Jan 11 20:26:17 2018 (r327844) +++ head/contrib/llvm/lib/Support/Unix/Memory.inc Thu Jan 11 21:12:23 2018 (r327845) @@ -27,7 +27,7 @@ #if defined(__mips__) # if defined(__OpenBSD__) # include -# else +# elif !defined(__FreeBSD__) # include # endif #endif From owner-svn-src-all@freebsd.org Thu Jan 11 21:17:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6E40E7D048; Thu, 11 Jan 2018 21:17:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 806B0321B; Thu, 11 Jan 2018 21:17:06 +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 B51C01A670; Thu, 11 Jan 2018 21:17:05 +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 w0BLH5nE036751; Thu, 11 Jan 2018 21:17:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BLH5M3036750; Thu, 11 Jan 2018 21:17:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801112117.w0BLH5M3036750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 11 Jan 2018 21:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327846 - head/sys/modules/dtrace X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/modules/dtrace X-SVN-Commit-Revision: 327846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 21:17:06 -0000 Author: tuexen Date: Thu Jan 11 21:17:05 2018 New Revision: 327846 URL: https://svnweb.freebsd.org/changeset/base/327846 Log: Build systrace_freebsd32 on arm64. Since r326501 which added COMPAT_FREEBSD32 to the GENERIC config for arm64, we need to build systrace_freebsd32, since dtraceall depends on it. Reviewed by: ed, gnn Differential Revision: https://reviews.freebsd.org/D13670 Modified: head/sys/modules/dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Thu Jan 11 21:12:23 2018 (r327845) +++ head/sys/modules/dtrace/Makefile Thu Jan 11 21:17:05 2018 (r327846) @@ -23,6 +23,7 @@ SUBDIR+= systrace_linux32 SUBDIR+= fbt fasttrap .endif .if ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "mips64" || \ ${MACHINE_ARCH} == "powerpc64" SUBDIR+= systrace_freebsd32 From owner-svn-src-all@freebsd.org Thu Jan 11 21:31:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8BFE7DA5C; Thu, 11 Jan 2018 21:31:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9698D3A44; Thu, 11 Jan 2018 21:31:11 +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 D73391A85D; Thu, 11 Jan 2018 21:31:10 +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 w0BLVAIO041012; Thu, 11 Jan 2018 21:31:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BLVA6V041011; Thu, 11 Jan 2018 21:31:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801112131.w0BLVA6V041011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 11 Jan 2018 21:31:10 +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: r327847 - stable/10/usr.bin/kdump X-SVN-Group: stable-10 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/10/usr.bin/kdump X-SVN-Commit-Revision: 327847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 21:31:11 -0000 Author: bdrewery Date: Thu Jan 11 21:31:10 2018 New Revision: 327847 URL: https://svnweb.freebsd.org/changeset/base/327847 Log: MFC r284406: Use cpp -I$includedir Modified: stable/10/usr.bin/kdump/mkioctls Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/mkioctls ============================================================================== --- stable/10/usr.bin/kdump/mkioctls Thu Jan 11 21:17:05 2018 (r327846) +++ stable/10/usr.bin/kdump/mkioctls Thu Jan 11 21:31:10 2018 (r327847) @@ -39,7 +39,7 @@ case "${MACHINE}" in esac awk -v x="$ioctl_includes" 'BEGIN {print x}' | - $CPP -nostdinc -I$1 -dM -DCOMPAT_43TTY - | + $CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - | awk -v ioctl_includes="$ioctl_includes" -v style="$style" ' BEGIN { print "/* XXX obnoxious prerequisites. */" From owner-svn-src-all@freebsd.org Thu Jan 11 23:56:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80FBCE601F0; Thu, 11 Jan 2018 23:56:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0686BD51; Thu, 11 Jan 2018 23:56:02 +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 907F71C0A0; Thu, 11 Jan 2018 23:56:01 +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 w0BNu1NQ003248; Thu, 11 Jan 2018 23:56:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BNu1sg003247; Thu, 11 Jan 2018 23:56:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801112356.w0BNu1sg003247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 11 Jan 2018 23:56: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: r327848 - stable/11/usr.bin/dc X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/usr.bin/dc X-SVN-Commit-Revision: 327848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 23:56:02 -0000 Author: asomers Date: Thu Jan 11 23:56:01 2018 New Revision: 327848 URL: https://svnweb.freebsd.org/changeset/base/327848 Log: MFC r326455: Reap dead code usr.bin/dc/inout.c Reap some dead code that was killed back in 2003 in OpenBSD, in version 1.8 of this file. Modified: stable/11/usr.bin/dc/inout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dc/inout.c ============================================================================== --- stable/11/usr.bin/dc/inout.c Thu Jan 11 21:31:10 2018 (r327847) +++ stable/11/usr.bin/dc/inout.c Thu Jan 11 23:56:01 2018 (r327848) @@ -216,12 +216,7 @@ readnumber(struct source *src, u_int base) n->scale++; bn_check(BN_mul_word(n->number, base)); - -#if 0 - /* work around a bug in BN_add_word: 0 += 0 is buggy.... */ - if (v > 0) -#endif - bn_check(BN_add_word(n->number, v)); + bn_check(BN_add_word(n->number, v)); } if (base != 10) { scale_number(n->number, n->scale); From owner-svn-src-all@freebsd.org Thu Jan 11 23:56:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D49A0E602E5; Thu, 11 Jan 2018 23:56:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF3FF6BF79; Thu, 11 Jan 2018 23:56:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC7511C0B0; Thu, 11 Jan 2018 23:56:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BNutdE003328; Thu, 11 Jan 2018 23:56:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BNutOs003327; Thu, 11 Jan 2018 23:56:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801112356.w0BNutOs003327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 11 Jan 2018 23:56:55 +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: r327849 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 327849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 23:56:56 -0000 Author: asomers Date: Thu Jan 11 23:56:55 2018 New Revision: 327849 URL: https://svnweb.freebsd.org/changeset/base/327849 Log: MFC r326624: cam: fix sign-extension error in adagetparams adagetparams contains a sign-extension error that will cause the sector count to be incorrectly calculated for ATA disks of >=1TiB that still use CHS addressing. Disks using LBA48 addressing are unaffected. Reported by: Coverity CID: 1007296 Reviewed by: ken Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13198 Modified: stable/11/sys/cam/ata/ata_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Jan 11 23:56:01 2018 (r327848) +++ stable/11/sys/cam/ata/ata_da.c Thu Jan 11 23:56:55 2018 (r327849) @@ -3328,7 +3328,8 @@ adagetparams(struct cam_periph *periph, struct ccb_get dp->heads = cgd->ident_data.heads; dp->secs_per_track = cgd->ident_data.sectors; dp->cylinders = cgd->ident_data.cylinders; - dp->sectors = cgd->ident_data.cylinders * dp->heads * dp->secs_per_track; + dp->sectors = cgd->ident_data.cylinders * + (u_int32_t)(dp->heads * dp->secs_per_track); } lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16); From owner-svn-src-all@freebsd.org Thu Jan 11 23:57:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279DFE605EF; Thu, 11 Jan 2018 23:57:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB3486C0BE; Thu, 11 Jan 2018 23:57:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D792A1C0B1; Thu, 11 Jan 2018 23:57:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0BNvtfp003418; Thu, 11 Jan 2018 23:57:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BNvti3003414; Thu, 11 Jan 2018 23:57:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801112357.w0BNvti3003414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 11 Jan 2018 23:57:55 +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: r327850 - in stable/11/lib/libc: gen tests/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11/lib/libc: gen tests/gen X-SVN-Commit-Revision: 327850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 23:57:57 -0000 Author: asomers Date: Thu Jan 11 23:57:55 2018 New Revision: 327850 URL: https://svnweb.freebsd.org/changeset/base/327850 Log: MFC r326640: Optimize telldir(3) Currently each call to telldir() requires a malloc and adds an entry to a linked list which must be traversed on future telldir(), seekdir(), closedir(), and readdir() calls. Applications that call telldir() for every directory entry incur O(n^2) behavior in readdir() and O(n) in telldir() and closedir(). This optimization eliminates the malloc() and linked list in most cases by packing the relevant information into a single long. On 64-bit architectures msdosfs, NFS, tmpfs, UFS, and ZFS can all use the packed representation. On 32-bit architectures msdosfs, NFS, and UFS can use the packed representation, but ZFS and tmpfs can only use it for about the first 128 files per directory. Memory savings is about 50 bytes per telldir(3) call. Speedup for telldir()-heavy directory traversals is about 20-30x for one million files per directory. Reviewed by: kib, mav, mckusick Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13385 Added: stable/11/lib/libc/tests/gen/dir2_test.c - copied unchanged from r326640, head/lib/libc/tests/gen/dir2_test.c Modified: stable/11/lib/libc/gen/telldir.c stable/11/lib/libc/gen/telldir.h stable/11/lib/libc/tests/gen/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/telldir.c ============================================================================== --- stable/11/lib/libc/gen/telldir.c Thu Jan 11 23:56:55 2018 (r327849) +++ stable/11/lib/libc/gen/telldir.c Thu Jan 11 23:57:55 2018 (r327850) @@ -52,11 +52,25 @@ __FBSDID("$FreeBSD$"); long telldir(DIR *dirp) { - struct ddloc *lp, *flp; - long idx; + struct ddloc_mem *lp, *flp; + union ddloc_packed ddloc; if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + /* + * Outline: + * 1) If the directory position fits in a packed structure, return that. + * 2) Otherwise, see if it's already been recorded in the linked list + * 3) Otherwise, malloc a new one + */ + if (dirp->dd_seek < (1ul << DD_SEEK_BITS) && + dirp->dd_loc < (1ul << DD_LOC_BITS)) { + ddloc.s.is_packed = 1; + ddloc.s.loc = dirp->dd_loc; + ddloc.s.seek = dirp->dd_seek; + goto out; + } + flp = NULL; LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { if (lp->loc_seek == dirp->dd_seek) { @@ -70,7 +84,7 @@ telldir(DIR *dirp) } } if (lp == NULL) { - lp = malloc(sizeof(struct ddloc)); + lp = malloc(sizeof(struct ddloc_mem)); if (lp == NULL) { if (__isthreaded) _pthread_mutex_unlock(&dirp->dd_lock); @@ -84,10 +98,17 @@ telldir(DIR *dirp) else LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); } - idx = lp->loc_index; + ddloc.i.is_packed = 0; + /* + * Technically this assignment could overflow on 32-bit architectures, + * but we would get ENOMEM long before that happens. + */ + ddloc.i.index = lp->loc_index; + +out: if (__isthreaded) _pthread_mutex_unlock(&dirp->dd_lock); - return (idx); + return (ddloc.l); } /* @@ -97,34 +118,47 @@ telldir(DIR *dirp) void _seekdir(DIR *dirp, long loc) { - struct ddloc *lp; + struct ddloc_mem *lp; struct dirent *dp; + union ddloc_packed ddloc; + off_t loc_seek; + long loc_loc; - LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { - if (lp->loc_index == loc) - break; + ddloc.l = loc; + + if (ddloc.s.is_packed) { + loc_seek = ddloc.s.seek; + loc_loc = ddloc.s.loc; + } else { + LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { + if (lp->loc_index == ddloc.i.index) + break; + } + if (lp == NULL) + return; + + loc_seek = lp->loc_seek; + loc_loc = lp->loc_loc; } - if (lp == NULL) + if (loc_loc == dirp->dd_loc && loc_seek == dirp->dd_seek) return; - if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) - return; /* If it's within the same chunk of data, don't bother reloading. */ - if (lp->loc_seek == dirp->dd_seek) { + if (loc_seek == dirp->dd_seek) { /* * If we go back to 0 don't make the next readdir * trigger a call to getdirentries(). */ - if (lp->loc_loc == 0) + if (loc_loc == 0) dirp->dd_flags |= __DTF_SKIPREAD; - dirp->dd_loc = lp->loc_loc; + dirp->dd_loc = loc_loc; return; } - (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); - dirp->dd_seek = lp->loc_seek; + (void) lseek(dirp->dd_fd, (off_t)loc_seek, SEEK_SET); + dirp->dd_seek = loc_seek; dirp->dd_loc = 0; dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ - while (dirp->dd_loc < lp->loc_loc) { + while (dirp->dd_loc < loc_loc) { dp = _readdir_unlocked(dirp, 0); if (dp == NULL) break; @@ -143,7 +177,7 @@ _seekdir(DIR *dirp, long loc) void _fixtelldir(DIR *dirp, long oldseek, long oldloc) { - struct ddloc *lp; + struct ddloc_mem *lp; lp = LIST_FIRST(&dirp->dd_td->td_locq); if (lp != NULL) { @@ -161,8 +195,8 @@ _fixtelldir(DIR *dirp, long oldseek, long oldloc) void _reclaim_telldir(DIR *dirp) { - struct ddloc *lp; - struct ddloc *templp; + struct ddloc_mem *lp; + struct ddloc_mem *templp; lp = LIST_FIRST(&dirp->dd_td->td_locq); while (lp != NULL) { Modified: stable/11/lib/libc/gen/telldir.h ============================================================================== --- stable/11/lib/libc/gen/telldir.h Thu Jan 11 23:56:55 2018 (r327849) +++ stable/11/lib/libc/gen/telldir.h Thu Jan 11 23:57:55 2018 (r327850) @@ -39,24 +39,62 @@ #include /* - * One of these structures is malloced to describe the current directory - * position each time telldir is called. It records the current magic - * cookie returned by getdirentries and the offset within the buffer - * associated with that return value. + * telldir will malloc one of these to describe the current directory position, + * if it can't fit that information into the packed structure below. It + * records the current magic cookie returned by getdirentries and the offset + * within the buffer associated with that return value. */ -struct ddloc { - LIST_ENTRY(ddloc) loc_lqe; /* entry in list */ +struct ddloc_mem { + LIST_ENTRY(ddloc_mem) loc_lqe; /* entry in list */ long loc_index; /* key associated with structure */ long loc_seek; /* magic cookie returned by getdirentries */ long loc_loc; /* offset of entry in buffer */ }; +#ifdef __LP64__ +#define DD_LOC_BITS 31 +#define DD_SEEK_BITS 32 +#define DD_INDEX_BITS 63 +#else +#define DD_LOC_BITS 12 +#define DD_SEEK_BITS 19 +#define DD_INDEX_BITS 31 +#endif + /* + * This is the real type returned by telldir. telldir will prefer to return + * the packed type, if possible, or the malloced type otherwise. For msdosfs, + * UFS, and NFS, directory positions usually fit within the packed type. For + * ZFS and tmpfs, they usually fit within the packed type on 64-bit + * architectures. + */ +union ddloc_packed { + long l; /* Opaque type returned by telldir(3) */ + struct { + /* Identifies union type. Must be 0. */ + unsigned long is_packed:1; + /* Index into directory's linked list of ddloc_mem */ + unsigned long index:DD_INDEX_BITS; + } __packed i; + struct { + /* Identifies union type. Must be 1. */ + unsigned long is_packed:1; + /* offset of entry in buffer*/ + unsigned long loc:DD_LOC_BITS; + /* magic cookie returned by getdirentries */ + unsigned long seek:DD_SEEK_BITS; + } __packed s; +}; + +_Static_assert(sizeof(long) == sizeof(union ddloc_packed), + "packed telldir size mismatch!"); + +/* * One of these structures is malloced for each DIR to record telldir * positions. */ struct _telldir { - LIST_HEAD(, ddloc) td_locq; /* list of locations */ + LIST_HEAD(, ddloc_mem) td_locq; /* list of locations */ long td_loccnt; /* index of entry for sequential readdir's */ }; Modified: stable/11/lib/libc/tests/gen/Makefile ============================================================================== --- stable/11/lib/libc/tests/gen/Makefile Thu Jan 11 23:56:55 2018 (r327849) +++ stable/11/lib/libc/tests/gen/Makefile Thu Jan 11 23:57:55 2018 (r327850) @@ -3,6 +3,8 @@ .include ATF_TESTS_C+= arc4random_test +ATF_TESTS_C+= dir2_test +ATF_TESTS_C+= dlopen_empty_test ATF_TESTS_C+= fmtcheck2_test ATF_TESTS_C+= fmtmsg_test ATF_TESTS_C+= fnmatch2_test @@ -10,9 +12,8 @@ ATF_TESTS_C+= fpclassify2_test ATF_TESTS_C+= ftw_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test -ATF_TESTS_C+= wordexp_test -ATF_TESTS_C+= dlopen_empty_test ATF_TESTS_C+= realpath2_test +ATF_TESTS_C+= wordexp_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, # TODO: t_siginfo (fixes require further inspection) Copied: stable/11/lib/libc/tests/gen/dir2_test.c (from r326640, head/lib/libc/tests/gen/dir2_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/gen/dir2_test.c Thu Jan 11 23:57:55 2018 (r327850, copy of r326640, head/lib/libc/tests/gen/dir2_test.c) @@ -0,0 +1,189 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2017 Spectra Logic 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: + * 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. + */ + +/* + * Test cases for operations on DIR objects: + * opendir, readdir, seekdir, telldir, closedir, etc + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +ATF_TC(telldir_after_seekdir); +ATF_TC_HEAD(telldir_after_seekdir, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Calling telldir(3) after seekdir(3) " + "should return the argument passed to seekdir."); +} +ATF_TC_BODY(telldir_after_seekdir, tc) +{ + const int NUMFILES = 1000; + char template[] = "dXXXXXX"; + char *tmpdir; + int i, dirfd; + DIR *dirp; + struct dirent *de; + long beginning, middle, end, td; + + /* Create a temporary directory */ + tmpdir = mkdtemp(template); + ATF_REQUIRE_MSG(tmpdir != NULL, "mkdtemp failed"); + dirfd = open(tmpdir, O_RDONLY | O_DIRECTORY); + ATF_REQUIRE(dirfd > 0); + + /* + * Fill it with files. Must be > 128 to ensure that the directory + * can't fit within a single page + */ + for (i = 0; i < NUMFILES; i = i+1) { + int fd; + char filename[16]; + + snprintf(filename, sizeof(filename), "%d", i); + fd = openat(dirfd, filename, O_WRONLY | O_CREAT); + ATF_REQUIRE(fd > 0); + close(fd); + } + + /* Get some directory bookmarks in various locations */ + dirp = fdopendir(dirfd); + ATF_REQUIRE_MSG(dirfd >= 0, "fdopendir failed"); + beginning = telldir(dirp); + for (i = 0; i < NUMFILES / 2; i = i+1) { + de = readdir(dirp); + ATF_REQUIRE_MSG(de != NULL, "readdir failed"); + } + middle = telldir(dirp); + for (; i < NUMFILES - 1; i = i+1) { + de = readdir(dirp); + ATF_REQUIRE_MSG(de != NULL, "readdir failed"); + } + end = telldir(dirp); + + /* + * Seekdir to each bookmark, check the telldir after seekdir condition, + * and check that the bookmark is valid by reading another directory + * entry. + */ + + seekdir(dirp, beginning); + td = telldir(dirp); + ATF_CHECK_EQ(beginning, td); + ATF_REQUIRE_MSG(NULL != readdir(dirp), "invalid directory index"); + + seekdir(dirp, middle); + td = telldir(dirp); + ATF_CHECK_EQ(middle, td); + ATF_REQUIRE_MSG(NULL != readdir(dirp), "invalid directory index"); + + seekdir(dirp, end); + td = telldir(dirp); + ATF_CHECK_EQ(end, td); + ATF_REQUIRE_MSG(NULL != readdir(dirp), "invalid directory index"); + + closedir(dirp); +} + +ATF_TC(telldir_at_end_of_block); +ATF_TC_HEAD(telldir_at_end_of_block, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Calling telldir(3) after readdir(3) read the last entry in the block should return a valid location"); +} +ATF_TC_BODY(telldir_at_end_of_block, tc) +{ + /* For UFS and ZFS, blocks roll over at 128 directory entries. */ + const int NUMFILES = 129; + char template[] = "dXXXXXX"; + char *tmpdir; + int i, dirfd; + DIR *dirp; + struct dirent *de; + long td; + char last_filename[16]; + + /* Create a temporary directory */ + tmpdir = mkdtemp(template); + ATF_REQUIRE_MSG(tmpdir != NULL, "mkdtemp failed"); + dirfd = open(tmpdir, O_RDONLY | O_DIRECTORY); + ATF_REQUIRE(dirfd > 0); + + /* + * Fill it with files. Must be > 128 to ensure that the directory + * can't fit within a single page. The "-2" accounts for "." and ".." + */ + for (i = 0; i < NUMFILES - 2; i = i+1) { + int fd; + char filename[16]; + + snprintf(filename, sizeof(filename), "%d", i); + fd = openat(dirfd, filename, O_WRONLY | O_CREAT); + ATF_REQUIRE(fd > 0); + close(fd); + } + + /* Read all entries within the first page */ + dirp = fdopendir(dirfd); + ATF_REQUIRE_MSG(dirfd >= 0, "fdopendir failed"); + for (i = 0; i < NUMFILES - 1; i = i + 1) + ATF_REQUIRE_MSG(readdir(dirp) != NULL, "readdir failed"); + + /* Call telldir at the end of a page */ + td = telldir(dirp); + + /* Read the last entry */ + de = readdir(dirp); + ATF_REQUIRE_MSG(de != NULL, "readdir failed"); + strlcpy(last_filename, de->d_name, sizeof(last_filename)); + + /* Seek back to the bookmark. readdir() should return the last entry */ + seekdir(dirp, td); + de = readdir(dirp); + ATF_REQUIRE_STREQ_MSG(last_filename, de->d_name, + "seekdir went to the wrong directory position"); + + closedir(dirp); +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, telldir_after_seekdir); + ATF_TP_ADD_TC(tp, telldir_at_end_of_block); + + return atf_no_error(); +} From owner-svn-src-all@freebsd.org Thu Jan 11 23:58:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF57E6072F; Thu, 11 Jan 2018 23:58:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5708C6C254; Thu, 11 Jan 2018 23:58:42 +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 94C941C0B4; Thu, 11 Jan 2018 23:58:41 +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 w0BNwfEM003503; Thu, 11 Jan 2018 23:58:41 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BNwfTv003502; Thu, 11 Jan 2018 23:58:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801112358.w0BNwfTv003502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 11 Jan 2018 23:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327851 - stable/11/lib/libcam X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/lib/libcam X-SVN-Commit-Revision: 327851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 23:58:42 -0000 Author: asomers Date: Thu Jan 11 23:58:41 2018 New Revision: 327851 URL: https://svnweb.freebsd.org/changeset/base/327851 Log: MFC r326646: Fix a null-pointer dereference and a tautological check in cam_get_device Reported by: Coverity CID: 1017964 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13184 Modified: stable/11/lib/libcam/camlib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/camlib.c ============================================================================== --- stable/11/lib/libcam/camlib.c Thu Jan 11 23:57:55 2018 (r327850) +++ stable/11/lib/libcam/camlib.c Thu Jan 11 23:58:41 2018 (r327851) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -130,6 +131,9 @@ cam_get_device(const char *path, char *dev_name, int d * it so we don't hose the user's string. */ newpath = (char *)strdup(path); + if (newpath == NULL) + return (-1); + tmpstr = newpath; /* @@ -138,8 +142,9 @@ cam_get_device(const char *path, char *dev_name, int d if (*tmpstr == '/') { tmpstr2 = tmpstr; tmpstr = strrchr(tmpstr2, '/'); - if ((tmpstr != NULL) && (*tmpstr != '\0')) - tmpstr++; + /* We know that tmpstr2 contains a '/', so strrchr can't fail */ + assert(tmpstr != NULL && *tmpstr != '\0'); + tmpstr++; } if (*tmpstr == '\0') { From owner-svn-src-all@freebsd.org Thu Jan 11 23:59:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDB7E60816; Thu, 11 Jan 2018 23:59:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEBED6C39E; Thu, 11 Jan 2018 23:59:27 +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 533E41C0B5; Thu, 11 Jan 2018 23:59:27 +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 w0BNxREK003584; Thu, 11 Jan 2018 23:59:27 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0BNxRjx003583; Thu, 11 Jan 2018 23:59:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801112359.w0BNxRjx003583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 11 Jan 2018 23:59:27 +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: r327852 - stable/11/usr.bin/at X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/usr.bin/at X-SVN-Commit-Revision: 327852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 11 Jan 2018 23:59:28 -0000 Author: asomers Date: Thu Jan 11 23:59:27 2018 New Revision: 327852 URL: https://svnweb.freebsd.org/changeset/base/327852 Log: MFC r326698: at(1): annotate some intended switch-case fallthroughs Reported by: Coverity CID: 1008191 Sponsored by: Spectra Logic Corp Modified: stable/11/usr.bin/at/parsetime.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/at/parsetime.c ============================================================================== --- stable/11/usr.bin/at/parsetime.c Thu Jan 11 23:58:41 2018 (r327851) +++ stable/11/usr.bin/at/parsetime.c Thu Jan 11 23:59:27 2018 (r327852) @@ -614,6 +614,7 @@ parsetime(int argc, char **argv) } /* now is optional prefix for PLUS tree */ expect(PLUS); + /* FALLTHROUGH */ case PLUS: plus(&runtime); break; @@ -638,8 +639,10 @@ parsetime(int argc, char **argv) */ case TEATIME: hr += 4; + /* FALLTHROUGH */ case NOON: hr += 12; + /* FALLTHROUGH */ case MIDNIGHT: if (runtime.tm_hour >= hr) { runtime.tm_mday++; From owner-svn-src-all@freebsd.org Fri Jan 12 00:00:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9BF0E608EC; Fri, 12 Jan 2018 00:00:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A51E06C4E6; Fri, 12 Jan 2018 00:00:02 +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 E9D721C0BB; Fri, 12 Jan 2018 00:00:01 +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 w0C001mc003707; Fri, 12 Jan 2018 00:00:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C001fO003706; Fri, 12 Jan 2018 00:00:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120000.w0C001fO003706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 00:00: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: r327853 - stable/11/contrib/less X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/contrib/less X-SVN-Commit-Revision: 327853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 00:00:02 -0000 Author: asomers Date: Fri Jan 12 00:00:01 2018 New Revision: 327853 URL: https://svnweb.freebsd.org/changeset/base/327853 Log: MFC r326799: less(1): diff reduction vs upstream No functional change. Sponsored by: Spectra Logic Corp Modified: stable/11/contrib/less/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/less/main.c ============================================================================== --- stable/11/contrib/less/main.c Thu Jan 11 23:59:27 2018 (r327852) +++ stable/11/contrib/less/main.c Fri Jan 12 00:00:01 2018 (r327853) @@ -71,7 +71,6 @@ main(argc, argv) { IFILE ifile; char *s; - extern char *__progname; #ifdef __EMX__ _response(&argc, &argv); From owner-svn-src-all@freebsd.org Fri Jan 12 00:01:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46ABDE60BE1; Fri, 12 Jan 2018 00:01:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E877F6C6FC; Fri, 12 Jan 2018 00:01:10 +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 1831D1C1E8; Fri, 12 Jan 2018 00:01:10 +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 w0C019NA003822; Fri, 12 Jan 2018 00:01:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C018BI003811; Fri, 12 Jan 2018 00:01:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120001.w0C018BI003811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 00:01: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: r327854 - stable/11/sbin/dhclient X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sbin/dhclient X-SVN-Commit-Revision: 327854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 00:01:11 -0000 Author: asomers Date: Fri Jan 12 00:01:08 2018 New Revision: 327854 URL: https://svnweb.freebsd.org/changeset/base/327854 Log: MFC r326834, r326853 r326834: dhclient(8): Don't shift through the sign bit of a signed int PR: 208007 Submitted by: Michael McConville r326853: dhclient(8): raise WARNS to 3 Mostly had to fix a lot of signed/unsigned comparison warnings Sponsored by: Spectra Logic Corp Modified: stable/11/sbin/dhclient/Makefile stable/11/sbin/dhclient/clparse.c stable/11/sbin/dhclient/conflex.c stable/11/sbin/dhclient/dhclient.c stable/11/sbin/dhclient/dhcpd.h stable/11/sbin/dhclient/inet.c stable/11/sbin/dhclient/options.c stable/11/sbin/dhclient/packet.c stable/11/sbin/dhclient/parse.c stable/11/sbin/dhclient/privsep.c stable/11/sbin/dhclient/tree.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/dhclient/Makefile ============================================================================== --- stable/11/sbin/dhclient/Makefile Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/Makefile Fri Jan 12 00:01:08 2018 (r327854) @@ -44,7 +44,7 @@ MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp dhclient-script.8 LIBADD= util -WARNS?= 2 +WARNS?= 3 .if ${MK_TESTS} != "no" SUBDIR+= tests Modified: stable/11/sbin/dhclient/clparse.c ============================================================================== --- stable/11/sbin/dhclient/clparse.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/clparse.c Fri Jan 12 00:01:08 2018 (r327854) @@ -292,12 +292,12 @@ parse_client_statement(FILE *cfile, struct interface_i } } -int -parse_X(FILE *cfile, u_int8_t *buf, int max) +unsigned +parse_X(FILE *cfile, u_int8_t *buf, unsigned max) { int token; char *val; - int len; + unsigned len; token = peek_token(&val, cfile); if (token == NUMBER_OR_NAME || token == NUMBER) { @@ -681,14 +681,14 @@ parse_option_decl(FILE *cfile, struct option_data *opt int token; u_int8_t buf[4]; u_int8_t hunkbuf[1024]; - int hunkix = 0; + unsigned hunkix = 0; char *vendor; char *fmt; struct universe *universe; struct option *option; struct iaddr ip_addr; u_int8_t *dp; - int len; + unsigned len; int nul_term = 0; token = next_token(&val, cfile); Modified: stable/11/sbin/dhclient/conflex.c ============================================================================== --- stable/11/sbin/dhclient/conflex.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/conflex.c Fri Jan 12 00:01:08 2018 (r327854) @@ -58,8 +58,8 @@ int eol_token; static char line1[81]; static char line2[81]; -static int lpos; -static int line; +static unsigned lpos; +static unsigned line; static int tlpos; static int tline; static int token; @@ -226,7 +226,8 @@ skip_to_eol(FILE *cfile) static int read_string(FILE *cfile) { - int i, c, bs = 0; + int c, bs = 0; + unsigned i; for (i = 0; i < sizeof(tokbuf); i++) { c = get_char(cfile); @@ -261,7 +262,8 @@ read_string(FILE *cfile) static int read_number(int c, FILE *cfile) { - int seenx = 0, i = 0, token = NUMBER; + int seenx = 0, token = NUMBER; + unsigned i = 0; tokbuf[i++] = c; for (; i < sizeof(tokbuf); i++) { @@ -288,7 +290,7 @@ read_number(int c, FILE *cfile) static int read_num_or_name(int c, FILE *cfile) { - int i = 0; + unsigned i = 0; int rv = NUMBER_OR_NAME; tokbuf[i++] = c; Modified: stable/11/sbin/dhclient/dhclient.c ============================================================================== --- stable/11/sbin/dhclient/dhclient.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/dhclient.c Fri Jan 12 00:01:08 2018 (r327854) @@ -142,7 +142,7 @@ int findproto(char *cp, int n) { struct sockaddr *sa; - int i; + unsigned i; if (n == 0) return -1; @@ -172,7 +172,7 @@ struct sockaddr * get_ifa(char *cp, int n) { struct sockaddr *sa; - int i; + unsigned i; if (n == 0) return (NULL); @@ -187,7 +187,7 @@ get_ifa(char *cp, int n) return (NULL); } -struct iaddr defaddr = { 4 }; +struct iaddr defaddr = { .len = 4 }; uint8_t curbssid[6]; static void @@ -229,7 +229,8 @@ routehandler(struct protocol *p) n = read(routefd, &msg, sizeof(msg)); rtm = (struct rt_msghdr *)msg; - if (n < sizeof(rtm->rtm_msglen) || n < rtm->rtm_msglen || + if (n < (ssize_t)sizeof(rtm->rtm_msglen) || + n < (ssize_t)rtm->rtm_msglen || rtm->rtm_version != RTM_VERSION) return; @@ -2023,7 +2024,8 @@ priv_script_write_params(char *prefix, struct client_l { struct interface_info *ip = ifi; u_int8_t dbuf[1500], *dp = NULL; - int i, len; + int i; + size_t len; char tbuf[128]; script_set_env(ip->client, prefix, "ip_address", @@ -2173,12 +2175,14 @@ script_write_params(char *prefix, struct client_lease pr_len = strlen(prefix); hdr.code = IMSG_SCRIPT_WRITE_PARAMS; - hdr.len = sizeof(hdr) + sizeof(struct client_lease) + - sizeof(size_t) + fn_len + sizeof(size_t) + sn_len + - sizeof(size_t) + pr_len; + hdr.len = sizeof(hdr) + sizeof(*lease) + + sizeof(fn_len) + fn_len + sizeof(sn_len) + sn_len + + sizeof(pr_len) + pr_len; - for (i = 0; i < 256; i++) - hdr.len += sizeof(int) + lease->options[i].len; + for (i = 0; i < 256; i++) { + hdr.len += sizeof(lease->options[i].len); + hdr.len += lease->options[i].len; + } scripttime = time(NULL); @@ -2187,7 +2191,7 @@ script_write_params(char *prefix, struct client_lease errs = 0; errs += buf_add(buf, &hdr, sizeof(hdr)); - errs += buf_add(buf, lease, sizeof(struct client_lease)); + errs += buf_add(buf, lease, sizeof(*lease)); errs += buf_add(buf, &fn_len, sizeof(fn_len)); errs += buf_add(buf, lease->filename, fn_len); errs += buf_add(buf, &sn_len, sizeof(sn_len)); @@ -2292,7 +2296,8 @@ void script_set_env(struct client_state *client, const char *prefix, const char *name, const char *value) { - int i, j, namelen; + int i, namelen; + size_t j; /* No `` or $() command substitution allowed in environment values! */ for (j=0; j < strlen(value); j++) @@ -2360,7 +2365,7 @@ script_flush_env(struct client_state *client) int dhcp_option_ev_name(char *buf, size_t buflen, struct option *option) { - int i; + size_t i; for (i = 0; option->name[i]; i++) { if (i + 1 == buflen) Modified: stable/11/sbin/dhclient/dhcpd.h ============================================================================== --- stable/11/sbin/dhclient/dhcpd.h Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/dhcpd.h Fri Jan 12 00:01:08 2018 (r327854) @@ -80,7 +80,7 @@ #define REMOTE_PORT 67 struct option_data { - int len; + size_t len; u_int8_t *data; }; @@ -90,7 +90,7 @@ struct string_list { }; struct iaddr { - int len; + size_t len; unsigned char iabuf[16]; }; @@ -283,9 +283,9 @@ char *parse_string(FILE *); int parse_ip_addr(FILE *, struct iaddr *); void parse_hardware_param(FILE *, struct hardware *); void parse_lease_time(FILE *, time_t *); -unsigned char *parse_numeric_aggregate(FILE *, unsigned char *, int *, - int, int, int); -void convert_num(unsigned char *, char *, int, int); +unsigned char *parse_numeric_aggregate(FILE *, unsigned char *, size_t *, + int, unsigned, int); +void convert_num(unsigned char *, char *, unsigned, int); time_t parse_date(FILE *); /* tree.c */ @@ -419,7 +419,7 @@ int read_client_conf(void); void read_client_leases(void); void parse_client_statement(FILE *, struct interface_info *, struct client_config *); -int parse_X(FILE *, u_int8_t *, int); +unsigned parse_X(FILE *, u_int8_t *, unsigned); int parse_option_list(FILE *, u_int8_t *); void parse_interface_declaration(FILE *, struct client_config *); struct interface_info *interface_or_dummy(char *); Modified: stable/11/sbin/dhclient/inet.c ============================================================================== --- stable/11/sbin/dhclient/inet.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/inet.c Fri Jan 12 00:01:08 2018 (r327854) @@ -54,7 +54,7 @@ struct iaddr subnet_number(struct iaddr addr, struct iaddr mask) { struct iaddr rv; - int i; + unsigned i; rv.len = 0; @@ -77,7 +77,7 @@ struct iaddr broadcast_addr(struct iaddr subnet, struct iaddr mask) { struct iaddr rv; - int i; + unsigned i; if (subnet.len != mask.len) { rv.len = 0; Modified: stable/11/sbin/dhclient/options.c ============================================================================== --- stable/11/sbin/dhclient/options.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/options.c Fri Jan 12 00:01:08 2018 (r327854) @@ -53,11 +53,11 @@ int bad_options_max = 5; void parse_options(struct packet *); void parse_option_buffer(struct packet *, unsigned char *, int); -int store_options(unsigned char *, int, struct tree_cache **, +unsigned store_options(unsigned char *, int, struct tree_cache **, unsigned char *, int, int, int, int); void expand_domain_search(struct packet *packet); -int find_search_domain_name_len(struct option_data *option, int *offset); -void expand_search_domain_name(struct option_data *option, int *offset, +int find_search_domain_name_len(struct option_data *option, size_t *offset); +void expand_search_domain_name(struct option_data *option, size_t *offset, unsigned char **domain_search); @@ -211,7 +211,8 @@ parse_option_buffer(struct packet *packet, void expand_domain_search(struct packet *packet) { - int offset, expanded_len, next_domain_len; + size_t offset; + int expanded_len, next_domain_len; struct option_data *option; unsigned char *domain_search, *cursor; @@ -255,9 +256,10 @@ expand_domain_search(struct packet *packet) } int -find_search_domain_name_len(struct option_data *option, int *offset) +find_search_domain_name_len(struct option_data *option, size_t *offset) { - int domain_name_len, i, label_len, pointer, pointed_len; + int domain_name_len, label_len, pointed_len; + size_t i, pointer; domain_name_len = 0; @@ -322,10 +324,11 @@ find_search_domain_name_len(struct option_data *option } void -expand_search_domain_name(struct option_data *option, int *offset, +expand_search_domain_name(struct option_data *option, size_t *offset, unsigned char **domain_search) { - int i, label_len, pointer; + int label_len; + size_t i, pointer; unsigned char *cursor; /* @@ -379,8 +382,10 @@ cons_options(struct packet *inpacket, struct dhcp_pack int terminate, int bootpp, u_int8_t *prl, int prl_len) { unsigned char priority_list[300], buffer[4096]; - int priority_len, main_buffer_size, mainbufix, bufix; - int option_size, length; + unsigned priority_len; + size_t main_buffer_size; + unsigned option_size, bufix, mainbufix; + int length; /* * If the client has provided a maximum DHCP message size, use @@ -422,7 +427,7 @@ cons_options(struct packet *inpacket, struct dhcp_pack */ if (inpacket && inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data) { - int prlen = + unsigned prlen = inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].len; if (prlen + priority_len > sizeof(priority_list)) prlen = sizeof(priority_list) - priority_len; @@ -516,7 +521,7 @@ cons_options(struct packet *inpacket, struct dhcp_pack /* * Store all the requested options into the requested buffer. */ -int +unsigned store_options(unsigned char *buffer, int buflen, struct tree_cache **options, unsigned char *priority_list, int priority_len, int first_cutoff, int second_cutoff, int terminate) Modified: stable/11/sbin/dhclient/packet.c ============================================================================== --- stable/11/sbin/dhclient/packet.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/packet.c Fri Jan 12 00:01:08 2018 (r327854) @@ -58,7 +58,7 @@ u_int32_t wrapsum(u_int32_t); u_int32_t checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum) { - int i; + unsigned i; /* Checksum all the pairs of bytes first... */ for (i = 0; i < (nbytes & ~1U); i += 2) { Modified: stable/11/sbin/dhclient/parse.c ============================================================================== --- stable/11/sbin/dhclient/parse.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/parse.c Fri Jan 12 00:01:08 2018 (r327854) @@ -154,7 +154,8 @@ void parse_hardware_param(FILE *cfile, struct hardware *hardware) { unsigned char *t; - int token, hlen; + int token; + size_t hlen; char *val; token = next_token(&val, cfile); @@ -238,13 +239,13 @@ parse_lease_time(FILE *cfile, time_t *timep) * tokenized. */ unsigned char * -parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max, - int separator, int base, int size) +parse_numeric_aggregate(FILE *cfile, unsigned char *buf, size_t *max, + int separator, unsigned base, int size) { unsigned char *bufp = buf, *s = NULL; - int token, count = 0; + int token; char *val, *t; - size_t valsize; + size_t valsize, count = 0; pair c = NULL; if (!bufp && *max) { @@ -321,14 +322,15 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *bu } void -convert_num(unsigned char *buf, char *str, int base, int size) +convert_num(unsigned char *buf, char *str, unsigned base, int size) { - int negative = 0, tval, max; + bool negative = false; + unsigned tval, max; u_int32_t val = 0; char *ptr = str; if (*ptr == '-') { - negative = 1; + negative = true; ptr++; } Modified: stable/11/sbin/dhclient/privsep.c ============================================================================== --- stable/11/sbin/dhclient/privsep.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/privsep.c Fri Jan 12 00:01:08 2018 (r327854) @@ -76,7 +76,8 @@ buf_close(int sock, struct buf *buf) ssize_t buf_read(int sock, void *buf, size_t nbytes) { - ssize_t n, r = 0; + ssize_t n; + size_t r = 0; char *p = buf; do { @@ -84,7 +85,7 @@ buf_read(int sock, void *buf, size_t nbytes) if (n == 0) error("connection closed"); if (n != -1) { - r += n; + r += (size_t)n; p += n; nbytes -= n; } @@ -107,9 +108,9 @@ dispatch_imsg(struct interface_info *ifi, int fd) char *medium, *reason, *filename, *servername, *prefix; size_t medium_len, reason_len, filename_len, - servername_len, prefix_len, totlen; + servername_len, optlen, prefix_len, totlen; struct client_lease lease; - int ret, i, optlen; + int ret, i; struct buf *buf; buf_read(fd, &hdr, sizeof(hdr)); Modified: stable/11/sbin/dhclient/tree.c ============================================================================== --- stable/11/sbin/dhclient/tree.c Fri Jan 12 00:00:01 2018 (r327853) +++ stable/11/sbin/dhclient/tree.c Fri Jan 12 00:01:08 2018 (r327854) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include "dhcpd.h" -extern int h_errno; - pair cons(caddr_t car, pair cdr) { From owner-svn-src-all@freebsd.org Fri Jan 12 00:25:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 924D8E62174; Fri, 12 Jan 2018 00:25:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 539176D56F; Fri, 12 Jan 2018 00:25:58 +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 9C5851C58C; Fri, 12 Jan 2018 00:25:57 +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 w0C0PvSU016232; Fri, 12 Jan 2018 00:25:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C0Pvb5016228; Fri, 12 Jan 2018 00:25:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120025.w0C0Pvb5016228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 00:25:57 +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: r327855 - in stable/11: contrib/netbsd-tests/lib/libc/sys lib/libc/tests/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11: contrib/netbsd-tests/lib/libc/sys lib/libc/tests/sys X-SVN-Commit-Revision: 327855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 00:25:58 -0000 Author: asomers Date: Fri Jan 12 00:25:56 2018 New Revision: 327855 URL: https://svnweb.freebsd.org/changeset/base/327855 Log: MFC r309373 (by bdrewery) Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired. This uses the same fix as r294894 did for the mlock test. The code from that commit is moved into a common object file which PROGS supports building first. Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8689 Added: stable/11/lib/libc/tests/sys/mlock_helper.c - copied unchanged from r309373, head/lib/libc/tests/sys/mlock_helper.c Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c stable/11/lib/libc/tests/sys/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Fri Jan 12 00:01:08 2018 (r327854) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Fri Jan 12 00:25:56 2018 (r327855) @@ -50,85 +50,12 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 #include #define _KMEMUSER #include + +void set_vm_max_wired(int); +void restore_vm_max_wired(void); #endif static long page = 0; - -#ifdef __FreeBSD__ -#define VM_MAX_WIRED "vm.max_wired" - -static void -vm_max_wired_sysctl(int *old_value, int *new_value) -{ - size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); - - if (old_value == NULL) - printf("Setting the new value to %d\n", *new_value); - else { - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - } - - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - - if (old_value != NULL) - printf("Saved the old value (%d)\n", *old_value); -} - -static void -set_vm_max_wired(int new_value) -{ - FILE *fp; - int old_value; - - fp = fopen(VM_MAX_WIRED, "w"); - if (fp == NULL) { - atf_tc_skip("could not open %s for writing: %s", - VM_MAX_WIRED, strerror(errno)); - return; - } - - vm_max_wired_sysctl(&old_value, NULL); - - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, - "saving %s failed", VM_MAX_WIRED); - - fclose(fp); - - vm_max_wired_sysctl(NULL, &new_value); -} - -static void -restore_vm_max_wired(void) -{ - FILE *fp; - int saved_max_wired; - - fp = fopen(VM_MAX_WIRED, "r"); - if (fp == NULL) { - perror("fopen failed\n"); - return; - } - - if (fscanf(fp, "%d", &saved_max_wired) != 1) { - perror("fscanf failed\n"); - fclose(fp); - return; - } - - fclose(fp); - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); - - if (saved_max_wired == 0) /* This will cripple the test host */ - return; - - vm_max_wired_sysctl(NULL, &saved_max_wired); -} -#endif ATF_TC(mlock_clip); ATF_TC_HEAD(mlock_clip, tc) Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Fri Jan 12 00:01:08 2018 (r327854) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Fri Jan 12 00:25:56 2018 (r327855) @@ -50,6 +50,11 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.6 2017/01/13 21:16 #include #include +#ifdef __FreeBSD__ +void set_vm_max_wired(int); +void restore_vm_max_wired(void); +#endif + static void sighandler(int); static const char path[] = "setrlimit"; @@ -236,10 +241,18 @@ sighandler(int signo) _exit(EXIT_SUCCESS); } +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(setrlimit_memlock); +#else ATF_TC(setrlimit_memlock); +#endif ATF_TC_HEAD(setrlimit_memlock, tc) { atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_MEMLOCK"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(setrlimit_memlock, tc) @@ -250,6 +263,11 @@ ATF_TC_BODY(setrlimit_memlock, tc) pid_t pid; int sta; +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + page = sysconf(_SC_PAGESIZE); ATF_REQUIRE(page >= 0); @@ -292,6 +310,14 @@ ATF_TC_BODY(setrlimit_memlock, tc) if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) atf_tc_fail("RLIMIT_MEMLOCK not enforced"); } + +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(setrlimit_memlock, tc) +{ + + restore_vm_max_wired(); +} +#endif ATF_TC(setrlimit_nofile_1); ATF_TC_HEAD(setrlimit_nofile_1, tc) Modified: stable/11/lib/libc/tests/sys/Makefile ============================================================================== --- stable/11/lib/libc/tests/sys/Makefile Fri Jan 12 00:01:08 2018 (r327854) +++ stable/11/lib/libc/tests/sys/Makefile Fri Jan 12 00:25:56 2018 (r327855) @@ -73,6 +73,9 @@ LIBADD.timer_create_test+= rt .include "../Makefile.netbsd-tests" +SRCS.mlock_test+= mlock_helper.c +SRCS.setrlimit_test+= mlock_helper.c + .if ${COMPILER_TYPE} == "gcc" WARNS?= 3 .else Copied: stable/11/lib/libc/tests/sys/mlock_helper.c (from r309373, head/lib/libc/tests/sys/mlock_helper.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/sys/mlock_helper.c Fri Jan 12 00:25:56 2018 (r327855, copy of r309373, head/lib/libc/tests/sys/mlock_helper.c) @@ -0,0 +1,114 @@ +/*- + * Copyright (C) 2016 Bryan Drewery + * 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. + */ + +/* + * Helper for mlock(3) to avoid EAGAIN errors + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#define VM_MAX_WIRED "vm.max_wired" + +static void +vm_max_wired_sysctl(int *old_value, int *new_value) +{ + size_t old_len; + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + + if (old_value == NULL) + printf("Setting the new value to %d\n", *new_value); + else { + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + } + + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + + if (old_value != NULL) + printf("Saved the old value (%d)\n", *old_value); +} + +void +set_vm_max_wired(int new_value) +{ + FILE *fp; + int old_value; + + fp = fopen(VM_MAX_WIRED, "w"); + if (fp == NULL) { + atf_tc_skip("could not open %s for writing: %s", + VM_MAX_WIRED, strerror(errno)); + return; + } + + vm_max_wired_sysctl(&old_value, NULL); + + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + "saving %s failed", VM_MAX_WIRED); + + fclose(fp); + + vm_max_wired_sysctl(NULL, &new_value); +} + +void +restore_vm_max_wired(void) +{ + FILE *fp; + int saved_max_wired; + + fp = fopen(VM_MAX_WIRED, "r"); + if (fp == NULL) { + perror("fopen failed\n"); + return; + } + + if (fscanf(fp, "%d", &saved_max_wired) != 1) { + perror("fscanf failed\n"); + fclose(fp); + return; + } + + fclose(fp); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + + if (saved_max_wired == 0) /* This will cripple the test host */ + return; + + vm_max_wired_sysctl(NULL, &saved_max_wired); +} From owner-svn-src-all@freebsd.org Fri Jan 12 00:31:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79EADE62603; Fri, 12 Jan 2018 00:31:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36ED26D7E4; Fri, 12 Jan 2018 00:31:09 +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 73B831C5D6; Fri, 12 Jan 2018 00:31:08 +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 w0C0V84f018644; Fri, 12 Jan 2018 00:31:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C0V7Ux018635; Fri, 12 Jan 2018 00:31:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120031.w0C0V7Ux018635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 00:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327856 - in stable/11: sys/boot/geli sys/geom/eli tests/sys/geom/class/eli X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/11: sys/boot/geli sys/geom/eli tests/sys/geom/class/eli X-SVN-Commit-Revision: 327856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 00:31:10 -0000 Author: asomers Date: Fri Jan 12 00:31:07 2018 New Revision: 327856 URL: https://svnweb.freebsd.org/changeset/base/327856 Log: MFC r313962, r313972-r313973, r315230 r313962 by allanjude: improve PBKDF2 performance The PBKDF2 in sys/geom/eli/pkcs5v2.c is around half the speed it could be GELI's PBKDF2 uses a simple benchmark to determine a number of iterations that will takes approximately 2 seconds. The security provided is actually half what is expected, because an attacker could use the optimized algorithm to brute force the key in half the expected time. With this change, all newly generated GELI keys will be approximately 2x as strong. Previously generated keys will talk half as long to calculate, resulting in faster mounting of encrypted volumes. Users may choose to rekey, to generate a new key with the larger default number of iterations using the geli(8) setkey command. Security of existing data is not compromised, as ~1 second per brute force attempt is still a very high threshold. PR: 202365 Original Research: https://jbp.io/2015/08/11/pbkdf2-performance-matters/ Submitted by: Joe Pixton (Original Version), jmg (Later Version) Reviewed by: ed, pjd, delphij Approved by: secteam, pjd (maintainer) Differential Revision: https://reviews.freebsd.org/D8236 r313972 by ngie: Unbreak the build when "make obj" is executed beforehand Using relative paths imply working directory (in this case .OBJDIR), whereas the sources live in the .CURDIR-relative path. X-MFC with: r313962 Pointyhat to: allanjude Sponsored by: Dell EMC Isilon r313973 by ngie: A forced commit to note other portion of the Makefile change accidentally committed in r313972 The code committed in r313962 implicitly relies on python 2.x to generate testvect.h . There are a handful of issues with this approach: - python is not an explicit build dependency for FreeBSD - python 2.x is deprecated and will be removed sometime in the future (potentially before 11.x's EOL), and the script does not function with python 3.5 (it uses deprecated idioms and incompatible function calls). - python(1) (by default) lives in /usr/local/bin (${LOCALBASE}/bin) and gentestvect.py is a dependency of testvect.h (prior to r313972) which means that if the mtime of the generator script was newer than the mtime of the test vector, it could cause a spurious build failure in build time or at install time. A better solution using C/C++ should be devised. Discussed with: allanjude X-MFC with: r313962, r313972 Sponsored by: Dell EMC Isilon r315230 by ngie: Move .../sys/geom/eli/pbkdf2... to .../sys/geom/class/eli/... This change moves the tests added in r313962 to an existing directory structure used by the geli TAP tests. It also, renames the test from pbkdf2 to pbkdf2_test . The changes to ObsoleteFiles.inc are being committed separately as they aren't needed for the MFC to ^/stable/11, etc, if the MFC for the tests is done all in one commit. X-MFC with: r313962, r313972-r313973 Reviewed by: allanjude Sponsored by: Dell EMC Isilon Differential Revision: D9985 Added: stable/11/tests/sys/geom/class/eli/gentestvect.py - copied unchanged from r315230, head/tests/sys/geom/class/eli/gentestvect.py stable/11/tests/sys/geom/class/eli/hmac_test.c - copied unchanged from r315230, head/tests/sys/geom/class/eli/hmac_test.c stable/11/tests/sys/geom/class/eli/testvect.h - copied unchanged from r315230, head/tests/sys/geom/class/eli/testvect.h Modified: stable/11/sys/boot/geli/Makefile stable/11/sys/geom/eli/g_eli.h stable/11/sys/geom/eli/g_eli_hmac.c stable/11/sys/geom/eli/pkcs5v2.c stable/11/tests/sys/geom/class/eli/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/geli/Makefile ============================================================================== --- stable/11/sys/boot/geli/Makefile Fri Jan 12 00:25:56 2018 (r327855) +++ stable/11/sys/boot/geli/Makefile Fri Jan 12 00:31:07 2018 (r327856) @@ -24,6 +24,10 @@ WARNS?= 0 .PATH: ${.CURDIR}/../../../lib/libc/string SRCS+= bcmp.c bcopy.c bzero.c +# need explicit_bzero for crypto +.PATH: ${.CURDIR}/../../../sys/libkern +SRCS+= explicit_bzero.c + # Our password input method SRCS+= pwgets.c Modified: stable/11/sys/geom/eli/g_eli.h ============================================================================== --- stable/11/sys/geom/eli/g_eli.h Fri Jan 12 00:25:56 2018 (r327855) +++ stable/11/sys/geom/eli/g_eli.h Fri Jan 12 00:31:07 2018 (r327856) @@ -686,8 +686,8 @@ int g_eli_crypto_decrypt(u_int algo, u_char *data, siz const u_char *key, size_t keysize); struct hmac_ctx { - SHA512_CTX shactx; - u_char k_opad[128]; + SHA512_CTX innerctx; + SHA512_CTX outerctx; }; void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey, Modified: stable/11/sys/geom/eli/g_eli_hmac.c ============================================================================== --- stable/11/sys/geom/eli/g_eli_hmac.c Fri Jan 12 00:25:56 2018 (r327855) +++ stable/11/sys/geom/eli/g_eli_hmac.c Fri Jan 12 00:31:07 2018 (r327856) @@ -47,7 +47,7 @@ void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey, size_t hkeylen) { - u_char k_ipad[128], key[128]; + u_char k_ipad[128], k_opad[128], key[128]; SHA512_CTX lctx; u_int i; @@ -66,13 +66,17 @@ g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uin /* XOR key with ipad and opad values. */ for (i = 0; i < sizeof(key); i++) { k_ipad[i] = key[i] ^ 0x36; - ctx->k_opad[i] = key[i] ^ 0x5c; + k_opad[i] = key[i] ^ 0x5c; } - bzero(key, sizeof(key)); - /* Perform inner SHA512. */ - SHA512_Init(&ctx->shactx); - SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); - bzero(k_ipad, sizeof(k_ipad)); + explicit_bzero(key, sizeof(key)); + /* Start inner SHA512. */ + SHA512_Init(&ctx->innerctx); + SHA512_Update(&ctx->innerctx, k_ipad, sizeof(k_ipad)); + explicit_bzero(k_ipad, sizeof(k_ipad)); + /* Start outer SHA512. */ + SHA512_Init(&ctx->outerctx); + SHA512_Update(&ctx->outerctx, k_opad, sizeof(k_opad)); + explicit_bzero(k_opad, sizeof(k_opad)); } void @@ -80,28 +84,27 @@ g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const u size_t datasize) { - SHA512_Update(&ctx->shactx, data, datasize); + SHA512_Update(&ctx->innerctx, data, datasize); } void g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize) { u_char digest[SHA512_MDLEN]; - SHA512_CTX lctx; - SHA512_Final(digest, &ctx->shactx); - /* Perform outer SHA512. */ - SHA512_Init(&lctx); - SHA512_Update(&lctx, ctx->k_opad, sizeof(ctx->k_opad)); - bzero(ctx, sizeof(*ctx)); - SHA512_Update(&lctx, digest, sizeof(digest)); - SHA512_Final(digest, &lctx); - bzero(&lctx, sizeof(lctx)); + /* Complete inner hash */ + SHA512_Final(digest, &ctx->innerctx); + + /* Complete outer hash */ + SHA512_Update(&ctx->outerctx, digest, sizeof(digest)); + SHA512_Final(digest, &ctx->outerctx); + + explicit_bzero(ctx, sizeof(*ctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) mdsize = SHA512_MDLEN; bcopy(digest, md, mdsize); - bzero(digest, sizeof(digest)); + explicit_bzero(digest, sizeof(digest)); } void Modified: stable/11/sys/geom/eli/pkcs5v2.c ============================================================================== --- stable/11/sys/geom/eli/pkcs5v2.c Fri Jan 12 00:25:56 2018 (r327855) +++ stable/11/sys/geom/eli/pkcs5v2.c Fri Jan 12 00:31:07 2018 (r327856) @@ -56,6 +56,7 @@ pkcs5v2_genkey(uint8_t *key, unsigned keylen, const ui uint8_t *counter, *keyp; u_int i, bsize, passlen; uint32_t count; + struct hmac_ctx startpoint, ctx; passlen = strlen(passphrase); bzero(key, keylen); @@ -66,20 +67,23 @@ pkcs5v2_genkey(uint8_t *key, unsigned keylen, const ui for (count = 1; keylen > 0; count++, keylen -= bsize, keyp += bsize) { bsize = MIN(keylen, sizeof(md)); - counter[0] = (count >> 24) & 0xff; - counter[1] = (count >> 16) & 0xff; - counter[2] = (count >> 8) & 0xff; - counter[3] = count & 0xff; - g_eli_crypto_hmac(passphrase, passlen, saltcount, - sizeof(saltcount), md, 0); + be32enc(counter, count); + + g_eli_crypto_hmac_init(&startpoint, passphrase, passlen); + ctx = startpoint; + g_eli_crypto_hmac_update(&ctx, saltcount, sizeof(saltcount)); + g_eli_crypto_hmac_final(&ctx, md, sizeof(md)); xor(keyp, md, bsize); for(i = 1; i < iterations; i++) { - g_eli_crypto_hmac(passphrase, passlen, md, sizeof(md), - md, 0); + ctx = startpoint; + g_eli_crypto_hmac_update(&ctx, md, sizeof(md)); + g_eli_crypto_hmac_final(&ctx, md, sizeof(md)); xor(keyp, md, bsize); } } + explicit_bzero(&startpoint, sizeof(startpoint)); + explicit_bzero(&ctx, sizeof(ctx)); } #ifndef _KERNEL Modified: stable/11/tests/sys/geom/class/eli/Makefile ============================================================================== --- stable/11/tests/sys/geom/class/eli/Makefile Fri Jan 12 00:25:56 2018 (r327855) +++ stable/11/tests/sys/geom/class/eli/Makefile Fri Jan 12 00:31:07 2018 (r327856) @@ -1,9 +1,13 @@ # $FreeBSD$ +.PATH: ${SRCTOP}/sys/geom/eli ${SRCTOP}/sys/crypto/sha2 + PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} +ATF_TESTS_C= pbkdf2_test + TAP_TESTS_SH+= attach_d_test TAP_TESTS_SH+= configure_b_B_test TAP_TESTS_SH+= delkey_test @@ -39,5 +43,20 @@ ${PACKAGE}FILES+= conf.sh .for t in ${TAP_TESTS_SH} TEST_METADATA.$t+= required_user="root" .endfor + +CFLAGS.pbkdf2_test= -I${SYSDIR}/sys + +SRCS.pbkdf2_test= \ + hmac_test.c \ + g_eli_crypto.c \ + g_eli_hmac.c \ + pkcs5v2.c \ + sha512c.c \ + sha256c.c + +LIBADD.pbkdf2_test= crypto + +testvect.h: + python gentestvect.py > ${.TARGET} .include Copied: stable/11/tests/sys/geom/class/eli/gentestvect.py (from r315230, head/tests/sys/geom/class/eli/gentestvect.py) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tests/sys/geom/class/eli/gentestvect.py Fri Jan 12 00:31:07 2018 (r327856, copy of r315230, head/tests/sys/geom/class/eli/gentestvect.py) @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# $FreeBSD$ + +from hashlib import pbkdf2_hmac +import hashlib +import itertools +import string + +#From: https://stackoverflow.com/questions/14945095/how-to-escape-string-for-generated-c +def cstring(s, encoding='ascii'): + if isinstance(s, unicode): + s = s.encode(encoding) + + result = '' + for c in s: + if not (32 <= ord(c) < 127) or c in ('\\', '"'): + result += '\\%03o' % ord(c) + else: + result += c + + return '"' + result + '"' + +intarr = lambda y: ', '.join(map(lambda x: str(ord(x)), y)) + +_randfd = open('/dev/urandom', 'rb') +_maketrans = string.maketrans('', '') +def randgen(l, delchrs=None): + if delchrs is None: + return _randfd.read(l) + + s = '' + while len(s) < l: + s += string.translate(_randfd.read(l - len(s)), _maketrans, + delchrs) + return s + +def printhmacres(salt, passwd, itr, hmacout): + print '\t{ %s, %d, %s, %d, %s, %d },' % (cstring(salt), len(salt), + cstring(passwd), itr, cstring(hmacout), len(hmacout)) + +if __name__ == '__main__': + import sys + + if len(sys.argv) == 1: + hashfun = 'sha512' + else: + hashfun = sys.argv[1] + + if hashfun not in hashlib.algorithms: + print 'Invalid hash function: %s' % `hashfun` + sys.exit(1) + + print '/* Test Vectors for PBKDF2-%s */' % hashfun.upper() + print '\t/* salt, saltlen, passwd, itr, hmacout, hmacoutlen */' + for saltl in xrange(8, 64, 8): + for itr in itertools.chain(xrange(100, 1000, 100), xrange(1000, + 10000, 1000)): + for passlen in xrange(8, 80, 8): + salt = randgen(saltl) + passwd = randgen(passlen, '\x00') + hmacout = pbkdf2_hmac(hashfun, passwd, salt, + itr) + printhmacres(salt, passwd, itr, hmacout) Copied: stable/11/tests/sys/geom/class/eli/hmac_test.c (from r315230, head/tests/sys/geom/class/eli/hmac_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tests/sys/geom/class/eli/hmac_test.c Fri Jan 12 00:31:07 2018 (r327856, copy of r315230, head/tests/sys/geom/class/eli/hmac_test.c) @@ -0,0 +1,41 @@ +/* + * $FreeBSD$ + */ + +#include +#include + +#include + +const struct { + char *salt; + size_t saltlen; + char *passwd; + int iterations; + char *hmacout; + size_t hmaclen; +} testdata[] = { +#include "testvect.h" +}; + +ATF_TC_WITHOUT_HEAD(hmactest); +ATF_TC_BODY(hmactest, tc) +{ + size_t i; + uint8_t hmacout[64]; + + for (i = 0; i < nitems(testdata); i++) { + pkcs5v2_genkey(hmacout, testdata[i].hmaclen, + (uint8_t *)testdata[i].salt, testdata[i].saltlen, + testdata[i].passwd, testdata[i].iterations); + ATF_REQUIRE(bcmp(hmacout, testdata[i].hmacout, + testdata[i].hmaclen) == 0); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, hmactest); + + return (atf_no_error()); +} Copied: stable/11/tests/sys/geom/class/eli/testvect.h (from r315230, head/tests/sys/geom/class/eli/testvect.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tests/sys/geom/class/eli/testvect.h Fri Jan 12 00:31:07 2018 (r327856, copy of r315230, head/tests/sys/geom/class/eli/testvect.h) @@ -0,0 +1,1137 @@ +/* $FreeBSD$ */ +/* Test Vectors for PBKDF2-SHA512 */ + /* salt, saltlen, passwd, itr, hmacout, hmacoutlen */ + { "\331}\035\215\000\272\350\261", 8, "\323\303\210\231\260\225\217\035", 100, "J\257\275\352n\371\300!tp\367\257\347c'\000\243F\246\376\274H\263\312m\336\304\3515P\222Cb\037-\313W\0067\232\024%\235\252\322\035\225k\025\2248\251r\312]v\316\021j\231\224\2556\350", 64 }, + { "\321\213\277\330\210E\207x", 8, "(C\371\344\354\356\232\212\346\014\335M(\234g\226", 100, "\035MoB\245\001\000\315\332\235\356?alD\231I[%A\372\367\027\267,\303\022\324\004\302a\302t\257\306S\251\250;-pa\246Z\200\003*+\026\305_\250\214n\321\340.\032a3\371\346\025\042", 64 }, + { "\344\353\215\257\020\315\245\367", 8, "/pj@N\344\271\243^\352\236gu\352\344os\366FR\362\001\347\301", 100, "\223eS:\015\311\023\317\230O\012\347\014\32070\321\337p\353\305\361\223\323\333&\011'\360?\022\374P\336\337\031\266,~@!\037\000\320v\360!\225\221@C\266|k\370@\305\202\235+\314\247\305&", 64 }, + { "\364\275\222\376\0064\240g", 8, "_\2000 A\233#\372\351\332\247\010\313\274\334\255\362J\356\333\302\345\317\305*\357 \366Aj\344\346", 100, "\223\015X\340\024\244\2767\027\253\261\232\360(?\350H7\326K\322\246\341\222\202:@\254\3218\016T\275\212^\005\344\202\230\220s\311\201\025\233~K6\241*b\244\203\273\355\270\277\242\300V3\037\224\311", 64 }, + { "\272\207\326\030\010\374\263f", 8, "\323\230\233\317\337\001\241]G\312\347\320K\3374\247\016\343\246\353\300\373\267\335\314h\216\245$\373\210\214\014b\340\377\256\0202E", 100, "a\274S.\032\246\330\321\322\207\004\241n\303\363\361\361\215\367Xi\250\275\246\037\355\255\342\004\253\250\243&\032\357\250\204\207K\2612\0318\3353\253\335Z\351\337\253v\345\322r\030\0066\230jp\345\373\203", 64 }, + { "j\276\230\215\031$\326v", 8, "gy\264\354\363\322(w\262\272\203\306{\356\031\376\277+\276L\337\270G\345!>29\010\204m\240!\326\255\326\321\272(\325T\033B\262[\267]\272", 100, "\2563\024\201\310\372\017\373\270\232\277\265:j\231\365\032zS\3723\012\341i\302V\233l\247\030:\355\262]\337\361JUe:\350|#D\262\335)\260\333\273\221\252\005\226\322'\371+a\270a\302\276p", 64 }, + { ",;\270P\012\035\262\235", 8, "\375 \232J\304\271_\272\033\027\363\021\227\260\323\310\304k\004.\327\354\217,\357\353]I0\332We\245\257\371,\260\360\325\224\026q[VuS\217\004\262\376T\353\262\321\241\024", 100, "\313\246&~\374Zq(0\000\002\332\356\355M\353Z?\310~\234\327\011\242\370\032GK\250\020\203sJ\234I,\271\012\230\204g\323\345\343\343\350\231\227\015\350b\256\012\367Q\255v\365\210\247\2614\210\365", 64 }, + { "\021\325\267u\203$\352\274", 8, "\232\032\225'\021*'a\042\023{\250\361r\262\365\370\032\347\336\363Re28\033J\3763^\311I\322:\036\204\320\033\245\200\262\225\341\377\334\241p\314\334\005O,\374\225\234\014\266\365\030i6\210a\205", 100, "\220\006\216\2420-8m\2766\353(6\212\306\261C@\252\2104\005\205\274\204\365\226\373\016\345\332\207\361A\244\023W\3051:\277\2705Z\253\262\371M\024L\215\224\340p\336\355\250\030*8\300\017\254f", 64 }, + { "[\353e\224\2423\270m", 8, "\1776\374\302o0\007\307w\032\307\266\376\320\042/\266\352\233\224\316\3616\314!`\015d\316\370L{\201B\245\317\366@V\036\227\273I\205\251\306GW\200*\340P\267\202#\354\330\266O\347\254(\203\270\366w\274\375\272\016\240\313", 100, "?j\005\340=\022\012NM\024\231\220_u\023@\042\214\014b\375\251\023\244y3m\330\377\341\271~V0\263\223\274\325Rmug\026Dt!\347%\270\244\371@\177\350\250N\320\246\034\320\013|\276\027", 64 }, + { "\262\304(\244\326\272\262\311", 8, "\210C(\273\376\013/\034", 200, "6+\233\201\350\374\2053\013\377SA\007\037\303\027RyrC\361\303\321\031\225d\215\314\213\210\006\031\217\035L)\377'\016\263\310\206\326\372\362\230\226.F\134\277\367\35357(\214\262\036\310@\363#\020", 64 }, + { "\246<\216\226^F\004\036", 8, "\344].\210\212\236\252f\256n\006\250\2615\325\371", 200, "\213J\234\270\227$St\265\035\323\001&\025\027T>\015F\205\325\361_\003l\245|\213S\232@\254o\227\235l$\355\037\214\220\032\213\320\265lM\334\320\313+\205.\355\310\201K\370^\025\134\346[K", 64 }, + { "9s72\020\270\251\350", 8, "\323\370:k\323o\271Y\335\306\375#\333\222\246?C\313\023\202>\005\025\216", 200, "\371\373\341\202(\231\010\325_\335\205\253\216\371\227\354\352Os2\356e\033L\236znr;\337a'\025\335n\032f\304\177u\001n{\236`\261\346N\2748R\017\243\226[\256@<\021m\202r\363g", 64 }, + { "\032\216\254\215\022l\001H", 8, "\027J\232\302\240lTSU\215y\262\360\017\346\3253\276r\276\211\306>\3740\263\264\002\333J;\262", 200, "\3206K,\267r<\302r\207y\373\3625]2Y\3710\343\272\211\202\3465g\340jG\001`\341\352\313\203\250x\221K\254iV\350w\2220\257Yc\360Z\263\237\255\042\325\341\307\330\232s@?\210", 64 }, + { "D\302g\023\316\224l\271", 8, "\262t\301{\366\345Bv\271!\213\303\244O8\314\336\363\325|\206x\034d$#\001x9\012\241\256W\241\334\307\240\207F", 64 }, + { "\037\346\010\241]\004x\204", 8, "T\334\371\316I\33656Q\027\277\203\033\303\240\371\231\352\214\3701@\002\015?2\264\002\257R\205\250\264}\021\012\326\366wF\311\267\271\0042C:/\341\031\242\337\237.\021V\034\263`W\306Y\3533", 200, "V\370Nt\341W\226|\367\226\200\033|\006Kii\263\304\307\347\301#L\371\335l|O\304\300v\361d\255h^\322\026\332U\224\270\255\227\022\226G\326\363\303\244\234\235\016/<\331\247\307\242\355\226\307", 64 }, + { "\364\303X\325\327\256\342f", 8, "\227E\237\320\214GB\332\005\0333\250=\020c(\345\007?\032)\2643\243\202\371\200\030\002\225\011/\030\030\003Q\354\344\361B\214\333.\015\336`\376.\360\243$\017\367K\207\212\347L\356S\230\346\034*\307\207\203\233a\310\370\255", 200, "L(\217#(\300jA\343\037\251rR\312G\024\016dj:\212|\024\373\275\134\375\374\247\266FpF\275:\373_\314\134\244\016\373\203k\265\225\243\212t\240\310\347\226\262%\233\213\332w\042WL\302\331", 64 }, + { "c\027\266\220\010\031\241\313", 8, "F#\323\2367\260\323\273", 300, "@\200\033\254\020\246\206L$\203\026.T\223\205\364\362@\204*\316\232u\033\321\212;l\202\313s\205\333<1~\211\267\213\336Z\276\233W\322\366!\3629l\343@O\216+[!\262I\350\262\312\022\357", 64 }, + { "\001\277`\003x\301n\313", 8, "\257'\372i.M$\356\230\032\252yq\302\004c", 300, "?\037\327=m\335R\367?\242q\002\023V\203\017q8\252\325?6\213\241\274\275\356\344*\312/p~.<\305\346]\377\242\361\025\311\375\303\247\305\345@U\230\364F\275\211n\250Ay\352\026+\253V", 64 }, + { "\203\020{)\016R\324\350", 8, "\261\200\031:\346l\242u\352\300\014_\320\221y\213e\214\352\042c\371\257\361", 300, "\001\2111R\305R'b.L\007$\042\267\346\304(|+2\240\260\021\042\243J\344\237\006\236\203A\032\363\356\251\015.\321\336\03431X\002\355\221\313]\264\310\315o\316aw\246|\312bT:\325\300", 64 }, + { "\002X\311\253\033h\036'", 8, "P\206\257!\305E\377\275\310\005\364Bn\005\342>!w\017@}\245\350\177\305\312\323\361,\301y\022", 300, "\360\301\033\007\367,\374\242\177\3153D\251*_>{\005\272NQ\021\024:0\036\357\333c\254/\001\035\202\341\330\005\0245\265b}\261\232\273\0318\225\227\252\210\361\300\016\357\323\204\202\246\376\277@\225w", 64 }, + { ">+\207\003k\311\225\276", 8, "((\260Eak\253\305\3243Q\332*N\276\323\325_48\317\264&\340\005\323N\224p\003\331Fl\215\317 w\034u?", 300, "\276\317.\310Gj \217\3502.za\021\230\322C6\255\301\354-\263\247\002\352\377\267]\243\201n\245\213D\240\010D|\324\336\251\326\342e\231\350*\300\315\007\234\236\002}\372\013\364\257\232\262:\207e", 64 }, + { "\265G\357\330S\302?8", 8, "7S-\203\036\340\015\356\027\253\302\376\222\037\2276\0141|p\255\313\325\211\206\265\230\333\027\343\231\007\335\366\356\011 $ \312`\333y\267K4\317\277", 300, "\004\264\241\262\204\361YL%#v\373\013@E/\335\353 l\365\242u\215\301p\360O\030{\0236\033\206$\340\263\202bC\032\014\252\365\323\325\350u\210\234\020\037\015\275\000{h\363a\244\024\177\356\236", 64 }, + { "I\257\321\376\365\317\267I", 8, "\200!XxW\233B\374,\362\027,\343\022\204\220\373\231=\376\343\362\246\224 \001\233\015\0338\337\224#%\320\037\342\276\314X{h\036\210w\377\011@=\021\034\3429!\211\350", 300, "`\277s c\215t\251,\306:L\267`u%D\244\021\340\036C\304\032\014u\042\134Mzo\313\225\3641\017\037\271q*\321\023\227\253\215\330\351\373\202\220\274`P\267\277\373\007\366\370\031\350\015\214\245", 64 }, + { "\324\366\347;\363R\300!", 8, "y\262~C\031\252 \004\215a\033\355l9\024C\237b/\032Kk\316q\257K\017\017\036\316\003\246\005\225(\0168\264\032pT\030\250\334\341\020\012X K\325\002\254mh\265\134N*?\233\007Zn", 300, "\202\252\261h$8%\335rv\260\0005\313Lj\244\262\342\202\352\277\005 \2418\2740Y\333\036\014[\015\030'O\351\377|D\0114O\344\203\177\360\337\3610\315\323\2528\247\307\3535R\366)\033\236", 64 }, + { "\301\357\263\261\347O\344,", 8, "\216\376\312\271K}\224Pt\022\2572\230lR\177\340m\224\271\305\237Z\374\252\204\313M\307&\330]^W[\001\317\207\264\305\017\224\331\245\361\301Z\371r\264\223\202\201\353\252k\223Bk\361\323c\307\255(\010:x%\257\3352", 300, "\312\240!.\3606\236]\235\315\2409\042?\027\015\271\030\352l>\272s\345\340\231\317\263\306W6[\342\360\307\305 !\357\003|g][\275j=ptx\344\265\271~\036_\361\004\246\261\313\241D)", 64 }, + { "\257\000;+\233Q\214b", 8, "eoq{\270\246ua", 400, "\251B\370\245m\000>\134\007\256\373\001\251\262,\310\367\376\323\334{K\202\177\235\376x\365D(+\367\361\373\031\376\254H\243\305/N\267\205\2108\301*\025@\030\311\012.\261\237\377\015\205h\261\042\372\034", 64 }, + { "hU\325\246:obb", 8, "?/\352\332\327c\027\331\305N'\321\355\337\316\241", 400, "\177\312\2275\203 \026aNXF\010\377\336=\240\025\312\252r\01363\234\351\2754[y7E\334CQ\371\243F\010l\2545\253\214\341\323\300u\202\225\236\250\356\007Q\000Q\302\207M@g\350m:", 64 }, + { "p(\256-\313\020{\300", 8, "\334\310\227\225J\356\360\307!\353\023\332|\214\306\036\026\253|-\267\341\321\223", 400, "\267\250\271J-\265\303\247\337ib\237l>\352\344\302\3321\3006\240\233\232N\2661\236\022s+\300\1342\375%\251Yl\032kK}\227T`\364\233v0|/\217\026\032\261\020\225\335k@`\021\227", 64 }, + { ",\032\034\337\304,\340\334", 8, "\011F\350\213N\0058\212}N\267\007\007E\276\203C\315\332\013\030`\372\030\370\001\240\030\354@9\327", 400, "\206A\034\355\042\030\025\220\000\251\025`\356\372Fr\313\246L\307\255@;\366\354\346\362\206h\023>A\271\273r\036\224\325Q\246\2527 ^\014!\240:|\335G\322\333\032\005ok~\371\372\255oD\257", 64 }, + { "H\322\305\000\020\341\365\243", 8, "\330\313R\037\276\004\355\327\363QH\327\364r\305}\014\370\007B\252xS\345\003\346\202\366\250\375\237\315 \205\355\214Rj\037\365", 400, "u\346\0049k\347\134\211\023\330\015\360o`\217\266\234\012\007\003\270\025A}\373^\366d:n\344\000PqM\314\200\213<\204:N\0279\323z\337\271\031\337x\0007\352\220\032b \303\346`\201\2729", 64 }, + { "\236\271\202\214\310\003r\323", 8, "\020>\356\364\222*\307l\337\312\351\343R\273pxL6|\305\324\362\273>\332\245t\3267\212\276\231\310\343\243\034X\360,\224il\313\374\217\2407\134", 400, "\224?^QsO\227|\332iTx\204=g\360\033\352\240`\330L\212\276(\201Dx\017\216\016\231\307^\204K%^\327\360\257\236\005j\010\233\371H\203n`zx\230cH\320,M\315\344%\215\024", 64 }, + { "\353h~\2307\320gN", 8, "\235H\252\037+\014\003\265\235*v\020I\376\207\331\222\266\274\0270tb\341\276.\306w^\331\270\263k\341%\270\200\232\321b/\244\310\016\361\316\362:\375/\371\255B\307./", 400, "\221Y)\236*\214\226e\360\324\257\367\230R\014_\314\214\236\027O\004\305\370\317w\257\260\001w\245\003P\371\335Y\240\227\365\243bh\254\372\247\375\301)k\255\245&\262\036\374_\026\224\326D\220\336\246\351", 64 }, + { "\362\023\013 \331\240-M", 8, "\353~\003\260'd@\026_<\301\360]EU\332i\336\177g\347\313\232\337\3562\010\250\345c\235\265\236\343;\322\302~\317\371\002~\027\012\332\301r\014#\322\004\353\261\275g\263\017(W>{`\322P", 400, "SA\003b\271\034\227\224gN\023\203\207 mW\365\257Nz\267wn\016\221\017g%(n\256/\330\311\377+\335\261\343CA\015A\272\352-\345`\245\370W6\020Y\215\2212\000\272\001\022$*\376", 64 }, + { "\250c`\236vN\302\210", 8, "\257(\256\0171z\243\023\042\134\363\223\252}GzB\307\261\220\301\270\027\327\326\353\253>\313\276\006UAd\355}\276\320)\375`E\353*-\370\226\370\021\004\203\374e\016e\275\202\313\227AP/?5\260\225\217\243\276Ag\377", 400, "\203\022\352c\27522Z\265mo\224\016G\376/C\026\000{\0201\015(\224\005!fV\262\204N\265\206\202\336\255\362\036\015\330\241!5\247\035rVG\346v\301W\306\204\335HS\371Tlq\207\334", 64 }, + { "\327\002\265\344\005\337@O", 8, "\233\317\326\221:\2409Y", 500, "\134\021\253\352\370\313yg<\015\200\022b\317Vq\262\220\257fL\315\302\201\266\036lxQ\371\021 J\337)(2\346\017V2\310\217\030\274I\357\215\2115\277p\351\236\012\272\346V:\317\003\326\2062", 64 }, + { "\320u\027+-\245\0217", 8, "\216\257\376\3147\035d\300\366\365\315\320w\304\236$", 500, "\001_\134H\237\352\244\340\034\274\366\034H\321\311\216\255R_U\263\221\206J\301\2641\304J~\274oH\007\340\246a\313\204>\216\330\311x*<\334T\216\251S\322at\360\234\243w3\033\2061PL", 64 }, + { "#@\256\000\333y\350\327", 8, "Rb\213R\263\262W\317\333\354\261\340\246\26119H\334\277U\253\266C\247", 500, "\343\224\023a\337\367\347\276\245\310-(\363\021\271\221_\360\245\233\356S\236\363\027\212\0046*\244\376\3032\352\007\023Fs-\332\203#+\355\244\33654\205a\200\302w\314\335\0157\212S\227\271l\202*", 64 }, + { "\350e\303Y\257\366M\223", 8, "d\311\323\036\030%\266j\372\006\016\024;\344\350\256\234\026\341el\325\270\236\226\020\312b[\212\353\343", 500, "F\026H&\347}\264@\307\246ap\356W\272P\023\254\204/-\006\337u\230K\221\204\312h\337Q\021\037p9\222U\032\262k~\013e\017X\134/\243\264>j\251=DBu_*\350Z\260\010z", 64 }, + { "\277\212\2413\001K\016_", 8, "\005<#\022(`\277\021/J4~\363\354x\207\271\211Ft\233\026\252\326:\236", 500, "\220\344\307\355\203\332\013\207\2504\364\207\303\026\316\251\026X\367\373sN\225\2540\243\006\233/l\224\370\310\346\352\227}K\267\223E,\010G{e\270>})\274\312\001\3350\311\261\367?7\251|i\243", 64 }, + { "\271\035\035\334\321\366u\304", 8, "\325L\272\252\211;\134\014}^\270\007<\316[68S\361\3264lA\240}\025l\032\265\036\247\227!\035x\354C\262[\177\320\324\305%\333{\317*V\220\027\367\322_\234\017\253]\024\347dDB#>\373\003\216\347\333r\220Z\334\301\346\356']\323 \375t7cQh\010\004v\2253", 64 }, + { "\275\303\226\316\005\315-\300", 8, "\223\241?\356\014`\255l\337ad\241k\345\355\226\334\266@\217C\221\237\005", 600, "\312\375\227\367e\311\261\367\012\304\303\372K:\226\326\010E\235\355A\225\331j\026n\3264\303\301\324\214YnM\261\310\020\002bi\324\311\247\011\237{;\013\216C<> \017-xk\370\265\303\333\311\014", 64 }, + { "J\242\213\023\026l\3506", 8, "\303\020\346\376\230\303\347=_\355#\0015\363\345+\233\216\203l\347rSa\272Q9\336>\034\257\233", 600, "\3331\377\232\361\326D\362V#\2124l\237\327\215\231\375%|)aM\037\201\030\027\341OxFU<\306\302\355fO\326\325\242\177A\254\316H\247V\227\342\032\377\002\256VY\220\303\363\206[j\222\226", 64 }, + { "\222\360%qi`\034\316", 8, "\370Hx\232\025]yH\337ys\310\032f\317g\371\315-zT\225c4\033Uy\021\314\013\337\260\247G_4s%\261\004", 600, "\336lk\337\003M\223\020y\344p\356\250\000\301z\337\263.WN),\335!\375\227\210\367d\263Z\214Y\330\333\264\030\004\326\011W\005\323\3448\354(^T'\200\255\301\320\012\355F\240\271\203\012\353\313", 64 }, + { "0\015\376\022\354\343\255/", 8, "\304\347\345\335\327g\331\204\343\025\246\030\247y\365-\266\264\361\212\366\211\035\216\276+\235<\371\321\226[\250\336\346tn<}\247\2076%\231\373\227o\351", 600, "\201\306eLu\262\032\355\246H`2\246\247-\007\217H;\017\370\277\237)\275='\001HG$\134\223N\000\335n\304y\272\205N\2265\310\305o\250# \235r\312\236\217W\324\360\323\007\351\215\232+", 64 }, + { "\030\253\370\026\377\013s\252", 8, "\337\202p\313\334&[ql\346\042\350\016\272+\322|\004S5d\223]9}\250\253EW\357+\215\315\255\246\023\352>\274\001\027\231x\225#\261:n\342\012l\253\005\036\134\327", 600, "\223\241\274\227M\2322t\205\027\016\377\267\015\350\012Y \321\217\000\305\305Y\322\301\260\316\230\200\003rQ\235\245\177\003\305\342\022Iu\375\323>1W\002\013\321k\264\334?\225:!\377\014\331\206\270\371'", 64 }, + { "a\033o\014\314\261\004\243", 8, "y\340j\235ZH+4\023}\372=4\262\303\213\134|\220\252\255\0014\021\262\355\224\212\312\341\277 l^\021t\261S^j\007\313N\005\277\340\224\345\320\346\226eH\042\313q\271i\317\023U]B\331", 600, "\355=1\261\000\236>\260t@\241\370\305\323\2139\016\316vb\352\2533\336L\015\371\321\265\211_\273\177c\311UAa8P\263\017\272\037\217<\201\327\205\002IV\227\034\273\002\002\3312#\243\225\327b", 64 }, + { "[$\035\042a\220:c", 8, "j\312\316\373\207\241\335\304\0327\033\263\274[\305\234\371\224\253\012\266x\340\224V\230\335\374l3\320L\252\306qA\344\3069C&H\265\211\306X\347\311:\376\223It,\251\300!h\24791\371V\007\375\233J\032\330.\236U", 600, "`l\213nT\353\237\304\251I\256 >C\231\000X\377\332\206\204K\262Z\353\327\022\265}\245y\232\3368WI\332/\213\316\042\371\200\033\0378\322U4J\363\360\357\350\361*\367.>\363\377\334\0232", 64 }, + { "\354\304\015\017\355\240\021\276", 8, "\247\274\225<\353\357\376c", 700, "\374\221\245\277Y\007w\274\375\266'l\316\243\333\312\223\257\301\270\303K\337q_\331\354\347\376\012\223\275\344\001t\373F`\235\302\3108W\332\205Q\223d\004\207\223aki\277\307\313}\326\254\234v\042\341", 64 }, + { "IZ\367\257\273\377\332k", 8, "i\027\226\010\004~\257w\273?\222\224\212\274 C", 700, "\253\034\346./iA\3661T32Zw\312\266.\357\034\032\202\213\332\320\356\356\327\275\217\251\326\356\042\377^\270\362\346W\367\353\237\331B[\021\034\310& Me]|\355\274\207\325\372=\373iR\177", 64 }, + { "G\334S\242\304\334Y<", 8, "\330x<\264\323\016\237-\300\231\260\364\210B\314bW\255/\235\014\277\3450", 700, ";U\042\252\241\200\357\247\366\020?gb\0358\231W\354\331\377MS\273 F\3361\313\377\344\361\004edjn\276\261[\0221\225\017\3731\203`\350a\301a\005\036wwQ\034m\323\226", 64 }, + { "T\236\334\030&\300sl", 8, "\006\377L|^\220T\213\307-f\214\024\215\251\366\224\240\250L\364\346=\224\001m\206D\335\375i\371.\261\3026\364\270\225\320", 700, "|i\376\031T\307y\012)\250\211\242c\200\244\370\232\212\206\316$-\031~\274\264\302IJ\243\356\367\232C\314c\013U\037\236\305\313\264\207\322}\273VHX\300\321\002Yi\237\261\345e\031\005{L|", 64 }, + { "A\313\345\257\373[@]", 8, ")\227\310\042\306\361\235\256\363y\337\341\265\3144\344\012\342\3540\260>\343\246\214id\013\254c:\203>\020\365\267x\243\013B7w4\235\267\015\330,", 700, "\0428\377Wc\042\366\266\227\254\030_w\263g\202\376\326\267\253\336\265\353\026\200t\017\354l\227\352\314[;\364\263\361\203\215\220\374.\272\042:.@m\033\250\274}\3646\000\330b^\363\364\327(A\015", 64 }, + { "\210\332a\312\367\024()", 8, "]\215\337\017p\215\251/\2747[\206\312\314Zk\267'\324\223c4\265Z%\315\210&\014\021&\262\270U\274@\374\221\0262\2720\3360?\274\214\330\302\373\240G\205RwQ", 700, "0\3646)\364\337\3250\333!\010\356\306D\241]wn\353\303\265:\374\315~6C%\250\346\234\231\367\330\367\220\221\324\255\221\375\344mc\271+R\324\374z\027\237H?k\343\211\022\014\375\134J\256\014", 64 }, + { "\305\354v] \232v\253", 8, "9\230\361c\001XS\355\303\361*\366\267z\363\226\237\331E\336\222#\305\037\326\005v\336\375_+=\277\212_\0269!A=\235\007h\254\370Z7K\346\277\246\360*\015Kb6\303\022\224\322\026M\313", 700, "\253\232\256))\226\212\353\237S+\307u<>$\3440\367\363v\222\250\321k:\323^\234P\351\236f\205?\003F\326\016\355\311\244\023\346\321\243|\256!\273\2243y\226P\026\323m\250\306\360Q\267p", 64 }, + { "\001\363\342\257~\177S\275", 8, "B\012\033\376\003<9&\264 \214\003\212\001j\004;/\321@\231r\267\024\302\270\344c\0306\262\215\205@\263_\360\033j\3177Z\220\042E#\206\231X_}j\012\340\365\325\336\376D[\273g\366O\377\300\265\373\256\203\2779", 700, "\013\331\003N\240.\215\336\022\230\317\271\042\376lv\311\036\305[f4\351\314\237f\323e2u2\272g\225\261b1\027\246>\251\235\261\326$\243\201\342\250CG\224MY\3737\225\312o\355TU\032\275", 64 }, + { "\017\327\331x\230\001\363\353", 8, ".\331\317\373;\330h_", 800, "\265udMk\214\004v\236Q\366c\336\020\010/\243\236\262\020\320\004\016\241\371\242\232i |)\240\305=\266\316\201\350UAY$J\243\230\267P\377\011\000o\033+\211\236\020r\356|\261\317\033\355u", 64 }, + { "\032\276\352\212\347\313\231;", 8, "\311\365\134;\311+\024N\037\134\0020\362\354\324x", 800, "\276\004-\013\036\334\372\350\311\270\306T3\014\230\351\015\230^@\330\342\304\324\034F\264e\367\013\273\355\251\260\271O4\257\020x\362*\354il)\363\201\017\232\032\344:\312\037\005\341\325\3720\326\366\002b", 64 }, + { "]]Yk\304T\222f", 8, "H\031\273\324T\210$\267\222\324\027\270_\2514\214\347\317o\177C\272\313\012", 800, "\325\007\134%\256\3015\242\203%;\261\350\324!\262\367\002H\177\355\247Mk\042m\373\263\306#\301\3472\354\344\353\031\346\246\017\202\342\306V\005D\266giX\205\012\016H3\231\344bn:;v\225,", 64 }, + { "\346\320\306\0348\265\356\000", 8, "\376S\210\356d\366\033O0\352\265\314ZV\263\3701p\023\262f\227\356\025\361\002EV\204\337\304\206", 800, "Z\2104\306`\244\211\342\010\204%\343\240\207VL\375_T\342\360\031\017\257_\207\345\327\014\347Fn?\331QY\310\375\334b\244\337\241\003\370\202\0356!\305\326z\330@\201\0241\244\332:v\371/\264", 64 }, + { "r\206Tl\304\226\231\356", 8, "g_B@\2277\267\027l\314\247W\306\346\221\226\223\201\013\263R\245A<\024\177\007\230\222|\216\331~\233{\350n\244\341\362", 800, "f8ma\263y|\237\2600q\021'\276I\3642\276\344\255\345\032\270\273\032\262\365\026\004\364j\211x:\330_\207\250\336\311\016g\376\261\366\307\345\223\204k\362\355\252l!\357X\211\003\035L`]\341", 64 }, + { "\016\320!\037;\311\210\213", 8, "\347\042\302\3575\315\031\013\267\340\377)\031DY\177`G\316D\251\025\327o\311\233We3\236\022L\017\354\314\342d\207\343\017\345\235\010H\210\225E\345", 800, "4V\003\007\215ht\377\262zSoW\277\3314\316L\376oAw\367\015\224\304\201\2176\277\375}9r\042\304hZU\374\306\202\205\354\2167M!(\371]\313\357]\233\005\345\256N\252]\177Q#", 64 }, + { "\347\274e\2157\327\016 ", 8, "\272xp\134\303\305\032\372\217\330\225\227\354\372?D\027\354\212\376\311\236\260?H\362\257\006\261\003\350|p\266\331R\363\036{\332\335t\021\327\213.\253\202Ss \335\252#*%", 800, "\1346\322\026\247m\011\012,\203\263\2449,\344\250\235\360|t>\225\277.Z\215\037\226)5\356\345JV\334\234\211\357c\024=\2534\257\026\225\005\023\221\330\275\010\246\011^\374\034A\246Pd\212\234\317", 64 }, + { "Z\207\036\243J\207\322D", 8, "\323\326\355\204\245}\341\034\322\331\364\234\240\241\260\2203,X\355\362\335O9^V\212\373;\214\342\334\020\316\234\214\324H\317wH_\313S\257\335\240e\007n\372\036](\317\024\331\231`\031\023\002\243\033", 800, "\224\343\262\023\213\042XE\317\300\260\327\316\217{{\322\307\234yqc\011BMd\312\373\375M\323]@X\3400\012\2175k\235_X\307a\134\023\376\035\323Z\312\011\376?\346\006C\356x \332\323\227", 64 }, + { "4\324\256]z\277\006\304", 8, "Os\324\324\223\211\353X\217\245\344\317\334w C\265\024\371e5\007\235\230\364CH*\036\243\251\222,|/\270+\31386ywY\202.ByB J\245p\237(\315\024l\362\240SC\352\261D\24176\026\024D\023u", 800, "\014\217}\334\346\012\202\320\323x\317\341\363\307y\261\134\355\0259|\237\224\200Q\002q#\232t\336\215\303\355\020\263\221\0257\205)\374-\316\271sj(\000\332h\303&\003\323%\3052x\035\230\3673\267", 64 }, + { "\2311\362\360(*\314c", 8, "\226\205\332a\235\200\177\002", 900, "\266N>\311\351\345\223>\327\365/\202\006\211\317\345\265z\001\276\340'\355\303QyH\367\311\042\032\350\331\012\034\261\327po\323\275E\317\000D\234\355\032\241\242\332]e\276Pk\264\000\211ia0q5", 64 }, + { "\020\277\212\360H>\226S", 8, "\333\342rh\323\302\366\223vK\376\004\340\213\316;", 900, "\344\254\354@\367\243\012\310\303\042\263\330\230\230\307\266-\011\134\024\221[\371\320\324\244\375^S\314u\303\335:", 8, "\035)\304;g\254m\313n\232Rn\276\022\264\317.\210WB\272\026M~", 900, "[i{\304\237n\213\314\375\2223w\134T\257\027\265\307\015\264\016\022\245~\250\031\257\342w\211Q\242{\012\370&\003P\016\311\032+\235,F\260\362\327&2wxw\030\277D#\365'c\216\303A\356", 64 }, + { "\324\210\245\303\375jc\134", 8, "\003\042\006\004.8\256\321\013\216'\227\210\353\226.\364\037\300\351e\206\357JY\201\254x\015\352\023\212", 900, "\2727$\177\202\237\0142`&\034\321\224P\3620\013\367pg\371h\315 \134\227\306\241\257\3333uS\025\206\030\2704n\013\354^\032\034\266]\024\254\000\256\356\2356\331nz\263\310Q\2178\201\310\320", 64 }, + { "\322;F\214L\230wH", 8, "\330%\316\307\264\310\375q;+\256*\315h\300\274\215yZ\320\360\203)\353|\310!\016u\260\350\222\323\177\303\226\212o\3255", 900, "m\267\007?\353\220\220$\231\316;f\201\253X\312\320\006{\307\014\334s\3257\277[^\0055\2567\134\270yr9A\342\273N\217i\374\314\364\301\312\335G\036\014R\341|w\323ei\226\014I\034C", 64 }, + { "\345\342>\335\2457/,", 8, "\355\262\340\201\134\012o\2011F\234^\321\211\216w\207\022[\361\310\004\236\256`x`j^\263v*\2250\336=*\340\017\317R|\00164\353<\244", 900, "\004\240\005\275jv\352M\360\350\036U\306l\237[\031C\224\205C0iT\370\242\011K\042\030\333\375\302^\255B\301\354\310\240*\323\257\310\222\240\354\233\221\346h\311;\214\321\240\341]\363\326\335\022\216\224", 64 }, + { ".\245\313\031\277\374\042l", 8, "-]\026q\347=q\004<\002@^\242\277\355\212\334\337M\304B\351\015:p\323!lA\357\204\206\364*N\317\363\016\016\230D6\227\337\347*t\243\177\021]Y|\240\035\006", 900, "p\006\336\010\351\337\304\260\372\210\267\013\231 t\265\231\274{%DScF\3726\320\205\275 \011h'\251B\363\323L\014V\260\362#z'\233\322H_\306t\273\027\353\272\021f0Q\222\244\0316\225", 64 }, + { "\014Y>\242\331\270\367G", 8, "\222\344 \364|\347CP.9\372Tu\341n\014\333\321\034\204k4y\312\314\363\323(\221\365\023\032\342Y!\010n\273\213ot\346\310h\304\220y./\235\342Pg\214\037\217\352\316\374\276\3740\256e", 900, "\211\042{m\201\233_\3020\350\237<\315\272\256\200\010\323)\210\210*\042\200~\266\343\177ic\212\300\363L\215\271\022\2609_\361eWbF8\203\271\363\214t\272\275X5\011\355<\2233[T]P", 64 }, + { "\334\023\304\233\305\200\206\272", 8, "\314\332|aD\003\341\033_\3733\374\263\042L&9\014g\336\253\355Ir`\004\014\377\306\2031\212nX)uG\236I\021\031\337\336u0m;\3126u\332\025Q\370u\303$2*YH\211\343Z\3628\237\274\2061sw", 900, "\005Zx\257\262D\357n\005b\014(\012\277O<\313\361M\331\373mB8\031\215\035/\247\005B\343\346\305\337o\024\275\357|Y\235@\221}\202M1\0325\306\325A\253\250\241JY\326\255\032\272\314c", 64 }, + { "Z\270\301ED\237U|", 8, "\0272-\237\010\275\377\042", 1000, "\360\355\220\212\252\371b9P\343K\301,\024$\227|\305\346\327$>\215R\243\214Vs\273W{\306\234x\347Jlb\211\355\321\310\015\002\267\352[\210\335Zl\341\023\236u{\225\264\027\370Wc\343&", 64 }, + { "\262\3435,q\037^\014", 8, "G\330\246\256\356\260\201)P|\336R\254\301\265m", 1000, "\314\320h\267\227\350\034\216p\334\250\372\230\300\273\220s\352K\341\347\253\317\321\362\042R\311fN\177S[\376b\354@R\320\010\251W\374\256]\243\262NO\000\206\347\005\306`\215u4/!\365\025T\026", 64 }, + { "\033\341\202Z\263\274s\025", 8, "\317\320\367\371\200\035\361Z\240oE~t\347\300\227\330V]g\337r\316@", 1000, "\234\313t+9d;3\226!\325\256\242\211`\323\030\352\336\377\306\215rZ\263#{\306\037{7\307\203\325M\032\031Q^\260[8$a\272\215\337?p\022A\335n%u\214\232\303^\352\241\251~\247", 64 }, + { "uc\214\232\3031l\300", 8, "\013(7Vl\341\013JA\276\222u\345\271\363\015\134\317\340R\214\335\312\245\264z\324\326\366L\344\250", 1000, "'\352\216\246\314\215\365\333%\334\202\342\334\352\347\211%\312\215(R\312k\246\330\207\223\004LhVFw\374\322\331\275\265\334k7\343\013\312\010_\264\362b[\254\366\226\224hvgG\307\200\347\216\033\036", 64 }, + { "cD\020\266.C`u", 8, "\247&^M\360@\266Y\365\322'\367\262l\376\250\042KU\360\237nOl\207\346\2520\203\0428\003\332o\344\0046`\226a", 1000, "\241u\001\027W\202YT\341\275\204.Y\242_U\016t\003\025\001\340\304\213\364L\264)\023\346\031(d\234\256\313\204\260\262x\220N\017\274\340\315\000\276q\017\001;x\375v\004\025\300\276U9\336\260\375", 64 }, + { "a\0162\201\011\221d\017", 8, "\256aW\215\327\374\235\334;\303\032\021\037wg\306K@\001d\213L\244>\343Z\234u\336\313\024b\344`\233\271\234\333\365\305Z\306\0218\310UK\306", 1000, "\304\023e\243|\032k\320ni\270\002\252\306\036tZ\015j\373\340\331\207\245\347\032\261L\354kh\012\356\363e7\015\334\352\206\036;\320~\331\260\330\003\257\310\244\364\244\370\305\233:J\363\367\324\362\025[", 64 }, + { "\324\304\265\306\270\217\276\015", 8, "\276\027jRk0X\215\227lG\236\240RpJ\220N\005\250b\345tQ\221h\321\354P\371\035\244$\256l\023HZ[\031\255- O\236\222:\267t\254d\313's\317\024", 1000, "\250\316\327\215\271\374\206\207\220\351D\263\306Q\362\366c|\273VQ\241\016\377\004n\314f\215\253\305\321\350\236.ZjX\037|!\314m\331\3775\011\034n_\263x\267\345\241\322j\230l^G\334\256L", 64 }, + { "\030\302&\234\200)\230\305", 8, "+L\221:5T\274h\237\256q\323\353m\333fh\201}Q\351*\351\240\267\276\327\007\254\316\214J\342\350\351\367\367\266\301\010\3775\015\014\351\337\3264\355K\027\355\327m\300\241@?#\232\225\263\037\007", 1000, "\201\355F\216\035\037@\350_\232\325Mx5\353\004*\372\250\370%X\247)\315\324\314\256\315\242}?\373L3\346a\331\302\134\334=\237n\275 \330_OZ]VW\007q\312\254\244\276\024\034K,C", 64 }, + { "?\362\015\253q\331|\250", 8, "}\020\020\337\215V\263\334p\346\003G\363\301A\333\134\177\222w\271\262\306>m\2774\343\006#P\260\306mS#Gs\250\363u\230\227\377\015\361\235\336\273V\230\316\214\276l\201\272\241}\361\260\357Aw\015\263\246/\366\026\375\037", 1000, "u'\305L\233\270\032\326\225\2422\323\347\335g\374\270\023\352E\305\332\240\231\244\035\343\226\322z\264\346\354M\036\211ye:A1\257K\236\215\333B#BV!\333\245\336|\217\317P\257>\257\265\252\003", 64 }, + { "(\134\324\014\245*\260?", 8, "\263nO\374\320BL\042", 2000, "\354`\262\357X\301\351\240\333\374\3536\307\367A\273gVR\366B\1775\217_]\214\016\2641j$kE\201g\270,\276$\213\205\250\237\005\211D$\351\241\334\222\337\326\360\372\277P\002k\224\235\2137", 64 }, + { "VC\260\247\227+K\325", 8, "\214y\202\334\330\323;\206\274k\026\333#X\247H", 2000, "\005\366 t\203\277\030z|\241z+\222\344\134C\306XV\367\042\032Y\2074j\211\034g~\013\263Z}\354d\342\246\005\011\250\230\244\222\336(\224\320\320\221\237lj\227\003\345c\311P\023t\000\243<", 64 }, + { "\226\264\332\250Q\332\033?", 8, "6\177z\010St\034J\240\224\003\367\252I\322/\034ZS\243\322\307\374\311", 2000, "\225\325\364`R\004\354\021\306\2123\337\341M\273\023xsu\030\210\267U\375\011\223{\002!3a\031\254\247\200\302\265\016\277\301\235\024\014Vj\363\022\367H\224\372\205\337\302G\035\351\257~\316\371\252D\342", 64 }, + { "\347\016\225\220\026\324\301Y", 8, "\351\314\237M\230\305o\321\374\374\253H\236(*=1\364\203\007\210\344\001\245\2736\022\340C\314\265\224", 2000, "kN3z\003R\340\020D\033\221{\234\352\211\201\315\356\017\234\370\270\214\035J\335KM\255\200I\010=:\3512\030\260(+\257\276\275\001\361\263j\030\002\224\352\372\031$q_\023\330\333\021\233\240\222x", 64 }, + { "\340r\267}u]\377\350", 8, "\242\360\243\361\363\020jX_g\376\016X\352dF\022;'+\306\213\375\036\224\214A\242L\022\334\025\231\015\267\305\001:\032\270", 2000, "\230D8\251\010\031,p\016\330\310\233\241O\031#\310[\324u\261\207\2042\361u\310;\366\342[9\201\005\037\20261\316\351;&\273\325\263\305\325@\251\027\343Ak\225\270\014K\342\037\015\305\247e\231", 64 }, + { "\013n\007\254\357\255\217\340", 8, "\334\015\217\312\237\315sW\026\357{W\321,\031\034\374\023\2720y\251\235q\030\2170\357\251\366\370\364\312E\205.w\273r\242`\246\005}>,\231\250", 2000, "w\210\363\2605\020\134\374\231\024\327\314\205\310\325\247\033%\322T\226\271@\302\004\266q\304\345\326\275\347\260\322\361\2435\344\010\356\300%g\307\217K\0423!`R,\005\327\201\0037U\266\2705\275\343r", 64 }, + { "\202\361W\024^\252\307\235", 8, "\356\247\020\315\037(p\361\006\223 \261\035\332b\222m\236\027\367n\020dw\323\247\3017:8\034\256\302\363\263|\273\134TF\260M_D\3418h\237\365\260\262\257\007\344\231\351", 2000, "\327G\376I\211\335s\3060\367\277\200\015\270\327\351\023\3539\245\203\356\244\367Y\244\340\277\207\235\360\027\347\352\343.\301\3570\347\330\324\352\353S\242>\324w\213\271\262\013\211\250\035\261a\011\271\370\034\3633", 64 }, + { "\207-J\204\243\334\335\016", 8, "\261\134\241\340\024\3441\306'\32061\256\202\267\232\370\2327\257\357\342R\202\326\345\300\362Cp\315!;\320\305\240\013Zm\234\343\217\373f)#\223\343s7\320R\342d\224\027\212,+\304\262k\243l", 2000, "\271\317r\177#\201M\306\320\314\317e\236\042k\031\032\242W\364\321\255\026YkJ\371zp`\337\264\212\253x\034Ef\2003\214-\370o\277\305\3671\355\013\320C\247d\214nA\273!C\375\025\2218", 64 }, + { "\300H\213\371\272>\337\241", 8, "\001qO\241\310Gs\274\036\375\272\362\033\014\256\327v^\037\321\246\277e\224\300\235\231U\367\316'\014\327\232\265Z\033*s\302\252}xo\374(a\231\355\301\0350\021\231\024F\177\276\341\221N\316\025f\320\324\134\247\376\335\274c", 2000, "\301\360\262PJf1\243rl\320\364\320\017\312@~\240\031\206\211\261\330\035?\314\356\253\263>\016\252wt\341\213\001!\014.N\264\350\377]\243\234\245\354\325Au\353\227\236;L\333\332k\340\343\352z", 64 }, + { "z\015\256n_HF\264", 8, "IO\305\325\253\232\001\022", 3000, "\021\032\252P\005v\354\234q:\204\326\203U\2162\246\371\343\340b\327+\037\330\360\241_\215\134H\214c\373Ix\364j>\036L\016\355i\226\034Q\370\320'\320'\014i\336A\210Z|D\200\006\006\202", 64 }, + { "\027\035\353\321\372\222%>", 8, "\375\3772\334\316\222?\333\300\325\265\005\360\361\347F", 3000, "\231\0011>Jk\031l\324q\271\2308\316\025B\362/JA\010\370\021\377C[3\016G\260/l~\042\350_8\252%\373Q\275-\263}>\356\330\337&\005\265L\353\377\021\324~\255\371\346\316R\204", 64 }, + { "'\331\374\255\355\315\206^", 8, "~Wx\355\211\365/\372@\022c3\337\311\233\253\007\215j\356\264\254\321\032", 3000, "}\344w\013/\000n\371<7", 3000, "f8\205}\321\371=\330\3410\034\030\354\323\033\270\333\227\320vUS\336\305\010\332`\306q8\351\027\034n\372\356\363$u\376@\017\244\3467Ft6H{\264\345\275k\302G \334\202\275\257\375\242r", 64 }, + { "\241\364\000\231\250^_\277", 8, "R4\332\217\332\374?\341\030\277\345\025~Q\364#l\307\273\331\357\0352\361\373\246\320M\220\250\265EP\225\221(\236\026\332\272", 3000, "\177\243\277\322\005\134\016\015E\251\300\205\250\352\366e_~\377\251+\223\011\021\326\042\033\277\267\206\037\224\231g\260\031_V\341.\300{\243-x\025Q>\177u8\223\177\032\201T3\360\033\336\201\255\234\024", 64 }, + { "\020\011\277\006(\215\353j", 8, "\215\341\262\207s/M\323\274\341\223\322q\215t\177\225\246\367?\326\245Y\330\026\221:\370`u1\305\377\261\215p\311[D\0229\200(\205\216\341\247\230", 3000, "\236\022O\372{|'\313\011\216[d\364\210\030\36249\2122\266\221\022xD\266\363\207'z\215t\2448\007Be{\272\244\207\251\352\365_\353t\333u\355\317\327\327\205\222\250\003\330\201B\023\004#5", 64 }, + { "C\251\361u\026\34102", 8, "5\343\200wqFK\2739\260#\224\301\256\323$\247\033\272\322\346_\227k\274\250Wzt\3062\134VI\202\234\325fv\013*m\003\355=R\366\214\233\305O\333|\200\376b", 3000, "\030\177WT\007\014.\134XcB\245\202\004\363\021\313E\344M\216\332<\330W\360N\314\134\341\255\030%\031\323\024\035\312O\370\213\017\263\034*\261\344\031\356\237\271Oi\213.\276\315\314\367\222\212\027\024W", 64 }, + { "\311\254\331ZS\226@L", 8, "\013\320= \345\032S\317t\255\2550\245\3062\232\316\241\002\235\333\015$Lx\376\026\334K\010\360=\237*;\007\134\3506O\352,\037\322\342\013", 3000, "\344\202\347\365^\026e&\200\260\214A\324\264\022\313\225\351\033\254\254o\357\255(\215^z\034\200\220\312K\301\240\227MO\030\231\366\020\031=\203\012\224=\024\004>\316W2:\363D\365\231hy\366\365j", 64 }, + { "\134#\216 D[\241\223", 8, "\017P\274\200^(R\220\266g;\211Z\265\036\345\337\360\2310y\031\330\206rF\253\254\375\271dr\321\367iT\304\2003fV\367\333\264\247\2370S:\377&\216\360yfs\202h>\327\347C\261\345\274\357q\037\331^\305\134", 3000, "\177\373nj\013\324\202\021\035]!)\370\370%\005\353\016~W\330\265\217\362\337\301Z\275\321V\000g71\335\377v\013R\335K\315\241\225\216qE\312\272@.\020\315b\247l\3359:\242\265\000)\310", 64 }, + { "\304\326\303\344\272\260A?", 8, "`f\262P\027'\211\217", 4000, "\012^\363\365\134\265*$\014\270]F\274|\375>p\341\003dT\242\337u{\314\205\307\260\360\322\025\214\007E\307y\365\352\310\240\372\134Fji\370\241\017\305\336\262\351\332\002{\026\270\376\363\266\134\274;", 64 }, + { "1\2004\011\006-\032R", 8, "\353\371\330A\261\263)\213u\007\233-\354\230!\202", 4000, "{o\014.\322\016\323\244\021\037&W4*\362\300)mGv\014\016\306\307\237/6G[\267\033\213u\313\266J'\276GtN!\000\216\363^7Y\037\370\021\014\333\250\374\332\274\235l\230\263\220\347\222", 64 }, + { "\354n\227\202\363\306j8", 8, "T\334\212\366\246\020\042\264\342r\271\317a\0047\322\317\354O\031\202\342\370o", 4000, "\312~\260\260\027\266G\247\236\312`n\335\342\262Ec\247\272x\001\003\252y=\002\362\362\004\326\350\007\0252!\263\312\360H\344\246\016\207vEO\022\205\212\306\276\251O\325;Gz\307O\266}\020\322\376", 64 }, + { "\360\263\275l\234\244zO", 8, "\335\375\273\001\261%\233,\007\350\255\247\342\235\310-\032\035\314\246\252\027+a\233f\204\274M5W\262", 4000, "\317\365.\214hyP\313\205\356(4Y\251\224W\367\263\361\027\262\324\277\255M\010z\263\314?0\025\003\367\332\236.\004\331\302\232\011R\332D8;]Dz`v\000\246\242a\247b\033M\031\270\011?", 64 }, + { "v\327\346&\035C\320\322", 8, "\260 ^\376\355\375\2567_\272\252\255Wb\376v\0057M\226\346\031\272a#Up\264#\015\311\342+\2128`(\224\224V", 4000, "`s7\365\307p\250\356x\310^7\320f\2442mm\242\0207\023\360\300\264\336\252.\266\244\202\134\042\311\023F\374\206\225'\371|\327R\371\277\357\307\304\250\352E\016\253\010N@-/9\257'\0235", 64 }, + { "\252\317\025\232\012l\372\275", 8, "\216\020\363\015\245F\277y5\254}\016'\272\204Rf\226\340\341E\230L\024\352\205\312\306\340\042\241\017\263\375\337\355\013\020KJ\273\342\3572^\313\312U", 4000, "\222\010Cw\275\317./j@\012\032LH^\222s\205\240\335\011\026\310\275i\246\264\347\305\302\365\302\336\221}R\016]\231\006#G\321\222\255\215E\262\272\013\202\260%~\027\350U\031\220(U\210\221\314", 64 }, + { "\035dQ9@Z\267$", 8, "\204]\013SSO\332\324\322\327\216\362D\203\253\241/\262\21093\374Z\213\001t\376>\207\024e\273\371.\037|\036\334p\005}\353\277'/\346\014#NP\362\2504w6/", 4000, "\252BW%6\265\317\000\271\024C\010C\202nYZ\027\006@\334\321\365g\371z\017\3469J\374\262\366\242G\200\017\363\313\223=\251s\213`\343\362\007\000~_CV\336\207\240\352F*\313#x\212P", 64 }, + { "\344\263\246\321\357 \003\347", 8, "aT\363\245-\012\023\032\333\253\3049D\372\033\332I\370\005o\267\177\340\226\211&\356T(\210\017\355\372\003\207\277F\012\010\221\213\274s\314\200xLST\260\375\217\013\331wG\240\343\344\347\347\301\324\302", 4000, "\324\336\003\003\337\337\215\354\327z\217\0319E\000\020\353\011\366\347\001\035x\3660D\332\014\276\374\2363\3635\026\227\031f0G#=\015\213\275\210\237\032\207\342s\002\263\2438h'\301)M\351\213\200\274", 64 }, + { "fJ\325L\311M\364\333", 8, "\2640\311\202\3471\2310\011\271\345\002\265\225\257>\220\277\205\311f_I3\247|l\351\222\341\353j\240|2G\035(\353\203\250\031Jl]\317\226\223\343\205]Z\324\356\245,\264v\030\333~t\035\220*f\027k\207\364Yr", 4000, "42\335%\022\372\310&W\2374\335bp\217\247m#\210\006\207\021\371\134N\306\335a]S\274\350y\247oZ\024\272j%\326\213;\324\273\347w\300E]\347%'Z\261\206w\2350(\265\205\301\302", 64 }, + { "\363\237$\002\006\023\357\001", 8, "f\327\370v\0061\026\200", 5000, "\331\303\025\301\344\370\222\004z\275\364\374h\253Y9i\027md\032\020<\042\017\250\261\317%#ne\303Z\324!\354\300\006\235\374[Y\341\036`\373a0\357\357\015\246\3464\352*'\241\272-\317\325M", 64 }, + { "\332|{6Q\346v\313", 8, "\134!gL\026\024\376\2430~\306\2743\232c\206", 5000, "3\325\201\34598\202\330\263Y\005\244\321}}w+\245:\274\177\255\365\265\000e7\375\312gc\261'OG\266hPp\365\250\364\042\333\373\323|\205m\005\2572\021\027\271]\233\360\216-;\210\371\274", 64 }, + { "\333\220G-\240N\205\232\303\177 \012\324\374rl\034", 5000, "U\342\2200*K\262\010\177\273\024\2455|\367\336\2311\225\366/\005b\305\345{\233\301k\030\023?e\250Cf\007\134\036:\377\213\027)\353%\323R\322:b\255Rqr\007!\020r6\305a)F", 64 }, + { "\234\004/\345\032\000v\220", 8, "ar\031\272\305\245\232*\007\247\025HL\274\010\336E+\311\336\2557\266\300\263%\3031\337F\227<", 5000, "\320\254\3477Do\003\227NL\334\355\217)\317\302\221\344\300\320\356\204\266\350\305\223\275\273&r\327\014\261\352\324@\356\032\325\221\330C\346\202\233\013\007\304\031#h\202\244L\207\236p\351\371\335\213O\341^", 64 }, + { "k\317u\332\217\324\322\216", 8, "\177Te\253\271\260\255\276\353o\223D\324\001s\317L\033V\242\247,\2566\233\206\313\315\014\332b\317\312\134\322\216\314d\344\344", 5000, "\316\021\033\027\375R\207\327\021\341\340\253Y\230\016\257\355\024\027B\226\322\346\025\017\2429.\336\2262\352\324\375\225\356\367\353\235\012X\011\361$Q,s\240\033\372\254p\202>\343\034^\303<\211\242\273AA", 64 }, + { "`\226\222T\332\377\223\015", 8, "\351\350a \311\352J/ \015\270I~3\360\2378\265kP\302\371q\202\3006\000", 64 }, + { "\303\327\253eb|\362\227", 8, "\30630\364^\006>\227\224\315o\217]aL\236*\256DZ\270<^N.\326\014y!!Ng\375\325P-v\220\341\206\315'>\314X\315\364\276\014L\324\212\374\354e\230", 5000, "\267\272\262\235\213^\042E\255\330\372\010&\012p\354nBG\344\246\266#t\300\237a\271)\275\010x\356b\274a7^\327\303S9s\343\203\236!=\332n06\241\312\254s\335\265\334\356\324\367\177\375", 64 }, + { "Z\3378}!\257\020\301", 8, "\301.\2642Q\250\277$\271\334M\307\250jz\364\354\361+K\322\275\343\242\322\021Z\2747\333\213\241\224\011\0320j\267\011\337O\023~{7/y\350\012_\202\331\216L\206\003\006\026iQ^\310\036\360", 5000, "\216\202S\222}\336pr\331?\232X\323M!\202<\372\263%\353\264\334\035\370_\323\363\217\322\014\301\177", 8, "\344\303W\177\317\032+u\032B\353\375\317,\225r", 6000, "\212\205\266\373(\344\246\213'\247\262\257\030vZ\355L)\242\375\353p\227\3250h\022Xg\356\310\350=\353\247=/k%\021\364\030\223\013\272-\177\277iX\005?\000\200\325\310\245\0137\247\365\034\234\007", 64 }, + { "\235z\200\0425D\206\326", 8, "ZC\014\243\032t3g\336&\0058\016`U\317\210K$\205\236\264\274\224", 6000, "\233__\371\276\213\263L\005\211\250jO\042\364m,B\020S9\014\332\263~`R\334\236\020\224d\374\037\201\311\327\262:l\221\315&\277\351A\251\262\000\012\200R\203\360\011\371.\373\323b\000\316\277\275", 64 }, + { "\013\216\203\231;\177\030\022", 8, ";\250\2605\215\314[\2478\314\343\342gM\352\211\020:\336\3271E\260\042\3444\274\305\234:\226\221", 6000, "k\255\012\344\344\350\306;fm\253<\277T\017\020?\234\215\216A\373\303\3375l\325\333\027P\301\006\214\221\202\375\342\240\213\012\307g3`\377@*F\3518\000?\010\002\021\005\023\227+E\177\363\022\236", 64 }, + { "\211\354\257\301\023\201\377\374", 8, "t\235\202\224\274\013\350\134Cnm77\352w\200B>\250\213\211l\275\357\234/\004\342\311\216)\260a\016B\216o\253&\317", 6000, "\304\225\214\273\016\374\375V\215\207G\264?/\273*\276\257\343\012\234/\025&/\017\331\211\355\016\351+\301bS\004x\017\326\252\032&\205\030\222\347\272\002\036\231\261\033\200\276\330\367\007\252\376\005#\217~\212", 64 }, + { "{\355d\364\020MGs", 8, "\324\301)\225SI\220\322\320\333\263[\375\2154\006X\303\014\275x\300a\313O:E]\011\236\134\203\344\220wj\231\320\300\015\222\321\324\177\341\320\237\372", 6000, "]\005'\026\210\036\250\037{}hs7\254d\327\243$Ch\000.\011E|\213_\347\3579d\342\321E\212\334\251~\231\221o9\006\323\317\013L9L\312\206\357\372\007Hv\234Q\311'+\001\276\034", 64 }, + { "DR\0073?q\272\374", 8, "\250l\002\017#4\320=p\032\202\257s\207\352\347I\373\244z\377jD\227\214IG\364\206\004\322\261-\217\305\301\214.\314\206\373p\341 TSu\323\377L\373Bu{\032\247\370\270Q\260\307PZ\337\203\304\235\004\254\354\322\363\260\001\004", 64 }, + { "PB\323`z9_2", 8, "\373\317\015\021\275\311\335\315\323\231\212}\307j\336::\201\343Y\210\042P+M\263Gh\031d1\034jz&\134\366\363\012\374\274\212\244\315j|\207\331 \345\312\027x\026\261f\016\311\035Mt\370x\243\323\3550A\014R\033h", 6000, "\134L\334\310\334X\035\356S\015v\243\242|\002\037\305\022\375\372qK]\020\300\226\001\334\310P\357\376s\203\225 \037\305\373o\261\020\303\264\370\256\262\337\237\251\273>:E\335e\260\316\246U`c}\016", 64 }, + { "\027\223!\256N\260<\200", 8, "\020\374\203\034\005b\230\201", 7000, "\302I|/\305\025\001\003\233\244@\332R<&1\333\030B<\010\3315\267\213\317\231U\225\303\336S\217\037\337\212C\202\022p\270\207o\205D\177!}j\221\215\027)\306~s\004h\323\342\336Z\252\377", 64 }, + { "\201\016\210\273m\345&W", 8, "\253\363\011\215\2646\222:gr\001:h{\012Y", 7000, "\244*>\204\042@\302A*b\010\024j\270\220P!\2114\327\031\237\304\231Lb\303\336J\325\321K\263d0\200\327\005l\320\344\336\353\323\012y}N\251!h\275\363\376\320\225\341f\246RE\310\2418", 64 }, + { "\276\257\256+\244\247\211\226", 8, "?\235\347\030\024\362ng\234\254\017@\033\321\331TO_\255\277!\042\233t", 7000, "\216I\365\206\200\134\002\353\213I$\327$U\275\240(\351\352\2738{\313H\202\275F/\322\013h(8\263\205\326\303\042\2621\032\204M\264hT\221\205\310\263\214\273\262\313\221\267\206m|)G\324\241\025", 64 }, + { "\2020\274j\042\224\231\221", 8, "\334\260p\216\333[3\014\301-\223\026&\315G|\231\207\205{\310\336@H\246\3257M\020\031\362-", 7000, "x\213\321\215\223\332\313\016\323\012\310\330?o\300\277\177j\312\220\255H\247&\366\232BX\232\352\362N0\225=\373\010\260\027'\271v\376\220\324\263\225~\354\035\277r\222f\221\260R\253\215m\203|$\334", 64 }, + { "\372+1\367\246\333\271w", 8, "`\220^\277$Y\341q?\315!\014J\221\210\242\232ySd'\354\361z\306\301\016\252\274\342\267sso_TZ\200fe", 7000, "d\224\227\252\306\204\012g\201\237\314i~\216\214QV(1C\271\320\233K\341\351\313\005\342\343>\361\341\377\030\204b7N\340\356\274Ma\023\212\314\222\240\211\033\013\211-\356\264\267\027\262\005\313\270[\204", 64 }, + { "e/\227\361\021\350\237E", 8, "-NQ\342\360?\267#\011s\303\241\227\353\232\227\010f\003f\012;[\022\217iu\317\024g,caX\370.\214\321\273\035|\337EB\014\2636\235", 7000, "\247_\330\233!\237~,D\351\274\202\265Z\026G\224a}\277q1\250?\023!\276\011j\254e\233\255\374\246b\024\275ss\200\031\036\312\322\257i\357\367\371\022\324\213W\014\246<}_\003G\317\204\247", 64 }, + { "\230\373\305\254hVc5", 8, "\362\306\303B\214\210\020QR\316\205\356\241\373>W\307q\237\261\227\355\251R\334\332j\303\231\202Y\356~\213C$l\353f\017\031US\334\324\016\034D:\374\345\252\235D\303\214", 7000, "\331[#\367\002\331}\306\266\3258\246n\226\357M\204u\226\320\306\323n\015$\320\247\305;\265~\2478\025V\364\222\366s\240f\270\314\034\250\277\347d\275\351\326\310]\213\244d\264v\303\317\371p\235\263", 64 }, + { "j\332\311\021\016q~\273", 8, "G\026\002J\024d]\255~\231\271\322d\335T1\203\371(\350\331b\013\302n\244\004pi\231\210\205\332\327oE\205\345\011\300\216df>F@\323\020\240I)\026\335\362\345ndx\321b|a\304U", 7000, "\371?q\263\265\2344%\200;\333\251G\020E\316\333\331RD`\275\260\006\261\356\332b\027Tv\251\243\001S(p\361\313\011(g\327^\241\0030\376\365\3425\376\363\307\216\234\316\216\377b{\310\347\003", 64 }, + { "oS\366\311V \247u", 8, "\217\350\316\355\003>f\334\306W\026\213\307? \304a\245\370\333\364[\236\0256\267\320g\360xn{\037\015\356H\271\010\255\360\265\3136\025\266\342\324\246\204\211\311k\244\322\342\231\307\204o\2376\361cy3w\314\347/\246@\022", 7000, "\211\314\257hDW;\257\3702\271\243\322\314\3131\352\250e\313\006\364/\001\207\327J\350\214\350\232U\353\216\024\344\177(\325\366K\031Rt\220\201L\265\263{\366\305\305\215]\373x\177\373\020K\224\346\350", 64 }, + { "\2713\267\214\012\302\311g", 8, "bo\2109\255\305P\036", 8000, "\236bG>\215\363\021\012\242\265P8\373\332\017,\367o\217}\210\320\035\320\255\316}1\005\021m'\205\214B\236y\232\377\300\262&\240pJRXQ9\226\011\212\316\346E3\302\252!l\266\304\134\017", 64 }, + { "l\364\370\012\341\025\344z", 8, "\201\004\012\261\355\255N]*\324i\346\002z\300O", 8000, "\024\220\237\352h\017\263\237Vk7\015\250\007\000\253\203\305\255\220\337|\306\233\240\023\361\226d\304\315g!GGY\363g\331\005\376\354\243\371\207Q\212\246Ez\030|\341\315;h?Pe\351\256\004\364\373", 64 }, + { "\302\241:W\337\336\036\342", 8, "\273\233\362\231\357\212^\310 $n\370\314\324a\225\235\004L|\322\015\357\256", 8000, "\357\333\324\221\253\207\002\244\006\352S#\326\352Y\201\034\307\301e\22120\252\036\333\2151\010\134*~\235T\322\007\200\020x\221phGw4p\221d\251\262\355\013=\236I_Vm\241\003CN\245]", 64 }, + { "\250\275\025\013\365\363\227\210", 8, "\030\02582\351Z8\344\017\0252\203\305sTM6\322\336\214\037\303\223!H\306\276R3\235\323D", 8000, "\337/\303\204\376H\020/\366\036\3336O\234\237b\012Q,=9z*4VZ<\320\214\270\341\277\262gjEu,I\224\242\316c\217h\042\211\005\300+\033&\336\024\254&\227&\301\324\004\362\377r", 64 }, + { "\366\345\301\371\301\220\3759", 8, "\315\012\003\227M\042[2[ \036\264dB\022a\326\372\203%\223\005\330&\007\304\012\300n\347\233\012\263o\330)\177DC\323", 8000, "\023\006\222\026\010\342gH\220\370\372\277Z\327/?\240P\244\244-\326\333e\234g8p\323\263OG2K_\272S=\276\012\011\314\217G\027{\215\246\360 \024\224\244\352\363\003\307\371o\305\212\341\3706", 64 }, + { "\272\010\025[\365PR<", 8, "\270\205:\014\2338\264k\246~\025\245z3\345\001?\005Nk\006\202\357\220:|\251\2522\276Z\243\232<~8\341i\326IQq\265\355\013$c\241", 8000, "\031\240\307X\344 m0\221(p%\247>\215B\244\325\211#\036\355\215\356\231\247\263=B\232G\264E\260\222\214`\006v\315L\011\355\025F\235\352\347\365Pm\230\211\273\255N\0023\021\202\362\370\004\340", 64 }, + { "\031\322*2\357\375S\022", 8, "\366\252\324S\223=\016\205>\011\374\2703\234\226\316\004\327\231\1774K\236\030T\232_\315AS'\374H\326\226E\037\225\263.s\004g\332\360\372\0147\200\364Z\003\262\225GJ", 8000, "Y$ \014\261L\304\307\264F\212M\362\364\272\375f5\223\016\275&3z|\227\021]mvP-\024\225!+\361\371\250\335\375\377\310\035\017=\233\347\225\235\042\335\241\300\264\260E*\327\034\220E\204\325", 64 }, + { "\031\220H$e\221aZ", 8, "\366\331\016o\241W!J\177\212U\230\316F\042\345xO@\324\314cQfu\315\261\312j\252\005{\001\035\362/`i|\361\237\367GmJ\303\356\035\366sV<\031\346\2736\266t\302\024x\001\360t", 8000, "IB\042P\213'\260\225\275a\244\255\225\361\346a%\321tT\251t?gbp\344@x\016\002A\025\242\264\177\224\256'~;\256\216\277\301Nc\302a\216\325\220~\213\240\245\252\260E2\371\216w\134", 64 }, + { "\004\341juF>\010\303", 8, "\012\374\210H\310\034\235\215\205\261\207r\3443\224\300\027\275\304\271\366\021\300\034\024b\256\337\0164\007w\335\243$T\300m\010O\202]%\306h\205\311\260B\206c\236\011\233m\305\305V\042\020\274\001[zM", 8000, "e\327,[\030\205\3270?\251o\320\177\305\134\272`\256\332~\363\017\200(\035s=\343\300\244A\231\243\267\247\032\353\325\275\256k\221\364\230\301\301\2658\260D\035\244\207>\211\354\035\220\202$:\012\345\177", 64 }, + { "\244\276\254\240~1|k", 8, "\251>\326\357\223\360I\224", 9000, "\202\327C\273\265\315pa&\261\02517B\232V\007\200q\302i\240\265\250\302FH\230\002]\357\216\204\245\351\221\223\335\250[\0274\265\307\214\362\347_\213\003]\244\360\344\014\011\003t\226\031\016\354\034L", 64 }, + { "v\015\177M_\312\0052", 8, "\366;\234/9\024b`\042Np7\3674\335\254", 9000, "\363{J[\233\031\001=k\307d\011w?\300 `\320\005\253\303\373\134\004Q\212\334\344} \355v\221\370\315a\314\205\236\343\363H=\357/\026\2531\024\316ZC\200D\345\212\3025\011\333!`:q", 64 }, + { "\272\021\314kDz,\250", 8, "\1774.\331\031\134\003wT\204\366\216@\2057N\223\237m<\341\307Z\307", 9000, "\323`\024\332+\270\220\374#eZ\314\217\274\015\275\234>X\342\363\240l\202\321\3030\245n44\267\007\377\042\334\225\323>t\310\316\301\333\213\215\205N\330\274+\214\323(\342\012\336\255\233\233T\220\345\352", 64 }, + { "\346G\354\015KEg9", 8, "\320i\372\224\255\204t\310p\216(.\260j\241\215\217\245\350o\362=\024d\323\350\364\212\010\300\351\265", 9000, "\237\006\200\214I\354\024/O\134\026\322\201i\203\031vjkO\024\234\311\351M\020\202\350\016vO\331}^\333\223\247\006\366\251\260\3661()\027\322\361\350v\310F\005n\337\277'\361\327\220\330\031\374\037", 64 }, + { "\350V\321\365\262\311q\250", 8, "\343m\037\250\273\367\033\260\306+\343\236\021\337\216;&\366\361\237\301\244\224\035\017m\033\241T\206\011\006\030\220\240\222(\226=%", 9000, "\215,\364\267-?M\243\134l\345\312s\270\224lu\363@\337\360Gz\357 =0\374\320\027E~\206t\347\031\222\371\211H\333\242\210p\371H\023E\262u\004\042@\250\341.\316IYA%\364\010o", 64 }, + { "\134\012\274\273\331\3564\247", 8, "o\2669\261\335\134\307M'\373{\361\367\325\253\331\243qy\316^\031\315\223>\024\007\177\375L\216\001\272Y\235\246\340\341$rG\352<\203s\255%#", 9000, "-\017\003\263@\273\011\274\3138Fx\036\312\320/3y\26458\035V\222\376\004\312\330]\263\317*\265q\324\340a%\016\214\241\255v\033U4j\006\002n\346\014\326\011\211\201\237I4\330\034\0002\335", 64 }, + { "\276Z\205\372\215/E^", 8, "\260X\264\010\316\224\021_\014\005\246\0046\005I\377j\356N\365\013\253}\007\250BlGu\224\027\37541\352\316\3704\305\024\343%\037\342\265\236YA\200\005j\352\203\254\315\237", 9000, "\266t\3301\355\364\233_\353*\333\220Z\007\360\343t\343&\260\036\334\201\254\335R\373&b\237\027\221\343]U\304\212+\0367\307\375w\250\227\233\042U\227\215\324\017`_\254\3125.E\002D\321\200;", 64 }, + { "\226\005\201\252\315+\266a", 8, "\377\315Y\201\220\361\037\222\262r \237\226*r\005\236\225\036\323\313(n\257b\011\330\357H:# \321\271\344\202,\231Q\016\013\034\222\003\364\205|m\335\232\0172V\355\275*vH\262\177\205\307\210D", 9000, "\234GS\240:\220\213\346l\004u\204\234\243\351I\370\260\375\010\201\035\223_E\354\271v\036\250\266h\227[\243=\337\315?\220\3253\300\366\346\024[\307w\325\313y&l\027\010-", 9000, "\307\367\342\016j\337\217Jr\210\226)\242A\315v6U\313S\042\025`\335\346\002\240'U\312\342\210]=|DZU\253\237\320\235\264\311p\200\221EP\311z*\207\267\305J\273P\033Utu\254\300", 64 }, + { "\347H\205\004\340w\177\321\313\337\042G\204\274\033\334", 16, "h}o\344Iv:b", 100, "\037 \023\347\332\024\007\042\036e\253\276\016\270RM\224\223w\012i\223\305\2474]_=\257\303.\331\025EqB}\214\204s\253sD\037\317b\034\000\376e\012\340V\220\224\00532+\024f\206\032a", 64 }, + { "S>\007\330\027\271yp\211\357\017\246\200q\302\376", 16, "\266\042\300\276\377Z\362X\241\271\005\257\355l\232\235", 100, "\320\302\134\002$F\034\315\343\211\010\256\264\222\021\363\177\003T\030\225\027\333\376\213\256\357\202\324\272\350\201\3161\233\277\327\04293 \332>?\327A\377\361\265b\274\202\246\3123\236\366\001g\211u\223\354\354", 64 }, + { "B\031~Q\003^\310\367\210K\014\256\245\202\316j", 16, "\015-L\002\032\352\005\215\322f\024\344\3559\360\273\222\336\347\221\356_c\320", 100, "\177\207_s#\007\301m\206\013\2300!\365\000\2125o\261\376\343\365x\220\313\356\264p\304\013\033\306\354\246}\304\004Z\311l]\002b\362yd\013\234c\007\340\262Bh\001\013\314\364\021l=T\344~", 64 }, + { "\245\360\247\005\370r{\215\303#0\353\344>\002d", 16, "_k\016jF9i\254\253\026,\251e\003\315\3136\016\023\213\337/\331q\343\356n_\355\242\200\231", 100, "\303\207[\317\226\277\341}\225.\324<\006jL\035\372\247\245\332j\334V\015\266\012\366\273\213;\213\275\021\020\341\271\325W\277\303oy\260\215\021U1\333\205D-`-[<\335E$V\253\014\213mg\267\355k\262\211(7(\016\003\036\231$\257", 64 }, + { "\3746\000\2150\247\037#\313\331\351l\012\333\247A", 16, "\234y\004\241[\363vH\207.\227X3\234\366G", 200, "\314z=\265I\243\201;\010\234\015.\042\377\265`\220\223M \006\234\276\035\036\2571\322\237+~C\241qv\223\006\223I\034\225qT'Q\232q7\3102\336\371\271\237~F(~\350\317W\236D\000", 64 }, + { "\305\363\361\241\301\257\317\177\3327\134\252\316f \307", 16, "\324)\212\012\226\034\330\315\313\323n\361&s(,\205\322\034\211a\236\335\375", 200, "&\3403J!17\345\026 \211\235C\025R\212\177\374\273\343\027\3772\026}\232\347\016\362U\352\025|-\373V\300Q\221\003\317,\037x\334Dq\230j\277\206(iW\037.\336vJ\230W=\013\376", 64 }, + { "\342\015\026\337\254d\021\237\010\216O\314\271\015\202>", 16, "\272\010\351vz\243\205y\234\345\354\262[\353^z\346G\324\177@\217\357\252z\254\354\240\241Yb0", 200, "_\235S\033v\365x\3567c\255\216L\267\200\307\204\006\365\271\276>H#\260\015\335\025d\000\230H4\255\365\264\370& \204[\345w\035ne\301\254\312\246$\213\345\362\261\256s;,\321\304\371o\333", 64 }, + { "P\220Zg>x\313,\234\260\240\262\260\351\177{", 16, "\3762s\2309\276B\215}-\215&\363Z\374\305\233\325\203\254\367\212\250\266H\222\002\256\362~m\374mr\354\305\317\330\215\214", 200, "B\2700\007hU\301p|\227\275\342e\005%\374\023D\242x\311l\0344\211\256k(\264%\011\362\266:a\305\330\252\320\303\365uh6\240\0033\271\236c\220M:}\365|\210\010\305g\000\364\027\347", 64 }, + { "\032\222\254\003\000n\311\010x\225ny~\226p\016", 16, "\303\3346\310>\2656\271\251L\272\243\007\315\221OZ\300\212q\335\367\246t\234`\213\214\347\332U\340\352\275\265\134\354\203\333( ?\256\304\035D\012?", 200, "t\301\031U\330\0141Jw\010\027\212\334q,\306\307\313\354\177L^h\376&\033\310-\231\220\273=\277?n\201>~\0263\216\012M\341\224\037\034\244\036:\325\017\2024\230\342\006i=$\3546*\243", 64 }, + { "z\012!\011\346\202\316+8\217e\255\023>\350\221", 16, "\177\015\264RK\134=\005j\210\255\202\373z\327\304\377\027\267g\254\3139\333\354\215\273\177\0112\237\327\343D\205>\213\231j#\235\355\363,\237\315t\021\335Q\300t.\346v\210", 200, "\233c\377\253\202\010\203\256\372\357<\200\231\334\3074\207\371\232\243\206\023\212zj\272\273\216\217\210f\200`\031\202Z\337/\2467?\177\226\321\215\300\216\260\222t\320i\361\012oT\017\302\340\353=\302\240z", 64 }, + { "8\346\2320\027\300\302e_\224V5\347!\037<", 16, "\247b\235u\341\201tX7\372$\260M\312R\344\275\241i\233\255\253\030\206\256u!\334\201\275\202\042\036_\237\335=\031,\015\230\372\303\224\312\334\220V\035\323\226\340;\177\250v\375{k\344\331\255\214$", 200, "\216\323\264\300\362\373?\027\346\000\323\275\267q\001\222 y\303D\366{@f\034\226O\234\341\216\230/\226\324\034{\001\264\042\326\357\015\360\037\362\2602\306\277.s\244\001t\346V\333\016\3111\015r0\316\005b\330s\204\317uxc", 64 }, + { "`\204\233i\237g%EA\265\241\220\240\311\271\277", 16, "\007{\3171vCb\215", 300, "\231\365\3613x\302\240\021\024\331\3726O\333\340E\304 OVy^\0121\360\353\237\210PM\261P\011\325\311\307{ -\307\016\204R\300+\003\324M\312h\003\304+\251\214\005\205&\002\252\022\240\3702", 64 }, + { "t\271\276\220\376\026\002Q\320(\350\3108\032\234\227", 16, "\275'o.\375\363f\266\245\373IN`\331\016]", 300, "\234\203\367\265\303\221\335\243F\363!\225\007..\177v\266\321oe\227\013_/3\032\330\225d3\233*\252\042A\323gR\303}A\374\300A\353s*~\205LdO\305\002[\201\204\033>\244\207\330\030", 64 }, + { "\200|\315\327\367T6\016E/+~\016\267\042\366", 16, "hR\302J\352\242*>\306R\202R\354\214^\317\216\270\277\014\316\322P*", 300, "\215.\042\007PDE\315\3073\355\007^\2619\323ET\250\004\334|\364lQ8\020/f|\206\344Q\010p')\013\220\277\231\362\272\00462\344r\211%i\273U\012y\346\322<\005s\204\017\200\274", 64 }, + { "\302\354a`\2242\277\372\213\134P\021lU\200u", 16, "\320\311\272#\313\335\306\264\251J\255lR}\002\273G\3006\371\205h\235Ah-X\001\312\3341\027", 300, "\022\220u_\275S\011\301u+\222\351\307~q\226\007\233d\231\276\026e\251x\3123(\243B\227\021\215\277\031\315\226\315Y<\360\213$h\203\017\266\335\024\247cSC\350<\340\303\343\237\241*\200}\265", 64 }, + { "/\342EJ\341\2354E\202N)\376\311\231S\231", 16, "\266\012\010\366\027c\3434\364\272\373\260 \263\207\262\344\237\350\271Y\245+\011 \341\344\277", 16, "\326&\352]\243\333[\211\035t!\366\204\204.\351\005\036:\260F<\210?\343m\226\035_\134\255@\016\260\017\347\033\256\377\361Cd,\343@\007\264e\177L\275f\216\346rP", 400, "\300\042\035WU\336\316\023i\201\215\215KSU\215aH=\010\332C\207\276\207\254}\373\331\325\312\013)%<)WM\330r+ \014\214\217\012c\266\023\364\330\356t\264\042(\031\312\271\312\351\3356J", 64 }, + { "\260\354\027\023%\230\372\345'\315\035rq\356<\327", 16, "\300#\263\231\336\337J9\346\354\007\273\351\244z\013\247C\342\337\042cF\221\022\221\203z\200\244\323H\015\366p\364*1\2271\134\326\377>\002{\260:\242\224\323\035\211\002\277\347\246\227\237\223\315\315\361=", 400, "/\015\317\021n>l.\252\256A\340'/\327vM\233\262C*\241\361\036\353\203sjK\003\007\331\361][\204\3643\237$\234\353\205_\206\226\337\275\375\025\255\314\263\250\311\244.\362P\336w8_\344", 64 }, + { "\366\317\345\225\251\365g\205\211\324*\313\001E\314R", 16, "{-\027(\230\231a\371\302\271rc\302\204\32402\204\312\005f\227\336R@f+%\250\372%\023\340\002!\203\037\237!\1346\012\355\345\246\020\346\263\204\204\222\356\221\2334=\3333\364)bs\242\314w\001g\214\212\020Gq", 400, "\212K\270\302:\017\317\343\266*H-\373\241\321\200\021\204y\276\272\252\347#\333V\025sI&\325@\337\015t\312JR\312\222\243le-\204\354WAi\364d\353\364+\023\376\363\210}\261\236\242\262\222", 64 }, + { "'\225\026", 500, "\341\213,\254\202dg\312T3&z\363\354#\350\301\204b\302\357\253~\315a\342\235Z\206J\002\341\042\004\342h+\274Z\305\350.8^\377C\241c'\231+UI\216`a\002\203>>H\276q\330", 64 }, + { "\355\2508\036\235/\211\331\356\0223S\2121`\224", 16, "Zk\3217\020B\320\302u\222N\357UBC\364\221M<\344\210Rq\254\327[v\266\347\251Y\022\367E\376m\303\332\134\270\020\332\333\026\224\204\367\254\362U\011 \324\276m\330 \032\222^W\2304\345F\005fw\364\277\322VXJ\345\0167KM\213\022fv'~\032k", 64 }, + { "\134\244y5\2355\245\326E\016:R\206\032\334\202", 16, "\233\364\201H8\215y\376\014\277\016\334\013\337Jm", 600, "8\337\036\337\322h\016\272\377\261\302jZ\271\312!F\372\364\327>XPTg\232\226F\021\362\024%~\371@\314\226;\026\244\2356\312\134\134\236K\217\243\341\0052J\304\014\354n\205\321\365\256\214t\337", 64 }, + { "Q\361\217DR\030\023l0f\316\321\317\370\000\270", 16, "\210\323\252\322\0060{\223\006\022On0fm\202\011\315\357a\031\373*\317", 600, "\300\241\266\226\264\202\202\216m\0166|\321<:^\367\256B\327\211\036d\030\002i\207\311\322RSC\252\303G*xD\203\213\003\343\252=D\261b6\033?\351\257Y\251\261)\254j6I\203e<\333", 64 }, + { "W\240\211i \373\342$O\315\042y\243\371o\203", 16, "m\225\254MJ\265\037\231)\021\336\371\254\253\256\317.\204\210N\300\226\320w\354\021G>\014\256\310\034", 600, "\373\356\000o\004\330\262\234\262\250\346f\212ap\337e\220,\007f\333\202\270\253_ms\351\013\373\234\251j\204\360\033\257e\344\360\200A\324S\320\251\235)\015\013m\202\206$eE\370\243\001\014\221\300\275", 64 }, + { "\305\337\271 *\214\274\272\356\013\307u\215/<'", 16, "\323>\273\2563S\220)\265\367\346\246\002l),\025\177\027f\332\223\014\004\260}A%R0 #Z\357h\340e\261\025>", 600, "\333\224\212N\256t\331\335\002\315\266\324W\214\017\016\273\250\303\021\326\340\016fC\015&\305\213\266Pi\261\344D\325A\367z\251\326n\321\305\2120L\324v\006\262r\320\211[\023\253\301\330\376\017\245w\000", 64 }, + { "\227\317\337v\243\316\223\362\003=\022\307\243\250o\216", 16, "\247\270\205\312\252b\325\344\227\372q6\3660\004\035i&r\212 \253\177\211\365\034\207`\213\310&\005\307zo\332\363\344R`\217\267\270l<\275\321\317", 600, "\312\021O\242AA,?\251\335\207\244\357\274\2753\020\006\321\240\362\262\304\253\210\370\231>\323v}\335C\000r\362|f\273\246\225\314\354\244\272\260\330o\221e\233\005ea'7\336\232\232:\221S\031\334r`\316\2015\257\377\203:j\221\264d@\342", 64 }, + { "\255\377\250\342\216\0156\217\331\352\220r\302\236\376w", 16, "\377I\023\011\206\313\214=\006\344\0217\037\034\312Q\013\303;#v\275,\276b\036\023\375r\332\302G\335\307\333B\325\374\347\271", 700, "0\2629)\037Z\226\272\312\021\215\345\266_\036\373\277\012\023\364\271%\271\272\366\353\205\322\243\220\1342<\233\372\311M\232\027,\215<\334Z\357N6F\207O#\031n\215\235<\256\333\304k\223\323\240]", 64 }, + { "\243<+\014\304\027\016\025\023\373@\377rt@\336", 16, "\316\023W\361\200\325\241\255_\347\247V\0324U\031.\377u1F=\234\206\365\342\256\210\243\346\217\317m\3334\267\242\263|.\015H9\212\313\360\331,", 700, "B\322\302\014Tt\014A\243K\347\353K\031\364_)\340Q\356\216\006\367\275\355\246\035\362k)\322$\242jn\3077\255@\036d#\266\267\274\267\343ti\211\376\032\200x\313[\306\267\247n\222\222\347\021", 64 }, + { "\371)r\237\3421+4\356s\277\234\343\330\212\313", 16, "\262\017\333\260\372\305\253\325SWj\350\233\231\222\372s\277\032\272[p;5\204T\014\243\017A\345\314\217\210\323&9\222!y\247U\3673'\351\266W\216N\215\265\0331\331\373", 700, "r\016\300\215\261\246E\350\234\360\035\340\025\033\206C`\206b.\326\223\367sV\320\232\006\374\227\234N\027\222\376\273\264\356\206\340\317\337>\237\266r\207\206\224zp\343\335b\333\237k\240\306\204I9qF", 64 }, + { "\351\236t\270\232A\203a}#a\340\217\314\235\246", 16, "\345a\00716#31\263\314\220\255\005<\306\277\3574;\025\004\341\323\215\023\210l\373|\226\234\251O\242\2334\311\336g\260\033<\261\236\237\271\357\230\035\273\016c\212\200\3406\361g\022\263\030\311E\277", 700, "\300\270 \346\234{<\357^\225\303\255u\351\042\254\267A6\032?\023\251\226\320\361AToOc\201\220\335\241\276\363.\277\227G\042i\300x^`\230\253\247S\205\231\2700\370]\304\343y-\134\262\274", 64 }, + { "\326\315\030\330\327m\324g`\357\314\374,m\313\027", 16, "\222\231=\273\242\212\226\031\325\251e5\213\256\244i\036\370\247\361\2530\377\372E\244\265\367\346\251\312\300<\304\221\035\201\277\342\304\015@", 64 }, + { "o}J\242\212Q\201\317\222\006\331dI:\362T", 16, "\227\363\374\030\2151\324W\373\366>QP\367\032\315", 900, "\374\010\253\244u\317\244|\366\2348h\341\373\322\350\234,{x>V\036\006\266m\042\374\335,\351Vl\376\341\026\000\233\302\021\013u\274\246\363#F\321\234\226A[J\323\253\371\201\344\306\312\222\300\232!", 64 }, + { "fW`\315\042.\323\234/\024e/\235.\367{", 16, "\377\001Rk\017\237\367\371WR4q\271\242\200\034\374\224\224\026\371\3056\305", 900, "\314e3\234\224\216\231\334\257\005\354\223\241\322\363t\134 T\343l\246q\237[\300n.\014F\207I6 Hp21\271l\244b\023\352\214\356\331+\331\006'\321\215\301}\223!\3318Mp7\005\330", 64 }, + { "\365\016\371I\230s\357\307\245\037\373\023N\2579\236", 16, "+\214\007\212\252%\034\006\337Z\013\267\134l\211\030\302\271\267\376W\014!\370 \354\272k\013 \265\035", 900, "\026\345\251\321>\361;\226\251\251\277\3261$\233\224tk\373\011h\030\256N\030\314e\352M\2200\273\341\351\350\302\257\03796Lc\3615\215\033J\326q\347\364T\0232B<\015\202\251b\021\352\271\224", 64 }, + { "\357\305\300\016h4\217\213\205|\365\275\2402M\212", 16, "\232{\261\235\227\366}\037?xZ\217{\271\352\3539\3628\370T\207\370\222\334\221PJ6\237`\235\343\020n\323\370}+\025", 900, "\006An\011@\267Z\023\026aW\274\002\263\316S\006\374\372\362%\003\357C\355\307\202\023\266YN\245\361\324:\311\201/Pa\342e4\2122\203\255\312T\201\243l\357\337}\361\302\347\034}\315l\007\301", 64 }, + { "\254\373N\035\251\017\360\304\005\333`\256\301\240\351\020", 16, "\257\231q%\353\262\257\37167\260\364e\222*\0135\242\214-\263;\011\232e\237\221\202\026\352\334\034=\326\346\246\016\353\375hH\020\2666;\276\254\254", 900, "{1\200C\304@\350\255\323d\266\042|\2019\262\264\177/T\362\020\346V=\032\360\226WC\234\260u\244X/6\326\202\363\025[\327Y1\240\243\030\373m$Yp8\220\272v\321]\361\343\305?\226", 64 }, + { "\200\323\244\005\342\327}\330\0329D\266v\037\332\234", 16, "\305sYC\035z\357\246\025\315'\376\305Do\345\022\320\016L\321\236rW)\0128>;\042\215\2640\244\370\245\271\312\220\222\211j\247\323\252\324\252\316G\014\307\303\220\026>\241", 900, ":\015\356\340\031MC[\210\244\201QVg/u5\331\215\134Q\277J\322E\306\222\372\346X0\210N^\207'\300I\345\011\020\366R\014\177\213\037\3425&\252>\264H\316\335\235W\264\265\256\3774\002", 64 }, + { "\033t\350)6\260R\333\031\346'3\021x\014)", 16, "\317\036\207|'\372vD9\324\306m\004B96\3643\007/\337\212\015\042\015\317\022\375\3434\3669\266\243\234+\336\261\234!@P\204\377\220d\236\370\254\370vx\312\134\017\204\3509\225+\034\351\024\267aH}p\364fW\006+;=", 900, "\023\234\016G\310\260[R\353\236BW\207\317\016H\245'\203'\3209L\0148\230(x\027\337\025\256\355&O\2170\024\177\312\200\005\320\365Z\353c\365\207\333\134\264?\321j\0170\312\263\366\350\2733\030", 64 }, + { "}\026\215\320q$\364\307\271\035\234s\210bw\265", 16, "\260d\255\307\300\313\321\370", 1000, "ko~\027fI:q\276\226\305\216\270\317\010\340)d\020\353l\010\274H\013-\306\331\014\277\252\254}\007~\371\327{\352\216\255\211<\366\221\201\311\001\340\267JV\227+\347\253.\222\200U\317F_\276", 64 }, + { "\302\316l\266\270\312\0316W\200lJD\344\263\264", 16, "\353L\235\037:<\341\377\357z\035R\322\221b\010", 1000, "\357\261'\225|\274\201H\253\332.\240:\2151\3776\250\032Sa\351\3659\223\366\240H\200\2439\007\223\240\300k?,\004\203$\200\220M\236\202\314\032\321/\231;\210\312\013\214=U\0129\246\247\347\324", 64 }, + { "\351%\241\263p\261\200\362S\377%\206e\350\237p", 16, "\347x\025h\232\331\240\015\006\035\273\353\233\001@\004\177>\254We\361\353\215", 1000, "\302\000\266c\330\375\3350W\022\272\3446\345EY+\311~\244\0162\006=\353N\212\343\257/-B\271\270\343!\030Q\210\242F\307r\276342\261F[\342\337\277\321\217\360v\015\215\301\005\367\232C", 64 }, + { "\224U\367\245\357\276\004zv\004\017`\350\315\220^", 16, "\230G\361u\016\305\221\367\253\334\344Dg&x0\314\301/j\042\211~\320\207\207y\217r\237p\354", 1000, "{8\226FL\023\270\334N,\247>\033\032B\032\354k\010\001\373\222;t\023X\304\371\276\244\203\316Vw\352\214\310yI\010x\025\215\250}\301\027\205 .\042P`\306Xrx\322\257\235\340J;\277", 64 }, + { "\225t\353\356\367\376\013\326RX\246\016\134D\243\336", 16, "D\006}S\362\262u\220p\364\313\365&{\346n\277\322Jv\2202xdk\230g\327\341C1\220\374\322>;C\263\254W", 1000, "\026.X\262\251\361\032\206=\326\251\214\2721.!5n:\266-\267\015\213\216\313\335vP\013\305\034*\301\177\226\010\345\030\322\213C\313\233\251n\245p*\207tO\021\022\221\020)\006\212\237\014\223\020\256", 64 }, + { ")\035\350\023\325\370\321\370\243\005\263dm\3147\252", 16, "\015m$\343M\220\3573\304\200,C\032m\237}\256\366=A@\200\223\177z|~\263a\321\320\344=z\0229\244\200\222\253\013\224\021\265\224\023Hf", 1000, "x\351\246kB\345\355\201\134K M\003\321V\307\024\257\246\251\031\224>\244\021e]\014\262\272\004\206>\251\270D\372\226\206\352\225\273\010\036!\364_\327\244\001\353\012\250\232\227W(\034\231p\301\031\203\325", 64 }, + { "\246\337^`\273\277pp\204\370\235\023\256\026&Z", 16, "\327 h\205i7+eN\362\265T\320\321\237\214s\036,\326\021\357:7S\302\212\253\016e+\251\253\334z]\022\256]c\007\310`\223\364\022\206\245\217O\036\251\366\214\242\370", 1000, "\346\364s\202y\026\347\275\220gk\304\232\326\234\025\257Rg\254\233\216\344a\306\225\366N\216?\276\367\032pn\364-\322\331\367y\002*\276\322x\340Q\016\354:\341\216\320b\216w:\267_\227>\274\235", 64 }, + { ";\355],\232J\026\265\200\333\220Di\271\362\325", 16, "\217p\015\025\3636\334\234\011:\304\3378\203T\247\207\350qA\370\365\307\021\230\250\312:\214l\311~\274\220\303\225S\250\230\343hc\261\374\343gI\374JO\013\325N\271\255A\264\032\215\013>>\262\021", 1000, "Tm\271\346\333\031\034\261o\233\342G\006\277\264\2759\015$\351\352\331\214\200BL\375\356\322\376\340\337)f\356%\346Tm@\277F\027\012\315>\327\276\001\302\2576\313\244\315\276H3\346A\266\226\312T", 64 }, + { "1\317C\247\340O\362+\332\245\006\261\2069\252\342", 16, "l\31548\373\321n\375\007\337\320\277WV\334\205Q\230:\021\010*g?\3702\004\005\306\305\324\025\256 \203\351^\276\347H\306\345=k\310\247G}\326\020\347\363\350\016\215{\023\374\357\335\2669\315\353\336\250\224\303W\370\246\221", 1000, "E66r;h\253\215\200\205\375d\261\331\275\264\330\3146o\011W\210\217NI\343w\256;\226\351\351\000h\346\340wi\221\275\302C}l{\336\272\030\177\273o[6zV3j6\007)L\244T\025\256\353\2726\023\241\3501\221Qz\342\001S*^\327x", 64 }, + { "^u\024=)!f\324L\251Z\200\377#\134\362", 16, "\224v\363\204\345\353\263&e\242g\310\227\323\231\370\320\350u(3>\346\013?\3316\360n\316\2560\032\264n\003\177\352b\360", 2000, "u64\012\241KEM\001(>Z\237\042\027\240\361|\252\216\357\214\017-\302\002\365\224\355\277\351\033\011\030\324\363\034\320q\340&F4uCc\235{\347\013l\2671zB\025\236\3174\215k\361IJ", 64 }, + { "\256\002\200\356\321\334\300\0423Y\021fv\323iD", 16, "\224\307\134\316\002\320\273^[g\332G\320U\0139\004\022\220\010\372\200'iw\376\236\012\034\304\017\035\334a%/\322\277\3206o\262*8\014<\004\202", 2000, "4\274\031mr\012\340\305s\042/\217\205y3\374`\224\223\311\377\222\301\202\214\351\337\010\015\315m\213\263\334g\314oT\372\330\246(\333\306X\321\376X2\206\026\230\333\361\325z=\277n98\334\377@", 64 }, + { "\250\346\251\243\207\200\303\011\307\231z\220\332\004\367\021", 16, "F\251%7\247?A\003\200\015@A\260\042\247\310\356\004/`#\222\244\201\317\375>\134B\023\024\007\032\251z\330\371\3456\006Be\207\343\354CR<\261O\352\362J\361\377\367", 2000, "\276\207\365,\306\033P\0200\231\2013c\351-\301\032\207\212#\301\3233D\374b\027\206\357\335\341\321\205TO<\316\225\011\271\013Ca\235\315>\214\325\222R$\003a\224\005v\253\226\243s$\375\345\240", 64 }, + { "\222\324\307\304'\000\210\255 [),\322\357l\332", 16, "\007\345\242+\012\357t\231\202\266\324\250iv\277\257n\315\354r\025\004\356\233\317n\256\042\202\372\251\223\230\226c\203=\334\331\230\237\034\2129\215\365\317\006\250\010\361\335\226\261\367u[zT63|\365!", 2000, "\371\270dr\215\025\035\212\004\012q>\263\267*L\201\373g<\333+\215@\334\260E\253,\302\261>\222\201)Y\006\316,{?\303H\240\253\326\362b\134\374\177\013c\351\237h\025\2350\313\3422\313\272", 64 }, + { "\325\351\200@r/\240=\323\331\372\023\244H\013\236", 16, "\326\307\360\340u/\260\312d\314E\240r\134\025h\272\202\230\177\364\346\134-L\345\362\260Y$\207\027fv\257(\336a\307\215\341!X{\024\0317\345\257\240\263q\332\032Y\230k\026\254\037-t\031\244'\353\324\344\3014pD", 2000, "sf\252}\216![5`hs\210\324T5H\346\037v\314\344\346\330c\240\373\021\023-s\350\356kj\224M~i\206\325\246\325b\347\335\252\303+\277n\003\307lgw\217\245\025R\205\301\257gb", 64 }, + { "\244 \262P\000\300\360\311\042\251hn\226\023A\270", 16, "R{\337\244\226\014\276w", 3000, "b\254\205l3\271@=Y`\251\226<\316\334\013$\321\357[\357\324P\201\246!\355W;\362{\367h\2072\270\247\353 \271\357\233_\330C\322\231\341\251\315\010xm\270\350\260\352\304\035\304\204K$m", 64 }, + { "\015}\205\262\251\331\300M\312\216\024H;\313O\030", 16, "@\225\032!\031\231W`\325%\332\334+\345L\257", 3000, "S\042\245F\263\330\001\203\365\020Q(Q\032O\302\236\311jA[Yq$\000\210\266\026BIFj\255\263\362L\357^\304I\266\222\223\001~\321N2\202\206\301Ml?.R\321\215h\327*\347\317\324", 64 }, + { "\270\257g\226\273\231t\256;\025\270\267mL\177y", 16, "\224\2678\3320\274\306\365\254a\260\307\276\377\012Y\231\372-\3652\026\225\026", 3000, "5\3706\342[/{PT\265sHl\345\275\215\273W\300\354\341\342 \334\011\013T\003l\225Q\333\277B\240s\211\231s\360\353\301A4yj&`\024\005_\307\216\325E3\235R\032>\213\034[4", 64 }, + { "\312\207\223Gfp\250\306\342\002|\233\1349U\004", 16, "4\321\374\364\375ycx\020g\345\224\352\0424\313\011c*p\267\376\232_\370|\240\010.\3227\033", 3000, "\341.\134\262?0\256n\334\263\356\273\3141m*\352\344\237\302\300\364>\347Kq,mu<\327\010\267.lg\002\232\226\350\354\010\263\215+\032\014\230\262\375R\264\032\204\334\351/\314q\361w\246D\274", 64 }, + { "\2645\264\241X\321\351\352\342\015\253\257\241\354xn", 16, "\214Ihf0\343\371\323=X6\244\327\237l%\340\300\021\006\271Q\340\002\267\331\234\0100\231#j\005\342[\367\012\042J\237", 3000, "A?@\303a\325\243\015\200\206\256\025m\2471\254|\252\203j$Y(\013'\346\336\011\217\355I\346m.\001\337\033V\022\342\2177\216\264\211\000\253\330\007\315\323s\365o\371\330t\361\235:\0231\266#", 64 }, + { "\250b\326\230\271\352\346\357\305\245\303:\3236\036\300", 16, "Fe\247\220E?\206\201p\303G\006\357\027\204xD\264\237\247t\042\357N\335\351\351B6\177Q\301\307\334\012H>\2572\275.'tu#\014\371\260", 3000, "\3270\222r\024-Gf*\352\204\271\305\315l\234\370\364\313\304\250N\267\321i_=5\370R-\302Oi\251\305\236\244\376\005\033\270\265\031\007\242\234\301\02166q\243\042\035\326j\224w\035\232J#m", 64 }, + { "\226 \316\360\363n\302\012\207I\3022\252\232\271\221", 16, "\213\316\027t\212l\242\354\014\304\376\344\377\352o\207\330\376\037?t/\214\316\017\027\363Y\010\017\027N\326\007\003\263\274\042\177\230z\264x\340\017\204\005\203\200}w8R\304|g", 3000, "x\330\300Nq\0371t=\326=O'i\0176\314k\351\301\335\134\372s\200\331\010\322\226e3N\016\341\251\3670QT\322\200\346\217\300\202w\010\253\242\342\272\024&|i\307\270[H\357\306Vu\004", 64 }, + { "ng,\206\357\313\353!`\263a\237\375\256\224s", 16, "\334\370\260\331\016\0355\342]/\207\227K\2323\256\003\004\314\256\020\020Wc\241\367!s\366\223\025\254\245\227`\335\226-<\375\367\010_p\2151*\204\2501\263\242r\324y\231>Ej\324\374\265\247+", 3000, "\233\241\316\316\335\307~\260\336\332\273\337\263yqH^\202\037\265\375\032\353\364\277\241\241\2456\325\3558\364\360ft\316\031F\350\300\026\026\264;\345{Ru\002~\027\340U\316\313\231\205\205p\3167\256*", 64 }, + { "]\340\304\315\250W\316\336J\263\231\002\216\251\364\242", 16, "\201\376\003\177\021\346\237\211\320\262\334k\320Hu\220r\357\237%\222\357\013\350\330\042{\210t\227\376\372\016\3707\340\230f\200\360\300u\312\034\220\376]ct\225\311\275\005z1\243l\373-\234\2154\317zZ\0306\312\2435\032C", 3000, "V\373\262\256p\232H\0424\034\215\015\273)\217\366\237\253\323R\226\256A\257\334\355\035\376\331=\251.T)OVJd0\005q#\356\346\012\223,\017\015S\227\007\034\010\026\370\271\233\267\030\010\357*\244", 64 }, + { "\021\225f`U!\334\331P\355\312\351-\032E)", 16, "+d'\210\235<\262\204", 4000, "'\276\227\331e\015\206\231\234\323\2578\306/\0338\007U8\354}%\310\265\335%O%\255\377\376Lo\303\350n0\353Zi\355\277\315l\010\252\366'G\272\263f\341\310N2V\346\334\257\214\333\002G", 64 }, + { "^\314\361\023\376q\261\003\245N\240\353\031\300\031I", 16, "\355^\377\321#:\253X@7\201\251\215\257&\310", 4000, "\266=p\000\366\231n\365r\310\011\266\315\357\242\011\333\237o\030k\364\341T\042E\332\313\255\227\246\251.^\372\012\317\222\355\244\2066\034\336\000\250\277x\000\315\002\373\263]\037b\350S\036\303\341X\002\335", 64 }, + { "\300&m\242\343a\326$\210e\200x\012\335\036Z", 16, "SG\363E\013\273\017VO\360a#J\220,\263\375\322\202\227\242;Pr", 4000, "\242\351.\17783>g\001<\034\004\030\002\312\345\270\021k\342\375\243/\342-\346\240\017\260bj\342e\206\225\134\367x\330\020/\363v\214\241\025\205lg\347$\275\300\315\205\021u-1\246SH\205$", 64 }, + { "\235QV\311\015\001\301Sd\204*\270o\026\177A", 16, "w\020\211E\315W\014\015\342\344j\251X\341\2528\354\371\336\214\260B\367)\264r\345r~\221k\255", 4000, "\3260\375\203\347\030\375\023\351t]\015=\301\267\303\035\204\2345cJ\2565\243\266G\211\333\024\311\320\2556\031\302\310\257\273{\340\274A\011\305\206\272\232\264\336\217\012)\375\036~q]\241\267\220[\203\330", 64 }, + { "\303g\3655f\271\332\250\306${\317S'\270U", 16, "\300RV\321<\333\2779\031\216\346/\305Dv\021\333a\374\344\303\355\370\0367\201\315\346]\242\375)\323=e\023\013\201\306 ", 4000, "@\253ur\230\326\344l!\004\026\352D\222,\021l\0316S\205-,\035\374#E\023q\034\312\0003?\234\000bs\334\011\011\204w\2558\356v\343\255y\260\023\320\305T\314\300K\232\000\013\352\305:", 64 }, + { "\366\307\305\200i\370k\246sc\035zh#`\035", 16, "\341@\032\010\373\0114'\275\204P\256\314\324>\030\266\343 \034jB\372\0124\255^\234\207\274\322\227\357\244VJ\273wq\326\224\373x\360\327k\3508", 4000, "\323u\002\267\022\271\274t\002\305B\017\015\366y`\256\201{w\017\240/\225p\356\036yj\277\277\242\243)$\244\333\272j\367\024\223>\021o\370Aq\343nV\237\031\234\350z\226\201\300\024\256\006Gh", 64 }, + { "\365\236\311\322\134\327\033F\230F\370_\217\221H\315", 16, "\214\207u\217\253\234Y\236\377\343qB\374\035\231b\267\266\314\226V\207T\367\352V\001jY<\337~q\203\345\265\230zB\2110\346U0\231\205\246\254\013\213\011\134\236\351YO", 4000, "\315\360d\246\273\364\265\217\210\306dnuA\004\347\022w\200\375\267\341\336\340\226jlc\354\205\310\316\251G\373\347\237Cee]O\351\237UN\236`\305\244W6al;#\336\377n\335(\337qO", 64 }, + { "\341\325\003\214aV\254\361\365\314\333y}\005\036p", 16, "\274\271\3200UV\327\273\263H\022\362@\322\300\362)SMQ\335'6}\017\255\332e\341=\377v}\024\012\316\233\324xJ\367\011\016\260[\260N\322\257\011\005h\273\237L\010C\263\3300\321C\365H", 4000, "\336=?\327\210\002\245G\275:Q\371\271\233\300\273v\274@\002\363\340A\305\372\272%\355\365\343\012\000a\204\276\243$|\237\223\221\240*\351\311\262\327\367U\000\316$G\224q\036\033\327\224\247\371rzY", 64 }, + { "E\352\312,\222$\365\267\303\016\331\276\345f\305\134", 16, "\01152\236\032\242H}L\263\334qk-9\013\006\356\357\251\372\026Tb\304\256\226#Ad\216\3024\333\264\240S\217:S\257\024\347\030\321\026\223\024f\301\261]\301\002\272\350\023M<\254\255A\270]Yh\251g\2235\206*", 4000, "\352\317\323\300\357w\365m\200D*\277\024\330\246H\207\347\257\211^\240\362\005\001D\237\310\332@T\243pB\247\025\236\204V\377\346u\242\203q\324\307\320\314\207\372\376\222\206m\134\037\365[\307,\240\377c", 64 }, + { "ho\014\234\352\310\134-\224\021\301\134\015d\356\351", 16, "'\256\217k~\376y\335", 5000, "_\341\264f\012\003\275\012It\363\322\301\032\342\337\331j$'\006\014!3\3029\313\200n\266\003\254@\236[\011\214XK\372\020\210\335\031\134\303\011\042-\004\365\003sn5\235NK\375\013`\022\336\025", 64 }, + { "4\020\304\323y$t\014\202P\251H\371\235|\035", 16, "\303\370Y \366f\325\317\352\030^\245\234\366\010u", 5000, "#W\033\270\241m\245%\357\270\243\340\211\271\263y*\341-\002\277I\332\227\042\271x\321\344\246\030x\252\233\326-s\302\334\327G:(!\315\220c\346\240\375\012@F8@\205\271Vx\321\202\024!}", 64 }, + { "\034.{\0068\255D\335\340\303m\273\356\223x\204", 16, "\247z\325\244A\337\245'5\373\351\336X\330\003\2576\243H\020s\226\266p", 5000, "\353\206?\351#+\346\206\330\225;ua\020\263\312p\024\2229\213h\015\336q\254\216P\256 \004}\001\355\230\214emU\323E\371g--\237\303\022'\016\033\355\274\267\271\351T\0327\300\306\253\031v", 64 }, + { "\015\363\324\364\323\220\323f\177rR&v\375\027U", 16, "C\020\362\262F\351H\240l\271\245_G\134\034mC}\277\354\017\377_Ab,l\322_6[v", 5000, "\370\357\015*{\001\221\310\244\235\134\214k\335\310%\274\226\3203o6\223\361\243\356\200\000\340\240\330~\225\266\004\224\254\211\276\270\202^\251P4\237\350^\036\3671MV\317\214\227\022\211\344\022\321\001\257}", 64 }, + { "\312\272\240\233x{\372:;\253\370\330\334#\267A", 16, "\323&\213|\016\3346>\224\345\032;R\233\0056\316:\037\315V?\221!h\0308\231\333\207\221k\035\222\252\014I\2215K", 5000, "\004\012\245\017y\316\355)\320\007\331\236c\324+\3771\247\257|\336C\332\331\317\037\007KG\321\334\235\237\265\301\360\315Im\212\260\012d\033DIb\042\260\025\304\311I6\2158\3527n[\032\347x\371", 64 }, + { "\215R\005M\032\350\240=\023x\0165\246\231$.", 16, "\021\272d\364Y\217\317\346\026\0161\327\214\001\357\335D\030\364OE\264\266\012\270\350c\276\340\327\254(\2638\361O\253\254!Lb\021\014S\234Z8Y", 5000, "_\3748\356H\220\264;\253\233\323\376\2548\235\004\357)\002\277#Gz\253\363j\026\015^\335\024#\211\002\354\207\373E\364\2513\344(f`\214\227\3319\031SIh\260\234\202\301\375\204\315 \002\347\376", 64 }, + { "\245\313\007\234\303h\224\215\356\243\352O\206,e\266", 16, "\031\033p\375\350W\006\004\213\313]3\214\257v\333\0357\016\375\364\021\344\305\323,;_\330E\224\351&N\244\026\275J\354\024\340\310'/(\012V\217\253P\361\236\273PMl", 5000, "v\276{&\342:\355Rm1\362\320E\344J?\015\023\323l\315\331\252\031\245\206\231\014\303\340\022\231\241\332qe\036\226qF\213\254\037^\220\042\324L\204\011q\277\233T\303\350o\217k[\327x2\346", 64 }, + { "\273E~\201\327n\340\231\001G\001\367l\206\021\030", 16, "<0=\371\010\317Aa\375\340\261\234F\275\251\236\024\310d\003\265^\345|\372-\223\305\235\272\344\350\271\3669-Q\264\312S\323 \236\343\352x\304)\341\334\355>j\024\251\377\252-\356\241.QW\256", 5000, "\307\241^1\271\302UOY$\250\372pd\343l\031\205\353\272s\004\311\002R\276\006\232I?\327\020\237[\363\012\2656-\361Z\177\025\210V\204ZF\351w|\206RqU\042T\205+\222Op\235\376", 64 }, + { "[\034\223\310a\210w\351\020J\351\263\240z\034\261", 16, "<\217A\265\347 \264\242\024\324:\011\370b\263\345R\012'\271.\005\350d\027\314\017\034\361W\316Tj\225n\1778Y\356'\012ie\307\342cF\266?M\300. \271\247`\042\344\272\371\013\273s\316\357X\207\304\357\013\322\315", 5000, "\241\224\024\317\303\227\241\317\332\351\301\3567j\326\320w)\275\223\234m\241{B\356\274P\274,\012|\235\367.E\345c ^Z\321\031\352I\042\005\365\264\360\245\357K;\306\202h\350\206fV1\000\325", 64 }, + { "5\265\376M\262\3518<\353of\232AA \374", 16, "WSKsW#\354W", 6000, "o\027\243%Q.\3759\331k\011R\363\367jK\234\357o\363\317\220|'\245\233l\250\001N\203\322\002Q\026\027H\267\253v.\351\242\220\257e=}\010/v!9\346\352\3749\2014q-\340N\376", 64 }, + { "\350\203\337\210]\367\213\335\270\213\232\026\221|,\370", 16, "\346\327\263\312\213\345\005\011'~\221\027\355\241J\231", 6000, "*\022\205kO\256\322\231(\361\367\342\277\266\220\000nj\330xh\340\215O\356d\210\225\303\2373\340\2130;\005\254S\3115R\257g\344\233\023\347\205\237\274M\307\367\327\364-W\246W\203\275\373\237\272", 64 }, + { "m\326\335]k)2U\200G\347\000\311\010\311\302", 16, "\340\250^(]nb\003\212\354b\177\344\011y\300P\016cl/0\016\213", 6000, "\273\333\252\306\015\232\306\321\251_]Y\006\042\345\350r\222\010\372\026\205Mg\373\347\267\014\234\032\016d\210i@n*aP\316s\366\206\200\004\015\017\034\325g\334OS\177\214\374\230\211eP\213rNp", 64 }, + { "f\323\354%,\247\330/\027\373\267@~\345\352\256", 16, "=\354\324\017\336\012\214\370\014Pd\217\317f\364\301a\207\032+\227\2247\201\317\215\333\020\276B&0", 6000, "\245+\223Y\302\363Wl\312\0344J\245)\347\217\027l\027\321\0121\341\365/\263\374t\330\262\210\220\250\354\240q\020^\033M\274\261\350Sp\325\254_\262\304\357U\031*\262$\363\371\030\036ay\200\242", 64 }, + { "|\035\377\326\376\2752^\335\207\230\271\341\326z*", 16, "P\271\315\034\230[z$j\377\266\015\205\3064h_\316\254\271\353\342\301*\366\366\350iV\004\351f}\260wr\257\236\025\241", 6000, "\301\354S\253]c\332 \277\205!Y\356v%\225\367c`gB\006\024\247t\314\300Q\323\225\020d\036\024A\353d\335\007\025\014\245?\252\246W\222w'\301\263\003M\014\300.\014\2420\011\355\342XA", 64 }, + { "\364;\377\002H\026A\016P\352\331g\2407[\261", 16, "p\271\243\3110\372w{O\317\315Q\035\371\221\016\236\215\002\222\317Z{\372\375X\316 8\226\270\024\344\373^>\235\274\320\337\313\366\223\246\336\250\134K", 6000, "\340Lv+w\360\311\322\355_\036@Hd\246\275\324\033\235\274\013RJr&zD\230\345\033\216\234\213\255\237[\217U\367\300\356\331\372\237\021)x\362\216\306/\351\374\314\210\2341h\227|\230,\336D", 64 }, + { "\134.\271\033\351\232P\020\356k\321X\351q\331\004", 16, "\277\207!\216\312\324\347\223\234\202\360\220}m\3773\210\232pe\020\254\371\334\266(\227\254?\305\017T5\020\210\223\006O\223\375\357!+\363\003\245.\325\255vF\350\3565s\221", 6000, "\352*\003U\323P\225\256\254\374\001\337\312\377[\134>\2306\270\001\217V\033\006<\243\265\012\355+\024&\374\313\031\254|\302\006\216\216\250wD\352\320\3128zf\000\205[P\323\013E{\025\353\276\316\034", 64 }, + { "\015\372\205\371:m\005T\000n\3255\366\220\2653", 16, "\266\234\036\134e\020:],5\005\201\331`S\305\224\017kW=@.\025\376\017\353\022\210\007#|M6\354\210\3121N\356\331\033\223\230\344\305sR\241\232p*t\217\366\243\352E\255\332\004\270\365\361", 6000, "qq\245\012\237#\004\316%\345a6\322\340\353\0344\265\013LH`\237A\232\337\357]\363\023[\353\2631\000\277\013\317\336\371\3125\312y\305`\236*]]\204\236\302\344e#L\270F\232\372\267\232\250", 64 }, + { "F\256\277\366N\234\235\316\042\230\263\256\025Q\320'", 16, "\200\254Yq.\205\373\373\0056\331\214\376C\235\277\323\350\261Rc<\177.<\326\237B\353\373\360\313\257\333^\212\303\023>\223\004\327Q\333\271\011I\303\230N\325N\0172vT\011\214\330a\260\216n\017\207xd\264\327\272f\276", 6000, "9\343\311g\224\222\221\275\256Mb\206nD\361\232L\327s\222P\005;\255\027\240\261R-M\231\347\315\3164\264\314F\347\245\372\247\247\303Q\341\241\271\003\035\207\303\304\335,\012\360?Y\320Y\227\376q", 64 }, + { "#\256)c\376QG\273\245\222Y\010\357x\221;", 16, "\315Ysi\036\266I\332", 7000, "Z\213\027\2367\231\205\005\224\300'\224>u*\372\031\003U\205\242e\223\274Q6F\362;?\022\327_\343!\214\276\262\247L\260MLX\247N*Y+\331\361\215\220l\331\213\361\335c\314\203.\330~", 64 }, + { "\360\343\200\367\344\250O\260\215`\247Z\341\274\346\270", 16, "\310\2524/j\334(\344\303\017Bs-\201\264\312", 7000, "\037$}\362F\213\254\306\345R\345i\326Z&\262Q\017\304\210\026\216\336#\220:A]\210[W\246\272\005\011z\337\036g\366\206)\245\201\214K\335#\212\205\350B\376h\034!\235\006M\272\256\225\257\220", 64 }, + { "<\230\261\363\334\357\217\022\276\000R\306\240\210Dg", 16, "FQ\263I\223\375\335\2135\006\374-1/\227\207S\341\202!\372\206\253\236", 7000, "\266|\263\374\266\265}\000\261eB\307;\233\241V\253C\014\224\230\012\326q\276\242>M\214[wt \361\361\205\303\311\320\355dV\245\242A\237MAt\237\340\242K\3133\355\357\034\303\200\0277\267U", 64 }, + { "\213.\310\205\014W\307\364sd\223u\363\035M\260", 16, "\331\007K\015\367D\224\016Q@\243a\264\342\346\216t\2161\030p\345{\227\245]\245\274\235{\322\245", 7000, "nX\013K/^l\377\237\3044\010\277\367\134.\222\215/\3471\023&:]!^\261\177g\272\011\177\374#2\177\326v\251\003\005\374\232z\030\274@\311\321n\323\227*\024H\225PA\241y(\276\361", 64 }, + { "`k\271x\304Cf\230\313;O\277\236\2448\207", 16, "r(\245\265\003\237kT\204@\321\252\202j\242\352\365\366FZZ:\366\272#\323\017\2666U\240v\252\236S\332\011\001\361p", 7000, "W\200\361\034j\376\022\254\325\205\257|\232\255w/0\373\267n~\355u_\331\007\242jXi\034E\254\032S\205\034/\023i\356\310\250\226\3517\201\311\360\237\201\221O\267w\355`\366\217\257\006z\357\321", 64 }, + { "bg\316Zg(\330\371\016:\011^\202\000\235f", 16, "_\177\346\022\375\256%\310\347m\336p`_J\333\334\003\312k\254X,Z\361\372\303#\305q;\343&XT\316`\006\036\215\306\207\327\311\255(\203/", 7000, "\313\000\3670T+\346TF\365[6\223rBb\241\267_\035\321y\315o\255\321\035\361\230\371\230\015\264\347y\364'\376-\240yL\036\260\265\234\265n.\217\312\261a\234\032\227\257\207a\331\354\010\263X", 64 }, + { "\350\026px{\014~\0317\015\314\231h\336\237\217", 16, "\347A\307^u\267Qc\027\235j\323\012\315\311\031\234\2003R'\015\221\370\030\227\003)h\214\236\012Qok\210`\320\227\307\354\303\305\317\314~|\014Z\012WA\036M\322I", 7000, "\227|\356\271\333\257\235G", 16, "\311\372\032x.?\3452L\331*\235\356\356\261sY\313\266\260\014\202\333\016\006\322j\3516\007U\377\215p\177s\267&\010\352\010A\361\315\357\0103k\220\311\042\250\267\022\312\030\034>\343\250\320\300\002\0123i\361\025~V\037\273\277\322\272sI\375m\375\337(\345*\220\362w\231\373\315y\230\273l3\017\226\260`", 64 }, + { ",<\361\027\343\375\355\265O\264\234[w5\261\340", 16, "dS:\242\350\2612,\314\224}\367\361kW\335+Gj\357Q\355\251i@\326r\024K\346\034B\340\360\242\356\016\272\216m\232u\220\300\236\333\312\363\036\241(\322&\244\211=\275\376\006.\377\013\034\220\020\306\353\274\374\042[\300", 7000, "\277\364m'[]\305CMd`\345G\237\352\371\225\215\373j>V\362\241!\364l\033<\236\364O\023\276?n\231\207\3735\201r\270\305\337\177'b\031\014\251\213\217mZ\320\266O\211\364&\0304x", 64 }, + { "\225\306\272{\341v\275 [\231\230\317\371\363Je", 16, "\343\036pA\252Q\264\242", 8000, "sJ\331\240\3206G\226\015\2441\370e\317\012u\356\372V>}\251l\1340\033U\177\215\316\317\037v\226\016\272O\275Z\341\307\370\317q\311\010\332\304\012a\375\343y\336ZT\377-2\361\203 \042\336", 64 }, + { "\320\231-\337g\034\212\004\342\037QU:X\277\316", 16, "\216k\037\361.T\244\366\003\010E\323U\233v\240", 8000, "\021\375\214G\326\017\316\350\013*\236-\013\026S\223\310,d\036L\311\032CM\006\0352\241\232\000\342\224\025x:\215S\2146wvh\205\306-[p2\003\322M\224\353\237\263/\216\134`Z8\273_", 64 }, + { "*/E\206\367\224\243\334\243\262r\326\360\231*H", 16, "\345\315t\032\021\207@\026\330=HF\320\204\304\330!\232Om\322\246\0260", 8000, "\200\306R\350\230V\334N\020\001Ol\242\024yN:\350\241\332\214\262\016\2629V\264(\2059\220\326b\340\303\020h\232gb\202ZCiR\275z\347+\326\267\027+A\246!\345\206k6\344\255\264*", 64 }, + { "S\345P\373\311\016\352\202\352`)Ecl\336\361", 16, "\376\007\354p2\333q\006\237q%\037\220/,\007\264\366\006-\335\273\235\377\036\345\035:\351\042k<", 8000, "\204\256G\244\332\302{GC\274\335x\200\216\001\232\211>\263\211\360\032\031\267\236\317\257\211\273\031u?.M\022\014\220!\202\225\310_VC)L\001\323\362\014\231\341\244\350\222\022\243\361t\364\357\316G\257", 64 }, + { "F\042a\201rU \373\374e\273\351=\364w\222", 16, "\212\030=]!}o\373VP\036\303\376/\373\322\025\222n\234\300Rl\264\010\2311(Y\275\232\3137\013i>\327\233)\207", 8000, "\233\276*\331\257\377\012\270|\212\272\2466cAh\225\024\334\2332\026\177\330'\006\210\210V\277\323\251\211\230\212\363W\2258y\224\236=9\337(]\010\3171N\342\016.Cjm\322Y\356\26574\207\332\355^\351f\0258\343\267w\361B", 64 }, + { "\305?\017\233\177\271m4\354\221@\216j\376%_", 16, "_,H\223\264<\314\342", 9000, "\236\314\367\273Z6(]M\214\215U\254\264\325Gb\24793\042l66\014g\317\342a\236\317\251\254CaS\326![\210\303\323\202\032f\014M\247\034w\225a\220\303\332\024L\317M\324\022\023\206\316", 64 }, + { "?0`\205\22034\220\217B\361\242\217+'\022", 16, "\177\315\237t\250\213S\313\337\265\337\371]l8\026", 9000, "\377n\327S\215\306\365\346\375Gj\247\245e\2004\343\202\221^_\275}\323\2345\302\007\333\337p\353\265\222\350t\227g\356\032\272G't\242r3V\276\362Lf\222\016\244Ez\200\315\247\370B|\372", 64 }, + { "\306$\211\276,\353}W.\355\274\330\215Ay\346", 16, "\330\362\015\255\012+e\264\241.\036#\377\327\001\011\205\254i;[P\223\363", 9000, "\204\003\342\235\365\213\361\303\3248_\324\346\330RpT4\235J\0106j\263\032\2113bjHj\233\332\365oA\222\247s;\250\247\017\377U\354-f\005\277p\377\345\345&ILO05\232R\325\311", 64 }, + { "\257\364\250\253\267\304/\330\357ch\230xu]1", 16, "\247\336\344\240\322\251G\223\222\225P\370\322\311/\204f}\253\222\252\363y\214\346\016x\262&N_\002", 9000, "\262\003\321\0362H\220\310\344\306\265\020\373\300T3\2652+\252g\275\225\224\036\357\2050B?\375E\273\232\344\024\310\344Zh\004(%@e)\264\202\2022iAZ\030\210\033r\346\211\332x\363\023\032", 64 }, + { "\340\000\323\220e,\371U\242\254f\245\272\337\001\357", 16, "\215\306\001}9&\307\2221d\253\212q\236\3316G\005|\015\042\012\361+\005w\270\367\211\332N\026\331\037\250\014\212d\330\246", 9000, "\260\342\217\247s\321\350A\016\221\371\222W\304&<`\312c#\366\002\225\241fJ\033\211F\252\300\251Z\313\225q\202\036w\253\264\277+\361\256\235\354\300\203g\334qz\310[\022\326\212\223\314H\247Wg", 64 }, + { "\025[\275\212\134\0013L[|\034k\356Q\321\267", 16, "#YZ\033(t\272\257\363\262\134\225y\206zF\234rB\266\221\254\367\310\042\264\270\236\026\372#v\354\213\265\372\221\304-i\020\042\0107\344\253\3678", 9000, "E\267\177\372_&\305\201\215\351\335\007irx\302U\037\252\012q4\201U\356%\366m\245\202\373bqh\244;\271z\372l\2516u\267\004\013\246z\274F\021\312E\177\2159|\037\033C\340\351\332\353", 64 }, + { "\312\016\206\247\361E\252\245\001\033\031\234\227\246L\332", 16, "^S8\353\353\0307\031}\012\247}o\352@\027\217\200s\220\206c\320`D\270\232\275#\361\223\210ur\361%\003\034\3607\255E\016\271p\336\274\260Q\027\0136r\246\025\263", 9000, "\202d\317\362\315$\311J\377+\037\244V\342.\336\363Mx^\347\202\206Vm:\363[\3353\324\316\3403\012\357\351\364\221TN\340\275ALC\033mC\224\225\274\000{n>i\327\006\221p\360:\020", 64 }, + { "I-\350\031\2302\352\226OO\234*?me\030", 16, "\004'\254\034\206\216\214\277\213/\235\237\007\312K\347\034\361?\376\327C64w\313\300\004Z\226\207\303\363\0066\377\375=\341\371\207Aq\247V\237\024T\246\200X\342]\005\356\337\273\023tq\226\032\021\202", 9000, "\367\317\013/\030\210_\377\013k\366C\234s\237\011\212\330!.\016\263@\353\017\007\034\345B\212s\204\371q\336;\334\032\313E\324>\326e\344\304v\205\004\342\000\343v\025\346ZO\2243Y\264\366Z{", 64 }, + { "\237\234O\246\003\264m\356\326\201\266\313\345\227j\324", 16, "\027\016\205\250\331\027\275\260Q\032'\204\373j<\233N\251v\234\346T\250\270n\017\244\225\275\340\354\346LJ\376\2779\2311\311\312P\335\036\323\202h\255\254\376\261\350kO\3324\277\266\223\207Q\263\373\351&\0030\247\330lL9", 9000, "r\036\301q\371B\034\017/H\010>\242\326\247F\353\014\333:)9\353\261c\003\177\223\3277\250Sm\263\306\316\261\341\321\321\134\232b\312\235\014@\336l\330\3356\001nw>\363\015\210O!*{Z", 64 }, + { "\227\346\344\330,\020\250\376\033v\253F\236\207\374\245C\230\255&\277\300\310M", 24, "\333\256\034\031\307s\315'", 100, "\267@0\237\025s\217\307\3646\231O\246za\000\340\233Q\254$\277/=)M\250\213i\245\275t\333\322U\256S\025\030<\200fFkO\2528Y\272\243:\033\315\304\313\237\017\356\255\274\357m\323\215", 64 }, + { "\3410\3103\201\025\037\366'2\340N\277\256q\345Gc\020\036kH\373w", 24, "\302\330?\225\200d\3510\335\346\211\317\324\365\366*", 100, "FN\014\374\031a\240\212\202H\314\016\371|{\025\267\243\353r\257\365{35\134q\252\205\357]\317,Y\350G\206\365Tuf9\356\267\365S\371\332+\245f\332\213\371\320\215\215\300\242\243\216F\361-", 64 }, + { "\265\001\263W\336\011\274\204=\356p6\210\000\216k\216k\203\365>W\275k", 24, "\270\342\331\242\013|j\306\324$X\035R\365\326\242\307\036Z\321\303\357hi", 100, "\005\301\361qhJ\263\253\2069O\003\242E\333Z\014\003\274\336f\322De(\376\024T\336\250\2111T\270\320>\366\266\311P\177\234\264(\015Vd\260+ De[\0301}gzZ/\263\263ma", 64 }, + { "C\347\306\033\005#\201X+OL\177\310\360:\207'L\316B\325\264\324\264", 24, "\021\357\353jzG\377\235V\012u\262'\256\354:\007\343A-'{Z\204\204\226\321GbTP\270", 100, "\200GB\211ui\244\352\343Sj\207|\250\213\035\010[\335\312\345k)&a\035\363\213\371\217\212\317\364\031{]\355\315E\222@n\026\375k\357\004\3505\025\226w<\134\226\324\326\254\345$\322l\302\247", 64 }, + { "\236\030\042\231=f\332wq\260\342\364o\372S\374t^\343\027\374\006\002\024", 24, "\344\273\215\371\325wt\273n\225\221\020\263\214~\226\266\237\226\323w\026\313\327\377\201\022\226\356.7`C\362jR\217,\362.", 100, "\235\361\025\375f\302\004\271\274\003\354w\027\001f\034\246\323HME~<%\303I\037 \266\042\335PY\306\134<]\364\377\026\254d^a\327\275\012\134\223\027\265\277\177\035W\3347,d\362\250`\006\342", 64 }, + { "\035x\237%7I1\271N\370\236\340\214p\331\367@\355o\134\256\032\355\243", 24, "3w\231\014p'd\220\317\366[Kz\241\271\010\200u\225.E\277\313q\262\341\313\031\271\205\016\024\3616\021\345\030\254\367\314\312] \026\211\273fs", 100, "-\300\221\205rc1\013\374\370_xC\315\013Y\21477\320\202m(\345(%:\260\232\304\004\263\303\275\304\317D\376\245\331K\310\027\343\322\221q\200.Kp\206\311\231\306!a\240\203\324^)%\026", 64 }, + { "\023\366\263t\006\015l\264\316Gq\271\3468j\220\271\232\361\223tW\224\020", 24, "\365\367`yT7jO\360\247/;-K\241\031\227\034\211\251[\236S\015\035P\304\256\342E!q\205WJ\207\373\016\006\355`\235\367[~\300\264'\232\200u\241\234\210io", 100, "\271\034\330\262\216K\312\224\375\206\243\341{\372}\232\210R2H\032n\264\377J\021*\263\022\240\277i\242\356GS\302\243b\230@\034<\261\276\025\016\340EIt$;\347\221\024W\311\275R\254\272A\037", 64 }, + { "\373Oc{\307\313=\3414>\340\016\245\217jar]\035\307\252\010\031\025", 24, "kk\262\256\340\255Z\310\235\020\320_\032\345\260\243\352\202\321\301\246s\300)\3314FJ\267\361b\237\034*BrjY=z\336\300\344\370\371\035\227\334[5*\325\3152\233Z\022\302\3733Wr\012\005", 100, "\246\372\3420\204\346\034\314$wZT/\240\376d\252\354?\331y\225\037\252\374Ah.\304\3737\242\013K\351\035tH(\255\353\240\214\304\350\245s\273\326\265\340\300\253,\022/\311\223\024\3369\002{V", 64 }, + { "\201\012\000\332_\206`\206GD\336\346Gm\227j>\301Y\333\2658\354\001", 24, "\361\321\374qZ\346\016\307Xm(a\256\301\002\245\352\216\244/ca\247,\315V\017+H\004\355wmR\225Upz\373\217\333\206\337>\257\313\275\307\260\342PS\013\260\356\377\322\267e\027\250\030\262B\012\346Q\260\025C\311\317", 100, "\254\012\230\016\257A\017\210\264Z&\234\320\375BRb?\266\012\2509\222\355UgM\322Y^\321b\225\243\353\374\374\224\2545$q\030\030\370\332M\302\350\014F\023p\033\201\316\004\000\270b\016!)$", 64 }, + { "n( \210$O\004\366\207T\3158\361!\212\3606\317<\330G\250\260\272", 24, "\204+\330\321\244\030h\275", 200, "\353Ko\207&\357t\224\036\266ob\222)Cz\360#p\020E\357k\320\370\007R\375\311'\347\007\364p\340\341\275\220\341\260\032\316]-Rthu\206\202\255QY\251.\214\245\330\007\312\354@\375\204", 64 }, + { "'\273`n\012l\345{r4\347\264\223\376LW\311\363P_h\302\001C", 24, "\324\200pH\263\220\2615\305\341\371Gp:\323\322", 200, "\205-\343\243<\333\375na\337\314\271J\354S\300D7\011J\364\023?\2222\360\267\221\010Fr\256\366{\366\235\255\331K 1\370\307V\373\020o\363\367\036\226\004\246G\331o\321%\314\220\254\234\317\033", 64 }, + { "\345/\334G\221\360\212(\211i\247\012\215\223h(P\366\215\371\300w\336\274", 24, "o\341\236\363w\371x\217Y)\013\331\006\034\222\007\221oA\022\037\332\252-", 200, "os\235_H\326N\300\244\310\361o0\202j4\334YO \345#:/\227\042=$@\363h\212\365\376\277\34220\301\371\373\250\327\201\374\012!)_\001\346Y\2061\220\302e\323\004E\364\025\334Q", 64 }, + { "|fm*#\220r\246\343f\364\364\241\370P\313\315}\216x\303,\335w", 24, "\342\177\034\326\226\223Oo\035\214\227\361\305\316\314\307\323\223\353\271\303_\213^\337\017\204C\316\037t\345", 200, "\2571!\373\364\361]\225\332K\267\042\317\314\030\2360.\257\037H\215E\276I,\356\033\13411\267\335>;\226\254g\2532\024\323t\024\237\275\014\021\267\251\004\004\331o\305\036\256\221\234\242\210[\273\271", 64 }, + { "\315\3742x\230\331D\375G\256R\363g\316 \024Q\034\317C\271X\240K", 24, "<3~d\026V9\2178\224\202\324U\335\006%\270=\225^\001l\212\212UC\277\270\233r\211lR\300\275\223\275\300\346J", 200, "`[\366\233Zk==\042\033\211\322-r\354e6D\210\302\275\247\274\374\0266\203d\234\315\331\244\2671\226\014\336\243\350\216^\206\255\242\023ueK\017%CN\002t\300N\244\272?/s\243\200\327", 64 }, + { "v\313\001I\364\011(l\005=7\330\0012\000C@w\317\206\230\306\363\000", 24, " \300\300\271\3443iMC\254\301*%S\325\211\212Rw\350\3027N\233\237\334\3134\204\332\031HS\374\3749\214 \3503FN\367\002\030\312\351D", 200, "S\007a\011\031\231\366\371g\003@\3407\024\016\376yl\373M ksH\327=6\210Y\225Q\325(\2348\334\362E/w#\375\354qY5\324\356F\212\232:\033\231\306\235\302\321\330y\226\005\260X", 64 }, + { "\335\002\277\030F@\273\340E\000\300\304\372\322n\230\262\354\032\250/*\351\230", 24, "\270\207\0010\377\337\347\375\213\331q\315\033\371\253\012n\275\262D\267\226G\367\371P\213*xA!\364!J\342\2113\242\321:\205\203hF\015\315D\026\313\353[`\213`\374j", 200, "3\301\365]\214s%u\230\234\215e\331<.\347<\320T/\254\351\243huF\003dA\341\342\372\206\243\005\277\257\033\364\042[\200Y\326\017@\015\271R\225\035\330z\37523*\313\3347\027\226\325\355", 64 }, + { "C\325RQ/\246$:h\177\362\331\223\261\312\006\237%\326zY\375\033\341", 24, "\002d\2740-\177h\221\356\310\211B\036K/H\335\336X\326\324\3304\251D\365\377\234\220\375\325,`\003O?\340\276=1\246+\231\336\233\211\272\265\257K\036\316\333\204\223g\035\336s\347h\230\270f", 200, "[\037\344w\257\272\235\230\032\270\263xh\361\014\273\350:\273\201Z[\314W\254\224\222\364;z\303\372D:\022a\366\266\364U\3467\314\337\357\246su\014FO\240\030:\325\362ZA\363`\362\005q!", 64 }, + { "=e\0029fU\375,?\262\327\273+f\013\263\201\021\027N\026y\341\340", 24, "\312\204\344\332=f\0336\341\017\264#j\216\206\236k\022Z`B\242\355'Y\016\267h?F\270\213B0\245;\367f\363\246J\012\200\330y\230\200}\347$\243\343\216\032\037\006\271\214\322X\255\256\032\276\021%\263aM\264\252G", 200, "H)\352\343\007'}5\333\013:e\354\225zG\271\032\340~\262\351\261\177\004\227~\333I\363\301u\210S\252\231\340+R\271\336\317\027\354\351\364<\276\220\042a\373\320en\370\001\301\305\356\344\244\236,", 64 }, + { "\376\374`\300n\003\362\372\017\2253-\307\232\264a\351F\247\002\011\270\336\311", 24, "\023\265B\220\374\244\304\323", 300, "{\346'N\227\254\343\334b\323\220\316&\335\375\227\013\314K\214~E\374$n.Mi\337\223\326L\361\342\237\242\257D\207'#\237\373.\2729\363\005\003O\216\011\005$\261O\214\343\275(X\336]\317", 64 }, + { "\177\337\370\037J\313\252R\367\027-\303\274\322?(]\370\017_?\010\360a", 24, "~hCg\251\003\302}\372\2644,v\264q\251", 300, "\003\253\302X\215\255\034\206\337\272\327Z}\206\000\333\311\026\377T\336\347\315\341>\210gsS*\276@3(T\340\263#\325\327\335\027~\310\201;C\2723?\042\341R\346\247\273\355\344\002\300\341\314\245\345", 64 }, + { "mD\363\333\332\276\206\023\340y\331\010\326\322\331vHX\265:\277\042\350_", 24, "w\011\263\376{\016R3\025\013<\033\261\320\024\017\356)\371\235c\021\353\262", 300, "\304\010\302K\273#u\237\227\3135^\134\2743z\326F\265=}0#m\240@\303\020\356\373\042Xl\223^)\242\031\374\215\031T\316\020\203\255\273$\024\034h1\370\270;\276\277P\250k\252\352\232\371", 64 }, + { "Z\2556U\206\026\34258E\247BT\276%L\367\0119r\032\233L\272", 24, "8@\034\305j[D\015A\317!\227jgy\313D\315ZIu\367\266{@]\335\311}\351dC", 300, "\022\23418\340\022\235\005\024\016\010m\217\370\271\262\307z\325\003\237:a\216\255w\023y=#fx\323k\346\215\331\275\206YGw_\261\353\007", 64 }, + { "\247\005\202\025\315\206zP\360\241\134\036C<-\006\327\363\201q\251\002`\267", 24, "\271]\336\352\244%\215\020\330\3458\377\225\350\302\237\253\033\202\367\265\373\331\261o\250\031Q\374q\217\254\233o\230\375\236\327\333f", 300, " ~\303\251\370\211U\337,\237Ln}E\320.k\245\246i\234\202r\314\324MU\365\377v\3177\266nXT\002%\346<;\350\3354\262\330\275\303W\242\014\024UN\274Hd\210 W\244\222Fv", 64 }, + { "%\312/\275\212\305\002\376\340\362\311b\224\3203\012\317R\370]\336\204\260>", 24, "\343';\334\363\247E\332\354\203kj\3654>+_E\310\353~xO\202n\234\217\227\360\371\261\343\314E\331-\210\203\032]\177;)$~\333\367\313", 300, "\2553\037\301\022E\356\010\274\241\216\332\333\037!9X\374z\314\306T\345\274'Z\256\375\036\355HL\337Dw\276\235D\225\213\304\214\350\250\031\316\200B\317\320:\0253\233\233\025n\264\016Y\271\242\035\316", 64 }, + { "\273o\033\015`\0168\005\343\233[\262$q\314\315\246\011\036(\233\203\211'", 24, "Qsa\3029\213*\321F\261}\270\357\330\030\200\335\375'\261cT$\2101\303\035\253\024\267\240\246\377&\316\357\331\221\361nl\0327B\015[\332h\333\376\351\0258\232\203\321", 300, "\260<4h\346\217Q\237=\376N\213\261R\257\374@!&\300\311\027\263\346'\230\377\224\134\225\237\002vQu\006\033y\036D\357T\362\316\311.\321\271\207r8\304\035T\226\233\326\345,\327\361W\217\364", 64 }, + { "-\207,\240\261txU\001\360Q\213R3\332\236\037_7\016H\261d,", 24, ",U^\351\036\003\300?0&+'`\363\252j\202\270V\375\007\355DR^\032\011\237}B\304\031\267.[\266J\273]\325y\335\327\2555\201m\233\254\352A\315\214\337\022Q\270\330\367?\363A\021f", 300, "\220\326\330u\2268\305\223\255\2359\332\203\273F\203I~\012\232g\001\355jb\224\212\226\032\277\036z\326\0361\265\025[N\226\261$f\216\311\236X:.\366\036_\020:\247\004d\276_\276\237`\323=", 64 }, + { "\276\035\274eI\033\356\262M3\021I\315\006j\241T\025\216\342\246\223\035}", 24, "1\316\345\252\312\377\027_\302v+.\276[\002j\006\266\233\037\265UR\023\255\244o\263\333\276+\264s\336\304f'\250\377\003\300\006\320\006B\375\205\300\332\341p\241\223\254\024j\274\231\024:\003\276\233\232\006\011\201\220\356\257\257\361", 300, "\271\353O+ C\226\325Qu\362\201Cb\304)\014\367\001\376\243\027\360U\273\356Y\235\234\357\243\002a\210\324\017`\304F\317;\022\014\021Y\375?\356\343\253\306\371\006\330fdD\333O6\042\203\214\354", 64 }, + { "\342$\336\336[\306\001\033/\216\277\201\367\014\257\362\331\320\374\036\034\361\371N", 24, "\220F\317Y\0232\2022", 400, "\351\321\325*\035\023\026\377\273d.\016s\225\276\321.\330u\014V+\331Z\223\365\034\371\377\236^\203\213\240\375\220/\313P\024WS\331\034\251\347\220ux\231[$\334:x\014|\344\010\233U)\276\344", 64 }, + { "D\255;\367\374\305_\373\372\020$\201\275\3735p`S\330\333\246\271\316)", 24, "\300M\273:\024\362\017\002\247j\376#8\321\260\346", 400, "rW\235\326[\326(\001\223\221\340\316\006z Z$\217\321\372\3722\277\024\334\025I\252\374\134\232\342!\2111\351\323}^\324\217L\032\350n1\372>\311\001\323\3239\321\345i\262\323\013\014\262j \336", 64 }, + { "\200q\243(\134z\361\042cG\335'v\231\025X:\016\316\0170\342hH", 24, "!8\347\001?\220\313\251\3042\306\201\004l\012\356.\177\367~e\305\3269", 400, "\371\230\253b7m\177\266\325\344\350\375>!D\246b", 24, "\314\354\361@\255\027O\232\037\322w\032\316\356i\023\333\331\342n-\301Q\002\244\2328z\026\304$\372\366\260cc\310_S\236\241\237\304\212[\022'\365\226e\016_X\303\323\005'\374\010}O\336\242\321", 400, "\273\265\023\023\343\261\201\026t\300\270#E\336\012I8\300\271\011\016`\234\326\2417\015\311t\012\322\341\355T\335\254\217L\243\253\211\364\234d\222-\344\203\027o\342y1\305\266\261$\316\376\364\220\317I\267", 64 }, + { "\275\272\371\314\250`\370\331\324d(\227\364e\203!\014\322m\254kH\012\354", 24, "\2617\007\347\243\255u9\320\226\035d\341\311\344L\272\352\023\256\361\332\364\2700\014\247\331s]\234\223\223\210/\273V\364\335\015\032\267\357_\001q\310\367\260E\374!E\335\200\337\316sQ\205\023\240M\355\267\250\020{\207\254\231i", 400, "R\300\302\270\242\312\331\300\376P\201\353\0128\370\241o\233\316\260\030\222\303\322)\376\017>\007\011\005\222JPb\361\233\340)\036\352\242\035*>\373R\020\203\355\340\000\0212K8\311\240\266\134\347\351\216\326", 64 }, + { "\330\2011\262\366s\232\025\317~\260\312\237+J\202\020t?\134l\207\310\304", 24, "cE\245\266X\315\3545", 500, "\315\247\030\277\337=T\214\254\331&\364\374\030\246\000]\220\345\274\373k\243O\0234\006\210\2606\031\360y\205\226\221\212I\341\006\216M\206K\211\342\314s\343\327\316\353A]}z@b\0053\202\212R[", 64 }, + { "\250+>b\307\310\001\233\331\261o\360>\206\2733Dp\340y\017\372V\023", 24, "E\241\134\345\365\327\016\336D,\217\032\022E\233\262", 500, "O5\263\352\317g89k\247\351\020/\037\3033\370T7\304\256o\216\337\227\321\225\254hH\211G\316\224j^c\271?\340\036\003\177\001\205Y\303a3\376f \021\211\344q\362\255Q\341\264\244u\321", 64 }, + { "\2153$\257\243\042\257\230\3443\276Y\275\000\354^\363\317\342#\343\272~?", 24, ")\246LD\006}w(\243\307w\260\336\241\024w{O\237/\236\004\230\016", 500, "\304\373j\036\0062\302._\327q\002\302 \023~\367\007.TC,\206\177DX\275Y]\224\366\232\212\001U\207z\305\233\317\320\203\3543\353s\374\012\272q`]\333W\305\250E\336VG\223\343I\257", 64 }, + { "\224\302\305\230\315\313\231\243pxO_\014\374\342\256\237\231\356\330\215:\260S", 24, "\310D\2217\341\363\362\243&@$\221\340\320\266\213\236`LOy:'\300\244\314\212\302^Q\373\376", 500, "i\311\241\337\357s\333\356P+\023'\330\310\273\205D\354\233\343\310\306;\037\213N6\230\006\273\261H\272X\243\367\341t\234\035\263\2034{\203p\034\371gY\265^_\010\267\321~\272\34364\227\322\027", 64 }, + { "m#\277k\323P\307\256\351\316\020\370d\202\377\023P~l\024\201p\033\015", 24, "\366g\225\335\215\223\322\241\007\333\007Y\275\343\330\267\346\003\006\306q\332\317\355\355\377\373}\303i\3322\262\322\221\226\217\305\027\354", 500, "\351\011\202M\306\035&\257KE\357\361\3644\243^\272\346\024\375\267gK4\010y\013\021\361o\253\025\2719\267yk\374\261 [\010\036\360yP\311\351v\0252\236\270i\217\356\022\006\214\224k@L\343", 64 }, + { "\264\276S\014\276;\012]s|\330\273\223+\222\230\004j-\035u\260\336\364", 24, "\177\010jO\370\237\274\370J\333u\240\013\255\374\3621\342\013\240H\374l\372\225\016\266Vy\315\371\030*\024\231\302pLl\234\336\255\271T\001V\254\263", 500, "\225$\317\031\226?\314Cy\201\035-@<\030\252\205\014\245\231\277\271\013\317\375\260", 64 }, + { ".\373qW\226\272\303\354\235\374\302\320h\345\357\034\014\250\344\266\244\325\244\270", 24, "\240/%\223\314\333\316\363\361\034q\245\312\134]\254\263\267\255f\225\217\313\313!ax\035\273\264\272_\027\037\323c\253\271\372\246\013\361\305\364\014\016@-\310\361\233Tc(\015\014", 500, "\010\250\337\244J\255\022/\001\035M\334\2426i\327\255\012i\333\217Y4\250uG\007D\225:\276\344|\027(\311\302\307\321!!A\003\343y\202\247\267\253R\032\312Y\243\134\007\252\321\236\251\364\307\342\366", 64 }, + { "3\244\330\322\257\350\201\244$\032V\270\032\236T:YU\211U\265\327\262\355", 24, "\227o]\354 ;iq\224\345\203Z\231L9+\374\316\265\226\226{\375\377\204\007\223\274\273RH\244\134\243\224A\337W-k\362\372\317'\207\023\272\361\347\015\3371\344\334\226\277\215\277\237\351O\307\362}", 500, "I^J\373\327{\005\200L\373\304\022M\022\250J\253Iu`\345;/\023\325\362\001\032\367{B\017\366_\034a\257x\000\025}tA\347\332]#_\260\023\211{\301\310/@.&\272-\005\323\262\355", 64 }, + { "\343~<_Kd\253{\262\357W95\256\337n\325\336\357\257\260-\227\011", 24, "\251\014\025\254\015\257!\326\256@1\225Ay\027\311\313\204'#\230\306\254\036\324p\221e>\230{\373ZP\236\025\025\3610\001\313\002\275\315\204\263\332\315\342\003-\326\356\216[+\270g\255p%\224O\306\365\241H\262\001q\231\346", 500, "\307\204\357\347\320l\0328\015\373G\336\271\322h\326\034\245\301,G\215Jf\031\177\355fhtW\034g\266\316V\034\222\042\346U\253Ac\036\304g$1\004\244\245VP=41\313\200\272FJe\374", 64 }, + { ".\246\322\250\363\276\370\266\342\207\226\210p\366P\025FM\371\232\203*\036\303", 24, "m\221\370\307\016\020\374\317", 600, "\252D\266\320\035\2649\007=\003\326\355p\332;\021\277\360\200\255\033\313w\366}\201a\325\377A\033\365\321\320S\357G\241e\344\375)\0303E;\256\017 \031'\223\204\2630\027\253\225\354\305T\366\360\005", 64 }, + { "\277\010D\025\241\325\032%\235\032y2A;H\020\214\333\306\356j$", 64 }, + { "\002\261>m$`\016\02494\263\307\353\263\252r\006\356x\223\215\321\236\037", 24, ".\222M\266\201\371\370\375\214\134\223)\242\011\371\225\365Y\203*\365\275\252\037\262\315\024;\032\256SuK\275hn\231\233HN", 600, "q\223\223]O\3412\371D\304\246Z\277P\267\307\247\327\213\036$\223\234Q\021e\332u\004\240\254\316_\012\036!\230\213\233~=\233Ay/\313\010\204\207\220\312j*\016\324\347\042=\017\217Qn4\302", 64 }, + { "\216i\036Z\247\365\202\373\255\243\035o\301\221\013\3434*r\347\214\002\342T", 24, "F-\311\364o3?M\260\205\340:)\302.>#\203O\340\245@6\375\356\313X\267\302c0\014\325\261{\013\267\253\277\027W\254\004a\353\350\255b", 600, "Uq\242\257\354/\372\365\027\376\020\267#S\277\237\300\314t\021\234\370\034\320\206-\357T\272\370\204r\002ZAsX\356j}\012\2259\247\231\211<6-\372\027V8ZM]\200\2344\227\276q\033\322", 64 }, + { "g,R\261\255\355\242\315\344\302\207\312\216\326$&\246\352\351\004\230\372\357\342", 24, "\011\237\227\033\026b\224\320Z\340\2019r\220\367\304m\256%&&\3424zt!CY F\014\347\345v\255\230Se\372\021\242\203YH\277\262\213\301\327\267\314\036\205\0020$", 600, "\020*\217~@\030\030z\241\300Cf\230\362\037\343r\203\344A\304Z\223\2310\331X\377\365k\237\245'l\223\024\012`\345*\324?\310L\344!\270\340>\001 aL\220\001\221KD\235n9\333\362\227", 64 }, + { "-^[\305D\215\276\210\007\255\365\315\023\340\343\011\212_\340?\215(\221|", 24, "'(\221\177\261K\003\247;*\201=\251?\240\345\026U\225\252\355lg\342\310\021-\006\004\270-\256\340&\007e\304\042;]K\306b ;h\222d\353\277\030\332}\355\030\001\347o\375a:#\207\232", 600, "\213{K\321\232\301\253\312\037\324\340\2454\262\376J\335\210J\235\252\220\370-\004\042\134C\316\025\275Te\250\333\212\227\324\035\006\244c\273\004Mq2\276\373\005w'\212f\266u\010\320(\361\332\217W\000", 64 }, + { "E\223\025>\255\312\337\310X\234\377\032\243\275\366\347~QmZ\027\013\257l", 24, "\202\021:\372K\001\252\250\363`\260Lk\255\042^|m\312\370\200,Gv'\255\024\022<\357\346\002\016b\252\315,\303\374\247\326\324\352\254\322\250L\306;\315\311\374\264\042z\354\256\304\021BD\231%\236s\321n\236\251\022\006\262", 600, "T\024\252$\261\307\0362\033@Y92dA\366\341\204\33236\265\357\205\232\266\027oI\245J\272\233O\215\317\302\246\374Ko\204\270z\356\236\042\315\360\312l\231{\274\026\225\221\345\377\343MG\321\320", 64 }, + { "ew\357\210D\321\347\2421\315\323\264_\036\253\332^\253\325\271I\211\212\250", 24, "h5\202`\361F\354\312", 700, "o\325\241\254!\217\211\331~e\346{\211Z5\371+\353\334\134\034\207\213\243\270I\334\317S\312X\344\326y\217f\261\021\243\223\251\015h\022C\303\026\036\222E,\203\366G\362Sy`\3241\3205\262\265", 64 }, + { "\275\247\376Y\223o+\2440\255\024e\351\324_\203\206\326t\333\134\332J7", 24, "trXoC\241\333\350\3415x\210\356\307]\243", 700, "gyBJl\234\206\356:\023K\310gd\312\200\346\320\2479V\272\340\000\024J\316\362PI\271\263\202\022Yhs\302L1\234\037\267\200\312\3641\0171\265\217\215\205S6\243\222\300d5x9\306\275", 64 }, + { "\001\024\003\337\276\355UDd\202\271\302\262m\021\205b\021\234\3108\220\226\343", 24, "<\015&\212c@\264\015n4z\261\252>\355\025\231\363C\224\311n\313-", 700, "g\2301\253WQM\014\240kG#\037t\014gaF\007\234\317:\261|C=\344+\252)~*Pr_\037\376\013y,\377\376\344\2419\266J\227\260\2123\225s\344s\224(\204\024\344@\001c\255", 64 }, + { ">\030*\353\341\240\203\312r\031t\260\265\012\345\331\354\016\014}\306SI\351", 24, "Z\020\013K\254\006\0164\347J\264)O0^a\025T_(\243\025p\261\210j\203\260\233\026\263\360", 700, "\223\3078V\010{G\373\301\030Ea\340\335\315\251\237\257W&B@\022+yHu\2165Y\377p2\344\003\340\341\326f\134\262\267\253\037\300d\312\030t\030\324\211\032Y\255\257T\237K\332\220\310\307P", 64 }, + { "\374\310\024\302\321W\213\250C\252\275\336\024\341i''\022\373xg\007\247x", 24, "\3404>\007'\303\215\331\2719\357\362\010\2146Nf,\272\304Hd\226%\251\2659\252\336\224@\355\357W\024\322\265\341\355\226", 700, "\273\207\247\374n\350\247\030\2469m\313-'\204\200h\022\356\320\341\302\001%ON\343\244\316\227W\212\3252\317\234\366\275,\033\261}\325\350\341\207\203\306y\010\034{%z]r\350\206\201{\017\330|\031", 64 }, + { "\240+\274h}\2040K(f\267\320\015\265CC\337\226\200\335\032E2[", 24, "\240\266\274n\2077\260C\005\223\036\004\011]\322q^*3\276\235\226\320\027=\344$M^\227N\370\022\234\313\007Wk\366.\205\016\365\350\200\020\217E", 700, "\212\232\234:U\323\302L(\362\221\016[\270\266\001v3\253\225\340t{\016\226|EC2Jx\377\264hn6\331\266\014W\245\233\277m\020\353\245\023\221\016H\000|c\307\362P\027)5\323\0230\344", 64 }, + { "\030\307\267{\345\270MM\201\325\330:O\224f\313\005\311\325\310\210tJa\022\002\010\374\335S/\247\253\270\010-\205f\257?\330\234\032", 24, "\335I!\203\271D\364\336OF\220\225]! \362\013%Bsp\326\341\343\360K\267\267\367L\354\370@\371\035\227\225\360Z\205mx\276\371F\247P\344.\223\264\221x}\322\225!\346\350\256\2742\253\265C\367\377\022\036;\017P", 700, "(\036gv\030n\0139/\250P\272\313\230\351\226\211\363\237\312Y\037\272\311\265=\351\343\305\374_\246\235A\264YD\304\334\202K>\037\274\336)\301%\366\242\246D\324\134A\303\2414\276*\031Y\376\357", 64 }, + { "#\0427\244K\257\006l\005*\256m~8+\317\373\325x`\224.\320\221", 24, "\261f\203\226F\362\245\334", 800, "\267c\357A}cz\243\206\233+\230\256=\203\034H\007[\32169\375\366\322J=hG\336o60\336{\244\037\2775\326\243\213\320)\337\003\370\323Q\232\242A\306ZRT\016\242\242\350\372\015\220\260", 64 }, + { "\347\377\324\375\314\303n\375%,\010\336{\375\3320\227\344\2662\0024\325\365", 24, "\361\311\366\227\314\275\335}\213\1773o\371\231\357K", 800, "\273\267\010\210e`\307P\264k\012\345K\247\362\367\033\310=\000\225\035V\220\312\213X\314\341\273|9\325\275\304\241m\012EI\271\302\2747\331A~\177\032#\233\376\353]N\301\365^Mh\272.+\260", 64 }, + { "\357\2528\231\262a\032ZJm\3157\260\331<[\232\27441\372\310\267\036", 24, "l\001\255\324\355\0220\246E\206G-~-\333\004\331Y\026\363\303R\010\324", 800, "\246\354\213\206<\223h\204\367\333W\021!2G\376\014:\373\013\327m\225\227\336\250\342\221\310\321\363\253z\354\022uk\342\177\302\213F\3758\021\341mgESmN\257\356\014\276\344ju\372\332\361\014\011", 64 }, + { "u\267\0421[S\023km]\353\002\364\331~J\3503\376Ay\335L\012", 24, "\352\204\321\301fO\005\370g\003m\307\304\344\354:\030\244\216\215\026\331\262\2267\223\3655qX\252x", 800, "\011\254b\343o*\216\240Dp\215\015A!.E0", 800, "\375\240\241\236\314\214\274}\266\250\225p\024zo\012\354\220\377#_\210\001\301\343KG2\362\312B\335\331\304L\224\205\267o\320E\305\233G\021\031\2726iE\267\257E\217\310\313\247\312\232\200p`\266\375", 64 }, + { "\255\032\237A_\223m\000!7E\226\354wSZ \375\207\316\2177d\031", 24, "\324\234\005\333;6(\316k9\134\271r_\035p%\350Rm6\2418\025\204vv\212b$\321\027\314\250_\3478\233y\303\301\370\016\200\301IZ\316", 800, "\316\312\267%f\212!y0\237 \243\207\371\274\321\134\274!\327\362\004\014\210D\250\232\307PbslaL:\252\262\201#\315<\220\232\275\273\246G\311\333/\032p;D\253\235\2401b\016\224\215\134\341", 64 }, + { "z\006\205PE\271u\361w$g\362u'\134\013\240U\303\0055\305!U", 24, "\0279\275\233\304 \031Fb\231\224\204\276\203\021\011kM@\341\223\236+ \262q\337\212\376\222\3471\243\3615\333\247\340`7\004\3137'\263\231\302\327\3253\353\326VP[\263", 800, "\011\253 \313\264\371\333\363\017o3(F\001\234\207\243\263\376G)Y>x\271\332`\270!\250I\375V\300$\000C\206}v\345{\247\257\314\276\017*\365%\332\374\242\242\343\271\243\210D\200{+\254;", 64 }, + { "\367\212\237\347\371`\021\024\317\363m\366\226P\240\271~\353l\015\204[\350\306", 24, "B\343\221\021\345\275\004\353ZB\274\223t7\313:\233\255\233\363\361\351\014\315\314\325\343^\370\301S\012\212\317>%\022\023\210\352<2(\224\311\312\027\232\327:\227\214\230\363\023\037\337.\024\010\372\317h\023", 800, "\327\304K\020\214\277B\366\002\330C:n\353t\334fXe\351P\033\032\311M+`\320/r\265!\301B\231\350`\001\013\311c?\220\333\326\202\216\243\365\245^\245j\377\372\210\307\272\303\342\216\370\210\355", 64 }, + { "\212\264Q\307\376[/\236\013n\346\243\030\322\026\321\205\216\324\214\360=\370}", 24, "\202e\341xV\033\272\236\340\342\216:\016\2516y2G\267D\211\375!\247I\342\021\277b\031P*\207\035P\205\244\235\311\310_2\346\023\354T\004\304\327.\332TR\312\346\034\212\302\251\134\005\310\016\004\200\257L|\205c\303\205", 800, "\220\242\272\200\024,\341E\312\361`\270\304\345\016\037\273\273\341\301\134\224\316\032\003\324$(\316\234o<\250\263?6\351\024\312\042d\373\366\320\036Pa\015'nX\213\033:\313N{i\134/s$=@", 64 }, + { "\274\322\370Z\025\306%\003\310\201(b\362P\000g\264\011\212\340{3\244\236", 24, "\256e\007,5\002=\262", 900, "\005\001w|\222\320\330\021\015P\305/k\244+(\002\366\277\207\243a\302\350\301\227;Mdc\250\024\370\006\311\007\226\302\037o\367Wg\377q?k\005\223u\021\036\375U\321@\363\232\317\363\225\177\3303", 64 }, + { "f\247\021,n\027\321:\311Y\243M\345.\204Qe\302\206\301(\205\031\235", 24, "\037^\213\344\352\177&\134\004\203\203{%&\027i", 900, "\253m\201\326M\344} \345K\2152,\245a\255\306'\265\353\216\011\217\004\207Y\271b\234\222\230m\016mu\340\231\035\235\215\3413:\004\332\015\310yR\260\023b\206\000\230\007\314\214\370 8\011\210\313", 64 }, + { "U\257m1\225~y\202\247\245\346\262\261&\252\253\261\375\022\303\247e\351\342\321\260\237\275L\220^)\3519\017\261\013\364\243\037\030\277\375MkIo\275y\004_j\241", 64 }, + { "\367B\325\214\226\364F9!\304<\320{\342kg\315I\315\023\316\372A\336", 24, "\240a\265\361\241\204\221O\347\345\026K2\336a\357\304\037F\311\341\276\216\343\360A\334\014E\317\265\203Ik\346]\317\031\272~\365\267ft\241\015\350GX\235\021\037;\024\033\354\2124J\337\377\304\203\250", 900, "\202\242\3013\2208U:\340\237\377\261,\312\016\251^\260\271l\324\213\034\311j4\011\236\254\360\251\341\347\310{H\017\320 }\232\274Jg{\217\324\257\363o\357\344\026\026G\277\310\004\242\235\263\357-\222", 64 }, + { "\016\270E&%\327f4\252\212>4r\344d\252\234\271'\254S\324\352\350", 24, "\375\306\361\014e1\036\264\033W\024j\367\214\265\027*\201\337\333\233\275y?\027\270~F\274\346dC\364w\211`L@\364PCo\257)#\346\343?)m(_k\252K\375\275\003\3456\376\2240\036\360\222\373C\265\217\322\251", 900, "\302\205\312\343Gl\252\336J7\013\234\355z\377E\3711U\311\204\213\332X07Z\222\333\017s\351k3\333\370\273\352\361nvB,w\315\202\214\327\367\351W\3560\350\377\016\2111\323\315Rd\360\241", 64 }, + { "X\241g:\042LD\026\033\305\2103\347%\313\222M%IxT\3311[", 24, "\354*\024\334zTk&", 1000, "TW\205I\026\261\327\304\271\241.\340\134\260\241U\257\312\000L\177\012\002\020c\266\333W\352q\331P\336\027\357\363j\356P\3036y\357\306.\361C\232\134\245[\366\203\213\307}r\255\350\324~\330J@", 64 }, + { "P\273\256\313\320\002{\007\246Q\235\261\314\225\325f+\265c\221f3\037|", 24, "\3772#\270\014I\036\251\274\343\270*\254r\244S", 64 }, + { "~\021+\245uZ\362\213\366\200\022\206\215\334\351NYt\355\377{\353m\027", 24, "\2447u\244\364\217\330\177\207zVy\210\026|h\302\255\343\012l\034W\235\214w\263\270\256\236\255\312\134j\272Z\350\134v\357", 1000, "\323\021P\223\322\235O\310\243\376\254\014W\021\250#\357\307'\305\362)z\177Y\177\354w\265\015qzf\333>\020G}\011\355\350O]\253<\221\251A\013\315:\023\201\267\010\210\372\277B6\241\244*\314", 64 }, + { "`\216\220\304\345\323\032\361\230\006\373k\0015w\247j2xL\303\242\021\301", 24, "\354\314=\001]\034\307\013\035\250P\231Pi&\031\205\203\027Y?\360\215nEQ\021\336\373\215\332O}h\264\207\253Ah\377\376a\264u\251\002z\252", 1000, "\321=R\262\037DS\377\205\222t\316\371\353\206\267\315\313\246\364\3673\010%\224\351\307z2\230\360\273\220\311aGp\2636\015l9\300\345\003\326r\356m\203Q\235\232O\227 \352\341\021{\267M;E", 64 }, + { "\354\004\006\232\301c\330+\321\346{\032\251+\226\274\273r\2126K\000\000\320", 24, "\244\371\011l\010r\042\231\366N\007\354\251\304\237\021\200\314\321d\330P\027Jgm\022NQ\015u\354\016\023s\363\0059\003x\243\366\361'\375s\330\266\310\334]\350\201\037\330\177", 1000, "\262\340\313\343-\0366\257\034\321\223hwX\317D\305h_\036\012\323\303\360(\016\014\351\244\256|;\031\316\355\317&\244\221\374Do\370\351\372\233\344\027\237x\225\212\032\026\321>\203\335{\263\343h\254\245", 64 }, + { "\306\321\026\304\337ii\326\313\346\326Vw\314&B=\233:\237?\221\201\353", 24, ")\344\304\012\2374O\241\033;\035\3024u\021\243\347\201\314\277u\304\210h\252\022\241\237y\031In&\3374\356\315b\214\004\277\370;\330~\237\335\262\275[\373\3121t\005',\211\201=I\321\216\334", 1000, "\376L\243\307O\223 ;d\203\232\017\217\324\246\260*=>\377\373z8\226\237\255\341\320\342Z\301\015m\363\005\201X\026\202\221\017\351\301\003M\366J\031\263\035\001{:\307R\026\356\367Ww\226\2106N", 64 }, + { "a\201~E\177k^\377\225\372\322\254\303%\007\300\327\315\250\025\257VA0", 24, "\270SB\012l\322\243\037q\035\317;\324\307\324\351\347\030]\245\265\366X\2650e\322e=P\205R4\344\245\227\221F\272\356\034&\323&\022m`z2\275\303\266:\207\212\213U:,\035\227I\275\347\257\023\211\206\211\324\377\364", 1000, "\224F\035\020\272\0235\366!5\234\200\355y^\042+\321\275nk\247\366\034#b\235o\214\277\020\375\344q\374\035\261\263\222\246TI\221 \240u\232[\214\346HB\221\322\003\377r\371wG\025\035y\345", 64 }, + { "(A\2328\302\034m\303m\265$2&\227\250\016Q\3779\275,\313\013h", 24, "\250\337%\227r\334&S", 2000, "\241}n\035\312\202l\273\322\352\272\252\212)\335\230\226\325\012\362eE\004\315\357\177\245'\022\0052\244\024\014\225\227\007\243As\277\251\351-\262\246u4\312Z\214\274\202O\376\324\262m\035\201\360*\343\006", 64 }, + { "\224\227\346\024\316\015\012\374\275#\026\307#\012\262Nr\313\353+ \216\372\032", 24, "t[\215\345V\325<\254\367\361\255\343\245\023\017C", 2000, "u-\242\357\275\260\2226\270\312\037\230\275\372rS\327\216l9\316Q\356\210\323\210E5@\217\347\036\032C\202)\033\230f<\227\023\256'o\233\247\006c\320j\244\341\020\134\177\313\177A\214\336\215\230\322", 64 }, + { "b\247o\224K\245\234t/\302\265\264>\310\225\024\015#\255\227>\225\022@", 24, "\211e\230C\273\3177\2211j\365\030\320\203H\255\017^\256\324S\212\266\372", 2000, "\302\004\0071\000\034\042\360R\205>\020.\016\334\042W\230c\250\222zs\337-\377\373r\333c\001\371\272z\363\0003'\362\202raS\244V\354\377\344\336$\201\336\322\372Uqy`>{B\021\234\030", 64 }, + { "\002,v\342\377\027yk\360b6]\032eS\242\353\011\353\204T\307\207\022", 24, "\236\177\303M\345\365\027T\017\323:\360\225z\271\361\220\265\017\300\273\030\223\2531U\316T\020)\225\375", 2000, "\340\214P\252yt\0126\301i\3054U\217\267\024\364\035\306\003\376!/\345\374?9\250\207,S\031K\276\223\257\364\346\367\241 &\256\271\314-:\272+n\367\023\272\311Y\346\004\225\315\016\236\205\306\350", 64 }, + { "\004\000\227\245\266\231UzT\033sW\240t\234\004\356\320xazQZ\033", 24, "\257\341\327r\023?z\022Y\205t\302{\252\341\027\341\333\260_d\030\206\354\367\026\302*M2\225\347\336N\253\251&Ad\276", 2000, "\353\364R\036\042\354w$=(^!\317\207\266\342\212\215\263\250+\307H#P\011\3448'\212'\030m\037V\021\212\375\3601\311B\233\361!9\036\2135\034\337\264T\331\346-k\222z6I;\303\360", 64 }, + { "\015\213l\014\376\305F\340\317\356[<8l\000\235L\361\327\3623\251,\032", 24, "\356~\011\332\242\011\203:\271\222\204xV\274#\0064\016\237\364[\377\231|j\031\336\272Q\007\331\371$\010\361\231\346\205\337\340U%\230\241\221\202f\267", 2000, "*\230O\020\204]\354H\245&VSOk\247\352Jd>\243\322\351(kX\302c\177UhS]\001hq\245K\320oB\201;\335 %\3164\256\024`\233\273\256\304\324\247\321\345|\023$?cJ", 64 }, + { "\203\371\026\261\020\021\004\370\246\244o\321\365\355j\004\200\367V\304>)\355\300", 24, "\260\347Jg9\373\303\270u\270\253\343C\300\336\010\307?\016bu\366<\334!\312\337v\240w\177[j\227\224AU'\037{\032\245\347n\343\011\370\342o)\214\354\265\236\234B", 2000, "G\345\0377\201\012\226\231\207F\224\006\035\236p9\303\365\3250\223\226>,\313\330d\317\237\312\3238BN.\257\0155h\377\034\236\331\223\037\307\3416\317]\203\302\252\356\234\230^\027\220\375|\0341\006", 64 }, + { "!\323\234\201\027.\265K1\243\334w\375W\367s\264\232]^\011\243'k", 24, "`C\241\225\020\3131\226V\311\257\355\361\313\326\304\003K\206\266\311L:\327'\370@\317U\300\027\207\012[\246h\247\004d Re\027\247\222\323\212\225\324\020v\252_\252\255\361\367\303\020(b\015\346\336", 2000, "\332\363\361a\364\375z\356\215\366N\256\330L\022H\2644\134I\362\373\310\212\213\262\326%\366\351`)\315\014\356a\266\037\352\262\236\365\326z)uU\374\364cq\307=\331\013\316\243\335\033{\273\244'c", 64 }, + { "\263\266\230s\247\032\243\235\271\203y\245\243\012\276\015\230C\230\262\213T\346", 24, "4GO\256\202.5\272\256\313\017\307\220\252\234E", 3000, "\223\021;\244\350D\254W\275\346\222\261N:\235\364\316N`V\307\134\004\037\005m\332\222J\324H\020^\325=\233\356\350'!\035^\245\025\263\022.\272\004\254\342\243?\010\011k\224\331\331\2322\336R\242", 64 }, + { "\237V\216}VW3\357\037qC\305\317\207\302\220\351\331\037\375L:\022 ", 24, "\336\277\323o\333\220q\304\274\313h\237|a\327\323\230\261(\371~\020\327d", 3000, "\211\017E*\360`\315\036-Q\374A^B\343\020\200y\034\177U7\340\260\371?U\221\323}\321\212\261\255\3411L\246\315\334\004%K\01749\207\341\027\313X\230v\300\032=\304\340\307\240\005cu\036", 64 }, + { "\277^\326\265S(\042\033\000\346Y\234M\000\310\025\344\3171\343\230\017s:", 24, "j\301\025\325\364\345h6p,\377h\322\372[\215\262\261\235{\355\352ae3:\042\337o^\270\226", 3000, "\367\314\334~\313\305\216R\375\313\317( W\2524\237\367t\006V\356l\270\305\025b\351\372\016\205\274\032yn\321\366B,Z\300\245\310\364\202\374\336y\325\015\221\342\343\223\254)\340GH\354\021\235u\354", 64 }, + { "oP\0024\027P6\376C\272\232\025\207\225\3616\361\26629\313\004\375$", 24, "\031r\357\216B\274\223?U\2367\002<&\2615Lj\012\276\303\327~\373\314\373\3762\010N\177\231\324\036n\334`\317\013\200", 3000, "&\322\212\306\227\365|H\226f\313\2425.p\030V\261j\350|\352\205:|L\316[\023\305\222`W\264\246-\232DO*+\343:\241\251\320\233\354\377\203\246\235S\027\341\250\316\327C<\226~\346o", 64 }, + { "O7\204\017\015\252\361\327R\030\367$\314\307\217\207\252\323\333\270\213\207]0", 24, "'\234\271/\326l\237\264-\337%\332\012n\372\276H\262\134\263\336\213\337\021M\234\321Q\227\333r\266\304XS\343\211\256T\322\303\234\211\260\241[\037\271", 3000, "_\203,Z\033\317!\350W\356\335\2426T\015IE\012s\331~\301D\012\374\306\235V\321p\340$\353\263\331\237(76I+\000P\342/\001N\345\313\241\214\377\333\377\360Z9}\3544\236\201\370\351", 64 }, + { "\244\350\3759f9f\300\002\015\214P\344\022\200\351[\134RvR\363\225~", 24, "\204\253i\244\217\223s=\217_\313\242\024<\252\241\3530\215,\212^\335S\257j\331\003DNLn\2414\035\017,p{\364\360\342U\032\254\007\021\036\256\345t\253\316M\021\254", 3000, "F\264\340\263\355%\367\007CHC\304!5o\030K^=\305\204P\305gIJ\274\177s\232?\341\000\364\014>\214n\236\004\363\250\323\324\211g\025\371\004Y\357c\351\033(O%\312\267\214\313\001\003\274", 64 }, + { " \373\314\232\000\2625\230_\303\350zD\210\252*\034\305\005\017\355\356\227\270", 24, "R)\032\244p\363 !9\274-\205\343'\231)X\346\025E\323r\032\357\024\020Fr@\013K\221M\376a\336$\024q1\310zU\031\271\274\325(\352\265\017\042\210\016\276\271]\330\252#\244X\261O", 3000, "\241\362\014\177\002\312\211G\001\312\001z5_3\207\232\300\227\245\201J\255\376n/\177(\371x<\303f$\353\210\014\232\232[\244\277h\353\341\022\320\325\002TF\352\037\264Tf\2676\370\271\321\363!\307", 64 }, + { "\333\025O\227@h\274\2608\237\300\004\377\223\022\320\341\312e\202`xN\263", 24, "a\042V\324\255~rU\355\206\366\202\005\354\002}w\033\215\266\010` \215\226-@\231\246\376\340\010\023\015\216)z\221\365\327\372\262\203\035j=5\265\243\242E\035n\036\014\0177\367\205\237\363\031\346\264!K\357Y\350d\375\373", 3000, "\003\242\243\204\364\011Z\213&\276\020\270\364\204\275&v\013\015?/d\352XM\302\306\371\242l\360\033/\247=\277c\331:\021OUK\262^l\270]qh\242\257b\213TJ4L1\364\366\253\201r", 64 }, + { "(n\026\312\205\343\005\033\363+;\013\305ww\340`ET\312*\2063\371", 24, "\327\336n\263\257uk\336", 4000, "Fj?_\352\260\304u^\354\210\205e\025_K\026\277\346Vrq(\224n\204\371\024\221\021dc\360\030z\270eu*\203\365\336p\32321\305w\347\245\265\337\212}S\302\247LR\377{\002\203\235", 64 }, + { "\275\277G\270\316\265\317Y\033\321\261\3341^\036)\235\253\253\274\014\227\327\374", 24, ":\311\227\357\355\353V\261iP\265L\354xr\262", 4000, "\021\332D\300\265\336P\356\226\215\014[=\000\234\027\224eX\022\260P\220\207\315\274~\030(e'\314\134\256KX\015\022\361`\315N7\021$\005\213\027\327\230\300\212\246\267\010UF\322}\260\276\006[\273", 64 }, + { "e\3241\366\225:\037\220p\032\242\346\364\341\237s\332\235+\033`\007\333\260$\241\007p\013j\007", 24, "q\326\233\230 \340\376\340\330\241\255\270}Qb\037\331L\363\243\021Fe\012\204\210\220 \246'e\323", 4000, "\233A\343!1\343\230\230\201Xu\272V\314L\330\204\217\301\265\376Ph\035s\321\253_\303\224\201\262M\350\365\375\302\325\217&D\234\314\320D\210S\370L\3674\217B\311\251\313\237\243\202)\030\022\307\336", 64 }, + { "\266\015\355@-\222\245\034\2232\353\327a\326[\223H>\212BBP\212\221", 24, "\207Q\350>\367*\313\020LH\353Ap\025/e\240\033\230\221=\367\325\243\326Bp\037KHzi\302\017\247\254\306\375@\346", 4000, "Ii\225\355?a\327\357\035d\007@`A\307M\214\027\304\205\376\343\2641.\325^\336\030g\275u\351\333_\205@Q2v\255\263\353O\243\006Q\243\303\031\252\252\036_\020\3739\202\307\177C\314{\271", 64 }, + { "\362\272&\200\012\014\365\001\341\023T\232,j\201\202\324\0042\256h\377L\250", 24, "=\013\254\322\351\270\307\341\322\310Y\262\211%\357\356\273\233\346'\265\277\350\313\342\263\244\017\361\005?\033\352\374+\305\244e\270\232$bB\375/k\355\316", 4000, "\222a\254\336Z1\3035)c\302\226\031v\216\345qr\234\247\211\134\004O\010\033\205\221YR\313\365\034`\244\276m8\204\255\217}\333\013p\017\307,\245\270\344~\037.\027@\243\3008\226\346\364\004^", 64 }, + { "g\027\243\247\030\210\246\017\355\022\306\212\347\226pup\007v\374H\261\006b", 24, "s\006v\241m\353\271\320{X]\346V\027\345\331\360\017\302\210\010\213\243\134\361`\235\306\265\036U\025\264\373T\373\324n\033\226\037\252\031\340s_xtA\310\335a|A\252\274", 4000, "l\247\361\333NE h\255\336\021\374\356\327}\347\314\347lZ\336\335\377\341\354\342\206\317\310\036\302G\2039-\374\005\027\204\313\304\340\334\032\032z{S\273\330\1772Q\220a\201\260\264\312\222\003\317\034U", 64 }, + { ":\243\340\307\302'\256\134\326\301W\356]\307\3327", 5000, "\205\254\255LW\275\210\264\205a\214\001\323\312\254\251\233%O\222!0\037\177\274:\212\357\354`\005\335W\254\265[\275>S\243s\225\032\341\313\214\321D\177*\246\001\366\005S\234\230\010\300\301\024\337\3777", 64 }, + { "i\347u\243(?];\2174p\027|w\252\232\374\252\031\360\013<\244\313", 24, "U\204\031A\265u\316;\325\340\215C\340\026\245\366\027V#\3607\320\223\315\352\364\316\240\020\276\034\342", 5000, "p\216\236P/^Q\034\303A/:C\012-V\363\242J\370\310\265\333b4\2267\177!pX:e\306\242(c\325\033\306\315\312B{\311\026\250k\026\257\207\217E\306\013\246>:@%\203\272\001A", 64 }, + { "#E2\2447&#\202\264\042-e\346\315\327\212S`\354\357T\373\374\356", 24, "}+\227\036\352<\035B\325jB\225\343w\237\034\206\255\235\260\233\336\204Sx\216\317\202\001\261\242wb\035\352\304\235D\221\267", 5000, "\242\246\366\007v\255\267\332>O\332\005\024)K>f\350\031\325)\224\236\277/j9\373w\375\224\207\327B\321\354\265!f\373\013\375\024o\3768\345c\351\202\305~\366\221\301\237\3504}\215\313\306aK", 64 }, + { "n\342f\266\256\206\242}}3\011Iw\350\264de\356\210\365.A\357I", 24, "\313\366\372-\305\017\251\134\366\265\2732\304\203\300\275\224\300\314ZKR\016\260\363\273\014\255\344\304kW\217\275\021\357\334*\342\022\243\312\303\265\016OM1", 5000, "9H\012\364@\023gk\224\324\007\340\017\215U\013\247(\006\007\305\335\006xAp\372\343\267\322\355\250\344#385;D\342\310Q\030\214\271b\275\265S\246A\020\247\030%\233,$C\267\334\036I\020", 64 }, + { "p\224\002t\321\207- x\331MZn\352\042*\220Cv\230\303\244u\233", 24, "DE.\236\2209#`\026\303\274.\352\300\310\230\216\032\216\214\307\254\024\253\317U\033b\327\3532\033\231\370\344<\376\013-\330\0032\260\264L\012\305\020\254\356N\375c\333\010\236", 5000, "\324\235\2268\20247\200[\222\042\315\006\244\002\207\367h\31422p\371\205\206Y\202\331\307V\227\210\024@\002q\226\225\345\305`iwI\274\334\373\310\345\330\271\226N\331\242\371g{\231\266\035F\330\263", 64 }, + { "I\2423\320\015(\222H\242\017\252\211\353\375Ja8\033\340\3765\314\322u", 24, "\346M\375k'| \307\351{\221\376\304T\026\0058)!\025\306\022\271\227\032G\254\200+\201\033\021e\032\334\002\301\317\201V\3658$\042\266\362\216i\217\266\021Y\312\017r-\354j9R\022\037\321)", 5000, "\224I\371i\265\005\262\257\262\253\373zV\250\240<\311\201\257\362\222UH\340\367\200Q\212\017\335\251J\020\002\341PB\202\030\022\017\277\032fT\256\013\266\355\227=\224!D\371\225\240J\215w\002\255>\300", 64 }, + { "\205\027X\235\021\3344\2458U\361\222k\375\353\370\226z\3140\321v\353\026", 24, "\254\365t\304\343\317\275\254\0273g\241\003\320C\326\264\034Ep\360\267\273\2332\210B'\222\210\303W\202\021\364\246\302\320\236\256#\3074\324\313\216V\231\242c*\003\2345l\0365\353n\347\276c^\366>\257\215\227\215-R\207", 5000, "\337F\336\013{\253\267\314\001wC\321\201G\344", 6000, "\226\341q(.\361\024R\272\037\201Z\202\300\271\002\216AM[g\263=\0039\034m\250pb\235_\205\3468A\007\213\276\366oK\273]\277k\010\011#\255\264V.)m\032_|\372x\230mnv", 64 }, + { ";\346\354\013\230\227\031F\357Nz\350\262\002\025\305\013\337\377\332\350\256\014\030", 24, "\222G\375\327\177$\353\274\353\357@\007\026\356\266\303\240\370\271\241h\241\003f\233\0061=U\264\177\320\311\312\334\036\031\025\275'\324\341QQ`\277A\347J|\012\3315\243\230\217", 6000, "\332\363q\304\333D\240\347\241\032i\333P\231b\271\344\317\024\355\314\301\267\316\021\237\321`\013\215\202l\365\330\311g\235\247\232\361\336\257\206,\321\317\330\006\253\233\302$T\357\324\035\241\0316\030\036(\204\251\331\376M^\2559.\225@\0110[j\201\350", 64 }, + { "7Y\231\310\325x\221\333\3057~t\254\265\325\335\247\326\227\363:\134\355\201", 24, "\340\341y\031.\267\217\264\012\020M\250\347\274l\311_\255\361o\232\260I\342", 7000, "\202\267\254}\0042\357\253\273\261\022\024H\020\203\013\032to}\347m\337\376\371$\250\255\321r\016\006\274\367\311\323\243^wsG\237Vw\004p]\325\261\365\027\356b\230\205\322L]\021\203\371\2709d", 64 }, + { "\177\335\200\3270AM\247Y\322\010*\234\035A\261C\366n\036>r`l", 24, "\214\014\337\257?\303=\024\240\307\343\00255#\326\0235\267\327K>\354\375\211\321b\021[i6>", 7000, "K\000\352K\222\245\260\275\361\361o\365\326\364\036\2770\207\331 \312LL\350c\006\226\247\014\217\217\261/;AP2N\327\343\013\246d@f\250-\364\304\013\002\314T\032\025\247\017\217c\366\003\305\037\362", 64 }, + { "\200s3/\021\217F\036\305x\321\206\215\004mk\314<\000\300\226(*\244", 24, "\247\250\3112z~\236L\327\215\003\367\022\244\217\201\373f\010$HE\221\026%w\326>\033\017\226\020\207G\367\352iL\322/", 7000, "\311\374\230\374$\026\042\360\254\307\307\252\207ZP\232\364", 24, "\207tG[%\035\246\377\337\325\331N\022~\365\236/\304\201\374\021@U\372] \226\375\037E8\007\254\354\370}5vZ\031\206`\366!\322\366\342^", 7000, "\245\210\355\305?\007\012\026-\377\272\025\2700\270\375T\332iM?\216$tT\216.}\356\005ExPe\005\262?\223\226,O'\365\000k\246E\202\021\213\324\035qRg'c\024'\200X\026\240o", 64 }, + { "\021\300\216*\364\017\360\1340\321\362\221`G\234W\363\333h\324\216b\217\307", 24, "+E\251\013\223\005\246S3R\255\016G`\212\214\246\352\012t\353\324\237\230\242\241c\227\021\374\316#\260\351\317\0252\243\007\002\346\026\237\023\216\3117\344S}.9\274\203h\371", 7000, "\362\315\306z\261\307\255\373\276u6\243\021\347\234C\370\206\306Bv\257\211\347\242", 7000, "\033\256\213\370\341\215jM\215\216\262\324d\007\316\365\227\371\2034\134\272\012\206h8\212\253Z\027\314\305\017z\371\010\216s\343\313\277{A\262>\312k\376`*d\300\360\2516\241:%aj\215\242\275\375", 64 }, + { "2\214\342\377V\332?\2433\233\177\347:\352\242\364\337\340\331X\237\257}6", 24, "\320\326\244\261\006:\026\037p\252$B\205\265\036`\362\327%w\241\271\317\367\004\026\215\364\260\023F\3245\220\276\367\347\260G&g$,\2219\015\177a\224\211\313\016\346\027+ \011\354\017`\026#>a\327\022\372\177|_\023\231", 7000, "\332\3414\351\013\042V\243\371\033\321o\023\023m7T^\220X\343\300H\010\306a\307+9\326\315\323\226\032\205\030\024b\371\365j\220n\014\312\024\003p\345X\017\341=\321\304\205\340Q\300\362`\307\314\365", 64 }, + { "55v.A\333M\011\253\244\245\331H\317t\353\235\243\306\200\307\241\330d", 24, "\301\032\244\327Z\351#\344", 8000, ">\334a\343\370\316\221c\363\253\306\042\325\007\310UU\351g\340|&\203l\034Q*\36754\206\134\264<\341q\342\332bg\014\000\301}yR:pI\342\301\343\250x\232p.\373\211\033o\016\015\300", 64 }, + { "u\034\247\2249\312\031?K\134\367\227\373\015w\005\303v\375\311\227Y\264P", 24, "\347\374w\031d0O\321\342+\036q\026\015+L", 8000, "\000\307\323\245\336\306|\361i\245\221\003\013Mn\233\211\227\230=\272\211Ybv.\007\256\244u\364\350\201k\274RA\022\327\212\325\234Or\0137gx\340$\365`\355\255\3310r\205CF\246\3554\003", 64 }, + { ">\372\324z\264\3456\210u\275\205\315\302%$\323\023\204.\245\305O\266\215", 24, "\210\036\242\335\310\002\367\363\365\034\003\030\207\017\007\022m\0369Z\322\032\272\213", 8000, "wO\311(\236\027@\354\006YJ\353\207~\360\237`Y\316\242\247\307uz)\307\023\267\262\340\007\307u\2256\0220\347\1774\274\042\271M\335\026D\342`\356\004\255\2702\21587\0270\346\310\231\303\215", 64 }, + { "\205\015pw\204\330\315l\327UI\003\134\005\033j!\202\007M9\030\017\257", 24, "\243\006_`Ge\333\270\232\361\256\305\266\204\351\231\232\310k\230}\035\225oh,F \177\213\3508", 8000, "|\206d\356K\204\337\023\357\324\325\377U\314\343\001\177Q{m\277Y\3232\347Z\264\343\032b\367\337\204\347\237\340\220\000\005\240\015\256\207\240\266\020{#p\216Kd\031\245\266\237\366\327\003\352\20096\270", 64 }, + { "\234\317\267X\261\316p\305\317\270\037\223\364s`)\266\360\255\372Cx\034\344", 24, "\037*ZQG\262z\310\302\331\247\036\355\331S\227\271\245\240=K\342\360}\015o\376\275\353\370v\326\011\352\366\011\035\346t\315", 8000, "X\246h\312\331\270l\217;7\371z\357\213}\021\200`\035\335\277S\211#\024\257\253\367\270$\306\334\346\236e\030r\031\356Z\314\340_\237\242\025\134\314z\360\216\020\337\205\272z\314\036L\216Y\217G>", 64 }, + { "\216\336\334\260\010\376\034\330\025Ilx\217\376+\341?A\303\320\212)\242[", 24, "\002\257\245\0163\344\244v\375\344\023\272\244;\353\242\371|\010H\337(\200ut\252\252W\260\256\355\251\244|\013H\257\350P\003\210\330Ji\026\361\230\313", 8000, "H\320\325\372\034/\365\265\000Z\356\250\353{\205\202\247\006\313|I\032\013+F\373\270\134S\015\036\3443\240\376\334\3018\3343h^\344\200\243\312Nk\264,\302K\365\267\315\346y\030!\020\313\373\241\272", 64 }, + { "\364[\025a\015\244\351\226\361\277\362RnY\016Vg\011\004\032\0243V\334", 24, "\303\035t\266\010\251('\331\304\035\276E2\030\216\305\330\026\3153\271\227szf\361\307Jg\217\003\200.\031\034ga{\247\042\021VG\262\216\264t\015\006\014\232\236\300\335\360", 8000, "\373Ng\266cw\232\023\340\345\134(\241\223\330\251P*.\251p\023I\216\222\016s\274\2610\2719-QX\017s'\364\367\203[z;\321\275\367N]\016\205\216\032\246\351\013\014\230u:a!\340\344", 64 }, + { "\036-\324\033\321\251\200\377\035C\2173\352\252);\211\025\316\215\375\214w\215", 24, "\300\007\353\005\230\026\313\261\017\376~\245\312\375R\275\336UpX\223\261R\321\012\257\305\361\354\305y\016[P\026\302\367\203\210\222\320\267\341A\374\323Lk\237\360\277\303\226v\214\362\372\303\363\2325\032Y\216", 8000, "G\277\034+\204mQ\037Jh\3735M\226yb\271T\333\216\320\233+\3414.\010\243\335\030vR\223r*\272O\263\222\310\204\366\266)\037\012o\344\333#\027\260\037\300F\010f\336\236\236\367\203\213\222", 64 }, + { "\266c\307\213\340;\202\254\364tO\370\023\221\332\006w3Q\352d\224\000a", 24, "p\035\261\247\274*,[\341\236\263\237,\272\361\301\232\301w\203\023\024}\265]\313E\203g\364\247o\005\134Az_\007G\007\010\220;\326RR\216\262\025\200\255\262>\330\321\276\316\331\356\310\334(\241e\345D\263\330Gx\324\325", 8000, "\253h\230\377\267\373 \214\322-\273\273~\336\356\177\024\205\277\240\277[\227\023\332\316\315\374\000\272\351\357Z\011\021\300\377\371\376o\223\336\235\312\021U\330\257mz\250N\206\210jB\134m%\276/o\357\354", 64 }, + { "\245\221f\320]\012k\303\031\336Wr\336'kl%\250\3559=\266P\274", 24, "\243 \351Hp\230\003\351", 9000, "Z0\012\276\353\351\232\246\223\035\333\243S\367\365\272\376;\035\314\004HG\030\213\275yU\355\005'\341\134\002O\014\310\134\21217\020\011\317\311\032\031\317\355/=h\201N\305\243\232\300\354\342\005\206\216\200", 64 }, + { "K\213x;{\306\322N-=\201\352v\366\255\013\005\012\221\2142\336\014\300", 24, "\200>\242~\026\241\226\204\221\351\213\303\223\237*\345", 9000, "\273\325T\251\032q\370\2077\310\220FF9e\204\342\226\374\247BP\370_\273\024%\314r/Y\270\231\343\323\353A{r\334\013$\315\224-\226\272\276\244x\337\220d*H\021G\307\271\347\251\304\360a", 64 }, + { "X8\022-Z\303\263\357\3236\371-\322\352\212}\226xVF\200KH\271", 24, "\352\321\241\333\217\016\012\344\245\240\216\017-\367\340\324\260i/\320\377{$Z", 9000, "\363\313A;\203\243u\267\276\002\327\036\2234\323\217o(k\372\333\023\240\221\300\254\2677\234\2040\300\350uv\327\371\262\215\272x'\213\274\010\021\034|\352\3338\353\273\027\272\265\376n\134\210r\300\006\247", 64 }, + { "\335y\005\355Q\326\204\360\222$g\356s\374o\200W\011\220\001\247\025'u", 24, "\035*\242\310`G,\244Q\372\256\301\305p\034\271)t4bW\2076\225\177y\335\322\317\245\256&", 9000, "f\326\017\227\016\302R\363\324\314\010\271\320U\341Y\222\370\265\277z\370\313\303TA\334b\371\226\254\264pq\336^D\330\134Q/n\324\320,`ay8\203-\035\223\351\301%3\032\355\217<\233\256\236", 64 }, + { " \250t\357\202 ;\3730`p\201\373k+r]\354;\370\244\030p?", 24, "\363\217\315\313~\351\231+$\215\216\362W\26569\223\027\300<\252\336=?\320\015t\333\004\265\316$'Z\010\337\032\300\356o", 9000, "\013\263\374\335\225\200S$\237\251\312#@\227@iE\373\364tpE_\342\203\204\364q\350\333\215\237\345\262n\217X\023\020`\257\327\257\236a\273\007\271\020\213`9\363:\011\240\014\257u\013B\302\365Z", 64 }, + { "\037\211\342J\233OL\256\313,\272\317E\355__\006\211\354\343)a\326\366", 24, "\3069v\303-\210\007`\270\242\024-\010\203d\242\210\250\347g\031\343\265}\035\317WY\2600n\342\263\317\300\010\007A\023\313\311\320\361Y\266\206\326\256", 9000, "\037\232\322\324l|\277\265I9\377\203-F\026`\202\206;f\256-6\312\374b\0152\016@p\017\374*\250\213\255i|\274.\326\364y\336}@\252\012\377D\202:LL\274'\010\222\304\265\360\324V", 64 }, + { ";I\027SS_\355\250\257M\025\034\252\332C*}=A{S\012\267\020", 24, "h\324z\036\2161^\373N\027iO\210.\344\361\370\213\300\274\204!q6\277rja\216tk\243\371#\353\201\272t\312j\206+L\005*fh\033?B\323K\213\300u\310", 9000, "\323\004\241\010\242'?&\207\347n\2659\262c\327\356\373Af{\363k\244u\315\271\257\215\002&#\350\244\253\345\004\362\245\341!\370\367\235L\324t\325V\232i\261\177\3241\010~\310\347z:\263\177\211", 64 }, + { "\331\363[@JRZ\206\223\334\330\027\234\035\3774\273l\316\322]\310\212`", 24, "\250\0109m\246\376;\177\2612T<\274\327\2363\344\324U\343\343\340\206%;\347()\364\322}?\376\214?\246\361\005#\273\020r\200\260\3608\335\217\017\202\212F7\202\325\353\323\367\305\034M\033\303{", 9000, "\205\373\010\365Z\241;\3701a\253D\025\351\374\254eX\244\037?u\372f\346\231g-t\274\325h\030\365X\363\322N\011@\270#\027\212\271\307\221\302\275(\033{\221\270^\264ku\017H\367H\201\002", 64 }, + { ".\354\201\342\256\244\227\276\215j(\026Va\3359\206l\377\020\253\376vu", 24, "\014\346\240i\217\206\263\300Aq\336\242;,,\240\035-\253\3070\367B\352\325\042\366\351\013\200\134\372\245\227u\233B\212\016\244.\021\362!\214\221\016%\224A\231\004f/\346\343|\007\3014K\334\015\2660\302\332\243\330\331\277\225", 9000, "?\341\377#\006\027\300O\217\020\267]\3708K\301b\177Flug\301\212T{\304\255>\260\357\266\2368\336^\134\326\335\0268\357\214\230R&&\372\223\315\212\374\341\320\234\224\203\017\310f\254\017\365\371", 64 }, + { "\035Uw\245\207fy\341\213Cf\313\250\356\333#\365\330\025\214V\365V\315C\301\312A;\265\324\333", 32, "\237\306\371M\211\275\020}", 100, "\277\325\220\301\016\372\256@NS\004\207\201\3778`\215_\211w%.\337\374\353\367\220Z\272\373\326]\275\224,^\036\311a\206\211\260\005\317U\0154\001\237\273\305\316\033uu\251Q\213z\351x\036\243\265", 64 }, + { "I\333\366\014@\0225Jgoz\373\270\002\020\037(\012\177V$\232\250(\264;\320\371!\324p\235", 32, "p\340\214\234\324\205\224\324\020h\221\357Ej\330J", 100, "\317]\000c\226\304\271\261\023h\365\3636ZV\016\353\356\222y4 \340\013\223\223\301\356<\004\234+\300\201V\230\370\375z(\177m\364\306\351\231s\254\360\227T\351ebLA\316\207\011\273\353n\323c", 64 }, + { "\342\206\301N\363g\353|\226Wd\356\240\3630,z\343\225\024\031\252a\275Jg\337\361\000\224_\273", 32, "F\342{{\365w\331/Pi,}$\303\260\344\265,\032\134r\362s?", 100, "A_o\223\300\360\016\264Z\223&\300D\2500\310\316U\347\004/\226\364\336\353\034\217\011](\237r\356hd\245\205k\037\252\042/n\241'eZ\316\310K\233\017{\247\234\303/\205,J\373l\362.", 64 }, + { "k\007z\262\2607\030\372\326\240\273\317\332\2406\031\203\014\211KOT\330H\001\356@\360:6\310\336", 32, "\301\261#\301\224\212~\323\326\237\037\202\036N\342\034\323\034\332\245s\002&n\035\265)kU\314+\244", 100, ":\276\200\342\261\1345\243N\265\304\334\375\364\323\371\304\213KB\336\372i$5\205\344\313\012.X\273\021\306n\222\025\224\207\321\365\265\333\304\363\225C\256Yf$\235\340d\026\027\207\216\267\006\361\030\353@", 64 }, + { "\212nj\377V\332\013\370O\246\366+\370\264\321V\252\246\341\232\000\250t\341\241y\217\2764\213\234\203", 32, "\210\370\011\356\265\343X\235\3101\255m],h\253[\347{\134B\360x\215\222\324\275=\212}\363\247\326\004m\034\003C\241t", 100, "pc\205\224\356\344\247b\310\251\222\224\357\315\277]\000\272/\303T'\371\336\221u\370\355*\264\226~L\357\004\237\345\215\236\224\310n\032n\345\357\347\204\231\2543\020\234\032\042'\014\361,o\134\305\2233", 64 }, + { "\227\222\262P\202\346\315\316\216#\250\032\346\007U\375-\317j\020<\220F\344\215X\234\004\374uM#", 32, "\215\215\254\311\351\001\253\313\331\364\304\315\032\276r6(\261\325\224\346 d\357\257\013\240T%\314\305\270\200\350\204\343\276\371\021\011\206\221(\310!+\034)", 100, "1W\302\356\244\310\375,&oW\334\355\230ipU/\026\236\352\250X\010p\335c$\032V=\375\316\037T&ja1{\225\262\177\313M\360Q\313\220\177M\307/.6\206\333\256@<[\331x\212", 64 }, + { "\016j\376}|\201\341\346\214\014}\023\353||\360K`\336\205\261\336\015J\243MP\341-Z\016\224", 32, "\013\350b=%\356\202\247\222\201\3362\222gr\331Lf\201\340=\365\002?>\011h\246\306C\361\274\306mK\002\005Z\230\267\372\0364\342\254<\032'\215FR\231\210re\035", 100, "Fr\342\330}\351*D4\314\003G\366\270z\016\345\233\241\331\225j\262\324\362o\016\306\205\272\333J\255\350G\001\365\225\2548c\202\036\275\353\375-\031\032\023m\220u\337\236\265f\357\033O\341\332\235\246", 64 }, + { "\037h\035C\201\200\227\347\245\205a\334g\343\330F\330\267\276\254\350\234=\317$\220e_?7\014\020", 32, "\363\34664\0316\003!\264\262\016C\225\026-\230(\363\007(R\347\013\014\012\304\244S\032\367\203\336x\251^\365\200\004G\354Vv\236\277S_2\363\260MU+\240\263p[\274\357\343\227\264TN\244", 100, "=\304\257c\200^\221\207\253\275\301\300\245\370\303\326Lt\026\235\337\334K\026B/&\0273\352q\024Pf\377\305\326\015\353\217~:\223bxyC\036/\021\134@\324,\337@O\024\356\252\352\314\001w", 64 }, + { "\350B\315\204\370D;A\224\200\004{,\202\302Ba\310=\214\012U\002\007\265h\007\262ou\251f\372\337\227\012\310\357\277\346\321\351\236?\310\303.\263\377`", 64 }, + { "\372\252\370u<\365\355\222\214g\324\027\302\020\214\357\013;\334A\042\331\227\267c\3001\035\215^\245\316", 32, "8Kt_\242\015\235\007d\013\376\241ml\211Bf\225k\357\226\031\042m", 200, "\214\323$\343\001&.\301\226\220\260R\263\253\207\226\321.\276E\233\267\351BW\230\365sc\273\034\005\342\006\033\2051\227*1\017\216\221\024\276Db\222\212Y\032\017X\333\320\210\177\356U\366\321\256\002\216", 64 }, + { "\203\000$\374>\2270*\334\000*\254(8\020o\311\213!\000\253q\333`r<\201IS\020\217\246", 32, "d\315\226\314\202\321\343\360\351\203\033\343\312\315\245\024x\351\274&\032\034\364m\241}\376}T\253]d", 200, "}1)\202\266\331\2179l!M\277\251\265=\3449\310\220\346\310w\330\210\026\305\251\375*\207\233\276s\277\273\202o\326wes\224\023\3222\223\365\304\375\371K\274\344t+S\314M\217d\320\221I'", 64 }, + { "\2519\015GJ\241\362a*\252\307\253B+\226\204\226\320\276TlW]xHr\244L\354<1\363", 32, "1\207\307\303\232\276\322\277\037}b\023\256\211A\371\333\220\217\342\216\304\011`\3450\270\207\343\365\277\311\301\351p\002\223\011\372\362", 200, "\354\034\351Z\226\347\033\212*\253\011X\355\254\336s\363\365\257]/\202\256c\305\203X>\251\027A\233\357s5\337\022wW\240A2\351\271v'D\376\205[\246\313\361\375\301\251\307c\202\365tf\000\305", 64 }, + { "+we\241*9\342\353\272\365\313\366\241\031\272\231R=\310#\372'\322s\014\253y\372ym\314\260", 32, "\230\327\217\225\203D\015\036\364D'2\042,\001&W\310\326*\375n\255\2530*\323\210~\203\361\234m\375\215\2151\342`\360\353\224\224\2510cW\260", 200, "\017\317\2567\134\357G\343 f\3122\011\377\334R<\365j\230\021_N\230\235\006\245\035\274\037-P\012P\225D\024\021Zy\256o\223\242\030\032Y\024\213z\265\012\374c\325\342\2735\370+\274\360&\020", 64 }, + { "\234T\251\237\350\325\232\3613\253\322p\252\327Y\212\213,\374\326\203\235\037\274\203\2665kO\025\356\012", 32, "\263Bg\330\260$a\243\027$\303M\2553\2347Qm^8\2041\011`\216@\013\011}\302%\352\360\316\352\370\003\220?\321F,\236\360\362F\327\350R@\327\247d\325\272I", 200, "\244\015\341\362\031\363\032!/\221\207\204\325\303\254xl=\267\373\336\357-\322\304o#\314\027Q\015G~\012\211l\314\265\3305T\005\247\324\000\2406vp\372t\352\204u\374O\347\032\010h\277[8\257", 64 }, + { "\257\330\002\330n\015\300\364\026\251V\016\3308\231\221\207m\003\024CL\271\251\364\324r\036\313[u&", 32, "\240\032\225W\314\311S\204\0351\027\177\361\367eO\224\260\214\274\266Yj\275#V\265\32533\244\00139m\356\256\363\312\221\015u\334\036r\205q\300\024\264\002\311\277Z\271\333\006a\326\206M\357\253B", 200, "\270\367\357\237\004\177T\024\266\332\342 g\261\336\024 \035\243\255a\336\2006Uq\217-\362\372\037S\301\314\314\327+n\252\235c\004\042\020f\311\337\177\211S\266]\346\033\210\244\254\377\333\305\314\007\355\311", 64 }, + { "\224!/\213\360\357\220!5,h\322LnTY\025{\334XqV\236qY\026A'`\021\364/", 32, "\247\213\203\223K\362\366\255\020\217\2265\222%\030T\265\313:SW\237Y\346\256\324\012\2358\235\257J\276\034\031a`\337\202\317\352Z\017\323\303 \264\042\016\015\012\253\004\264$i:F+\003\301\266)\270Im\234@\271\014\026\312", 200, "\207\261\336J\2314\262\330\025I\012\316}\354|\357\033t\006\361\326\333\232\031\325y\003K\277\3518\334\301\357\365\234\301.w\230K\256\201\266\350@~\340\222\310\014\376\355Fk\257x\242D\374\037gxU", 64 }, + { "_\005\231\003\225\334q\370mQ\321\252X\031\265=I\224{\343u)\217\201\370J?\364\013\315D\177", 32, "Q,\356e\355p\312\232\311\270O\333\024g\301vY\364\032\351\352Nw\320\247!\241\367\003\006", 64 }, + { "92\200 \224\243\3026Vp\376\270X,\300V\315\265\270$H`\262\324\271\337\320\253\367P\2525", 32, "\360\371\017\302\303~\016~\334\013(|S\017\315\2465\264\227\3060\334\014w6\235C\256I\346\022Z\012O\023\221\262\252\355\237\346\323F\3111>L.", 300, "\274\0251\006\345\321\275[id\316<\370{\026\210\350KjB\324,lS:\345O\263\301\355J\364\346\271/\3262\223j\347\231\245\234\022\241\254h\002\265\234J\275\2521V\325Xg)\215\300VFN", 64 }, + { "\224-3\372E\373y\366q6\375r\201\250\276\235\212\276R\275\347\317\331I\2572\031{k\354Sm", 32, "\335\213\324\011\243y'\302X`\317 \300nj\240\002\355\177\322\003\350\004\250\3265\333L\210\134\354\260\327Qty\007\033\337\350\234\216\340)\230/\321!|\361\2669\246\335\266\360", 300, "\240\270\256\340\027\016\010W\030L\305\234~\362\011C\234\022\267g\207\301\246p\216`\234>\245`0n\231\326\303\032\2464.\215\310\347\236\237i\220 \336i/\275q\315\205\034$Y\307\2310\326\276\252\224", 64 }, + { "\347w?8\316\356\356u\030FA\011cQ0\032\301{\322z\364\007\344\244P\003\312t\271\370\022g", 32, "\270\003\340}\246\274jA\267\033\366Z\275\177\227\331\205%v\323\260-\012\340\015?t\2752'i\302z\212\300\332\317\231\234\220\015\241\035\3523g\025\263\244\042y\340\274\322a\252\005\251\336:\275B\020E", 300, "v7\377au\016Z%\270\215\300\011\237\324S\021\207\014\357<\335-p\306\034\224\362Dn\331cK@Ji\354\217\324p\324\212\310\313Ho.\224\340\031/H\373*\335\033\357\253\037\222\204\234\265\037-", 64 }, + { "\255\002vG\234h\247N\257\033\370\323\353\003Z\352.\361\373!\003\304Z\374R\012\265\255K\273\223\005", 32, "\335'+\321\275\250\200\315\216I\235\253\307\266\310\357G\004\372\301\311\031\352y\004\247\252\277\325$-,\340\352j3\331\042\360S:}>\276\313:%N*\226\273\311\264\363W\217yBLK\225?\343W\020\360\261\347?\267\344\203", 300, "\212\336y\264\270\212\272\345y\231nX\323\343t\236|\334\370\346<\347\322[\013Z\036\200\267\333t\014\3361\347O\210\357\206\031?\314Q!\275\310)%_\325T9\376\204\260\241\223\003\363\334{K\360f", 64 }, + { "\257\324S\205\231\324\023n\317*\321\373\341\307p\302\300A\251\304\014\325\276&p=\307#\341\220\274\000", 32, "\203%ft\036\202Iv", 400, "5\213\375C\213\233\346\347\003\243\243\304\255\035\213xV\007\275\042\013\265\015\231\267\322\021~rZ\271\227~\010 T\277rS^\326\211\305\032]4\023G\224K%x\005\312\3131No\177\230O#\0423", 64 }, + { "\234$\001\017m\223\035\315\265X\360u&\202D&\321\020\216\334\261\236QA\302\004D\367R\302\255\341", 32, "\247\334\314\177\366|5\235\231h\323\217\332\364O\016", 400, ";\015\000\340\014\206\252\307\206\376\314v$\224x/\033g\027S\003\262\270\273bT\036\020\001!\261\003h\314u\003T\014\030\037V\202\005\327\216\324\213\336\020\303Le\3237B\012\374B\310\035\322\320\006\324", 64 }, + { "!B\007Pw^\277\024m\232\342jH\2722\376\326+?\3568\217WT\037\273\037\311\352\240\007\273", 32, "\374Vhd\263\246\255W\226\015\276h\241\253.\274*\012o\003D1\360\021", 400, "\0119\322\250\350\027\226G\260\203 \316\245\027[lV\313\005d6K/\217}L\353\337\273*\250]J~\223\320\266\331\225\222p\262\027\007\227DV\223\340\332\305|\211\303~N\211~\353U\340\324\261\042", 64 }, + { "`m\302\221<\360\306\306)\220)\2751sl\022\216\363\233*\257\000\251^m\006\261\367k\007\355?", 32, "\300_\016\250\265\234\3131\241\030\033L\253F\003B|\272\250\021\242z\235\011c\013\231ty\277M\027", 400, "Rb\332\252\340\0128\177\311\030p\330\0265\337\206\212\217\213\322c\240\370\200\016\370hC\012\026HB\275W\255l\316\354}\225\354M\310A(\307\372_\254\260mY\277\032\375F[{\323P\030\273\321.", 64 }, + { "\020\301r\264\274\330C\264`DH\360>V\370\005\234\013\270\273\223\234\02137\345\275{\042\326\236X", 32, "\274(\277C\310%D\305\035zk\212\360\020\324\324\223\212\234+\312$Y\221\250\006\357\325F>9\212\313n\250\2323\314\343 ", 400, "\276\012\347\225\301\271\344\223V\3001\004\212\033y\001\351\313vU\331\021C\036\360\343!\324\321%\222sh\221\232\313lo\3063\2471\354\335s\256\237.\241\267\323\247\261\340=\272\370c\276\336\134\214>\204", 64 }, + { "H\325\277\243\331\206\273\317R\005\324\030^,\370t\276j\0003\230~\370i\346\363!\223\273\244d\333", 32, "\367\241s\025\264\023%I\355:^XHr\003\230\177\331\245\347\025\372\234i\325\350-_\177\375\323\370#\320\332\320\311\241nED;\134\370:\012\026=", 400, "5\325\243\265{\033-\344\370u\020\1342B\017r\301\277\134+4\016\001+_T\367\354\012\325\311\257\023\200s \262[7jy,@\205\254\364\350\033\212\223\275\236\332o\031\350\026c\366%\377\272\333,", 64 }, + { "\012rD\010t\322\202\251\355\253W<\201J\363\312\206\323\337dN\244V\025zG\324\375\361\207RK", 32, "\207\227\350\201v\263\376\206\215\360\221\3046\022\217\002+\022[0\216G\225bQ)s\204\321,\225\352\256`!\250\333\216\364\217\30602i\017\262\013\352\326\301\250\022\244iLf", 400, "\034\033\242g\257\230{\316\363{U\253\0049\000\257\265\264\030\264\011E\320J1<\274)\201[c\252\323\266\353\222\022Jy\366\301\024\252\024m\272\261\307=\2047\371Ril\222/\230eL\003\325c\276", 64 }, + { "\207xrV%\324mBu\004\356\222\302;`T\347\0040\302\356\324\012\335\015#\324\330\214\335\221\205", 32, "\346)|\356\355q\266\340?\377\220\364\361\022\004\274eTvh>@\231\205\003\3354\234\001\337\260\031\225\3546C0i-\377\3657\021\340\354\225\352@\314\313\336\035\313\014\347\327\320\250\314\276\247#\356`", 400, "\341\017\177\253\177\265\002.\322\235\224\177\244$k\307H\245&fLi\354|u\241^^\0231#\300\317<\316\230\254\0302\264\134\011\016\275\356)\307\374\365\313\324\311\267\246\236\371Sl\366\327\254\333c!", 64 }, + { "\024\201\3045\325ty\362\270\271\253!\260hE4\220W\255\240\277\377\326\320\202\206t\264I\324\215\204", 32, "_\271\352z\017\375Q\326\256`\372g=\274\261c\367\033#\275\356\0242\315<\220[#\023\371\2636\3131\360:\324\375\242 mC\227\315\220\302\006#\204\273\011\252\245\002\026\030&_\241:T\215(\002\372\213\252\331lX\017\370", 400, "\242\304\265c@\230\004N\354\001\252\263\211\037\201\276-]\015g\365\204\323\252\355\272\3165iB\364\357HS\345\253\303+\006\251g]\370\323\204\267\346\031[#`\225\343\272\201\253Rxn\347l-\3050", 64 }, + { "A\316\347I\012\032\011\224\206\310LF}\377\212\035q.\031\206\241Tt\346\252\220(o\223\272\325\257", 32, "\011\025\200\201\221V\177\373", 500, "C\275\213\366A\324\330s\323\322\231\342\353\355F\226Z\253T| f\331\134\377\337K\325 ^[#\275\012\231\325\032\362S\371\027\312\223*\356\222\364\226\042\311\006\260s\360\236\034\253\310\357\365\265h\374\236", 64 }, + { "663\230\3430\362\027D#\210\010\013P\017\224>\020\005\216\272m\006\035\225\355Zly\221\005\223", 32, "\335\374\334\026Y\254Z\211\272\353\306L\354)\251\002", 500, "\022e\035\371\012\311q\335%W\011\312B\377\263=\376\214'\275}K\254\221R\205\321\212'X\221\354\337_e\327\362\372\323\320\311\300b\263\253\273\020\305\302\251\002\266\005|F\245g_?<\361\314P\201", 64 }, + { "\031\236|\263)\012v8?A\033\332\003\363\2020sLS\230&\353B\031\242\010\245=\027\217\037p", 32, "\012]\202\012\2107`\233\373\265r\217\234\273\213|M|\315\357Yue\327", 500, "g,v\236\024\021\267gL{\262\341\213\346\356B\250a\361\354\276\267-\313\201d\211[\001bu\314`T\036\134\212\022\330o\366_\254\3731\354\024Z\300\272\250>%Y&Y\354v\271K<\316\246H", 64 }, + { "\301\031\014\272\325+ \361B\361\360\204\343A\230\220l\221\017\337\250\316\134T\351\211\037eO\305.x", 32, "J\244-\214\267\363s8\302\242\237\204\351\274q\204\3478\227z\263\311u\312~\336\317\250\241\341\206q", 500, "\316\205\233\374\320\350\232\001\355\277E\227\230:\372q\230\024\373y\356\264\306F3\2551\320\246\275\025\036\206{\323\264\272f\276\330\1778\262?\235\204\363\363\261w\030\251\242\347}\002\305\223|)\340{\264\257", 64 }, + { "\364wG\247F\300\250\203\364rB\337\311\272Td\221\207\034\251\303\265\217\014\273P\034\377\342\254\363\037", 32, "\361\134\360\257\305\010\030w\345\030Y\244\236\002ge\324\326\340\276\022\362\335\353\366\362\205\307\020A\232\274\034\240\366\274\310C\242v", 500, "\260\311x\272\213L,\223\333U\363\022\355\366?\231Fr\227\025\253\321\203\025\013M(\033\300\302\226\256\272\344\370\217\034\256o\376\325[\004\035\007\004M\220\005\334y\234O\367\334wp\2750'\032y\306T", 64 }, + { "t\246\251p\322\247`B\337\225i\007\362\317\201\023\010\263H]\373\344\226\005\304^@z\226\210>\250", 32, "\315\310T\325\200ys9\324G\3320\034J\376\024\366\365\310\351\350\221\362\251u\372\334xiUD\205Q\247\206\276\232\204\015\2034\264\347x\303\270\375[", 500, ">F\372\306+\2150\024\263\031\340\226\215d\350\373!\237\272\263\340\362aBZ\354\263N\377!r\351\307\223\257\215\224\322\305\253j\016\201W\303\3706\177%\262$\212\334P\015uwj#\267\037(\254\204", 64 }, + { "\351\275\340\351\264\341\017\033f|\233\331pOK\277)\013\354\312\356\211\344@(\320\321\322,\367Z\212", 32, "\360\340\021bp\367\336\246\352\231\244.\232\370M\257\204\033/v\236\226I\215\033\243}#e\362\030>g\361\242'\334\220\177\003t\353<\370\023f\034\354\177\017\267\013\335\315\350\355", 500, "\001\266i\240c\265i\314\204Y\252!\335\042\373\211\332U\303(\273\304m\261\020l!\360\300\006\376j8\2547E\037+\242yO8\002\377]\256\245Q\032}R\343\311\344H\353/\227\3566\270V\263D", 64 }, + { "\217\025\363\021\024\006\013\355\005N2/\250-+\3704\354M\001t\245\000\233\361j\324:\340\266D\036", 32, "\177\226\351\134a]/i\247`\370\346\243\006Q8\302\211r\021gQb\006\244s\350\273\303\202\220\236\341:\372\026\335_\247f\203\254\303\010\231\035gG\252e\375 \326H\3469\270\014d\215\273{yw", 500, "\270\334>\273H\035}\215\322\350,\353r\212\020\362Hd\033\214\021g}\366\352\346\2725K\022K\217\220z\221n;M5\024\012\310\225Uv\377.\203\260\026W\351\000\263\003\266\017\202\324x\313~/\302", 64 }, + { "\214k\277\217\215\031\022\204\207\011_E\321BRrkE\020\015\375\223\367\346\370\013f2\306R\217\356", 32, "\307\337r\321\366\245\307A\013\015t\352\362\006?\245 \333\334\264f\260N\250\225\341\030J\334`#\263j\275\231WU8\366\203K\223\365X,\266?n(_v\347\303\305|\316\207\013\042\251\233\232\011\324\3714g\010#C\241\336", 500, "\007YI\203\310+\236\336\020\221YU\351\376\232\266DF@Y\006\226\242\256\270r\303eO'\366?+\323\032\225\345\320\015\227rsge\317\260\342jp\231\372\306nG\350Mx/\337f\2757\0121", 64 }, + { "\134\355\220\225k\203\013\271o\037N\364\237\343\352c\336:\335n0\213\247\365K\204A\253\005\205\211=", 32, "u\267\316\322\344I\327a", 600, "\263OO\366\217\232\213i\216se\234\231\2740!\311#\256~2\267\134\025\367\310\020\3541-T\223\227\025\010\276\212c~\265Sf1\200\017MO\002\006\352\374\316}\313\032\317\221\007\322]S\224jl", 64 }, + { "\014\274\263\346f\231?\005\223\3336\036u\301z\361\324\277\351\013\320\244\247_\365\315n\222\345s\023\134", 32, "\336I\3260\310g\341\234\3012\376\205\002\301f\311", 600, "\362\246 u\364\216c\037\232*\037\253\031\335\347\022[\007\256j\303O\225\270\204/\031E\244\253FdC\272\305\233i\343\357\327b\273\241j\243\261\321\255\345\304\365\363\337\277\222(&hL\325\361\011J\266", 64 }, + { "YC\314\276\211\370\003\272\320\325\232?v\203\001\274\2738qt\256\330\365\276Ad)\256$5\353v", 32, "g\346W\016*\233\311\344_\267D\346\261\322>\031\274J\300A:\355\232\330", 600, "\304\2457j\205\3131Z\021oA\234FI\254(O\026\334N\017\324\206\033_C\375\231$\314\270\212\245aV\035+\220GC\264\035@\241\231\0124\235\014<\334j\257d9\355\301(\236\226\210$\235\230", 64 }, + { "\207j\363\010\013\313\273v\326\270\265e\260\033\313\3237\211*tQ\366\215\216J\212\235\324 W\035\033", 32, "\303\374\023\372y\363\307\320(w\236\200H]\371\262\010\006\020\361M\030\346\222\361\216S!bc\3612", 600, "Y\301\037?z\341Y\350_\374@\210\324\274\014f\377\317\023\303lOh\032\253\035\332\217|\375.m\203\031\361^\320v\323^ s\031\347\215Z\012Zj\335\206\363\024:F\310\035\211\255\216\301\203\251M", 64 }, + { "\216PY\256\343yt=H\205\303\011\353\232\340\2630^\021\365\266\004r\001\307wV\251a3k\370", 32, "I\256\322\255atb\305@\004Z\352H\032\205\212\254\215", 32, "vU\273'/j`\351", 700, "\360\255\227x\024|z\360JY\364\273B\240\037+\027\376\346\207?\030A`K\216Ba\366\241^A\030n\027\363\225\301z]Y_e\012\273*0\222\274\242\313Q\003\201\336\034\210T\361\2268E\243\303", 64 }, + { "\352J\265\255z\256\252C\363\273\332\3044\351\214\311\012\2516~\226\355\225/\347T\264\260A\330\377\355", 32, "dv\016\032\340<\207.\260\037\354\234Csm\337", 700, "\360|\337\257\240\016)LW\230]\035T\016\001\256\252Ew\222\016\003{yE\025^A\274\377\346\265\370W\361\336`\352\0118~\241\356BW\272\315\260P\240\273\273v\322.P\322\301\177\033`\317\244\346", 64 }, + { "Q\026o\230\010\276b\336kNrzjJ\021D\302\364'\353'1\202\345\207\203\207\201\034\203\000\257", 32, "lwS\255\204\030M\357jIx\363\301\271q\304!r\215s\356\322\340$", 700, "Fx\263\350\210|\223Thrl\326\215A\366u\2168z\225U\255\314_v\020\017\314\025U\304S\023}N\021\363a\314\267G\2444\205C\200\011^Q\253{\216}[zfQG<\232\242r\314\334", 64 }, + { "Y+b\271\212\342\325\025\343\277\012\223\0121\243d\004\240\342<\205\013f0k\307\254\335\014e\364\261", 32, "\343j4%\254\352o \0116ksr)-\341\366\366P)\021\362\305\305\003T\204\302\317\312\313f", 700, "\016r\343>\207\376\003\177dw\037AN\262\334\017Y\236\374L\253<,\226\027d\317;\250`\216\326\334d\251\355\300i3eV\241Iy\220\001\356\035\364[\303\220:\242|eN\313\354\3039\3309\272", 64 }, + { "\354\261t\321\217\227\3512\321}N\214E\257\251~\006\014\372\200R\017\261\007\021\220\371\370@@P\222", 32, "\277\301+;*+3M\352\373\365\246\304\356\250nf\320-\241\325\244\306\357kXYX\325R/u\326*\277\265<\200\360\270", 700, "\265%\225}\007\257W\255.\306\000\201U>\271\330F*\253DD\317\021aj\374\223`3\367f;\026\010\342f\0150o\232\303\015\377\017\205\357%\277]\277\216m&\236\344\366\313?\373P\214\223\000\324", 64 }, + { "\310F\324\335\367\301A4\252\337\342\331\016\000\241V\341>\237\034C\204\301\276\255e\276q\341\3778\301", 32, "\214\222\134\343\224:\336\012B\323z\310\262\021\205\225\216<\313|\227L\267\024^s\316\257\014\2259\261\371tB\242\373\366\232\374\353\336[\343\026k\307\256", 700, "u:_q\370\012\235@\315X|\367\377C\217\353(\3051a\251\001\003\226\205\342\227\212\306\337$\274\201\212P\315\017\221\347\006\021\230\354\266\200.v\213\361'\320\227\331Wi\034\374\346)\332\273O\372\225", 64 }, + { "o\210\323\375q@\013U\011)\020\252TE\206\233\306\2058\324\371\354P\374?\212\235e;r\207\261", 32, "U[{7\230\215\213\276\344\336\223\322,P\214\360\205\007\202\276e\005\025H\2048\212\247Vq\232q\303\272r\273\001=\201\261\265I\311\266\323\206\203\207J\212\323\200A\375!\276", 700, "\211B\011\227\272\0275k\016\015\266\202B\0301\223\226@\037\005\377H#\302~B\020|\002\226\015\242C\342\273T\306\245\376\307\320I\301f\021f\316[_Q\356\210M!\271m\011p\027\361x\316\353]", 64 }, + { "\033\310\253\302A\013u\205\252\020.\233;\372vs\243\275\351 \015G\220l);\265\245\362c0[", 32, "\306\233y\253,\303\222I\343\335\211\242\243\026\320\253\177\211x\215\033\234\177*\333\343~\215\364\333t\326\005\240\256\300\362\015\022\344\212+)\237\277k\354;FFL\323\373\2342\022\001\254S\353\265\253\323\363", 700, "(#\342K\312\320\243\035\234y\366\000\333\023\256\305\042\361u\035\026\201?\252}Y\015=\203\332\235;&\344\027\235f\353\252\235\257Z\042k\377:\346\365l\236\335\035\274X\237WL\342\237U.y\003H", 64 }, + { "\003!:\341;,\031hr\233W\265|O\015!eO\352\272\355\210\304\360\3318q\004pw)\364", 32, "\317\243\314\370\315\317\025\017\002\273\020\344\354\222^\007\217\245\336\362\002\307c\207\376\236[\373`\257\226\332\025\202\246\010\230>\311|#\273\134\322A\364y\354V\021*=\344\326jb_:Z\221\214\203\011\277h\042v\212\211\241\303r", 700, "\252'\212\362^\0326\2114\216J#\367z\024KZIf{~\375\345C\302\307\236\030\002\262\346\012\033\317\272\230\244\320\220\272\242*\021\327\240>k`\222\263DT\231\204';\301i\027.\302\223\320\236", 64 }, + { "\321\334^\2313\347D\003\200\003RyA\002\241\321b\264d\337k]\005\260\265\226\001\017\3361$\341", 32, "6\327\246\342\376\260\013\303", 800, "\304\350\334c\025Q\240R\263\243M\320\011D\351\230\375\257Q\134\346V\303\267i\362\221\277?\323\363\207?`Qx\023\356H*wm\032\343F\017\304\033\327\204\242\2064^\214\204n3\000oqF3\347", 64 }, + { "<\204\330om\325\200\322\261\262\343\010\364z\017\317\223\366\313\311'\263\344V\270\134\2008\005'\267K", 32, "\015<\014\200\270\270\134\036\277\352\025\350Gk,\301", 800, "\331[p+\273\317\247\205\026\353\262\311\226D0Q\273U\014\366Rc\371\346>\255\206Z\253\260\267\226\200\321\357\134\3309\002X\014\015\241Wu2Y2$\331\265M\267\377\262\255r\252-\021d\201\341\217", 64 }, + { "\206\362\247\200tY~\344\264,\2113{Myk\366\370\3025\310_\343g6 \261nK ~\310", 32, "\323\372Uv{\243\026\035\350\261\323(B\257.\334v\024K\016\334\227\034\266", 800, "]\275\033\351\007\357\036\375\264\375$\360\322{\213Jaxg\027\21729\251\357\274\246\222\267K\271\351\237\321o\2451\035\310\2423\267|\272~\254\222\030\356c\003\240\337\373\231\033\270\340\277\240\3505V`", 64 }, + { "y\207\206\361\236\374\200\304St\364l\263z\244\375\270!\355\334\370\205\372(\027#\320!xij\313\314", 64 }, + { "\200\364\370;\271\323\015f\203%k\217\262E?*\305\243\211S\370\010fV\255\271IA\312sL\303", 32, "P'\305'\353+.\324[\364\241]\231\231_\215\357\004\345\322\2315\250F\335I\3471u\026\325{\204\241l\235\365\233\357x", 800, "\226v\235\300y\206\023\337\027\266B+1\377\312\214/\027\343m~\036\361\222R\024}\337S$\003\001\330\317cW\200iKJ\362sy\227\307\2670S\341;\252dE\343\217\375\270\206\373,1\020\352\312", 64 }, + { "ZN\344\3253\000'\217\224\223\206\257\3662\321\235j\204K\236\264'\312\030\327\276*\363\001q\272\223", 32, "\246\017~\226\231#gE\374\224\224E\374d\367\301\027\336XL\242+-\247\227\020F\215e\354\020i\272\214\271F>v\030\230t\007n\263\301\275\231\214", 800, "\332\003m>\274\2375.p0[\0234\037\245\256\227\2617%2\374u/\201,\316\324\200\323\225a\242\023c\332\233\211\342\254\011\230\032AV\235`\246PC\222\301\222/\342\354\261\251;\3505\357ey", 64 }, + { "\371\374\236\365\2432\210\021\205\300A[\365\017\207\2611\252\236`\015\031\205\326E\324\010\253\037\312\267\304", 32, "e\316\2516%\025\333\014\300QA\220O\343\366\001J5\251\353\300\262\262A\2748-R\025\027\263\227z\231E}Z\207\017\250\365\030\001\344\231\376\002j!\375\317\206 \347\3046", 800, "S]:v\220\373\206M\244y$\240\260>\030q\335+\206\205\305\361\251\326\0039\332.\034X\250x\004O\016\221\022\027\001\022\221,r\377F\262M\307=\033\042\341\312\014/\024v\224\265\200R\363\223|\360\235\200qp\225$o\201\020\2500\375\024^\217d\347*\355\257\211L \007", 64 }, + { "\206\307\0424\261\034\255\242\033\233\205VS*\003W8\226n\302\042\263\366YL\343\033\256'R\007\331", 32, "\035\241\217\002\364\341\305\313Cu\347@)\020\376\336\372\375\257Y3\202\237\266\365)J\270\351\265\310\212v$\201\207_@u\013\301\177j94\202\304k\345W_\324\310z\215_\304\2554U\236\245\314\330\313r\271\001\335\0075\322", 800, "\237\225\217\301\200\264\242I\240Z}\303\365n\227ps\365\302\013U3\373\311\273`KQ\354\360\335\212p\227\245h\332\225\374\375\374\300\261#[\240\246y\212\013\332/\342\212ns\243'\243\036\023\375\002[", 64 }, + { "d\375\042\033\372\337\277O4\004\270\037G|\234oY\032\214\211|6\374\374\207\221\205\261Z\034h\362", 32, "\332jcz)%\345\206", 900, "\312\233\266M|)\265Y\277UY\323MYj\034\203\011\353\215\361\247:(/o\270\321\362\034&\302$\2402\277\260\262\371\231\030\204\373\230;\276\371\000\323\302\025\314\027\205\035\2404\257]Kyl\363\203", 64 }, + { "\272\211\350\227\343N9\013\232\254RC\003\362)-M\324)\211\002\343l\331\300\177`\255\373\017r[", 32, "O[\2002X\323wW\374\204vg\355\270\003t", 900, "\243FM\260\206\333G\331\341\347\337\336\001;rr\306\343\211\360\272'g\207>'\224\334\2664nLA\311\221\321\030\024\015\036\246[\224\364P\270\223q\221QN\254\272+]\246G\337z@\211FQ~", 64 }, + { "x\357\024\247\310&1j\252\035r\024\301\217\241\012\336\300[\342\201\312\335<\307y(\273\321Wp\323", 32, "u#j\303\340\326h\242\367\023&\377\334M\201\202Y\342F\205\241\357\220\036", 900, "1\343\316\341e\365\233Z\355\313\013\021\302@\027\274\223\342\331\367\343z\353R\276r [\273\344\332~\015\311\255\324\325\014i\266dH\357s\3040\304\002\355\257\274\022\212\346\27511\300\272\215\210m\042|", 64 }, + { "Y}\011\134e\265|\3432\274gZi\334\340\320\011E\360\353\033\374\373\004\023n\025Z\325j\036\003", 32, "~\034V#\3239\346\017\020m\212/\203\370\372'\341\005\021\246\304\341v\352\275\224\036M\313S\211\257", 900, "\377\374\030KE\325Clh$K|\350#Ns\267X\3442\031%\270\012\024\17744_P\317Y\244\316s[\240\312\347F\305Q\322\021\013D\350\022V\014\2677\017q\306\361\222\260\306\037\257\236\010\263", 64 }, + { "\301\271z:r\325\332&s\200|W\361\220\270V\327\337\376\266Q\343/Z\224\245\021\226f\012\227\321", 32, "\1342m}<\220\234r\367W?\235p\234k\216.Z\260Q\304\212u\006\323\317\3103\300&@\257\354\276\245\311_9\004\252", 900, "\351\010\311ad_\347\271\204\243\007\377\311\236C\027,\215e\200\030\024=:B\253fp,1C\221\311d\214l \317T\027\376\030\320\204o:\362\235h\270\366\353\001eJu\004\202\300`\215%\355\201", 64 }, + { "\241\371#\267\251}\342\250k\275/\364dhP\000\340rX\010\006f\241\371\377>>\032\370\265h\253", 32, "\333/\273\006\213P\330\305\304\357\357\324.A!\002\250\210brD\302{\026n\007\350}\327,\371\260\240\322\253Q\243\266\254\037\001fm\233\257Z\315-", 900, "\030{p\375!\357\134*\353\017C%\217C+\225m\005_\206+\004 J:N\370\367\2041o7\241\236\222\261 \313\222\177\340\134\376r;l\224cC\035v?\022\316\321D \372K\214\317\216A>", 64 }, + { "\014b\217 (,\360\311\026\343\360yQ\215\363?\030\3467f\352\251%4\361Pt\037\261\371\014b", 32, "\032\257\353]'\003&l`\315\012\274\356L\346\001\255\303\3150{?/K\270\305\346\2311$O\244C--\351\004\206n\327S\217[\134\274c\372P}\243\355A\354\266\207\006", 900, "\007t\223\367\034\352H\312\205\030\314|\272\240\360\362\006\002(@\261\224\004\225\204Q,{qhp\240\271S\340B\015C\376f/\370B&Gf\024\022\312M\262O\316\177 \325i>\274\377E&\220\220", 64 }, + { "=`\230\314\234r\206\304\134\367\363!\023\2774\301\323\026\011\366\265\265/(\343!\007\335\242\214P\012", 32, "e\024\351\002y\227a\260\331\026\213Y\267\251\310*\230\030W\214p\255\230u\001j\3704\315\375MSX\030c\336\306w\325\346\262\2640\255\2465\253\3334\337Nex\234\334\216\316\314|-\257\017\022(", 900, "t\221\347C\244\016:\216QD[$r\347\227\325\256\343P\203.\012\277\3216N\241\351!\037\211\322U\017h\021\042\352\030\221=\317r\306 \367G\372\270\214\004\000\207n1\3646\344\034\371R\215K\305", 64 }, + { "\355\361\227|\310\247\256\014p\026\017\037?\364\277\355\314\030\236\306\032\306\240\321%\262\256\265\244Y\216\252", 32, "\263\354<\350\215\312\311\366\242xX'\234\312}f$>Ez\327\023x\320\355\331'\372uF\231\257\251^\034\364d\230\022\304\245\322\261>\325,\273\357\303\311N\3374~\323Q\014\342b\342\025\226y\307\245\026\231Q\266dm\215", 900, "\325\361\300\010\312\311\037\017Mh\310]\254@NC\324\205+Y6\027\362'b`x\353\007\211\035\264b\005\225|&\321AH+W\007z\377#\361\274\265:\371=\257\225\361ec]\315\203Jv\203R", 64 }, + { "\242\341U\355j\004k\356\204\330\351ufb\327\337\357A\223\341\233\3668\220\352\134\247\202\373\006\310\323", 32, "]\331\327\016\205\272\246\206", 1000, "?\230\007\216(\272\307M\015J\344W\242_\233\230\2201\243iM\254\362+\254\333\3658I'\335\241\377\2061\013d\212T<\327\201\257*U=\014\226\321\251\227y\370y\016\216=C\363$j\272\241\365", 64 }, + { "\017\376\364^4\254p\016=\353\344\366\352\006\227)\030\357\004\263R\373\177#\211 \335V*[\344\257", 32, "\3722\017\275\232\262\323fcgiW\232\224\262f", 1000, "\373P\274\357\005\026n\3021wkI\355\325\026\376\021", 64 }, + { "\042t\014\315\227K\273\323\237\220!\270\0172O?\2645\030\265J\325F\343!\241\344\323\301\241\024\272", 32, "\316\027A>\233\225\212m0\037Z\277d-f\017\200\303z\334Y@\261\230\254XT\227P\301\260\014\242\266\244\262f\334\365\324", 1000, "q2\353W\236\364\266\204\340G2\337\224;\220\223/|\2132\202%\215+\362\023\340>\210\360]\217n\374'\353-\010\217\000\212U\335,\012*_\325\001\370\037\322\007uCu\037\331\242\212eb\343\035", 64 }, + { "|{v\001\223\245`d\005\263$\321\225f\344\340\010,\305\273\025$\370\275<\315\373j\304\226\350\233", 32, "\224\263<\367\330\351A*\260\300\235\337))y\221\367\306\373G\324\266\227\372\027g\013OH\321f\326\025\333\334|\013\002e\005\025\205\004j\212\206\244\216", 1000, "\341\371\031\340\344\313\002M\255\020I\333\324\265\242ra\371mhr\017\214\366\274\337\200l\336R\305\276F\024\264\035:'Hg\231\245\217\350\306\251\376\032\310\010\311\250\013\354Tr\017c\367\241\300\031h\211", 64 }, + { "\303\341\317.\250\305\257\235F\324\011OjZ2\312s\224st\2041KS\233H\022gm\354\276<", 32, "%\264\212\004p\266<\314:\376\324\250\341\3151\251 F~\223\267\032\252\245\370\001[\257~v\363\242\253\240g\042j\306\233\336\312\042\345\257:\266Rc?\011$\344\313\267t|", 1000, ">a>\272\354,h\337\205\232\204Z\212\230\257e\307D\322\263\2539,\264\271!\034Rg=\201\334~\201\252@etE\326\241Q3f\205\314cc\237\216\373\272>,\0112\010\273 \307\332z\223\274", 64 }, + { "\211\211\354\215f\332\255Z\340\337P\031\217G\266c\200J\323\042\361\250[\210\022\007R\341A\017xD", 32, "\256\303\241\352Ij\317\253XL\262\221\031\375S\343\275\225\301\033\356\264\332'\014\004\326\230\036\275\002\325\260\301-2\223\247\0041m\251\210a\356\251\274\324\204\361AP,\312\025\247^\363t[\350\223WY", 1000, "\311\035\334V-zy\017\370\244\203\300W_f\2177\002\237T;\301\261\221G[S.\037\2030`1\321\010\300(b~\371\217\034\301\276\250\023\2462\342\374\332`\372\204x\035\247\012\237ju\275\224\362", 64 }, + { " \313\304\230\206\234\222pk\244\005\2711u \340 \223\322\345\002w\275\020\324\316\224\325\036r\223;", 32, "\372\344\357\324a\333\254c\215i\177\320\300\242\020\025[\005\3252;b\277&@I\270\015}F.;\242\304!\177\343\012=U\253\253o[qR\371\201n\357\361\330\277\253\346\177^\332\042\322$\201\377\340.IOk\273\363\005w", 1000, "\310\012_\254\372k\220\263\272\361\134l,\345/\371\371\357\237\301>\205\237\237m\036\272~^L\355\0210X\221x\331\0256LD\264(1f\357\014#?w\034\023'\210&\355\261\235\361^\004\277\313\014", 64 }, + { "\373\253'\357\233\227]\260\212\305\037\273`\364\001\032H\177\203\342\012\022\225\2572o`\240\277|\275M", 32, "U7%\340\031!\012%", 2000, "\024\2525\230j}\315\267\244\345e6oY\226\027\347\017\336\134\316\355*\252F,\034\247\267\270'\017\245\201I\2735\205^\205!\205\312\221\352\216\270\274\222\276\011 |-E\301#\240ifGA\375\210", 64 }, + { "\207K/>\226\027\221N{?\037s\003\323&S\243\355$R\361\254Q\026R9\2540\231Zx\374", 32, "\314\260\226\231\312\037\245u\230\345]T&\037>\375", 2000, "\010\267\374\351\370\303s,\323\030N\244\353\252e\275\205\253\206TL\340\3205E\004\253\204f\220\362\330\231\037?\204'D\274+\367\363\316\340\340x:\230\254\313U\016\347\023|G?\363\017\037M\177l\321", 64 }, + { "\215\3425\215\223\0224\311Y\251\213\337\240nw\233\343\320\335\244U!\300\023\023\347\012w1\222\011\263", 32, "\010uJ\261\030JR\357vV\257Wd\012\004i\257\351\360\266\303\200/\256", 2000, "\211\243QK\231\376\321\212\322\350\321*\245~\311+6S\013E$\351\217\227\224\217B\006\230\212\251L\264\245.ZJ\350$!u\000Q]\021}`\022\370U\364\224\215\274%\353\333Ys\177*\265#\314", 64 }, + { "O\2649\000z2\177w\372mk@\345\277\270$\231\330\246\001\334\350\271-\264\343\307\342Nw\231\221", 32, "\201VZ\223\246\217\224\263\241AO\325\367\251\031\322\221\200g\354BM\2600\340x\276\307\246zIT", 2000, "\316\341$\022\261\303\322yZh\227\205\310(\347\233\326g\031\220>\011\226.\352J\242\311\274\247\211\010\355\336\220\214,\2440\214\311\241\253I\042^\257\361\336\241\360\177UB\356G^\325\203A\3040,\042", 64 }, + { "\177\016\252\362g\010?|\0168\364*!(\042\343\015]m\253>\012\012/\3471\205\015\321\014jh", 32, "%$\263U\023\275\273\230SxJ\363o\373\241JK\234\252<)\207\026\302\267\215\016C\357\014V(\021J\336pq%\360\214", 2000, "\301\365\314\263\264K\025\305[161\030\015\211\207\0358h\020\231\042\351\031\323\253wC\320\330\351\205Nm\216\024\033\201e\324\037\354\006Z\331\305O\335\272\333\233\243\262\271b\023/\342\320l\177\311L\000", 64 }, + { "L\027CQ\252\262\232\343\237\205\245\344C\014F4\134\210\345\213G\256.~;\240\252<\332\202(\032", 32, "\313\376\250X\267T\235\320\236T\242[\255'\0117\207\332 \2130\242kz\246}\336\321\022_\316\377\323}\340_H.\001\337\327\205\372q\022\355\013m", 2000, "\302\002\343\242\245\365L\016\366\205WD\242\015\330\375\300\357\357\020\206\344j\237\022\002\036\247\265>\350\036\212\027\242\325\2135a\320\312\344\330O\366\335=h\253\330b\216\221\017\031\026\027\233 \260\254\204\345#", 64 }, + { "\013\207\005\265\235\252\020\354d\367\342\006\341\2004\311\021l\000\256\246\241\342v\342\026B\225\333&\214L", 32, "xW\265\230\242\345\002d\230\216\315\347!\232\272\3751J7\3271\011;-\3309:\207\374\204\244\203\244\333\026\011\344\366\134\364j\324\004y4\347^\005\313\202)_\030\217\236\355", 2000, "F<\236\376\203\266\204\306\361\367/\001:\220\350a\366\035\326\374\332\244\304`\202\367oA\335\331\013\330\204\361\353$\347\206\345\231\005\231l\215\013L\351\302\267]\244\006\335\374G\342\311)\245q\301B_I", 64 }, + { "\241\021vc\346\211\270V\212A\302t8\233G\232&c\001_\263\211k\232~\241\001\305z;}\204\371F<\200\350\260%E\036\374\013Nu\200\242>\321\234\316Y\232\375\220\036\243C\250)N\375\341\3775\336\357@O\232\304\225gH\351\270\316\003V\364\003\206;\352.\320", 2000, "\360\350\222\354\320\364\042y\245\343W\2413\024\250\221\377\245\325GH\277ZAu\274\026\265\275\231\304\2722.\010np\217\302f#\346Z\347]@\216a\302\177F\233k?\326\337x\301}\230ek\300\332", 64 }, + { "\030\344U\2107\244N\237\230d\255\376\324\213\343l\224\201\325\027Xb\201sH\200\245\263\244\035\005\300", 32, "]\371\274\014\217\177([--\347Z{\021\350\330\301\134\255n/&@N/\177?\2006\2026\360\241'\3025\215\362\253\322\027\034\201mA\353>3\247\366d\327\007g\335Z\367|L\026\234\301\340\016\325\204\261\244i\036\016*", 2000, "\225q\223-\325\221\257:\351t\266\032n\250\357\002\350\003:\020\242\302\236\311\245zi(\333\010B.\311\256>\265Uue7B\030-\243((%\332\362\303D\325\242\314\243\321g\264\201\331\001@\207{", 64 }, + { ".\356\217\343\212\004\001a\027\213\207[,\042\231Xj\221\315\276HB\037F+\372B\251|\265t\026", 32, "\330R]2\031E\351U", 3000, "Z\271\372U\365\246\007\342\272\236\251\271%V\347\027Q\303\237\356\304\242\220\231\026GJ\011\031R>\252Y\223\014\017]\311\365\265>8\370\211\323\014\2027\225\304\030\273\000[Jj\204\015\025c\211\302\361\331", 64 }, + { "\333?\003\246\275\035\007?\027Y\354w\012\344f$\3309\030Rf\263\366\306\350]\332\002\221\346/t", 32, "\361A\234}\315\361C\366\227\177h\325\235'\001\205", 3000, "f\367\374\346\006B\013x%\010]\371I]\256F\042\264\334\233#'\013\271|\347\355I?#7\266\257\253\353\027\217\025\276/G\334\020'\271\004>A\033\233WM\237\377S)\347}\2357\252=\277\313", 64 }, + { "\334\276\227$\003\200y\2567l0kC1\3330\310*x>V\273\021\015\305\246=\250\353\361Y\221", 32, "\364\023\034&\371R\363\231\003\342\350\236\0131\333u\266\314\327\266-8\243\374", 3000, "(\004s\333p/\003\201\333\376F\024K\313\004\374\371\310W{\037\313\377J!\304[\303:\3329\340\200E\204\177\212p\235^\221pu~\270\361Jvl\267;W\225\034\311Lm\371Yl\301Q\032f", 64 }, + { "\221\326\310\317\321-OH\334\006\007P\374uz\213\300\226h\231G\2220E\237\235\323\030\235=\316\267", 32, "ZO\241\0178\261\034\025\311\353E=t\353\331\003\364\243}\005\343\364\006\340\024t\341w\310\303\235\035", 3000, "\363Nm\010\373\315G\216_\354\021\200I\242]\014y\026u\301\346?\273/\304\213z\264\231e\322\304\010\217\205\303\204\277.\234\371\22699L\242\342\313\027\210\316\026z\252\215\235\307\347\361\002\306\037D\302", 64 }, + { "\032\370|S\365\270uTK\326O\353r\255\271\034#\327\307\370\242\262\374\266\312\263#\277J\215\251\362", 32, "\301\225\303\340w\312\303}~\011+\261z\216\320\220c\237\250\037\011\253\300%\267\011q\224\266z\271\025m\266\361|\341\374\301\007", 3000, "\364\037VE\343\326\327v\222\042\300\250\272Mr\036\023\270~o\316\314?Z\321\232c\261\374Rq\020~\032\344\333\134\272\223)\035\005Di\205\345\012;\3076\227\205Y/Z\350\016\236\317J\253\323`=", 64 }, + { "\245\223u0\342\000R\223\240\033e\340**\244\254K\302\031\363\177`M\240$\247\361\317Y\220\227\344", 32, "\372U\371\002\134:\304\002\023\314\037x\372\231\375\241\210\360\224_}r\334\302+\372t\2741I6\035\232\226\036\336\012\211\316\260\205\220\3374\316\256m\343", 3000, "\273\361\376/\034`\322Sy\031\333*\033\134U~$b\362\363\236\361$\313H\022\243\203\306\352\314\375\204\347\223S\246\314\230jB,%\241\000\335\237\364I\000\215\266\300DR\211`\322\271\306\026.\215\341", 64 }, + { "\273G\256e\220\336\234\0325]\177\324\012\204\230\031\322\023<\020~;\347J\355\027\244\032\342\304\340t", 32, "A\350>\021x_\311\275\017\322!\315\376\357\177t\236\001~\355\315Tg\344_\012\002j\2454\002 \233\012&\212g\224\221m\242\315\353\250e\322o\004L\005<)\220 \177R", 3000, "S:z\324\320\361s\320>bW\326\0118\026b\316[\021\265\375\273\021\343\031\205u7-.\307+\360W\237\321\236 z_\347H\256q\255\022\242%\2746\032\251B\224\2446^\266\261\177|\272\010\246", 64 }, + { "\367>aQ\260\374\262\260\020\201%\260[M\244G3\337H\200\025g:\002\275@\373H\364Q\030x", 32, "\321~\273\020-L\224;2\342G\223\025\235i {\256\342 =\316e\376\014\215\221\034\252\235\25762\007\210\3158\257(\235\277i\350\272\011\016\231fb\007\243)\307\376\2409\234\011\034\207\262\307\026\230", 3000, "\307\312QT\215\034\320`\314\352\251]\210w&\203\004\2716\352\251\311\311\261\001\220\276\224\301Y\020\241\245\364L\305\335NP#$]\251\023}z\304\351\304?\214\000\354r\323\000\300\220\003\343@Q4\366", 64 }, + { "1\211\332\336\2713\223\3103\310\247]\376\015\275K\036\233\266\036\275\362\211\343\013\312\134b\306v\227\272", 32, "\134\253eO\347\267\226\220n\360+a\374\362a\314\202\304\221oy\275\020\367\201}:Eu\214\303\2002[\2270jFO\245\237<\241\323N\032\200>\314\330\261V\342\364\361S\243\215.H\012gTu\345\212M\026\024q\236\337", 3000, "m\324)\245\253\323\022\134HK\340v\314\270\315)~Y5y\270,T\3453\366\376\360 @\234\362\006\012\216\210\216.\360G\233.\326\363\253\006\031\277q\303&\215O\203\257\214\002\037\223\365\023\022\303\361", 64 }, + { "v\352_\013\314\201C\025V\042\015h\374\375\272=\361\320\337\302i<\264\275H\002\2622\321\3266\265", 32, "\361H\3748\322\242\2249", 4000, "\025\332a\365\371\230\207\270h\260\011d5`\307%\235\311\354\337r\012P\323\005\214\330\202aT\356\202\225(Z1'\237\246\177:I_]@\327\317\332\266E\241\233h$\312q\217\325\256\230L>\353k", 64 }, + { ")2\223N,\364T\011\236\322\2671\214\240\220\306m,Xt\322\025\241\013\276'/\027\022A}\367", 32, "Pv\327\262\275\253WCP\010\004\341,\227\242\263", 4000, "\206\345\207oIg\320\275\200\246~\243\233S\303\330a(\301\367;wh\212\016\243\335/\034\202\201yN\352\200A\261;\226\277\222\230\256\243\342\021\340#\006T7=\324=\013\231\376\255\216\025\251C\224!", 64 }, + { "A\375*|\023?\215\251\2717\204\366\2310\356\004%\206\331\326]\022-\234\372q\243\371\231\314\207W", 32, "\031\003f\276o\314\232\2038@\307#z\312\222\376\007\376\351\346[g\005i", 4000, "\252e\003QJl\010#\235*5+8\210)A\251\250\032<6\003\215\221\364k\211\233\312\225\356\026f\220\254\303H0k\201\2565Adv\236\247Dt\3735](\3508\2602\315\035V\240\247\013\266", 64 }, + { "_\026N\013=\247\000\330\377\233a0!\007H\0054\021\337\027\242\315\361\004\373\360t\216\203\240qa", 32, "<\252\210&-\264*1\312\334\235q\316\011\024-Cm2bX&\356\033\233\207\001&\277t\311\325", 4000, "\002R\002W\3036\276\213w8\007Y\362\377y~#\347\207+\216\225\2272\271Jh9\354*\016\361\2554\233\263\025\353\267\015\026K\016Y\340\340\377\304\015=iz\341-\275q\315Ed2n:~4", 64 }, + { "\217\243/\333S*\205\365\302\330HZ\235\347C\007\003m\364\015,\316\032$\036\274\225\317\010,\244\213", 32, ":\226\370{n\035?\032\006(\257\302\366\036\301\275HI\342\230\303 \230\301\230\226k_2Ur\210=O\3602\253\277s\205", 4000, "\266x72y\026W\037Yu\222\207\244(0K\340\305\233\310s\021\011\275\022\004\213|\210D\002\240S\276\207\000\207v'\206w\271\320\362\302{q\231\355ff\361\374B\022\363\272;\223\316|[\301\217", 64 }, + { "Yf\027I8L\371^\314Y\006*BK\36582A\221\252\030\322\352D_\266ux\377\035\367\023", 32, "\362d\335&o`\242r@\363\2426n}\234\004t\275\213\254\236\020\341\021\304.\042\321\361'o.\002\223[\266\224\233?%\004\337\240\340<\323\267\3039\220u\334\330\242\3239", 4000, "d\315\310\234\260\364\012\230\023\235\2756I\352\305\247_F\260\3602\350\324\2067\353\341-\232\020?\247\302\014\232\253\006S\016\241\320\251\000\022!DA\022\011P\356\372qL\277\263o\303\242\007\347\225\370\331", 64 }, + { "@>\004\006\352\316\314\230\032\255\237\021\276h\037i\032/=^<}}R\313\265\001\270n\267\274\340", 32, "3\245B\276\234\220I\261\336\323\014\353\325?6\360_O/I#\270S\362\331\270\200\360\242Mp\213\361\356;2\316\304\251\227\003\352\327\027\003\271\026\275\230\237\233'\316\003\332j\260\032\014\323\243SO\006", 4000, "_\347Q\374R\016[\274\365~\217(\266\016\364\253\306\365~W\335\223:`Q\301L>\033\344(\253\027\211\372\352.\355\251\233\005\036\225\134\220\034\357'<\031\227\223f\253\240[>\031\344\300+\025\243\365", 64 }, + { "\017\024\253{G\272\276x`\224}\324\216\324W\363\357o\266{Z\347\200\342*s;\3159\036\320]", 32, "/\203\306Y\243\30672\2236\257\335\233\352,W\351R2\004\237n\325y*\3525\371!^r\222\364A\217\311\370\301\3677A#9\212\030q\220r\042\321\031\303\036\003\235\274F\252\134\327XKI\344\370\215\266\316\013\3704\352", 4000, "\216o\275\201\220\001\2209\010\241\307\260\352\274\220\020\004\352`'\3552\372T\204{M\221\202oy\226\223lhIe%\260\325\303\314BX\347\331\316TN\311\332\177\251;W12\006X\376\307\235^\227", 64 }, + { "\375\367\261\310P\032\253\300s\271\362\034Q\000\267\231wh\274[\367N\031\272\313\333Lg\016\233\032\246", 32, "w4\376Oe\334\337(", 5000, "\265\320\254NT0=/r<\341)\226*\376\345\364\004\134\201\024m\020\375Z\216t\212l\313G-\232%\321\272\256\336W$\371\310]m\335\334\242\306\241\367\220\263}F0\216\267\364\341D^\212\251\341", 64 }, + { "\341\3615\215\010Wr\235\353\224\272`%vA\336\2122KT\237t\233\321(\213\316$\340\206\237\001", 32, "\337\362\246Z\225\307J\215c\244\007W\221/m\027", 5000, "z\033/\267\300\001z\320\334\020\034\255m\3321\364d\227\012\247\032\017\370C\031\340$\307TCn\004Y$\017\220\371\274/\350\306\303\002\012,]T\034\301\017\3459\365\252\032\321\316j\231\245\341\322%)", 64 }, + { "\355p\310\241\334\272\230LP\241\235\324\302\312\202\002bm#\375\324\314\266L\212\016\340x\0370\333\304", 32, "\031\3057\204`\205\372\200;\320i\264\027I\007\027\267*-\365K\134\243Y", 5000, "mB\302\302\253l\313x;_y\012{\273N\340\303ohA\210TQ\310\321[lK\015lWL/\252\134iB\224a\265\207+[\016\241\330\005DRam\250\335}\356wZ\006\015\256\226a\216h", 64 }, + { "\240\367\032Y\306a\312*U\314\322\335\022\016\377\213jMmr\244\042\274\257)\267\220\3307\221\033A", 32, "\027\277\033\343S\023\203\300\354nzy\226\254a\307\2146\215\033 p\256\342 \016B1\015C\027\266", 5000, "j=:\035`\342S/}\343\240\311\033N\227\377\327\270|\215\353\241\310\206\042\265\367\206\243\222\315\023a\303\274G\037\245\345\323H`\010\231\344\342\351X\001^r\353\314 &\234\024\002\242\317\021\254\340.", 64 }, + { "\250\277w^\361\217\026b\210\177\306\3461%\252=\266\234A\211\002q\264\357e\232\3257;\036-\362", 32, "\261\363r\305^\275\322\224\3328\261\352\242\275\201O\317\275{\020\263{YD\241%2;\340\352?\366t\300\272h\351W\303+", 5000, "d\364y\350\264o\356\017\320\011\2317\326\027\254\033V\326/\200\276\374\360d\321\265\015\212_x\017\246bE\003\256\337F\265\260X!N\354\031o\216\335O\3278\202\027\222\266\262\356\311]Ok5=m", 64 }, + { "\374;\134\361\232\355\314\370sC\252\275N\372\2732\335\213*\232*\310\352\0312\0047\3758\230\022\010", 32, "\332\205i\265\023\022\002\372\234S\253,W*\303^o\204\316\360\332\353\237[x\030\210\2003eBX\342u\224\363\232Q\262\220\212`$\026l\207\330\302", 5000, "d\021\307\254\221XR\257$\322]9\306}\306aqr\333\224\337M\266\245-\001\2148\203\346\002\032\031ax2\336\230\024W8p\346\310\300!\213\203\241\306|\222\206i.\272\251\026\022O\007\207\262?", 64 }, + { "\204K\335O\134`\227I\204P\241\370G\324\350\313\305\346X\221\312\313S:\371t\341\011\275\327\301W", 32, ";h\002\331bk\375\014\232b:\334\367\341\361h\261\005\266\265\316!$N/i\201\002\272\005\351\212\031<\332Y3A\243\036\303\254\255\317\317\0356\020LD\210\337aU\007\023", 5000, "\002\036\314;\347rW\266\310(9\304\223\015\220\367\334~\3175W\354\233(\372\177n\304)\270\221\352\233\256[\370\320\222\042\202!\265\201\251\262\214m\234N\352\371\314\2724\201\001\272\3643\347\265/d\205", 64 }, + { "I\304\026\242\014M\013\255)\257wq\205\273\337\252\256\2626\233faR\365\262\257\010\010\333@~\322", 32, "\377\235?i\251n\222\2608\250N\304r\353\331\313Byx\236u\212\340\322\243\376y=fv\367\244\303\232A\214\244*p\253\333\134\335\250X\223\320\325R\311\243G\2524\337\344\134I\340E=\253\300\301", 5000, "\335\011\020j[V\242\266q\257^\2139\027XpWl\367G+\224\210\371\320\002\2170\007\223\361s\271\033\374\134\301A\320\234N\357\252:\343\275\025'\012\035]\311/H\341\315\310\303\310}Q\021\375r", 64 }, + { "Dml\351(\305\351#\355\004||\231$h\227j\361\3136\210l\375T\213\315\375\234~dF.", 32, "n\353',\204G\017\242\020\255N\026Io\221\224v$\324I(\246\016\036\035\374[\343\260]\326\021\013ne\371\356\301D\350\030k+\357nGJ\270E\262\035\351R\303\010f\233\246>\326\355|:\2552\003\021\234>dr\313", 5000, "\220\243\001\307\364\032\262\304\372\017\266%r\204;\301!\374\042[+,Z\321\373\020S\014\243s\305\335r\331\350\370\216\277\267\224GT\035\301\030\261\237kge\006\017|z\220\224\274\033\215\201\301\026uJ", 64 }, + { "\270\0170\011\344\012A%\357\323\236(t.v\263l\231\00450?bA\325*?<\251j\256\230", 32, ";\354h\272\035\251\026\346", 6000, "<\220\344\337G\206\302WjF\342\302\323\276\371\3105d\240\376QF\003 VL\024\357\217%\237\331\360g\326\362\224p\322\032\204Y\254\230\227A\2048\201\023AaN\363\264h\347F\222'\232\352\356\042", 64 }, + { "+\2547\326e\016\371\243\360E\373\0228\222sO\203\374\322\204\247\240\320f\227\201\364\371\223\323\216-", 32, "\215L\237\227\342\276aw\036\025\374\246\201\030\010\352", 6000, "oT:^\276\374\027\266\300\375v`Yz\330\206\325[~/\134\364o*hW\371\213\375w&\275\006\011\361\037!j\370\317\337\301\346\234\341\354\225\321\264\305\346iz\313&\324|O\305\317\2629?\022", 64 }, + { "\354\332\023}\256\222\332\241 \362\302\351MG\3479\276\332\334\023\362\271\253\211u\275\200\334/\246\013\244", 32, "\266\243\134H\272\356\332/\011\305Q\357n\371\354\001\020\307\177\333\037\362\315\242", 6000, "\306\231\246\333A\300/\22328l\017\305+\010\037\256\341\202\313pq9'X\264(Z\246m\177\300.\352 \372\20368*\274p\305\033\2251ar\211.\2624,\326B\031\134\335o\033\310\037\2469", 64 }, + { "\327'\333\2626\365\015l\373\244\377\016\314T\205\023\255T\244\217\346\304s\275\370\134o\226\241\000\3653", 32, "\204\340\237\333\347B Zh\352@\2206\262\303\002|\312\203\327\333<\372o\200\035\276G\210S\134Z", 6000, "\334B\327\177g\003$\351\375\134F\266\375\211\212\241\366y\323\375\373_\267\215l[\203\305\370\216\202$p>\241\264\377\032\022\211I\257,:&\317f\245\242w\364*q\037.\347\276\277\275\244\205?\034\317", 64 }, + { "\234>s\026\201USYC\367\314\261\324w\355\264\037\377\236\274\021\3211\006\372\354\201\250o\20011", 32, "'&A<4\356\331\213\213y\222#=_(\361\346\226\350\3564\177\261\024\350\3528 \331\235g?\007\361rYB\003\220}", 6000, "\304\232K\203\301\022\0351\220\354\260\350\311\321\337\023\264\354\256\365\333\215\373\325\201\274\204\216\310=\252y\006I7\250Y\210\204\226N]\036h<\016@\231$\234\134\271\357\307\225\273\331\245\272\2650\357q\203", 64 }, + { "\351\000z&j\354\276\2739+7\300\022\264\327\244\275\345\003\365>\204;\276\217\307)`XP:\345", 32, "\234\365\001{\277}\042\367\222\230\030\327\264\201\016>\241\001\037\336\340z%>\324\032#\352\204\351\212eC\304\027i\205\362\215Sn\226i\215\313\374\210\354", 6000, "?A\017\245L]\214\344\373i?\212\306\252\013Lg\277\015\256\260\001\306C\375\354D\025L\134\337\263\363\025V\336\227\013\237\353>F]_\035\314D\240ES\253\357\210\344\014r\220!\222\220\010\374-\265", 64 }, + { "T\217D\316|\373{}\037\354\234\177S\327\270\016-\231\316RE2\376E\030\245't\005)<\200", 32, "2\316\204\337k\213\260o\273\020-\351q,\220\202]e+\376ci\312\367L'\331\237\035\024\025,|\323\220z\332\211B\314\226\261E:.\002\0238\376\315\320\274.&\233\036", 6000, "\312X.<\3273\237\320\2349\267Rg'\337\230\326~\223\323}\204\010\005\352\035\221\223\244\374\262D;O\2356i0\311\333\360W\203%\321m\037\3220\267\0162\254w\0161\342\320\031u\206\032\370\271", 64 }, + { "D\243\026\222\253]\312\252\020% ^w\024\024\377\312~Q\221\334t\215\377\365#\353\305\340\273\341\364", 32, "r\012Vc\246\013\020\364\221>\227\273DJc\233\2373F\235\001\307G\223\210\260\033\236\361\365J\037K$\372\245\270\370\2402x|\360\033,\002b\307#\305\026\345\2572\325\241\321Sk#\364\035\342\363", 6000, "\342\3053\272\022\221\021F\344AvW~\350\355\314\342|\303\324\315\002U\311\236\315#\2776)\3219\033.T?0\035\264\207\350d\247\247\042w\365\371\262\217\2051\001E}\201\301\034\025\177\016\314\246\312", 64 }, + { ";\370<_m\217w\363\0054hx\333\347:\247\033\337\364\363n\370\042\244\303\014\306G\322\027\323U", 32, "4\331\020,\014\345\314\367~DR7\345\013\2001P\261\273\333\257\306\373\300\033\361\257\256\271\362\302\134\342<\320\301\224\034\034g\033\206\022\005\220N\260\014\207\347\265|\206'Q\323\214\276\305\357\356O\355Gr>\237\204Z\371\354\375", 6000, "\027\304\207\017\213\207_\0117\262Yu\004\012J.\274\307xu\273\372V\004z\243P\007n\363n\222:A\311\351\031\212\2748f\352@\217\347;[@\177:\023nq\260\221n\244\014\246*\361\033\212\042", 64 }, + { "~_\236f\256=\004\026S\320\325Tz\237U\327d2#w\202)Ir\003%\220>$u4\215", 32, "\372v\342\354;>9\312", 7000, "\134\017I=\243`|\314\225\014\263\254K\014r\372l4R\015<\3138'3Pw\214\3051 J!^G\364l\334\037\314\177m\220\247\321\001\307P\317B;\316\037BC\246\310@\250\250\367V\031\223", 64 }, + { "\371\311\302+J{\330+%\236\312\021P\377\377I\235\356\2664\000[\270Q\042\022\357\235\374\307.=", 32, "r\244\035~\327Y\310\266#\364\324D\203hd\266", 7000, "\272\304O|Wj\3136{g_+\347\355j\265/\300!lR+\341\231\2032\322:\032\272\350\331J\347Q\203DQc'4\335@i\347\334}))a\004(\313\255\3220\206\000\346\014\206\206\365\012", 64 }, + { "4\203\215\242\377.\236%\324\260\315@\275i\310C\241U\350\363\3107\337\371\2607\223\036\015:tQ", 32, "y;\315-J\314\274\357\264\210\020\222\007\240\272N\015\331\370\037\334Y\267\016", 7000, "\351\334\341R\305\301\022\273C8\001\000\270i\226\343\304\016z\322d\370_Q\377\2671\215Zu\376nS\245\030Za\374\353\255\305H\024\202\024\0110\037i9\003\363\337\377\304\214\331\207\366\226W\012\307\376", 64 }, + { "l?\242\3334\336\353R\233b\216|C!\013\000\022\274^$xfn\231\237!\037\357k\351\345\374", 32, "\005\276\347\3550\023\213\226w\2313\312\351\253PuJ+\027\003!\255\322\340\006\334__\017\317!\341", 7000, "=\015\237\267?\333$u\274\201\353e\204.Zls}H\344O\020!W\036@\222\362Qp\013\212\225T\274\265\256\024\2221#v\245\254\203K\202\020\355\0118\262\001\333\346\364\332\240\347\017\3227>\245", 64 }, + { "\027\344\376D\230{\335\276\012\027xc\247h\300\221\253\2004\231N\337XVPH\350\177\202\324\336(", 32, "\014;\3008\375\017N\372G\354\331\201\031\263A\027a\351\315\256\344rE\326P\247G\375\2502\262\375\353\344NA\035\317i\212", 7000, "Y\222\200\251;I<\227Q]\356\335\317\263\351\231\042Q\322s\313n\006-P'RKDZ\330\237q\213\332\374c\266\022\352,y6\231\226\001\233\354\027\245k22\312\331^i\026\2764\244\353\306\251", 64 }, + { "\267\366\277\006\327\363\330(~,Wd\275\303A\203\315\016\230\333\327X=*\326yB\364\213v&%", 32, "\274M\257\261N\266.k\356\343p \331wdX\324>\366a\031\362\207\3732\323\302\255\013\212r\003\321:d\220\200PI\010\0029HA\011\003\326\220", 7000, "i\364Q(V\223\200\223\340\007\374\330&H\342E\032\215\2515\3556X\022\215O\365\363\264\247Vwu>\371\320\332j\305\354\267R\323\022\274\232\216\262\361\301\225\3124\004\215=\236\237\341\347\365z(/", 64 }, + { ";~ \241\225\021\325\357\016\232\310=\214\261\3451\270\316\233-\303g\361\216\033Nxz\377\361.\236", 32, "\272x^\233\036p\375\304\204\200\034\306\224\352\307g\361\310\003K\224\276\211%\202\336\346;c\207\240A\021\005\206\255\006%6\312\233G\017,3\230\310\301\202\226A% \0341\353", 7000, "\331\326\014\373X\343aJI\247Cn-?\201B\223\271R\230\015\346\204\350\350w\012Y\373\240\265\020\274\232\000\366\207s\263\360\323\0254S\226i\007\371]\354\314\015aV>\337\303\260f\030\275\214\233\372", 64 }, + { "zt\362W\316\317\032\273\343zzZ\207)ZLm\224\345=\350_\361:\033X\324`\305\306\202-", 32, "\010\306xU:i\204\2235\375\346w6Q?\036\010M\267\275\265\240\223[p\022\255\213K-iKnR\263oP\263\002\036\331\200J\363\365\314\214\036\026\343\304\316\352=a\211\274*I\340.\266\015\265", 7000, "\337\242\214[V\263\350\233\377\006\301\201\275G-\365;\260\241\030\035\355\010\242k\361,\271\344\377bB<\304\242h\357\015\225\313\203\266b\031\322\270\235\376\365\351h\212b\2250\317\2567\254\033\223PLq", 64 }, + { "\004\221\352\003\252\354\313\377UT\030\207\205\362+\004\033\015\2140\004\261Yr\001\340jA2\241\2625", 32, "\256\300\3735\301\013\223\035\221Hl\304mj\340\375\215\254\337\0332\3472\274\254g(.\323\322g\0122\177\347\377\343\353\271t\010R\024\215\331\033\0027e\237\305{U\034k\357\220S\240v ;R\266\177\344p|Tw,\230", 7000, "\335\227U\002aP\016>\270\376g\266\312\211+\305&\013\273\312\262\364\365*\002\227\256/tg\007\341\3777 \351\323\337\031\246\025\227\301!\330\221\032;tX\007\030\004\353\004oX\277j\250\257\323J\230", 64 }, + { "\347\324\310U\204\323j\341\215\317&\325zo\327\025D\024&\352'gZ+>w5\256x\3500\353", 32, "\311b;\237!Zc\350", 8000, "\032\210\262\273W\324\134P\216\315\300\312\325\270\346\032^\031\022\260\372u\313\336\234\315h\005\264\2010\373$4u/\271\311VX\226V\304\261\042B\241A\227}\265jR@O\3651\364!\012w\246\335\200", 64 }, + { "Dn\207\341\204X\030\206\355vO@\340B\275\354\000\023\311\265\225T\237m\013\364\034\247\353\217\316w", 32, "\372\366\303\033\331\272uy\262\371j\302\256\356\334\257", 8000, "\250KJ\204a\031\225\204\016\325x\310?\230\013\2070\322\302\263\231r\264\001\240VR\237\270F#\330\353!\337\330V\256\223\357\262\030\2421\205\037x\272\305L\350Z\031\245W|\360\325\305w\223\020oc", 64 }, + { "\355\015e\250>p\225X\225*\011\316{\311\244f\364g\372\300\336\351=\216-W\324\257\316\373i\376", 32, "\226l\330`I\331\035r\203A\354~\251\373^yQK\322\343.Z E", 8000, "70`<\225^\221|\350*\017|\244\004`\317\221\134\376\352}%\245\324\360\216IY\042\311l|\201\350\230\210{\346\034\271\264R,&#\001\337\261[I\357kBl\336\335\213T\352;\015\024\301\033", 64 }, + { "\317|uV\275\303X\214t\250w\274\335\0028z\376\025\223^2\326F\250i\006\024\006Jm\303\017", 32, "\012\375\360\206\245\022J<\212H\177\267\247\370gr\326\322\251\011\324\331\010B^_IC\317JP\327", 8000, "`n\314\361\221\2161\263%w}y\006-\323\010S\354\240\332\026l)\325\266\023\013\036.\273\000u\247'\273Y\316j,ap\345\206*\264\324inn\022\203tj\260pb\023\210c\306R\234-\320", 64 }, + { "\231\230\221\276\330\2648\017\330v\311\346E\364\272<\037\243'\355\356\252*\210f\006\036\206Z\346[I", 32, "/Ws\213\262\202\020\005n\351i\334\233\303\375~\374\341\251]\227\247aeU\246H\263\031\035\015[\250\316\205\031{\222\016\205", 8000, "T(\016UCC$\370\236\251|\013s\237\023\325G\014\327\376Q\013\306\244*\233E;\014\264sZ\2449\242!m\200\243\264\342M\257\0350\370\357\224\373\262\201K\023\204\334\320\340\016y\272P\311A\217", 64 }, + { "\372\310Z\030\0367\234\257\361J\306F\267\310\216\2069+\013\224\275T/S\257\3554e\177P\243\134", 32, "p\237\036hc\362\305I\350\222\316\022\310v\240\240rE\200\277\241\212\245\330\260\035y_i\374\332\240\304\031w-QX\357\022Q\025\343n\371\273D\201", 8000, "c&\346\353\305F\004P\307\212\3268\356\255\252\225vy\214\213%\340Zz\242\252\301\263R\344qUhOG\334\363\177\203\030\014m\241\306\313\366m<\322\241\254{\334A\007\371\035\0210\211\320\357\042\014", 64 }, + { "\274\023\233g\226\220\266b~\011M\215\240\304:\345\216)\2338O\031\205c2nj\364\332\245\252\275", 32, "\023x\251\256\246*\363\004nr\336\240\357\031\011\315J\210\243:\023f\263\202H\333u0s\323\345\2516i\212\012>d\344\004\231:\217\371%P3\004\333\225M\037\321\036'z", 8000, "\305\373\334\202\333DvE\007\302L\246\273O1\312\006\327\203m 1\227\322\262\275\262$}\343n\377\275\325\034\323c\242\337e\352\247\217\264\200\276l\203\207*MG\245wI`4\261\200\025w\277\374\273", 64 }, + { "\310M\231/BX\015\3022,D\221\343\336{AB\373\305\232\223~\332\001$p%\236\311?\307\255", 32, "\346\237C\3322L\307\240\003+\342@\244\356\210\3652@\231uyajh\3672)\3133k\015\247\011\221\360\256$}G\232\326\344sB9\266\326a\273\276\273t\134\330Q)\2555O\212\204\207K\251", 8000, "Fg\027\253\252e\334-\306!7\300\374\277\235\274\261\350\005D\327\262\302\037\025\016\306|p3+\031\230\216\224\362\370&34\314\240LA\326\010\307b\371\177Pw\310\2605\210\275\305q$YPw\024", 64 }, + { "\243%\302\344P\210:6\271\3316\330|\234\377\325x\317\255\356u\266\204_\264\232\306\221H\235\323\233", 32, "\203\355\374\337L8\346\314\340\310\310)iB\261\313\303`\254\263\356\011\360LVf[\240\372\033\263\031 \237\361\263\264\007\257\323\224\205\207\366)\344\220\270H\216\005K\310\200\256~\341w\352\365m\305\316\231\315!\354\232\270\030\327\027", 8000, "/p\266KV\336\250\270\214\3752\255>\253\011\261\353Lu\022y\313+\300v\201\005^\333\310\370\016\375x\023N\340v&\222\042\353W'\277\014\226ss\240\314T/\020\347\2303\225i\337\255\217\275\310", 64 }, + { "\020\352\211\2704\337\355MK\251\237\315\207w=\345M\253j\013Q\312A\323v\256\212\273\346\314\206Z", 32, "\356\327\312\324\304XV\042", 9000, "<\252\305rA1WHK\030\310K\220\312\214/\225\222#\211\020y5J.\373.\375\250\246\344=U\326_\322\205\303\357\316\212*2\252\1347yP)/y\330\030q(;\275\222\316B\345N/'", 64 }, + { "\246\200\343|\000\363\320\004c1/\252 \230\027f\221\010\300L8<\315\333\014\000~\013=\224m`", 32, "\344h\347\244\325\331\22483=Nft\360\302\261", 9000, "\330Y+Q\337\302\005\230&\257\271\201\020\266\346rXi\310\342\234l\365\374}\242\365&\377\214Fn\240\315\272\026\322\326\2318\332\325\001\362\007G\316\346T\001\225\273\377\042\345?\377\330\302\361:\354Q\270", 64 }, + { "\300^\277,{\327^\347;\023\366\331\344\214@\224\226/\231\304z\212\024\264\343\305u\353Y\301\305\031", 32, "e0H}\001o\0238|<\317\200\275\255I\300\2211SZ\350\024\010x", 9000, "\346\352\302\366Gt<\261;\010((\022\360\232w\323\024~\3107\323\001\003\331X\006\245\235\364V\302\000\233~9\370\225\340\312\2120\011\362\274W\036\272\270\3168\311d\366\361\270\254E\363Zg\001\326\227", 64 }, + { "\302\3170F\365\303\367\304\340\000\332\3223F|\363\231o\336\315\010\334\000\327\225,\300\205\214\301\272)", 32, "\017\015*/]\217\334\262S\312\317\235r\371m\225\273\013\215N\360\016\324\003 \257\222\315\371\014\326t", 9000, "Q\213LROW\365\360C\375\251\233\235\237\273f\370\333&Qv\035\231bj|\2621\134\365\213\254\264\221\377N\321\305\036\272\236I\331K\375 \276\212\177R(T\370\030\376\322\201!a\230\014g2\330", 64 }, + { "VW\226?\011\206\237\332\316^\201\211F\363\242#\2414\260\034f\253F\020\015\356\022\026\030wy\207", 32, "\134X>oO\341\2221p\023\236\217\357\355\213qc\222\237$q\311\271\224\317\005\354\243\010'\365\246Q\371)N_\226\353m", 9000, "\310Z1\202\257\017\276\0118bF\322\213U\222~\243\033\323[\324\371\365(\344R\363\347\313\342\255\033\320\316\374]\207\371\004\353e\311+\316`%p\236\327\326o\017\235yu\234=+\216\303\3420\246\333", 64 }, + { "\265\321\227\226\355\037\225\225f\000`\331\364x_h\261\236\302F\356\277\305\203\337n\324\242XlX\276", 32, "\353\325\230[\314*\371$\233U\335d\302\356+M+\217K\255:\305i\217\315U5dmm1r\034`^\033\200\311\366\323\244\254\134\354*.C\261", 9000, "\203\205\206;\334K\261)~\005a\365\232$.\246\250\333\351\036\237\227T\326\007\266\277\337\267\012i\252\277f/\367", 64 }, + { "g\342u\261\360\205W\253\3757\224>\2007\261$\321\326[A\030Nl>\300\255\270\310j\230\000\317", 32, "\205R\344\134\355S;_$R9\207\216\351\035\355\344\246\230\347\305\225y\365'\264\273\273\002\3004\3074\321%j\237\246\352\345Y(\224\334\371\274\012WL\232$z\246\331m\020", 9000, "\042\307\336\011n\273.\027\006Z\200\335\244N)\210\325\177M\000\270U\2167\007\331\217\002u\262\030\257\223\325]\371WI\207\226\211\331s\007.\224P\3330\023E\273\3256\324\2250|h\332\134\306M}", 64 }, + { "\205\222\255d0\015\236\365\024\002w\355:\025Q\206(\000\014\315*`6\343\233\217\377\036\227\231\001\310", 32, "\031\345\002\252\206*\014\226\235[\012\333\340K\207$\010\010\332s8*\346|\245\323h}^\202`\233\200\2460\304H9\031H\2321x\013\033\363\322=B\223\224\321\2335\204\262#%\245#N\236\205\360", 9000, "\376\304\247X\265W\252\204.\025\177:\360\227\0259$\005h\205\364\030o\324p\023\206\006\325\302B:\311\252\240\015\253\000\370\313\007\002\276:\037/\001\240-T\241\221\007\247`Z\012|M\027\316\2303\004", 64 }, + { "\262\332x\2240\1348{\351ow\377\220.\005\010\351\313\365w\310\006\042\312O\234\256\254I\225P\236", 32, "\003\262\327\213\033E\352\255k\031x_V1\330\217\232\333TCjCG\257\222\207\302aA_&\303\022\242T2V\301l\230U=\204\255\013?9\212W\217R\254\246\264J\310\243\340\215\276\324\264\211\371H~d\334V\0048\210", 9000, "\2428\360\032\336\004$\015\303\304\203\271/\302\252\361\204\366\314\201\231\324\323\340\031E\355\205\372\201?JX\264\256\177\242L\362\001oc\310\134{pO\232\234\200x03\270\364@\346\134\214\330\202\010\254\350", 64 }, + { "`\210\003\226\023\271\363\251\376u\032@4R\227A\233\177\204+\331D\302jJ\035I~\033Va\334\306\134\337\3708\3159\374", 40, "g:\354\200:\353\237\314", 100, "\247\204y~\264\003\374\263YbJ1\265\256\370b\020\377?\034\240{\014\275Z\011\347\213\206\356\037Q\010^\306\207Q9\021\374q\270\242DI\034-\232o=\212\202\134\037+\305pB\2152CI\275[", 64 }, + { "\330\3067\035\364 \2267\266\226]\315\242\015X{\270Vn9\260\277\277\375a\014\251k2P\003f{Z\037[t|o=", 40, "\375\276EL5\306\235A\371\032\272\364\014\340\014\374", 100, "8\255\030MN[\002\3162\250\340\323\262\011O\0374\012V'\303a\010\026\372\337\022p\002\321*\032\255\205\217\377`\264\015\255\217\005\300`\352\261\313\370`\217en.\252\205V_\331b\261\302g\333\273", 64 }, + { "\247\3113>'\341Z\226\015E\235\221\200}d\217\021\263\134r\205NX\241\366\014\257\243\261y\212r\263D\272\243\021\207\235\216", 40, "(\213\353B\221\216\0302\003R}\310}\331\006\343\001\333\326\236\017x3\005", 100, "\261\201\255\301\037\027-\004\242}\361\027\264\250\210r\231\274=d\010\371\2662\357\017\233d\224\230\0300\356\273\264\245\212A*%\333 \326(c#\273X\026\312\226\317\031X\257,\353\213\307\254\304\337C\326", 64 }, + { "\024B\327M\362\134\210]Iu3\223\322\277\361\3646\276H\263\030\2348XC\271\206d5\242\231\263*\334w\317\015\376\002\014", 40, "\321\357!\351~\005{\304\267\313\205\027\005\307\232a\367\212r\302\306\032\231\26567\246\356\227!R2", 100, "`\236%\333\327{\331~X\022m\274\337\203\257\326\012\247\021\326\270l\3271W\244A:T\261\250\252n\230\327\231\305v\024\245\371\377\346\007\305\204\360\215\252\267G\007\005_E\0221\223\340\3714\243\220\303", 64 }, + { "\002\325\230\270\245\022\320|\042<\274\236\243{IF\255\2123~1\324NX\343\212\002\230+,\321\253\320\334\246\273\264\265\215\350", 40, "M\361.*\033\362\022\226*k\333\225B\320\377\266\011\307\034w4s\274\316\217\034\221W\373\003\256\244\210e\260\242)\206\254\223", 100, "\371d\211g\2024\010\257M\023f\177\247\376\000e\036\353\372\375%l4\272\370\026\343\330\240\022L\214y\025\235\360\0213\014\375B\326\331\300G\336\212}\342*,\254~\001B\204\370\200d\254 \303E\367", 64 }, + { "\243\035i\361t\264\370\31688\017\261Ph\267\224\271\357Y4\035gZ\2631\021\253\236\364\311\031E\364K\240\313xi\253o", 40, "\313h\035\345a9\260^n\335\014\337v'\371\330D\215`\332|1\357\023\253\215\213X,\215h\306X\244C\232\236h\256\372\247\020N\275\020d\360\005", 100, "{\320\345i\277g\336.\253(|\256\347\302\022\260\330\315\247j3\217\257\236\260\302\024\204\000,+}I\202Ow\321\205\013\315\324\001\332\331\003\367E%C\205\354\345\366E\314\351\032\340\314\2568\233=#", 64 }, + { "R.\220Q\306\005\331\013_\274\263\364\305\363\253ut\215T\042\354}\011\014\256\254J\245c\353f/R3s\342$<\205\366", 40, "\042L;\375\240\241\376\322\232GY\375\004PV\261\331}\305#d=\210T\261\233\246\322\377\365\350\365\304\202\256\264\003WX\021=\273\247;\007\215\377Y\360\212\004\324\2525\260\223", 100, "]\370(3IL\232v\357\336\347\350j\3428=\337\205g\331\211=w\023\373\311q\321fM\372\134\037o\312\270\207E\232$\246\224\0069q\245;_U\256\207\246\224~\265lfX\217+\241\177\012\000", 64 }, + { "\005F\364\361\037\250}\236\013\315z\330\022B\011U\222\372\236Z\033ZH|G\313j\247\263\363\222\350\362\243~;8\203\276Y", 40, "'\006e\223)\331-D/\272>1\236\236\202\360\034\015\253\305\312\036\202;\306\254\036\313)\235\011\217\270y\235 9'\355cs5\311\300I\042\235ls}\202\364\002\303S\223L\3528\262\305\001\203\011", 100, "NY\261\274\311\225i^\034\326=\353\301\204\312\357y\263r\031\234\240O<%\253\221\022\321\264\015rH\311\327\302\201yi\304\360\3748z\036\022\205\236W\026\023\006\256B\227mJ\234\231\263\253\3368\202", 64 }, + { "\006\336\254*o{\322\024\361\337\007S\353\357\243\370\244\033\261\024`\3159\311\001\027:\342h\275)R#_S\030\217V\336\024", 40, "\001/Wmb8\260\026\246\270#\346W\360\277/\347\177\233\322t%|\226\334\261~\001tJE\326+\204X\304\324&\036\134\252\004\362\020Y\347V\245\015\023\332EQ\345U\002F\321\202T\012\356\313\235f\206h\356]+\314\324", 100, "I\177\227\177z\320\023\255\352\036\233\272\216\032\231\236\236\220\034\304\263\006x\212\004\340~\371a\034\375R\254T\321\237,\351>\367Be\335\020d\343\363\216\271\011!\344\345\271\325u\006Jdv\004\350\277\301g\007\211_\336", 64 }, + { "\011d*\215\352[\313\3051?\362\360c\277?7\1771\306\221\271\022\275\205Y1E\240M\214T\225R\363\010\3130!*y", 40, "\310l3\2262\346\215Z\223\005\236\302\241\025~\276'\334r<\030Ou\273", 200, "\022\251\266\330\274\244\022\001\042g?\014Q\334^\032\320\203\004\023\231VI\236\351\032\234\200\220\272}/\255\356\322C\342\315\340mR/\024\003WvC\362}0\204\274x\315u\216\014\203\337\353\0350\216\241", 64 }, + { "N{\366HE\323\251BA2\337\035lQ9y\377\206_\354\217\210\210\237\301\277Tm\234\001\033\237\200\261:\314$\007Ro", 40, "\226L\252\227\244 P\217\303\022\353\351\357u|\367X\206\134h\354]\006\257\247b\277ug\266\371\305", 200, "\331\343\322@\363\303\324CF\204on\225pD1\260\342\250h\337\376<\376oqrOrC\260,\014\330\234@ \363\236v\206\201;\335\020+\253#\232x\267-\035\035P\010G\277\322\200d\241d\337", 64 }, + { "RjMU\235u\300\005\020s\3026\244C \010T\277\204\025}6\221\260t\030\347\262y\246\004\004\022nP\003E\224B\275", 40, "\361|Oc\337\006\334\314}y\037}5'L\363\3776(W\331\015+\005y\211\036X\006\33121\012Y\017\011c\016\353\025", 200, "\037^\036", 300, "^b\177X\310\203*\016\340f\343R\233\025\025\222\017l|R\203\227F\217\311@\261\207\325\013\273\042\375\260\256b\333\036\221\220\026\377\223X\336\243\217\235h\006\3110\231R\314\247\3401q\365>dA\010", 64 }, + { "\350$\307\023\016\225\330\3677\315F]9\3447F\306\036?w\000w\266\266\214\244|w\354\204*9~\331y\262x4\237E", 40, "\023*\200k:\322 \321O\214W\374R\223>\232G\202\230\223u\231.\266", 300, "z\223\217\302\200\321_U\300\304W\241/a~\367X\24385\244\207\224M/\255,\232\252\366C\377>5\312\210\273k\001\377\353>g\204\032>\017\303\207#1\021\373\257\031(M*\014 h\334P\370", 64 }, + { "\341\320\235C\357(E\316\332\224\353$\002\330\352{m\215\310l%\255\247\035>fQN\270\217\001\211\355\265@\2036W\263\210", 40, "\232\001\020\307\220Q\244C\312\213%\0206bK~y\272Bh\302\323D8OE\205\323\356\003\235\300", 300, "\227\366^\335\033\330\023e+w\242!B*~t\226\326\322\201\020\251\025O\336 \302\354\355b=\3732,\304\311\025\005y\032\376\005y\347I\031\260\336\360puq/\340\235\325(\337\023\344y\225Hs", 64 }, + { "E,\342\3250\250\275N5\307?b\016f\215\200E7\3260\2062z\026X\243R\245A\210R\014\262\240r\305Z\303\211\042", 40, "\213n0gD'Y$\2742\031\330\027\247\253\343Y\345\263Y\335\354\270\0275\205`\015\227\002\3527\336\367\354\337\024\204v0", 300, "\305\042\312\304t\351\241\223H<~\212\257N\201\022\363\032~\231\241\373\300L\344\333\302F\272\233\306\037\231\260\236\243\326\035\370lOM[v6N\214\042\362D\224\001\372\316Z\372\220t\177\301>\020}2", 64 }, + { "&\3372)\301\232E\222\030&{\236\272\013\210\011\034%1\352s\310\341^\310\251\352\177\257l*\3071}\343\011\317\377\012\221", 40, "\332%\357\310,%\202/Ei\2600\0219\256\305\225}\344F\273*\231\272\317\004@G\334\242\311\270F\0232\240\264\003\234JL\304P\2627\271\234U", 300, "\017\356\256\272\201\031Kf\300\365Z\246\362Z\2765b\346\272c\011\222\241\033\337L\356\323h\034%\001\270\020\016u5\251\030\013u\343%\361%c\005d\242\340p\224L\255\261\370\025\216=9S\225\027X", 64 }, + { "\023\225\225\225a\205\3544\023J\002\345\037\024\217$\252P\240\347\025-\206\0266wn\353*Jx\327\323\213qo\322~JV", 40, "<\225(\247f\351\21182x\003\036Z\333I\376\347\211\037\340{\241\0017jPQ\037\206N(\365\354$$\001X\253\3713\253?\263.W?]\260\327')\347\200\240%\354", 300, "\362wD\306Q!\204\002\0347J\363\256\214\210\3030\266\007\3170\323\346\375\301n+\300\010\025\345\010\0316\363\344%*\377\360\260#\212Ut\324\347\334;\011\356(&A\207\0332\013\320\3060\367\271\333", 64 }, + { "\267\244\274\263\273\230jf&\202Y\220\226\354\216\363\010\031\206\326p\363ux\3536%.~<\213\324;vCi\0217\004\311", 40, "\230\250\225\200\265%,\326\017\035?\274\237{D\272\224\303\3037ea\205:\042\022B1\272\017\275G\263\317\344 \306\204\233\244\273\254\235m/1\317\223\344Uf \273\372.\305\306?\005\011[\217\302p", 300, "\360\214I\303\037J\034r\211\204\333\023u\217\274\134\373G\024\327Z\016\331\022\210aOM\014\212\226\240\257N\215nH\266\343\006e?X\244\370&-\313|\252%\353\351{\345\340\004\345\271\004Q\314^0", 64 }, + { "G.\325\033\317\202j\005\253z1\227\033\207\2061<0\003\311+\3337L9\264\004h&\027@:\030H\331\313/N\270/", 40, "\006\032\324w1\247)\271\337H\335\312\316\2467\214\042\207\245\373\361\250J\207\354c\253f\371\001\276o\343\300h\010A\300\366\331\301NI\255\322\270\350lf\246\020\257\263m\231\311H\3175{>\257\223\313\262Y\245\254hghv", 300, "d8\023\233e\020}\215\007\036\002\367H\003\367\336\010\260\364\255 \360\200\223\265\252\203y\315\322\013\252\376E-gi\000IY\325\367\353)\322\311g\023\301\245\245\134\223n\211\324\245\301coXc.\320", 64 }, + { "\302\347\272e\366\307\3749\015< ^\330\275\344*\370\033\274_\361\227=-\350d\340[V\025#\225\255\017\252g\325;H9", 40, "\272w\001\242\254\207\370\351", 400, "\304>v\275T\012F\025\366\200\362K'\263v\211\232\267oM$\337\134R~&\262\205IM\300\372\3549\014\177\267H{!\241$\234S=t\355T\247O|?\310\247U\263\326y\000\221\214\2404\266", 64 }, + { "8\217\216\363!u\361\212Kw?\134\251\346\316\012\000\0055\042g\230\010T\374\365y\312\213\333\307z\022\363\313\330d\354\226\325", 40, "\331\326\007\325[\226\374\225\250\021\225\214\012c\240\310", 400, "\016e\302\330?9\223s=\3620\302X\221\336==v\365\351iF\340\227\223;?b\005;\010\201)\327\262\006\247\0077\345\224\250=\026\341tP\303-+M\025\014[\367\007\022w\013k\374\032\234&", 64 }, + { "\027\271\230\271\345\254vz%`\006\201P\331\3222-\323\374\222[S!\003\011\323\231\262+\325\224\250=|\277 \201\254\201_", 40, "\010\214t\242\242\352\314\021\304\320\367\322I\3120\314Ry:\334u\354\272\370", 400, "\334\230\272\330r `\333\030E^\250m\023}\302\022\025th\024\364UC7b\001\301\023d\272\265\207.\037\377\371\011\362\344\270o\2101Bk@\340\332\351\253\257yp\361\377\331v\016\3105\020\363\317", 64 }, + { "B>\351\352\241\021\035\330U73\250J\266\243\374+\340\306\337\263\316\377{U\331\250\304\033jy\0032\216\021\211\345N)d", 40, "\250,\252\367X\257\022\264\331\373\042\223\226Z\021PQ`d\021\371\201\227w\374r\2028\033\3662\377", 400, "\315j\243\042p\000\266\016]BH\350\270\356\257\236\013\214'\347\347\001\010\341v\357\271\355avY\354\250\367\032\260:dRv\377\134?Abn\262\026\020\010\371\255#\227F\035\326,lx\251+D\372E.\263A", 40, "\350\3618b\270\207+:1\033\366\322`\321,\240\244/TDD\315\362\335\354\231\327\333hI\365~\270\271\244\374EU\237\270", 400, "jY\035\262\337\213\327\204\367\352u\230\024\020\021/\027\261\021\037D\2740\354\276G\035\222~\037\3065\201\002\350\042\371\276ye\020\253^B0\234\237v\363\252\267\221\305\373\336\016\034\351\236\243\215\375\236\305", 64 }, + { "\270\322\236\314\345\206Gv@\370=\210\267\316\245\215!F\264\211I7\032\231\225\360?\020\375\256\371\0020V\204&\134\273yk", 40, "\265\257\037\360V\302\357\200\373\024R1X\211!\362\327\027\275\134>X\371\334W9jt=1\331r\241\0138\265\344{hWe^?rZ\301\305\375", 400, "o\212\230=\031.r\255\037}3Q\3413\237%\320\323\362\260/\014\377w\312\370!\236\335\371\010\377\240hR\252\254\016\000\030\332\004\243\305G\371\024<\025r\243X\312\371\320p%n\340K\317\346\2710", 64 }, + { "v\203'\352\031\202O\037i\246\205\355\211^AW\331\251g\257\356vw5\003v\247\304\225\310\232\206\373kqS\360'\252\255", 40, "\252\275\277Tw\316\320$\304s>\372\236\264\330\354\341\314\275\315\034E\240f\001\330=ZK\001\026b\317\333\007\224\230\272\020\366\314\332\027\265\221\033\244\034fA\323\214\032\227\010\225", 400, "\327\262\021>\322}w \177&\302\357\351\356\350\345\217\300\004\24057\0254*\367\365a\200\263\353\000\134h!\226O\243\202\231I+\003\006\244JK\210\005\336\363\032\352\242\206\330\266JQL\013\356\356\307", 64 }, + { "@\257T\377\244\313W+}\242\241gP_\252\2466u\016U\335\230\344\210S\323\030\01608\237\351`\320\332a\3702t\327", 40, "lB;^\004{\301\301\2000\367\227\226\026\222cQl\322\225\374\221\351\277\134\301\023,\002_c[V\333\010z\271\200tQP\237;\277\213\265C6\3474\361=cs\267\200\247\012h\253\233\017k\025", 400, "b\016\304n\314l\007\256\316\042\300\033\006\033\356\305@\237H\356s\026u\276\013Z\016%g\340\344a\0330W\004\244 \241K\216\255V\345\360;\026+u\340\374\006$\201\371\004X\274\332\360D\233s\011", 64 }, + { "h\026\013#^#\3608\361\241y\335\311\364\257\251\0033\202s.0\032I\254\256\250\305[L\332x\032\035M\275\373#41", 40, "n\272\237\200{L\204\300\313\253c\332\220c\225\325\024\243\266$$\364s\344\271\327\270i\245\375\002yu\245`\250\042!\341\200\025\017\203w\253\002{9i~Y\337\316\215G\222\273\031\200\005\221)\370\004e\200\313\2531\335*)", 400, "]J\212\037\332v\225s\225A\361\336b\015`X\010\301\352C\225\020\333\215\226\354\264\205/\034\033\345Q\316\310\311\335\025@\323\376L\373\365N\014\207\333\377\373\030c?\263o \270y1\327'\011\275\300", 64 }, + { "\037$\023\200l\203\315\362\001r:\251Y\265N\006\033\223\177\266\276}\235\042.{\340@(\361\042u\250\364\374/\017\225\203?", 40, "o'P\035\276\332b\015", 500, "\027+\241\256=XP\216\265\203C\372\367\026_g\042W\277\042\017Q\200\260\363\021\031\370\017\354\214H#\247\233\012\244*\277\325fi\261\344\005\026\206\262v->\344\340\332\367C6RpF\273Y(c", 64 }, + { "i\356+\334\331\004\246\024\364t\321l&\254\240['=B^\351Y\222e\332\267\227++\320,\351\315$\025H4\036\307\305", 40, "\232%\344]\343?\304T\007\016\323\211\341\264\350\003", 500, "\376%\230\250'\221\371L\315\021\017^\256\034\273;\335\337\360p\305k\331\256\370\021\371\230kZk\234\353\026\227\340\313{\203\206r\032\034\034\374J\025\352\015\335 \373V\365\347\024\005\276*\363\021\331\3446", 64 }, + { "B\276J\227\335\347dq0\204\341\373\352\264v$\311g\306b\314,\252a\030^,\333\202\327\353(\245l\240\313\267B\243s", 40, "]r\312\3217\237OJfZR\274\021\261Q (\244\241\013bm\306\001", 500, "\020\307H\233\2222\307\276\233\134\220Sc\226&\230\273\353\315\265\004*\253\030\222\031\016\203\022`\242\360/}\301z\226\270\231L\203\346\034sh\201\216\030\201 \223j\341Y\337\350\366\256\347\301X\372V?", 64 }, + { "\367\373\350:\033`v#:q\264G\032\235Y\3419(\211bK\002\012\317\237\217\261\277|\367'F\225\346\322M\262oO\032", 40, "\017q*\266,_U\373\216\351\001\035\3237u\354\251^r\022'X\237\206\230]\331{@%\301\311", 500, "\211\366\134\340\227K~6!L>7(#\032\2176\230\000J\344\321\013\371A6\206#^\350/N\021\341\365V\211\230;\266v\013\327\000\221X\360\025ag]\344\011\002\322\357\363\254\270\324j\333e\232", 64 }, + { "`r\253B\0145\341=\303\240Yp%\023\256\003\232\354\212!F\246Q\232\207\224\337\347Z\216\261\235\244c\332\242w\206-\337", 40, "Z\216\370\311}==\002\367]w65\340\302\340\221\002\032@\302\210AP\273\215\335\322Q>\011I[\004\231\241\310\246\022\322", 500, "H:DD\322bY\205\003\134,\367\345\265\352\021\331\375\007\261\2251\334{g\336\022bso\015\203\277\312\264)\005\2372(\335RK\225^qM]\2626j\266\324\006\023n\371\321\340\260\354/\357\225", 64 }, + { "\036;{cq\252\200V\205y\367HY\042\373\323<\235\252F4\31601v\341\235\005%\204x&\177\316.\222\032\214\357>", 40, "\023\321:\305B\361\352\322\345J\042\202\333Q\214c\007-\026MN\352\252\231t\205\012Y\365\340=\212\374\245\275\021\177?g)\006c\0104%6A/", 500, "\250\303\354\237a\347#'\230\270\035^\357\275\231\254\000\001z\315{\312@u\365s\310x\326z=\007S\213\336\026`}/\324\220\275\217\232\323\321\273Z@\027\317|\223\011e,2\023P\021^\325\000b", 64 }, + { "*z\225F\206\0151/t\213\026\2309~\313\313\374\205\235*\342\026\003\267\347\223\333\034:N\2051\001O\3031\207\375H\265", 40, "/?\0267\245\223\272\370\225Ad\214,H\332\265\376'\377NE\035bP\342\311\030\202\031\311\014\340\276\266 bW]\373\255+W\316\020\211,\277S\035c\020%\365g\350\271", 500, "\031Q\035\3656\223\042s\342\21538\340\235\226v\014\357\260\013\363\201g\241\271\226\213\220\316Zj\000\306\000\220\021V\027\250\230\302\265'\255\235\334N\230\355\251\326&\207\307;4\2550p\377d\315\342\222", 64 }, + { "\247g\321K\211\224K\024H-}\217\260\373\332\325;L/e.\307e-,\013\263n\255\271\312\213\231\241\266\264\264\010\220\177", 40, "\026\227\357\264\367\222d\234F\311\363\371\316:,\366\007\007\240b\272\361\244\215\007U$PW\007\321jGm\033]M)@\326\234\341K~G\005$\024MU\266f\333\247\374\002_\34273\020\301\036D", 500, "\2177\022\2258\227\032v\042f\134\2542D\314\315\271\320\315\026M<\2708r|@c!\351E%\035@v~j\245m\276a\367\364\311\237\016\370Zy\352k\230\322\315\355a\3212\367\252'8\027\010", 64 }, + { "1\010\366:\322\246\037\312\007Jc|d\302)\233\366\134\224\351\272\237\3669\305\247T}\245*\3402m\241\214\035\365\341\274U", 40, "\260\042\205\205\337\006\014\3020%\243\020\221J\361\352\337\003\317\352-\006\303\032\353\333\030:y)aP\003\206\376K\313>\332,\340\202\245\331\333\034Hd\342q\315m\002\256M@4\340:99o6\013\3201\253\355\347R;\022", 500, "f_\215\220\321\254\317rr\306_[\007H\267\334\332\271P\270\220\360mbZ?\012\220\322\357\351e\330E\250N\251\256/?z\261J\276\013\226%\224.4\327\367\310.\320\324bk#x\250P\205`", 64 }, + { "\205\310\260\004\314\016\205\266\337>I\276\336XNQ\371\2057\001oj0|\033\022u\255\233\250\307R#\220_u\021\350\222\317", 40, "\321\234C\254C=\026\005", 600, "\230m\022Q\007v\331W\031'/0\0336\235\241\254g\231v\367\244\013[8\007\016\351\200\371\305b\203\231r\241\324\363/\246\256\222\234\001\223\325\231\267\245\005Pav\241\257\323\265\254\355\134\250\224\033\245", 64 }, + { "\032G5\256\134!\321-\371\005\331b3\321\321\351'%v\361\316\2378\213\356\032{o\042\220\355\006z\277\351\332\342\304\3146", 40, "\200h\016\361\347\034\302\327\3315\371\344:\203\331W", 600, "X\275\364\247\307\262\230\202f\255^X\225\330\225\254\223\203iL\037Gq\001M\304{&\330\342\354\002\322\252\001\301=\231\313[)\236v\012CT\2719\340S~\371\001=\312\234H\323\217\343\020\022m\237", 64 }, + { "18\333\277\367\221\366w\230\253K\012\351\2526\234^\270/\247JD\204,\034\361!Y\266\336\274\354\322\226R6\030\207\305\304", 40, "g\241\307h\373\326X\200\134\002s\362C\011\230-\012\277-\011\377\001\274`", 600, "\236\207\032|\264\025\321-\203\236Ug\306\360\366\262L\022\333\370s\207O]\344+\326\334U\266\340\310>=\360re\227\017Nz\026\216\331\204n$\007\365\323\257>\334;M\213\024\320\252_E\010$\042", 64 }, + { "|\017\325Z\222\240\336\245\247\207\000\326`\221e\2770\360\226\232$\274\375(B\024\264\336t`SwhX\354|D\327Z\236", 40, "\356^\021\042^\200\272j:Z\377\216\247KVH\334\241\263\307\220\223Gi\337r\001Q\246\261 \207", 600, "\323\247\260\306\013&\234n\235\213;{\234\276\241\016\270\012\006\340:6\337g+\234\0264cV\367\307\361\341Iqu\210\307\370\0056\002\343Oy\264w\230X\3239H\024\207\027\377\315\204\333\340\302\220\250", 64 }, + { "}\017\344\277/u\246\350\315\226\323\033\277\356o\024h\004\234\343\036\005\014s\265\375\023\001\363\206d\265a\266\374\036\344\200*\364", 40, ":\361\031\206\006\321\276\321\206^*\330\027\257:\204i\311\012\233\3404\236\0040Zk\326\007\013\015\310\022\367i\313)m\341\026", 600, "\236\317\231\200E\323\025aM\347\231R\345\020\324\364\254\367{\024F~]c\204\350G\364\364\204\355k'4k\343\221\034W}TL\311B\027T\246\353\311\333|\340\2266\231\017\323\307\254\337A\007\373\333", 64 }, + { "\247KD\327\323`\024v \344}H4C;\307#J*\323\314\021\362/\214\254ED\201\042:\341\204\313\231U Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708C7E6469A; Fri, 12 Jan 2018 01:09:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2696EBF8; Fri, 12 Jan 2018 01:09:31 +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 85ACF1CBFD; Fri, 12 Jan 2018 01:09:30 +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 w0C19UUt032877; Fri, 12 Jan 2018 01:09:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C19UYZ032876; Fri, 12 Jan 2018 01:09:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801120109.w0C19UYZ032876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Jan 2018 01:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327857 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 01:09:31 -0000 Author: bdrewery Date: Fri Jan 12 01:09:30 2018 New Revision: 327857 URL: https://svnweb.freebsd.org/changeset/base/327857 Log: Cache LINKER_FEATURES to fix the wrong ones being used. Submitted by: Dan McGregor Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 12 00:31:07 2018 (r327856) +++ head/Makefile.inc1 Fri Jan 12 01:09:30 2018 (r327857) @@ -144,7 +144,7 @@ TEST_SYSTEM_COMPILER_VARS= \ WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ COMPILER_FREEBSD_VERSION \ - LINKER_TYPE LINKER_VERSION + LINKER_TYPE LINKER_FEATURES LINKER_VERSION test-system-compiler: .PHONY .for v in ${TEST_SYSTEM_COMPILER_VARS} ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" @@ -178,6 +178,7 @@ _COMPILER_METADATA_VARS= COMPILER_VERSION \ COMPILER_FEATURES \ COMPILER_FREEBSD_VERSION \ LINKER_VERSION \ + LINKER_FEATURES \ LINKER_TYPE compiler-metadata.mk: .PHONY .META @: > ${.TARGET} From owner-svn-src-all@freebsd.org Fri Jan 12 01:09:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B493E646E3; Fri, 12 Jan 2018 01:09:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CBA56ED0C; Fri, 12 Jan 2018 01:09:43 +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 940EE1CBFE; Fri, 12 Jan 2018 01:09:41 +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 w0C19fbT032928; Fri, 12 Jan 2018 01:09:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C19feH032927; Fri, 12 Jan 2018 01:09:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801120109.w0C19feH032927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Jan 2018 01:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327858 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 327858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 01:09:44 -0000 Author: bdrewery Date: Fri Jan 12 01:09:41 2018 New Revision: 327858 URL: https://svnweb.freebsd.org/changeset/base/327858 Log: Add a hack to disable AUTO_OBJ for 'old style' kernel builds. Another solution would be to extend the Makefile.sys.inc idea, or a .no_obj file, to more places but I would rather keep that limited to the top-level build for now to not impact performance (statting a file in every make call) or to bring unintended side-effects. Reported by: jhb, imp Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Fri Jan 12 01:09:30 2018 (r327857) +++ head/share/mk/src.sys.obj.mk Fri Jan 12 01:09:41 2018 (r327858) @@ -132,7 +132,8 @@ __objdir:= ${MAKEOBJDIR} .if ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ - !defined(NO_OBJ) + !defined(NO_OBJ) && \ + empty(RELDIR:Msys/*/compile/*) # Find the last existing directory component and check if we can write to it. # If the last component is a symlink then recurse on the new path. CheckAutoObj= \ From owner-svn-src-all@freebsd.org Fri Jan 12 02:49:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76343E6A404; Fri, 12 Jan 2018 02:49:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 525AF72082; Fri, 12 Jan 2018 02:49:19 +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 A51931DBEE; Fri, 12 Jan 2018 02:49:18 +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 w0C2nIbv073985; Fri, 12 Jan 2018 02:49:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C2nIMt073984; Fri, 12 Jan 2018 02:49:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801120249.w0C2nIMt073984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 12 Jan 2018 02:49:18 +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: r327859 - in stable: 10/etc/rc.d 11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/etc/rc.d 11/etc/rc.d X-SVN-Commit-Revision: 327859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 02:49:19 -0000 Author: cy Date: Fri Jan 12 02:49:18 2018 New Revision: 327859 URL: https://svnweb.freebsd.org/changeset/base/327859 Log: MFC 327737: USNO and possibly others have misinterpreted the maining of the leapseconds last-update field and incorrectly increment it when changing the file even though the leapsecond data has not changed. For instance, if a leapsecond file is obtained from USNO, when it expires it will not be replaced by a newer file from other sources because it has an incorrect later last-update (version). This corrects r304780. PR: 225029 Submitted by: ian Modified: stable/11/etc/rc.d/ntpd Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/etc/rc.d/ntpd Directory Properties: stable/10/ (props changed) Modified: stable/11/etc/rc.d/ntpd ============================================================================== --- stable/11/etc/rc.d/ntpd Fri Jan 12 01:09:41 2018 (r327858) +++ stable/11/etc/rc.d/ntpd Fri Jan 12 02:49:18 2018 (r327859) @@ -144,9 +144,9 @@ ntpd_fetch_leapfile() { done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) ntp_expiry_tmp=$(get_ntp_leapfile_expiry $ntp_tmp_leapfile) - if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" -o \ - "$ntp_ver_no_tmp" -eq "$ntp_ver_no_db" -a \ - "$ntp_expiry_tmp" -gt "$ntp_expiry_db" ]; then + if [ "$ntp_expiry_tmp" -gt "$ntp_expiry_db" -o \ + "$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \ + "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then $verbose using $url as $ntp_db_leapfile mv $ntp_tmp_leapfile $ntp_db_leapfile else From owner-svn-src-all@freebsd.org Fri Jan 12 02:49:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE91E6A408; Fri, 12 Jan 2018 02:49:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87E8772084; Fri, 12 Jan 2018 02:49:19 +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 C68A71DBEF; Fri, 12 Jan 2018 02:49:18 +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 w0C2nIXM073991; Fri, 12 Jan 2018 02:49:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C2nINZ073990; Fri, 12 Jan 2018 02:49:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801120249.w0C2nINZ073990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 12 Jan 2018 02:49:18 +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: r327859 - in stable: 10/etc/rc.d 11/etc/rc.d X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/etc/rc.d 11/etc/rc.d X-SVN-Commit-Revision: 327859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 02:49:19 -0000 Author: cy Date: Fri Jan 12 02:49:18 2018 New Revision: 327859 URL: https://svnweb.freebsd.org/changeset/base/327859 Log: MFC 327737: USNO and possibly others have misinterpreted the maining of the leapseconds last-update field and incorrectly increment it when changing the file even though the leapsecond data has not changed. For instance, if a leapsecond file is obtained from USNO, when it expires it will not be replaced by a newer file from other sources because it has an incorrect later last-update (version). This corrects r304780. PR: 225029 Submitted by: ian Modified: stable/10/etc/rc.d/ntpd Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/etc/rc.d/ntpd Directory Properties: stable/11/ (props changed) Modified: stable/10/etc/rc.d/ntpd ============================================================================== --- stable/10/etc/rc.d/ntpd Fri Jan 12 01:09:41 2018 (r327858) +++ stable/10/etc/rc.d/ntpd Fri Jan 12 02:49:18 2018 (r327859) @@ -127,9 +127,9 @@ ntpd_fetch_leapfile() { done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) ntp_expiry_tmp=$(get_ntp_leapfile_expiry $ntp_tmp_leapfile) - if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" -o \ - "$ntp_ver_no_tmp" -eq "$ntp_ver_no_db" -a \ - "$ntp_expiry_tmp" -gt "$ntp_expiry_db" ]; then + if [ "$ntp_expiry_tmp" -gt "$ntp_expiry_db" -o \ + "$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \ + "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then $verbose using $url as $ntp_db_leapfile mv $ntp_tmp_leapfile $ntp_db_leapfile else From owner-svn-src-all@freebsd.org Fri Jan 12 03:50:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E798CE6DA9D; Fri, 12 Jan 2018 03:50:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C22D374758; Fri, 12 Jan 2018 03:50: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 0BF741E634; Fri, 12 Jan 2018 03:50: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 w0C3oi7G099753; Fri, 12 Jan 2018 03:50:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C3oi0Z099751; Fri, 12 Jan 2018 03:50:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801120350.w0C3oi0Z099751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Jan 2018 03:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327860 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 327860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 03:50:46 -0000 Author: emaste Date: Fri Jan 12 03:50:44 2018 New Revision: 327860 URL: https://svnweb.freebsd.org/changeset/base/327860 Log: ANSIfy function definitions in sys/vm/ Modified: head/sys/vm/vm_glue.c head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Fri Jan 12 02:49:18 2018 (r327859) +++ head/sys/vm/vm_glue.c Fri Jan 12 03:50:44 2018 (r327860) @@ -113,9 +113,7 @@ __FBSDID("$FreeBSD$"); * space. */ int -kernacc(addr, len, rw) - void *addr; - int len, rw; +kernacc(void *addr, int len, int rw) { boolean_t rv; vm_offset_t saddr, eaddr; @@ -147,9 +145,7 @@ kernacc(addr, len, rw) * used in conjunction with this call. */ int -useracc(addr, len, rw) - void *addr; - int len, rw; +useracc(void *addr, int len, int rw) { boolean_t rv; vm_prot_t prot; @@ -527,12 +523,8 @@ intr_prof_stack_use(struct thread *td, struct trapfram * to user mode to avoid stack copying and relocation problems. */ int -vm_forkproc(td, p2, td2, vm2, flags) - struct thread *td; - struct proc *p2; - struct thread *td2; - struct vmspace *vm2; - int flags; +vm_forkproc(struct thread *td, struct proc *p2, struct thread *td2, + struct vmspace *vm2, int flags) { struct proc *p1 = td->td_proc; int error; Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Fri Jan 12 02:49:18 2018 (r327859) +++ head/sys/vm/vm_unix.c Fri Jan 12 03:50:44 2018 (r327860) @@ -73,9 +73,7 @@ struct obreak_args { */ /* ARGSUSED */ int -sys_obreak(td, uap) - struct thread *td; - struct obreak_args *uap; +sys_obreak(struct thread *td, struct obreak_args *uap) { struct vmspace *vm = td->td_proc->p_vmspace; vm_map_t map = &vm->vm_map; @@ -247,9 +245,7 @@ struct ovadvise_args { */ /* ARGSUSED */ int -sys_ovadvise(td, uap) - struct thread *td; - struct ovadvise_args *uap; +sys_ovadvise(struct thread *td, struct ovadvise_args *uap) { /* START_GIANT_OPTIONAL */ /* END_GIANT_OPTIONAL */ From owner-svn-src-all@freebsd.org Fri Jan 12 04:25:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50A27E6FBED; Fri, 12 Jan 2018 04:25:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BE5F75B1D; Fri, 12 Jan 2018 04:25:17 +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 6F07A1EC9C; Fri, 12 Jan 2018 04:25:16 +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 w0C4PGDr016224; Fri, 12 Jan 2018 04:25:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C4PGRI016223; Fri, 12 Jan 2018 04:25:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120425.w0C4PGRI016223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 04:25:16 +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: r327861 - stable/11/tests/sys/geom/class/eli X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/tests/sys/geom/class/eli X-SVN-Commit-Revision: 327861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 04:25:17 -0000 Author: asomers Date: Fri Jan 12 04:25:16 2018 New Revision: 327861 URL: https://svnweb.freebsd.org/changeset/base/327861 Log: MFC r315292 r315292 (by glebius) Fix buildworld broken in r315230 when /sys doesn't point into a right source tree. Usage of SYSDIR is apparently wrong here. Discussed with: allanjude Modified: stable/11/tests/sys/geom/class/eli/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/geom/class/eli/Makefile ============================================================================== --- stable/11/tests/sys/geom/class/eli/Makefile Fri Jan 12 03:50:44 2018 (r327860) +++ stable/11/tests/sys/geom/class/eli/Makefile Fri Jan 12 04:25:16 2018 (r327861) @@ -44,7 +44,7 @@ ${PACKAGE}FILES+= conf.sh TEST_METADATA.$t+= required_user="root" .endfor -CFLAGS.pbkdf2_test= -I${SYSDIR}/sys +CFLAGS.pbkdf2_test= -I${SRCTOP}/sys SRCS.pbkdf2_test= \ hmac_test.c \ From owner-svn-src-all@freebsd.org Fri Jan 12 04:26:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55F84E6FD89; Fri, 12 Jan 2018 04:26:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 312A475C99; Fri, 12 Jan 2018 04:26:41 +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 834521EC9D; Fri, 12 Jan 2018 04:26:40 +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 w0C4QeqS016310; Fri, 12 Jan 2018 04:26:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C4Qevs016309; Fri, 12 Jan 2018 04:26:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120426.w0C4Qevs016309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 04:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327862 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 327862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 04:26:41 -0000 Author: asomers Date: Fri Jan 12 04:26:40 2018 New Revision: 327862 URL: https://svnweb.freebsd.org/changeset/base/327862 Log: dhclient(8): add missing include stdbool is technically needed, though we can get away without it due to header pollution. MFC after: 3 days Modified: head/sbin/dhclient/parse.c Modified: head/sbin/dhclient/parse.c ============================================================================== --- head/sbin/dhclient/parse.c Fri Jan 12 04:25:16 2018 (r327861) +++ head/sbin/dhclient/parse.c Fri Jan 12 04:26:40 2018 (r327862) @@ -45,6 +45,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "dhcpd.h" #include "dhctoken.h" From owner-svn-src-all@freebsd.org Fri Jan 12 04:31:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 179E3E70260; Fri, 12 Jan 2018 04:31:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E821E76133; Fri, 12 Jan 2018 04:31:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CBAE1EDFD; Fri, 12 Jan 2018 04:31:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0C4Vrim019471; Fri, 12 Jan 2018 04:31:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C4VrDw019470; Fri, 12 Jan 2018 04:31:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201801120431.w0C4VrDw019470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jan 2018 04:31:53 +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: r327863 - stable/11/sbin/dhclient X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sbin/dhclient X-SVN-Commit-Revision: 327863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 04:31:54 -0000 Author: asomers Date: Fri Jan 12 04:31:52 2018 New Revision: 327863 URL: https://svnweb.freebsd.org/changeset/base/327863 Log: MFC r327862 dhclient(8): add missing include stdbool is technically needed, though we can get away without it due to header pollution. Pointy-hat-to: asomers Modified: stable/11/sbin/dhclient/parse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/dhclient/parse.c ============================================================================== --- stable/11/sbin/dhclient/parse.c Fri Jan 12 04:26:40 2018 (r327862) +++ stable/11/sbin/dhclient/parse.c Fri Jan 12 04:31:52 2018 (r327863) @@ -43,6 +43,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "dhcpd.h" #include "dhctoken.h" From owner-svn-src-all@freebsd.org Fri Jan 12 06:36:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99CECE7609E; Fri, 12 Jan 2018 06:36:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B62979FB8; Fri, 12 Jan 2018 06:36:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83D8920135; Fri, 12 Jan 2018 06:36:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0C6ajUE069807; Fri, 12 Jan 2018 06:36:45 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C6aidV069798; Fri, 12 Jan 2018 06:36:44 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801120636.w0C6aidV069798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 12 Jan 2018 06:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327864 - in head/sys/dev: mlx4 mlx4/mlx4_core mlx4/mlx4_en mlx4/mlx4_ib mlx5 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/sys/dev: mlx4 mlx4/mlx4_core mlx4/mlx4_en mlx4/mlx4_ib mlx5 X-SVN-Commit-Revision: 327864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 06:36:46 -0000 Author: eadler Date: Fri Jan 12 06:36:44 2018 New Revision: 327864 URL: https://svnweb.freebsd.org/changeset/base/327864 Log: sys/dev/mlx[45]: fix uses of 1 << 31 Reviewed by: kib (D13858) Modified: head/sys/dev/mlx4/cq.h head/sys/dev/mlx4/mlx4_core/mlx4_fw.c head/sys/dev/mlx4/mlx4_core/mlx4_mcg.c head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c head/sys/dev/mlx4/qp.h head/sys/dev/mlx5/device.h head/sys/dev/mlx5/qp.h Modified: head/sys/dev/mlx4/cq.h ============================================================================== --- head/sys/dev/mlx4/cq.h Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/cq.h Fri Jan 12 06:36:44 2018 (r327864) @@ -86,7 +86,7 @@ struct mlx4_ts_cqe { } __packed; enum { - MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31, + MLX4_CQE_L2_TUNNEL_IPOK = 1U << 31, MLX4_CQE_CVLAN_PRESENT_MASK = 1 << 29, MLX4_CQE_SVLAN_PRESENT_MASK = 1 << 30, MLX4_CQE_L2_TUNNEL = 1 << 27, Modified: head/sys/dev/mlx4/mlx4_core/mlx4_fw.c ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4_fw.c Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/mlx4_core/mlx4_fw.c Fri Jan 12 06:36:44 2018 (r327864) @@ -1944,7 +1944,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_in #endif if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT) - *(inbox + INIT_HCA_RECOVERABLE_ERROR_EVENT_OFFSET / 4) |= cpu_to_be32(1 << 31); + *(inbox + INIT_HCA_RECOVERABLE_ERROR_EVENT_OFFSET / 4) |= cpu_to_be32(1U << 31); /* QPC/EEC/CQC/EQC/RDMARC attributes */ Modified: head/sys/dev/mlx4/mlx4_core/mlx4_mcg.c ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4_mcg.c Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/mlx4_core/mlx4_mcg.c Fri Jan 12 06:36:44 2018 (r327864) @@ -1352,7 +1352,7 @@ static int mlx4_QP_ATTACH(struct mlx4_dev *dev, struct qpn = qp->qpn; qpn |= (prot << 28); if (attach && block_loopback) - qpn |= (1 << 31); + qpn |= (1U << 31); err = mlx4_cmd(dev, mailbox->dma, qpn, attach, MLX4_CMD_QP_ATTACH, MLX4_CMD_TIME_CLASS_A, Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c Fri Jan 12 06:36:44 2018 (r327864) @@ -600,16 +600,16 @@ mlx4_en_store_inline_header(volatile struct mlx4_wqe_d if (unlikely(len < MIN_PKT_LEN)) { *(volatile uint32_t *)inl = - SET_BYTE_COUNT((1 << 31) | MIN_PKT_LEN); + SET_BYTE_COUNT((1U << 31) | MIN_PKT_LEN); } else if (len <= spc) { *(volatile uint32_t *)inl = - SET_BYTE_COUNT((1 << 31) | len); + SET_BYTE_COUNT((1U << 31) | len); } else { *(volatile uint32_t *)(inl + 4 + spc) = - SET_BYTE_COUNT((1 << 31) | (len - spc)); + SET_BYTE_COUNT((1U << 31) | (len - spc)); wmb(); *(volatile uint32_t *)inl = - SET_BYTE_COUNT((1 << 31) | spc); + SET_BYTE_COUNT((1U << 31) | spc); } } @@ -885,7 +885,7 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int dseg->addr = 0; dseg->lkey = 0; wmb(); - dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0); + dseg->byte_count = SET_BYTE_COUNT((1U << 31)|0); } /* fill segment list */ @@ -895,7 +895,7 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int dseg->addr = 0; dseg->lkey = 0; wmb(); - dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0); + dseg->byte_count = SET_BYTE_COUNT((1U << 31)|0); } else { dseg--; dseg->addr = cpu_to_be64((uint64_t)segs[nr_segs].ds_addr); Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h Fri Jan 12 06:36:44 2018 (r327864) @@ -195,7 +195,7 @@ enum mlx4_ib_qp_flags { /* Mellanox specific flags start from IB_QP_CREATE_RESERVED_START */ MLX4_IB_ROCE_V2_GSI_QP = MLX4_IB_QP_CREATE_ROCE_V2_GSI, MLX4_IB_SRIOV_TUNNEL_QP = 1 << 30, - MLX4_IB_SRIOV_SQP = 1 << 31, + MLX4_IB_SRIOV_SQP = 1U << 31, }; struct mlx4_ib_gid_entry { Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c Fri Jan 12 06:36:44 2018 (r327864) @@ -263,7 +263,7 @@ static void post_nop_wqe(struct mlx4_ib_qp *qp, int n, /* Pad the remainder of the WQE with an inline data segment. */ if (size > s) { inl = wqe + s; - inl->byte_count = cpu_to_be32(1 << 31 | (size - s - sizeof *inl)); + inl->byte_count = cpu_to_be32(1U << 31 | (size - s - sizeof *inl)); } ctrl->srcrb_flags = 0; ctrl->fence_size = size / 16; @@ -274,7 +274,7 @@ static void post_nop_wqe(struct mlx4_ib_qp *qp, int n, wmb(); ctrl->owner_opcode = cpu_to_be32(MLX4_OPCODE_NOP | MLX4_WQE_CTRL_NEC) | - (n & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0); + (n & qp->sq.wqe_cnt ? cpu_to_be32(1U << 31) : 0); stamp_send_wqe(qp, n + qp->sq_spare_wqes, size); } @@ -1992,7 +1992,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, for (i = 0; i < qp->sq.wqe_cnt; ++i) { ctrl = get_send_wqe(qp, i); - ctrl->owner_opcode = cpu_to_be32(1 << 31); + ctrl->owner_opcode = cpu_to_be32(1U << 31); if (qp->sq_max_wqes_per_wr == 1) ctrl->fence_size = 1 << (qp->sq.wqe_shift - 4); @@ -2653,11 +2653,11 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, s spc = MLX4_INLINE_ALIGN - ((unsigned long) (inl + 1) & (MLX4_INLINE_ALIGN - 1)); if (header_size <= spc) { - inl->byte_count = cpu_to_be32(1 << 31 | header_size); + inl->byte_count = cpu_to_be32(1U << 31 | header_size); memcpy(inl + 1, sqp->header_buf, header_size); i = 1; } else { - inl->byte_count = cpu_to_be32(1 << 31 | spc); + inl->byte_count = cpu_to_be32(1U << 31 | spc); memcpy(inl + 1, sqp->header_buf, spc); inl = (void *) (inl + 1) + spc; @@ -2676,7 +2676,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, s * of 16 mod 64. */ wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | (header_size - spc)); + inl->byte_count = cpu_to_be32(1U << 31 | (header_size - spc)); i = 2; } @@ -3213,7 +3213,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_se } ctrl->owner_opcode = mlx4_ib_opcode[wr->opcode] | - (ind & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0) | blh; + (ind & qp->sq.wqe_cnt ? cpu_to_be32(1U << 31) : 0) | blh; stamp = ind + qp->sq_spare_wqes; ind += DIV_ROUND_UP(size * 16, 1U << qp->sq.wqe_shift); Modified: head/sys/dev/mlx4/qp.h ============================================================================== --- head/sys/dev/mlx4/qp.h Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx4/qp.h Fri Jan 12 06:36:44 2018 (r327864) @@ -283,7 +283,7 @@ enum { /* param3 */ #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) enum { - MLX4_WQE_CTRL_OWN = 1 << 31, + MLX4_WQE_CTRL_OWN = 1U << 31, MLX4_WQE_CTRL_NEC = 1 << 29, MLX4_WQE_CTRL_RR = 1 << 6, MLX4_WQE_CTRL_IIP = 1 << 28, @@ -371,7 +371,7 @@ struct mlx4_wqe_lso_seg { enum mlx4_wqe_bind_seg_flags2 { MLX4_WQE_BIND_ZERO_BASED = (1 << 30), - MLX4_WQE_BIND_TYPE_2 = (1 << 31), + MLX4_WQE_BIND_TYPE_2 = (1U << 31), }; struct mlx4_wqe_bind_seg { @@ -388,7 +388,7 @@ enum { MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_READ = 1 << 29, MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_WRITE = 1 << 30, - MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC = 1 << 31 + MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC = 1U << 31 }; struct mlx4_wqe_fmr_seg { @@ -445,7 +445,7 @@ struct mlx4_wqe_data_seg { enum { MLX4_INLINE_ALIGN = 64, - MLX4_INLINE_SEG = 1 << 31, + MLX4_INLINE_SEG = 1U << 31, }; struct mlx4_wqe_inline_seg { Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx5/device.h Fri Jan 12 06:36:44 2018 (r327864) @@ -164,7 +164,7 @@ enum { }; enum { - MLX5_MKEY_INBOX_PG_ACCESS = 1 << 31 + MLX5_MKEY_INBOX_PG_ACCESS = 1U << 31 }; enum { @@ -188,7 +188,7 @@ enum { MLX5_MKEY_REMOTE_INVAL = 1 << 24, MLX5_MKEY_FLAG_SYNC_UMR = 1 << 29, MLX5_MKEY_BSF_EN = 1 << 30, - MLX5_MKEY_LEN64 = 1 << 31, + MLX5_MKEY_LEN64 = 1U << 31, }; enum { Modified: head/sys/dev/mlx5/qp.h ============================================================================== --- head/sys/dev/mlx5/qp.h Fri Jan 12 04:31:52 2018 (r327863) +++ head/sys/dev/mlx5/qp.h Fri Jan 12 06:36:44 2018 (r327864) @@ -159,7 +159,7 @@ enum { MLX5_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, MLX5_WQE_FMR_PERM_REMOTE_READ = 1 << 29, MLX5_WQE_FMR_PERM_REMOTE_WRITE = 1 << 30, - MLX5_WQE_FMR_PERM_ATOMIC = 1 << 31 + MLX5_WQE_FMR_PERM_ATOMIC = 1U << 31 }; enum { @@ -174,7 +174,7 @@ enum { MLX5_QP_DRAIN_SIGERR = 1 << 26, MLX5_QP_LAT_SENSITIVE = 1 << 28, MLX5_QP_BLOCK_MCAST = 1 << 30, - MLX5_QP_ENABLE_SIG = 1 << 31, + MLX5_QP_ENABLE_SIG = 1U << 31, }; enum { From owner-svn-src-all@freebsd.org Fri Jan 12 06:37:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C2DEE76158; Fri, 12 Jan 2018 06:37:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 562AC7A1AC; Fri, 12 Jan 2018 06:37:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B90120137; Fri, 12 Jan 2018 06:37:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0C6brVK069887; Fri, 12 Jan 2018 06:37:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C6brSX069884; Fri, 12 Jan 2018 06:37:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801120637.w0C6brSX069884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 12 Jan 2018 06:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327865 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 327865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 06:37:54 -0000 Author: eadler Date: Fri Jan 12 06:37:53 2018 New Revision: 327865 URL: https://svnweb.freebsd.org/changeset/base/327865 Log: sys/dev/e1000: fix uses of 1 << 31 Reviewed by: erj (D13858) Modified: head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_regs.h Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Fri Jan 12 06:36:44 2018 (r327864) +++ head/sys/dev/e1000/e1000_82575.h Fri Jan 12 06:37:53 2018 (r327865) @@ -385,7 +385,7 @@ struct e1000_adv_tx_context_desc { #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) #define E1000_ETQF_1588 (1 << 30) -#define E1000_ETQF_QUEUE_ENABLE (1 << 31) +#define E1000_ETQF_QUEUE_ENABLE (1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -412,7 +412,7 @@ struct e1000_adv_tx_context_desc { #define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */ #define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8 #define E1000_DTXSWC_LLE_SHIFT 16 -#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */ +#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1U << 31) /* global VF LB enable */ /* Easy defines for setting default pool, would normally be left a zero */ #define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7 Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Fri Jan 12 06:36:44 2018 (r327864) +++ head/sys/dev/e1000/e1000_ich8lan.c Fri Jan 12 06:37:53 2018 (r327865) @@ -5202,7 +5202,7 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1 /* Device Status */ if (hw->mac.type == e1000_ich8lan) { reg = E1000_READ_REG(hw, E1000_STATUS); - reg &= ~(1 << 31); + reg &= ~(1U << 31); E1000_WRITE_REG(hw, E1000_STATUS, reg); } Modified: head/sys/dev/e1000/e1000_regs.h ============================================================================== --- head/sys/dev/e1000/e1000_regs.h Fri Jan 12 06:36:44 2018 (r327864) +++ head/sys/dev/e1000/e1000_regs.h Fri Jan 12 06:37:53 2018 (r327865) @@ -215,7 +215,7 @@ /* QAV Tx mode control register bitfields masks */ #define E1000_TQAVCC_IDLE_SLOPE 0xFFFF /* Idle slope */ #define E1000_TQAVCC_KEEP_CREDITS (1 << 30) /* Keep credits opt enable */ -#define E1000_TQAVCC_QUEUE_MODE (1 << 31) /* SP vs. SR Tx mode */ +#define E1000_TQAVCC_QUEUE_MODE (1U << 31) /* SP vs. SR Tx mode */ /* Good transmitted packets counter registers */ #define E1000_PQGPTC(_n) (0x010014 + (0x100 * (_n))) From owner-svn-src-all@freebsd.org Fri Jan 12 06:40:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9B0EE7642C; Fri, 12 Jan 2018 06:40: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9524E7A41B; Fri, 12 Jan 2018 06:40:59 +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 E4B3820193; Fri, 12 Jan 2018 06:40: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 w0C6ew4Z070037; Fri, 12 Jan 2018 06:40:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C6ewTd070036; Fri, 12 Jan 2018 06:40:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801120640.w0C6ewTd070036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 12 Jan 2018 06:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327866 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 327866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 06:40:59 -0000 Author: cem Date: Fri Jan 12 06:40:58 2018 New Revision: 327866 URL: https://svnweb.freebsd.org/changeset/base/327866 Log: aesni(4): Quiesce spurious GCC 6.3.0 -Wmaybe-uninitialized warnings Always initialize some variables GCC warns about. They are initialized in every path where they are used, but GCC doesn't know that. Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Fri Jan 12 06:37:53 2018 (r327865) +++ head/sys/crypto/aesni/aesni.c Fri Jan 12 06:40:58 2018 (r327866) @@ -724,6 +724,8 @@ aesni_cipher_process(struct aesni_session *ses, struct return (EINVAL); } + ctx = NULL; + ctxidx = 0; error = 0; kt = is_fpu_kern_thread(0); if (!kt) { @@ -775,6 +777,9 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c KASSERT(ses->algo != CRYPTO_AES_NIST_GCM_16 || authcrd != NULL, ("AES_NIST_GCM_16 must include MAC descriptor")); + + ivlen = 0; + authbuf = NULL; buf = aesni_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) From owner-svn-src-all@freebsd.org Fri Jan 12 07:55:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CD0E794E2; Fri, 12 Jan 2018 07:55:51 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4B107CB20; Fri, 12 Jan 2018 07:55:50 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DA0720E69; Fri, 12 Jan 2018 07:55:50 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0C7tod9003217; Fri, 12 Jan 2018 07:55:50 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0C7tntv003214; Fri, 12 Jan 2018 07:55:49 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801120755.w0C7tntv003214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 12 Jan 2018 07:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327867 - in head/sys: conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv X-SVN-Commit-Revision: 327867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 07:55:51 -0000 Author: wma Date: Fri Jan 12 07:55:49 2018 New Revision: 327867 URL: https://svnweb.freebsd.org/changeset/base/327867 Log: PowerNV: initial support for PCIe host controller Provide initial support for PCIe host controller as well as for IOMMU mapping. This commit allows proper bus enumeration, but does not guarantee DMA operations are working. Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Added: head/sys/powerpc/powernv/opal_pci.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Jan 12 06:40:58 2018 (r327866) +++ head/sys/conf/files.powerpc Fri Jan 12 07:55:49 2018 (r327867) @@ -185,6 +185,8 @@ powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_console.c optional powernv +powerpc/powernv/opal_dev.c optional powernv +powerpc/powernv/opal_pci.c optional powernv pci powerpc/powernv/opalcall.S optional powernv powerpc/powernv/platform_powernv.c optional powernv powerpc/powerpc/altivec.c optional powerpc | powerpc64 Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Fri Jan 12 06:40:58 2018 (r327866) +++ head/sys/powerpc/powernv/opal.h Fri Jan 12 07:55:49 2018 (r327867) @@ -38,13 +38,40 @@ int opal_check(void); /* Call an OPAL method. Any pointers passed must be real-mode accessible! */ int opal_call(uint64_t token, ...); -#define OPAL_CONSOLE_WRITE 1 -#define OPAL_CONSOLE_READ 2 -#define OPAL_CEC_POWER_DOWN 5 -#define OPAL_CEC_REBOOT 6 -#define OPAL_START_CPU 41 +#define OPAL_CONSOLE_WRITE 1 +#define OPAL_CONSOLE_READ 2 +#define OPAL_CEC_POWER_DOWN 5 +#define OPAL_CEC_REBOOT 6 +#define OPAL_HANDLE_INTERRUPT 9 +#define OPAL_PCI_CONFIG_READ_BYTE 13 +#define OPAL_PCI_CONFIG_READ_HALF_WORD 14 +#define OPAL_PCI_CONFIG_READ_WORD 15 +#define OPAL_PCI_CONFIG_WRITE_BYTE 16 +#define OPAL_PCI_CONFIG_WRITE_HALF_WORD 17 +#define OPAL_PCI_CONFIG_WRITE_WORD 18 +#define OPAL_PCI_EEH_FREEZE_CLEAR 26 +#define OPAL_PCI_PHB_MMIO_ENABLE 27 +#define OPAL_PCI_SET_PHB_MEM_WINDOW 28 +#define OPAL_PCI_MAP_PE_MMIO_WINDOW 29 +#define OPAL_PCI_SET_XIVE_PE 37 +#define OPAL_PCI_RESET 49 +#define OPAL_PCI_POLL 62 +#define OPAL_PCI_SET_PE 31 +#define OPAL_START_CPU 41 +#define OPAL_GET_MSI_32 39 +#define OPAL_GET_MSI_64 40 +#define OPAL_PCI_MSI_EOI 63 +#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 +#define OPAL_RETURN_CPU 69 +#define OPAL_REINIT_CPUS 70 -#define OPAL_SUCCESS 0 -#define OPAL_BUSY_EVENT -12 +/* For OPAL_PCI_SET_PE */ +#define OPAL_UNMAP_PE 0 +#define OPAL_MAP_PE 1 + +#define OPAL_SUCCESS 0 +#define OPAL_PARAMETER -1 +#define OPAL_CLOSED -5 +#define OPAL_BUSY_EVENT -12 #endif Added: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_pci.c Fri Jan 12 07:55:49 2018 (r327867) @@ -0,0 +1,576 @@ +/*- + * Copyright (c) 2015-2016 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include "pcib_if.h" +#include "pic_if.h" +#include "iommu_if.h" +#include "opal.h" + +/* + * Device interface. + */ +static int opalpci_probe(device_t); +static int opalpci_attach(device_t); + +/* + * pcib interface. + */ +static uint32_t opalpci_read_config(device_t, u_int, u_int, u_int, + u_int, int); +static void opalpci_write_config(device_t, u_int, u_int, u_int, + u_int, u_int32_t, int); +static int opalpci_alloc_msi(device_t dev, device_t child, + int count, int maxcount, int *irqs); +static int opalpci_release_msi(device_t dev, device_t child, + int count, int *irqs); +static int opalpci_alloc_msix(device_t dev, device_t child, + int *irq); +static int opalpci_release_msix(device_t dev, device_t child, + int irq); +static int opalpci_map_msi(device_t dev, device_t child, + int irq, uint64_t *addr, uint32_t *data); +static int opalpci_route_interrupt(device_t bus, device_t dev, int pin); + +/* + * MSI PIC interface. + */ +static void opalpic_pic_enable(device_t dev, u_int irq, u_int vector); +static void opalpic_pic_eoi(device_t dev, u_int irq); +static void opalpic_pic_mask(device_t dev, u_int irq); +static void opalpic_pic_unmask(device_t dev, u_int irq); + +/* + * Commands + */ +#define OPAL_M32_WINDOW_TYPE 1 +#define OPAL_M64_WINDOW_TYPE 2 +#define OPAL_IO_WINDOW_TYPE 3 + +#define OPAL_RESET_PHB_COMPLETE 1 +#define OPAL_RESET_PCI_IODA_TABLE 6 + +#define OPAL_DISABLE_M64 0 +#define OPAL_ENABLE_M64_SPLIT 1 +#define OPAL_ENABLE_M64_NON_SPLIT 2 + +#define OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO 1 +#define OPAL_EEH_ACTION_CLEAR_FREEZE_DMA 2 +#define OPAL_EEH_ACTION_CLEAR_FREEZE_ALL 3 + +/* + * Constants + */ +#define OPAL_PCI_DEFAULT_PE 1 + +/* + * Driver methods. + */ +static device_method_t opalpci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opalpci_probe), + DEVMETHOD(device_attach, opalpci_attach), + + /* pcib interface */ + DEVMETHOD(pcib_read_config, opalpci_read_config), + DEVMETHOD(pcib_write_config, opalpci_write_config), + + DEVMETHOD(pcib_alloc_msi, opalpci_alloc_msi), + DEVMETHOD(pcib_release_msi, opalpci_release_msi), + DEVMETHOD(pcib_alloc_msix, opalpci_alloc_msix), + DEVMETHOD(pcib_release_msix, opalpci_release_msix), + DEVMETHOD(pcib_map_msi, opalpci_map_msi), + DEVMETHOD(pcib_route_interrupt, opalpci_route_interrupt), + + /* PIC interface for MSIs */ + DEVMETHOD(pic_enable, opalpic_pic_enable), + DEVMETHOD(pic_eoi, opalpic_pic_eoi), + DEVMETHOD(pic_mask, opalpic_pic_mask), + DEVMETHOD(pic_unmask, opalpic_pic_unmask), + + DEVMETHOD_END +}; + +struct opalpci_softc { + struct ofw_pci_softc ofw_sc; + uint64_t phb_id; + vmem_t *msi_vmem; + int msi_base; /* Base XIVE number */ + int base_msi_irq; /* Base IRQ assigned by FreeBSD to this PIC */ +}; + +static devclass_t opalpci_devclass; +DEFINE_CLASS_1(pcib, opalpci_driver, opalpci_methods, + sizeof(struct opalpci_softc), ofw_pci_driver); +EARLY_DRIVER_MODULE(opalpci, ofwbus, opalpci_driver, opalpci_devclass, 0, 0, + BUS_PASS_BUS); + +static int +opalpci_probe(device_t dev) +{ + const char *type; + + if (opal_check() != 0) + return (ENXIO); + + type = ofw_bus_get_type(dev); + + if (type == NULL || (strcmp(type, "pci") != 0 && + strcmp(type, "pciex") != 0)) + return (ENXIO); + + if (!OF_hasprop(ofw_bus_get_node(dev), "ibm,opal-phbid")) + return (ENXIO); + + device_set_desc(dev, "OPAL Host-PCI bridge"); + return (BUS_PROBE_GENERIC); +} + +static int +opalpci_attach(device_t dev) +{ + struct opalpci_softc *sc; + cell_t id[2], m64window[6], npe; + int i, err; + + sc = device_get_softc(dev); + + switch (OF_getproplen(ofw_bus_get_node(dev), "ibm,opal-phbid")) { + case 8: + OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-phbid", id, 8); + sc->phb_id = ((uint64_t)id[0] << 32) | id[1]; + break; + case 4: + OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-phbid", id, 4); + sc->phb_id = id[0]; + break; + default: + device_printf(dev, "PHB ID property had wrong length (%zd)\n", + OF_getproplen(ofw_bus_get_node(dev), "ibm,opal-phbid")); + return (ENXIO); + } + + if (bootverbose) + device_printf(dev, "OPAL ID %#lx\n", sc->phb_id); + + /* + * Reset PCI IODA table + */ + err = opal_call(OPAL_PCI_RESET, sc->phb_id, OPAL_RESET_PCI_IODA_TABLE, + 1); + if (err != 0) { + device_printf(dev, "IODA table reset failed: %d\n", err); + return (ENXIO); + } + while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) + DELAY(1000*err); /* Returns expected delay in ms */ + if (err < 0) { + device_printf(dev, "PHB IODA reset poll failed: %d\n", err); + return (ENXIO); + } + + /* + * Reset everything. Especially important if we have inherited the + * system from Linux by kexec() + */ +#ifdef NOTYET + if (bootverbose) + device_printf(dev, "Resetting PCI bus\n"); + err = opal_call(OPAL_PCI_RESET, sc->phb_id, OPAL_RESET_PHB_COMPLETE, 1); + if (err < 0) { + device_printf(dev, "PHB reset failed: %d\n", err); + return (ENXIO); + } + while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) + DELAY(1000*err); /* Returns expected delay in ms */ + if (err < 0) { + device_printf(dev, "PHB reset poll failed: %d\n", err); + return (ENXIO); + } + DELAY(10000); + err = opal_call(OPAL_PCI_RESET, sc->phb_id, OPAL_RESET_PHB_COMPLETE, 0); + if (err < 0) { + device_printf(dev, "PHB reset completion failed: %d\n", err); + return (ENXIO); + } + while ((err = opal_call(OPAL_PCI_POLL, sc->phb_id)) > 0) + DELAY(1000*err); /* Returns expected delay in ms */ + if (err < 0) { + device_printf(dev, "PHB reset completion poll failed: %d\n", + err); + return (ENXIO); + } + DELAY(10000); +#endif + + /* + * Map all devices on the bus to partitionable endpoint one until + * such time as we start wanting to do things like bhyve. + */ + err = opal_call(OPAL_PCI_SET_PE, sc->phb_id, OPAL_PCI_DEFAULT_PE, + 0, 0, 0, 0, /* All devices */ + OPAL_MAP_PE); + if (err != 0) { + device_printf(dev, "PE mapping failed: %d\n", err); + return (ENXIO); + } + + /* + * Turn on MMIO, mapped to PE 1 + */ + if (OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-num-pes", &npe, 4) + != 4) + npe = 1; + for (i = 0; i < npe; i++) { + err = opal_call(OPAL_PCI_MAP_PE_MMIO_WINDOW, sc->phb_id, + OPAL_PCI_DEFAULT_PE, OPAL_M32_WINDOW_TYPE, 0, i); + if (err != 0) + device_printf(dev, "MMIO %d map failed: %d\n", i, err); + } + + /* XXX: multiple M64 windows? */ + if (OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-m64-window", + m64window, sizeof(m64window)) == sizeof(m64window)) { + opal_call(OPAL_PCI_SET_PHB_MEM_WINDOW, sc->phb_id, + OPAL_M64_WINDOW_TYPE, 0 /* index */, + ((uint64_t)m64window[2] << 32) | m64window[3], 0, + ((uint64_t)m64window[4] << 32) | m64window[5]); + opal_call(OPAL_PCI_MAP_PE_MMIO_WINDOW, sc->phb_id, + OPAL_PCI_DEFAULT_PE, OPAL_M64_WINDOW_TYPE, + 0 /* index */, 0); + opal_call(OPAL_PCI_PHB_MMIO_ENABLE, sc->phb_id, + OPAL_M64_WINDOW_TYPE, 0, OPAL_ENABLE_M64_NON_SPLIT); + } + + /* + * Also disable the IOMMU for the time being for PE 1 (everything) + */ + if (bootverbose) + device_printf(dev, "Mapping 0-%#lx for DMA\n", + roundup2(powerpc_ptob(Maxmem), 16*1024*1024)); + err = opal_call(OPAL_PCI_MAP_PE_DMA_WINDOW_REAL, sc->phb_id, + OPAL_PCI_DEFAULT_PE, OPAL_PCI_DEFAULT_PE << 1, + 0 /* start address */, roundup2(powerpc_ptob(Maxmem), + 16*1024*1024)/* all RAM */); + if (err != 0) { + device_printf(dev, "DMA mapping failed: %d\n", err); + return (ENXIO); + } + + /* + * Get MSI properties + */ + sc->msi_vmem = NULL; + if (OF_getproplen(ofw_bus_get_node(dev), "ibm,opal-msi-ranges") > 0) { + cell_t msi_ranges[2]; + OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-msi-ranges", + msi_ranges, sizeof(msi_ranges)); + sc->msi_base = msi_ranges[0]; + + sc->msi_vmem = vmem_create("OPAL MSI", msi_ranges[0], + msi_ranges[1], 1, 16, M_BESTFIT | M_WAITOK); + + sc->base_msi_irq = powerpc_register_pic(dev, + OF_xref_from_node(ofw_bus_get_node(dev)), + msi_ranges[0] + msi_ranges[1], 0, FALSE); + + if (bootverbose) + device_printf(dev, "Supports %d MSIs starting at %d\n", + msi_ranges[1], msi_ranges[0]); + } + + /* + * General OFW PCI attach + */ + err = ofw_pci_init(dev); + if (err != 0) + return (err); + + /* + * Unfreeze non-config-space PCI operations. Let this fail silently + * if e.g. there is no current freeze. + */ + opal_call(OPAL_PCI_EEH_FREEZE_CLEAR, sc->phb_id, OPAL_PCI_DEFAULT_PE, + OPAL_EEH_ACTION_CLEAR_FREEZE_ALL); + + /* + * OPAL stores 64-bit BARs in a special property rather than "ranges" + */ + if (OF_getencprop(ofw_bus_get_node(dev), "ibm,opal-m64-window", + m64window, sizeof(m64window)) == sizeof(m64window)) { + struct ofw_pci_range *rp; + + sc->ofw_sc.sc_nrange++; + sc->ofw_sc.sc_range = realloc(sc->ofw_sc.sc_range, + sc->ofw_sc.sc_nrange * sizeof(sc->ofw_sc.sc_range[0]), + M_DEVBUF, M_WAITOK); + rp = &sc->ofw_sc.sc_range[sc->ofw_sc.sc_nrange-1]; + rp->pci_hi = OFW_PCI_PHYS_HI_SPACE_MEM64 | + OFW_PCI_PHYS_HI_PREFETCHABLE; + rp->pci = ((uint64_t)m64window[0] << 32) | m64window[1]; + rp->host = ((uint64_t)m64window[2] << 32) | m64window[3]; + rp->size = ((uint64_t)m64window[4] << 32) | m64window[5]; + rman_manage_region(&sc->ofw_sc.sc_mem_rman, rp->pci, + rp->pci + rp->size - 1); + } + + return (ofw_pci_attach(dev)); +} + +static uint32_t +opalpci_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, + int width) +{ + struct opalpci_softc *sc; + uint64_t config_addr; + uint8_t byte; + uint16_t half; + uint32_t word; + int error; + + sc = device_get_softc(dev); + + config_addr = (bus << 8) | ((slot & 0x1f) << 3) | (func & 0x7); + + switch (width) { + case 1: + error = opal_call(OPAL_PCI_CONFIG_READ_BYTE, sc->phb_id, + config_addr, reg, vtophys(&byte)); + word = byte; + break; + case 2: + error = opal_call(OPAL_PCI_CONFIG_READ_HALF_WORD, sc->phb_id, + config_addr, reg, vtophys(&half)); + word = half; + break; + case 4: + error = opal_call(OPAL_PCI_CONFIG_READ_WORD, sc->phb_id, + config_addr, reg, vtophys(&word)); + break; + default: + word = 0xffffffff; + } + + /* + * Poking config state for non-existant devices can make + * the host bridge hang up. Clear any errors. + * + * XXX: Make this conditional on the existence of a freeze + */ + opal_call(OPAL_PCI_EEH_FREEZE_CLEAR, sc->phb_id, OPAL_PCI_DEFAULT_PE, + OPAL_EEH_ACTION_CLEAR_FREEZE_ALL); + + if (error != OPAL_SUCCESS) + word = 0xffffffff; + + return (word); +} + +static void +opalpci_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int width) +{ + struct opalpci_softc *sc; + uint64_t config_addr; + int error = OPAL_SUCCESS; + + sc = device_get_softc(dev); + + config_addr = (bus << 8) | ((slot & 0x1f) << 3) | (func & 0x7); + + switch (width) { + case 1: + error = opal_call(OPAL_PCI_CONFIG_WRITE_BYTE, sc->phb_id, + config_addr, reg, val); + break; + case 2: + error = opal_call(OPAL_PCI_CONFIG_WRITE_HALF_WORD, sc->phb_id, + config_addr, reg, val); + break; + case 4: + error = opal_call(OPAL_PCI_CONFIG_WRITE_WORD, sc->phb_id, + config_addr, reg, val); + break; + } + + if (error != OPAL_SUCCESS) { + /* + * Poking config state for non-existant devices can make + * the host bridge hang up. Clear any errors. + */ + opal_call(OPAL_PCI_EEH_FREEZE_CLEAR, sc->phb_id, + OPAL_PCI_DEFAULT_PE, OPAL_EEH_ACTION_CLEAR_FREEZE_ALL); + } +} + +static int +opalpci_route_interrupt(device_t bus, device_t dev, int pin) +{ + return (pin); +} + +static int +opalpci_alloc_msi(device_t dev, device_t child, int count, int maxcount, + int *irqs) +{ + struct opalpci_softc *sc; + vmem_addr_t start; + phandle_t xref; + int err, i; + + sc = device_get_softc(dev); + if (sc->msi_vmem == NULL) + return (ENODEV); + + err = vmem_xalloc(sc->msi_vmem, count, powerof2(count), 0, 0, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, M_BESTFIT | M_WAITOK, &start); + + if (err) + return (err); + + xref = OF_xref_from_node(ofw_bus_get_node(dev)); + for (i = 0; i < count; i++) + irqs[i] = MAP_IRQ(xref, start + i); + + return (0); +} + +static int +opalpci_release_msi(device_t dev, device_t child, int count, int *irqs) +{ + struct opalpci_softc *sc; + + sc = device_get_softc(dev); + if (sc->msi_vmem == NULL) + return (ENODEV); + + vmem_xfree(sc->msi_vmem, irqs[0] - sc->base_msi_irq, count); + return (0); +} + +static int +opalpci_alloc_msix(device_t dev, device_t child, int *irq) +{ + return (opalpci_alloc_msi(dev, child, 1, 1, irq)); +} + +static int +opalpci_release_msix(device_t dev, device_t child, int irq) +{ + return (opalpci_release_msi(dev, child, 1, &irq)); +} + +static int +opalpci_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + struct opalpci_softc *sc; + struct pci_devinfo *dinfo; + int err, xive; + + sc = device_get_softc(dev); + if (sc->msi_vmem == NULL) + return (ENODEV); + + xive = irq - sc->base_msi_irq - sc->msi_base; + opal_call(OPAL_PCI_SET_XIVE_PE, sc->phb_id, OPAL_PCI_DEFAULT_PE, xive); + + dinfo = device_get_ivars(child); + if (dinfo->cfg.msi.msi_alloc > 0 && + (dinfo->cfg.msi.msi_ctrl & PCIM_MSICTRL_64BIT) == 0) { + uint32_t msi32; + err = opal_call(OPAL_GET_MSI_32, sc->phb_id, + OPAL_PCI_DEFAULT_PE, xive, 1, vtophys(&msi32), + vtophys(data)); + *addr = be32toh(msi32); + } else { + err = opal_call(OPAL_GET_MSI_64, sc->phb_id, + OPAL_PCI_DEFAULT_PE, xive, 1, vtophys(addr), vtophys(data)); + *addr = be64toh(*addr); + } + *data = be32toh(*data); + + if (bootverbose && err != 0) + device_printf(child, "OPAL MSI mapping error: %d\n", err); + + return ((err == 0) ? 0 : ENXIO); +} + +static void +opalpic_pic_enable(device_t dev, u_int irq, u_int vector) +{ + PIC_ENABLE(root_pic, irq, vector); +} + +static void opalpic_pic_eoi(device_t dev, u_int irq) +{ + struct opalpci_softc *sc; + + sc = device_get_softc(dev); + opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq); + + PIC_EOI(root_pic, irq); +} + +static void opalpic_pic_mask(device_t dev, u_int irq) +{ + PIC_MASK(root_pic, irq); +} + +static void opalpic_pic_unmask(device_t dev, u_int irq) +{ + PIC_UNMASK(root_pic, irq); +} + + From owner-svn-src-all@freebsd.org Fri Jan 12 10:51:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22638EA51B3; Fri, 12 Jan 2018 10:51:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F20BA82D31; Fri, 12 Jan 2018 10:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4758522AFB; Fri, 12 Jan 2018 10:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CAphTh077233; Fri, 12 Jan 2018 10:51:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CAphvn077232; Fri, 12 Jan 2018 10:51:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801121051.w0CAphvn077232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Jan 2018 10:51:43 +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: r327870 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 327870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 10:51:44 -0000 Author: kib Date: Fri Jan 12 10:51:42 2018 New Revision: 327870 URL: https://svnweb.freebsd.org/changeset/base/327870 Log: MFC r327730: Fix year. Modified: stable/11/share/man/man4/smp.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/smp.4 ============================================================================== --- stable/11/share/man/man4/smp.4 Fri Jan 12 10:01:09 2018 (r327869) +++ stable/11/share/man/man4/smp.4 Fri Jan 12 10:51:42 2018 (r327870) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2017 +.Dd January 6, 2018 .Dt SMP 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Fri Jan 12 10:54:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 306CEEA551F; Fri, 12 Jan 2018 10:54:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9214830AC; Fri, 12 Jan 2018 10:54:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31C3522B33; Fri, 12 Jan 2018 10:54:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CAs1MX078240; Fri, 12 Jan 2018 10:54:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CAs0oF078233; Fri, 12 Jan 2018 10:54:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801121054.w0CAs0oF078233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 12 Jan 2018 10:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327871 - in stable/11: sys/amd64/amd64 sys/dev/cpuctl sys/sys sys/x86/include sys/x86/x86 usr.sbin/cpucontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: sys/amd64/amd64 sys/dev/cpuctl sys/sys sys/x86/include sys/x86/x86 usr.sbin/cpucontrol X-SVN-Commit-Revision: 327871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 10:54:02 -0000 Author: kib Date: Fri Jan 12 10:54:00 2018 New Revision: 327871 URL: https://svnweb.freebsd.org/changeset/base/327871 Log: MFC r327597: Make it possible to re-evaluate cpu_features. Modified: stable/11/sys/amd64/amd64/machdep.c stable/11/sys/dev/cpuctl/cpuctl.c stable/11/sys/sys/cpuctl.h stable/11/sys/x86/include/x86_var.h stable/11/sys/x86/x86/identcpu.c stable/11/usr.sbin/cpucontrol/cpucontrol.8 stable/11/usr.sbin/cpucontrol/cpucontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/sys/amd64/amd64/machdep.c Fri Jan 12 10:54:00 2018 (r327871) @@ -1544,7 +1544,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) kmdp = init_ops.parse_preload_data(modulep); - identify_cpu(); + identify_cpu1(); identify_hypervisor(); /* Init basic tunables, hz etc */ Modified: stable/11/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/11/sys/dev/cpuctl/cpuctl.c Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/sys/dev/cpuctl/cpuctl.c Fri Jan 12 10:54:00 2018 (r327871) @@ -71,6 +71,7 @@ static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_ struct thread *td); static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td); +static int cpuctl_do_eval_cpu_features(int cpu, struct thread *td); static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data, struct thread *td); static int update_intel(int cpu, cpuctl_update_args_t *args, @@ -157,7 +158,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t dat } /* Require write flag for "write" requests. */ if ((cmd == CPUCTL_MSRCBIT || cmd == CPUCTL_MSRSBIT || - cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR) && + cmd == CPUCTL_UPDATE || cmd == CPUCTL_WRMSR || + cmd == CPUCTL_EVAL_CPU_FEATURES) && (flags & FWRITE) == 0) return (EPERM); switch (cmd) { @@ -185,6 +187,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t dat ret = cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data, td); break; + case CPUCTL_EVAL_CPU_FEATURES: + ret = cpuctl_do_eval_cpu_features(cpu, td); + break; default: ret = EINVAL; break; @@ -501,6 +506,29 @@ fail: free(ptr, M_CPUCTL); return (ret); } + +static int +cpuctl_do_eval_cpu_features(int cpu, struct thread *td) +{ + int is_bound = 0; + int oldcpu; + + KASSERT(cpu >= 0 && cpu <= mp_maxid, + ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); + +#ifdef __i386__ + if (cpu_id == 0) + return (ENODEV); +#endif + oldcpu = td->td_oncpu; + is_bound = cpu_sched_is_bound(td); + set_cpu(cpu, td); + identify_cpu1(); + identify_cpu2(); + restore_cpu(oldcpu, is_bound, td); + return (0); +} + int cpuctl_open(struct cdev *dev, int flags, int fmt __unused, struct thread *td) Modified: stable/11/sys/sys/cpuctl.h ============================================================================== --- stable/11/sys/sys/cpuctl.h Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/sys/sys/cpuctl.h Fri Jan 12 10:54:00 2018 (r327871) @@ -57,5 +57,6 @@ typedef struct { #define CPUCTL_MSRSBIT _IOWR('c', 5, cpuctl_msr_args_t) #define CPUCTL_MSRCBIT _IOWR('c', 6, cpuctl_msr_args_t) #define CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_count_args_t) +#define CPUCTL_EVAL_CPU_FEATURES _IO('c', 8) #endif /* _CPUCTL_H_ */ Modified: stable/11/sys/x86/include/x86_var.h ============================================================================== --- stable/11/sys/x86/include/x86_var.h Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/sys/x86/include/x86_var.h Fri Jan 12 10:54:00 2018 (r327871) @@ -116,7 +116,8 @@ void cpu_setregs(void); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void finishidentcpu(void); -void identify_cpu(void); +void identify_cpu1(void); +void identify_cpu2(void); void identify_hypervisor(void); void initializecpu(void); void initializecpucache(void); Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/sys/x86/x86/identcpu.c Fri Jan 12 10:54:00 2018 (r327871) @@ -1373,9 +1373,8 @@ fix_cpuid(void) return (false); } -#ifdef __amd64__ void -identify_cpu(void) +identify_cpu1(void) { u_int regs[4]; @@ -1392,15 +1391,37 @@ identify_cpu(void) cpu_feature = regs[3]; cpu_feature2 = regs[2]; } -#endif +void +identify_cpu2(void) +{ + u_int regs[4], cpu_stdext_disable; + + if (cpu_high >= 7) { + cpuid_count(7, 0, regs); + cpu_stdext_feature = regs[1]; + + /* + * Some hypervisors failed to filter out unsupported + * extended features. Allow to disable the + * extensions, activation of which requires setting a + * bit in CR4, and which VM monitors do not support. + */ + cpu_stdext_disable = 0; + TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); + cpu_stdext_feature &= ~cpu_stdext_disable; + + cpu_stdext_feature2 = regs[2]; + } +} + /* * Final stage of CPU identification. */ void finishidentcpu(void) { - u_int regs[4], cpu_stdext_disable; + u_int regs[4]; #ifdef __i386__ u_char ccr3; #endif @@ -1419,22 +1440,7 @@ finishidentcpu(void) cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; } - if (cpu_high >= 7) { - cpuid_count(7, 0, regs); - cpu_stdext_feature = regs[1]; - - /* - * Some hypervisors failed to filter out unsupported - * extended features. Allow to disable the - * extensions, activation of which requires setting a - * bit in CR4, and which VM monitors do not support. - */ - cpu_stdext_disable = 0; - TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); - cpu_stdext_feature &= ~cpu_stdext_disable; - - cpu_stdext_feature2 = regs[2]; - } + identify_cpu2(); #ifdef __i386__ if (cpu_high > 0 && Modified: stable/11/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/11/usr.sbin/cpucontrol/cpucontrol.8 Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/usr.sbin/cpucontrol/cpucontrol.8 Fri Jan 12 10:54:00 2018 (r327871) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2017 +.Dd January 5, 2018 .Dt CPUCONTROL 8 .Os .Sh NAME @@ -34,46 +34,51 @@ device .Sh SYNOPSIS .Nm +.Bk .Op Fl v .Fl m Ar msr -.Bk .Ar device .Ek +.Bk .Nm .Op Fl v .Fl m Ar msr Ns = Ns Ar value -.Bk .Ar device .Ek +.Bk .Nm .Op Fl v .Fl m Ar msr Ns &= Ns Ar mask -.Bk .Ar device .Ek +.Bk .Nm .Op Fl v .Fl m Ar msr Ns |= Ns Ar mask -.Bk .Ar device .Ek +.Bk .Nm .Op Fl v .Fl i Ar level -.Bk .Ar device .Ek +.Bk .Nm .Op Fl v .Fl i Ar level,level_type -.Bk .Ar device .Ek +.Bk .Nm .Op Fl vn .Op Fl d Ar datadir .Fl u +.Ar device +.Ek .Bk +.Nm +.Fl e .Ar device .Ek .Sh DESCRIPTION @@ -136,6 +141,20 @@ The .Nm utility will walk through the configured data directories and apply all firmware updates available for this CPU. +.It Fl e +Re-evaluate the kernel flags indicating the present CPU features. +This command is typically executed after a firmware update was applied +which changes information reported by the +.Dv CPUID +instruction. +.Pp +.Bf -symbolic +Only execute the +.Fl e +command after the microcode update was applied to all CPUs in the system. +The kernel does not operate correctly if the features of processors are +not identical. +.Ef .It Fl v Increase the verbosity level. .It Fl h Modified: stable/11/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- stable/11/usr.sbin/cpucontrol/cpucontrol.c Fri Jan 12 10:51:42 2018 (r327870) +++ stable/11/usr.sbin/cpucontrol/cpucontrol.c Fri Jan 12 10:54:00 2018 (r327871) @@ -61,6 +61,7 @@ int verbosity_level = 0; #define FLAG_M 0x02 #define FLAG_U 0x04 #define FLAG_N 0x08 +#define FLAG_E 0x10 #define OP_INVAL 0x00 #define OP_READ 0x01 @@ -115,7 +116,7 @@ usage(void) if (name == NULL) name = "cpuctl"; fprintf(stderr, "Usage: %s [-vh] [-d datadir] [-m msr[=value] | " - "-i level | -i level,level_type | -u] device\n", name); + "-i level | -i level,level_type | -e | -u] device\n", name); exit(EX_USAGE); } @@ -339,6 +340,25 @@ do_msr(const char *cmdarg, const char *dev) } static int +do_eval_cpu_features(const char *dev) +{ + int fd, error; + + assert(dev != NULL); + + fd = open(dev, O_RDWR); + if (fd < 0) { + WARN(0, "error opening %s for writing", dev); + return (1); + } + error = ioctl(fd, CPUCTL_EVAL_CPU_FEATURES, NULL); + if (error < 0) + WARN(0, "ioctl(%s, CPUCTL_EVAL_CPU_FEATURES)", dev); + close(fd); + return (error); +} + +static int do_update(const char *dev) { int fd; @@ -428,11 +448,14 @@ main(int argc, char *argv[]) error = 0; cmdarg = ""; /* To keep gcc3 happy. */ - while ((c = getopt(argc, argv, "d:hi:m:nuv")) != -1) { + while ((c = getopt(argc, argv, "d:ehi:m:nuv")) != -1) { switch (c) { case 'd': datadir_add(optarg); break; + case 'e': + flags |= FLAG_E; + break; case 'i': flags |= FLAG_I; cmdarg = optarg; @@ -466,22 +489,25 @@ main(int argc, char *argv[]) if ((flags & FLAG_N) == 0) datadir_add(DEFAULT_DATADIR); dev = argv[0]; - c = flags & (FLAG_I | FLAG_M | FLAG_U); + c = flags & (FLAG_E | FLAG_I | FLAG_M | FLAG_U); switch (c) { - case FLAG_I: - if (strstr(cmdarg, ",") != NULL) - error = do_cpuid_count(cmdarg, dev); - else - error = do_cpuid(cmdarg, dev); - break; - case FLAG_M: - error = do_msr(cmdarg, dev); - break; - case FLAG_U: - error = do_update(dev); - break; - default: - usage(); /* Only one command can be selected. */ + case FLAG_I: + if (strstr(cmdarg, ",") != NULL) + error = do_cpuid_count(cmdarg, dev); + else + error = do_cpuid(cmdarg, dev); + break; + case FLAG_M: + error = do_msr(cmdarg, dev); + break; + case FLAG_U: + error = do_update(dev); + break; + case FLAG_E: + error = do_eval_cpu_features(dev); + break; + default: + usage(); /* Only one command can be selected. */ } SLIST_FREE(&datadirs, next, free); return (error == 0 ? 0 : 1); From owner-svn-src-all@freebsd.org Fri Jan 12 12:14:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F629E60D4A; Fri, 12 Jan 2018 12:14:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3811B3801; Fri, 12 Jan 2018 12:14:16 +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 62146237DC; Fri, 12 Jan 2018 12:14:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CCEFZc012630; Fri, 12 Jan 2018 12:14:15 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CCEESM012626; Fri, 12 Jan 2018 12:14:14 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201801121214.w0CCEESM012626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 12 Jan 2018 12:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327872 - in head/sys/modules: bhnd sdhci_acpi sdhci_pci sgx X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/modules: bhnd sdhci_acpi sdhci_pci sgx X-SVN-Commit-Revision: 327872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 12:14:16 -0000 Author: lwhsu (ports committer) Date: Fri Jan 12 12:14:14 2018 New Revision: 327872 URL: https://svnweb.freebsd.org/changeset/base/327872 Log: - Fix `make` in sys/modules Reviewed by: gonzo, landonf, br Differential Revision: https://reviews.freebsd.org/D13856 Modified: head/sys/modules/bhnd/Makefile head/sys/modules/sdhci_acpi/Makefile head/sys/modules/sdhci_pci/Makefile head/sys/modules/sgx/Makefile Modified: head/sys/modules/bhnd/Makefile ============================================================================== --- head/sys/modules/bhnd/Makefile Fri Jan 12 10:54:00 2018 (r327871) +++ head/sys/modules/bhnd/Makefile Fri Jan 12 12:14:14 2018 (r327872) @@ -18,6 +18,7 @@ SRCS+= chipc.c chipc_subr.c SRCS+= chipc_gpio.c SRCS+= gpio_if.h ofw_bus_if.h +SRCS+= opt_platform.h SRCS+= bhnd_sprom_chipc.c \ bhnd_pmu_chipc.c Modified: head/sys/modules/sdhci_acpi/Makefile ============================================================================== --- head/sys/modules/sdhci_acpi/Makefile Fri Jan 12 10:54:00 2018 (r327871) +++ head/sys/modules/sdhci_acpi/Makefile Fri Jan 12 12:14:14 2018 (r327872) @@ -4,6 +4,7 @@ KMOD= sdhci_acpi SRCS= sdhci_acpi.c sdhci.h sdhci_if.h -SRCS+= acpi_if.h device_if.h bus_if.h opt_acpi.h pci_if.h mmcbr_if.h +SRCS+= acpi_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h +SRCS+= opt_acpi.h opt_mmccam.h .include Modified: head/sys/modules/sdhci_pci/Makefile ============================================================================== --- head/sys/modules/sdhci_pci/Makefile Fri Jan 12 10:54:00 2018 (r327871) +++ head/sys/modules/sdhci_pci/Makefile Fri Jan 12 12:14:14 2018 (r327872) @@ -4,5 +4,6 @@ KMOD= sdhci_pci SRCS= sdhci_pci.c sdhci.h sdhci_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h +SRCS+= opt_mmccam.h .include Modified: head/sys/modules/sgx/Makefile ============================================================================== --- head/sys/modules/sgx/Makefile Fri Jan 12 10:54:00 2018 (r327871) +++ head/sys/modules/sgx/Makefile Fri Jan 12 12:14:14 2018 (r327872) @@ -4,6 +4,7 @@ KMOD= sgx SRCS= sgx.c sgxvar.h assym.s sgx_support.S +SRCS+= opt_compat.h opt_hwpmc_hooks.h opt_kstack_pages.h sgx_support.o: assym.s ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From owner-svn-src-all@freebsd.org Fri Jan 12 12:14:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EABEE60E9F; Fri, 12 Jan 2018 12:14:54 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 228933993; Fri, 12 Jan 2018 12:14:54 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43B15237E2; Fri, 12 Jan 2018 12:14:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CCErP7012696; Fri, 12 Jan 2018 12:14:53 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CCEqfj012692; Fri, 12 Jan 2018 12:14:52 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801121214.w0CCEqfj012692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Fri, 12 Jan 2018 12:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327873 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 327873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 12:14:54 -0000 Author: wma Date: Fri Jan 12 12:14:52 2018 New Revision: 327873 URL: https://svnweb.freebsd.org/changeset/base/327873 Log: PowerNV: update OPAL driver Update OPAL driver with: - better console support - proper AP configuration - enhanced IRQ/OFW mapping - RTC support Created by: Nathan Whitehorn Submitted by: Wojciech Macek Sponsored by: FreeBSD Foundation Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_console.c head/sys/powerpc/powernv/opal_dev.c head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Fri Jan 12 12:14:14 2018 (r327872) +++ head/sys/powerpc/powernv/opal.h Fri Jan 12 12:14:52 2018 (r327873) @@ -40,9 +40,12 @@ int opal_call(uint64_t token, ...); #define OPAL_CONSOLE_WRITE 1 #define OPAL_CONSOLE_READ 2 +#define OPAL_RTC_READ 3 +#define OPAL_RTC_WRITE 4 #define OPAL_CEC_POWER_DOWN 5 #define OPAL_CEC_REBOOT 6 #define OPAL_HANDLE_INTERRUPT 9 +#define OPAL_POLL_EVENTS 10 #define OPAL_PCI_CONFIG_READ_BYTE 13 #define OPAL_PCI_CONFIG_READ_HALF_WORD 14 #define OPAL_PCI_CONFIG_READ_WORD 15 @@ -57,10 +60,10 @@ int opal_call(uint64_t token, ...); #define OPAL_PCI_RESET 49 #define OPAL_PCI_POLL 62 #define OPAL_PCI_SET_PE 31 -#define OPAL_START_CPU 41 #define OPAL_GET_MSI_32 39 #define OPAL_GET_MSI_64 40 #define OPAL_PCI_MSI_EOI 63 +#define OPAL_START_CPU 41 #define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 #define OPAL_RETURN_CPU 69 #define OPAL_REINIT_CPUS 70 Modified: head/sys/powerpc/powernv/opal_console.c ============================================================================== --- head/sys/powerpc/powernv/opal_console.c Fri Jan 12 12:14:14 2018 (r327872) +++ head/sys/powerpc/powernv/opal_console.c Fri Jan 12 12:14:52 2018 (r327873) @@ -133,42 +133,39 @@ static struct { char tmpbuf[16]; uint64_t size; struct mtx mtx; -} escapehatch; +} opalcons_buffer; static void uart_opal_real_map_outbuffer(uint64_t *bufferp, uint64_t *lenp) { - if (!mtx_initialized(&escapehatch.mtx)) - mtx_init(&escapehatch.mtx, "uart_opal", NULL, MTX_SPIN | MTX_QUIET | - MTX_NOWITNESS); + if (!mtx_initialized(&opalcons_buffer.mtx)) + mtx_init(&opalcons_buffer.mtx, "uart_opal", NULL, + MTX_SPIN | MTX_QUIET | MTX_NOWITNESS); if (!pmap_bootstrapped) return; - if (TD_IS_IDLETHREAD(curthread)) { - escapehatch.size = *(uint64_t *)(*lenp) = - min(sizeof(escapehatch.tmpbuf), *(uint64_t *)(*lenp)); - mtx_lock_spin(&escapehatch.mtx); - memcpy(escapehatch.tmpbuf, (void *)(*bufferp), *(uint64_t *)(*lenp)); - *bufferp = (uint64_t)escapehatch.tmpbuf; - *lenp = (uint64_t)&escapehatch.size; - } + mtx_lock_spin(&opalcons_buffer.mtx); - *bufferp = vtophys(*bufferp); - *lenp = vtophys(*lenp); + opalcons_buffer.size = *(uint64_t *)(*lenp) = + min(sizeof(opalcons_buffer.tmpbuf), *(uint64_t *)(*lenp)); + memcpy(opalcons_buffer.tmpbuf, (void *)(*bufferp), + *(uint64_t *)(*lenp)); + *bufferp = (uint64_t)opalcons_buffer.tmpbuf; + *lenp = (uint64_t)&opalcons_buffer.size; } static void -uart_opal_real_unmap_outbuffer(uint64_t lenp, uint64_t *origlen) +uart_opal_real_unmap_outbuffer(uint64_t *len) { - if (!pmap_bootstrapped || !TD_IS_IDLETHREAD(curthread)) + if (!pmap_bootstrapped) return; - mtx_assert(&escapehatch.mtx, MA_OWNED); - *origlen = escapehatch.size; - mtx_unlock_spin(&escapehatch.mtx); + mtx_assert(&opalcons_buffer.mtx, MA_OWNED); + *len = opalcons_buffer.size; + mtx_unlock_spin(&opalcons_buffer.mtx); } static int @@ -187,7 +184,7 @@ uart_opal_probe_node(struct uart_opal_softc *sc) return (ENXIO); reg = -1; - OF_getprop(node, "reg", ®, sizeof(reg)); + OF_getencprop(node, "reg", ®, sizeof(reg)); if (reg == -1) return (ENXIO); sc->vtermid = reg; @@ -389,7 +386,7 @@ uart_opal_put(struct uart_opal_softc *sc, void *buffer uart_opal_real_map_outbuffer(&obuf, &olen); err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); - uart_opal_real_unmap_outbuffer(olen, &len); + uart_opal_real_unmap_outbuffer(&len); } else { uart_lock(&sc->sc_mtx); if (bufsize > 12) @@ -404,7 +401,7 @@ uart_opal_put(struct uart_opal_softc *sc, void *buffer uart_opal_real_map_outbuffer(&obuf, &olen); err = opal_call(OPAL_CONSOLE_WRITE, sc->vtermid, olen, obuf); - uart_opal_real_unmap_outbuffer(olen, &len); + uart_opal_real_unmap_outbuffer(&len); uart_unlock(&sc->sc_mtx); @@ -438,7 +435,11 @@ uart_opal_cngetc(struct consdev *cp) static void uart_opal_cnputc(struct consdev *cp, int c) { + static uint64_t events; unsigned char ch = c; + + if (cold) + opal_call(OPAL_POLL_EVENTS, &events); /* Clear FIFO if needed */ uart_opal_put(console_sc, &ch, 1); } Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Fri Jan 12 12:14:14 2018 (r327872) +++ head/sys/powerpc/powernv/opal_dev.c Fri Jan 12 12:14:52 2018 (r327873) @@ -37,7 +37,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include + #include #include #include @@ -55,6 +59,7 @@ static const struct ofw_bus_devinfo *opaldev_get_devin device_t child); static void opal_shutdown(void *arg, int howto); +static void opal_intr(void *); static device_method_t opaldev_methods[] = { /* Device interface */ @@ -89,6 +94,9 @@ DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev static int opaldev_probe(device_t dev) { + phandle_t iparent; + pcell_t *irqs; + int i, n_irqs; if (!ofw_bus_is_compatible(dev, "ibm,opal-v3")) return (ENXIO); @@ -96,6 +104,24 @@ opaldev_probe(device_t dev) return (ENXIO); device_set_desc(dev, "OPAL Abstraction Firmware"); + + /* Manually add IRQs before attaching */ + if (OF_hasprop(ofw_bus_get_node(dev), "opal-interrupts")) { + iparent = OF_finddevice("/interrupt-controller@0"); + iparent = OF_xref_from_node(iparent); + + n_irqs = OF_getproplen(ofw_bus_get_node(dev), + "opal-interrupts") / sizeof(*irqs); + irqs = malloc(n_irqs * sizeof(*irqs), M_DEVBUF, M_WAITOK); + OF_getencprop(ofw_bus_get_node(dev), "opal-interrupts", irqs, + n_irqs * sizeof(*irqs)); + for (i = 0; i < n_irqs; i++) + bus_set_resource(dev, SYS_RES_IRQ, i, + ofw_bus_map_intr(dev, iparent, 1, &irqs[i]), 1); + free(irqs, M_DEVBUF); + } + + return (BUS_PROBE_SPECIFIC); } @@ -104,14 +130,32 @@ opaldev_attach(device_t dev) { phandle_t child; device_t cdev; + uint64_t junk; + int i, rv; struct ofw_bus_devinfo *dinfo; + struct resource *irq; - if (0 /* XXX NOT YET TEST FOR RTC */) + /* Test for RTC support and register clock if it works */ + rv = opal_call(OPAL_RTC_READ, vtophys(&junk), vtophys(&junk)); + do { + rv = opal_call(OPAL_RTC_READ, vtophys(&junk), vtophys(&junk)); + if (rv == OPAL_BUSY_EVENT) + rv = opal_call(OPAL_POLL_EVENTS, 0); + } while (rv == OPAL_BUSY_EVENT); + + if (rv == OPAL_SUCCESS) clock_register(dev, 2000); EVENTHANDLER_REGISTER(shutdown_final, opal_shutdown, NULL, SHUTDOWN_PRI_LAST); + /* Bind to interrupts */ + for (i = 0; (irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, + RF_ACTIVE)) != NULL; i++) + bus_setup_intr(dev, irq, INTR_TYPE_TTY | INTR_MPSAFE | + INTR_ENTROPY, NULL, opal_intr, (void *)rman_get_start(irq), + NULL); + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; child = OF_peer(child)) { dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); @@ -134,13 +178,56 @@ opaldev_attach(device_t dev) } static int -opal_gettime(device_t dev, struct timespec *ts) { - return (ENXIO); +bcd2bin32(int bcd) +{ + int out = 0; + + out += bcd2bin(bcd & 0xff); + out += 100*bcd2bin((bcd & 0x0000ff00) >> 8); + out += 10000*bcd2bin((bcd & 0x00ff0000) >> 16); + out += 1000000*bcd2bin((bcd & 0xffff0000) >> 24); + + return (out); } static int +opal_gettime(device_t dev, struct timespec *ts) +{ + int rv; + struct clocktime ct; + uint32_t ymd; + uint64_t hmsm; + + do { + rv = opal_call(OPAL_RTC_READ, vtophys(&ymd), vtophys(&hmsm)); + if (rv == OPAL_BUSY_EVENT) { + rv = opal_call(OPAL_POLL_EVENTS, 0); + pause("opalrtc", 1); + } + } while (rv == OPAL_BUSY_EVENT); + + if (rv != OPAL_SUCCESS) + return (ENXIO); + + hmsm = be64toh(hmsm); + ymd = be32toh(ymd); + + ct.nsec = bcd2bin32((hmsm & 0x000000ffffff0000) >> 16) * 1000; + ct.sec = bcd2bin((hmsm & 0x0000ff0000000000) >> 40); + ct.min = bcd2bin((hmsm & 0x00ff000000000000) >> 48); + ct.hour = bcd2bin((hmsm & 0xff00000000000000) >> 56); + + ct.day = bcd2bin((ymd & 0x000000ff) >> 0); + ct.mon = bcd2bin((ymd & 0x0000ff00) >> 8); + ct.year = bcd2bin32((ymd & 0xffff0000) >> 16); + + return (clock_ct_to_ts(&ct, ts)); +} + +static int opal_settime(device_t dev, struct timespec *ts) { + return (0); } @@ -158,5 +245,18 @@ opal_shutdown(void *arg, int howto) opal_call(OPAL_CEC_POWER_DOWN, 0 /* Normal power off */); else opal_call(OPAL_CEC_REBOOT); + + opal_call(OPAL_RETURN_CPU); +} + +static void +opal_intr(void *xintr) +{ + uint64_t events = 0; + + opal_call(OPAL_HANDLE_INTERRUPT, (uint32_t)(uint64_t)xintr, + vtophys(&events)); + /* XXX: do something useful with this information */ + } Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Fri Jan 12 12:14:14 2018 (r327872) +++ head/sys/powerpc/powernv/platform_powernv.c Fri Jan 12 12:14:52 2018 (r327873) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "platform_if.h" #include "opal.h" @@ -101,6 +102,8 @@ static platform_def_t powernv_platform = { PLATFORM_DEF(powernv_platform); +static int powernv_boot_pir; + static int powernv_probe(platform_t plat) { @@ -113,17 +116,98 @@ powernv_probe(platform_t plat) static int powernv_attach(platform_t plat) { + uint32_t nptlp, shift = 0, slb_encoding = 0; + int32_t lp_size, lp_encoding; + char buf[255]; + pcell_t prop; + phandle_t cpu; + int res, len, node, idx; + /* Ping OPAL again just to make sure */ opal_check(); cpu_idle_hook = powernv_cpu_idle; + powernv_boot_pir = mfspr(SPR_PIR); - /* Direct interrupts to SRR instead of HSRR */ - mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_LPES); + /* Init CPU bits */ + powernv_smp_ap_init(plat); + /* Set SLB count from device tree */ + cpu = OF_peer(0); + cpu = OF_child(cpu); + while (cpu != 0) { + res = OF_getprop(cpu, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpus") == 0) + break; + cpu = OF_peer(cpu); + } + if (cpu == 0) + goto out; + + cpu = OF_child(cpu); + while (cpu != 0) { + res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + cpu = OF_peer(cpu); + } + if (cpu == 0) + goto out; + + res = OF_getencprop(cpu, "ibm,slb-size", &prop, sizeof(prop)); + if (res > 0) + n_slbs = prop; + + /* + * Scan the large page size property for PAPR compatible machines. + * See PAPR D.5 Changes to Section 5.1.4, 'CPU Node Properties' + * for the encoding of the property. + */ + + len = OF_getproplen(node, "ibm,segment-page-sizes"); + if (len > 0) { + /* + * We have to use a variable length array on the stack + * since we have very limited stack space. + */ + pcell_t arr[len/sizeof(cell_t)]; + res = OF_getencprop(cpu, "ibm,segment-page-sizes", arr, + sizeof(arr)); + len /= 4; + idx = 0; + while (len > 0) { + shift = arr[idx]; + slb_encoding = arr[idx + 1]; + nptlp = arr[idx + 2]; + idx += 3; + len -= 3; + while (len > 0 && nptlp) { + lp_size = arr[idx]; + lp_encoding = arr[idx+1]; + if (slb_encoding == SLBV_L && lp_encoding == 0) + break; + + idx += 2; + len -= 2; + nptlp--; + } + if (nptlp && slb_encoding == SLBV_L && lp_encoding == 0) + break; + } + + if (len == 0) + panic("Standard large pages (SLB[L] = 1, PTE[LP] = 0) " + "not supported by this system."); + + moea64_large_page_shift = shift; + moea64_large_page_size = 1ULL << lp_size; + } + +out: return (0); } + void powernv_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, struct mem_region *avail, int *availsz) @@ -140,7 +224,7 @@ powernv_timebase_freq(platform_t plat, struct cpuref * phandle = cpuref->cr_hwref; - OF_getprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); + OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); if (ticks <= 0) panic("Unable to determine timebase frequency!"); @@ -186,10 +270,10 @@ powernv_smp_first_cpu(platform_t plat, struct cpuref * return (ENOENT); cpuref->cr_hwref = cpu; - res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + res = OF_getencprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, sizeof(cpuid)); if (res <= 0) - res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + res = OF_getencprop(cpu, "reg", &cpuid, sizeof(cpuid)); if (res <= 0) cpuid = 0; cpuref->cr_cpuid = cpuid; @@ -208,7 +292,7 @@ powernv_smp_next_cpu(platform_t plat, struct cpuref *c res = OF_getproplen(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s"); if (res > 0) { cell_t interrupt_servers[res/sizeof(cell_t)]; - OF_getprop(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s", + OF_getencprop(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s", interrupt_servers, res); for (i = 0; i < res/sizeof(cell_t) - 1; i++) { if (interrupt_servers[i] == cpuref->cr_cpuid) { @@ -230,10 +314,10 @@ powernv_smp_next_cpu(platform_t plat, struct cpuref *c return (ENOENT); cpuref->cr_hwref = cpu; - res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + res = OF_getencprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, sizeof(cpuid)); if (res <= 0) - res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + res = OF_getencprop(cpu, "reg", &cpuid, sizeof(cpuid)); if (res <= 0) cpuid = 0; cpuref->cr_cpuid = cpuid; @@ -256,6 +340,10 @@ powernv_smp_get_bsp(platform_t plat, struct cpuref *cp if (res < 0) return (ENOENT); + /* XXX: FDT from kexec lies sometimes. PIR seems not to. */ + if (cpuid == 0) + cpuid = powernv_boot_pir; + cpuref->cr_cpuid = cpuid; if (powernv_smp_first_cpu(plat, &i) != 0) @@ -299,7 +387,7 @@ powernv_smp_topo(platform_t plat) ncores = ncpus = 0; last_pc = NULL; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { pc = pcpu_find(i); if (pc == NULL) continue; @@ -319,7 +407,11 @@ powernv_smp_topo(platform_t plat) if (ncpus == ncores) return (smp_topo_none()); +#ifdef NOTYET /* smp_topo_1level() fails with non-consecutive CPU IDs */ return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); +#else + return (smp_topo_none()); +#endif } #endif @@ -333,6 +425,9 @@ powernv_reset(platform_t platform) static void powernv_smp_ap_init(platform_t platform) { + + /* Direct interrupts to SRR instead of HSRR and reset LPCR otherwise */ + mtspr(SPR_LPCR, LPCR_LPES); } static void From owner-svn-src-all@freebsd.org Fri Jan 12 13:39:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC4CE6508A; Fri, 12 Jan 2018 13:39:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6582469D16; Fri, 12 Jan 2018 13:39:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E4C124502; Fri, 12 Jan 2018 13:39:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CDd22Q046529; Fri, 12 Jan 2018 13:39:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CDd2ml046528; Fri, 12 Jan 2018 13:39:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201801121339.w0CDd2ml046528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 12 Jan 2018 13:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327874 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 13:39:03 -0000 Author: mjg Date: Fri Jan 12 13:39:02 2018 New Revision: 327874 URL: https://svnweb.freebsd.org/changeset/base/327874 Log: vfs: tidy up vdrop Skip vfs_refcount_release_if_not_last if the interlock is held and just go straight to refcount_release. While here do cosmetic rearrangement of _vhold to better show it contains equivalent behaviour. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 12 12:14:52 2018 (r327873) +++ head/sys/kern/vfs_subr.c Fri Jan 12 13:39:02 2018 (r327874) @@ -2840,14 +2840,14 @@ _vhold(struct vnode *vp, bool locked) else ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (!locked && vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt)) { - VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, - ("_vhold: vnode with holdcnt is free")); - return; - } - - if (!locked) + if (!locked) { + if (vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt)) { + VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, + ("_vhold: vnode with holdcnt is free")); + return; + } VI_LOCK(vp); + } if ((vp->v_iflag & VI_FREE) == 0) { refcount_acquire(&vp->v_holdcnt); if (!locked) @@ -2911,14 +2911,11 @@ _vdrop(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if ((int)vp->v_holdcnt <= 0) panic("vdrop: holdcnt %d", vp->v_holdcnt); - if (vfs_refcount_release_if_not_last(&vp->v_holdcnt)) { - if (locked) - VI_UNLOCK(vp); - return; - } - - if (!locked) + if (!locked) { + if (vfs_refcount_release_if_not_last(&vp->v_holdcnt)) + return; VI_LOCK(vp); + } if (refcount_release(&vp->v_holdcnt) == 0) { VI_UNLOCK(vp); return; From owner-svn-src-all@freebsd.org Fri Jan 12 13:40:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91666E6526F; Fri, 12 Jan 2018 13:40:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DDD669F80; Fri, 12 Jan 2018 13:40:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6DFD2451F; Fri, 12 Jan 2018 13:40:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CDeoMF046645; Fri, 12 Jan 2018 13:40:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CDeoI9046644; Fri, 12 Jan 2018 13:40:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201801121340.w0CDeoI9046644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 12 Jan 2018 13:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327875 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 13:40:51 -0000 Author: mjg Date: Fri Jan 12 13:40:50 2018 New Revision: 327875 URL: https://svnweb.freebsd.org/changeset/base/327875 Log: mtx: use fcmpset to cover setting MTX_CONTESTED Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Jan 12 13:39:02 2018 (r327874) +++ head/sys/kern/kern_mutex.c Fri Jan 12 13:40:50 2018 (r327875) @@ -578,6 +578,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) ts = turnstile_trywait(&m->lock_object); v = MTX_READ_VALUE(m); +retry_turnstile: /* * Check if the lock has been released while spinning for @@ -609,10 +610,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) * or the state of the MTX_RECURSED bit changed. */ if ((v & MTX_CONTESTED) == 0 && - !atomic_cmpset_ptr(&m->mtx_lock, v, v | MTX_CONTESTED)) { - turnstile_cancel(ts); - v = MTX_READ_VALUE(m); - continue; + !atomic_fcmpset_ptr(&m->mtx_lock, &v, v | MTX_CONTESTED)) { + goto retry_turnstile; } /* From owner-svn-src-all@freebsd.org Fri Jan 12 14:01:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29ABBE663B7; Fri, 12 Jan 2018 14:01:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05A796ADB3; Fri, 12 Jan 2018 14:01:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44332248AE; Fri, 12 Jan 2018 14:01:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CE1d0Z058243; Fri, 12 Jan 2018 14:01:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CE1cW4058239; Fri, 12 Jan 2018 14:01:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201801121401.w0CE1cW4058239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 12 Jan 2018 14:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327876 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 327876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:01:40 -0000 Author: andrew Date: Fri Jan 12 14:01:38 2018 New Revision: 327876 URL: https://svnweb.freebsd.org/changeset/base/327876 Log: Workaround Spectre Variant 2 on arm64. We need to handle two cases: 1. One process attacking another process. 2. A process attacking the kernel. For the first case we clear the branch predictor state on context switch between different processes. For the second we do this when taking an instruction abort on a non-userspace address. To clear the branch predictor state a per-CPU function pointer has been added. This is set by the new cpu errata code based on if the CPU is known to be affected. On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer versions of this will clear the branch predictor state for us. It has been reported the ThunderX is unaffected, however the ThunderX2 is vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't yet run on the ThunderX2 or Falkor no workaround is included for these CPUs. MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13812 Modified: head/sys/arm64/arm64/cpu_errata.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/trap.c head/sys/arm64/include/pcpu.h Modified: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- head/sys/arm64/arm64/cpu_errata.c Fri Jan 12 13:40:50 2018 (r327875) +++ head/sys/arm64/arm64/cpu_errata.c Fri Jan 12 14:01:38 2018 (r327876) @@ -30,6 +30,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -39,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef DEV_PSCI +#include +#endif + typedef void (cpu_quirk_install)(void); struct cpu_quirks { cpu_quirk_install *quirk_install; @@ -49,7 +55,36 @@ struct cpu_quirks { static cpu_quirk_install install_psci_bp_hardening; static struct cpu_quirks cpu_quirks[] = { + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A57,0,0), + .quirk_install = install_psci_bp_hardening, + }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A72,0,0), + .quirk_install = install_psci_bp_hardening, + }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A73,0,0), + .quirk_install = install_psci_bp_hardening, + }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A75,0,0), + .quirk_install = install_psci_bp_hardening, + }, }; + +static void +install_psci_bp_hardening(void) +{ + +#ifdef DEV_PSCI + PCPU_SET(bp_harden, psci_get_version); +#endif +} void install_cpu_errata(void) Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Jan 12 13:40:50 2018 (r327875) +++ head/sys/arm64/arm64/pmap.c Fri Jan 12 14:01:38 2018 (r327876) @@ -4663,6 +4663,7 @@ pmap_activate(struct thread *td) struct pcb * pmap_switch(struct thread *old, struct thread *new) { + pcpu_bp_harden bp_harden; struct pcb *pcb; /* Store the new curthread */ @@ -4690,6 +4691,15 @@ pmap_switch(struct thread *old, struct thread *new) "dsb ish \n" "isb \n" : : "r"(new->td_proc->p_md.md_l0addr)); + + /* + * Stop userspace from training the branch predictor against + * other processes. This will call into a CPU specific + * function that clears the branch predictor state. + */ + bp_harden = PCPU_GET(bp_harden); + if (bp_harden != NULL) + bp_harden(); } return (pcb); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Fri Jan 12 13:40:50 2018 (r327875) +++ head/sys/arm64/arm64/trap.c Fri Jan 12 14:01:38 2018 (r327876) @@ -352,6 +352,7 @@ do_el1h_sync(struct thread *td, struct trapframe *fram void do_el0_sync(struct thread *td, struct trapframe *frame) { + pcpu_bp_harden bp_harden; uint32_t exception; uint64_t esr, far; @@ -363,11 +364,25 @@ do_el0_sync(struct thread *td, struct trapframe *frame esr = frame->tf_esr; exception = ESR_ELx_EXCEPTION(esr); switch (exception) { - case EXCP_UNKNOWN: case EXCP_INSN_ABORT_L: + far = READ_SPECIALREG(far_el1); + + /* + * Userspace may be trying to train the branch predictor to + * attack the kernel. If we are on a CPU affected by this + * call the handler to clear the branch predictor state. + */ + if (far > VM_MAXUSER_ADDRESS) { + bp_harden = PCPU_GET(bp_harden); + if (bp_harden != NULL) + bp_harden(); + } + break; + case EXCP_UNKNOWN: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); + break; } intr_enable(); Modified: head/sys/arm64/include/pcpu.h ============================================================================== --- head/sys/arm64/include/pcpu.h Fri Jan 12 13:40:50 2018 (r327875) +++ head/sys/arm64/include/pcpu.h Fri Jan 12 14:01:38 2018 (r327876) @@ -35,11 +35,14 @@ #define ALT_STACK_SIZE 128 +typedef int (*pcpu_bp_harden)(void); + #define PCPU_MD_FIELDS \ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_midr; /* stored MIDR value */ \ uint64_t pc_clock; \ - char __pad[241] + pcpu_bp_harden pc_bp_harden; \ + char __pad[233] #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri Jan 12 14:10:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A780E66D95 for ; Fri, 12 Jan 2018 14:10:59 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61BDC6B4F6 for ; Fri, 12 Jan 2018 14:10:59 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-it0-x233.google.com with SMTP id b5so9201391itc.3 for ; Fri, 12 Jan 2018 06:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=55DDVw8HpcnpggjM2UJJnqdGH+FBVP6pNAW7mmwPj4g=; b=YfiKhCUVDXjK0hMw+yQUvST/5NvtxE2wjGFW+lXAp+OJ55nLBMIQOLwWrHeFml4cmR FTVQ1kX7obUvWBiXB9mY6FddFUdOf3kppoq00LqaXsrGUSUeJDi26o49FDOWgH6uqWoJ GZ9nRO0+JxomONl/hhPSqRpv61dsGa3HBrCaXFpKzmHUNIYjolvh4pnax/ABTEH9CYIs Gjx/DCXVt6jbqZUjTUETOkUvUpBVkRZ52KCvKE1VFstuW3Ra7oX/wrIgNUzKUJsIxYwH KiUGUShWhlrmpwschbvQXW07BVm0VmV8ksC8j5QNpgCuQSOZNZGI6GqF0sW5fdKF8CIN yRFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=55DDVw8HpcnpggjM2UJJnqdGH+FBVP6pNAW7mmwPj4g=; b=ZbNhVEE37ty34FMIACJg0+BnCgyI9AHkyL9UdKyJC/NzukZpyEn2NjsilJyPBRO914 R3bLcUHcUS2tiVAU5ZcoKHWnblZVCvh/7yBx45ueGgDeUnJ12v7h9yzjS8ptbDO7b582 B7yPmGu55sFw42p+tTDyXSPv1Tvcf55LZbwPdesdgxXOPL0gTkFzXVnkuIEYSNElgFPa Tan7AvGWDubHIpWzO7RRg7X3PylJ3I/9iCERl4Ye7z3GC7FHSxQtL3FG+LrL1MRsdusy 2bZIls1T0MWMYYH0BEZ63xaGQK1Ycwg7sWPLqkv2Li1MyRLS8SjzQp2igNggSOuS3z6Z IRpA== X-Gm-Message-State: AKwxytc7yMAKolIsQ5DPjfNRqg6b39jVdNMPfafeaBuKo84Ztc4iga1o pX28w5fqLgu8cGhKE63pReelCzAWpp1u46q3xvYluQ== X-Google-Smtp-Source: ACJfBosJboz518wxY8XSXvK6kJDnbXYpNI4puBxDU47NComeqsBZkghmGH8eIbJ9VLgc1uSc8s9bM5+HqOhjDCo3wUs= X-Received: by 10.36.148.139 with SMTP id j133mr5108303ite.148.1515766258598; Fri, 12 Jan 2018 06:10:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.37.13 with HTTP; Fri, 12 Jan 2018 06:10:58 -0800 (PST) In-Reply-To: <201801121401.w0CE1cW4058239@repo.freebsd.org> References: <201801121401.w0CE1cW4058239@repo.freebsd.org> From: Marcin Wojtas Date: Fri, 12 Jan 2018 15:10:58 +0100 Message-ID: Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:10:59 -0000 Hi Andrew, 2018-01-12 15:01 GMT+01:00 Andrew Turner : > Author: andrew > Date: Fri Jan 12 14:01:38 2018 > New Revision: 327876 > URL: https://svnweb.freebsd.org/changeset/base/327876 > > Log: > Workaround Spectre Variant 2 on arm64. > > We need to handle two cases: > > 1. One process attacking another process. > 2. A process attacking the kernel. > > For the first case we clear the branch predictor state on context switch > between different processes. For the second we do this when taking an > instruction abort on a non-userspace address. > > To clear the branch predictor state a per-CPU function pointer has been > added. This is set by the new cpu errata code based on if the CPU is > known to be affected. > > On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer > versions of this will clear the branch predictor state for us. > > It has been reported the ThunderX is unaffected, however the ThunderX2 is > vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't > yet run on the ThunderX2 or Falkor no workaround is included for these CPUs. Regardless ThunderX2 / Falkor work-arounds, do I understand correctly that pure CA72 machines, such as Marvell Armada 7k/8k are immune to Variant 2 now? Thanks, Marcin > > MFC after: 3 days > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D13812 > > Modified: > head/sys/arm64/arm64/cpu_errata.c > head/sys/arm64/arm64/pmap.c > head/sys/arm64/arm64/trap.c > head/sys/arm64/include/pcpu.h > > Modified: head/sys/arm64/arm64/cpu_errata.c > ============================================================================== > --- head/sys/arm64/arm64/cpu_errata.c Fri Jan 12 13:40:50 2018 (r327875) > +++ head/sys/arm64/arm64/cpu_errata.c Fri Jan 12 14:01:38 2018 (r327876) > @@ -30,6 +30,8 @@ > * SUCH DAMAGE. > */ > > +#include "opt_platform.h" > + > #include > __FBSDID("$FreeBSD$"); > > @@ -39,6 +41,10 @@ __FBSDID("$FreeBSD$"); > > #include > > +#ifdef DEV_PSCI > +#include > +#endif > + > typedef void (cpu_quirk_install)(void); > struct cpu_quirks { > cpu_quirk_install *quirk_install; > @@ -49,7 +55,36 @@ struct cpu_quirks { > static cpu_quirk_install install_psci_bp_hardening; > > static struct cpu_quirks cpu_quirks[] = { > + { > + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, > + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A57,0,0), > + .quirk_install = install_psci_bp_hardening, > + }, > + { > + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, > + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A72,0,0), > + .quirk_install = install_psci_bp_hardening, > + }, > + { > + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, > + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A73,0,0), > + .quirk_install = install_psci_bp_hardening, > + }, > + { > + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, > + .midr_value = CPU_ID_RAW(CPU_IMPL_ARM, CPU_PART_CORTEX_A75,0,0), > + .quirk_install = install_psci_bp_hardening, > + }, > }; > + > +static void > +install_psci_bp_hardening(void) > +{ > + > +#ifdef DEV_PSCI > + PCPU_SET(bp_harden, psci_get_version); > +#endif > +} > > void > install_cpu_errata(void) > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Fri Jan 12 13:40:50 2018 (r327875) > +++ head/sys/arm64/arm64/pmap.c Fri Jan 12 14:01:38 2018 (r327876) > @@ -4663,6 +4663,7 @@ pmap_activate(struct thread *td) > struct pcb * > pmap_switch(struct thread *old, struct thread *new) > { > + pcpu_bp_harden bp_harden; > struct pcb *pcb; > > /* Store the new curthread */ > @@ -4690,6 +4691,15 @@ pmap_switch(struct thread *old, struct thread *new) > "dsb ish \n" > "isb \n" > : : "r"(new->td_proc->p_md.md_l0addr)); > + > + /* > + * Stop userspace from training the branch predictor against > + * other processes. This will call into a CPU specific > + * function that clears the branch predictor state. > + */ > + bp_harden = PCPU_GET(bp_harden); > + if (bp_harden != NULL) > + bp_harden(); > } > > return (pcb); > > Modified: head/sys/arm64/arm64/trap.c > ============================================================================== > --- head/sys/arm64/arm64/trap.c Fri Jan 12 13:40:50 2018 (r327875) > +++ head/sys/arm64/arm64/trap.c Fri Jan 12 14:01:38 2018 (r327876) > @@ -352,6 +352,7 @@ do_el1h_sync(struct thread *td, struct trapframe *fram > void > do_el0_sync(struct thread *td, struct trapframe *frame) > { > + pcpu_bp_harden bp_harden; > uint32_t exception; > uint64_t esr, far; > > @@ -363,11 +364,25 @@ do_el0_sync(struct thread *td, struct trapframe *frame > esr = frame->tf_esr; > exception = ESR_ELx_EXCEPTION(esr); > switch (exception) { > - case EXCP_UNKNOWN: > case EXCP_INSN_ABORT_L: > + far = READ_SPECIALREG(far_el1); > + > + /* > + * Userspace may be trying to train the branch predictor to > + * attack the kernel. If we are on a CPU affected by this > + * call the handler to clear the branch predictor state. > + */ > + if (far > VM_MAXUSER_ADDRESS) { > + bp_harden = PCPU_GET(bp_harden); > + if (bp_harden != NULL) > + bp_harden(); > + } > + break; > + case EXCP_UNKNOWN: > case EXCP_DATA_ABORT_L: > case EXCP_DATA_ABORT: > far = READ_SPECIALREG(far_el1); > + break; > } > intr_enable(); > > > Modified: head/sys/arm64/include/pcpu.h > ============================================================================== > --- head/sys/arm64/include/pcpu.h Fri Jan 12 13:40:50 2018 (r327875) > +++ head/sys/arm64/include/pcpu.h Fri Jan 12 14:01:38 2018 (r327876) > @@ -35,11 +35,14 @@ > > #define ALT_STACK_SIZE 128 > > +typedef int (*pcpu_bp_harden)(void); > + > #define PCPU_MD_FIELDS \ > u_int pc_acpi_id; /* ACPI CPU id */ \ > u_int pc_midr; /* stored MIDR value */ \ > uint64_t pc_clock; \ > - char __pad[241] > + pcpu_bp_harden pc_bp_harden; \ > + char __pad[233] > > #ifdef _KERNEL > > From owner-svn-src-all@freebsd.org Fri Jan 12 14:16:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7606DE671F6; Fri, 12 Jan 2018 14:16:08 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4334D6BAF6; Fri, 12 Jan 2018 14:16:07 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [IPv6:2001:630:212:2a8:ad58:428a:6221:67a0] (unknown [IPv6:2001:630:212:2a8:ad58:428a:6221:67a0]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 99BE04E78C; Fri, 12 Jan 2018 14:15:35 +0000 (UTC) From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include Date: Fri, 12 Jan 2018 14:15:34 +0000 In-Reply-To: Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Marcin Wojtas References: <201801121401.w0CE1cW4058239@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.5.20) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:16:08 -0000 > On 12 Jan 2018, at 14:10, Marcin Wojtas wrote: >=20 > Hi Andrew, >=20 >=20 >=20 > 2018-01-12 15:01 GMT+01:00 Andrew Turner >: >> Author: andrew >> Date: Fri Jan 12 14:01:38 2018 >> New Revision: 327876 >> URL: https://svnweb.freebsd.org/changeset/base/327876 >>=20 >> Log: >> Workaround Spectre Variant 2 on arm64. >>=20 >> We need to handle two cases: >>=20 >> 1. One process attacking another process. >> 2. A process attacking the kernel. >>=20 >> For the first case we clear the branch predictor state on context = switch >> between different processes. For the second we do this when taking = an >> instruction abort on a non-userspace address. >>=20 >> To clear the branch predictor state a per-CPU function pointer has = been >> added. This is set by the new cpu errata code based on if the CPU is >> known to be affected. >>=20 >> On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as = newer >> versions of this will clear the branch predictor state for us. >>=20 >> It has been reported the ThunderX is unaffected, however the = ThunderX2 is >> vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD = doesn't >> yet run on the ThunderX2 or Falkor no workaround is included for = these CPUs. >=20 > Regardless ThunderX2 / Falkor work-arounds, do I understand correctly > that pure CA72 machines, such as Marvell Armada 7k/8k are immune to > Variant 2 now? It is my understanding that the A72 will be immune with this patch and = an updated Arm Trusted Firmware as documented in [1]. Andrew [1] = https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firm= ware-Security-Advisory-TFV-6 = From owner-svn-src-all@freebsd.org Fri Jan 12 14:37:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85086E6863F for ; Fri, 12 Jan 2018 14:37:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47B966D693 for ; Fri, 12 Jan 2018 14:37:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id c16so9288880itc.5 for ; Fri, 12 Jan 2018 06:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wgSF2+VfuwU8M83moU1SY/WYdvAZyjtzABKKJDb8OuA=; b=SM+J2DfitOLPlGSo3FwO/lo6DzJImsVVf7u+Dwy/zgXfEh4GGb4hNuX2e+6uAAA3Xu iBYFKfbtKHWyE0+hcsxU5II0XY/83KUJk6iOlIBuorPp/XvTGV7x1C6cOR8sPXxNaPDs fhxz+B51EgMhVtFzJJtzAjdiviQsSNuPc4ED5Qe+zRt8V9rkHy4Ym+WkVJkSyf2IIQeh AoSho4YXsTeFtJRSf+iLu2K9YhwCJJyE2e6Od28oGNHrFNGpBCM7+cQiDvO+QOV3vBJp ImGgCz2GKZWGCBAVvbo3l7YsrMNcsbrknnnUdxC67ivbbMILtlEmwgiCLPN7Y8uqYf+K EGog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wgSF2+VfuwU8M83moU1SY/WYdvAZyjtzABKKJDb8OuA=; b=hhvuqWcjziVUji6EgQWbcMZ25yx4++SFDSJUbDJ3cyhQRpR9XYds/OIydXiB/SZUNQ 2mQcLwlbMlpfuWPUZb98nynQlZ1qSWVfvSfdwcVWwP4tTG9Onk8zHPDpxzo/rzfGXKsb L+cqMDgQvvE65nKiF0jfVwRtX31u5CS962lItH1+v7W/lPLVDxJBbphDQl6R36JyQtWM vB0bvqW43jHuIyJ6++iQ5UGS2nroGQAqrxyvWQyiUwJjrBhcUtgxJmYer4NOMgEvk/Cl Ai6aU3ne2m6kgdmC6P2gQnlEMHmC6G0ODJ8L077FHuvAN8ex4gzEWmxsmqVEflsGPHjI BwDQ== X-Gm-Message-State: AKwxytchovjzKKzqOZWtchZkI367/PmA6a27yOsHmiorekQ7z3sTRxfn SxPLfhgyIREVvmTvOTpMqfRQNgLvAI7Uj547LdF3UQ== X-Google-Smtp-Source: ACJfBotPn1yGWNbdfa/CoiJdfNLhg2UbxHlgrQQwTKTjgkDLuYt8EQHE95pMXfJ3FSTrqumjcLKdcOoXzhnqPBzsVZ8= X-Received: by 10.36.3.144 with SMTP id e138mr5183691ite.97.1515767874286; Fri, 12 Jan 2018 06:37:54 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Fri, 12 Jan 2018 06:37:53 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201801121401.w0CE1cW4058239@repo.freebsd.org> From: Warner Losh Date: Fri, 12 Jan 2018 07:37:53 -0700 X-Google-Sender-Auth: p_Xw6E5vKhNyee-Zw749MfTYgtw Message-ID: Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Andrew Turner Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:37:55 -0000 On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner wrote: > > > On 12 Jan 2018, at 14:10, Marcin Wojtas wrote: > > Hi Andrew, > > > > 2018-01-12 15:01 GMT+01:00 Andrew Turner : > > Author: andrew > Date: Fri Jan 12 14:01:38 2018 > New Revision: 327876 > URL: https://svnweb.freebsd.org/changeset/base/327876 > > Log: > Workaround Spectre Variant 2 on arm64. > > We need to handle two cases: > > 1. One process attacking another process. > 2. A process attacking the kernel. > > For the first case we clear the branch predictor state on context switch > between different processes. For the second we do this when taking an > instruction abort on a non-userspace address. > > To clear the branch predictor state a per-CPU function pointer has been > added. This is set by the new cpu errata code based on if the CPU is > known to be affected. > > On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer > versions of this will clear the branch predictor state for us. > > It has been reported the ThunderX is unaffected, however the ThunderX2 is > vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't > yet run on the ThunderX2 or Falkor no workaround is included for these > CPUs. > > > Regardless ThunderX2 / Falkor work-arounds, do I understand correctly > that pure CA72 machines, such as Marvell Armada 7k/8k are immune to > Variant 2 now? > > > It is my understanding that the A72 will be immune with this patch and an > updated Arm Trusted Firmware as documented in [1]. > > Andrew > > [1] https://github.com/ARM-software/arm-trusted-firmware/ > wiki/ARM-Trusted-Firmware-Security-Advisory-TFV-6 > Are you also working on aarch32 mitigation? Warner From owner-svn-src-all@freebsd.org Fri Jan 12 14:52:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DAF3E69213; Fri, 12 Jan 2018 14:52:05 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id CE4FE6E1F0; Fri, 12 Jan 2018 14:52:04 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [IPv6:2001:630:212:2a8:ad58:428a:6221:67a0] (unknown [IPv6:2001:630:212:2a8:ad58:428a:6221:67a0]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 9C19C4E78C; Fri, 12 Jan 2018 14:52:03 +0000 (UTC) From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include Date: Fri, 12 Jan 2018 14:52:02 +0000 In-Reply-To: Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201801121401.w0CE1cW4058239@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.5.20) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:52:05 -0000 > On 12 Jan 2018, at 14:37, Warner Losh wrote: >=20 >=20 >=20 > On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner > wrote: >=20 >=20 >> On 12 Jan 2018, at 14:10, Marcin Wojtas > wrote: >>=20 >> Hi Andrew, >>=20 >>=20 >>=20 >> 2018-01-12 15:01 GMT+01:00 Andrew Turner >: >>> Author: andrew >>> Date: Fri Jan 12 14:01:38 2018 >>> New Revision: 327876 >>> URL: https://svnweb.freebsd.org/changeset/base/327876 = >>>=20 >>> Log: >>> Workaround Spectre Variant 2 on arm64. >>>=20 >>> We need to handle two cases: >>>=20 >>> 1. One process attacking another process. >>> 2. A process attacking the kernel. >>>=20 >>> For the first case we clear the branch predictor state on context = switch >>> between different processes. For the second we do this when taking = an >>> instruction abort on a non-userspace address. >>>=20 >>> To clear the branch predictor state a per-CPU function pointer has = been >>> added. This is set by the new cpu errata code based on if the CPU = is >>> known to be affected. >>>=20 >>> On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as = newer >>> versions of this will clear the branch predictor state for us. >>>=20 >>> It has been reported the ThunderX is unaffected, however the = ThunderX2 is >>> vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD = doesn't >>> yet run on the ThunderX2 or Falkor no workaround is included for = these CPUs. >>=20 >> Regardless ThunderX2 / Falkor work-arounds, do I understand correctly >> that pure CA72 machines, such as Marvell Armada 7k/8k are immune to >> Variant 2 now? >=20 > It is my understanding that the A72 will be immune with this patch and = an updated Arm Trusted Firmware as documented in [1]. >=20 > Andrew >=20 > [1] = https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firm= ware-Security-Advisory-TFV-6 = >=20 > Are you also working on aarch32 mitigation? No. I think a similar technique could be used, however as aarch32 has = instructions to invalidate the branch predictor these can be used = directly. Andrew= From owner-svn-src-all@freebsd.org Fri Jan 12 14:54:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7C8E69455 for ; Fri, 12 Jan 2018 14:54:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3D746E678 for ; Fri, 12 Jan 2018 14:54:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id p139so9384147itb.1 for ; Fri, 12 Jan 2018 06:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Go4lAj5ElGPELLGX4kIGa4LVnPjIn6Fsn267DIqUfyk=; b=rpG9IP5WD5KDJDM1l3ludSYp0oQbHGfeG+wJTbvDzi0uicZ0UakNOvKV3unuzzwbja JjlL2cq2TDzpYG4cgK49sNVOUiC028CkaQ9fe674KX2aODXO7R2jf0Y1CX65JE2cbX4i zsoT0zzucUddfqheyS4KPl4Uovy6KRfXZaIkNKo1w0/VKSAZuioV/ag62Lflrf1O4iEk eeQtrBZwNTagigUeKWqQ+z9rZjROheQuzrsbsY1daj2zCsMSzNSAgOlfHeBcxUjOyL4K vNJoUlYR4XSpAYWZwBczHUT/cc+9wlN2gDiuYUhAtZXiPdw37y5bCvXmWtE696ypy8TA mdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Go4lAj5ElGPELLGX4kIGa4LVnPjIn6Fsn267DIqUfyk=; b=RyFBi8/YEtWQkaLcx8Y3pyd4mOpSYAJZH55fM7Ob244Bx91FhN1hARINLqXSLSOcs9 ojc9kOSxQheYIcU23cev9kiVn0TckTAYOh/8SVnhPR8rFb0FhmCDsHhA7CSX+KRKsXzA oyw/XVp9zBTwNPZgLXDnnZj7voX2TeAUrCjj9a2iLBzlSE2ph8l4mVTROTyQgg9b70NH AckWn9ue3e1LEJHtmPhGN+kqzAYLfvjZTltQerTG9u2dCX52QudGGwBMr8iotpxpjxf8 cqw3HEYw1UHGfJTO0TrFNRMfwnvO6Hbrzfo+UL5/MhLTLaOB+IVCXAowbu0gglKIFQqf lyeg== X-Gm-Message-State: AKwxyteTbQNSW2R2GMGA3fJ6ajtyumAphtwfofreY/G/BuS9nofjZ1pM 64IxCidVX8aFwB/7xACLxd2GaEJsWXvyExBWrkPbrg== X-Google-Smtp-Source: ACJfBovSN5WTvV+TkdaaydXOA/T6OVABP4/3XPKmgUQZe+kXJqfUBAOsG9XH71xnzzw5o/M/hIVy3OuVpzR74EeL9mg= X-Received: by 10.36.74.200 with SMTP id k191mr5591757itb.69.1515768853896; Fri, 12 Jan 2018 06:54:13 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Fri, 12 Jan 2018 06:54:13 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201801121401.w0CE1cW4058239@repo.freebsd.org> From: Warner Losh Date: Fri, 12 Jan 2018 07:54:13 -0700 X-Google-Sender-Auth: g-YYfWiOWKOJyn_T8lpRWwR4YUQ Message-ID: Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Andrew Turner Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 14:54:15 -0000 On Fri, Jan 12, 2018 at 7:52 AM, Andrew Turner wrote: > > > On 12 Jan 2018, at 14:37, Warner Losh wrote: > > > > On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner wrote: > >> >> >> On 12 Jan 2018, at 14:10, Marcin Wojtas wrote: >> >> Hi Andrew, >> >> >> >> 2018-01-12 15:01 GMT+01:00 Andrew Turner : >> >> Author: andrew >> Date: Fri Jan 12 14:01:38 2018 >> New Revision: 327876 >> URL: https://svnweb.freebsd.org/changeset/base/327876 >> >> Log: >> Workaround Spectre Variant 2 on arm64. >> >> We need to handle two cases: >> >> 1. One process attacking another process. >> 2. A process attacking the kernel. >> >> For the first case we clear the branch predictor state on context switch >> between different processes. For the second we do this when taking an >> instruction abort on a non-userspace address. >> >> To clear the branch predictor state a per-CPU function pointer has been >> added. This is set by the new cpu errata code based on if the CPU is >> known to be affected. >> >> On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer >> versions of this will clear the branch predictor state for us. >> >> It has been reported the ThunderX is unaffected, however the ThunderX2 is >> vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't >> yet run on the ThunderX2 or Falkor no workaround is included for these >> CPUs. >> >> >> Regardless ThunderX2 / Falkor work-arounds, do I understand correctly >> that pure CA72 machines, such as Marvell Armada 7k/8k are immune to >> Variant 2 now? >> >> >> It is my understanding that the A72 will be immune with this patch and an >> updated Arm Trusted Firmware as documented in [1]. >> >> Andrew >> >> [1] https://github.com/ARM-software/arm-trusted-firmware/wik >> i/ARM-Trusted-Firmware-Security-Advisory-TFV-6 >> > > Are you also working on aarch32 mitigation? > > > No. I think a similar technique could be used, however as aarch32 has > instructions to invalidate the branch predictor these can be used directly. > That's my reading as well. It looks fairly easy to do it always, but I've not researched it sufficiently. Warner From owner-svn-src-all@freebsd.org Fri Jan 12 15:30:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D761E6B259; Fri, 12 Jan 2018 15:30:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1380F6FF08; Fri, 12 Jan 2018 15:30:58 +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 3356D2573C; Fri, 12 Jan 2018 15:30:57 +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 w0CFUvEO095789; Fri, 12 Jan 2018 15:30:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CFUv4n095788; Fri, 12 Jan 2018 15:30:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801121530.w0CFUv4n095788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 12 Jan 2018 15:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327879 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 327879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 15:30:58 -0000 Author: imp Date: Fri Jan 12 15:30:56 2018 New Revision: 327879 URL: https://svnweb.freebsd.org/changeset/base/327879 Log: Report the boot order and where we are in that boot order. Add ability to create a boot1.efi that always fails for testing purposes and failover scenarios. Sponsored by: Netflix Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Fri Jan 12 15:30:52 2018 (r327878) +++ head/stand/efi/boot1/boot1.c Fri Jan 12 15:30:56 2018 (r327879) @@ -55,6 +55,7 @@ static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; /* * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures @@ -80,6 +81,25 @@ Free(void *buf, const char *file __unused, int line __ } static EFI_STATUS +efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) +{ + size_t ul; + CHAR16 *uv; + UINT32 attr; + UINTN dl; + EFI_STATUS rv; + + utf8_to_ucs2(v, &uv, &ul); + if (uv == NULL) + return (EFI_OUT_OF_RESOURCES); + dl = *len; + rv = RS->GetVariable(uv, g, &attr, &dl, data); + if (rv == EFI_SUCCESS) + *len = dl; + return (rv); +} + +static EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) { CHAR16 *var = NULL; @@ -411,6 +431,9 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; CHAR16 *text; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; /* Basic initialization*/ ST = Xsystab; @@ -480,12 +503,32 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } } + boot_current = 0; + sz = sizeof(boot_current); + efi_getenv(&GlobalBootVarGUID, "BootCurrent", &boot_current, &sz); + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + efi_getenv(&GlobalBootVarGUID, "BootOrder", &boot_order, &sz); + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x", boot_order[i]); + printf("\n"); + +#ifdef TEST_FAILURE + /* + * For testing failover scenarios, it's nice to be able to fail fast. + * Define TEST_FAILURE to create a boot1.efi that always fails after + * reporting the boot manager protocol details. + */ + BS->Exit(IH, EFI_OUT_OF_RESOURCES, 0, NULL); +#endif + /* Get all the device handles */ hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); handles = malloc(hsize); - if (handles == NULL) { + if (handles == NULL) printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); - } status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, &hsize, handles); From owner-svn-src-all@freebsd.org Fri Jan 12 15:30:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A786BE6B221; Fri, 12 Jan 2018 15:30:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80A5D6FDA6; Fri, 12 Jan 2018 15:30:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1EEA25730; Fri, 12 Jan 2018 15:30:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CFUm1F095684; Fri, 12 Jan 2018 15:30:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CFUmE6095683; Fri, 12 Jan 2018 15:30:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801121530.w0CFUmE6095683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 12 Jan 2018 15:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327877 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 327877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 15:30:49 -0000 Author: imp Date: Fri Jan 12 15:30:48 2018 New Revision: 327877 URL: https://svnweb.freebsd.org/changeset/base/327877 Log: Fix error in determining the next available boot slot. Sponsored by: Netflix Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Fri Jan 12 14:01:38 2018 (r327876) +++ head/usr.sbin/efibootmgr/efibootmgr.c Fri Jan 12 15:30:48 2018 (r327877) @@ -563,7 +563,7 @@ make_next_boot_var_name(void) } else { /* now just run the list looking for the first hole */ for (i = 0; i < cnt - 1 && next_free == 0; i++) - if (vals[i] != vals[i + 1] + 1) + if (vals[i] + 1 != vals[i + 1]) next_free = vals[i] + 1; if (next_free == 0) next_free = vals[cnt - 1] + 1; From owner-svn-src-all@freebsd.org Fri Jan 12 15:30:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FD6E6B22E; Fri, 12 Jan 2018 15:30:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1A36FDB7; Fri, 12 Jan 2018 15:30:53 +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 DE6F025736; Fri, 12 Jan 2018 15:30:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CFUqEP095738; Fri, 12 Jan 2018 15:30:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CFUq7M095737; Fri, 12 Jan 2018 15:30:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801121530.w0CFUq7M095737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 12 Jan 2018 15:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327878 - head/stand/efi/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/include X-SVN-Commit-Revision: 327878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 15:30:53 -0000 Author: imp Date: Fri Jan 12 15:30:52 2018 New Revision: 327878 URL: https://svnweb.freebsd.org/changeset/base/327878 Log: Add GUID for UEFI boot manager variables. Sponsoered by: Netflix Modified: head/stand/efi/include/efi.h Modified: head/stand/efi/include/efi.h ============================================================================== --- head/stand/efi/include/efi.h Fri Jan 12 15:30:48 2018 (r327877) +++ head/stand/efi/include/efi.h Fri Jan 12 15:30:52 2018 (r327878) @@ -59,5 +59,7 @@ Revision History */ #define FREEBSD_BOOT_VAR_GUID \ { 0xCFEE69AD, 0xA0DE, 0x47A9, {0x93, 0xA8, 0xF6, 0x31, 0x06, 0xF8, 0xAE, 0x99} } +#define UEFI_BOOT_VAR_GUID \ + { 0x8be4df61, 0x93ca, 0x11d2, {0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c} } #endif From owner-svn-src-all@freebsd.org Fri Jan 12 16:28:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA81E6E5F4; Fri, 12 Jan 2018 16:28:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8BEA72432; Fri, 12 Jan 2018 16:28:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0F25260CA; Fri, 12 Jan 2018 16:28:51 +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 w0CGSp0K021358; Fri, 12 Jan 2018 16:28:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CGSpS6021356; Fri, 12 Jan 2018 16:28:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801121628.w0CGSpS6021356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 12 Jan 2018 16:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327880 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 327880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 16:28:52 -0000 Author: imp Date: Fri Jan 12 16:28:51 2018 New Revision: 327880 URL: https://svnweb.freebsd.org/changeset/base/327880 Log: Move getsecs() prototype to stand.h from net.h so it can be used everywhere. Sponsored by: Netflix Modified: head/stand/libsa/net.h head/stand/libsa/stand.h Modified: head/stand/libsa/net.h ============================================================================== --- head/stand/libsa/net.h Fri Jan 12 15:30:56 2018 (r327879) +++ head/stand/libsa/net.h Fri Jan 12 16:28:51 2018 (r327880) @@ -128,6 +128,4 @@ char *inet_ntoa(struct in_addr); char *intoa(n_long); /* similar to inet_ntoa */ n_long inet_addr(char *); -/* Machine-dependent functions: */ -time_t getsecs(void); #endif /* ! _STAND_NET_H */ Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Fri Jan 12 15:30:56 2018 (r327879) +++ head/stand/libsa/stand.h Fri Jan 12 16:28:51 2018 (r327880) @@ -394,6 +394,7 @@ extern void putchar(int); extern int devopen(struct open_file *, const char *, const char **); extern int devclose(struct open_file *f); extern void panic(const char *, ...) __dead2 __printflike(1, 2); +extern time_t getsecs(void); extern struct fs_ops *file_system[]; extern struct fs_ops *exclusive_file_system; extern struct devsw *devsw[]; From owner-svn-src-all@freebsd.org Fri Jan 12 17:15:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D19A0E70DF4; Fri, 12 Jan 2018 17:15:19 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70A2E74A20; Fri, 12 Jan 2018 17:15:19 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id i11so13160842wmf.4; Fri, 12 Jan 2018 09:15:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DFIqFFsB+WCLtaB4gYDxwooQr3DS1Lwg3AwN4OW9MJo=; b=AqhwHsII2W1E8LSp15NIyeO+iJDPbeYDtHpnQYNrdow5tJSTN0zXTAnCfc/wyG6TUm oo5hitq0w8JurB7HBrHynIhsbx6TP4FHH396dsnVwJYtsZcl0iECP1iJq60icMrDOYAD rGgCeXmpxg/6+t6IE2znUBNzJLKr7RLQa9PqBikVji5bHSNnUszRZQicWrtqyL1KplC5 k3fAE3A3uM6A+CaUaqbCJqbAYMkPcmieu3l1rNsKkx3Cu9+onUSWdWk3jS+J0J12HznH 4rzsk/1y0S5GWRdQtCM1X3C2wCScsmpSTcJx8hz6iOZw4uplr9wLGSjijI8+xRrKp6YR lfag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=DFIqFFsB+WCLtaB4gYDxwooQr3DS1Lwg3AwN4OW9MJo=; b=Dj7O6bpJIOy5JAwBLlGqEqgBjvtIWyS9isnOdjaZOCGBZiWT3Ymjc9p68H2GqSEtk3 cXTjQC2o7aR0ekLc6IKuNDK8/+QPGVsJp84Tb9sV2VVm2sLfIFVC4eHMPcGeKPslyGoc RTJrvVb01ydMXvUKGuA9UemXTmoZ3UaT1PcDXHkPTMCKb4KhcMmDYteyc01fz35AegAp wEuqL6CLgnwBPZLFZScg6LkKU+a1TJ+It1Ac41AiJrHyZyUf8c3NscELxvnifq5m1uQ9 CgmLuAEdpbckoX9WgdF0JtexLICnVyz5za/z2wasWW+cVZD5AtUsxQhGZqeZvSgyo7ud cdNA== X-Gm-Message-State: AKwxytdHVKAKof29ciRiev6XYbPfrGdpjfUnDXwRroxJE38ndyIZfRju EvoHIoZzsTmu3mM2c2BvFJ86qJmz X-Google-Smtp-Source: ACJfBouXcczM3yImdHg4B2Khb1ROfQhqMl7xI2wH93D4/PfIoVzJBARsvRdciIp3n5sxvHJU3cfafQ== X-Received: by 10.28.168.8 with SMTP id r8mr2620802wme.157.1515777317501; Fri, 12 Jan 2018 09:15:17 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id 187sm5979333wmu.19.2018.01.12.09.15.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 09:15:16 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Warner Losh , Andrew Turner Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801121401.w0CE1cW4058239@repo.freebsd.org> Message-ID: <187e75c7-343f-aea6-cb59-61c77fd64023@freebsd.org> Date: Fri, 12 Jan 2018 18:15:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 17:15:19 -0000 On 12.01.2018 15:54, Warner Losh wrote: > > > On Fri, Jan 12, 2018 at 7:52 AM, Andrew Turner > wrote: > > > >> On 12 Jan 2018, at 14:37, Warner Losh > > wrote: >> >> >> >> On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner > > wrote: >> >> >> >>> On 12 Jan 2018, at 14:10, Marcin Wojtas >> > wrote: >>> >>> Hi Andrew, >>> >>> >>> >>> 2018-01-12 15:01 GMT+01:00 Andrew Turner >> >: >>>> Author: andrew >>>> Date: Fri Jan 12 14:01:38 2018 >>>> New Revision: 327876 >>>> URL: https://svnweb.freebsd.org/changeset/base/327876 >>>> >>>> >>>> Log: >>>>  Workaround Spectre Variant 2 on arm64. >>>> >>>>  We need to handle two cases: >>>> >>>>  1. One process attacking another process. >>>>  2. A process attacking the kernel. >>>> >>>>  For the first case we clear the branch predictor state on >>>> context switch >>>>  between different processes. For the second we do this when >>>> taking an >>>>  instruction abort on a non-userspace address. >>>> >>>>  To clear the branch predictor state a per-CPU function >>>> pointer has been >>>>  added. This is set by the new cpu errata code based on if >>>> the CPU is >>>>  known to be affected. >>>> >>>>  On Cortex-A57, A72, A73, and A75 we call into the PSCI >>>> firmware as newer >>>>  versions of this will clear the branch predictor state for us. >>>> >>>>  It has been reported the ThunderX is unaffected, however >>>> the ThunderX2 is >>>>  vulnerable. The Qualcomm Falkor core is also affected. As >>>> FreeBSD doesn't >>>>  yet run on the ThunderX2 or Falkor no workaround is >>>> included for these CPUs. >>> >>> Regardless ThunderX2 / Falkor work-arounds, do I understand >>> correctly >>> that pure CA72 machines, such as Marvell Armada 7k/8k are >>> immune to >>> Variant 2 now? >> >> It is my understanding that the A72 will be immune with this >> patch and an updated Arm Trusted Firmware as documented in [1]. >> >> Andrew >> >> [1] >> https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firmware-Security-Advisory-TFV-6 >> >> >> >> Are you also working on aarch32 mitigation? > > No. I think a similar technique could be used, however as aarch32 > has instructions to invalidate the branch predictor these can be > used directly. > > > That's my reading as well. It looks fairly easy to do it always, but > I've not researched it sufficiently. > I work on patches for armv6/7. But for aarch32, there is, unfortunately, much less information available about affective mitigation of variant 2. BPIALL while switching pmap is clear and we have it in code for years (well, BPIALL is effectively NOP for A15/A17, it must be explicitly enabled). But is not clear for me for which trap is branch predictor flush necessary. Michal From owner-svn-src-all@freebsd.org Fri Jan 12 17:21:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF70E713CB; Fri, 12 Jan 2018 17:21:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D6F75646; Fri, 12 Jan 2018 17:21:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9ABE26A3A; Fri, 12 Jan 2018 17:21:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CHLmDr046189; Fri, 12 Jan 2018 17:21:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CHLmC2046188; Fri, 12 Jan 2018 17:21:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801121721.w0CHLmC2046188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 12 Jan 2018 17:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327881 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 327881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 17:21:49 -0000 Author: imp Date: Fri Jan 12 17:21:48 2018 New Revision: 327881 URL: https://svnweb.freebsd.org/changeset/base/327881 Log: Allow this file to be included Use simple "foo" rather than "${.CURDIR}/foo" to include Makefile.fat since the former works when including this Makefile from else where. Also, use full path from ${BOOTSRC} to the FAT templates for similar reasons. It doesn't change anything in base FreeBSD, but allows us to have a custom boot1.efi more easily (though that will be short-lived for us, it may also be helpful for others). Sponsored by: Netflix Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri Jan 12 16:28:51 2018 (r327880) +++ head/stand/efi/boot1/Makefile Fri Jan 12 17:21:48 2018 (r327881) @@ -110,7 +110,7 @@ boot1.efi: ${PROG} # The following inserts our objects into a template FAT file system # created by generate-fat.sh -.include "${.CURDIR}/Makefile.fat" +.include "Makefile.fat" boot1.efifat: boot1.efi @set -- `ls -l ${.ALLSRC}`; \ @@ -120,7 +120,7 @@ boot1.efifat: boot1.efi exit 1; \ fi echo ${.OBJDIR} - xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} + xz -d -c ${BOOTSRC}/efi/boot1/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES+= boot1.efi boot1.efifat From owner-svn-src-all@freebsd.org Fri Jan 12 17:33:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D14E71BD7; Fri, 12 Jan 2018 17:33:21 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3460176095; Fri, 12 Jan 2018 17:33:21 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A5B826C27; Fri, 12 Jan 2018 17:33:20 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CHXKr2050593; Fri, 12 Jan 2018 17:33:20 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CHXKNl050592; Fri, 12 Jan 2018 17:33:20 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201801121733.w0CHXKNl050592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Fri, 12 Jan 2018 17:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327882 - head X-SVN-Group: head X-SVN-Commit-Author: schweikh X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 17:33:21 -0000 Author: schweikh Date: Fri Jan 12 17:33:20 2018 New Revision: 327882 URL: https://svnweb.freebsd.org/changeset/base/327882 Log: Correct a couple of typos. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jan 12 17:21:48 2018 (r327881) +++ head/UPDATING Fri Jan 12 17:33:20 2018 (r327882) @@ -60,8 +60,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: WITHOUT_LLD_BOOTSTRAP=yes 20180110: - On i386, pmtimer has been removed. It's functionality has been folded - into apm. It was a nop on ACPI in current for a while now (but was still + On i386, pmtimer has been removed. Its functionality has been folded + into apm. It was a no-op on ACPI in current for a while now (but was still needed on i386 in FreeBSD 11 and earlier). Users may need to remove it from kernel config files. @@ -209,7 +209,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: will create the recovery information. If you have a filesystem created prior to this change and wish to have a recovery block created for your filesystem, you can do so by running fsck in - forground mode (i.e., do not use the -p or -y options). As it + foreground mode (i.e., do not use the -p or -y options). As it starts, fsck will ask ``SAVE DATA TO FIND ALTERNATE SUPERBLOCKS'' to which you should answer yes. @@ -1869,7 +1869,7 @@ COMMON ITEMS: do an upgrade to the new branch. This is the best-tested upgrade path, and has the highest probability of being successful. Please try this approach if you encounter problems with a major version upgrade. Since - the stable 4.x branch point, one has generally been able to upgade from + the stable 4.x branch point, one has generally been able to upgrade from anywhere in the most recent stable branch to head / current (or even the last couple of stable branches). See the top of this file when there's an exception. @@ -2007,7 +2007,7 @@ COMMON ITEMS: for potential gotchas. The -U option is also useful to consider. See mergemaster(8) for more information. - [5] Usually this step is a noop. However, from time to time + [5] Usually this step is a no-op. However, from time to time you may need to do this if you get unknown user in the following step. It never hurts to do it all the time. You may need to install a new mergemaster (cd src/usr.sbin/mergemaster && make From owner-svn-src-all@freebsd.org Fri Jan 12 17:36:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6395E71E25; Fri, 12 Jan 2018 17:36:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE4C762C0; Fri, 12 Jan 2018 17:36:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD2C726C29; Fri, 12 Jan 2018 17:36:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CHaJlM050751; Fri, 12 Jan 2018 17:36:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CHaJLI050749; Fri, 12 Jan 2018 17:36:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801121736.w0CHaJLI050749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 12 Jan 2018 17:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327883 - in stable/11: include sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in stable/11: include sys/sys X-SVN-Commit-Revision: 327883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 17:36:20 -0000 Author: pfg Date: Fri Jan 12 17:36:19 2018 New Revision: 327883 URL: https://svnweb.freebsd.org/changeset/base/327883 Log: MFC r327697, r327699: Use the __result_use_check attribute for reallocf(9). MFC r327751: Use the __result_use_check attribute also for reallocf(3). The GCC attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. Unlike the traditional realloc, with reallocf(3) we don't have to check for NULL values but we still have to make sure the result is used. Modified: stable/11/include/stdlib.h stable/11/sys/sys/malloc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/stdlib.h ============================================================================== --- stable/11/include/stdlib.h Fri Jan 12 17:33:20 2018 (r327882) +++ stable/11/include/stdlib.h Fri Jan 12 17:36:19 2018 (r327883) @@ -309,7 +309,7 @@ int radixsort(const unsigned char **, int, const unsi unsigned); void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2) __alloc_size(3); -void *reallocf(void *, size_t) __alloc_size(2); +void *reallocf(void *, size_t) __result_use_check __alloc_size(2); int rpmatch(const char *); void setprogname(const char *); int sradixsort(const unsigned char **, int, const unsigned char *, Modified: stable/11/sys/sys/malloc.h ============================================================================== --- stable/11/sys/sys/malloc.h Fri Jan 12 17:33:20 2018 (r327882) +++ stable/11/sys/sys/malloc.h Fri Jan 12 17:36:19 2018 (r327883) @@ -184,7 +184,7 @@ void malloc_uninit(void *); void *realloc(void *addr, unsigned long size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, unsigned long size, struct malloc_type *type, - int flags) __alloc_size(2); + int flags) __result_use_check __alloc_size(2); struct malloc_type *malloc_desc2type(const char *desc); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Jan 12 18:41:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE60E7543A; Fri, 12 Jan 2018 18:41:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9796779638; Fri, 12 Jan 2018 18:41:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D63D110A7DB; Fri, 12 Jan 2018 13:41:28 -0500 (EST) From: John Baldwin To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r327843 - stable/11/tools/build/options Date: Fri, 12 Jan 2018 09:29:40 -0800 Message-ID: <11735770.uMkkBBHlKq@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801111941.w0BJf0mn093791@repo.freebsd.org> References: <201801111941.w0BJf0mn093791@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 12 Jan 2018 13:41:28 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 18:41:37 -0000 On Thursday, January 11, 2018 07:41:00 PM Ian Lepore wrote: > Author: ian > Date: Thu Jan 11 19:41:00 2018 > New Revision: 327843 > URL: https://svnweb.freebsd.org/changeset/base/327843 > > Log: > Add description files for WITH/WITHOUT_LINT. These should have been part > of r327837. > > PR: 223892 > Differential Revision: https://reviews.freebsd.org/D13799 > > Added: > stable/11/tools/build/options/WITHOUT_LINT (contents, props changed) > stable/11/tools/build/options/WITH_LINT (contents, props changed) > > Added: stable/11/tools/build/options/WITHOUT_LINT > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/11/tools/build/options/WITHOUT_LINT Thu Jan 11 19:41:00 2018 (r327843) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to not build the lint binaries and library. > +.\" $FreeBSD$ > +Set to not build the lint binaries and library. > > Added: stable/11/tools/build/options/WITH_LINT > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/11/tools/build/options/WITH_LINT Thu Jan 11 19:41:00 2018 (r327843) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to build the lint binaries and library. > +.\" $FreeBSD$ > +Set to build the lint binaries and library. Duplicated contents? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jan 12 19:59:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0F4CE78DE0; Fri, 12 Jan 2018 19:59: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 990527CA25; Fri, 12 Jan 2018 19:59: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 D3A643B2; Fri, 12 Jan 2018 19:59:47 +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 w0CJxlpS010081; Fri, 12 Jan 2018 19:59:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CJxlaw010074; Fri, 12 Jan 2018 19:59:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201801121959.w0CJxlaw010074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 12 Jan 2018 19:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327888 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety sys/cddl/contrib/ope... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety sys/cddl/contrib/opensolaris/uts/common/dtrac... X-SVN-Commit-Revision: 327888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 19:59:48 -0000 Author: markj Date: Fri Jan 12 19:59:46 2018 New Revision: 327888 URL: https://svnweb.freebsd.org/changeset/base/327888 Log: Add "jid" and "jailname" variables to DTrace. These return the jail ID and jail name for the traced process, respectively, and are analogous to "zonename" on Solaris/illumos. "zonename" is now aliased to "jailname". Also add some stress tests for the new variables. Submitted by: Domagoj Stolfa Reviewed by: dteske (previous version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13877 Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d Fri Jan 12 19:59:46 2018 (r327888) @@ -0,0 +1,44 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2018 Domagoj Stolfa . + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect jailname at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[jailname] = count(); +} + +profile-4999hz +{ + @a[jailname] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d Fri Jan 12 19:59:46 2018 (r327888) @@ -0,0 +1,44 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2018 Domagoj Stolfa . + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect jid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[jid] = count(); +} + +profile-4999hz +{ + @a[jid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Jan 12 18:44:28 2018 (r327887) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Jan 12 19:59:46 2018 (r327888) @@ -313,6 +313,12 @@ static const dt_ident_t _dtrace_globals[] = { DT_VERS_1_5, &dt_idops_func, "string(int, void *)" }, { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "uint_t" }, +#ifdef __FreeBSD__ +{ "jailname", DT_IDENT_SCALAR, 0, DIF_VAR_JAILNAME, + DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" }, +{ "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13, + &dt_idops_type, "int" }, +#endif { "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11, &dt_idops_func, "string(const char *, const char *)" }, { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0, @@ -528,10 +534,8 @@ static const dt_ident_t _dtrace_globals[] = { { "walltimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_WALLTIMESTAMP, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int64_t" }, -#ifdef illumos { "zonename", DT_IDENT_SCALAR, 0, DIF_VAR_ZONENAME, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "string" }, -#endif #ifndef illumos { "cpu", DT_IDENT_SCALAR, 0, DIF_VAR_CPU, Modified: head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Fri Jan 12 18:44:28 2018 (r327887) +++ head/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Fri Jan 12 19:59:46 2018 (r327888) @@ -19,6 +19,8 @@ ${PACKAGE}FILES= \ tst.gid.d \ tst.hton.d \ tst.index.d \ + tst.jailname.d \ + tst.jid.d \ tst.msgdsize.d \ tst.msgsize.d \ tst.null.d \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jan 12 18:44:28 2018 (r327887) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jan 12 19:59:46 2018 (r327888) @@ -3654,6 +3654,24 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_st return (dtrace_dif_varstr( (uintptr_t)curthread->t_procp->p_zone->zone_name, state, mstate)); +#elif defined(__FreeBSD__) + /* + * On FreeBSD, we introduce compatibility to zonename by falling through + * into jailname. + */ + case DIF_VAR_JAILNAME: + if (!dtrace_priv_kernel(state)) + return (0); + + return (dtrace_dif_varstr( + (uintptr_t)curthread->t_procp->p_ucred->cr_prison->pr_name, + state, mstate)); + + case DIF_VAR_JID: + if (!dtrace_priv_kernel(state)) + return (0); + + return ((uint64_t)curthread->t_procp->p_ucred->cr_prison->pr_id); #else return (0); #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri Jan 12 18:44:28 2018 (r327887) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri Jan 12 19:59:46 2018 (r327888) @@ -254,6 +254,8 @@ typedef enum dtrace_probespec { #define DIF_VAR_GID 0x011f /* process group ID */ #define DIF_VAR_ERRNO 0x0120 /* thread errno */ #define DIF_VAR_EXECARGS 0x0121 /* process arguments */ +#define DIF_VAR_JID 0x0122 /* process jail id */ +#define DIF_VAR_JAILNAME 0x0123 /* process jail name */ #ifndef illumos #define DIF_VAR_CPU 0x0200 From owner-svn-src-all@freebsd.org Fri Jan 12 20:03:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1123E79107; Fri, 12 Jan 2018 20:03:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDFE7CEF0; Fri, 12 Jan 2018 20:03:25 +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 CA09956C; Fri, 12 Jan 2018 20:03:24 +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 w0CK3OVb014079; Fri, 12 Jan 2018 20:03:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CK3OoG014078; Fri, 12 Jan 2018 20:03:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801122003.w0CK3OoG014078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Jan 2018 20:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327889 - head/contrib/gcc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/gcc X-SVN-Commit-Revision: 327889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 20:03:25 -0000 Author: emaste Date: Fri Jan 12 20:03:24 2018 New Revision: 327889 URL: https://svnweb.freebsd.org/changeset/base/327889 Log: Revert r280909 "unwind-d2 build workaround for arm64" We no longer try to build unwind-dw2.c on arm64 so no need for this workaround. Sponsored by: The FreeBSD Foundation Modified: head/contrib/gcc/unwind-dw2.c Modified: head/contrib/gcc/unwind-dw2.c ============================================================================== --- head/contrib/gcc/unwind-dw2.c Fri Jan 12 19:59:46 2018 (r327888) +++ head/contrib/gcc/unwind-dw2.c Fri Jan 12 20:03:24 2018 (r327889) @@ -1393,16 +1393,7 @@ uw_advance_context (struct _Unwind_Context *context, _ static inline void init_dwarf_reg_size_table (void) { -/* - * ARM64TODO: http://llvm.org/pr22997 - * llvm 3.6 doesn't support __builtin_init_dwarf_reg_size_table on AArch64. - */ -#ifdef __aarch64__ - printf("Unimplemented: init_dwarf_reg_size_table\n"); - abort(); -#else __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table); -#endif } static void From owner-svn-src-all@freebsd.org Fri Jan 12 20:25:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 890C4E7A355; Fri, 12 Jan 2018 20:25:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60CE07E0F4; Fri, 12 Jan 2018 20:25:58 +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 A52AE8D5; Fri, 12 Jan 2018 20:25:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CKPv8S022671; Fri, 12 Jan 2018 20:25:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CKPvVk022670; Fri, 12 Jan 2018 20:25:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801122025.w0CKPvVk022670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 12 Jan 2018 20:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 327890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 20:25:58 -0000 Author: emaste Date: Fri Jan 12 20:25:57 2018 New Revision: 327890 URL: https://svnweb.freebsd.org/changeset/base/327890 Log: bsdinstall: disable SUJ by default SUJ + cg checksums produce spurious warnings after an unclean shutdown (e.g. a crash). For now disable SUJ for UFS installs so installing from a FreeBSD 12 snapshot results in a usable filesystem, until this can be fixed. PR: 225110 Submitted by: Arshan Khanifar Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13890 Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Jan 12 20:03:24 2018 (r327889) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Jan 12 20:25:57 2018 (r327890) @@ -91,8 +91,7 @@ newfs_command(const char *fstype, char *command, int u {"SU", "Softupdates", "Enable softupdates (default)", 1 }, {"SUJ", "Softupdates journaling", - "Enable file system journaling (default - " - "turn off for SSDs)", 1 }, + "Enable file system journaling", 0 }, {"TRIM", "Enable SSD TRIM support", "Enable TRIM support, useful on solid-state drives", 0 }, From owner-svn-src-all@freebsd.org Fri Jan 12 20:35:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E190AE7AA54; Fri, 12 Jan 2018 20:35:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE03A7E721; Fri, 12 Jan 2018 20:35:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12469A72; Fri, 12 Jan 2018 20:35:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CKZR1m026912; Fri, 12 Jan 2018 20:35:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CKZRHR026911; Fri, 12 Jan 2018 20:35:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801122035.w0CKZRHR026911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 12 Jan 2018 20:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327891 - head/sys/arm/allwinner/a83t X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner/a83t X-SVN-Commit-Revision: 327891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 20:35:29 -0000 Author: kevans Date: Fri Jan 12 20:35:27 2018 New Revision: 327891 URL: https://svnweb.freebsd.org/changeset/base/327891 Log: allwinner/a83t_padconf: Rename "emac" function to "gmac" as per upstream DTS Although these should have been 'emac', upstream DTS is going with using 'gmac' as the function name for the emac RGMII pins. Rename here to accommodate. emac support for the a83t should come in with the 4.16 DTS update, in another couple of months. Modified: head/sys/arm/allwinner/a83t/a83t_padconf.c Modified: head/sys/arm/allwinner/a83t/a83t_padconf.c ============================================================================== --- head/sys/arm/allwinner/a83t/a83t_padconf.c Fri Jan 12 20:25:57 2018 (r327890) +++ head/sys/arm/allwinner/a83t/a83t_padconf.c Fri Jan 12 20:35:27 2018 (r327891) @@ -71,24 +71,24 @@ static const struct allwinner_pins a83t_pins[] = { { "PC17", 2, 17, { "gpio_in", "gpio_out", "nand" } }, { "PC18", 2, 18, { "gpio_in", "gpio_out", "nand" } }, - { "PD2", 3, 2, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD3", 3, 3, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD4", 3, 4, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD5", 3, 5, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD6", 3, 6, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD7", 3, 7, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD10", 3, 10, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD11", 3, 11, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD12", 3, 12, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD13", 3, 13, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD14", 3, 14, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD15", 3, 15, { "gpio_in", "gpio_out", "lcd", NULL, "emac" } }, - { "PD18", 3, 18, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, - { "PD19", 3, 19, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, - { "PD20", 3, 20, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, - { "PD21", 3, 21, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, - { "PD22", 3, 22, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, - { "PD23", 3, 23, { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } }, + { "PD2", 3, 2, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD3", 3, 3, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD4", 3, 4, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD5", 3, 5, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD6", 3, 6, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD7", 3, 7, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD10", 3, 10, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD11", 3, 11, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD12", 3, 12, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD13", 3, 13, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD14", 3, 14, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD15", 3, 15, { "gpio_in", "gpio_out", "lcd", NULL, "gmac" } }, + { "PD18", 3, 18, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, + { "PD19", 3, 19, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, + { "PD20", 3, 20, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, + { "PD21", 3, 21, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, + { "PD22", 3, 22, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, + { "PD23", 3, 23, { "gpio_in", "gpio_out", "lcd", "lvds", "gmac" } }, { "PD24", 3, 24, { "gpio_in", "gpio_out", "lcd", "lvds" } }, { "PD25", 3, 25, { "gpio_in", "gpio_out", "lcd", "lvds" } }, { "PD26", 3, 26, { "gpio_in", "gpio_out", "lcd", "lvds" } }, From owner-svn-src-all@freebsd.org Fri Jan 12 20:40:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E39E7AD25; Fri, 12 Jan 2018 20:40:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC317E969; Fri, 12 Jan 2018 20:40:28 +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 C79A8A7A; Fri, 12 Jan 2018 20:40:27 +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 w0CKeRdw027119; Fri, 12 Jan 2018 20:40:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CKeRbq027118; Fri, 12 Jan 2018 20:40:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201801122040.w0CKeRbq027118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 12 Jan 2018 20:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327892 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 327892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 20:40:28 -0000 Author: bdrewery Date: Fri Jan 12 20:40:27 2018 New Revision: 327892 URL: https://svnweb.freebsd.org/changeset/base/327892 Log: Ensure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP. This fixes building libllvmminimal with MK_LLD support when WITHOUT_LLD or WITHOUT_TOOLCHAIN are set, which are install flags not build tools flags. Reported by: sbruno Tested by: sbruno Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 12 20:35:27 2018 (r327891) +++ head/Makefile.inc1 Fri Jan 12 20:40:27 2018 (r327892) @@ -537,6 +537,7 @@ BSARGS= DESTDIR= \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ + MK_LLD=${MK_LLD_BOOTSTRAP} \ MK_INCLUDES=yes BMAKE= \ From owner-svn-src-all@freebsd.org Fri Jan 12 21:44:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22181E7E046; Fri, 12 Jan 2018 21:44:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA499818AD; Fri, 12 Jan 2018 21:44:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05A7A15E0; Fri, 12 Jan 2018 21:44:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CLirC2057294; Fri, 12 Jan 2018 21:44:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CLirYd057288; Fri, 12 Jan 2018 21:44:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801122144.w0CLirYd057288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 12 Jan 2018 21:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327893 - in vendor/dtc/dist: . Documentation libfdt pylibfdt tests X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in vendor/dtc/dist: . Documentation libfdt pylibfdt tests X-SVN-Commit-Revision: 327893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 21:44:55 -0000 Author: kevans Date: Fri Jan 12 21:44:53 2018 New Revision: 327893 URL: https://svnweb.freebsd.org/changeset/base/327893 Log: Import dtc 1.4.6 Added: vendor/dtc/dist/fdtoverlay.c (contents, props changed) vendor/dtc/dist/pylibfdt/ vendor/dtc/dist/pylibfdt/Makefile.pylibfdt (contents, props changed) vendor/dtc/dist/pylibfdt/libfdt.i vendor/dtc/dist/pylibfdt/setup.py (contents, props changed) vendor/dtc/dist/tests/bad-chosen.dts (contents, props changed) vendor/dtc/dist/tests/bad-gpio.dts (contents, props changed) vendor/dtc/dist/tests/bad-interrupt-cells.dts (contents, props changed) vendor/dtc/dist/tests/bad-phandle-cells.dts (contents, props changed) vendor/dtc/dist/tests/fdtoverlay-runtest.sh (contents, props changed) vendor/dtc/dist/tests/pci-bridge-bad1.dts (contents, props changed) vendor/dtc/dist/tests/pci-bridge-bad2.dts (contents, props changed) vendor/dtc/dist/tests/pci-bridge-ok.dts (contents, props changed) vendor/dtc/dist/tests/pylibfdt_tests.py (contents, props changed) vendor/dtc/dist/tests/stacked_overlay_bar.dts (contents, props changed) vendor/dtc/dist/tests/stacked_overlay_base.dts (contents, props changed) vendor/dtc/dist/tests/stacked_overlay_baz.dts (contents, props changed) vendor/dtc/dist/tests/unit-addr-leading-0s.dts (contents, props changed) vendor/dtc/dist/tests/unit-addr-leading-0x.dts (contents, props changed) Modified: vendor/dtc/dist/Documentation/manual.txt vendor/dtc/dist/Makefile vendor/dtc/dist/Makefile.utils vendor/dtc/dist/README vendor/dtc/dist/checks.c vendor/dtc/dist/convert-dtsv0-lexer.l vendor/dtc/dist/data.c vendor/dtc/dist/dtc-lexer.l vendor/dtc/dist/dtc-parser.y vendor/dtc/dist/dtc.c vendor/dtc/dist/dtc.h vendor/dtc/dist/fdtdump.c vendor/dtc/dist/fdtget.c vendor/dtc/dist/fdtput.c vendor/dtc/dist/flattree.c vendor/dtc/dist/libfdt/fdt.c vendor/dtc/dist/libfdt/fdt.h vendor/dtc/dist/libfdt/fdt_empty_tree.c vendor/dtc/dist/libfdt/fdt_overlay.c vendor/dtc/dist/libfdt/fdt_ro.c vendor/dtc/dist/libfdt/fdt_rw.c vendor/dtc/dist/libfdt/fdt_sw.c vendor/dtc/dist/libfdt/fdt_wip.c vendor/dtc/dist/libfdt/libfdt.h vendor/dtc/dist/libfdt/libfdt_env.h vendor/dtc/dist/libfdt/libfdt_internal.h vendor/dtc/dist/libfdt/version.lds vendor/dtc/dist/livetree.c vendor/dtc/dist/srcpos.h vendor/dtc/dist/tests/Makefile.tests vendor/dtc/dist/tests/bad-string-props.dts vendor/dtc/dist/tests/char_literal.c vendor/dtc/dist/tests/dtbs_equal_ordered.c vendor/dtc/dist/tests/dtbs_equal_unordered.c vendor/dtc/dist/tests/dumptrees.c vendor/dtc/dist/tests/include7.dts vendor/dtc/dist/tests/integer-expressions.c vendor/dtc/dist/tests/node_check_compatible.c vendor/dtc/dist/tests/node_offset_by_prop_value.c vendor/dtc/dist/tests/nopulate.c vendor/dtc/dist/tests/path-references.c vendor/dtc/dist/tests/path-references.dts vendor/dtc/dist/tests/property_iterate.c vendor/dtc/dist/tests/references.c vendor/dtc/dist/tests/run_tests.sh vendor/dtc/dist/tests/sized_cells.c vendor/dtc/dist/tests/stringlist.c vendor/dtc/dist/tests/subnode_iterate.c vendor/dtc/dist/tests/sw_tree1.c vendor/dtc/dist/tests/test_tree1.dts vendor/dtc/dist/tests/test_tree1_label_noderef.dts vendor/dtc/dist/tests/testdata.h vendor/dtc/dist/tests/tests.h vendor/dtc/dist/tests/tests.sh vendor/dtc/dist/tests/trees.S vendor/dtc/dist/tests/truncated_property.c vendor/dtc/dist/tests/value-labels.c vendor/dtc/dist/treesource.c vendor/dtc/dist/util.c vendor/dtc/dist/util.h Modified: vendor/dtc/dist/Documentation/manual.txt ============================================================================== --- vendor/dtc/dist/Documentation/manual.txt Fri Jan 12 20:40:27 2018 (r327892) +++ vendor/dtc/dist/Documentation/manual.txt Fri Jan 12 21:44:53 2018 (r327893) @@ -674,4 +674,22 @@ The fdtdump program prints a readable version of a fla The syntax of the fdtdump command line is: - fdtdump + fdtdump [options] + +Where options are: + -d,--debug Dump debug information while decoding the file + -s,--scan Scan for an embedded fdt in given file + +3) fdtoverlay -- Flat Device Tree overlay applicator + +The fdtoverlay applies an arbitrary number of FDT overlays to a base FDT blob +to a given output file. + +The syntax of the fdtoverlay command line is: + + fdtoverlay -i -o [ ...] + +Where options are: + -i, --input Input base DT blob + -o, --output Output DT blob + -v, --verbose Verbose message output Modified: vendor/dtc/dist/Makefile ============================================================================== --- vendor/dtc/dist/Makefile Fri Jan 12 20:40:27 2018 (r327892) +++ vendor/dtc/dist/Makefile Fri Jan 12 21:44:53 2018 (r327893) @@ -10,7 +10,7 @@ # VERSION = 1 PATCHLEVEL = 4 -SUBLEVEL = 3 +SUBLEVEL = 6 EXTRAVERSION = LOCAL_VERSION = CONFIG_LOCALVERSION = @@ -18,10 +18,12 @@ CONFIG_LOCALVERSION = CPPFLAGS = -I libfdt -I . WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow -CFLAGS = -g -Os -fPIC -Werror $(WARNINGS) +CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) BISON = bison LEX = flex +SWIG = swig +PKG_CONFIG ?= pkg-config INSTALL = /usr/bin/install DESTDIR = @@ -31,14 +33,20 @@ LIBDIR = $(PREFIX)/lib INCLUDEDIR = $(PREFIX)/include HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ - sed -e 's/\(cygwin\).*/cygwin/') + sed -e 's/\(cygwin\|msys\).*/\1/') ifeq ($(HOSTOS),darwin) -SHAREDLIB_EXT=dylib -SHAREDLIB_LINK_OPTIONS=-dynamiclib -Wl,-install_name -Wl, +SHAREDLIB_EXT = dylib +SHAREDLIB_CFLAGS = -fPIC +SHAREDLIB_LDFLAGS = -fPIC -dynamiclib -Wl,-install_name -Wl, +else ifeq ($(HOSTOS),$(filter $(HOSTOS),msys cygwin)) +SHAREDLIB_EXT = so +SHAREDLIB_CFLAGS = +SHAREDLIB_LDFLAGS = -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname, else -SHAREDLIB_EXT=so -SHAREDLIB_LINK_OPTIONS=-shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname, +SHAREDLIB_EXT = so +SHAREDLIB_CFLAGS = -fPIC +SHAREDLIB_LDFLAGS = -fPIC -shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname, endif # @@ -112,18 +120,38 @@ BIN += dtc BIN += fdtdump BIN += fdtget BIN += fdtput +BIN += fdtoverlay SCRIPTS = dtdiff all: $(BIN) libfdt +# We need both Python and swig to build pylibfdt. +.PHONY: maybe_pylibfdt +maybe_pylibfdt: FORCE + if $(PKG_CONFIG) --cflags python2 >/dev/null 2>&1; then \ + if which swig >/dev/null 2>&1; then \ + can_build=yes; \ + fi; \ + fi; \ + if [ "$$can_build" = "yes" ]; then \ + $(MAKE) pylibfdt; \ + else \ + echo "## Skipping pylibfdt (install python dev and swig to build)"; \ + fi +ifeq ($(NO_PYTHON),) +all: maybe_pylibfdt +endif + + ifneq ($(DEPTARGETS),) -include $(DTC_OBJS:%.o=%.d) -include $(CONVERT_OBJS:%.o=%.d) -include $(FDTDUMP_OBJS:%.o=%.d) -include $(FDTGET_OBJS:%.o=%.d) -include $(FDTPUT_OBJS:%.o=%.d) +-include $(FDTOVERLAY_OBJS:%.o=%.d) endif @@ -180,6 +208,10 @@ install-includes: install: install-bin install-lib install-includes +ifeq ($(NO_PYTHON),) +install: install_pylibfdt +endif + $(VERSION_FILE): Makefile FORCE $(call filechk,version) @@ -196,13 +228,31 @@ fdtget: $(FDTGET_OBJS) $(LIBFDT_archive) fdtput: $(FDTPUT_OBJS) $(LIBFDT_archive) +fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_archive) + dist: git archive --format=tar --prefix=dtc-$(dtc_version)/ HEAD \ > ../dtc-$(dtc_version).tar cat ../dtc-$(dtc_version).tar | \ gzip -9 > ../dtc-$(dtc_version).tar.gz + # +# Rules for pylibfdt +# +PYLIBFDT_srcdir = pylibfdt +PYLIBFDT_objdir = pylibfdt + +include $(PYLIBFDT_srcdir)/Makefile.pylibfdt + +.PHONY: pylibfdt +pylibfdt: $(PYLIBFDT_objdir)/_libfdt.so + +pylibfdt_clean: + @$(VECHO) CLEAN "(pylibfdt)" + rm -f $(addprefix $(PYLIBFDT_objdir)/,$(PYLIBFDT_cleanfiles)) + +# # Release signing and uploading # This is for maintainer convenience, don't try this at home. # @@ -234,6 +284,10 @@ TESTS_BIN += convert-dtsv0 TESTS_BIN += fdtput TESTS_BIN += fdtget TESTS_BIN += fdtdump +TESTS_BIN += fdtoverlay +ifeq ($(NO_PYTHON),) +TESTS_PYLIBFDT += maybe_pylibfdt +endif include tests/Makefile.tests @@ -243,7 +297,7 @@ include tests/Makefile.tests STD_CLEANFILES = *~ *.o *.$(SHAREDLIB_EXT) *.d *.a *.i *.s core a.out vgcore.* \ *.tab.[ch] *.lex.c *.output -clean: libfdt_clean tests_clean +clean: libfdt_clean pylibfdt_clean tests_clean @$(VECHO) CLEAN rm -f $(STD_CLEANFILES) rm -f $(VERSION_FILE) @@ -287,7 +341,7 @@ clean: libfdt_clean tests_clean $(LIBFDT_lib): @$(VECHO) LD $@ - $(CC) $(LDFLAGS) -fPIC $(SHAREDLIB_LINK_OPTIONS)$(LIBFDT_soname) -o $(LIBFDT_lib) $^ + $(CC) $(LDFLAGS) $(SHAREDLIB_LDFLAGS)$(LIBFDT_soname) -o $(LIBFDT_lib) $^ %.lex.c: %.l @$(VECHO) LEX $@ Modified: vendor/dtc/dist/Makefile.utils ============================================================================== --- vendor/dtc/dist/Makefile.utils Fri Jan 12 20:40:27 2018 (r327892) +++ vendor/dtc/dist/Makefile.utils Fri Jan 12 21:44:53 2018 (r327893) @@ -22,3 +22,9 @@ FDTPUT_SRCS = \ util.c FDTPUT_OBJS = $(FDTPUT_SRCS:%.c=%.o) + +FDTOVERLAY_SRCS = \ + fdtoverlay.c \ + util.c + +FDTOVERLAY_OBJS = $(FDTOVERLAY_SRCS:%.c=%.o) Modified: vendor/dtc/dist/README ============================================================================== --- vendor/dtc/dist/README Fri Jan 12 20:40:27 2018 (r327892) +++ vendor/dtc/dist/README Fri Jan 12 21:44:53 2018 (r327893) @@ -7,6 +7,83 @@ DTC and LIBFDT are maintained by: David Gibson Jon Loeliger + +Python library +-------------- + +A Python library is also available. To build this you will need to install +swig and Python development files. On Debian distributions: + + sudo apt-get install swig python-dev + +The library provides an Fdt class which you can use like this: + +$ PYTHONPATH=../pylibfdt python +>>> import libfdt +>>> fdt = libfdt.Fdt(open('test_tree1.dtb').read()) +>>> node = fdt.path_offset('/subnode@1') +>>> print node +124 +>>> prop_offset = fdt.first_property_offset(node) +>>> prop = fdt.get_property_by_offset(prop_offset) +>>> print '%s=%r' % (prop.name, prop.value) +compatible=bytearray(b'subnode1\x00') +>>> print '%s=%s' % (prop.name, prop.value) +compatible=subnode1 +>>> node2 = fdt.path_offset('/') +>>> print fdt.getprop(node2, 'compatible') +test_tree1 + +You will find tests in tests/pylibfdt_tests.py showing how to use each +method. Help is available using the Python help command, e.g.: + + $ cd pylibfdt + $ python -c "import libfdt; help(libfdt)" + +If you add new features, please check code coverage: + + $ sudo apt-get install python-pip python-pytest + $ sudo pip install coverage + $ cd tests + $ coverage run pylibfdt_tests.py + $ coverage html + # Open 'htmlcov/index.html' in your browser + + +To install the library via the normal setup.py method, use: + + ./pylibfdt/setup.py [--prefix=/path/to/install_dir] + +If --prefix is not provided, the default prefix is used, typically '/usr' +or '/usr/local'. See Python's distutils documentation for details. You can +also install via the Makefile if you like, but the above is more common. + +To install both libfdt and pylibfdt you can use: + + make install [SETUP_PREFIX=/path/to/install_dir] \ + [PREFIX=/path/to/install_dir] + +To disable building the python library, even if swig and Python are available, +use: + + make NO_PYTHON=1 + + +More work remains to support all of libfdt, including access to numeric +values. + + +Tests +----- + +Test files are kept in the tests/ directory. Use 'make check' to build and run +all tests. + +If you want to adjust a test file, be aware that tree_tree1.dts is compiled +and checked against a binary tree from assembler macros in trees.S. So +if you change that file you must change tree.S also. + + Mailing list ------------ The following list is for discussion about dtc and libfdt implementation Modified: vendor/dtc/dist/checks.c ============================================================================== --- vendor/dtc/dist/checks.c Fri Jan 12 20:40:27 2018 (r327892) +++ vendor/dtc/dist/checks.c Fri Jan 12 21:44:53 2018 (r327893) @@ -53,31 +53,27 @@ struct check { struct check **prereq; }; -#define CHECK_ENTRY(_nm, _fn, _d, _w, _e, ...) \ - static struct check *_nm##_prereqs[] = { __VA_ARGS__ }; \ - static struct check _nm = { \ - .name = #_nm, \ - .fn = (_fn), \ - .data = (_d), \ - .warn = (_w), \ - .error = (_e), \ +#define CHECK_ENTRY(nm_, fn_, d_, w_, e_, ...) \ + static struct check *nm_##_prereqs[] = { __VA_ARGS__ }; \ + static struct check nm_ = { \ + .name = #nm_, \ + .fn = (fn_), \ + .data = (d_), \ + .warn = (w_), \ + .error = (e_), \ .status = UNCHECKED, \ - .num_prereqs = ARRAY_SIZE(_nm##_prereqs), \ - .prereq = _nm##_prereqs, \ + .num_prereqs = ARRAY_SIZE(nm_##_prereqs), \ + .prereq = nm_##_prereqs, \ }; -#define WARNING(_nm, _fn, _d, ...) \ - CHECK_ENTRY(_nm, _fn, _d, true, false, __VA_ARGS__) -#define ERROR(_nm, _fn, _d, ...) \ - CHECK_ENTRY(_nm, _fn, _d, false, true, __VA_ARGS__) -#define CHECK(_nm, _fn, _d, ...) \ - CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__) +#define WARNING(nm_, fn_, d_, ...) \ + CHECK_ENTRY(nm_, fn_, d_, true, false, __VA_ARGS__) +#define ERROR(nm_, fn_, d_, ...) \ + CHECK_ENTRY(nm_, fn_, d_, false, true, __VA_ARGS__) +#define CHECK(nm_, fn_, d_, ...) \ + CHECK_ENTRY(nm_, fn_, d_, false, false, __VA_ARGS__) -#ifdef __GNUC__ -static inline void check_msg(struct check *c, struct dt_info *dti, - const char *fmt, ...) __attribute__((format (printf, 3, 4))); -#endif -static inline void check_msg(struct check *c, struct dt_info *dti, - const char *fmt, ...) +static inline void PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -183,6 +179,36 @@ static void check_is_string(struct check *c, struct dt #define ERROR_IF_NOT_STRING(nm, propname) \ ERROR(nm, check_is_string, (propname)) +static void check_is_string_list(struct check *c, struct dt_info *dti, + struct node *node) +{ + int rem, l; + struct property *prop; + char *propname = c->data; + char *str; + + prop = get_property(node, propname); + if (!prop) + return; /* Not present, assumed ok */ + + str = prop->val.val; + rem = prop->val.len; + while (rem > 0) { + l = strnlen(str, rem); + if (l == rem) { + FAIL(c, dti, "\"%s\" property in %s is not a string list", + propname, node->fullpath); + break; + } + rem -= l + 1; + str += l + 1; + } +} +#define WARNING_IF_NOT_STRING_LIST(nm, propname) \ + WARNING(nm, check_is_string_list, (propname)) +#define ERROR_IF_NOT_STRING_LIST(nm, propname) \ + ERROR(nm, check_is_string_list, (propname)) + static void check_is_cell(struct check *c, struct dt_info *dti, struct node *node) { @@ -538,13 +564,13 @@ static void fixup_phandle_references(struct check *c, FAIL(c, dti, "Reference to non-existent node or " "label \"%s\"\n", m->ref); else /* mark the entry as unresolved */ - *((cell_t *)(prop->val.val + m->offset)) = + *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(0xffffffff); continue; } phandle = get_node_phandle(dt, refnode); - *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); + *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); } } } @@ -590,7 +616,48 @@ WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interru WARNING_IF_NOT_STRING(device_type_is_string, "device_type"); WARNING_IF_NOT_STRING(model_is_string, "model"); WARNING_IF_NOT_STRING(status_is_string, "status"); +WARNING_IF_NOT_STRING(label_is_string, "label"); +WARNING_IF_NOT_STRING_LIST(compatible_is_string_list, "compatible"); + +static void check_names_is_string_list(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + for_each_property(node, prop) { + const char *s = strrchr(prop->name, '-'); + if (!s || !streq(s, "-names")) + continue; + + c->data = prop->name; + check_is_string_list(c, dti, node); + } +} +WARNING(names_is_string_list, check_names_is_string_list, NULL); + +static void check_alias_paths(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + if (!streq(node->name, "aliases")) + return; + + for_each_property(node, prop) { + if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { + FAIL(c, dti, "aliases property '%s' is not a valid node (%s)", + prop->name, prop->val.val); + continue; + } + if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) + FAIL(c, dti, "aliases property name '%s' is not valid", + prop->name); + + } +} +WARNING(alias_paths, check_alias_paths, NULL); + static void fixup_addr_size_cells(struct check *c, struct dt_info *dti, struct node *node) { @@ -685,6 +752,229 @@ static void check_ranges_format(struct check *c, struc } WARNING(ranges_format, check_ranges_format, NULL, &addr_size_cells); +static const struct bus_type pci_bus = { + .name = "PCI", +}; + +static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node) +{ + struct property *prop; + cell_t *cells; + + prop = get_property(node, "device_type"); + if (!prop || !streq(prop->val.val, "pci")) + return; + + node->bus = &pci_bus; + + if (!strprefixeq(node->name, node->basenamelen, "pci") && + !strprefixeq(node->name, node->basenamelen, "pcie")) + FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"", + node->fullpath); + + prop = get_property(node, "ranges"); + if (!prop) + FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a bridge)", + node->fullpath); + + if (node_addr_cells(node) != 3) + FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge", + node->fullpath); + if (node_size_cells(node) != 2) + FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge", + node->fullpath); + + prop = get_property(node, "bus-range"); + if (!prop) { + FAIL(c, dti, "Node %s missing bus-range for PCI bridge", + node->fullpath); + return; + } + if (prop->val.len != (sizeof(cell_t) * 2)) { + FAIL(c, dti, "Node %s bus-range must be 2 cells", + node->fullpath); + return; + } + cells = (cell_t *)prop->val.val; + if (fdt32_to_cpu(cells[0]) > fdt32_to_cpu(cells[1])) + FAIL(c, dti, "Node %s bus-range 1st cell must be less than or equal to 2nd cell", + node->fullpath); + if (fdt32_to_cpu(cells[1]) > 0xff) + FAIL(c, dti, "Node %s bus-range maximum bus number must be less than 256", + node->fullpath); +} +WARNING(pci_bridge, check_pci_bridge, NULL, + &device_type_is_string, &addr_size_cells); + +static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node) +{ + struct property *prop; + unsigned int bus_num, min_bus, max_bus; + cell_t *cells; + + if (!node->parent || (node->parent->bus != &pci_bus)) + return; + + prop = get_property(node, "reg"); + if (!prop) + return; + + cells = (cell_t *)prop->val.val; + bus_num = (fdt32_to_cpu(cells[0]) & 0x00ff0000) >> 16; + + prop = get_property(node->parent, "bus-range"); + if (!prop) { + min_bus = max_bus = 0; + } else { + cells = (cell_t *)prop->val.val; + min_bus = fdt32_to_cpu(cells[0]); + max_bus = fdt32_to_cpu(cells[0]); + } + if ((bus_num < min_bus) || (bus_num > max_bus)) + FAIL(c, dti, "Node %s PCI bus number %d out of range, expected (%d - %d)", + node->fullpath, bus_num, min_bus, max_bus); +} +WARNING(pci_device_bus_num, check_pci_device_bus_num, NULL, ®_format, &pci_bridge); + +static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node) +{ + struct property *prop; + const char *unitname = get_unitname(node); + char unit_addr[5]; + unsigned int dev, func, reg; + cell_t *cells; + + if (!node->parent || (node->parent->bus != &pci_bus)) + return; + + prop = get_property(node, "reg"); + if (!prop) { + FAIL(c, dti, "Node %s missing PCI reg property", node->fullpath); + return; + } + + cells = (cell_t *)prop->val.val; + if (cells[1] || cells[2]) + FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 3 must be 0", + node->fullpath); + + reg = fdt32_to_cpu(cells[0]); + dev = (reg & 0xf800) >> 11; + func = (reg & 0x700) >> 8; + + if (reg & 0xff000000) + FAIL(c, dti, "Node %s PCI reg address is not configuration space", + node->fullpath); + if (reg & 0x000000ff) + FAIL(c, dti, "Node %s PCI reg config space address register number must be 0", + node->fullpath); + + if (func == 0) { + snprintf(unit_addr, sizeof(unit_addr), "%x", dev); + if (streq(unitname, unit_addr)) + return; + } + + snprintf(unit_addr, sizeof(unit_addr), "%x,%x", dev, func); + if (streq(unitname, unit_addr)) + return; + + FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"", + node->fullpath, unit_addr); +} +WARNING(pci_device_reg, check_pci_device_reg, NULL, ®_format, &pci_bridge); + +static const struct bus_type simple_bus = { + .name = "simple-bus", +}; + +static bool node_is_compatible(struct node *node, const char *compat) +{ + struct property *prop; + const char *str, *end; + + prop = get_property(node, "compatible"); + if (!prop) + return false; + + for (str = prop->val.val, end = str + prop->val.len; str < end; + str += strnlen(str, end - str) + 1) { + if (strprefixeq(str, end - str, compat)) + return true; + } + return false; +} + +static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) +{ + if (node_is_compatible(node, "simple-bus")) + node->bus = &simple_bus; +} +WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells); + +static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) +{ + struct property *prop; + const char *unitname = get_unitname(node); + char unit_addr[17]; + unsigned int size; + uint64_t reg = 0; + cell_t *cells = NULL; + + if (!node->parent || (node->parent->bus != &simple_bus)) + return; + + prop = get_property(node, "reg"); + if (prop) + cells = (cell_t *)prop->val.val; + else { + prop = get_property(node, "ranges"); + if (prop && prop->val.len) + /* skip of child address */ + cells = ((cell_t *)prop->val.val) + node_addr_cells(node); + } + + if (!cells) { + if (node->parent->parent && !(node->bus == &simple_bus)) + FAIL(c, dti, "Node %s missing or empty reg/ranges property", node->fullpath); + return; + } + + size = node_addr_cells(node->parent); + while (size--) + reg = (reg << 32) | fdt32_to_cpu(*(cells++)); + + snprintf(unit_addr, sizeof(unit_addr), "%"PRIx64, reg); + if (!streq(unitname, unit_addr)) + FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"", + node->fullpath, unit_addr); +} +WARNING(simple_bus_reg, check_simple_bus_reg, NULL, ®_format, &simple_bus_bridge); + +static void check_unit_address_format(struct check *c, struct dt_info *dti, + struct node *node) +{ + const char *unitname = get_unitname(node); + + if (node->parent && node->parent->bus) + return; + + if (!unitname[0]) + return; + + if (!strncmp(unitname, "0x", 2)) { + FAIL(c, dti, "Node %s unit name should not have leading \"0x\"", + node->fullpath); + /* skip over 0x for next test */ + unitname += 2; + } + if (unitname[0] == '0' && isxdigit(unitname[1])) + FAIL(c, dti, "Node %s unit name should not have leading 0s", + node->fullpath); +} +WARNING(unit_address_format, check_unit_address_format, NULL, + &node_name_format, &pci_bridge, &simple_bus_bridge); + /* * Style checks */ @@ -713,6 +1003,31 @@ static void check_avoid_default_addr_size(struct check WARNING(avoid_default_addr_size, check_avoid_default_addr_size, NULL, &addr_size_cells); +static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct property *prop; + struct node *child; + bool has_reg = false; + + if (!node->parent || node->addr_cells < 0 || node->size_cells < 0) + return; + + if (get_property(node, "ranges") || !node->children) + return; + + for_each_child(node, child) { + prop = get_property(child, "reg"); + if (prop) + has_reg = true; + } + + if (!has_reg) + FAIL(c, dti, "unnecessary #address-cells/#size-cells without \"ranges\" or child \"reg\" property in %s", + node->fullpath); +} +WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size); + static void check_obsolete_chosen_interrupt_controller(struct check *c, struct dt_info *dti, struct node *node) @@ -737,6 +1052,324 @@ static void check_obsolete_chosen_interrupt_controller WARNING(obsolete_chosen_interrupt_controller, check_obsolete_chosen_interrupt_controller, NULL); +static void check_chosen_node_is_root(struct check *c, struct dt_info *dti, + struct node *node) +{ + if (!streq(node->name, "chosen")) + return; + + if (node->parent != dti->dt) + FAIL(c, dti, "chosen node '%s' must be at root node", + node->fullpath); +} +WARNING(chosen_node_is_root, check_chosen_node_is_root, NULL); + +static void check_chosen_node_bootargs(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + if (!streq(node->name, "chosen")) + return; + + prop = get_property(node, "bootargs"); + if (!prop) + return; + + c->data = prop->name; + check_is_string(c, dti, node); +} +WARNING(chosen_node_bootargs, check_chosen_node_bootargs, NULL); + +static void check_chosen_node_stdout_path(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + if (!streq(node->name, "chosen")) + return; + + prop = get_property(node, "stdout-path"); + if (!prop) { + prop = get_property(node, "linux,stdout-path"); + if (!prop) + return; + FAIL(c, dti, "Use 'stdout-path' instead of 'linux,stdout-path'"); + } + + c->data = prop->name; + check_is_string(c, dti, node); +} +WARNING(chosen_node_stdout_path, check_chosen_node_stdout_path, NULL); + +struct provider { + const char *prop_name; + const char *cell_name; + bool optional; +}; + +static void check_property_phandle_args(struct check *c, + struct dt_info *dti, + struct node *node, + struct property *prop, + const struct provider *provider) +{ + struct node *root = dti->dt; + int cell, cellsize = 0; + + if (prop->val.len % sizeof(cell_t)) { + FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", + prop->name, prop->val.len, sizeof(cell_t), node->fullpath); + return; + } + + for (cell = 0; cell < prop->val.len / sizeof(cell_t); cell += cellsize + 1) { + struct node *provider_node; + struct property *cellprop; + int phandle; + + phandle = propval_cell_n(prop, cell); + /* + * Some bindings use a cell value 0 or -1 to skip over optional + * entries when each index position has a specific definition. + */ + if (phandle == 0 || phandle == -1) { + /* Give up if this is an overlay with external references */ + if (dti->dtsflags & DTSF_PLUGIN) + break; + + cellsize = 0; + continue; + } + + /* If we have markers, verify the current cell is a phandle */ + if (prop->val.markers) { + struct marker *m = prop->val.markers; + for_each_marker_of_type(m, REF_PHANDLE) { + if (m->offset == (cell * sizeof(cell_t))) + break; + } + if (!m) + FAIL(c, dti, "Property '%s', cell %d is not a phandle reference in %s", + prop->name, cell, node->fullpath); + } + + provider_node = get_node_by_phandle(root, phandle); + if (!provider_node) { + FAIL(c, dti, "Could not get phandle node for %s:%s(cell %d)", + node->fullpath, prop->name, cell); + break; + } + + cellprop = get_property(provider_node, provider->cell_name); + if (cellprop) { + cellsize = propval_cell(cellprop); + } else if (provider->optional) { + cellsize = 0; + } else { + FAIL(c, dti, "Missing property '%s' in node %s or bad phandle (referred from %s:%s[%d])", + provider->cell_name, + provider_node->fullpath, + node->fullpath, prop->name, cell); + break; + } + + if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) { + FAIL(c, dti, "%s property size (%d) too small for cell size %d in %s", + prop->name, prop->val.len, cellsize, node->fullpath); + } + } +} + +static void check_provider_cells_property(struct check *c, + struct dt_info *dti, + struct node *node) +{ + struct provider *provider = c->data; + struct property *prop; + + prop = get_property(node, provider->prop_name); + if (!prop) + return; + + check_property_phandle_args(c, dti, node, prop, provider); +} +#define WARNING_PROPERTY_PHANDLE_CELLS(nm, propname, cells_name, ...) \ + static struct provider nm##_provider = { (propname), (cells_name), __VA_ARGS__ }; \ + WARNING(nm##_property, check_provider_cells_property, &nm##_provider, &phandle_references); + +WARNING_PROPERTY_PHANDLE_CELLS(clocks, "clocks", "#clock-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(cooling_device, "cooling-device", "#cooling-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(dmas, "dmas", "#dma-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(hwlocks, "hwlocks", "#hwlock-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(interrupts_extended, "interrupts-extended", "#interrupt-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(io_channels, "io-channels", "#io-channel-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(iommus, "iommus", "#iommu-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(mboxes, "mboxes", "#mbox-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(msi_parent, "msi-parent", "#msi-cells", true); +WARNING_PROPERTY_PHANDLE_CELLS(mux_controls, "mux-controls", "#mux-control-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(sound_dai, "sound-dai", "#sound-dai-cells"); +WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells"); + +static bool prop_is_gpio(struct property *prop) +{ + char *str; + + /* + * *-gpios and *-gpio can appear in property names, + * so skip over any false matches (only one known ATM) + */ + if (strstr(prop->name, "nr-gpio")) + return false; + + str = strrchr(prop->name, '-'); + if (str) + str++; + else + str = prop->name; + if (!(streq(str, "gpios") || streq(str, "gpio"))) + return false; + + return true; +} + +static void check_gpios_property(struct check *c, + struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + /* Skip GPIO hog nodes which have 'gpios' property */ + if (get_property(node, "gpio-hog")) + return; + + for_each_property(node, prop) { + struct provider provider; + + if (!prop_is_gpio(prop)) + continue; + + provider.prop_name = prop->name; + provider.cell_name = "#gpio-cells"; + provider.optional = false; + check_property_phandle_args(c, dti, node, prop, &provider); + } + +} +WARNING(gpios_property, check_gpios_property, NULL, &phandle_references); + +static void check_deprecated_gpio_property(struct check *c, + struct dt_info *dti, + struct node *node) +{ + struct property *prop; + + for_each_property(node, prop) { + char *str; + + if (!prop_is_gpio(prop)) + continue; + + str = strstr(prop->name, "gpio"); + if (!streq(str, "gpio")) + continue; + + FAIL(c, dti, "'[*-]gpio' is deprecated, use '[*-]gpios' instead for %s:%s", + node->fullpath, prop->name); + } + +} +CHECK(deprecated_gpio_property, check_deprecated_gpio_property, NULL); + +static bool node_is_interrupt_provider(struct node *node) +{ + struct property *prop; + + prop = get_property(node, "interrupt-controller"); + if (prop) + return true; + + prop = get_property(node, "interrupt-map"); + if (prop) + return true; + + return false; +} +static void check_interrupts_property(struct check *c, + struct dt_info *dti, + struct node *node) +{ + struct node *root = dti->dt; + struct node *irq_node = NULL, *parent = node; + struct property *irq_prop, *prop = NULL; + int irq_cells, phandle; + + irq_prop = get_property(node, "interrupts"); + if (!irq_prop) + return; + + if (irq_prop->val.len % sizeof(cell_t)) + FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s", + irq_prop->name, irq_prop->val.len, sizeof(cell_t), + node->fullpath); + + while (parent && !prop) { + if (parent != node && node_is_interrupt_provider(parent)) { + irq_node = parent; + break; + } + + prop = get_property(parent, "interrupt-parent"); + if (prop) { + phandle = propval_cell(prop); + /* Give up if this is an overlay with external references */ + if ((phandle == 0 || phandle == -1) && + (dti->dtsflags & DTSF_PLUGIN)) + return; + + irq_node = get_node_by_phandle(root, phandle); + if (!irq_node) { + FAIL(c, dti, "Bad interrupt-parent phandle for %s", + node->fullpath); + return; + } + if (!node_is_interrupt_provider(irq_node)) + FAIL(c, dti, + "Missing interrupt-controller or interrupt-map property in %s", + irq_node->fullpath); + + break; + } + + parent = parent->parent; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 12 21:50:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89437E7E5B5; Fri, 12 Jan 2018 21:50:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64A8681EE6; Fri, 12 Jan 2018 21:50:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73DAE15FE; Fri, 12 Jan 2018 21:50:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CLoIul057831; Fri, 12 Jan 2018 21:50:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CLoIEi057830; Fri, 12 Jan 2018 21:50:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801122150.w0CLoIEi057830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 12 Jan 2018 21:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r327894 - vendor/dtc/1.4.6 X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/dtc/1.4.6 X-SVN-Commit-Revision: 327894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 21:50:19 -0000 Author: kevans Date: Fri Jan 12 21:50:18 2018 New Revision: 327894 URL: https://svnweb.freebsd.org/changeset/base/327894 Log: Tag dtc 1.4.6 following import Added: vendor/dtc/1.4.6/ - copied from r327893, vendor/dtc/dist/ From owner-svn-src-all@freebsd.org Fri Jan 12 22:37:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EA2EA574B; Fri, 12 Jan 2018 22:37:53 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A46F869; Fri, 12 Jan 2018 22:37:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x242.google.com with SMTP id 33so7891937qtv.1; Fri, 12 Jan 2018 14:37:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DjA8GBp4njcy1z8P7u2bG1ED9lGHxlwcQu6ruT6nfOM=; b=hIMzHogeoSNM9ao014JGQekFYNTvKu1P/ILP8Qvvwt0JHLbjvK/iMYIXeAxp7BAry5 1qi8r45TshrvnthnCg4EHh8/Qa1DZaSR9D35K0W2SYdqKZmTEmYx7aerp3jUYNhSxPmf FUI1SWzLoqZMsr6zAOf3aDoMAMZVfsFaJniKCD5ykGL7y8bmPnLqyFNuYVlq+rao+rsK zFwW/3rRQAYFKMNOuXL/0iXvJCcvkYGLZfNKB7muAQmq7SR33mRMc5mMeaxXwSREcOoz XKJfICXVvIWPCjaKr5hrTqhikRfLhbsCCT9khTXAMB2zfbFlSOSXYZRhgCtvaWKshF6T VLWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DjA8GBp4njcy1z8P7u2bG1ED9lGHxlwcQu6ruT6nfOM=; b=LeQgix/CInddFdjQ5jFb50fGJwJrIxZGzi6D4cppTMDodrj3mVutKKHlD95Clgkm6y aVHqDRuIC0R6shGghZgPnNL5z8PxkJE2dZSwEYitkjc/oFJH0G1cM2oZt9B5FuRHsPFg MaVAqponafPU41KQDP16KbCVOdwuyMuXknkG9u2Gcbb6zxBS1RibnXK1kfBPSAf5LOKv sBHzlRpfrluVaqJqGmZbNXgvF5tFwxeaKwaI4KSxBSoVCRsv26fe0oIOpeGdGBNQGikT l2RnKPWvNNVObHl7tw+z0OYMfD2xdYGfxevsUnCXRgzybVBaCeOjkMPxw2BKnHnQeHCZ h8XQ== X-Gm-Message-State: AKwxytdpgONupC/acNAJHYpHq74zUUbo0uXWHA3SNZhgNCf/PU96F1dB mL5ZaomCSdlS3bfeUosOvde/As4LTqDtUDs+v7o= X-Google-Smtp-Source: ACJfBovGIjmMLBiO/FGLObNxf1cOrOBnnzYxMVii9iKgwY0j0dkHrrfQmsJbE8Q4qU0ylivy9cgumUOJulO1EDLHvz8= X-Received: by 10.200.43.13 with SMTP id 13mr39890438qtu.341.1515796671628; Fri, 12 Jan 2018 14:37:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.44.214 with HTTP; Fri, 12 Jan 2018 14:37:51 -0800 (PST) In-Reply-To: <201801121959.w0CJxlaw010074@repo.freebsd.org> References: <201801121959.w0CJxlaw010074@repo.freebsd.org> From: Mateusz Guzik Date: Fri, 12 Jan 2018 23:37:51 +0100 Message-ID: Subject: Re: svn commit: r327888 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety sys/cddl/contrib/ope... To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 22:37:53 -0000 On Fri, Jan 12, 2018 at 8:59 PM, Mark Johnston wrote: > Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > ============================================================ > ================== > --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > Fri Jan 12 18:44:28 2018 (r327887) > +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > Fri Jan 12 19:59:46 2018 (r327888) > @@ -3654,6 +3654,24 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, > dtrace_st > return (dtrace_dif_varstr( > (uintptr_t)curthread->t_procp->p_zone->zone_name, > state, mstate)); > +#elif defined(__FreeBSD__) > + /* > + * On FreeBSD, we introduce compatibility to zonename by falling > through > + * into jailname. > + */ > + case DIF_VAR_JAILNAME: > + if (!dtrace_priv_kernel(state)) > + return (0); > + > + return (dtrace_dif_varstr( > + (uintptr_t)curthread->t_procp- > >p_ucred->cr_prison->pr_name, > + state, mstate)); > + > Why t_procp? curthread->td_proc creds are what is used for permission checking and it rarely temporarily goes out of sync with proc's creds. However, if someone changes creds while this tracing is enabled this extra dereference risks accessing a freed object. On the other hand curthread creads are always safe to read. > + case DIF_VAR_JID: > + if (!dtrace_priv_kernel(state)) > + return (0); > + > + return ((uint64_t)curthread->t_procp- > >p_ucred->cr_prison->pr_id); > #else > return (0); > #endif > From owner-svn-src-all@freebsd.org Fri Jan 12 22:48:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8552EA60A2; Fri, 12 Jan 2018 22:48:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9F099B; Fri, 12 Jan 2018 22:48:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93FA200B; Fri, 12 Jan 2018 22:48:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CMmOi2082710; Fri, 12 Jan 2018 22:48:24 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CMmNdF082700; Fri, 12 Jan 2018 22:48:23 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122248.w0CMmNdF082700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 22:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327895 - in head: lib/libc/sys sys/arm/arm sys/compat/freebsd32 sys/conf sys/ddb sys/kern sys/netpfil/ipfw sys/sys sys/vm sys/x86/acpica usr.bin/cpuset usr.bin/numactl X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head: lib/libc/sys sys/arm/arm sys/compat/freebsd32 sys/conf sys/ddb sys/kern sys/netpfil/ipfw sys/sys sys/vm sys/x86/acpica usr.bin/cpuset usr.bin/numactl X-SVN-Commit-Revision: 327895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 22:48:25 -0000 Author: jeff Date: Fri Jan 12 22:48:23 2018 New Revision: 327895 URL: https://svnweb.freebsd.org/changeset/base/327895 Log: Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically. Implement domainset based iterators in the page layer. Remove the now legacy numa_* syscalls. Cleanup some header polution created by having seq.h in proc.h. Reviewed by: markj, kib Discussed with: alc Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D13403 Deleted: head/sys/kern/kern_numa.c head/sys/sys/_vm_domain.h head/sys/vm/vm_domain.c head/sys/vm/vm_domain.h Modified: head/lib/libc/sys/Symbol.map head/sys/arm/arm/machdep_ptrace.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/conf/files head/sys/ddb/db_run.c head/sys/kern/init_main.c head/sys/kern/init_sysent.c head/sys/kern/kern_cpuset.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/makesyscalls.sh head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_kdb.c head/sys/kern/syscalls.master head/sys/netpfil/ipfw/dn_sched_fq_codel.c head/sys/sys/cpuset.h head/sys/sys/proc.h head/sys/sys/syscallsubr.h head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/x86/acpica/srat.c head/usr.bin/cpuset/cpuset.c head/usr.bin/numactl/numactl.c Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Fri Jan 12 21:50:18 2018 (r327894) +++ head/lib/libc/sys/Symbol.map Fri Jan 12 22:48:23 2018 (r327895) @@ -398,6 +398,8 @@ FBSD_1.5 { mknodat; stat; statfs; + cpuset_getdomain; + cpuset_setdomain; }; FBSDprivate_1.0 { @@ -1022,4 +1024,8 @@ FBSDprivate_1.0 { gssd_syscall; __libc_interposing_slot; __libc_sigwait; + _cpuset_getdomain; + __sys_cpuset_getdomain; + _cpuset_setdomain; + __sys_cpuset_setdomain; }; Modified: head/sys/arm/arm/machdep_ptrace.c ============================================================================== --- head/sys/arm/arm/machdep_ptrace.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/arm/arm/machdep_ptrace.c Fri Jan 12 22:48:23 2018 (r327895) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri Jan 12 22:48:23 2018 (r327895) @@ -3017,6 +3017,24 @@ freebsd32_cpuset_setaffinity(struct thread *td, } int +freebsd32_cpuset_getdomain(struct thread *td, + struct freebsd32_cpuset_getdomain_args *uap) +{ + + return (kern_cpuset_getdomain(td, uap->level, uap->which, + PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy)); +} + +int +freebsd32_cpuset_setdomain(struct thread *td, + struct freebsd32_cpuset_setdomain_args *uap) +{ + + return (kern_cpuset_setdomain(td, uap->level, uap->which, + PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy)); +} + +int freebsd32_nmount(struct thread *td, struct freebsd32_nmount_args /* { struct iovec *iovp; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/compat/freebsd32/syscalls.master Fri Jan 12 22:48:23 2018 (r327895) @@ -1086,12 +1086,8 @@ 547 AUE_FUTIMESAT STD { int freebsd32_utimensat(int fd, \ char *path, \ struct timespec *times, int flag); } -548 AUE_NULL NOPROTO { int numa_getaffinity(cpuwhich_t which, \ - id_t id, \ - struct vm_domain_policy *policy); } -549 AUE_NULL NOPROTO { int numa_setaffinity(cpuwhich_t which, \ - id_t id, \ - const struct vm_domain_policy *policy); } +548 AUE_NULL UNIMPL numa_getaffinity +549 AUE_NULL UNIMPL numa_setaffinity 550 AUE_FSYNC NOPROTO { int fdatasync(int fd); } 551 AUE_FSTAT STD { int freebsd32_fstat(int fd, \ struct stat32 *ub); } @@ -1119,4 +1115,13 @@ struct kevent32 *eventlist, \ int nevents, \ const struct timespec32 *timeout); } +561 AUE_NULL STD { int freebsd32_cpuset_getdomain(cpulevel_t level, \ + cpuwhich_t which, uint32_t id1, uint32_t id2, \ + size_t domainsetsize, domainset_t *mask, \ + int *policy); } +562 AUE_NULL STD { int freebsd32_cpuset_setdomain(cpulevel_t level, \ + cpuwhich_t which, uint32_t id1, uint32_t id2, \ + size_t domainsetsize, domainset_t *mask, \ + int policy); } + ; vim: syntax=off Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/conf/files Fri Jan 12 22:48:23 2018 (r327895) @@ -3787,7 +3787,6 @@ kern/kern_module.c standard kern/kern_mtxpool.c standard kern/kern_mutex.c standard kern/kern_ntptime.c standard -kern/kern_numa.c standard kern/kern_osd.c standard kern/kern_physio.c standard kern/kern_pmc.c standard @@ -4837,7 +4836,7 @@ vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard vm/memguard.c optional DEBUG_MEMGUARD -vm/vm_domain.c standard +vm/vm_domainset.c standard vm/vm_fault.c standard vm/vm_glue.c standard vm/vm_init.c standard Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/ddb/db_run.c Fri Jan 12 22:48:23 2018 (r327895) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/kern/init_main.c Fri Jan 12 22:48:23 2018 (r327895) @@ -89,7 +89,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -497,10 +496,7 @@ proc0_init(void *dummy __unused) td->td_flags = TDF_INMEM; td->td_pflags = TDP_KTHREAD; td->td_cpuset = cpuset_thread0(); - vm_domain_policy_init(&td->td_vm_dom_policy); - vm_domain_policy_set(&td->td_vm_dom_policy, VM_POLICY_NONE, -1); - vm_domain_policy_init(&p->p_vm_dom_policy); - vm_domain_policy_set(&p->p_vm_dom_policy, VM_POLICY_NONE, -1); + td->td_domain.dr_policy = td->td_cpuset->cs_domain; prison0_init(); p->p_peers = 0; p->p_leader = p; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/kern/init_sysent.c Fri Jan 12 22:48:23 2018 (r327895) @@ -599,8 +599,8 @@ struct sysent sysent[] = { { AS(ppoll_args), (sy_call_t *)sys_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = ppoll */ { AS(futimens_args), (sy_call_t *)sys_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = futimens */ { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ - { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ - { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 548 = numa_getaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 549 = numa_setaffinity */ { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ { AS(fstat_args), (sy_call_t *)sys_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = fstat */ { AS(fstatat_args), (sy_call_t *)sys_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = fstatat */ @@ -612,4 +612,6 @@ struct sysent sysent[] = { { AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 558 = fhstatfs */ { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = mknodat */ { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = kevent */ + { AS(cpuset_getdomain_args), (sy_call_t *)sys_cpuset_getdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 561 = cpuset_getdomain */ + { AS(cpuset_setdomain_args), (sy_call_t *)sys_cpuset_setdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 562 = cpuset_setdomain */ }; Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Fri Jan 12 21:50:18 2018 (r327894) +++ head/sys/kern/kern_cpuset.c Fri Jan 12 22:48:23 2018 (r327895) @@ -51,17 +51,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include +#include #include #include +#include #include #include +#include #ifdef DDB #include @@ -109,8 +113,10 @@ __FBSDID("$FreeBSD$"); * getaffinity call using (CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, ...). */ static uma_zone_t cpuset_zone; +static uma_zone_t domainset_zone; static struct mtx cpuset_lock; static struct setlist cpuset_ids; +static struct domainlist cpuset_domains; static struct unrhdr *cpuset_unr; static struct cpuset *cpuset_zero, *cpuset_default; @@ -121,7 +127,33 @@ SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_ cpuset_t *cpuset_root; cpuset_t cpuset_domain[MAXMEMDOM]; +static int domainset_valid(const struct domainset *, const struct domainset *); + /* + * Find the first non-anonymous set starting from 'set'. + */ +static struct cpuset * +cpuset_getbase(struct cpuset *set) +{ + + if (set->cs_id == CPUSET_INVALID) + set = set->cs_parent; + return (set); +} + +/* + * Walks up the tree from 'set' to find the root. + */ +static struct cpuset * +cpuset_getroot(struct cpuset *set) +{ + + while ((set->cs_flags & CPU_SET_ROOT) == 0 && set->cs_parent != NULL) + set = set->cs_parent; + return (set); +} + +/* * Acquire a reference to a cpuset, all pointers must be tracked with refs. */ struct cpuset * @@ -140,12 +172,7 @@ static struct cpuset * cpuset_refroot(struct cpuset *set) { - for (; set->cs_parent != NULL; set = set->cs_parent) - if (set->cs_flags & CPU_SET_ROOT) - break; - cpuset_ref(set); - - return (set); + return (cpuset_ref(cpuset_getroot(set))); } /* @@ -157,11 +184,7 @@ static struct cpuset * cpuset_refbase(struct cpuset *set) { - if (set->cs_id == CPUSET_INVALID) - set = set->cs_parent; - cpuset_ref(set); - - return (set); + return (cpuset_ref(cpuset_getbase(set))); } /* @@ -257,17 +280,25 @@ cpuset_lookup(cpusetid_t setid, struct thread *td) * will have no valid cpu based on restrictions from the parent. */ static int -_cpuset_create(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask, - cpusetid_t id) +_cpuset_create(struct cpuset *set, struct cpuset *parent, + const cpuset_t *mask, struct domainset *domain, cpusetid_t id) { + if (domain == NULL) + domain = parent->cs_domain; + if (mask == NULL) + mask = &parent->cs_mask; if (!CPU_OVERLAP(&parent->cs_mask, mask)) return (EDEADLK); + /* The domain must be prepared ahead of time. */ + if (!domainset_valid(parent->cs_domain, domain)) + return (EDEADLK); CPU_COPY(mask, &set->cs_mask); LIST_INIT(&set->cs_children); refcount_init(&set->cs_ref, 1); set->cs_flags = 0; mtx_lock_spin(&cpuset_lock); + set->cs_domain = domain; CPU_AND(&set->cs_mask, &parent->cs_mask); set->cs_id = id; set->cs_parent = cpuset_ref(parent); @@ -294,8 +325,8 @@ cpuset_create(struct cpuset **setp, struct cpuset *par id = alloc_unr(cpuset_unr); if (id == -1) return (ENFILE); - *setp = set = uma_zalloc(cpuset_zone, M_WAITOK); - error = _cpuset_create(set, parent, mask, id); + *setp = set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); + error = _cpuset_create(set, parent, mask, NULL, id); if (error == 0) return (0); free_unr(cpuset_unr, id); @@ -304,7 +335,207 @@ cpuset_create(struct cpuset **setp, struct cpuset *par return (error); } +static void +cpuset_freelist_add(struct setlist *list, int count) +{ + struct cpuset *set; + int i; + + for (i = 0; i < count; i++) { + set = uma_zalloc(cpuset_zone, M_ZERO | M_WAITOK); + LIST_INSERT_HEAD(list, set, cs_link); + } +} + +static void +cpuset_freelist_init(struct setlist *list, int count) +{ + + LIST_INIT(list); + cpuset_freelist_add(list, count); +} + +static void +cpuset_freelist_free(struct setlist *list) +{ + struct cpuset *set; + + while ((set = LIST_FIRST(list)) != NULL) { + LIST_REMOVE(set, cs_link); + uma_zfree(cpuset_zone, set); + } +} + +static void +domainset_freelist_add(struct domainlist *list, int count) +{ + struct domainset *set; + int i; + + for (i = 0; i < count; i++) { + set = uma_zalloc(domainset_zone, M_ZERO | M_WAITOK); + LIST_INSERT_HEAD(list, set, ds_link); + } +} + +static void +domainset_freelist_init(struct domainlist *list, int count) +{ + + LIST_INIT(list); + domainset_freelist_add(list, count); +} + +static void +domainset_freelist_free(struct domainlist *list) +{ + struct domainset *set; + + while ((set = LIST_FIRST(list)) != NULL) { + LIST_REMOVE(set, ds_link); + uma_zfree(domainset_zone, set); + } +} + +/* Copy a domainset preserving mask and policy. */ +static void +domainset_copy(const struct domainset *from, struct domainset *to) +{ + + DOMAINSET_COPY(&from->ds_mask, &to->ds_mask); + to->ds_policy = from->ds_policy; + to->ds_prefer = from->ds_prefer; +} + +/* Return 1 if mask and policy are equal, otherwise 0. */ +static int +domainset_equal(const struct domainset *one, const struct domainset *two) +{ + + return (DOMAINSET_CMP(&one->ds_mask, &two->ds_mask) == 0 && + one->ds_policy == two->ds_policy && + one->ds_prefer == two->ds_prefer); +} + +/* Return 1 if child is a valid subset of parent. */ +static int +domainset_valid(const struct domainset *parent, const struct domainset *child) +{ + if (child->ds_policy != DOMAINSET_POLICY_PREFER) + return (DOMAINSET_SUBSET(&parent->ds_mask, &child->ds_mask)); + return (DOMAINSET_ISSET(child->ds_prefer, &parent->ds_mask)); +} + +static int +domainset_restrict(const struct domainset *parent, + const struct domainset *child) +{ + if (child->ds_policy != DOMAINSET_POLICY_PREFER) + return (DOMAINSET_OVERLAP(&parent->ds_mask, &child->ds_mask)); + return (DOMAINSET_ISSET(child->ds_prefer, &parent->ds_mask)); +} + /* + * Lookup or create a domainset. The key is provided in ds_mask and + * ds_policy. If the domainset does not yet exist the storage in + * 'domain' is used to insert. Otherwise this storage is freed to the + * domainset_zone and the existing domainset is returned. + */ +static struct domainset * +_domainset_create(struct domainset *domain, struct domainlist *freelist) +{ + struct domainset *ndomain; + + mtx_lock_spin(&cpuset_lock); + LIST_FOREACH(ndomain, &cpuset_domains, ds_link) + if (domainset_equal(ndomain, domain)) + break; + /* + * If the domain does not yet exist we insert it and initialize + * various iteration helpers which are not part of the key. + */ + if (ndomain == NULL) { + LIST_INSERT_HEAD(&cpuset_domains, domain, ds_link); + domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); + domain->ds_max = DOMAINSET_FLS(&domain->ds_mask) + 1; + } + mtx_unlock_spin(&cpuset_lock); + if (ndomain == NULL) + return (domain); + if (freelist != NULL) + LIST_INSERT_HEAD(freelist, domain, ds_link); + else + uma_zfree(domainset_zone, domain); + return (ndomain); + +} + +/* + * Create or lookup a domainset based on the key held in 'domain'. + */ +static struct domainset * +domainset_create(const struct domainset *domain) +{ + struct domainset *ndomain; + + ndomain = uma_zalloc(domainset_zone, M_WAITOK | M_ZERO); + domainset_copy(domain, ndomain); + return _domainset_create(ndomain, NULL); +} + +/* + * Update thread domainset pointers. + */ +static void +domainset_notify(void) +{ + struct thread *td; + struct proc *p; + + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + continue; + } + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + td->td_domain.dr_policy = td->td_cpuset->cs_domain; + thread_unlock(td); + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + kernel_object->domain.dr_policy = cpuset_default->cs_domain; +} + +/* + * Create a new set that is a subset of a parent. + */ +static struct domainset * +domainset_shadow(const struct domainset *pdomain, + const struct domainset *domain, struct domainlist *freelist) +{ + struct domainset *ndomain; + + ndomain = LIST_FIRST(freelist); + LIST_REMOVE(ndomain, ds_link); + + /* + * Initialize the key from the request. + */ + domainset_copy(domain, ndomain); + + /* + * Restrict the key by the parent. + */ + DOMAINSET_AND(&ndomain->ds_mask, &pdomain->ds_mask); + + return _domainset_create(ndomain, freelist); +} + +/* * Recursively check for errors that would occur from applying mask to * the tree of sets starting at 'set'. Checks for sets that would become * empty as well as RDONLY flags. @@ -376,10 +607,12 @@ cpuset_modify(struct cpuset *set, cpuset_t *mask) * Verify that we have access to this set of * cpus. */ - root = set->cs_parent; - if (root && !CPU_SUBSET(&root->cs_mask, mask)) - return (EINVAL); + root = cpuset_getroot(set); mtx_lock_spin(&cpuset_lock); + if (root && !CPU_SUBSET(&root->cs_mask, mask)) { + error = EINVAL; + goto out; + } error = cpuset_testupdate(set, mask, 0); if (error) goto out; @@ -392,6 +625,141 @@ out: } /* + * Recursively check for errors that would occur from applying mask to + * the tree of sets starting at 'set'. Checks for sets that would become + * empty as well as RDONLY flags. + */ +static int +cpuset_testupdate_domain(struct cpuset *set, struct domainset *dset, + struct domainset *orig, int *count, int check_mask) +{ + struct cpuset *nset; + struct domainset *domain; + struct domainset newset; + int error; + + mtx_assert(&cpuset_lock, MA_OWNED); + if (set->cs_flags & CPU_SET_RDONLY) + return (EPERM); + domain = set->cs_domain; + domainset_copy(domain, &newset); + if (!domainset_equal(domain, orig)) { + if (!domainset_restrict(domain, dset)) + return (EDEADLK); + DOMAINSET_AND(&newset.ds_mask, &dset->ds_mask); + /* Count the number of domains that are changing. */ + (*count)++; + } + error = 0; + LIST_FOREACH(nset, &set->cs_children, cs_siblings) + if ((error = cpuset_testupdate_domain(nset, &newset, domain, + count, 1)) != 0) + break; + return (error); +} + +/* + * Applies the mask 'mask' without checking for empty sets or permissions. + */ +static void +cpuset_update_domain(struct cpuset *set, struct domainset *domain, + struct domainset *orig, struct domainlist *domains) +{ + struct cpuset *nset; + + mtx_assert(&cpuset_lock, MA_OWNED); + /* + * If this domainset has changed from the parent we must calculate + * a new set. Otherwise it simply inherits from the parent. When + * we inherit from the parent we get a new mask and policy. If the + * set is modified from the parent we keep the policy and only + * update the mask. + */ + if (set->cs_domain != orig) { + orig = set->cs_domain; + set->cs_domain = domainset_shadow(domain, orig, domains); + } else + set->cs_domain = domain; + LIST_FOREACH(nset, &set->cs_children, cs_siblings) + cpuset_update_domain(nset, set->cs_domain, orig, domains); + + return; +} + +/* + * Modify the set 'set' to use a copy the domainset provided. Apply this new + * mask to restrict all children in the tree. Checks for validity before + * applying the changes. + */ +static int +cpuset_modify_domain(struct cpuset *set, struct domainset *domain) +{ + struct domainlist domains; + struct domainset temp; + struct domainset *dset; + struct cpuset *root; + int ndomains, needed; + int error; + + error = priv_check(curthread, PRIV_SCHED_CPUSET); + if (error) + return (error); + /* + * In case we are called from within the jail + * we do not allow modifying the dedicated root + * cpuset of the jail but may still allow to + * change child sets. + */ + if (jailed(curthread->td_ucred) && + set->cs_flags & CPU_SET_ROOT) + return (EPERM); + domainset_freelist_init(&domains, 0); + domain = domainset_create(domain); + ndomains = needed = 0; + do { + if (ndomains < needed) { + domainset_freelist_add(&domains, needed - ndomains); + ndomains = needed; + } + root = cpuset_getroot(set); + mtx_lock_spin(&cpuset_lock); + dset = root->cs_domain; + /* + * Verify that we have access to this set of domains. + */ + if (root && !domainset_valid(dset, domain)) { + error = EINVAL; + goto out; + } + /* + * If applying prefer we keep the current set as the fallback. + */ + if (domain->ds_policy == DOMAINSET_POLICY_PREFER) + DOMAINSET_COPY(&set->cs_domain->ds_mask, + &domain->ds_mask); + /* + * Determine whether we can apply this set of domains and + * how many new domain structures it will require. + */ + domainset_copy(domain, &temp); + needed = 0; + error = cpuset_testupdate_domain(set, &temp, set->cs_domain, + &needed, 0); + if (error) + goto out; + } while (ndomains < needed); + dset = set->cs_domain; + cpuset_update_domain(set, domain, dset, &domains); +out: + mtx_unlock_spin(&cpuset_lock); + domainset_freelist_free(&domains); + if (error == 0) + domainset_notify(); + + return (error); +} + +/* * Resolve the 'which' parameter of several cpuset apis. * * For WHICH_PID and WHICH_TID return a locked proc and valid proc/tid. Also @@ -481,44 +849,203 @@ cpuset_which(cpuwhich_t which, id_t id, struct proc ** return (0); } +static int +cpuset_testshadow(struct cpuset *set, const cpuset_t *mask, + const struct domainset *domain) +{ + struct cpuset *parent; + struct domainset *dset; + + parent = cpuset_getbase(set); + /* + * If we are restricting a cpu mask it must be a subset of the + * parent or invalid CPUs have been specified. + */ + if (mask != NULL && !CPU_SUBSET(&parent->cs_mask, mask)) + return (EINVAL); + + /* + * If we are restricting a domain mask it must be a subset of the + * parent or invalid domains have been specified. + */ + dset = parent->cs_domain; + if (domain != NULL && !domainset_valid(dset, domain)) + return (EINVAL); + + return (0); +} + /* * Create an anonymous set with the provided mask in the space provided by - * 'fset'. If the passed in set is anonymous we use its parent otherwise + * 'nset'. If the passed in set is anonymous we use its parent otherwise * the new set is a child of 'set'. */ static int -cpuset_shadow(struct cpuset *set, struct cpuset *fset, const cpuset_t *mask) +cpuset_shadow(struct cpuset *set, struct cpuset **nsetp, + const cpuset_t *mask, const struct domainset *domain, + struct setlist *cpusets, struct domainlist *domains) { struct cpuset *parent; + struct cpuset *nset; + struct domainset *dset; + struct domainset *d; + int error; - if (set->cs_id == CPUSET_INVALID) - parent = set->cs_parent; + error = cpuset_testshadow(set, mask, domain); + if (error) + return (error); + + parent = cpuset_getbase(set); + dset = parent->cs_domain; + if (mask == NULL) + mask = &set->cs_mask; + if (domain != NULL) + d = domainset_shadow(dset, domain, domains); else - parent = set; - if (!CPU_SUBSET(&parent->cs_mask, mask)) + d = set->cs_domain; + nset = LIST_FIRST(cpusets); + error = _cpuset_create(nset, parent, mask, d, CPUSET_INVALID); + if (error == 0) { + LIST_REMOVE(nset, cs_link); + *nsetp = nset; + } + return (error); +} + +static struct cpuset * +cpuset_update_thread(struct thread *td, struct cpuset *nset) +{ + struct cpuset *tdset; + + tdset = td->td_cpuset; + td->td_cpuset = nset; + td->td_domain.dr_policy = nset->cs_domain; + sched_affinity(td); + + return (tdset); +} + +static int +cpuset_setproc_test_maskthread(struct cpuset *tdset, cpuset_t *mask, + struct domainset *domain) +{ + struct cpuset *parent; + + parent = cpuset_getbase(tdset); + if (mask == NULL) + mask = &tdset->cs_mask; + if (domain == NULL) + domain = tdset->cs_domain; + return cpuset_testshadow(parent, mask, domain); +} + +static int +cpuset_setproc_maskthread(struct cpuset *tdset, cpuset_t *mask, + struct domainset *domain, struct cpuset **nsetp, + struct setlist *freelist, struct domainlist *domainlist) +{ + struct cpuset *parent; + + parent = cpuset_getbase(tdset); + if (mask == NULL) + mask = &tdset->cs_mask; + if (domain == NULL) + domain = tdset->cs_domain; + return cpuset_shadow(parent, nsetp, mask, domain, freelist, + domainlist); +} + +static int +cpuset_setproc_setthread_mask(struct cpuset *tdset, struct cpuset *set, + cpuset_t *mask, struct domainset *domain) +{ + struct cpuset *parent; + + parent = cpuset_getbase(tdset); + + /* + * If the thread restricted its mask then apply that same + * restriction to the new set, otherwise take it wholesale. + */ + if (CPU_CMP(&tdset->cs_mask, &parent->cs_mask) != 0) { + CPU_COPY(&tdset->cs_mask, mask); + CPU_AND(mask, &set->cs_mask); + } else + CPU_COPY(&set->cs_mask, mask); + + /* + * If the thread restricted the domain then we apply the + * restriction to the new set but retain the policy. + */ + if (tdset->cs_domain != parent->cs_domain) { + domainset_copy(tdset->cs_domain, domain); + DOMAINSET_AND(&domain->ds_mask, &set->cs_domain->ds_mask); + } else + domainset_copy(set->cs_domain, domain); + + if (CPU_EMPTY(mask) || DOMAINSET_EMPTY(&domain->ds_mask)) return (EDEADLK); - return (_cpuset_create(fset, parent, mask, CPUSET_INVALID)); + + return (0); } +static int +cpuset_setproc_test_setthread(struct cpuset *tdset, struct cpuset *set) +{ + struct domainset domain; + cpuset_t mask; + + if (tdset->cs_id != CPUSET_INVALID) + return (0); + return cpuset_setproc_setthread_mask(tdset, set, &mask, &domain); +} + +static int +cpuset_setproc_setthread(struct cpuset *tdset, struct cpuset *set, + struct cpuset **nsetp, struct setlist *freelist, + struct domainlist *domainlist) +{ + struct domainset domain; + cpuset_t mask; + int error; + + /* + * If we're replacing on a thread that has not constrained the + * original set we can simply accept the new set. + */ + if (tdset->cs_id != CPUSET_INVALID) { + *nsetp = cpuset_ref(set); + return (0); + } + error = cpuset_setproc_setthread_mask(tdset, set, &mask, &domain); + if (error) + return (error); + + return cpuset_shadow(tdset, nsetp, &mask, &domain, freelist, + domainlist); +} + /* - * Handle two cases for replacing the base set or mask of an entire process. + * Handle three cases for updating an entire process. * - * 1) Set is non-null and mask is null. This reparents all anonymous sets - * to the provided set and replaces all non-anonymous td_cpusets with the - * provided set. - * 2) Mask is non-null and set is null. This replaces or creates anonymous - * sets for every thread with the existing base as a parent. + * 1) Set is non-null. This reparents all anonymous sets to the provided + * set and replaces all non-anonymous td_cpusets with the provided set. + * 2) Mask is non-null. This replaces or creates anonymous sets for every + * thread with the existing base as a parent. + * 3) domain is non-null. This creates anonymous sets for every thread + * and replaces the domain set. * * This is overly complicated because we can't allocate while holding a * spinlock and spinlocks must be held while changing and examining thread * state. */ static int -cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask) +cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, + struct domainset *domain) { struct setlist freelist; struct setlist droplist; - struct cpuset *tdset; + struct domainlist domainlist; struct cpuset *nset; struct thread *td; struct proc *p; @@ -533,7 +1060,9 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t * 2) If enough cpusets have not been allocated release the locks and * allocate them. Loop. */ - LIST_INIT(&freelist); + cpuset_freelist_init(&freelist, 1); + domainset_freelist_init(&domainlist, 1); + nfree = 1; LIST_INIT(&droplist); nfree = 0; for (;;) { @@ -544,39 +1073,27 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t break; threads = p->p_numthreads; PROC_UNLOCK(p); - for (; nfree < threads; nfree++) { - nset = uma_zalloc(cpuset_zone, M_WAITOK); - LIST_INSERT_HEAD(&freelist, nset, cs_link); + if (nfree < threads) { + cpuset_freelist_add(&freelist, threads - nfree); + domainset_freelist_add(&domainlist, threads - nfree); + nfree = threads; } } PROC_LOCK_ASSERT(p, MA_OWNED); /* * Now that the appropriate locks are held and we have enough cpusets, - * make sure the operation will succeed before applying changes. The + * make sure the operation will succeed before applying changes. The * proc lock prevents td_cpuset from changing between calls. */ error = 0; FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); - tdset = td->td_cpuset; - /* - * Verify that a new mask doesn't specify cpus outside of - * the set the thread is a member of. - */ - if (mask) { - if (tdset->cs_id == CPUSET_INVALID) - tdset = tdset->cs_parent; - if (!CPU_SUBSET(&tdset->cs_mask, mask)) - error = EDEADLK; - /* - * Verify that a new set won't leave an existing thread - * mask without a cpu to run on. It can, however, restrict - * the set. - */ - } else if (tdset->cs_id == CPUSET_INVALID) { - if (!CPU_OVERLAP(&set->cs_mask, &tdset->cs_mask)) - error = EDEADLK; - } + if (set != NULL) + error = cpuset_setproc_test_setthread(td->td_cpuset, + set); + else + error = cpuset_setproc_test_maskthread(td->td_cpuset, + mask, domain); thread_unlock(td); if (error) goto unlock_out; @@ -588,33 +1105,17 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t */ FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); - /* - * If we presently have an anonymous set or are applying a - * mask we must create an anonymous shadow set. That is - * either parented to our existing base or the supplied set. - * - * If we have a base set with no anonymous shadow we simply - * replace it outright. - */ - tdset = td->td_cpuset; - if (tdset->cs_id == CPUSET_INVALID || mask) { - nset = LIST_FIRST(&freelist); - LIST_REMOVE(nset, cs_link); - if (mask) - error = cpuset_shadow(tdset, nset, mask); - else - error = _cpuset_create(nset, set, - &tdset->cs_mask, CPUSET_INVALID); - if (error) { - LIST_INSERT_HEAD(&freelist, nset, cs_link); - thread_unlock(td); - break; - } - } else - nset = cpuset_ref(set); - cpuset_rel_defer(&droplist, tdset); - td->td_cpuset = nset; - sched_affinity(td); + if (set != NULL) + error = cpuset_setproc_setthread(td->td_cpuset, set, + &nset, &freelist, &domainlist); + else + error = cpuset_setproc_maskthread(td->td_cpuset, mask, + domain, &nset, &freelist, &domainlist); + if (error) { + thread_unlock(td); + break; + } + cpuset_rel_defer(&droplist, cpuset_update_thread(td, nset)); thread_unlock(td); } unlock_out: @@ -622,10 +1123,8 @@ unlock_out: out: while ((nset = LIST_FIRST(&droplist)) != NULL) cpuset_rel_complete(nset); - while ((nset = LIST_FIRST(&freelist)) != NULL) { - LIST_REMOVE(nset, cs_link); - uma_zfree(cpuset_zone, nset); - } + cpuset_freelist_free(&freelist); + domainset_freelist_free(&domainlist); return (error); } @@ -690,46 +1189,57 @@ cpusetobj_strscan(cpuset_t *set, const char *buf) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 12 22:49:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BD20EA61BD; Fri, 12 Jan 2018 22:49:37 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0297DB15; Fri, 12 Jan 2018 22:49:37 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x242.google.com with SMTP id f34so2223666ioi.13; Fri, 12 Jan 2018 14:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1wdhWkkgHqbvDTBKL8auYNsDDpgv8cUiQ3L6pV44E3c=; b=ThDUT60k6krFvc6TgPZT8sx/nlfAlwub8ToPJ0eYExC0RuWssdGjQe99+4eUmn5Rvt zwJO/vp2UdWbbId3h0QWC1Am8TZPrwLmh8UhEecp6ypiwfSay3rigWqeBJIkePZYRs30 /gPkqJqLguIT6Zpanhgsk/hIccDMKjO8WU7eDTfB9gK0jHLQFdXFTb5r0grMiv3u50U0 MJYyP3Q3rz67LIlx6XrmorPSdtdCBc6W4ga2OkSfQERjunmsCigyVIJ3L8VGLpZnGpWi wbfpmU7o5qDhTyL2Pvc8t+sVkMt82o3sOcbHKsnQVMzT3/ckuaPOd1BXfIA2RQfgIOGs lPJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1wdhWkkgHqbvDTBKL8auYNsDDpgv8cUiQ3L6pV44E3c=; b=OVnKcK9bVhhF+xoufddz15/BWgv9UDVzVDETmm8ExX+IB5axTT6MWPTvUOUrc9JxXE ekt4lpyRAblN//I2Glv3+RNp+hqaZgarKZP1icR1INklsxaD79bY8GTTBB8mx2emNmje /DaBMltGJlLsNOZC4Quf4OkXBYJxA4avcLaYueg35DjIl07Zs2+xF1n3nRIYyoj2eaIt aWW3zr7x/4coXSIesGo6UpvoWoEHm/iGddRn/zMDrq1nZWxwVaf2oGIW6fWQAE84V5UB E4CfVOdhREoWTiicwFfOSqo9lRbMzMYNbFy3qB6LHo37O074TNNy5ml8lViaDg4EZaue XhlQ== X-Gm-Message-State: AKwxytcXUeHanBUTlEir56jZRfzGeMbft6g+prXQxdCOGgPqfn20NxVj y/PeKz0+LZOCIGXZDkbJWA0K/P78O7ziIaU2jc4= X-Google-Smtp-Source: ACJfBotzMxbXWMVR3pkkMsJVZlHOoEQfAm6ZbiOrplMunzH1SA5K9l2SRKkwn9EG7XonBj71vTXVKkafv8rpS0c/gnY= X-Received: by 10.107.35.85 with SMTP id j82mr25834609ioj.253.1515797376113; Fri, 12 Jan 2018 14:49:36 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.190.1 with HTTP; Fri, 12 Jan 2018 14:49:35 -0800 (PST) In-Reply-To: <201801111403.w0BE353l047103@repo.freebsd.org> References: <201801111403.w0BE353l047103@repo.freebsd.org> From: Antoine Brodin Date: Fri, 12 Jan 2018 23:49:35 +0100 X-Google-Sender-Auth: kAOVCC_EqZZ2KlCwaIVmLoCG65E Message-ID: Subject: Re: svn commit: r327823 - head/share/mk To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 22:49:37 -0000 On Thu, Jan 11, 2018 at 3:03 PM, Ed Maste wrote: > Author: emaste > Date: Thu Jan 11 14:03:05 2018 > New Revision: 327823 > URL: https://svnweb.freebsd.org/changeset/base/327823 > > Log: > Enable ld.lld as bootstrap linker by default on i386 > > Akin to r327783 for amd64. lld has been usable for amd64 for quite some > time, but a couple of issues remained that affected i386. These were > recently addressed upstream in lld and merged into FreeBSD (r326831, > r326879, r326897, r326957), so we can now use ld.lld on i386 as well. > > Similarly to amd64 this change enables lld only as the bootstrap linker > (used to link the kernel and userland libraries and executables), while > GNU ld.bfd is still installed as /usr/bin/ld and used for ports builds. > > The ports collection is essentially ready to use lld as the system > linker for amd64, but many ports still have trouble with lld on i386, > because lld defaults to -ztext, disallowing relocations against readonly > segments. Thus switching the system linker (WITH_LLD_IS_LD) will happen > later on a per-arch basis. > > Relnotes: Yes > Sponsored by: The FreeBSD Foundation Hi, There are some regressions in ports after this change, could you revert it and request a proper exp-run? Thanks. Antoine From owner-svn-src-all@freebsd.org Fri Jan 12 22:57:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CFC1EA6A61; Fri, 12 Jan 2018 22:57:59 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1040D13B4; Fri, 12 Jan 2018 22:57:59 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 354C721B8; Fri, 12 Jan 2018 22:57:58 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CMvwcX087237; Fri, 12 Jan 2018 22:57:58 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CMvvio087233; Fri, 12 Jan 2018 22:57:57 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122257.w0CMvvio087233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 22:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327896 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 327896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 22:57:59 -0000 Author: jeff Date: Fri Jan 12 22:57:57 2018 New Revision: 327896 URL: https://svnweb.freebsd.org/changeset/base/327896 Log: Add files for r327895 Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically. Implement domainset based iterators in the page layer. Remove the now legacy numa_* syscalls. Cleanup some header polution created by having seq.h in proc.h. Reviewed by: markj, kib Discussed with: alc Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D13403 Added: head/sys/sys/_domainset.h (contents, props changed) head/sys/sys/domainset.h (contents, props changed) head/sys/vm/vm_domainset.c (contents, props changed) head/sys/vm/vm_domainset.h (contents, props changed) Added: head/sys/sys/_domainset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_domainset.h Fri Jan 12 22:57:57 2018 (r327896) @@ -0,0 +1,60 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017, Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS__DOMAINSET_H_ +#define _SYS__DOMAINSET_H_ + +#include + +#ifdef _KERNEL +#define DOMAINSET_SETSIZE MAXMEMDOM +#endif + +#define DOMAINSET_MAXSIZE 256 + +#ifndef DOMAINSET_SETSIZE +#define DOMAINSET_SETSIZE DOMAINSET_MAXSIZE +#endif + +BITSET_DEFINE(_domainset, DOMAINSET_SETSIZE); +typedef struct _domainset domainset_t; + +/* + * This structure is intended to be embedded in objects which have policy + * attributes. Each object keeps its own iterator so round-robin is + * synchronized and accurate. + */ +struct domainset; +struct domainset_ref { + struct domainset * volatile dr_policy; + int dr_iterator; +}; + +#endif /* !_SYS__DOMAINSET_H_ */ Added: head/sys/sys/domainset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/domainset.h Fri Jan 12 22:57:57 2018 (r327896) @@ -0,0 +1,102 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017, Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_DOMAINSETSET_H_ +#define _SYS_DOMAINSETSET_H_ + +#include + +#include + +#define _NDOMAINSETBITS _BITSET_BITS +#define _NDOMAINSETWORDS __bitset_words(DOMAINSET_SETSIZE) + +#define DOMAINSETSETBUFSIZ ((2 + sizeof(long) * 2) * _NDOMAINSETWORDS) + +#define DOMAINSET_CLR(n, p) BIT_CLR(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_COPY(f, t) BIT_COPY(DOMAINSET_SETSIZE, f, t) +#define DOMAINSET_ISSET(n, p) BIT_ISSET(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_SET(n, p) BIT_SET(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_ZERO(p) BIT_ZERO(DOMAINSET_SETSIZE, p) +#define DOMAINSET_FILL(p) BIT_FILL(DOMAINSET_SETSIZE, p) +#define DOMAINSET_SETOF(n, p) BIT_SETOF(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_EMPTY(p) BIT_EMPTY(DOMAINSET_SETSIZE, p) +#define DOMAINSET_ISFULLSET(p) BIT_ISFULLSET(DOMAINSET_SETSIZE, p) +#define DOMAINSET_SUBSET(p, c) BIT_SUBSET(DOMAINSET_SETSIZE, p, c) +#define DOMAINSET_OVERLAP(p, c) BIT_OVERLAP(DOMAINSET_SETSIZE, p, c) +#define DOMAINSET_CMP(p, c) BIT_CMP(DOMAINSET_SETSIZE, p, c) +#define DOMAINSET_OR(d, s) BIT_OR(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_AND(d, s) BIT_AND(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_NAND(d, s) BIT_NAND(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_SET_ATOMIC(n, p) BIT_SET_ATOMIC(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_SET_ATOMIC_ACQ(n, p) \ + BIT_SET_ATOMIC_ACQ(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_AND_ATOMIC(n, p) BIT_AND_ATOMIC(DOMAINSET_SETSIZE, n, p) +#define DOMAINSET_OR_ATOMIC(d, s) BIT_OR_ATOMIC(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_COPY_STORE_REL(f, t) \ + BIT_COPY_STORE_REL(DOMAINSET_SETSIZE, f, t) +#define DOMAINSET_FFS(p) BIT_FFS(DOMAINSET_SETSIZE, p) +#define DOMAINSET_FLS(p) BIT_FLS(DOMAINSET_SETSIZE, p) +#define DOMAINSET_COUNT(p) BIT_COUNT(DOMAINSET_SETSIZE, p) +#define DOMAINSET_FSET BITSET_FSET(_NDOMAINSETWORDS) +#define DOMAINSET_T_INITIALIZER BITSET_T_INITIALIZER + +#define DOMAINSET_POLICY_INVALID 0 +#define DOMAINSET_POLICY_ROUNDROBIN 1 +#define DOMAINSET_POLICY_FIRSTTOUCH 2 +#define DOMAINSET_POLICY_PREFER 3 +#define DOMAINSET_POLICY_MAX DOMAINSET_POLICY_PREFER + +#ifdef _KERNEL +#include +LIST_HEAD(domainlist, domainset); + +struct domainset { + LIST_ENTRY(domainset) ds_link; + domainset_t ds_mask; /* allowed domains. */ + uint16_t ds_policy; /* Policy type. */ + int16_t ds_prefer; /* Preferred domain or -1. */ + uint16_t ds_cnt; /* popcnt from above. */ + uint16_t ds_max; /* Maximum domain in set. */ +}; + +void domainset_zero(void); + +#else +__BEGIN_DECLS +int cpuset_getdomain(cpulevel_t, cpuwhich_t, id_t, size_t, domainset_t *, + int *); +int cpuset_setdomain(cpulevel_t, cpuwhich_t, id_t, size_t, + const domainset_t *, int); + +__END_DECLS +#endif +#endif /* !_SYS_DOMAINSETSET_H_ */ Added: head/sys/vm/vm_domainset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/vm/vm_domainset.c Fri Jan 12 22:57:57 2018 (r327896) @@ -0,0 +1,243 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017, Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_vm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * Iterators are written such that the first nowait pass has as short a + * codepath as possible to eliminate bloat from the allocator. It is + * assumed that most allocations are successful. + */ + +/* + * Determine which policy is to be used for this allocation. + */ +static void +vm_domainset_iter_domain(struct vm_domainset_iter *di, struct vm_object *obj) +{ + struct domainset *domain; + + /* + * object policy takes precedence over thread policy. The policies + * are immutable and unsynchronized. Updates can race but pointer + * loads are assumed to be atomic. + */ + if (obj != NULL && (domain = obj->domain.dr_policy) != NULL) { + di->di_domain = domain; + di->di_iter = &obj->domain.dr_iterator; + } else { + di->di_domain = curthread->td_domain.dr_policy; + di->di_iter = &curthread->td_domain.dr_iterator; + } +} + +static void +vm_domainset_iter_rr(struct vm_domainset_iter *di, int *domain) +{ + int d; + + d = *di->di_iter; + do { + d = (d + 1) % di->di_domain->ds_max; + } while (!DOMAINSET_ISSET(d, &di->di_domain->ds_mask)); + *di->di_iter = *domain = d; +} + +static void +vm_domainset_iter_prefer(struct vm_domainset_iter *di, int *domain) +{ + int d; + + d = *di->di_iter; + do { + d = (d + 1) % di->di_domain->ds_max; + } while (!DOMAINSET_ISSET(d, &di->di_domain->ds_mask) || + d == di->di_domain->ds_prefer); + *di->di_iter = *domain = d; +} + +static void +vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) +{ + + KASSERT(di->di_n > 0, + ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + switch (di->di_domain->ds_policy) { + case DOMAINSET_POLICY_FIRSTTOUCH: + /* + * To prevent impossible allocations we convert an invalid + * first-touch to round-robin. + */ + /* FALLTHROUGH */ + case DOMAINSET_POLICY_ROUNDROBIN: + vm_domainset_iter_rr(di, domain); + break; + case DOMAINSET_POLICY_PREFER: + vm_domainset_iter_prefer(di, domain); + break; + default: + panic("vm_domainset_iter_first: Unknown policy %d", + di->di_domain->ds_policy); + } + KASSERT(*domain < vm_ndomains, + ("vm_domainset_iter_next: Invalid domain %d", *domain)); +} + +static void +vm_domainset_iter_first(struct vm_domainset_iter *di, int *domain) +{ + + switch (di->di_domain->ds_policy) { + case DOMAINSET_POLICY_FIRSTTOUCH: + *domain = PCPU_GET(domain); + if (DOMAINSET_ISSET(*domain, &di->di_domain->ds_mask)) { + di->di_n = 1; + break; + } + /* + * To prevent impossible allocations we convert an invalid + * first-touch to round-robin. + */ + /* FALLTHROUGH */ + case DOMAINSET_POLICY_ROUNDROBIN: + di->di_n = di->di_domain->ds_cnt; + vm_domainset_iter_rr(di, domain); + break; + case DOMAINSET_POLICY_PREFER: + *domain = di->di_domain->ds_prefer; + di->di_n = di->di_domain->ds_cnt; + break; + default: + panic("vm_domainset_iter_first: Unknown policy %d", + di->di_domain->ds_policy); + } + KASSERT(di->di_n > 0, + ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(*domain < vm_ndomains, + ("vm_domainset_iter_first: Invalid domain %d", *domain)); +} + +void +vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, + int *domain, int *req) +{ + + vm_domainset_iter_domain(di, obj); + di->di_flags = *req; + *req = (di->di_flags & ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) | + VM_ALLOC_NOWAIT; + vm_domainset_iter_first(di, domain); +} + +int +vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *req) +{ + + /* + * If we exhausted all options with NOWAIT and did a WAITFAIL it + * is time to return an error to the caller. + */ + if ((*req & VM_ALLOC_WAITFAIL) != 0) + return (ENOMEM); + + /* If there are more domains to visit we run the iterator. */ + if (--di->di_n != 0) { + vm_domainset_iter_next(di, domain); + return (0); + } + + /* If we visited all domains and this was a NOWAIT we return error. */ + if ((di->di_flags & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) == 0) + return (ENOMEM); + + /* + * We have visited all domains with non-blocking allocations, try + * from the beginning with a blocking allocation. + */ + vm_domainset_iter_first(di, domain); + *req = di->di_flags; + + return (0); +} + + +void +vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, + struct vm_object *obj, int *domain, int *flags) +{ + + vm_domainset_iter_domain(di, obj); + di->di_flags = *flags; + *flags = (di->di_flags & ~M_WAITOK) | M_NOWAIT; + vm_domainset_iter_first(di, domain); +} + +int +vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +{ + + /* If there are more domains to visit we run the iterator. */ + if (--di->di_n != 0) { + vm_domainset_iter_next(di, domain); + return (0); + } + + /* If we visited all domains and this was a NOWAIT we return error. */ + if ((di->di_flags & M_WAITOK) == 0) + return (ENOMEM); + + /* + * We have visited all domains with non-blocking allocations, try + * from the beginning with a blocking allocation. + */ + vm_domainset_iter_first(di, domain); + *flags = di->di_flags; + + return (0); +} Added: head/sys/vm/vm_domainset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/vm/vm_domainset.h Fri Jan 12 22:57:57 2018 (r327896) @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017, Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __VM_DOMAINSET_H__ +#define __VM_DOMAINSET_H__ + +struct vm_domainset_iter { + struct domainset *di_domain; + int *di_iter; + int di_flags; + int di_n; +}; + +int vm_domainset_iter_page(struct vm_domainset_iter *, int *, int *); +void vm_domainset_iter_page_init(struct vm_domainset_iter *, + struct vm_object *, int *, int *); +int vm_domainset_iter_malloc(struct vm_domainset_iter *, int *, int *); +void vm_domainset_iter_malloc_init(struct vm_domainset_iter *, + struct vm_object *, int *, int *); + +#endif /* __VM_DOMAINSET_H__ */ From owner-svn-src-all@freebsd.org Fri Jan 12 23:06:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA12EA71AF; Fri, 12 Jan 2018 23:06:38 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A1341B2D; Fri, 12 Jan 2018 23:06:38 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44F9F2352; Fri, 12 Jan 2018 23:06:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CN6b0k091215; Fri, 12 Jan 2018 23:06:37 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CN6ZnU091203; Fri, 12 Jan 2018 23:06:35 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122306.w0CN6ZnU091203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 23:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327897 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 327897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:06:38 -0000 Author: jeff Date: Fri Jan 12 23:06:35 2018 New Revision: 327897 URL: https://svnweb.freebsd.org/changeset/base/327897 Log: Regenerate auto-generated files Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 12 23:06:35 2018 (r327897) @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -693,6 +694,24 @@ struct freebsd32_kevent_args { char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; }; +struct freebsd32_cpuset_getdomain_args { + char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; + char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char domainsetsize_l_[PADL_(size_t)]; size_t domainsetsize; char domainsetsize_r_[PADR_(size_t)]; + char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; + char policy_l_[PADL_(int *)]; int * policy; char policy_r_[PADR_(int *)]; +}; +struct freebsd32_cpuset_setdomain_args { + char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; + char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char domainsetsize_l_[PADL_(size_t)]; size_t domainsetsize; char domainsetsize_r_[PADR_(size_t)]; + char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; + char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -823,6 +842,8 @@ int freebsd32_fstatat(struct thread *, struct freebsd3 int freebsd32_fhstat(struct thread *, struct freebsd32_fhstat_args *); int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); +int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); +int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); #ifdef COMPAT_43 @@ -1370,6 +1391,8 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_fhstat AUE_FHSTAT #define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT +#define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 12 23:06:35 2018 (r327897) @@ -455,8 +455,6 @@ #define FREEBSD32_SYS_freebsd32_ppoll 545 #define FREEBSD32_SYS_freebsd32_futimens 546 #define FREEBSD32_SYS_freebsd32_utimensat 547 -#define FREEBSD32_SYS_numa_getaffinity 548 -#define FREEBSD32_SYS_numa_setaffinity 549 #define FREEBSD32_SYS_fdatasync 550 #define FREEBSD32_SYS_freebsd32_fstat 551 #define FREEBSD32_SYS_freebsd32_fstatat 552 @@ -468,4 +466,6 @@ #define FREEBSD32_SYS_fhstatfs 558 #define FREEBSD32_SYS_mknodat 559 #define FREEBSD32_SYS_freebsd32_kevent 560 -#define FREEBSD32_SYS_MAXSYSCALL 561 +#define FREEBSD32_SYS_freebsd32_cpuset_getdomain 561 +#define FREEBSD32_SYS_freebsd32_cpuset_setdomain 562 +#define FREEBSD32_SYS_MAXSYSCALL 563 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 12 23:06:35 2018 (r327897) @@ -580,8 +580,8 @@ const char *freebsd32_syscallnames[] = { "freebsd32_ppoll", /* 545 = freebsd32_ppoll */ "freebsd32_futimens", /* 546 = freebsd32_futimens */ "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ - "numa_getaffinity", /* 548 = numa_getaffinity */ - "numa_setaffinity", /* 549 = numa_setaffinity */ + "#548", /* 548 = numa_getaffinity */ + "#549", /* 549 = numa_setaffinity */ "fdatasync", /* 550 = fdatasync */ "freebsd32_fstat", /* 551 = freebsd32_fstat */ "freebsd32_fstatat", /* 552 = freebsd32_fstatat */ @@ -593,4 +593,6 @@ const char *freebsd32_syscallnames[] = { "fhstatfs", /* 558 = fhstatfs */ "mknodat", /* 559 = mknodat */ "freebsd32_kevent", /* 560 = freebsd32_kevent */ + "freebsd32_cpuset_getdomain", /* 561 = freebsd32_cpuset_getdomain */ + "freebsd32_cpuset_setdomain", /* 562 = freebsd32_cpuset_setdomain */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri Jan 12 23:06:35 2018 (r327897) @@ -629,8 +629,8 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */ { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = freebsd32_futimens */ { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ - { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ - { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 548 = numa_getaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 549 = numa_setaffinity */ { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 551 = freebsd32_fstat */ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 552 = freebsd32_fstatat */ @@ -642,4 +642,6 @@ struct sysent freebsd32_sysent[] = { { AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 558 = fhstatfs */ { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 559 = mknodat */ { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = freebsd32_kevent */ + { AS(freebsd32_cpuset_getdomain_args), (sy_call_t *)freebsd32_cpuset_getdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 561 = freebsd32_cpuset_getdomain */ + { AS(freebsd32_cpuset_setdomain_args), (sy_call_t *)freebsd32_cpuset_setdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 562 = freebsd32_cpuset_setdomain */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Jan 12 23:06:35 2018 (r327897) @@ -3150,24 +3150,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 4; break; } - /* numa_getaffinity */ - case 548: { - struct numa_getaffinity_args *p = params; - iarg[0] = p->which; /* cpuwhich_t */ - iarg[1] = p->id; /* id_t */ - uarg[2] = (intptr_t) p->policy; /* struct vm_domain_policy * */ - *n_args = 3; - break; - } - /* numa_setaffinity */ - case 549: { - struct numa_setaffinity_args *p = params; - iarg[0] = p->which; /* cpuwhich_t */ - iarg[1] = p->id; /* id_t */ - uarg[2] = (intptr_t) p->policy; /* const struct vm_domain_policy * */ - *n_args = 3; - break; - } /* fdatasync */ case 550: { struct fdatasync_args *p = params; @@ -3266,6 +3248,32 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* freebsd32_cpuset_getdomain */ + case 561: { + struct freebsd32_cpuset_getdomain_args *p = params; + iarg[0] = p->level; /* cpulevel_t */ + iarg[1] = p->which; /* cpuwhich_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ + uarg[4] = p->domainsetsize; /* size_t */ + uarg[5] = (intptr_t) p->mask; /* domainset_t * */ + uarg[6] = (intptr_t) p->policy; /* int * */ + *n_args = 7; + break; + } + /* freebsd32_cpuset_setdomain */ + case 562: { + struct freebsd32_cpuset_setdomain_args *p = params; + iarg[0] = p->level; /* cpulevel_t */ + iarg[1] = p->which; /* cpuwhich_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ + uarg[4] = p->domainsetsize; /* size_t */ + uarg[5] = (intptr_t) p->mask; /* domainset_t * */ + iarg[6] = p->policy; /* int */ + *n_args = 7; + break; + } default: *n_args = 0; break; @@ -8563,38 +8571,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* numa_getaffinity */ - case 548: - switch(ndx) { - case 0: - p = "cpuwhich_t"; - break; - case 1: - p = "id_t"; - break; - case 2: - p = "userland struct vm_domain_policy *"; - break; - default: - break; - }; - break; - /* numa_setaffinity */ - case 549: - switch(ndx) { - case 0: - p = "cpuwhich_t"; - break; - case 1: - p = "id_t"; - break; - case 2: - p = "userland const struct vm_domain_policy *"; - break; - default: - break; - }; - break; /* fdatasync */ case 550: switch(ndx) { @@ -8768,6 +8744,62 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* freebsd32_cpuset_getdomain */ + case 561: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: + p = "size_t"; + break; + case 5: + p = "userland domainset_t *"; + break; + case 6: + p = "userland int *"; + break; + default: + break; + }; + break; + /* freebsd32_cpuset_setdomain */ + case 562: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: + p = "size_t"; + break; + case 5: + p = "userland domainset_t *"; + break; + case 6: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10554,16 +10586,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* numa_getaffinity */ - case 548: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* numa_setaffinity */ - case 549: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* fdatasync */ case 550: if (ndx == 0 || ndx == 1) @@ -10616,6 +10638,16 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* freebsd32_kevent */ case 560: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_cpuset_getdomain */ + case 561: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_cpuset_setdomain */ + case 562: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/kern/syscalls.c Fri Jan 12 23:06:35 2018 (r327897) @@ -554,8 +554,8 @@ const char *syscallnames[] = { "ppoll", /* 545 = ppoll */ "futimens", /* 546 = futimens */ "utimensat", /* 547 = utimensat */ - "numa_getaffinity", /* 548 = numa_getaffinity */ - "numa_setaffinity", /* 549 = numa_setaffinity */ + "#548", /* 548 = numa_getaffinity */ + "#549", /* 549 = numa_setaffinity */ "fdatasync", /* 550 = fdatasync */ "fstat", /* 551 = fstat */ "fstatat", /* 552 = fstatat */ @@ -567,4 +567,6 @@ const char *syscallnames[] = { "fhstatfs", /* 558 = fhstatfs */ "mknodat", /* 559 = mknodat */ "kevent", /* 560 = kevent */ + "cpuset_getdomain", /* 561 = cpuset_getdomain */ + "cpuset_setdomain", /* 562 = cpuset_setdomain */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/kern/systrace_args.c Fri Jan 12 23:06:35 2018 (r327897) @@ -3160,24 +3160,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 4; break; } - /* numa_getaffinity */ - case 548: { - struct numa_getaffinity_args *p = params; - iarg[0] = p->which; /* cpuwhich_t */ - iarg[1] = p->id; /* id_t */ - uarg[2] = (intptr_t) p->policy; /* struct vm_domain_policy_entry * */ - *n_args = 3; - break; - } - /* numa_setaffinity */ - case 549: { - struct numa_setaffinity_args *p = params; - iarg[0] = p->which; /* cpuwhich_t */ - iarg[1] = p->id; /* id_t */ - uarg[2] = (intptr_t) p->policy; /* const struct vm_domain_policy_entry * */ - *n_args = 3; - break; - } /* fdatasync */ case 550: { struct fdatasync_args *p = params; @@ -3276,6 +3258,30 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* cpuset_getdomain */ + case 561: { + struct cpuset_getdomain_args *p = params; + iarg[0] = p->level; /* cpulevel_t */ + iarg[1] = p->which; /* cpuwhich_t */ + iarg[2] = p->id; /* id_t */ + uarg[3] = p->domainsetsize; /* size_t */ + uarg[4] = (intptr_t) p->mask; /* domainset_t * */ + uarg[5] = (intptr_t) p->policy; /* int * */ + *n_args = 6; + break; + } + /* cpuset_setdomain */ + case 562: { + struct cpuset_setdomain_args *p = params; + iarg[0] = p->level; /* cpulevel_t */ + iarg[1] = p->which; /* cpuwhich_t */ + iarg[2] = p->id; /* id_t */ + uarg[3] = p->domainsetsize; /* size_t */ + uarg[4] = (intptr_t) p->mask; /* domainset_t * */ + iarg[5] = p->policy; /* int */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8523,38 +8529,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* numa_getaffinity */ - case 548: - switch(ndx) { - case 0: - p = "cpuwhich_t"; - break; - case 1: - p = "id_t"; - break; - case 2: - p = "userland struct vm_domain_policy_entry *"; - break; - default: - break; - }; - break; - /* numa_setaffinity */ - case 549: - switch(ndx) { - case 0: - p = "cpuwhich_t"; - break; - case 1: - p = "id_t"; - break; - case 2: - p = "userland const struct vm_domain_policy_entry *"; - break; - default: - break; - }; - break; /* fdatasync */ case 550: switch(ndx) { @@ -8728,6 +8702,56 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* cpuset_getdomain */ + case 561: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "id_t"; + break; + case 3: + p = "size_t"; + break; + case 4: + p = "userland domainset_t *"; + break; + case 5: + p = "userland int *"; + break; + default: + break; + }; + break; + /* cpuset_setdomain */ + case 562: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "id_t"; + break; + case 3: + p = "size_t"; + break; + case 4: + p = "userland domainset_t *"; + break; + case 5: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10549,16 +10573,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* numa_getaffinity */ - case 548: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* numa_setaffinity */ - case 549: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* fdatasync */ case 550: if (ndx == 0 || ndx == 1) @@ -10611,6 +10625,16 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kevent */ case 560: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* cpuset_getdomain */ + case 561: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* cpuset_setdomain */ + case 562: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/sys/syscall.h Fri Jan 12 23:06:35 2018 (r327897) @@ -465,8 +465,6 @@ #define SYS_ppoll 545 #define SYS_futimens 546 #define SYS_utimensat 547 -#define SYS_numa_getaffinity 548 -#define SYS_numa_setaffinity 549 #define SYS_fdatasync 550 #define SYS_fstat 551 #define SYS_fstatat 552 @@ -478,4 +476,6 @@ #define SYS_fhstatfs 558 #define SYS_mknodat 559 #define SYS_kevent 560 -#define SYS_MAXSYSCALL 561 +#define SYS_cpuset_getdomain 561 +#define SYS_cpuset_setdomain 562 +#define SYS_MAXSYSCALL 563 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/sys/syscall.mk Fri Jan 12 23:06:35 2018 (r327897) @@ -393,8 +393,6 @@ MIASM = \ ppoll.o \ futimens.o \ utimensat.o \ - numa_getaffinity.o \ - numa_setaffinity.o \ fdatasync.o \ fstat.o \ fstatat.o \ @@ -405,4 +403,6 @@ MIASM = \ getfsstat.o \ fhstatfs.o \ mknodat.o \ - kevent.o + kevent.o \ + cpuset_getdomain.o \ + cpuset_setdomain.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Fri Jan 12 22:57:57 2018 (r327896) +++ head/sys/sys/sysproto.h Fri Jan 12 23:06:35 2018 (r327897) @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1697,16 +1698,6 @@ struct utimensat_args { char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; -struct numa_getaffinity_args { - char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; - char policy_l_[PADL_(struct vm_domain_policy_entry *)]; struct vm_domain_policy_entry * policy; char policy_r_[PADR_(struct vm_domain_policy_entry *)]; -}; -struct numa_setaffinity_args { - char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; - char policy_l_[PADL_(const struct vm_domain_policy_entry *)]; const struct vm_domain_policy_entry * policy; char policy_r_[PADR_(const struct vm_domain_policy_entry *)]; -}; struct fdatasync_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; @@ -1761,6 +1752,22 @@ struct kevent_args { char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; }; +struct cpuset_getdomain_args { + char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; + char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; + char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; + char domainsetsize_l_[PADL_(size_t)]; size_t domainsetsize; char domainsetsize_r_[PADR_(size_t)]; + char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; + char policy_l_[PADL_(int *)]; int * policy; char policy_r_[PADR_(int *)]; +}; +struct cpuset_setdomain_args { + char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; + char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; + char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; + char domainsetsize_l_[PADL_(size_t)]; size_t domainsetsize; char domainsetsize_r_[PADR_(size_t)]; + char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; + char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2128,8 +2135,6 @@ int sys_procctl(struct thread *, struct procctl_args * int sys_ppoll(struct thread *, struct ppoll_args *); int sys_futimens(struct thread *, struct futimens_args *); int sys_utimensat(struct thread *, struct utimensat_args *); -int sys_numa_getaffinity(struct thread *, struct numa_getaffinity_args *); -int sys_numa_setaffinity(struct thread *, struct numa_setaffinity_args *); int sys_fdatasync(struct thread *, struct fdatasync_args *); int sys_fstat(struct thread *, struct fstat_args *); int sys_fstatat(struct thread *, struct fstatat_args *); @@ -2141,6 +2146,8 @@ int sys_getfsstat(struct thread *, struct getfsstat_ar int sys_fhstatfs(struct thread *, struct fhstatfs_args *); int sys_mknodat(struct thread *, struct mknodat_args *); int sys_kevent(struct thread *, struct kevent_args *); +int sys_cpuset_getdomain(struct thread *, struct cpuset_getdomain_args *); +int sys_cpuset_setdomain(struct thread *, struct cpuset_setdomain_args *); #ifdef COMPAT_43 @@ -3020,8 +3027,6 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_ppoll AUE_POLL #define SYS_AUE_futimens AUE_FUTIMES #define SYS_AUE_utimensat AUE_FUTIMESAT -#define SYS_AUE_numa_getaffinity AUE_NULL -#define SYS_AUE_numa_setaffinity AUE_NULL #define SYS_AUE_fdatasync AUE_FSYNC #define SYS_AUE_fstat AUE_FSTAT #define SYS_AUE_fstatat AUE_FSTATAT @@ -3033,6 +3038,8 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_fhstatfs AUE_FHSTATFS #define SYS_AUE_mknodat AUE_MKNODAT #define SYS_AUE_kevent AUE_KEVENT +#define SYS_AUE_cpuset_getdomain AUE_NULL +#define SYS_AUE_cpuset_setdomain AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-all@freebsd.org Fri Jan 12 23:12:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F57EA76B5; Fri, 12 Jan 2018 23:12:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E44B520D3; Fri, 12 Jan 2018 23:12:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49F7D24E2; Fri, 12 Jan 2018 23:12:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CNCV4S095200; Fri, 12 Jan 2018 23:12:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CNCVhA095198; Fri, 12 Jan 2018 23:12:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801122312.w0CNCVhA095198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 12 Jan 2018 23:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327898 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 327898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:12:32 -0000 Author: pfg Date: Fri Jan 12 23:12:30 2018 New Revision: 327898 URL: https://svnweb.freebsd.org/changeset/base/327898 Log: libalias: small memory allocation cleanups. Make the calloc wrappers behave as expected by using mallocarray. It is rather weird that the malloc wrappers also zeroes the memory: update a comment to reflect at least two cases where it is expected. Reviewed by: tuexen Modified: head/sys/netinet/libalias/alias_mod.h head/sys/netinet/libalias/alias_sctp.c Modified: head/sys/netinet/libalias/alias_mod.h ============================================================================== --- head/sys/netinet/libalias/alias_mod.h Fri Jan 12 23:06:35 2018 (r327897) +++ head/sys/netinet/libalias/alias_mod.h Fri Jan 12 23:12:30 2018 (r327898) @@ -42,7 +42,7 @@ MALLOC_DECLARE(M_ALIAS); /* Use kernel allocator. */ #if defined(_SYS_MALLOC_H_) #define malloc(x) malloc(x, M_ALIAS, M_NOWAIT|M_ZERO) -#define calloc(x, n) malloc(x*n) +#define calloc(n, x) mallocarray((n), (x), M_ALIAS, M_NOWAIT|M_ZERO) #define free(x) free(x, M_ALIAS) #endif #endif Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Fri Jan 12 23:06:35 2018 (r327897) +++ head/sys/netinet/libalias/alias_sctp.c Fri Jan 12 23:12:30 2018 (r327898) @@ -187,7 +187,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc((x) * (n)) +#define sn_calloc(n,x) mallocarray((n), (x), M_SCTPNAT, M_NOWAIT|M_ZERO) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ @@ -1104,7 +1104,7 @@ sctp_PktParser(struct libalias *la, int direction, str if (*passoc == NULL) {/* out of resources */ return (SN_PARSE_ERROR_AS_MALLOC); } - /* Initialise association - malloc initialises memory to zeros */ + /* Initialize association - sn_malloc initializes memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; @@ -1168,7 +1168,7 @@ sctp_PktParser(struct libalias *la, int direction, str if (*passoc == NULL) {/* out of resources */ return (SN_PARSE_ERROR_AS_MALLOC); } - /* Initialise association - malloc initialises memory to zeros */ + /* Initialize association - sn_malloc initializes memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; From owner-svn-src-all@freebsd.org Fri Jan 12 23:13:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0682EA7810; Fri, 12 Jan 2018 23:13:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2EF92261; Fri, 12 Jan 2018 23:13:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB5224E6; Fri, 12 Jan 2018 23:13:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CNDtRQ095293; Fri, 12 Jan 2018 23:13:55 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CNDtNS095287; Fri, 12 Jan 2018 23:13:55 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122313.w0CNDtNS095287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 23:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327899 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 327899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:13:57 -0000 Author: jeff Date: Fri Jan 12 23:13:55 2018 New Revision: 327899 URL: https://svnweb.freebsd.org/changeset/base/327899 Log: Implement NUMA policy for kmem_*(9). This maintains compatibility with reservations by giving each memory domain its own KVA space in vmem that is naturally aligned on superpage boundaries. Reviewed by: alc, markj, kib (some objections) Sponsored by: Netflix, Dell/EMC Isilon Tested by; pho Differential Revision: https://reviews.freebsd.org/D13289 Modified: head/sys/kern/subr_vmem.c head/sys/vm/vm_extern.h head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/kern/subr_vmem.c Fri Jan 12 23:13:55 2018 (r327899) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define VMEM_OPTORDER 5 @@ -186,6 +187,7 @@ static struct task vmem_periodic_wk; static struct mtx_padalign __exclusive_cache_line vmem_list_lock; static LIST_HEAD(, vmem) vmem_list = LIST_HEAD_INITIALIZER(vmem_list); +static uma_zone_t vmem_zone; /* ---- misc */ #define VMEM_CONDVAR_INIT(vm, wchan) cv_init(&vm->vm_cv, wchan) @@ -255,11 +257,11 @@ bt_fill(vmem_t *vm, int flags) VMEM_ASSERT_LOCKED(vm); /* - * Only allow the kernel arena to dip into reserve tags. It is the - * vmem where new tags come from. + * Only allow the kernel arena and arenas derived from kernel arena to + * dip into reserve tags. They are where new tags come from. */ flags &= BT_FLAGS; - if (vm != kernel_arena) + if (vm != kernel_arena && vm->vm_arg != kernel_arena) flags &= ~M_USE_RESERVE; /* @@ -615,23 +617,25 @@ static void * vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, int wait) { vmem_addr_t addr; + int domain; *pflag = UMA_SLAB_KERNEL; + domain = 0; /* XXX Temporary. */ /* * Single thread boundary tag allocation so that the address space * and memory are added in one atomic operation. */ mtx_lock(&vmem_bt_lock); - if (vmem_xalloc(kernel_arena, bytes, 0, 0, 0, VMEM_ADDR_MIN, - VMEM_ADDR_MAX, M_NOWAIT | M_NOVM | M_USE_RESERVE | M_BESTFIT, - &addr) == 0) { - if (kmem_back(kernel_object, addr, bytes, + if (vmem_xalloc(vm_dom[domain].vmd_kernel_arena, bytes, 0, 0, 0, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, + M_NOWAIT | M_NOVM | M_USE_RESERVE | M_BESTFIT, &addr) == 0) { + if (kmem_back_domain(domain, kernel_object, addr, bytes, M_NOWAIT | M_USE_RESERVE) == 0) { mtx_unlock(&vmem_bt_lock); return ((void *)addr); } - vmem_xfree(kernel_arena, addr, bytes); + vmem_xfree(vm_dom[domain].vmd_kernel_arena, addr, bytes); mtx_unlock(&vmem_bt_lock); /* * Out of memory, not address space. This may not even be @@ -657,9 +661,12 @@ vmem_startup(void) { mtx_init(&vmem_list_lock, "vmem list lock", NULL, MTX_DEF); + vmem_zone = uma_zcreate("vmem", + sizeof(struct vmem), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_VM); vmem_bt_zone = uma_zcreate("vmem btag", sizeof(struct vmem_btag), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_VM); + UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); #ifndef UMA_MD_SMALL_ALLOC mtx_init(&vmem_bt_lock, "btag lock", NULL, MTX_DEF); uma_prealloc(vmem_bt_zone, BT_MAXALLOC); @@ -826,7 +833,7 @@ vmem_destroy1(vmem_t *vm) VMEM_CONDVAR_DESTROY(vm); VMEM_LOCK_DESTROY(vm); - free(vm, M_VMEM); + uma_zfree(vmem_zone, vm); } static int @@ -1058,7 +1065,7 @@ vmem_create(const char *name, vmem_addr_t base, vmem_s vmem_t *vm; - vm = malloc(sizeof(*vm), M_VMEM, flags & (M_WAITOK|M_NOWAIT)); + vm = uma_zalloc(vmem_zone, flags & (M_WAITOK|M_NOWAIT)); if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/vm/vm_extern.h Fri Jan 12 23:13:55 2018 (r327899) @@ -56,14 +56,21 @@ void kmap_free_wakeup(vm_map_t, vm_offset_t, vm_size_t /* These operate on virtual addresses backed by memory. */ vm_offset_t kmem_alloc_attr(struct vmem *, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); +vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig(struct vmem *, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); +vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr); vm_offset_t kmem_malloc(struct vmem *, vm_size_t size, int flags); +vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags); void kmem_free(struct vmem *, vm_offset_t, vm_size_t); /* This provides memory for previously allocated address space. */ int kmem_back(vm_object_t, vm_offset_t, vm_size_t, int); +int kmem_back_domain(int, vm_object_t, vm_offset_t, vm_size_t, int); void kmem_unback(vm_object_t, vm_offset_t, vm_size_t); /* Bootstrapping. */ Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/vm/vm_init.c Fri Jan 12 23:13:55 2018 (r327899) @@ -81,16 +81,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include #include + +#if VM_NRESERVLEVEL > 0 +#define KVA_QUANTUM (1 << (VM_LEVEL_0_ORDER + PAGE_SHIFT)) +#else + /* On non-superpage architectures want large import sizes. */ +#define KVA_QUANTUM (PAGE_SIZE * 1024) +#endif long physmem; /* @@ -107,7 +116,10 @@ kva_import(void *unused, vmem_size_t size, int flags, { vm_offset_t addr; int result; - + + KASSERT((size % KVA_QUANTUM) == 0, + ("kva_import: Size %jd is not a multiple of %d", + (intmax_t)size, (int)KVA_QUANTUM)); addr = vm_map_min(kernel_map); result = vm_map_find(kernel_map, NULL, 0, &addr, size, 0, VMFS_SUPER_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); @@ -130,6 +142,7 @@ static void vm_mem_init(dummy) void *dummy; { + int domain; /* * Initializes resident memory structures. From here on, all physical @@ -150,13 +163,15 @@ vm_mem_init(dummy) * Initialize the kernel_arena. This can grow on demand. */ vmem_init(kernel_arena, "kernel arena", 0, 0, PAGE_SIZE, 0, 0); - vmem_set_import(kernel_arena, kva_import, NULL, NULL, -#if VM_NRESERVLEVEL > 0 - 1 << (VM_LEVEL_0_ORDER + PAGE_SHIFT)); -#else - /* On non-superpage architectures want large import sizes. */ - PAGE_SIZE * 1024); -#endif + vmem_set_import(kernel_arena, kva_import, NULL, NULL, KVA_QUANTUM); + + for (domain = 0; domain < vm_ndomains; domain++) { + vm_dom[domain].vmd_kernel_arena = vmem_create( + "kernel arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); + vmem_set_import(vm_dom[domain].vmd_kernel_arena, + (vmem_import_t *)vmem_alloc, NULL, kernel_arena, + KVA_QUANTUM); + } kmem_init_zero_region(); pmap_init(); Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/vm/vm_kern.c Fri Jan 12 23:13:55 2018 (r327899) @@ -67,9 +67,12 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include #include #include /* for ticks and hz */ +#include #include #include #include @@ -77,15 +80,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -161,17 +167,17 @@ kva_free(vm_offset_t addr, vm_size_t size) * given flags, then the pages are zeroed before they are mapped. */ vm_offset_t -kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flags, vm_paddr_t low, +kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) { + vmem_t *vmem; vm_object_t object = kernel_object; vm_offset_t addr, i, offset; vm_page_t m; int pflags, tries; - KASSERT(vmem == kernel_arena, - ("kmem_alloc_attr: Only kernel_arena is supported.")); size = round_page(size); + vmem = vm_dom[domain].vmd_kernel_arena; if (vmem_alloc(vmem, size, M_BESTFIT | flags, &addr)) return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; @@ -182,13 +188,13 @@ kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flag for (i = 0; i < size; i += PAGE_SIZE) { tries = 0; retry: - m = vm_page_alloc_contig(object, atop(offset + i), - pflags, 1, low, high, PAGE_SIZE, 0, memattr); + m = vm_page_alloc_contig_domain(object, atop(offset + i), + domain, pflags, 1, low, high, PAGE_SIZE, 0, memattr); if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - if (!vm_page_reclaim_contig(pflags, 1, - low, high, PAGE_SIZE, 0) && + if (!vm_page_reclaim_contig_domain(domain, + pflags, 1, low, high, PAGE_SIZE, 0) && (flags & M_WAITOK) != 0) VM_WAIT; VM_OBJECT_WLOCK(object); @@ -199,6 +205,9 @@ retry: vmem_free(vmem, addr, size); return (0); } + KASSERT(vm_phys_domidx(m) == domain, + ("kmem_alloc_attr_domain: Domain mismatch %d != %d", + vm_phys_domidx(m), domain)); if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; @@ -209,6 +218,28 @@ retry: return (addr); } +vm_offset_t +kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, vm_memattr_t memattr) +{ + struct vm_domainset_iter di; + vm_offset_t addr; + int domain; + + KASSERT(vmem == kernel_arena, + ("kmem_alloc_attr: Only kernel_arena is supported.")); + + vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + do { + addr = kmem_alloc_attr_domain(domain, size, flags, low, high, + memattr); + if (addr != 0) + break; + } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + + return (addr); +} + /* * Allocates a region from the kernel address map and physically * contiguous pages within the specified address range to the kernel @@ -218,19 +249,19 @@ retry: * mapped. */ vm_offset_t -kmem_alloc_contig(struct vmem *vmem, vm_size_t size, int flags, vm_paddr_t low, +kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { + vmem_t *vmem; vm_object_t object = kernel_object; vm_offset_t addr, offset, tmp; vm_page_t end_m, m; u_long npages; int pflags, tries; - KASSERT(vmem == kernel_arena, - ("kmem_alloc_contig: Only kernel_arena is supported.")); size = round_page(size); + vmem = vm_dom[domain].vmd_kernel_arena; if (vmem_alloc(vmem, size, flags | M_BESTFIT, &addr)) return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; @@ -241,13 +272,14 @@ kmem_alloc_contig(struct vmem *vmem, vm_size_t size, i VM_OBJECT_WLOCK(object); tries = 0; retry: - m = vm_page_alloc_contig(object, atop(offset), pflags, + m = vm_page_alloc_contig_domain(object, atop(offset), domain, pflags, npages, low, high, alignment, boundary, memattr); if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - if (!vm_page_reclaim_contig(pflags, npages, low, high, - alignment, boundary) && (flags & M_WAITOK) != 0) + if (!vm_page_reclaim_contig_domain(domain, pflags, + npages, low, high, alignment, boundary) && + (flags & M_WAITOK) != 0) VM_WAIT; VM_OBJECT_WLOCK(object); tries++; @@ -256,6 +288,9 @@ retry: vmem_free(vmem, addr, size); return (0); } + KASSERT(vm_phys_domidx(m) == domain, + ("kmem_alloc_contig_domain: Domain mismatch %d != %d", + vm_phys_domidx(m), domain)); end_m = m + npages; tmp = addr; for (; m < end_m; m++) { @@ -270,6 +305,29 @@ retry: return (addr); } +vm_offset_t +kmem_alloc_contig(struct vmem *vmem, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ + struct vm_domainset_iter di; + vm_offset_t addr; + int domain; + + KASSERT(vmem == kernel_arena, + ("kmem_alloc_contig: Only kernel_arena is supported.")); + + vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + do { + addr = kmem_alloc_contig_domain(domain, size, flags, low, high, + alignment, boundary, memattr); + if (addr != 0) + break; + } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + + return (addr); +} + /* * kmem_suballoc: * @@ -313,18 +371,18 @@ kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_of * Allocate wired-down pages in the kernel's address space. */ vm_offset_t -kmem_malloc(struct vmem *vmem, vm_size_t size, int flags) +kmem_malloc_domain(int domain, vm_size_t size, int flags) { + vmem_t *vmem; vm_offset_t addr; int rv; - KASSERT(vmem == kernel_arena, - ("kmem_malloc: Only kernel_arena is supported.")); + vmem = vm_dom[domain].vmd_kernel_arena; size = round_page(size); if (vmem_alloc(vmem, size, flags | M_BESTFIT, &addr)) return (0); - rv = kmem_back(kernel_object, addr, size, flags); + rv = kmem_back_domain(domain, kernel_object, addr, size, flags); if (rv != KERN_SUCCESS) { vmem_free(vmem, addr, size); return (0); @@ -332,20 +390,41 @@ kmem_malloc(struct vmem *vmem, vm_size_t size, int fla return (addr); } +vm_offset_t +kmem_malloc(struct vmem *vmem, vm_size_t size, int flags) +{ + struct vm_domainset_iter di; + vm_offset_t addr; + int domain; + + KASSERT(vmem == kernel_arena, + ("kmem_malloc: Only kernel_arena is supported.")); + + vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + do { + addr = kmem_malloc_domain(domain, size, flags); + if (addr != 0) + break; + } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + + return (addr); +} + /* * kmem_back: * * Allocate physical pages for the specified virtual address range. */ int -kmem_back(vm_object_t object, vm_offset_t addr, vm_size_t size, int flags) +kmem_back_domain(int domain, vm_object_t object, vm_offset_t addr, + vm_size_t size, int flags) { vm_offset_t offset, i; vm_page_t m, mpred; int pflags; KASSERT(object == kernel_object, - ("kmem_back: only supports kernel object.")); + ("kmem_back_domain: only supports kernel object.")); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; @@ -358,8 +437,8 @@ kmem_back(vm_object_t object, vm_offset_t addr, vm_siz retry: mpred = vm_radix_lookup_le(&object->rtree, atop(offset + i)); for (; i < size; i += PAGE_SIZE, mpred = m) { - m = vm_page_alloc_after(object, atop(offset + i), pflags, - mpred); + m = vm_page_alloc_domain_after(object, atop(offset + i), + domain, pflags, mpred); /* * Ran out of space, free everything up and return. Don't need @@ -373,6 +452,9 @@ retry: kmem_unback(object, addr, i); return (KERN_NO_SPACE); } + KASSERT(vm_phys_domidx(m) == domain, + ("kmem_back_domain: Domain mismatch %d != %d", + vm_phys_domidx(m), domain)); if (flags & M_ZERO && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); KASSERT((m->oflags & VPO_UNMANAGED) != 0, @@ -386,6 +468,26 @@ retry: return (KERN_SUCCESS); } +int +kmem_back(vm_object_t object, vm_offset_t addr, vm_size_t size, int flags) +{ + struct vm_domainset_iter di; + int domain; + int ret; + + KASSERT(object == kernel_object, + ("kmem_back: only supports kernel object.")); + + vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + do { + ret = kmem_back_domain(domain, object, addr, size, flags); + if (ret == KERN_SUCCESS) + break; + } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + + return (ret); +} + /* * kmem_unback: * @@ -395,28 +497,41 @@ retry: * A physical page must exist within the specified object at each index * that is being unmapped. */ -void -kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size) +static int +_kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size) { vm_page_t m, next; vm_offset_t end, offset; + int domain; KASSERT(object == kernel_object, ("kmem_unback: only supports kernel object.")); + if (size == 0) + return (0); pmap_remove(kernel_pmap, addr, addr + size); offset = addr - VM_MIN_KERNEL_ADDRESS; end = offset + size; VM_OBJECT_WLOCK(object); - for (m = vm_page_lookup(object, atop(offset)); offset < end; - offset += PAGE_SIZE, m = next) { + m = vm_page_lookup(object, atop(offset)); + domain = vm_phys_domidx(m); + for (; offset < end; offset += PAGE_SIZE, m = next) { next = vm_page_next(m); vm_page_unwire(m, PQ_NONE); vm_page_free(m); } VM_OBJECT_WUNLOCK(object); + + return (domain); } +void +kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size) +{ + + _kmem_unback(object, addr, size); +} + /* * kmem_free: * @@ -426,12 +541,13 @@ kmem_unback(vm_object_t object, vm_offset_t addr, vm_s void kmem_free(struct vmem *vmem, vm_offset_t addr, vm_size_t size) { + int domain; KASSERT(vmem == kernel_arena, ("kmem_free: Only kernel_arena is supported.")); size = round_page(size); - kmem_unback(kernel_object, addr, size); - vmem_free(vmem, addr, size); + domain = _kmem_unback(kernel_object, addr, size); + vmem_free(vm_dom[domain].vmd_kernel_arena, addr, size); } /* Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/vm/vm_phys.h Fri Jan 12 23:13:55 2018 (r327899) @@ -101,7 +101,6 @@ int vm_phys_mem_affinity(int f, int t); static inline int vm_phys_domidx(vm_page_t m) { -#ifdef VM_NUMA_ALLOC int domn, segind; /* XXXKIB try to assert that the page is managed */ @@ -110,9 +109,6 @@ vm_phys_domidx(vm_page_t m) domn = vm_phys_segs[segind].domain; KASSERT(domn < vm_ndomains, ("domain %d m %p", domn, m)); return (domn); -#else - return (0); -#endif } /* Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Fri Jan 12 23:12:30 2018 (r327898) +++ head/sys/vm/vm_reserv.c Fri Jan 12 23:13:55 2018 (r327899) @@ -549,6 +549,8 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t VM_LEVEL_0_SIZE), boundary > VM_LEVEL_0_SIZE ? boundary : 0); if (m == NULL) return (NULL); + KASSERT(vm_phys_domidx(m) == domain, + ("vm_reserv_alloc_contig: Page domain does not match requested.")); /* * The allocated physical pages always begin at a reservation @@ -568,7 +570,7 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t LIST_INSERT_HEAD(&object->rvq, rv, objq); rv->object = object; rv->pindex = first; - rv->domain = vm_phys_domidx(m); + rv->domain = domain; KASSERT(rv->popcnt == 0, ("vm_reserv_alloc_contig: reserv %p's popcnt is corrupted", rv)); @@ -715,7 +717,7 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t p LIST_INSERT_HEAD(&object->rvq, rv, objq); rv->object = object; rv->pindex = first; - rv->domain = vm_phys_domidx(m); + rv->domain = domain; KASSERT(rv->popcnt == 0, ("vm_reserv_alloc_page: reserv %p's popcnt is corrupted", rv)); KASSERT(!rv->inpartpopq, @@ -734,6 +736,8 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t p found: index = VM_RESERV_INDEX(object, pindex); m = &rv->pages[index]; + KASSERT(object != kernel_object || vm_phys_domidx(m) == domain, + ("vm_reserv_alloc_page: Domain mismatch from reservation.")); /* Handle vm_page_rename(m, new_object, ...). */ if (popmap_is_set(rv->popmap, index)) return (NULL); From owner-svn-src-all@freebsd.org Fri Jan 12 23:25:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947E6EB211C; Fri, 12 Jan 2018 23:25:08 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C49429A2; Fri, 12 Jan 2018 23:25:08 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 991802691; Fri, 12 Jan 2018 23:25:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CNP7Zx099580; Fri, 12 Jan 2018 23:25:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CNP5QY099559; Fri, 12 Jan 2018 23:25:05 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122325.w0CNP5QY099559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 23:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327900 - in head: lib/libmemstat sys/amd64/amd64 sys/arm64/arm64 sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys sy... X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head: lib/libmemstat sys/amd64/amd64 sys/arm64/arm64 sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys sys/vm X-SVN-Commit-Revision: 327900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:25:08 -0000 Author: jeff Date: Fri Jan 12 23:25:05 2018 New Revision: 327900 URL: https://svnweb.freebsd.org/changeset/base/327900 Log: Implement NUMA support in uma(9) and malloc(9). Allocations from specific domains can be done by the _domain() API variants. UMA also supports a first-touch policy via the NUMA zone flag. The slab layer is now segregated by VM domains and is precise. It handles iteration for round-robin directly. The per-cpu cache layer remains a mix of domains according to where memory is allocated and freed. Well behaved clients can achieve perfect locality with no performance penalty. The direct domain allocation functions have to visit the slab layer and so require per-zone locks which come at some expense. Reviewed by: Attilio (a slightly older version) Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Modified: head/lib/libmemstat/memstat_uma.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm64/arm64/uma_machdep.c head/sys/i386/i386/pmap.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_busdma_bufalloc.c head/sys/kern/subr_vmem.c head/sys/kern/vfs_bio.c head/sys/mips/mips/uma_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/slb.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/riscv/riscv/uma_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/malloc.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/lib/libmemstat/memstat_uma.c Fri Jan 12 23:25:05 2018 (r327900) @@ -55,6 +55,8 @@ static struct nlist namelist[] = { { .n_name = "_mp_maxid" }, #define X_ALL_CPUS 2 { .n_name = "_all_cpus" }, +#define X_VM_NDOMAINS 3 + { .n_name = "_vm_ndomains" }, { .n_name = "" }, }; @@ -297,11 +299,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *k { LIST_HEAD(, uma_keg) uma_kegs; struct memory_type *mtp; + struct uma_zone_domain uzd; struct uma_bucket *ubp, ub; struct uma_cache *ucp, *ucp_array; struct uma_zone *uzp, uz; struct uma_keg *kzp, kz; - int hint_dontsearch, i, mp_maxid, ret; + int hint_dontsearch, i, mp_maxid, ndomains, ret; char name[MEMTYPE_MAXNAME]; cpuset_t all_cpus; long cpusetsize; @@ -323,6 +326,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *k list->mtl_error = ret; return (-1); } + ret = kread_symbol(kvm, X_VM_NDOMAINS, &ndomains, + sizeof(ndomains), 0); + if (ret != 0) { + list->mtl_error = ret; + return (-1); + } ret = kread_symbol(kvm, X_UMA_KEGS, &uma_kegs, sizeof(uma_kegs), 0); if (ret != 0) { list->mtl_error = ret; @@ -447,10 +456,17 @@ skip_percpu: kz.uk_ipers; mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size; mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; - for (ubp = LIST_FIRST(&uz.uz_buckets); ubp != - NULL; ubp = LIST_NEXT(&ub, ub_link)) { - ret = kread(kvm, ubp, &ub, sizeof(ub), 0); - mtp->mt_zonefree += ub.ub_cnt; + for (i = 0; i < ndomains; i++) { + ret = kread(kvm, &uz.uz_domain[i], &uzd, + sizeof(uzd), 0); + for (ubp = + LIST_FIRST(&uzd.uzd_buckets); + ubp != NULL; + ubp = LIST_NEXT(&ub, ub_link)) { + ret = kread(kvm, ubp, &ub, + sizeof(ub), 0); + mtp->mt_zonefree += ub.ub_cnt; + } } if (!((kz.uk_flags & UMA_ZONE_SECONDARY) && LIST_FIRST(&kz.uk_zones) != uzp)) { Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/amd64/amd64/uma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -44,14 +44,15 @@ __FBSDID("$FreeBSD$"); #include void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { vm_page_t m; vm_paddr_t pa; void *va; *flags = UMA_SLAB_PRIV; - m = vm_page_alloc(NULL, 0, + m = vm_page_alloc_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) return (NULL); Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/arm64/arm64/uma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -42,14 +42,15 @@ __FBSDID("$FreeBSD$"); #include void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { vm_page_t m; vm_paddr_t pa; void *va; *flags = UMA_SLAB_PRIV; - m = vm_page_alloc(NULL, 0, + m = vm_page_alloc_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) return (NULL); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/i386/i386/pmap.c Fri Jan 12 23:25:05 2018 (r327900) @@ -338,8 +338,8 @@ static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offs static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, struct spglist *); #if defined(PAE) || defined(PAE_TABLES) -static void *pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, - int wait); +static void *pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int domain, + uint8_t *flags, int wait); #endif static void pmap_set_pg(void); @@ -697,12 +697,13 @@ pmap_page_init(vm_page_t m) #if defined(PAE) || defined(PAE_TABLES) static void * -pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, int wait) +pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags, + int wait) { /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig(kernel_arena, bytes, wait, 0x0ULL, + return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, 0x0ULL, 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); } #endif Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/kern/kern_malloc.c Fri Jan 12 23:25:05 2018 (r327900) @@ -96,6 +96,11 @@ __FBSDID("$FreeBSD$"); dtrace_malloc_probe_func_t dtrace_malloc_probe; #endif +#if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ + defined(DEBUG_MEMGUARD) || defined(DEBUG_REDZONE) +#define MALLOC_DEBUG 1 +#endif + /* * When realloc() is called, if the new size is sufficiently smaller than * the old size, realloc() will allocate a new, smaller block to avoid @@ -417,6 +422,20 @@ contigmalloc(unsigned long size, struct malloc_type *t return (ret); } +void * +contigmalloc_domain(unsigned long size, struct malloc_type *type, + int domain, int flags, vm_paddr_t low, vm_paddr_t high, + unsigned long alignment, vm_paddr_t boundary) +{ + void *ret; + + ret = (void *)kmem_alloc_contig_domain(domain, size, flags, low, high, + alignment, boundary, VM_MEMATTR_DEFAULT); + if (ret != NULL) + malloc_type_allocated(type, round_page(size)); + return (ret); +} + /* * contigfree: * @@ -432,26 +451,14 @@ contigfree(void *addr, unsigned long size, struct mall malloc_type_freed(type, round_page(size)); } -/* - * malloc: - * - * Allocate a block of memory. - * - * If M_NOWAIT is set, this routine will not block and return NULL if - * the allocation fails. - */ -void * -malloc(unsigned long size, struct malloc_type *mtp, int flags) +#ifdef MALLOC_DEBUG +static int +malloc_dbg(caddr_t *vap, unsigned long *sizep, struct malloc_type *mtp, + int flags) { +#ifdef INVARIANTS int indx; - struct malloc_type_internal *mtip; - caddr_t va; - uma_zone_t zone; -#if defined(DIAGNOSTIC) || defined(DEBUG_REDZONE) - unsigned long osize = size; -#endif -#ifdef INVARIANTS KASSERT(mtp->ks_magic == M_MAGIC, ("malloc: bad malloc type magic")); /* * Check that exactly one of M_WAITOK or M_NOWAIT is specified. @@ -474,7 +481,8 @@ malloc(unsigned long size, struct malloc_type *mtp, in if ((malloc_nowait_count % malloc_failure_rate) == 0) { atomic_add_int(&malloc_failure_count, 1); t_malloc_fail = time_uptime; - return (NULL); + *vap = NULL; + return (EJUSTRETURN); } } #endif @@ -485,18 +493,46 @@ malloc(unsigned long size, struct malloc_type *mtp, in ("malloc: called with spinlock or critical section held")); #ifdef DEBUG_MEMGUARD - if (memguard_cmp_mtp(mtp, size)) { - va = memguard_alloc(size, flags); - if (va != NULL) - return (va); + if (memguard_cmp_mtp(mtp, *sizep)) { + *vap = memguard_alloc(*sizep, flags); + if (*vap != NULL) + return (EJUSTRETURN); /* This is unfortunate but should not be fatal. */ } #endif #ifdef DEBUG_REDZONE - size = redzone_size_ntor(size); + *sizep = redzone_size_ntor(*sizep); #endif + return (0); +} +#endif + +/* + * malloc: + * + * Allocate a block of memory. + * + * If M_NOWAIT is set, this routine will not block and return NULL if + * the allocation fails. + */ +void * +malloc(unsigned long size, struct malloc_type *mtp, int flags) +{ + int indx; + struct malloc_type_internal *mtip; + caddr_t va; + uma_zone_t zone; +#if defined(DEBUG_REDZONE) + unsigned long osize = size; +#endif + +#ifdef MALLOC_DEBUG + if (malloc_dbg(&va, &size, mtp, flags) != 0) + return (va); +#endif + if (size <= kmem_zmax) { mtip = mtp->ks_handle; if (size & KMEM_ZMASK) @@ -523,11 +559,55 @@ malloc(unsigned long size, struct malloc_type *mtp, in KASSERT(va != NULL, ("malloc(M_WAITOK) returned NULL")); else if (va == NULL) t_malloc_fail = time_uptime; -#ifdef DIAGNOSTIC - if (va != NULL && !(flags & M_ZERO)) { - memset(va, 0x70, osize); - } +#ifdef DEBUG_REDZONE + if (va != NULL) + va = redzone_setup(va, osize); #endif + return ((void *) va); +} + +void * +malloc_domain(unsigned long size, struct malloc_type *mtp, int domain, + int flags) +{ + int indx; + struct malloc_type_internal *mtip; + caddr_t va; + uma_zone_t zone; +#if defined(DEBUG_REDZONE) + unsigned long osize = size; +#endif + +#ifdef MALLOC_DEBUG + if (malloc_dbg(&va, &size, mtp, flags) != 0) + return (va); +#endif + if (size <= kmem_zmax) { + mtip = mtp->ks_handle; + if (size & KMEM_ZMASK) + size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; + indx = kmemsize[size >> KMEM_ZSHIFT]; + KASSERT(mtip->mti_zone < numzones, + ("mti_zone %u out of range %d", + mtip->mti_zone, numzones)); + zone = kmemzones[indx].kz_zone[mtip->mti_zone]; +#ifdef MALLOC_PROFILE + krequests[size >> KMEM_ZSHIFT]++; +#endif + va = uma_zalloc_domain(zone, NULL, domain, flags); + if (va != NULL) + size = zone->uz_size; + malloc_type_zone_allocated(mtp, va == NULL ? 0 : size, indx); + } else { + size = roundup(size, PAGE_SIZE); + zone = NULL; + va = uma_large_malloc_domain(size, domain, flags); + malloc_type_allocated(mtp, va == NULL ? 0 : size); + } + if (flags & M_WAITOK) + KASSERT(va != NULL, ("malloc(M_WAITOK) returned NULL")); + else if (va == NULL) + t_malloc_fail = time_uptime; #ifdef DEBUG_REDZONE if (va != NULL) va = redzone_setup(va, osize); @@ -545,66 +625,124 @@ mallocarray(size_t nmemb, size_t size, struct malloc_t return (malloc(size * nmemb, type, flags)); } -/* - * free: - * - * Free a block of memory allocated by malloc. - * - * This routine may not block. - */ -void -free(void *addr, struct malloc_type *mtp) +#ifdef INVARIANTS +static void +free_save_type(void *addr, struct malloc_type *mtp, u_long size) { - uma_slab_t slab; - u_long size; + struct malloc_type **mtpp = addr; + /* + * Cache a pointer to the malloc_type that most recently freed + * this memory here. This way we know who is most likely to + * have stepped on it later. + * + * This code assumes that size is a multiple of 8 bytes for + * 64 bit machines + */ + mtpp = (struct malloc_type **) ((unsigned long)mtpp & ~UMA_ALIGN_PTR); + mtpp += (size - sizeof(struct malloc_type *)) / + sizeof(struct malloc_type *); + *mtpp = mtp; +} +#endif + +#ifdef MALLOC_DEBUG +static int +free_dbg(void **addrp, struct malloc_type *mtp) +{ + void *addr; + + addr = *addrp; KASSERT(mtp->ks_magic == M_MAGIC, ("free: bad malloc type magic")); KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("free: called with spinlock or critical section held")); /* free(NULL, ...) does nothing */ if (addr == NULL) - return; + return (EJUSTRETURN); #ifdef DEBUG_MEMGUARD if (is_memguard_addr(addr)) { memguard_free(addr); - return; + return (EJUSTRETURN); } #endif #ifdef DEBUG_REDZONE redzone_check(addr); - addr = redzone_addr_ntor(addr); + *addrp = redzone_addr_ntor(addr); #endif - slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + return (0); +} +#endif +/* + * free: + * + * Free a block of memory allocated by malloc. + * + * This routine may not block. + */ +void +free(void *addr, struct malloc_type *mtp) +{ + uma_slab_t slab; + u_long size; + +#ifdef MALLOC_DEBUG + if (free_dbg(&addr, mtp) != 0) + return; +#endif + /* free(NULL, ...) does nothing */ + if (addr == NULL) + return; + + slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); if (slab == NULL) panic("free: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); if (!(slab->us_flags & UMA_SLAB_MALLOC)) { + size = slab->us_keg->uk_size; #ifdef INVARIANTS - struct malloc_type **mtpp = addr; + free_save_type(addr, mtp, size); #endif + uma_zfree_arg(LIST_FIRST(&slab->us_keg->uk_zones), addr, slab); + } else { + size = slab->us_size; + uma_large_free(slab); + } + malloc_type_freed(mtp, size); +} + +void +free_domain(void *addr, struct malloc_type *mtp) +{ + uma_slab_t slab; + u_long size; + +#ifdef MALLOC_DEBUG + if (free_dbg(&addr, mtp) != 0) + return; +#endif + + /* free(NULL, ...) does nothing */ + if (addr == NULL) + return; + + slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + if (slab == NULL) + panic("free_domain: address %p(%p) has not been allocated.\n", + addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + + if (!(slab->us_flags & UMA_SLAB_MALLOC)) { size = slab->us_keg->uk_size; #ifdef INVARIANTS - /* - * Cache a pointer to the malloc_type that most recently freed - * this memory here. This way we know who is most likely to - * have stepped on it later. - * - * This code assumes that size is a multiple of 8 bytes for - * 64 bit machines - */ - mtpp = (struct malloc_type **) - ((unsigned long)mtpp & ~UMA_ALIGN_PTR); - mtpp += (size - sizeof(struct malloc_type *)) / - sizeof(struct malloc_type *); - *mtpp = mtp; + free_save_type(addr, mtp, size); #endif - uma_zfree_arg(LIST_FIRST(&slab->us_keg->uk_zones), addr, slab); + uma_zfree_domain(LIST_FIRST(&slab->us_keg->uk_zones), + addr, slab); } else { size = slab->us_size; uma_large_free(slab); Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/kern/kern_mbuf.c Fri Jan 12 23:25:05 2018 (r327900) @@ -283,7 +283,7 @@ static void mb_dtor_pack(void *, int, void *); static int mb_zinit_pack(void *, int, int); static void mb_zfini_pack(void *, int); static void mb_reclaim(uma_zone_t, int); -static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t, uint8_t *, int); +static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); /* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); @@ -386,12 +386,13 @@ SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, * pages. */ static void * -mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, int wait) +mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags, + int wait) { /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig(kernel_arena, bytes, wait, + return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); } Modified: head/sys/kern/subr_busdma_bufalloc.c ============================================================================== --- head/sys/kern/subr_busdma_bufalloc.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/kern/subr_busdma_bufalloc.c Fri Jan 12 23:25:05 2018 (r327900) @@ -149,7 +149,7 @@ busdma_bufalloc_findzone(busdma_bufalloc_t ba, bus_siz } void * -busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, +busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, int domain, uint8_t *pflag, int wait) { #ifdef VM_MEMATTR_UNCACHEABLE @@ -157,7 +157,7 @@ busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_ /* Inform UMA that this allocator uses kernel_arena/object. */ *pflag = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_attr(kernel_arena, size, wait, 0, + return ((void *)kmem_alloc_attr_domain(domain, size, wait, 0, BUS_SPACE_MAXADDR, VM_MEMATTR_UNCACHEABLE)); #else Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/kern/subr_vmem.c Fri Jan 12 23:25:05 2018 (r327900) @@ -500,7 +500,7 @@ bt_insfree(vmem_t *vm, bt_t *bt) * Import from the arena into the quantum cache in UMA. */ static int -qc_import(void *arg, void **store, int cnt, int flags) +qc_import(void *arg, void **store, int cnt, int domain, int flags) { qcache_t *qc; vmem_addr_t addr; @@ -614,13 +614,12 @@ static struct mtx_padalign __exclusive_cache_line vmem * we are really out of KVA. */ static void * -vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, int wait) +vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, + int wait) { vmem_addr_t addr; - int domain; *pflag = UMA_SLAB_KERNEL; - domain = 0; /* XXX Temporary. */ /* * Single thread boundary tag allocation so that the address space Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/kern/vfs_bio.c Fri Jan 12 23:25:05 2018 (r327900) @@ -133,7 +133,7 @@ static __inline void bd_wakeup(void); static int sysctl_runningspace(SYSCTL_HANDLER_ARGS); static void bufkva_reclaim(vmem_t *, int); static void bufkva_free(struct buf *); -static int buf_import(void *, void **, int, int); +static int buf_import(void *, void **, int, int, int); static void buf_release(void *, void **, int); static void maxbcachebuf_adjust(void); @@ -1419,7 +1419,7 @@ buf_free(struct buf *bp) * only as a per-cpu cache of bufs still maintained on a global list. */ static int -buf_import(void *arg, void **store, int cnt, int flags) +buf_import(void *arg, void **store, int cnt, int domain, int flags) { struct buf *bp; int i; Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/mips/mips/uma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -44,7 +44,8 @@ __FBSDID("$FreeBSD$"); #include void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { vm_paddr_t pa; vm_page_t m; @@ -59,7 +60,8 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in #endif for (;;) { - m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags); + m = vm_page_alloc_freelist_domain(domain, VM_FREELIST_DIRECT, + pflags); #ifndef __mips_n64 if (m == NULL && vm_page_reclaim_contig(pflags, 1, 0, MIPS_KSEG0_LARGEST_PHYS, PAGE_SIZE, 0)) Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Jan 12 23:25:05 2018 (r327900) @@ -1504,8 +1504,8 @@ retry: static mmu_t installed_mmu; static void * -moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *flags, - int wait) +moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, + uint8_t *flags, int wait) { struct pvo_entry *pvo; vm_offset_t va; @@ -1522,7 +1522,7 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes *flags = UMA_SLAB_PRIV; needed_lock = !PMAP_LOCKED(kernel_pmap); - m = vm_page_alloc(NULL, 0, + m = vm_page_alloc_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); if (m == NULL) return (NULL); Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/powerpc/aim/slb.c Fri Jan 12 23:25:05 2018 (r327900) @@ -480,7 +480,8 @@ slb_insert_user(pmap_t pm, struct slb *slb) } static void * -slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, int domain, + u_int8_t *flags, int wait) { static vm_offset_t realmax = 0; void *va; @@ -490,7 +491,7 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, u realmax = platform_real_maxaddr(); *flags = UMA_SLAB_PRIV; - m = vm_page_alloc_contig(NULL, 0, + m = vm_page_alloc_contig_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, 1, 0, realmax, PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); if (m == NULL) Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/powerpc/powerpc/uma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -51,7 +51,8 @@ SYSCTL_INT(_hw, OID_AUTO, uma_mdpages, CTLFLAG_RD, &hw "UMA MD pages in use"); void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { void *va; vm_paddr_t pa; @@ -59,7 +60,7 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in *flags = UMA_SLAB_PRIV; - m = vm_page_alloc(NULL, 0, + m = vm_page_alloc_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); if (m == NULL) return (NULL); Modified: head/sys/riscv/riscv/uma_machdep.c ============================================================================== --- head/sys/riscv/riscv/uma_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/riscv/riscv/uma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { panic("uma_small_alloc"); Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/sparc64/sparc64/vm_machdep.c Fri Jan 12 23:25:05 2018 (r327900) @@ -392,7 +392,8 @@ swi_vm(void *v) } void * -uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, + int wait) { vm_paddr_t pa; vm_page_t m; @@ -402,7 +403,7 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in *flags = UMA_SLAB_PRIV; - m = vm_page_alloc(NULL, 0, + m = vm_page_alloc_domain(NULL, 0, domain, malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); if (m == NULL) return (NULL); Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/sys/malloc.h Fri Jan 12 23:25:05 2018 (r327900) @@ -175,8 +175,16 @@ void *contigmalloc(unsigned long size, struct malloc_t vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); +void *contigmalloc_domain(unsigned long size, struct malloc_type *type, + int domain, int flags, vm_paddr_t low, vm_paddr_t high, + unsigned long alignment, vm_paddr_t boundary) + __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); +void free_domain(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags) + __malloc_like __result_use_check __alloc_size(1); +void *malloc_domain(unsigned long size, struct malloc_type *type, + int domain, int flags) __malloc_like __result_use_check __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/vm/uma.h Fri Jan 12 23:25:05 2018 (r327900) @@ -128,7 +128,8 @@ typedef void (*uma_fini)(void *mem, int size); /* * Import new memory into a cache zone. */ -typedef int (*uma_import)(void *arg, void **store, int count, int flags); +typedef int (*uma_import)(void *arg, void **store, int count, int domain, + int flags); /* * Free memory from a cache zone. @@ -281,6 +282,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * Allocates mp_maxid + 1 slabs sized to * sizeof(struct pcpu). */ +#define UMA_ZONE_NUMA 0x10000 /* + * NUMA aware Zone. Implements a best + * effort first-touch policy. + */ /* * These flags are shared between the keg and zone. In zones wishing to add @@ -326,6 +331,19 @@ void uma_zdestroy(uma_zone_t zone); void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); /* + * Allocate an item from a specific NUMA domain. This uses a slow path in + * the allocator but is guaranteed to allocate memory from the requested + * domain if M_WAITOK is set. + * + * Arguments: + * zone The zone we are allocating from + * arg This data is passed to the ctor function + * domain The domain to allocate from. + * flags See sys/malloc.h for available flags. + */ +void *uma_zalloc_domain(uma_zone_t zone, void *arg, int domain, int flags); + +/* * Allocates an item out of a zone without supplying an argument * * This is just a wrapper for uma_zalloc_arg for convenience. @@ -354,6 +372,16 @@ uma_zalloc(uma_zone_t zone, int flags) void uma_zfree_arg(uma_zone_t zone, void *item, void *arg); /* + * Frees an item back to the specified zone's domain specific pool. + * + * Arguments: + * zone The zone the item was originally allocated out of. + * item The memory to be freed. + * arg Argument passed to the destructor + */ +void uma_zfree_domain(uma_zone_t zone, void *item, void *arg); + +/* * Frees an item back to a zone without supplying an argument * * This is just a wrapper for uma_zfree_arg for convenience. @@ -373,25 +401,21 @@ uma_zfree(uma_zone_t zone, void *item) void uma_zwait(uma_zone_t zone); /* - * XXX The rest of the prototypes in this header are h0h0 magic for the VM. - * If you think you need to use it for a normal zone you're probably incorrect. - */ - -/* * Backend page supplier routines * * Arguments: * zone The zone that is requesting pages. * size The number of bytes being requested. * pflag Flags for these memory pages, see below. + * domain The NUMA domain that we prefer for this allocation. * wait Indicates our willingness to block. * * Returns: * A pointer to the allocated memory or NULL on failure. */ -typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t size, uint8_t *pflag, - int wait); +typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t size, int domain, + uint8_t *pflag, int wait); /* * Backend page free routines @@ -405,8 +429,6 @@ typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t * None */ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); - - /* * Sets up the uma allocator. (Called by vm_mem_init) Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jan 12 23:13:55 2018 (r327899) +++ head/sys/vm/uma_core.c Fri Jan 12 23:25:05 2018 (r327900) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -97,17 +98,12 @@ __FBSDID("$FreeBSD$"); #endif /* - * This is the zone and keg from which all zones are spawned. The idea is that - * even the zone & keg heads are allocated from the allocator, so we use the - * bss section to bootstrap us. + * This is the zone and keg from which all zones are spawned. */ -static struct uma_keg masterkeg; -static struct uma_zone masterzone_k; -static struct uma_zone masterzone_z; -static uma_zone_t kegs = &masterzone_k; -static uma_zone_t zones = &masterzone_z; +static uma_zone_t kegs; +static uma_zone_t zones; -/* This is the zone from which all of uma_slab_t's are allocated. */ +/* This is the zone from which all offpage uma_slab_ts are allocated. */ static uma_zone_t slabzone; /* @@ -226,13 +222,15 @@ struct uma_bucket_zone bucket_zones[] = { */ enum zfreeskip { SKIP_NONE = 0, SKIP_DTOR, SKIP_FINI }; +#define UMA_ANYDOMAIN -1 /* Special value for domain search. */ + /* Prototypes.. */ -static void *noobj_alloc(uma_zone_t, vm_size_t, uint8_t *, int); -static void *page_alloc(uma_zone_t, vm_size_t, uint8_t *, int); -static void *startup_alloc(uma_zone_t, vm_size_t, uint8_t *, int); +static void *noobj_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); +static void *page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); +static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void page_free(void *, vm_size_t, uint8_t); -static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int); +static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); static void bucket_cache_drain(uma_zone_t zone); @@ -250,23 +248,23 @@ static int hash_expand(struct uma_hash *, struct uma_h static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); static void uma_startup3(void); -static void *zone_alloc_item(uma_zone_t, void *, int); +static void *zone_alloc_item(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); static void bucket_enable(void); static void bucket_init(void); static uma_bucket_t bucket_alloc(uma_zone_t zone, void *, int); static void bucket_free(uma_zone_t zone, uma_bucket_t, void *); static void bucket_zone_drain(void); -static uma_bucket_t zone_alloc_bucket(uma_zone_t zone, void *, int flags); -static uma_slab_t zone_fetch_slab(uma_zone_t zone, uma_keg_t last, int flags); -static uma_slab_t zone_fetch_slab_multi(uma_zone_t zone, uma_keg_t last, int flags); +static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int); +static uma_slab_t zone_fetch_slab(uma_zone_t, uma_keg_t, int, int); +static uma_slab_t zone_fetch_slab_multi(uma_zone_t, uma_keg_t, int, int); static void *slab_alloc_item(uma_keg_t keg, uma_slab_t slab); static void slab_free_item(uma_keg_t keg, uma_slab_t slab, void *item); static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags); -static int zone_import(uma_zone_t zone, void **bucket, int max, int flags); -static void zone_release(uma_zone_t zone, void **bucket, int cnt); -static void uma_zero_item(void *item, uma_zone_t zone); +static int zone_import(uma_zone_t, void **, int, int, int); +static void zone_release(uma_zone_t, void **, int); +static void uma_zero_item(void *, uma_zone_t); void uma_print_zone(uma_zone_t); void uma_print_stats(void); @@ -332,7 +330,7 @@ bucket_init(void) size += sizeof(void *) * ubz->ubz_entries; ubz->ubz_zone = uma_zcreate(ubz->ubz_name, size, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET); + UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET | UMA_ZONE_NUMA); } } @@ -570,7 +568,7 @@ hash_alloc(struct uma_hash *hash) } else { alloc = sizeof(hash->uh_slab_hash[0]) * UMA_HASH_SIZE_INIT; hash->uh_slab_hash = zone_alloc_item(hashzone, NULL, - M_WAITOK); + UMA_ANYDOMAIN, M_WAITOK); hash->uh_hashsize = UMA_HASH_SIZE_INIT; } if (hash->uh_slab_hash) { @@ -736,6 +734,7 @@ cache_drain_safe_cpu(uma_zone_t zone) { uma_cache_t cache; uma_bucket_t b1, b2; + int domain; if (zone->uz_flags & UMA_ZFLAG_INTERNAL) return; @@ -743,10 +742,14 @@ cache_drain_safe_cpu(uma_zone_t zone) b1 = b2 = NULL; ZONE_LOCK(zone); critical_enter(); + if (zone->uz_flags & UMA_ZONE_NUMA) + domain = PCPU_GET(domain); + else + domain = 0; cache = &zone->uz_cpu[curcpu]; if (cache->uc_allocbucket) { if (cache->uc_allocbucket->ub_cnt != 0) - LIST_INSERT_HEAD(&zone->uz_buckets, + LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets, cache->uc_allocbucket, ub_link); else b1 = cache->uc_allocbucket; @@ -754,7 +757,7 @@ cache_drain_safe_cpu(uma_zone_t zone) } if (cache->uc_freebucket) { if (cache->uc_freebucket->ub_cnt != 0) - LIST_INSERT_HEAD(&zone->uz_buckets, + LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets, cache->uc_freebucket, ub_link); else b2 = cache->uc_freebucket; @@ -809,18 +812,22 @@ cache_drain_safe(uma_zone_t zone) static void bucket_cache_drain(uma_zone_t zone) { + uma_zone_domain_t zdom; uma_bucket_t bucket; + int i; /* - * Drain the bucket queues and free the buckets, we just keep two per - * cpu (alloc/free). + * Drain the bucket queues and free the buckets. */ - while ((bucket = LIST_FIRST(&zone->uz_buckets)) != NULL) { - LIST_REMOVE(bucket, ub_link); - ZONE_UNLOCK(zone); - bucket_drain(zone, bucket); - bucket_free(zone, bucket, NULL); - ZONE_LOCK(zone); + for (i = 0; i < vm_ndomains; i++) { + zdom = &zone->uz_domain[i]; + while ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) { + LIST_REMOVE(bucket, ub_link); + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, NULL); + ZONE_LOCK(zone); + } } /* @@ -865,7 +872,9 @@ static void keg_drain(uma_keg_t keg) { struct slabhead freeslabs = { 0 }; + uma_domain_t dom; uma_slab_t slab, tmp; + int i; /* * We don't want to take pages from statically allocated kegs at this @@ -880,20 +889,25 @@ keg_drain(uma_keg_t keg) if (keg->uk_free == 0) goto finished; - LIST_FOREACH_SAFE(slab, &keg->uk_free_slab, us_link, tmp) { - /* We have nowhere to free these to. */ - if (slab->us_flags & UMA_SLAB_BOOT) - continue; + for (i = 0; i < vm_ndomains; i++) { + dom = &keg->uk_domain[i]; + LIST_FOREACH_SAFE(slab, &dom->ud_free_slab, us_link, tmp) { + /* We have nowhere to free these to. */ + if (slab->us_flags & UMA_SLAB_BOOT) + continue; - LIST_REMOVE(slab, us_link); - keg->uk_pages -= keg->uk_ppera; - keg->uk_free -= keg->uk_ipers; + LIST_REMOVE(slab, us_link); + keg->uk_pages -= keg->uk_ppera; + keg->uk_free -= keg->uk_ipers; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 12 23:34:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B76EB279A; Fri, 12 Jan 2018 23:34:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F5DB2F68; Fri, 12 Jan 2018 23:34:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 989AA283E; Fri, 12 Jan 2018 23:34:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CNYHkT003902; Fri, 12 Jan 2018 23:34:17 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CNYGBD003889; Fri, 12 Jan 2018 23:34:16 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122334.w0CNYGBD003889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 23:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327901 - in head/sys: arm/arm arm64/arm64 dev/acpica mips/mips powerpc/powerpc sys vm x86/include x86/iommu x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 dev/acpica mips/mips powerpc/powerpc sys vm x86/include x86/iommu x86/x86 X-SVN-Commit-Revision: 327901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:34:18 -0000 Author: jeff Date: Fri Jan 12 23:34:16 2018 New Revision: 327901 URL: https://svnweb.freebsd.org/changeset/base/327901 Log: Add support for NUMA domains to bus dma tags. This causes all memory allocated with a tag to come from the specified domain if it meets the other constraints provided by the tag. Automatically create a tag at the root of each bus specifying the domain local to that bus if available. Reviewed by: jhb, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D13545 Modified: head/sys/arm/arm/busdma_machdep-v4.c head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm64/arm64/busdma_machdep.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/mips/mips/busdma_machdep.c head/sys/powerpc/powerpc/busdma_machdep.c head/sys/sys/bus_dma.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/x86/include/busdma_impl.h head/sys/x86/iommu/busdma_dmar.c head/sys/x86/x86/busdma_bounce.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep-v4.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v4.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/arm/arm/busdma_machdep-v4.c Fri Jan 12 23:34:16 2018 (r327901) @@ -500,6 +500,13 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + + return (0); +} + +int bus_dma_tag_destroy(bus_dma_tag_t dmat) { bus_dma_tag_t dmat_copy; Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/arm/arm/busdma_machdep-v6.c Fri Jan 12 23:34:16 2018 (r327901) @@ -563,6 +563,13 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + + return (0); +} + +int bus_dma_tag_destroy(bus_dma_tag_t dmat) { bus_dma_tag_t dmat_copy; Modified: head/sys/arm64/arm64/busdma_machdep.c ============================================================================== --- head/sys/arm64/arm64/busdma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/arm64/arm64/busdma_machdep.c Fri Jan 12 23:34:16 2018 (r327901) @@ -223,3 +223,9 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) return (tc->impl->tag_destroy(dmat)); } +int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + + return (0); +} Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Fri Jan 12 23:34:16 2018 (r327901) @@ -60,6 +60,7 @@ ACPI_MODULE_NAME("PCI_ACPI") struct acpi_hpcib_softc { device_t ap_dev; ACPI_HANDLE ap_handle; + bus_dma_tag_t ap_dma_tag; int ap_flags; uint32_t ap_osc_ctl; @@ -108,6 +109,7 @@ static int acpi_pcib_acpi_release_resource(device_t d #endif static int acpi_pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature); +static bus_dma_tag_t acpi_pcib_get_dma_tag(device_t bus, device_t child); static device_method_t acpi_pcib_acpi_methods[] = { /* Device interface */ @@ -136,6 +138,7 @@ static device_method_t acpi_pcib_acpi_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), + DEVMETHOD(bus_get_dma_tag, acpi_pcib_get_dma_tag), /* pcib interface */ DEVMETHOD(pcib_maxslots, pcib_maxslots), @@ -366,6 +369,7 @@ acpi_pcib_acpi_attach(device_t dev) rman_res_t start; int rid; #endif + int error, domain; uint8_t busno; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -537,15 +541,33 @@ acpi_pcib_acpi_attach(device_t dev) acpi_pcib_fetch_prt(dev, &sc->ap_prt); + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->ap_dma_tag); + if (error != 0) + goto errout; + error = bus_get_domain(dev, &domain); + if (error == 0) + error = bus_dma_tag_set_domain(sc->ap_dma_tag, domain); + /* Don't fail to attach if the domain can't be queried or set. */ + error = 0; + bus_generic_probe(dev); if (device_add_child(dev, "pci", -1) == NULL) { - device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) - pcib_host_res_free(dev, &sc->ap_host_res); -#endif - return (ENXIO); + bus_dma_tag_destroy(sc->ap_dma_tag); + sc->ap_dma_tag = NULL; + error = ENXIO; + goto errout; } return (bus_generic_attach(dev)); + +errout: + device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + pcib_host_res_free(dev, &sc->ap_host_res); +#endif + return (error); } /* @@ -752,4 +774,14 @@ acpi_pcib_request_feature(device_t pcib, device_t dev, } return (acpi_pcib_osc(sc, osc_ctl)); +} + +static bus_dma_tag_t +acpi_pcib_get_dma_tag(device_t bus, device_t child) +{ + struct acpi_hpcib_softc *sc; + + sc = device_get_softc(bus); + + return (sc->ap_dma_tag); } Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/mips/mips/busdma_machdep.c Fri Jan 12 23:34:16 2018 (r327901) @@ -481,6 +481,13 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + + return (0); +} + +int bus_dma_tag_destroy(bus_dma_tag_t dmat) { #ifdef KTR Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/powerpc/powerpc/busdma_machdep.c Fri Jan 12 23:34:16 2018 (r327901) @@ -341,6 +341,13 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + + return (0); +} + +int bus_dma_tag_destroy(bus_dma_tag_t dmat) { bus_dma_tag_t dmat_copy; Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/sys/bus_dma.h Fri Jan 12 23:34:16 2018 (r327901) @@ -176,6 +176,14 @@ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_ bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat); +/* + * Set the memory domain to be used for allocations. + * + * Automatic for PCI devices. Must be set prior to creating maps or + * allocating memory. + */ +int bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain); + int bus_dma_tag_destroy(bus_dma_tag_t dmat); /* Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/vm/vm_phys.c Fri Jan 12 23:34:16 2018 (r327901) @@ -198,20 +198,32 @@ vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg * (uintmax_t)p1->end, (uintmax_t)p2->start, (uintmax_t)p2->end); } -boolean_t -vm_phys_domain_intersects(long mask, vm_paddr_t low, vm_paddr_t high) +int +vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high) { - struct vm_phys_seg *s; - int idx; +#ifdef VM_NUMA_ALLOC + domainset_t mask; + int i; - while ((idx = ffsl(mask)) != 0) { - idx--; /* ffsl counts from 1 */ - mask &= ~(1UL << idx); - s = &vm_phys_segs[idx]; - if (low < s->end && high > s->start) - return (TRUE); - } - return (FALSE); + if (vm_ndomains == 1 || mem_affinity == NULL) + return (0); + + DOMAINSET_ZERO(&mask); + /* + * Check for any memory that overlaps low, high. + */ + for (i = 0; mem_affinity[i].end != 0; i++) + if (mem_affinity[i].start <= high && + mem_affinity[i].end >= low) + DOMAINSET_SET(mem_affinity[i].domain, &mask); + if (prefer != -1 && DOMAINSET_ISSET(prefer, &mask)) + return (prefer); + if (DOMAINSET_EMPTY(&mask)) + panic("vm_phys_domain_match: Impossible constraint"); + return (DOMAINSET_FFS(&mask) - 1); +#else + return (0); +#endif } /* Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/vm/vm_phys.h Fri Jan 12 23:34:16 2018 (r327901) @@ -77,7 +77,7 @@ vm_page_t vm_phys_alloc_contig(int domain, u_long npag vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); -boolean_t vm_phys_domain_intersects(long mask, vm_paddr_t low, vm_paddr_t high); +int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); Modified: head/sys/x86/include/busdma_impl.h ============================================================================== --- head/sys/x86/include/busdma_impl.h Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/x86/include/busdma_impl.h Fri Jan 12 23:34:16 2018 (r327901) @@ -50,6 +50,7 @@ struct bus_dma_tag_common { bus_dma_lock_t *lockfunc; void *lockfuncarg; int ref_count; + int domain; }; struct bus_dma_impl { @@ -60,6 +61,7 @@ struct bus_dma_impl { bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat); int (*tag_destroy)(bus_dma_tag_t dmat); + int (*tag_set_domain)(bus_dma_tag_t); int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/x86/iommu/busdma_dmar.c Fri Jan 12 23:34:16 2018 (r327901) @@ -326,6 +326,13 @@ out: } static int +dmar_bus_dma_tag_set_domain(bus_dma_tag_t dmat) +{ + + return (0); +} + +static int dmar_bus_dma_tag_destroy(bus_dma_tag_t dmat1) { struct bus_dma_tag_dmar *dmat, *dmat_copy, *parent; @@ -345,7 +352,7 @@ dmar_bus_dma_tag_destroy(bus_dma_tag_t dmat1) 1) { if (dmat == &dmat->ctx->ctx_tag) dmar_free_ctx(dmat->ctx); - free(dmat->segments, M_DMAR_DMAMAP); + free_domain(dmat->segments, M_DMAR_DMAMAP); free(dmat, M_DEVBUF); dmat = parent; } else @@ -366,16 +373,18 @@ dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); tag = (struct bus_dma_tag_dmar *)dmat; - map = malloc(sizeof(*map), M_DMAR_DMAMAP, M_NOWAIT | M_ZERO); + map = malloc_domain(sizeof(*map), M_DMAR_DMAMAP, + tag->common.domain, M_NOWAIT | M_ZERO); if (map == NULL) { *mapp = NULL; return (ENOMEM); } if (tag->segments == NULL) { - tag->segments = malloc(sizeof(bus_dma_segment_t) * - tag->common.nsegments, M_DMAR_DMAMAP, M_NOWAIT); + tag->segments = malloc_domain(sizeof(bus_dma_segment_t) * + tag->common.nsegments, M_DMAR_DMAMAP, + tag->common.domain, M_NOWAIT); if (tag->segments == NULL) { - free(map, M_DMAR_DMAMAP); + free_domain(map, M_DMAR_DMAMAP); *mapp = NULL; return (ENOMEM); } @@ -407,7 +416,7 @@ dmar_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap return (EBUSY); } DMAR_DOMAIN_UNLOCK(domain); - free(map, M_DMAR_DMAMAP); + free_domain(map, M_DMAR_DMAMAP); } tag->map_count--; return (0); @@ -438,10 +447,11 @@ dmar_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr if (tag->common.maxsize < PAGE_SIZE && tag->common.alignment <= tag->common.maxsize && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc(tag->common.maxsize, M_DEVBUF, mflags); + *vaddr = malloc_domain(tag->common.maxsize, M_DEVBUF, + tag->common.domain, mflags); map->flags |= BUS_DMAMAP_DMAR_MALLOC; } else { - *vaddr = (void *)kmem_alloc_attr(kernel_arena, + *vaddr = (void *)kmem_alloc_attr_domain(tag->common.domain, tag->common.maxsize, mflags, 0ul, BUS_SPACE_MAXADDR, attr); map->flags |= BUS_DMAMAP_DMAR_KMEM_ALLOC; @@ -464,7 +474,7 @@ dmar_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, map = (struct bus_dmamap_dmar *)map1; if ((map->flags & BUS_DMAMAP_DMAR_MALLOC) != 0) { - free(vaddr, M_DEVBUF); + free_domain(vaddr, M_DEVBUF); map->flags &= ~BUS_DMAMAP_DMAR_MALLOC; } else { KASSERT((map->flags & BUS_DMAMAP_DMAR_KMEM_ALLOC) != 0, @@ -832,6 +842,7 @@ dmar_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t struct bus_dma_impl bus_dma_dmar_impl = { .tag_create = dmar_bus_dma_tag_create, .tag_destroy = dmar_bus_dma_tag_destroy, + .tag_set_domain = dmar_bus_dma_tag_set_domain, .map_create = dmar_bus_dmamap_create, .map_destroy = dmar_bus_dmamap_destroy, .mem_alloc = dmar_bus_dmamem_alloc, @@ -842,7 +853,7 @@ struct bus_dma_impl bus_dma_dmar_impl = { .map_waitok = dmar_bus_dmamap_waitok, .map_complete = dmar_bus_dmamap_complete, .map_unload = dmar_bus_dmamap_unload, - .map_sync = dmar_bus_dmamap_sync + .map_sync = dmar_bus_dmamap_sync, }; static void Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/x86/x86/busdma_bounce.c Fri Jan 12 23:34:16 2018 (r327901) @@ -99,6 +99,7 @@ struct bounce_zone { int total_bounced; int total_deferred; int map_count; + int domain; bus_size_t alignment; bus_addr_t lowaddr; char zoneid[8]; @@ -150,6 +151,32 @@ static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags); +static int +bounce_bus_dma_zone_setup(bus_dma_tag_t dmat) +{ + struct bounce_zone *bz; + int error; + + /* Must bounce */ + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + bz = dmat->bounce_zone; + + if (ptoa(bz->total_bpages) < dmat->common.maxsize) { + int pages; + + pages = atop(dmat->common.maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(dmat, pages) < pages) + return (ENOMEM); + } + /* Performed initial allocation */ + dmat->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; + + return (0); +} + /* * Allocate a device specific dma_tag. */ @@ -184,28 +211,9 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && - (flags & BUS_DMA_ALLOCNOW) != 0) { - struct bounce_zone *bz; - - /* Must bounce */ - if ((error = alloc_bounce_zone(newtag)) != 0) { - free(newtag, M_DEVBUF); - return (error); - } - bz = newtag->bounce_zone; - - if (ptoa(bz->total_bpages) < maxsize) { - int pages; - - pages = atop(maxsize) - bz->total_bpages; - - /* Add pages to our bounce pool */ - if (alloc_bounce_pages(newtag, pages) < pages) - error = ENOMEM; - } - /* Performed initial allocation */ - newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; - } else + (flags & BUS_DMA_ALLOCNOW) != 0) + error = bounce_bus_dma_zone_setup(newtag); + else error = 0; if (error != 0) @@ -218,7 +226,24 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si return (error); } +/* + * Update the domain for the tag. We may need to reallocate the zone and + * bounce pages. + */ static int +bounce_bus_dma_tag_set_domain(bus_dma_tag_t dmat) +{ + + KASSERT(dmat->map_count == 0, + ("bounce_bus_dma_tag_set_domain: Domain set after use.\n")); + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) == 0 || + dmat->bounce_zone == NULL) + return (0); + dmat->bounce_flags &= ~BUS_DMA_MIN_ALLOC_COMP; + return (bounce_bus_dma_zone_setup(dmat)); +} + +static int bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) { bus_dma_tag_t dmat_copy, parent; @@ -237,7 +262,7 @@ bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) atomic_subtract_int(&dmat->common.ref_count, 1); if (dmat->common.ref_count == 0) { if (dmat->segments != NULL) - free(dmat->segments, M_DEVBUF); + free_domain(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -269,9 +294,9 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( + dmat->segments = (bus_dma_segment_t *)malloc_domain( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, M_NOWAIT); + M_DEVBUF, dmat->common.domain, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -292,8 +317,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags } bz = dmat->bounce_zone; - *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); + *mapp = (bus_dmamap_t)malloc_domain(sizeof(**mapp), M_DEVBUF, + dmat->common.domain, M_NOWAIT | M_ZERO); if (*mapp == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -355,7 +380,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmam } if (dmat->bounce_zone) dmat->bounce_zone->map_count--; - free(map, M_DEVBUF); + free_domain(map, M_DEVBUF); } dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); @@ -386,9 +411,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad *mapp = NULL; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( + dmat->segments = (bus_dma_segment_t *)malloc_domain( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, mflags); + M_DEVBUF, dmat->common.domain, mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); @@ -427,18 +452,19 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + *vaddr = malloc_domain(dmat->common.maxsize, M_DEVBUF, + dmat->common.domain, mflags); } else if (dmat->common.nsegments >= howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ - *vaddr = (void *)kmem_alloc_attr(kernel_arena, + *vaddr = (void *)kmem_alloc_attr_domain(dmat->common.domain, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } else { - *vaddr = (void *)kmem_alloc_contig(kernel_arena, + *vaddr = (void *)kmem_alloc_contig_domain(dmat->common.domain, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); @@ -471,7 +497,7 @@ bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) - free(vaddr, M_DEVBUF); + free_domain(vaddr, M_DEVBUF); else kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->common.maxsize); @@ -1041,7 +1067,8 @@ alloc_bounce_zone(bus_dma_tag_t dmat) /* Check to see if we already have a suitable zone */ STAILQ_FOREACH(bz, &bounce_zone_list, links) { if ((dmat->common.alignment <= bz->alignment) && - (dmat->common.lowaddr >= bz->lowaddr)) { + (dmat->common.lowaddr >= bz->lowaddr) && + (dmat->common.domain == bz->domain)) { dmat->bounce_zone = bz; return (0); } @@ -1058,6 +1085,7 @@ alloc_bounce_zone(bus_dma_tag_t dmat) bz->lowaddr = dmat->common.lowaddr; bz->alignment = MAX(dmat->common.alignment, PAGE_SIZE); bz->map_count = 0; + bz->domain = dmat->common.domain; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); @@ -1103,6 +1131,10 @@ alloc_bounce_zone(bus_dma_tag_t dmat) SYSCTL_ADD_UAUTO(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "alignment", CTLFLAG_RD, &bz->alignment, ""); + SYSCTL_ADD_INT(busdma_sysctl_tree(bz), + SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, + "domain", CTLFLAG_RD, &bz->domain, 0, + "memory domain"); return (0); } @@ -1118,18 +1150,16 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) while (numpages > 0) { struct bounce_page *bpage; - bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, - M_NOWAIT | M_ZERO); + bpage = (struct bounce_page *)malloc_domain(sizeof(*bpage), + M_DEVBUF, dmat->common.domain, M_NOWAIT | M_ZERO); if (bpage == NULL) break; - bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT, 0ul, - bz->lowaddr, - PAGE_SIZE, - 0); + bpage->vaddr = (vm_offset_t)contigmalloc_domain(PAGE_SIZE, + M_DEVBUF, dmat->common.domain, M_NOWAIT, 0ul, + bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { - free(bpage, M_DEVBUF); + free_domain(bpage, M_DEVBUF); break; } bpage->busaddr = pmap_kextract(bpage->vaddr); @@ -1271,6 +1301,7 @@ busdma_swi(void) struct bus_dma_impl bus_dma_bounce_impl = { .tag_create = bounce_bus_dma_tag_create, .tag_destroy = bounce_bus_dma_tag_destroy, + .tag_set_domain = bounce_bus_dma_tag_set_domain, .map_create = bounce_bus_dmamap_create, .map_destroy = bounce_bus_dmamap_destroy, .mem_alloc = bounce_bus_dmamem_alloc, @@ -1281,5 +1312,5 @@ struct bus_dma_impl bus_dma_bounce_impl = { .map_waitok = bounce_bus_dmamap_waitok, .map_complete = bounce_bus_dmamap_complete, .map_unload = bounce_bus_dmamap_unload, - .map_sync = bounce_bus_dmamap_sync + .map_sync = bounce_bus_dmamap_sync, }; Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Fri Jan 12 23:25:05 2018 (r327900) +++ head/sys/x86/x86/busdma_machdep.c Fri Jan 12 23:34:16 2018 (r327901) @@ -43,8 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include +#include +#include #include #include #include @@ -180,10 +184,27 @@ common_bus_dma_tag_create(struct bus_dma_tag_common *p common->filterarg = parent->filterarg; common->parent = parent->parent; } + common->domain = parent->domain; atomic_add_int(&parent->ref_count, 1); } + common->domain = vm_phys_domain_match(common->domain, 0ul, + common->lowaddr); *dmat = common; return (0); +} + +int +bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + domain = vm_phys_domain_match(domain, 0ul, tc->lowaddr); + /* Only call the callback if it changes. */ + if (domain == tc->domain) + return (0); + tc->domain = domain; + return (tc->impl->tag_set_domain(dmat)); } /* From owner-svn-src-all@freebsd.org Fri Jan 12 23:41:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CEC9EB2C1A; Fri, 12 Jan 2018 23:41:13 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570CE337E; Fri, 12 Jan 2018 23:41:13 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 890A3297C; Fri, 12 Jan 2018 23:41:12 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0CNfCd2006442; Fri, 12 Jan 2018 23:41:12 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0CNfChp006441; Fri, 12 Jan 2018 23:41:12 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201801122341.w0CNfChp006441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 12 Jan 2018 23:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327903 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 327903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 12 Jan 2018 23:41:13 -0000 Author: jeff Date: Fri Jan 12 23:41:12 2018 New Revision: 327903 URL: https://svnweb.freebsd.org/changeset/base/327903 Log: Fix compile error from r327900 Modified: head/sys/sys/busdma_bufalloc.h Modified: head/sys/sys/busdma_bufalloc.h ============================================================================== --- head/sys/sys/busdma_bufalloc.h Fri Jan 12 23:38:15 2018 (r327902) +++ head/sys/sys/busdma_bufalloc.h Fri Jan 12 23:41:12 2018 (r327903) @@ -113,7 +113,7 @@ struct busdma_bufzone * busdma_bufalloc_findzone(busdm * you can probably use these when you need uncacheable buffers. */ void * busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, - uint8_t *pflag, int wait); + int domain, uint8_t *pflag, int wait); void busdma_bufalloc_free_uncacheable(void *item, vm_size_t size, uint8_t pflag); From owner-svn-src-all@freebsd.org Sat Jan 13 00:04:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAF6E601D4; Sat, 13 Jan 2018 00:04:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48498633F7; Sat, 13 Jan 2018 00:04:12 +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 701EE2D1F; Sat, 13 Jan 2018 00:04:11 +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 w0D04BLg016477; Sat, 13 Jan 2018 00:04:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D04Bdu016476; Sat, 13 Jan 2018 00:04:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201801130004.w0D04Bdu016476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 13 Jan 2018 00:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327904 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 327904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 00:04:12 -0000 Author: np Date: Sat Jan 13 00:04:11 2018 New Revision: 327904 URL: https://svnweb.freebsd.org/changeset/base/327904 Log: cxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc. Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Jan 12 23:41:12 2018 (r327903) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Jan 13 00:04:11 2018 (r327904) @@ -899,8 +899,6 @@ typedef int (*c4iw_handler_func)(struct c4iw_dev *dev, int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new, struct l2t_entry *l2t); -void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qpid, - struct c4iw_dev_ucontext *uctx); u32 c4iw_get_resource(struct c4iw_id_table *id_table); void c4iw_put_resource(struct c4iw_id_table *id_table, u32 entry); int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt, u32 nr_pdid); @@ -986,7 +984,6 @@ void __iomem *c4iw_bar2_addrs(struct c4iw_rdev *rdev, unsigned int *pbar2_qid, u64 *pbar2_pa); extern struct cxgb4_client t4c_client; extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; -extern int c4iw_max_read_depth; #if defined(__i386__) || defined(__amd64__) #define L1_CACHE_BYTES 128 From owner-svn-src-all@freebsd.org Sat Jan 13 00:05:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B9DE60315; Sat, 13 Jan 2018 00:05:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 438BA635AF; Sat, 13 Jan 2018 00:05:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83A742D2F; Sat, 13 Jan 2018 00:05:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D05VQb016569; Sat, 13 Jan 2018 00:05:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D05Vhk016568; Sat, 13 Jan 2018 00:05:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201801130005.w0D05Vhk016568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 13 Jan 2018 00:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327905 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 00:05:32 -0000 Author: mjg Date: Sat Jan 13 00:05:31 2018 New Revision: 327905 URL: https://svnweb.freebsd.org/changeset/base/327905 Log: rwlock: try regular read unlock even in the hard path Saves on turnstile trips if the lock got more readers. Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Jan 13 00:04:11 2018 (r327904) +++ head/sys/kern/kern_rwlock.c Sat Jan 13 00:05:31 2018 (r327905) @@ -771,9 +771,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td turnstile_chain_lock(&rw->lock_object); v = RW_READ_VALUE(rw); retry_ts: - if (__predict_false(RW_READERS(v) > 1)) { + if (__rw_runlock_try(rw, td, &v)) { turnstile_chain_unlock(&rw->lock_object); - continue; + break; } v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); From owner-svn-src-all@freebsd.org Sat Jan 13 01:46:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D0DE66901; Sat, 13 Jan 2018 01:46:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90B846B6CE; Sat, 13 Jan 2018 01:46:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-199-215.ca.astound.net [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 41F6310A7DB; Fri, 12 Jan 2018 20:46:31 -0500 (EST) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327783 - head/share/mk Date: Fri, 12 Jan 2018 17:46:22 -0800 Message-ID: <3584752.ozb5ohFTAi@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801102028.w0AKS1UA000454@repo.freebsd.org> References: <201801102028.w0AKS1UA000454@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 12 Jan 2018 20:46:31 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 01:46:33 -0000 On Wednesday, January 10, 2018 08:28:01 PM Ed Maste wrote: > Author: emaste > Date: Wed Jan 10 20:28:01 2018 > New Revision: 327783 > URL: https://svnweb.freebsd.org/changeset/base/327783 > > Log: > Enable ld.lld as bootstrap linker by default on amd64 > > For some time we have been planning to migrate to LLVM's lld linker. > Having a man page was the last blocking issue for using ld.lld to link > the base system kernel + userland, now addressed by r327770. Link the > kernel and userland libraries and binaries with ld.lld by default, for > additional test coverage. > > This has been a long time in the making. On 2013-04-13 I submitted an > upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's > system linker. Since then 85 individual issues were identified, and > submitted as dependencies. These have been addressed along with two > and a half years of other lld development and improvement. > > I'd like to express deep gratitude to upstream lld developers Rui > Ueyama, Rafael Espindola, George Rimar and Davide Italiano. They put in > substantial effort in addressing the issues we found affecting > FreeBSD/amd64. > > To revert to using ld.bfd as the bootstrap linker, in /etc/src.conf set > > WITHOUT_LLD_BOOTSTRAP=yes > > If you need to set this, please follow up with a PR or post to the > freebsd-toolchain mailing list explaining how default WITH_LLD_BOOTSTRAP > failed for your use case. > > Note that GNU ld.bfd is still installed as /usr/bin/ld, and will still > be used for linking ports. ld.lld can be installed as /usr/bin/ld by > setting in /etc/src.conf > > WITH_LLD_IS_LLD=yes > > A followup commit will set WITH_LLD_IS_LD by default, possibly after > Clang/LLVM/lld 6.0 is merged to FreeBSD. > > Release notes: Yes > Sponsored by: The FreeBSD Foundation FYI, due to a quirk of how we load kernel modules on amd64 in such a way that doesn't really honor the ELF spec (but is self-consistent in the kernel and loader) and the fact that LLD doesn't sort sections the way BFD does, this change has confused kgdb such that it can compute different address for symbols. I dont think i386 is affected, only amd64. I've started on a fix, but my first attempt to boot it resulted in no modules loading anymore and it's time to go home for the day. :-P I'll try to resolve this early next week. If you need to use kgdb on amd64 with kernel modules, you will have to build with an external toolchain (the old ld.bfd can't cope with the kernel ifunc stuff). -- John Baldwin From owner-svn-src-all@freebsd.org Sat Jan 13 01:36:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06E8EE65DC3; Sat, 13 Jan 2018 01:36:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D70D26AE6D; Sat, 13 Jan 2018 01:36:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C0E94168; Sat, 13 Jan 2018 01:36:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D1acm4054357; Sat, 13 Jan 2018 01:36:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D1abhS054355; Sat, 13 Jan 2018 01:36:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801130136.w0D1abhS054355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 01:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/mpc85xx X-SVN-Commit-Revision: 327906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 01:36:39 -0000 Author: jhibbits Date: Sat Jan 13 01:36:37 2018 New Revision: 327906 URL: https://svnweb.freebsd.org/changeset/base/327906 Log: Enable L2 cache on supported PowerQUICC and QorIQ platforms Some PowerQUICC and QorIQ platforms have a L2 cache managed via the memory-mapped configuration registers, and appear as a node in the device tree. This adds basic support to enable the cache. Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Jan 13 00:05:31 2018 (r327905) +++ head/sys/conf/files.powerpc Sat Jan 13 01:36:37 2018 (r327906) @@ -146,6 +146,7 @@ powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx +powerpc/mpc85xx/mpc85xx_cache.c optional mpc85xx powerpc/mpc85xx/mpc85xx_gpio.c optional mpc85xx gpio powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 01:36:37 2018 (r327906) @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2018 Justin Hibbits + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +/* + * From the P1022 manual, sequence for writing to L2CTL is: + * - mbar + * - isync + * - write + * - read + * - mbar + */ +#define L2_CTL 0x0 +#define L2CTL_L2E 0x80000000 +#define L2CTL_L2I 0x40000000 +struct mpc85xx_cache_softc { + struct resource *sc_mem; +}; + +static int +mpc85xx_cache_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "cache")) + return (ENXIO); + + device_set_desc(dev, "MPC85xx L2 cache"); + return (0); +} + +static int +mpc85xx_cache_attach(device_t dev) +{ + struct mpc85xx_cache_softc *sc = device_get_softc(dev); + int rid; + int cache_line_size, cache_size; + + /* Map registers. */ + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->sc_mem == NULL) + return (ENOMEM); + + /* Enable cache and flash invalidate. */ + __asm __volatile ("mbar; isync" ::: "memory"); + bus_write_4(sc->sc_mem, L2_CTL, L2CTL_L2E | L2CTL_L2I); + bus_read_4(sc->sc_mem, L2_CTL); + __asm __volatile ("mbar" ::: "memory"); + + cache_line_size = 0; + cache_size = 0; + OF_getencprop(ofw_bus_get_node(dev), "cache-size", &cache_size, + sizeof(cache_size)); + OF_getencprop(ofw_bus_get_node(dev), "cache-line-size", + &cache_line_size, sizeof(cache_line_size)); + + if (cache_line_size != 0 && cache_size != 0) + device_printf(dev, + "L2 cache size: %dKB, cache line size: %d bytes\n", + cache_size / 1024, cache_line_size); + + return (0); +} + +static device_method_t mpc85xx_cache_methods[] = { + /* device methods */ + DEVMETHOD(device_probe, mpc85xx_cache_probe), + DEVMETHOD(device_attach, mpc85xx_cache_attach), + + DEVMETHOD_END +}; + +static driver_t mpc85xx_cache_driver = { + "cache", + mpc85xx_cache_methods, + sizeof(struct mpc85xx_cache_softc), +}; +static devclass_t mpc85xx_cache_devclass; + +EARLY_DRIVER_MODULE(mpc85xx_cache, simplebus, mpc85xx_cache_driver, + mpc85xx_cache_devclass, NULL, NULL, + BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-all@freebsd.org Sat Jan 13 02:56:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5827E6BF25; Sat, 13 Jan 2018 02:56:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97A766E709; Sat, 13 Jan 2018 02:56:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E74474F91; Sat, 13 Jan 2018 02:56:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D2u9KY087031; Sat, 13 Jan 2018 02:56:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D2u9fn087029; Sat, 13 Jan 2018 02:56:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801130256.w0D2u9fn087029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 02:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327907 - in head/sys: conf dev/fdt dev/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf dev/fdt dev/ofw X-SVN-Commit-Revision: 327907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 02:56:10 -0000 Author: jhibbits Date: Sat Jan 13 02:56:09 2018 New Revision: 327907 URL: https://svnweb.freebsd.org/changeset/base/327907 Log: Remove fdt fixups for powerpc, they are no longer needed. If a fixup really is needed, it should be fixed in u-boot, not in FreeBSD. Suggested by: nwhitehorn Deleted: head/sys/dev/fdt/fdt_powerpc.c Modified: head/sys/conf/files.powerpc head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Jan 13 01:36:37 2018 (r327906) +++ head/sys/conf/files.powerpc Sat Jan 13 02:56:09 2018 (r327907) @@ -31,7 +31,6 @@ dev/adb/adb_if.m optional adb dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/fb/fb.c optional sc -dev/fdt/fdt_powerpc.c optional fdt # ofwbus depends on simplebus. dev/fdt/simplebus.c optional aim | fdt dev/hwpmc/hwpmc_e500.c optional hwpmc Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Sat Jan 13 01:36:37 2018 (r327906) +++ head/sys/dev/ofw/ofw_fdt.c Sat Jan 13 02:56:09 2018 (r327907) @@ -430,7 +430,7 @@ ofw_fdt_package_to_path(ofw_t ofw, phandle_t package, return (-1); } -#if defined(FDT_MARVELL) || defined(__powerpc__) +#if defined(FDT_MARVELL) static int ofw_fdt_fixup(ofw_t ofw) { @@ -477,7 +477,7 @@ ofw_fdt_fixup(ofw_t ofw) static int ofw_fdt_interpret(ofw_t ofw, const char *cmd, int nret, cell_t *retvals) { -#if defined(FDT_MARVELL) || defined(__powerpc__) +#if defined(FDT_MARVELL) int rv; /* From owner-svn-src-all@freebsd.org Sat Jan 13 03:09:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF4DEE6D8B1; Sat, 13 Jan 2018 03:09:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF146F628; Sat, 13 Jan 2018 03:09:06 +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 C808451D4; Sat, 13 Jan 2018 03:09:05 +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 w0D395R6092298; Sat, 13 Jan 2018 03:09:05 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D395nW092297; Sat, 13 Jan 2018 03:09:05 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801130309.w0D395nW092297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 13 Jan 2018 03:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327908 - 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: 327908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 03:09:06 -0000 Author: nwhitehorn Date: Sat Jan 13 03:09:05 2018 New Revision: 327908 URL: https://svnweb.freebsd.org/changeset/base/327908 Log: Chase removal of FDT fixup code on PowerPC in r327907. Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat Jan 13 02:56:09 2018 (r327907) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat Jan 13 03:09:05 2018 (r327908) @@ -420,8 +420,6 @@ OF_bootstrap() return status; err = OF_init(fdt); - if (err == 0) - OF_interpret("perform-fixup", 0); } if (err != 0) { From owner-svn-src-all@freebsd.org Sat Jan 13 03:12:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65769E6DDB5; Sat, 13 Jan 2018 03:12:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34BE56FACA; Sat, 13 Jan 2018 03:12:22 +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 7D4CA535B; Sat, 13 Jan 2018 03:12:21 +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 w0D3CL56095566; Sat, 13 Jan 2018 03:12:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D3CLei095564; Sat, 13 Jan 2018 03:12:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201801130312.w0D3CLei095564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 13 Jan 2018 03:12:21 +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: r327909 - stable/11/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/tools/build/options X-SVN-Commit-Revision: 327909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 03:12:22 -0000 Author: ian Date: Sat Jan 13 03:12:21 2018 New Revision: 327909 URL: https://svnweb.freebsd.org/changeset/base/327909 Log: Fix fallout from applying a patch twice. Reported by: jhb@ Pointy hat: ian@ Modified: stable/11/tools/build/options/WITHOUT_LINT stable/11/tools/build/options/WITH_LINT Modified: stable/11/tools/build/options/WITHOUT_LINT ============================================================================== --- stable/11/tools/build/options/WITHOUT_LINT Sat Jan 13 03:09:05 2018 (r327908) +++ stable/11/tools/build/options/WITHOUT_LINT Sat Jan 13 03:12:21 2018 (r327909) @@ -1,4 +1,2 @@ .\" $FreeBSD$ Set to not build the lint binaries and library. -.\" $FreeBSD$ -Set to not build the lint binaries and library. Modified: stable/11/tools/build/options/WITH_LINT ============================================================================== --- stable/11/tools/build/options/WITH_LINT Sat Jan 13 03:09:05 2018 (r327908) +++ stable/11/tools/build/options/WITH_LINT Sat Jan 13 03:12:21 2018 (r327909) @@ -1,4 +1,2 @@ .\" $FreeBSD$ Set to build the lint binaries and library. -.\" $FreeBSD$ -Set to build the lint binaries and library. From owner-svn-src-all@freebsd.org Sat Jan 13 03:13:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ABAE6DEFB for ; Sat, 13 Jan 2018 03:13:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE6E6FC55 for ; Sat, 13 Jan 2018 03:13:40 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: b2aeb7cb-f80f-11e7-8486-0934409070aa X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id b2aeb7cb-f80f-11e7-8486-0934409070aa; Sat, 13 Jan 2018 03:13:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w0D3DbZV007346; Fri, 12 Jan 2018 20:13:37 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1515813217.44630.116.camel@freebsd.org> Subject: Re: svn commit: r327843 - stable/11/tools/build/options From: Ian Lepore To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Date: Fri, 12 Jan 2018 20:13:37 -0700 In-Reply-To: <11735770.uMkkBBHlKq@ralph.baldwin.cx> References: <201801111941.w0BJf0mn093791@repo.freebsd.org> <11735770.uMkkBBHlKq@ralph.baldwin.cx> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 03:13:40 -0000 On Fri, 2018-01-12 at 09:29 -0800, John Baldwin wrote: > On Thursday, January 11, 2018 07:41:00 PM Ian Lepore wrote: > > > > Author: ian > > Date: Thu Jan 11 19:41:00 2018 > > New Revision: 327843 > > URL: https://svnweb.freebsd.org/changeset/base/327843 > > > > Log: > >   Add description files for WITH/WITHOUT_LINT.  These should have been part > >   of r327837. > >    > >   PR: 223892 > >   Differential Revision:  https://reviews.freebsd.org/D13799 > > > > Added: > >   stable/11/tools/build/options/WITHOUT_LINT   (contents, props changed) > >   stable/11/tools/build/options/WITH_LINT   (contents, props changed) > > > > Added: stable/11/tools/build/options/WITHOUT_LINT > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ stable/11/tools/build/options/WITHOUT_LINT Thu Jan 11 19:41:00 2018 (r327843) > > @@ -0,0 +1,4 @@ > > +.\" $FreeBSD$ > > +Set to not build the lint binaries and library. > > +.\" $FreeBSD$ > > +Set to not build the lint binaries and library. > > > > Added: stable/11/tools/build/options/WITH_LINT > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ stable/11/tools/build/options/WITH_LINT Thu Jan 11 19:41:00 2018 (r327843) > > @@ -0,0 +1,4 @@ > > +.\" $FreeBSD$ > > +Set to build the lint binaries and library. > > +.\" $FreeBSD$ > > +Set to build the lint binaries and library. > Duplicated contents? > Yep, good catch, I think I applied a patch twice.  Fixed in r327909. Thanks, -- Ian From owner-svn-src-all@freebsd.org Sat Jan 13 03:19:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FAD0E6E364; Sat, 13 Jan 2018 03:19:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3E556FED2; Sat, 13 Jan 2018 03:19:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0D39Efo007022 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 12 Jan 2018 19:09:15 -0800 Subject: Re: svn commit: r327907 - in head/sys: conf dev/fdt dev/ofw To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801130256.w0D2u9fn087029@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Fri, 12 Jan 2018 19:09:13 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201801130256.w0D2u9fn087029@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZZAsxCmSbgNHVVbBhZuG7kuiCHjHqsxUgS7Ak2WJlzkROp1E1uECn1+1IgTxdlcV5PO6D6IqioiNpUlqj2ZGi0hZbKGolNF9U= X-Sonic-ID: C;iv9YIg/45xG+juBQ9eIpJw== M;fiXuIg/45xG+juBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 03:19:44 -0000 Thanks, Justin! Since the fixup stuff is now only defined for FDT_MARVELL, it would be great if it could move to sys/arm/mv now instead of being in MI code. -Nathan On 01/12/18 18:56, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Jan 13 02:56:09 2018 > New Revision: 327907 > URL: https://svnweb.freebsd.org/changeset/base/327907 > > Log: > Remove fdt fixups for powerpc, they are no longer needed. > > If a fixup really is needed, it should be fixed in u-boot, not in FreeBSD. > > Suggested by: nwhitehorn > > Deleted: > head/sys/dev/fdt/fdt_powerpc.c > Modified: > head/sys/conf/files.powerpc > head/sys/dev/ofw/ofw_fdt.c > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Sat Jan 13 01:36:37 2018 (r327906) > +++ head/sys/conf/files.powerpc Sat Jan 13 02:56:09 2018 (r327907) > @@ -31,7 +31,6 @@ dev/adb/adb_if.m optional adb > dev/adb/adb_buttons.c optional adb > dev/agp/agp_apple.c optional agp powermac > dev/fb/fb.c optional sc > -dev/fdt/fdt_powerpc.c optional fdt > # ofwbus depends on simplebus. > dev/fdt/simplebus.c optional aim | fdt > dev/hwpmc/hwpmc_e500.c optional hwpmc > > Modified: head/sys/dev/ofw/ofw_fdt.c > ============================================================================== > --- head/sys/dev/ofw/ofw_fdt.c Sat Jan 13 01:36:37 2018 (r327906) > +++ head/sys/dev/ofw/ofw_fdt.c Sat Jan 13 02:56:09 2018 (r327907) > @@ -430,7 +430,7 @@ ofw_fdt_package_to_path(ofw_t ofw, phandle_t package, > return (-1); > } > > -#if defined(FDT_MARVELL) || defined(__powerpc__) > +#if defined(FDT_MARVELL) > static int > ofw_fdt_fixup(ofw_t ofw) > { > @@ -477,7 +477,7 @@ ofw_fdt_fixup(ofw_t ofw) > static int > ofw_fdt_interpret(ofw_t ofw, const char *cmd, int nret, cell_t *retvals) > { > -#if defined(FDT_MARVELL) || defined(__powerpc__) > +#if defined(FDT_MARVELL) > int rv; > > /* > From owner-svn-src-all@freebsd.org Sat Jan 13 03:41:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A113E6FAB8; Sat, 13 Jan 2018 03:41:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C38F470E72; Sat, 13 Jan 2018 03:41:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wr0-x236.google.com with SMTP id 36so6949377wrh.1; Fri, 12 Jan 2018 19:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SmRPBui1xfHgOIUwxk3vglukN3vaeEQrl1Z6fjF6n0U=; b=MYKxa7wvIs+Y+YI//eMFKC5g+MUZSf6CPoPpHKB/076vhQO6PKD3XnRl6f4rPne2sr ySXXFib4T19oD589z/FG/EGK8XO36e6cRyYeQEFEJwZslC7BjCx1AC3eTs58zWUNC4SP a+9k/V6WjtCdNaO0QZ2ldv0jP5OaUXkP4ut1pGPj25Z7EfMeCe689JKmp74ATA9/9nTf 7jabVVsbaY5InJL3NGzo/DAmWtxUKz2/lW+lu+anX82fvEZ2nswmapMtgIO8Iowb3Tp7 QJLaJgAmtAS2JAWH4zkQ0+jAj5DC+Tnfm+AAk5jS/9FC0DAug9BZrZCRESa8oFLFtci/ 3q6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SmRPBui1xfHgOIUwxk3vglukN3vaeEQrl1Z6fjF6n0U=; b=gm94uBlKNF0x3UjnEYZH3VZ64zupjO2wmjdUMmw/wQObP1GHyBYTDm8yIuWXE9BI8O inrJ2rmE7e8n1SRl9aR2tXOf6I+Vybo+HrwC5lWvkg7P69CAzjbi9K5q/01V3ytobZmh lyudBHViyV+vm+HifBSNpc3PKGZ+Qt1NUkKqCqpdgakmKXddvLWWTjx1lxbTvcvBcCJ1 F+G9XbQ8TI7GtV9NPnNH373KkL9v8kK/ct/YC7uTb5zGAd9FE+wv4O/nRnKyqVBqT6So nbY+Mr/Hormx60KYnZBRb05xg/NPxLpAZ38FxbKDmDRSoW3wsdUSP2YEPS0Zw4/hCWMN HaIQ== X-Gm-Message-State: AKGB3mL0FjOHba4X3OS2BKqFpChz9l1OSyQALKeeex0KuX+tYwHHPG8G xHyVI8S8cQWnYhdOklCd8Rshj7/2Ej4G5gMZ7HCixQ== X-Google-Smtp-Source: ACJfBouGIr+CNR+U7zLl9BJOheqhV5/lBNE9q4wn1ihY1IO44fbhMuFaK+a6hU+4dJana6rMygYBwggoaIRsYJxJfO0= X-Received: by 10.223.190.142 with SMTP id i14mr18284854wrh.111.1515814906850; Fri, 12 Jan 2018 19:41:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.213.11 with HTTP; Fri, 12 Jan 2018 19:41:45 -0800 (PST) In-Reply-To: <3584752.ozb5ohFTAi@ralph.baldwin.cx> References: <201801102028.w0AKS1UA000454@repo.freebsd.org> <3584752.ozb5ohFTAi@ralph.baldwin.cx> From: Adrian Chadd Date: Fri, 12 Jan 2018 19:41:45 -0800 Message-ID: Subject: Re: svn commit: r327783 - head/share/mk To: John Baldwin Cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 03:41:50 -0000 hi, can we just flip the switch back for now until it's figured out? Some of us have to like, do development on -HEAD for fun. :) -a On 12 January 2018 at 17:46, John Baldwin wrote: > On Wednesday, January 10, 2018 08:28:01 PM Ed Maste wrote: >> Author: emaste >> Date: Wed Jan 10 20:28:01 2018 >> New Revision: 327783 >> URL: https://svnweb.freebsd.org/changeset/base/327783 >> >> Log: >> Enable ld.lld as bootstrap linker by default on amd64 >> >> For some time we have been planning to migrate to LLVM's lld linker. >> Having a man page was the last blocking issue for using ld.lld to link >> the base system kernel + userland, now addressed by r327770. Link the >> kernel and userland libraries and binaries with ld.lld by default, for >> additional test coverage. >> >> This has been a long time in the making. On 2013-04-13 I submitted an >> upstream tracking issue in LLVM PR 23214: [META] Using LLD as FreeBSD's >> system linker. Since then 85 individual issues were identified, and >> submitted as dependencies. These have been addressed along with two >> and a half years of other lld development and improvement. >> >> I'd like to express deep gratitude to upstream lld developers Rui >> Ueyama, Rafael Espindola, George Rimar and Davide Italiano. They put in >> substantial effort in addressing the issues we found affecting >> FreeBSD/amd64. >> >> To revert to using ld.bfd as the bootstrap linker, in /etc/src.conf set >> >> WITHOUT_LLD_BOOTSTRAP=yes >> >> If you need to set this, please follow up with a PR or post to the >> freebsd-toolchain mailing list explaining how default WITH_LLD_BOOTSTRAP >> failed for your use case. >> >> Note that GNU ld.bfd is still installed as /usr/bin/ld, and will still >> be used for linking ports. ld.lld can be installed as /usr/bin/ld by >> setting in /etc/src.conf >> >> WITH_LLD_IS_LLD=yes >> >> A followup commit will set WITH_LLD_IS_LD by default, possibly after >> Clang/LLVM/lld 6.0 is merged to FreeBSD. >> >> Release notes: Yes >> Sponsored by: The FreeBSD Foundation > > FYI, due to a quirk of how we load kernel modules on amd64 in such a way that > doesn't really honor the ELF spec (but is self-consistent in the kernel and > loader) and the fact that LLD doesn't sort sections the way BFD does, this > change has confused kgdb such that it can compute different address for > symbols. I dont think i386 is affected, only amd64. I've started on a fix, > but my first attempt to boot it resulted in no modules loading anymore and > it's time to go home for the day. :-P I'll try to resolve this early next > week. If you need to use kgdb on amd64 with kernel modules, you will have > to build with an external toolchain (the old ld.bfd can't cope with the > kernel ifunc stuff). > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Sat Jan 13 04:00:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09844E70A91; Sat, 13 Jan 2018 04:00:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D25BF71934; Sat, 13 Jan 2018 04:00:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0532C5A8A; Sat, 13 Jan 2018 04:00:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D40tbo016317; Sat, 13 Jan 2018 04:00:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D40tgZ016315; Sat, 13 Jan 2018 04:00:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801130400.w0D40tgZ016315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 13 Jan 2018 04:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327910 - in head/share: man/man5 mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/share: man/man5 mk X-SVN-Commit-Revision: 327910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 04:00:57 -0000 Author: emaste Date: Sat Jan 13 04:00:55 2018 New Revision: 327910 URL: https://svnweb.freebsd.org/changeset/base/327910 Log: Revert r327823, Enable ld.lld as bootstrap linker by default on i386 There's a report of some regression in ports. Revert for now for an exp run for this change in isolation (previous lld exp run also included switching the linker used for ports to lld). Also revert the src.conf.5 regeneration in r327824. Reported by: antoine Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Jan 13 03:12:21 2018 (r327909) +++ head/share/man/man5/src.conf.5 Sat Jan 13 04:00:55 2018 (r327910) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 11, 2018 +.Dd January 12, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -970,12 +970,12 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm64/aarch64 and i386/i386. +amd64/amd64 and arm64/aarch64. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Jan 13 03:12:21 2018 (r327909) +++ head/share/mk/src.opts.mk Sat Jan 13 04:00:55 2018 (r327910) @@ -253,7 +253,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "aarch64" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD -.elif ${__T} == "amd64" || ${__T} == "i386" +.elif ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP __DEFAULT_NO_OPTIONS+=LLD_IS_LD .else From owner-svn-src-all@freebsd.org Sat Jan 13 04:09:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9BC6E71400; Sat, 13 Jan 2018 04:09:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A29472009; Sat, 13 Jan 2018 04:09:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x234.google.com with SMTP id e20so7952306iof.12; Fri, 12 Jan 2018 20:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PAfcZBbgb8NIGr2akm8B0EMXS+gCpM8inKRMB3KJGmE=; b=EZAqg/+bO2VSWpUnVJGm9EvvNKVz5l2Vc2sT6VfeW9AXCjELRRKvzDkMPC4zultB77 OaZuM4NmvUdLB7yDL2oUotRxPQuxnhfaA5mt57hD5hd3m51BjiLdPkjmNyjfiQvz3dHN HuAeGH2rPnb1107dQSbwbzA+WFMA66pnsxtilAH6YN+NnTqg+acTOVy4l5pwF8rxJowk kiAmMVvmRgk5XI6+YhhqC5K6Zpdk320UahX+5ODYvmUsKLBu8ZK6gFjJseupq3I+MCns Ny5mpiGCqxjW7m2W6L4BTDjV9jfmj8bZrsHBJnAEAw88ehZMizm/1Gbbb+fkBUijVRXp fPgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PAfcZBbgb8NIGr2akm8B0EMXS+gCpM8inKRMB3KJGmE=; b=lETQrf/8OniFJvMoopV9WunM30JUqSUcRxxBSlABUd1x01oX+04USQdcLjascbMo1N G/ED2YPdaXmqXvolixGXAlh20fGniSlHBQiyGTVxl8ww3MPBrSGsD0rb2xhbOTE9yMjt op4iBRrr/z10j7R9kxpsM14SFhCUa+6OAXjiewSe9GIXnF0turuBuEpHmW4XVr3Sy90J sZl2723Q9H1guVWtEo8Ij7CMuRLyVWYD/XyrAvhpB/aQgty9gpQBfB+RVmuZc7eNisBk JW5Ja/kOPBDtLn82HiQt4M8wQmDDqUIEaU+s4sBmSSHC7/2coPrFEF5u4LVqC39EMuIc rgEg== X-Gm-Message-State: AKwxytd54M5SugsVVP1ClPBy/+7SmNuWjgr/hzpYlMoFqOBBXws5Ha3Z sS6qoxTiaDE7ImyIuDSBILH9GNvZzN4dofFfqgHyRGrF X-Google-Smtp-Source: ACJfBotI43VWRpGQwEhwIMVJE7a+HPtycpZBQZe1cDdJPx52h2tRyE42LnqSzLpQ2fYOIFlx8AblIs3863Yub2TMvYo= X-Received: by 10.107.173.159 with SMTP id m31mr27087421ioo.36.1515816571583; Fri, 12 Jan 2018 20:09:31 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.131.163 with HTTP; Fri, 12 Jan 2018 20:09:11 -0800 (PST) In-Reply-To: References: <201801111403.w0BE353l047103@repo.freebsd.org> From: Ed Maste Date: Fri, 12 Jan 2018 23:09:11 -0500 X-Google-Sender-Auth: pXiHkIZuc0KOkkaeN5TswlrJivA Message-ID: Subject: Re: svn commit: r327823 - head/share/mk To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 04:09:32 -0000 On 12 January 2018 at 17:49, Antoine Brodin wrote: > On Thu, Jan 11, 2018 at 3:03 PM, Ed Maste wrote: >> Author: emaste >> Date: Thu Jan 11 14:03:05 2018 >> New Revision: 327823 >> URL: https://svnweb.freebsd.org/changeset/base/327823 >> >> Log: >> Enable ld.lld as bootstrap linker by default on i386 >> > Hi, > > There are some regressions in ports after this change, could you > revert it and request a proper exp-run? Reverted in r327910, exp-run request (for LLD_BOOTSTRAP without LLD_IS_LD) in PR 225128. Do you have a few examples of regressions? From owner-svn-src-all@freebsd.org Sat Jan 13 04:53:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA6FE73839; Sat, 13 Jan 2018 04:53:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 710BA73D06; Sat, 13 Jan 2018 04:53:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A33B664CE; Sat, 13 Jan 2018 04:53:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D4r4dL038020; Sat, 13 Jan 2018 04:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D4r4jD038019; Sat, 13 Jan 2018 04:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801130453.w0D4r4jD038019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 04:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327911 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 327911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 04:53:05 -0000 Author: jhibbits Date: Sat Jan 13 04:53:04 2018 New Revision: 327911 URL: https://svnweb.freebsd.org/changeset/base/327911 Log: Replace the PMC class struct copy with an explicit memcpy() This should be effectively a nop for all archs, but for some reason the codegen difference on the PowerPC 970 is such that the struct assignment doesn't work (unless a printf() using one of the elements in the copied struct follows it), while the memcpy() succeeds. On all archs the memcpy() should be expanded to an inline copy, since the copy is bounded to ~16 bytes. MFC after: 3 weeks Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Sat Jan 13 04:00:55 2018 (r327910) +++ head/lib/libpmc/libpmc.c Sat Jan 13 04:53:04 2018 (r327911) @@ -3270,7 +3270,8 @@ pmc_init(void) cpu_info.pm_npmc = op_cpu_info.pm_npmc; cpu_info.pm_nclass = op_cpu_info.pm_nclass; for (n = 0; n < cpu_info.pm_nclass; n++) - cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n]; + memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n], + sizeof(cpu_info.pm_classes[n])); pmc_class_table = malloc(PMC_CLASS_TABLE_SIZE * sizeof(struct pmc_class_descr *)); From owner-svn-src-all@freebsd.org Sat Jan 13 06:53:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD19BE787F5; Sat, 13 Jan 2018 06:53:48 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC627733B; Sat, 13 Jan 2018 06:53:48 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id DA2C4FEC7; Sat, 13 Jan 2018 06:53:47 +0000 (UTC) Date: Sat, 13 Jan 2018 06:53:47 +0000 From: Alexey Dokuchaev To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327890 - head/usr.sbin/bsdinstall/partedit Message-ID: <20180113065347.GA26333@FreeBSD.org> References: <201801122025.w0CKPvVk022670@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801122025.w0CKPvVk022670@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 06:53:48 -0000 On Fri, Jan 12, 2018 at 08:25:57PM +0000, Ed Maste wrote: > New Revision: 327890 > URL: https://svnweb.freebsd.org/changeset/base/327890 > > Log: > bsdinstall: disable SUJ by default > > SUJ + cg checksums produce spurious warnings after an unclean shutdown > (e.g. a crash). For now disable SUJ for UFS installs so installing from > a FreeBSD 12 snapshot results in a usable filesystem, until this can be > fixed. Thanks; I keep seeing it quite often. Is it safe to disable SUJ on already populated filesystem? Can (should) it better be done on live, mounted one, of better off the other booted instance of FreeBSD (from another media)? ./danfe From owner-svn-src-all@freebsd.org Sat Jan 13 08:16:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5289E7C832; Sat, 13 Jan 2018 08:16:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C11B97AED8; Sat, 13 Jan 2018 08:16:11 +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 11C7A104FB; Sat, 13 Jan 2018 08:16:11 +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 w0D8GAMM024088; Sat, 13 Jan 2018 08:16:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D8GAfG024087; Sat, 13 Jan 2018 08:16:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801130816.w0D8GAfG024087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 13 Jan 2018 08:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327912 - 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: 327912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 08:16:12 -0000 Author: cy Date: Sat Jan 13 08:16:10 2018 New Revision: 327912 URL: https://svnweb.freebsd.org/changeset/base/327912 Log: Though this block of code is not used by FreeBSD, correct a call to sprintf() with a macro call to SNPRINTF similar to other calls to SNPRINTF within this same block. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Modified: head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Sat Jan 13 04:53:04 2018 (r327911) +++ head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Sat Jan 13 08:16:10 2018 (r327912) @@ -2136,7 +2136,7 @@ ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen) SNPRINTF(s, left, "%x:%x", a >> 16, a & 0xffff); left -= strlen(s); s += strlen(s); - sprintf(s, "|%d|\r\n", port); + SNPRINTF(s, left, "|%d|\r\n", port); #else (void) sprintf(s, "EPRT %c2%c", delim, delim); s += strlen(s); From owner-svn-src-all@freebsd.org Sat Jan 13 08:19:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD5EE7CB54; Sat, 13 Jan 2018 08:19:16 +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 E0F4C7B152; Sat, 13 Jan 2018 08:19:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id aH1ueuiePS7BpaH1vexi26; Sat, 13 Jan 2018 01:19:09 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=RgaUWeydRksA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VSQ6hZaGqi40Q9fsQmUA: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 95E0D3A7; Sat, 13 Jan 2018 00:19:06 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w0D8J6f7006350; Sat, 13 Jan 2018 00:19:06 -0800 (PST) (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 w0D8J6gn006347; Sat, 13 Jan 2018 00:19:06 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201801130819.w0D8J6gn006347@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 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: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327912 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Sat, 13 Jan 2018 08:16:10 +0000." <201801130816.w0D8GAfG024087@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 13 Jan 2018 00:19:06 -0800 X-CMAE-Envelope: MS4wfCXfxTudW2b2Oj2pY5fCGx6L7qRUcU0H8ZqFAVNvi8E4JaJI1LW6qk0p30IK6UM4OYDb2w1w0vXV8vLt2fqBdZwcHTHuJRtkp3LmmG886KxIOTYqQ7cz WPHvFH73o91R6amuzyftACvd8+lAJQx/RnuGldXJv9ppg+wCVGlx2k21o6ZC04MxMNoZlFxbRFAzrRVZBAhViW+AbVdzEYW3dVhsGgyHQ4LIK7ehBCZBE7DV 14Q2sF6iAk3rwApDRHC2uNAgaiOTJn7CvViyJBQ6j6U5jMwdWD5G0qSNBpReorVh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 08:19:16 -0000 In message <201801130816.w0D8GAfG024087@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Sat Jan 13 08:16:10 2018 > New Revision: 327912 > URL: https://svnweb.freebsd.org/changeset/base/327912 > > Log: > Though this block of code is not used by FreeBSD, correct a call to > sprintf() with a macro call to SNPRINTF similar to other calls to > SNPRINTF within this same block. > > MFC after: 1 week > > Modified: > head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Sat Jan 13 04:53:04 201 > 8 (r327911) > +++ head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Sat Jan 13 08:16:10 201 > 8 (r327912) > @@ -2136,7 +2136,7 @@ ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen) > SNPRINTF(s, left, "%x:%x", a >> 16, a & 0xffff); > left -= strlen(s); > s += strlen(s); > - sprintf(s, "|%d|\r\n", port); > + SNPRINTF(s, left, "|%d|\r\n", port); > #else > (void) sprintf(s, "EPRT %c2%c", delim, delim); > s += strlen(s); Lest anyone fret, sprintf --> snprintf for ipfilter is being worked on and is currently stashed in one of my working directories. -- 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 Sat Jan 13 08:28:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9206E7D417; Sat, 13 Jan 2018 08:28:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 844E17BC19; Sat, 13 Jan 2018 08:28:47 +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 C161F10699; Sat, 13 Jan 2018 08:28:46 +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 w0D8SkH3028823; Sat, 13 Jan 2018 08:28:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D8SkmK028822; Sat, 13 Jan 2018 08:28:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201801130828.w0D8SkmK028822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 13 Jan 2018 08:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327913 - 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: 327913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 08:28:47 -0000 Author: cy Date: Sat Jan 13 08:28:46 2018 New Revision: 327913 URL: https://svnweb.freebsd.org/changeset/base/327913 Log: Remove redundant variable. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Sat Jan 13 08:16:10 2018 (r327912) +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Sat Jan 13 08:28:46 2018 (r327913) @@ -103,7 +103,6 @@ buildnodes(addr, mask, nodes) ipf_rdx_node_t nodes[2]; { u_32_t maskbits; - u_32_t lastbits; u_32_t lastmask; u_32_t *last; int masklen; @@ -117,7 +116,6 @@ buildnodes(addr, mask, nodes) masklen = last - (u_32_t *)mask; lastmask = *last; } - lastbits = maskbits & 0x1f; bzero(&nodes[0], sizeof(ipf_rdx_node_t) * 2); nodes[0].maskbitcount = maskbits; From owner-svn-src-all@freebsd.org Sat Jan 13 09:26:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1980E7FDBF; Sat, 13 Jan 2018 09:26:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC72D7DC77; Sat, 13 Jan 2018 09:26:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3B7B11033; Sat, 13 Jan 2018 09:26:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D9QODo053389; Sat, 13 Jan 2018 09:26:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D9QOn9053388; Sat, 13 Jan 2018 09:26:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201801130926.w0D9QOn9053388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 13 Jan 2018 09:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327914 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 09:26:25 -0000 Author: mjg Date: Sat Jan 13 09:26:24 2018 New Revision: 327914 URL: https://svnweb.freebsd.org/changeset/base/327914 Log: sx: retry hard shared unlock just like in r327905 for rwlocks Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Jan 13 08:28:46 2018 (r327913) +++ head/sys/kern/kern_sx.c Sat Jan 13 09:26:24 2018 (r327914) @@ -1193,7 +1193,7 @@ _sx_sunlock_try(struct sx *sx, uintptr_t *xp) static void __noinline _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { - int wakeup_swapper; + int wakeup_swapper = 0; uintptr_t setx; if (SCHEDULER_STOPPED()) @@ -1213,6 +1213,9 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_ for (;;) { MPASS(x & SX_LOCK_EXCLUSIVE_WAITERS); MPASS(!(x & SX_LOCK_SHARED_WAITERS)); + if (_sx_sunlock_try(sx, &x)) + break; + /* * Wake up semantic here is quite simple: * Just wake up all the exclusive waiters. From owner-svn-src-all@freebsd.org Sat Jan 13 09:28:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87AF5E7FF8E; Sat, 13 Jan 2018 09:28:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 634077DE57; Sat, 13 Jan 2018 09:28:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC34E11035; Sat, 13 Jan 2018 09:28:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D9ShtW053506; Sat, 13 Jan 2018 09:28:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D9Sh5s053505; Sat, 13 Jan 2018 09:28:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801130928.w0D9Sh5s053505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 13 Jan 2018 09:28:43 +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: r327915 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 327915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 09:28:44 -0000 Author: eadler Date: Sat Jan 13 09:28:43 2018 New Revision: 327915 URL: https://svnweb.freebsd.org/changeset/base/327915 Log: MFC r324206: bsdinstall(8) hardening menu: Utilize new kern.randompid=1 behaviour Enabling the PID randomization option in bsdinstall(8)'s hardening menu now randomizes the effective value of kern.randompid on each boot. Previous behaviour: When kern.randompid was enabled via the the bsdinstall(8) hardening menu, a random value was generated and placed in the systems /etc/sysctl.conf as kern.randompid=value This makes the value of kern.randompid static across reboots. New behaviour: When kern.randompid is enabled via the bsdinstall(8) hardening menu, the line kern.randompid=1 is placed in the systems /etc/sysctl.conf. This takes advantage of a new kernel feature and makes the value of kern.randompid be randomized by the kernel on each reboot. Modified: stable/11/usr.sbin/bsdinstall/scripts/hardening Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/hardening ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/hardening Sat Jan 13 09:26:24 2018 (r327914) +++ stable/11/usr.sbin/bsdinstall/scripts/hardening Sat Jan 13 09:28:43 2018 (r327915) @@ -62,7 +62,7 @@ for feature in $FEATURES; do echo security.bsd.unprivileged_proc_debug=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi if [ "$feature" = "random_pid" ]; then - echo kern.randompid=$(jot -r 1 9999) >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + echo kern.randompid=1 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi if [ "$feature" = "stack_guard" ]; then echo security.bsd.stack_guard_page=1 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening From owner-svn-src-all@freebsd.org Sat Jan 13 09:30:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72FC5EA50E5; Sat, 13 Jan 2018 09:30:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4717DFC3; Sat, 13 Jan 2018 09:30:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA931103A; Sat, 13 Jan 2018 09:30:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0D9UYIu053626; Sat, 13 Jan 2018 09:30:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0D9UYW3053625; Sat, 13 Jan 2018 09:30:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801130930.w0D9UYW3053625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 13 Jan 2018 09:30: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: r327916 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 327916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 09:30:35 -0000 Author: eadler Date: Sat Jan 13 09:30:34 2018 New Revision: 327916 URL: https://svnweb.freebsd.org/changeset/base/327916 Log: MFC r323390: If the user tries to set kern.randompid to 1 (which is meaningless), set it to a random value between 100 and 1123, rather than 0 as before. Modified: stable/11/sys/kern/kern_fork.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Sat Jan 13 09:28:43 2018 (r327915) +++ stable/11/sys/kern/kern_fork.c Sat Jan 13 09:30:34 2018 (r327916) @@ -208,20 +208,26 @@ sysctl_kern_randompid(SYSCTL_HANDLER_ARGS) pid = randompid; error = sysctl_handle_int(oidp, &pid, 0, req); if (error == 0 && req->newptr != NULL) { - if (pid < 0 || pid > pid_max - 100) /* out of range */ - pid = pid_max - 100; - else if (pid < 2) /* NOP */ - pid = 0; - else if (pid < 100) /* Make it reasonable */ - pid = 100; - randompid = pid; + if (pid == 0) + randompid = 0; + else if (pid == 1) + /* generate a random PID modulus between 100 and 1123 */ + randompid = 100 + arc4random() % 1024; + else if (pid < 0 || pid > pid_max - 100) + /* out of range */ + randompid = pid_max - 100; + else if (pid < 100) + /* Make it reasonable */ + randompid = 100; + else + randompid = pid; } sx_xunlock(&allproc_lock); return (error); } SYSCTL_PROC(_kern, OID_AUTO, randompid, CTLTYPE_INT|CTLFLAG_RW, - 0, 0, sysctl_kern_randompid, "I", "Random PID modulus"); + 0, 0, sysctl_kern_randompid, "I", "Random PID modulus. Special values: 0: disable, 1: choose random value"); static int fork_findpid(int flags) From owner-svn-src-all@freebsd.org Sat Jan 13 11:59:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E3BE5CAFB; Sat, 13 Jan 2018 11:59:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD9AD82761; Sat, 13 Jan 2018 11:59:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A0BF1286A; Sat, 13 Jan 2018 11:59:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DBxnEW016240; Sat, 13 Jan 2018 11:59:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DBxnBd016239; Sat, 13 Jan 2018 11:59:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801131159.w0DBxnBd016239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 13 Jan 2018 11:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327917 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 11:59:51 -0000 Author: kib Date: Sat Jan 13 11:59:49 2018 New Revision: 327917 URL: https://svnweb.freebsd.org/changeset/base/327917 Log: Add sysctl debug.kdb.stack_overflow to conveniently test kernel handling of the kstack overflow. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Sat Jan 13 09:30:34 2018 (r327916) +++ head/sys/kern/subr_kdb.c Sat Jan 13 11:59:49 2018 (r327917) @@ -85,6 +85,7 @@ static int kdb_sysctl_enter(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_panic(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_trap(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS); +static int kdb_sysctl_stack_overflow(SYSCTL_HANDLER_ARGS); static SYSCTL_NODE(_debug, OID_AUTO, kdb, CTLFLAG_RW, NULL, "KDB nodes"); @@ -110,6 +111,10 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); +SYSCTL_PROC(_debug_kdb, OID_AUTO, stack_overflow, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, + kdb_sysctl_stack_overflow, "I", "set to cause a stack overflow"); + SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, CTLFLAG_RWTUN | CTLFLAG_SECURE, &kdb_break_to_debugger, 0, "Enable break to debugger"); @@ -224,6 +229,36 @@ kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS) (*fp)(0x11111111, 0x22222222, 0x33333333); return (0); } + +static void kdb_stack_overflow(volatile int *x) __noinline; +static void +kdb_stack_overflow(volatile int *x) +{ + + if (*x > 10000000) + return; + kdb_stack_overflow(x); + *x += PCPU_GET(cpuid) / 1000000; +} + +static int +kdb_sysctl_stack_overflow(SYSCTL_HANDLER_ARGS) +{ + int error, i; + volatile int x; + + error = sysctl_wire_old_buffer(req, sizeof(int)); + if (error == 0) { + i = 0; + error = sysctl_handle_int(oidp, &i, 0, req); + } + if (error != 0 || req->newptr == NULL) + return (error); + x = 0; + kdb_stack_overflow(&x); + return (0); +} + void kdb_panic(const char *msg) From owner-svn-src-all@freebsd.org Sat Jan 13 12:28:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45065E61EFE; Sat, 13 Jan 2018 12:28:29 +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 C2E67838B3; Sat, 13 Jan 2018 12:28: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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id DCBF4104B035; Sat, 13 Jan 2018 22:56:29 +1100 (AEDT) Date: Sat, 13 Jan 2018 22:56:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327767 - in head/sys: conf i386/bios i386/conf i386/isa In-Reply-To: <201801101459.w0AExJWM055025@repo.freebsd.org> Message-ID: <20180113203848.L2336@besplex.bde.org> References: <201801101459.w0AExJWM055025@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=YbvN30Zf c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=kWmvSgFVWL--hNsEXKIA:9 a=FGfX17d0zrhrSsFC:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 12:28:29 -0000 On Wed, 10 Jan 2018, Warner Losh wrote: > Log: > Retire pmtimer driver. Move time fixing into apm driver. Move > Iwasaki-san's copyright over. Remove FIXME code that couldn't possibly > work. Call tc_settime() with our estimate of the delta we've been > alseep (the one we print) to adjust the time. Not sure what to do > about callouts, so keep the small #ifdef in place there. The FIXME code might have worked before timecounters, but never worked in any committed version. You seem to have updated it correctly for timecounters in this commit, but then broke it by removing it in a later commit (see another reply). This commit obfuscates the fix by combining moving of the file with changing it. svn is also very broken -- it doesn't show history of the file under its old name. This is more broken than usual -- since the file was merged into a different file, svn doesn't show history of the file under its new name either. The callout fixup code is more broken. It never compiled in any committed version, since it uses data structures and logic that went away before it was committed. The option for it (APM_FIXUP_CALLTODO) is so broken that it is not a supported option or in LINT, so it is not normally noticed that the code under it never compiled. Long callouts are especially broken. E.g., nanosleep(1 hour) at least used to sleep for 2 hours if the system is suspended for 1 hour during the sleep. I haven't noticed any fixes for this. Callouts mostly use relative timeouts, and relative timeouts just don't work across suspensions. Actually, I have noticed some fixes for nanosleep(). Another bug in it was that it is specified to sleep in the time specified by the clock id CLOCK_REALTIME, but used to sleep in the time specified by the clock id CLOCK_MONOTONIC (the latter should be as close as possible to the former except for leap seconds adjustments, but is quite broken -- it doesn't count suspended time, and non-leap seconds settings of CLOCK_REALTIME also make CLOCK_MONOTONIC useless for determining physical time differences. nanosleep() now sleeps on the correct clock id, and clock_nanosleep() is now implemented. This is complicated, and I haven't checked if the fix works. It looks to simple to work. To work, it needs to do things like adjust timers whenever the timecounter jumps (mainly for resume and leap seconds adjustments). APM_FIXUP_CALLTODO only tries to handle the easier case of resume. > Modified: head/sys/conf/files.i386 > ============================================================================== > --- head/sys/conf/files.i386 Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/conf/files.i386 Wed Jan 10 14:59:19 2018 (r327767) > @@ -520,7 +520,6 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 > i386/ibcs2/ibcs2_xenix.c optional ibcs2 > i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 > i386/ibcs2/imgact_coff.c optional ibcs2 > -i386/isa/pmtimer.c optional pmtimer > i386/isa/prof_machdep.c optional profiling-routine > i386/linux/imgact_linux.c optional compat_linux > i386/linux/linux_dummy.c optional compat_linux pmtimer used to be needed all systems with acpi except amd64, because the acpi fixup of timecounters was bogusly ifdefed for amd64 only (or was not done by acpi in very old versions?). The pmtimer code for this fixup is still better tha the acpi code, except the FIXME made it unused and the next commit dumbs it down to worse than the acpi code (the acpi code is at least simpler). > Modified: head/sys/i386/bios/apm.c > ============================================================================== > --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) > Modified: head/sys/i386/bios/apm.c > ============================================================================== > --- head/sys/i386/bios/apm.c Wed Jan 10 14:58:58 2018 (r327766) > +++ head/sys/i386/bios/apm.c Wed Jan 10 14:59:19 2018 (r327767) > @@ -205,7 +232,7 @@ static int > apm_driver_version(int version) > { > struct apm_softc *sc = &apm_softc; > - > + > sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; > sc->bios.r.ebx = 0x0; > sc->bios.r.ecx = version; Unrelated style fixes make the important changes harder to see. This patch was to remove trailing whitespace, but some mail program broke it by removing the whitespace in the source lines. [... further mangled patches for whitespace not shown] > @@ -331,12 +358,10 @@ apm_battery_low(void) > static struct apmhook * > apm_add_hook(struct apmhook **list, struct apmhook *ah) > { > - int s; > struct apmhook *p, *prev; > > APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); > > - s = splhigh(); > if (ah == NULL) > panic("illegal apm_hook!"); > prev = NULL; > @@ -351,30 +376,25 @@ apm_add_hook(struct apmhook **list, struct apmhook *ah > ah->ah_next = prev->ah_next; > prev->ah_next = ah; > } > - splx(s); > return ah; > } This commit also removes spl*() with no mention of this in the log message. In FreeBSD-4 where spl's were not null, splhigh() was probably wrong, but it was much better than the splsoftclock() used in pmtimer.c. Hard clock interrupts should be disabled, and my fixes for this change softclock to statclock + XXX. It happens that splstatclock() == splclock() == splhigh(), so these splhigh()s were good enough. Now the locking is obscure. I think it is just Giant, and that is not enough. The spl's should not be removed until the locking is done properly. The splsoftclock()'s were removed even earlier in pmtimer.c, without doing any proper locking of course. > static void > apm_del_hook(struct apmhook **list, struct apmhook *ah) > { > - int s; > struct apmhook *p, *prev; > > - s = splhigh(); > prev = NULL; > for (p = *list; p != NULL; prev = p, p = p->ah_next) > if (p == ah) > goto deleteit; > panic("Tried to delete unregistered apm_hook."); > - goto nosuchnode; > + return; > deleteit: > if (prev != NULL) > prev->ah_next = p->ah_next; > else > *list = p->ah_next; > -nosuchnode: > - splx(s); > } Locking for device removal is especially necessary and badly done. New-bus forces lots of Giant locking which is probably not enough. > @@ -1047,6 +1067,53 @@ apm_processevent(void) > } while (apm_event != PMEV_NOEVENT); > } > > +static struct timeval suspend_time; > +static struct timeval diff_time; > + > +static int > +apm_rtc_suspend(void *arg __unused) > +{ > + > + microtime(&diff_time); > + inittodr(0); > + microtime(&suspend_time); > + timevalsub(&diff_time, &suspend_time); > + return (0); > +} This calculates the difference for use later, using a hackish method: - this used to be bogusly locked by - microtime(&diff_time) gives the current time in a good way - start hacking with inittodr(0). inittodr() reads the time from the RTC and adds the nasty global timezone offset to it. Without the latter, the new time set by inittodr() would be off by up to 12 hours. With the latter, it might still be off by 1 hour for a DST adjustment, depending on races between this and settimeofday(2) and adjkerntz(8) and certain racy sysctls, and it it is usually off by many seconds due to different drift of the RTC and the current time. The purpose of this function is to determine the drift at suspend time so as to add it back at resume time. This also handles timezone offsets even if inittodr() doesn't add them, and might reduce races for adjusting the timezone offset for DST. > + > +static int > +apm_rtc_resume(void *arg __unused) > +{ > + u_int second, minute, hour; > + struct timeval resume_time, tmp_time; > + struct timespec ts; > + > + /* modified for adjkerntz */ Cryptic comment from old code. This is related to the timezone offset, but I don't see how adjkerntz benefits in practice from old modifications made here. It only obviously benefits in theory from smaller races. > + timer_restore(); /* restore the all timers */ Old banal comment. timer_restore() function only exists on i386, and only restores 2 isa timers (i8254 and rtc), so moving its code out of isa is a layering violation. > + inittodr(0); /* adjust time to RTC */ Banal comment. Also wrong when the RTC time is local. > + microtime(&resume_time); > + getmicrotime(&tmp_time); The previous line is bad old code. We want to do arithmetic using resume_time and should copy it to tmp_time. Instead, we use the getmicrotime() mistake to fetch a truncated copy of a time slightly later than resume_time. > + timevaladd(&tmp_time, &diff_time); diff_time is the difference at suspend time and this adds it to resume_time (modulo the truncation). This gives correct-as-possible resume_time. > + /* Calculate the delta time suspended */ > + timevalsub(&resume_time, &suspend_time); > + > + second = ts.tv_sec = resume_time.tv_sec; > + ts.tv_nsec = 0; > + tc_setclock(&ts); This used to be better, except tc_setclock() was 'time = tmp_time' under FIXME. The calculation of the time suspended is convolved with fixing up the timecounter, and there is a comment about the relatively simple calculation of the time suspended and none about the convulutions or the more delicate fixup. > + > +#ifdef PMTIMER_FIXUP_CALLTODO > + /* Fixup the calltodo list with the delta time. */ > + adjust_timeout_calltodo(&resume_time); > +#endif /* PMTIMER_FIXUP_CALLTODO */ This has several style bugs together with its option being unusable. It further abuses resume_time. resume_time was initially actually the resume time before the fixup. The fixed up resume time is now in ts. We calculated this using tmp_time to keep the initial resume_time alive for using in another caclulation. Then the other calculation abuses resume_time for the delta time needed by the uncallable fixup. The comment unobfuscates this a but by describing the abused resume_time as the delta time. > + hour = second / 3600; > + second %= 3600; > + minute = second / 60; > + second %= 60; > + log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", > + hour, minute, second); > + return (0); With the FIXME version, almost everything was unused except for printing this msssage. This message is useful for debugging, but acpi never bothered doing it. > +} In the version with the FIXME, the careful fixups done by pmtimer reduce to just inittodr(0) plus printing the delta. In this version, the timecounter fixup actually works so the careful setup for this is undone, but things are convoluted with the unreachale callout fixup and printing the delta. acpi just does 2 timecounter warmups followed by inittodr(time_second + scp->acpi_sleep_delay). Here the arg is differently wrong. An arg of 0 says that we have no idea of the time and the raw RTC time should be used. time_second is the time in seconds before the system is fully resumed. This is probably the time in seconds when the system was suspended (since interrupts didn't run during suspension and if clock interrupts occurred before here, they would do nothing good. acpi_sleep_delay is just a forced delay during suspension. If it works at all, then updates of time_second have halted before the delay, and the arg is our best guess of the actual suspension time. IIRC, the arg is only used in the unlikely event that reading the RTC fails. pmtimer doesn't bother passing a nonzero arg. Bugs here are masked by other bugs: - at least x86 RTC-reading code is sloppy and only reads the RTC to the nearest second. So we expect an error of a second or 2 after suspend/ resume. This is too large for ntpd to fix well, so the best that can happen (without a resume script that repeats boot time ntpd initialization) is that ntpd is running and quickly notices that the offset is too large and steps the clock to fix it. Backwards steps are very bad, so the resume code should try to set to an earlier time. - when nptd is running, the current time may have been written to the RTC quite often. This probably keeps the timecounter fixup less than a few seconds although x86 RTC-writing code is sloppy and gives another source of errors. - if an error related to the timezone offset occurs or if the timecounter fixup is not applied, then the enormous error from this might be a feature. Hopefully ntpd is running and recovers faster if the error is enormous. (I think it actually doesn't do this right. It has a limit like 900 seconds and can step more than that to act a but like ntpdate when invoked with certain options, but you normally want it to do only 1 large step. Restarting it with these options after every resume is best.) Bruce From owner-svn-src-all@freebsd.org Sat Jan 13 13:38:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE6CE65997; Sat, 13 Jan 2018 13:38:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 0561821C0; Sat, 13 Jan 2018 13:38:16 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 073A61A60D9; Sun, 14 Jan 2018 00:17:51 +1100 (AEDT) Date: Sun, 14 Jan 2018 00:17:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327774 - in head: . sys/i386/bios In-Reply-To: <201801101725.w0AHP8Ca020379@repo.freebsd.org> Message-ID: <20180113225638.Q2336@besplex.bde.org> References: <201801101725.w0AHP8Ca020379@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=YbvN30Zf c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=E3LQvFw-N6LwsXHdYfEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 13:38:17 -0000 On Wed, 10 Jan 2018, Warner Losh wrote: > Log: > inittodr(0) actually sets the time, so there's no need to call > tc_setclock(). It's redundant. Tweak UPDATING based on code review of > past releases. No, tc_setclock() is not redundant (except for bugs). initodr(0) sets a raw RTC time (plus a racy timezone offset). tc_setclock() is supposed to fix this up to a less raw time using calculations done at suspend time. The calculations are still done, so are even more bogus then when the fixup was null under FIXME (then the FIXME a least indicated what needed to be done). > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Wed Jan 10 16:56:02 2018 (r327773) > +++ head/UPDATING Wed Jan 10 17:25:08 2018 (r327774) > @@ -53,8 +53,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > 20180110: > On i386, pmtimer has been removed. It's functionality has been folded > - into apm. It was a nop on ACPI. Users may need to remove it from kernel > - config files. > + into apm. It was a nop on ACPI in current for a while now (but was still > + needed on i386 in FreeBSD 11 and earlier). Users may need to remove it > + from kernel config files. It is indeed still needed in FreeBSD-11. acpci resume is still broken there on all arches except amd64, by bogusly ifdefing acpi_resync_clock() to do nothing except on amd64 (and even on amd64, there is a sysctl to give the same brokenness). pmtimer was made a no-op if acpi is configured in the same commit that fixed acpi resume. > Modified: head/sys/i386/bios/apm.c > ============================================================================== > --- head/sys/i386/bios/apm.c Wed Jan 10 16:56:02 2018 (r327773) > +++ head/sys/i386/bios/apm.c Wed Jan 10 17:25:08 2018 (r327774) > @@ -1086,7 +1086,6 @@ apm_rtc_resume(void *arg __unused) > { > u_int second, minute, hour; > struct timeval resume_time, tmp_time; > - struct timespec ts; > > /* modified for adjkerntz */ > timer_restore(); /* restore the all timers */ > @@ -1097,14 +1096,11 @@ apm_rtc_resume(void *arg __unused) > /* Calculate the delta time suspended */ > timevalsub(&resume_time, &suspend_time); > > - second = ts.tv_sec = resume_time.tv_sec; > - ts.tv_nsec = 0; > - tc_setclock(&ts); > - The carefully calculated tmp_time is no longer used. It wasn't used before either, since ts was initialized to a wrong value. tmp_time was last used under FIXME, but that shouldn't have compiled either since FIXME was undefineable -- tmp_time as a write-only auto variable in all cases. The non-use of some of the other timestamp variables is harder to detect since they are static. tc_setclock() takes a delta-time as an arg. resume_time is already a delta-time, but I think it is complete garbage. resume_time was initially actually the resume time, but is abused to hole the suspension interval (delta-time). inittodr(0) already advanced the timecounter by approximately the suspension interval, and inittodr(&ts) gives a garbage time by advancing by this again. I think the correct second advance is simply diff_time which was calculated earlier. The dead tmp_time is + diff_time. This was only used in the unreachable FIXME code because the "API" for that needed an absolute time. Untested fixes: X Index: apm.c X =================================================================== X --- apm.c (revision 327911) X +++ apm.c (working copy) X @@ -1067,17 +1067,17 @@ X } while (apm_event != PMEV_NOEVENT); X } X X -static struct timeval suspend_time; X -static struct timeval diff_time; X +static struct timespec diff_time; X +static struct timespec suspend_time; X X static int X apm_rtc_suspend(void *arg __unused) X { X X - microtime(&diff_time); X - inittodr(0); X - microtime(&suspend_time); X - timevalsub(&diff_time, &suspend_time); X + nanotime(&diff_time); /* not a difference yet */ X + inittodr(0); /* set tc to raw time seen by RTC */ X + nanotime(&suspend_time); /* record this raw time */ X + timespecsub(&diff_time, &suspend_time); /* diff between tc and RTC */ X return (0); X } X X @@ -1084,23 +1084,22 @@ X static int X apm_rtc_resume(void *arg __unused) X { X + struct timespec resume_time, suspend_interval; X u_int second, minute, hour; This already changes too much, so I didn't fix blind truncation of tv_sec starting in 2038 or other type botches for second/minute/hour. X - struct timeval resume_time, tmp_time; X X - /* modified for adjkerntz */ X - timer_restore(); /* restore the all timers */ X - inittodr(0); /* adjust time to RTC */ X - microtime(&resume_time); X - getmicrotime(&tmp_time); X - timevaladd(&tmp_time, &diff_time); X + timer_restore(); X + inittodr(0); /* set tc to new raw RTC time */ X + nanotime(&resume_time); /* record this raw time */ X + tc_setclock(&diff_time); /* restore old diff to tc */ Fixing tc_setclock() is the easiest part. X + X /* Calculate the delta time suspended */ X - timevalsub(&resume_time, &suspend_time); X + suspend_interval = resume_time; X + timevalsub(&suspend_interval, &suspend_time); There are to many comments. I forgot to remove the one above after unobfuscating resume_time. X X -#ifdef PMTIMER_FIXUP_CALLTODO X - /* Fixup the calltodo list with the delta time. */ X - adjust_timeout_calltodo(&resume_time); X -#endif /* PMTIMER_FIXUP_CALLTODO */ X - second = resume_time.tv_sec; X +#ifdef PMTIMER_FIXUP_CALLTODO /* XXX needed unconditionally, but never worked */ X + adjust_timeout_calltodo(&suspend_interval); X +#endif X + second = suspend_interval.tv_sec; X hour = second / 3600; X second %= 3600; X minute = second / 60; Bruce From owner-svn-src-all@freebsd.org Sat Jan 13 13:59:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 861E9E66A8D; Sat, 13 Jan 2018 13:59:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 600BA2E61; Sat, 13 Jan 2018 13:59:36 +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 9729B13BE7; Sat, 13 Jan 2018 13:59:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DDxZiD067492; Sat, 13 Jan 2018 13:59:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DDxZur067490; Sat, 13 Jan 2018 13:59:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801131359.w0DDxZur067490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 13 Jan 2018 13:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327919 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 13:59:36 -0000 Author: tuexen Date: Sat Jan 13 13:59:35 2018 New Revision: 327919 URL: https://svnweb.freebsd.org/changeset/base/327919 Log: Add support for readv() and writev() to truss. Sponsored by: Netflix, Inc. Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Sat Jan 13 13:53:05 2018 (r327918) +++ head/usr.bin/truss/syscall.h Sat Jan 13 13:59:35 2018 (r327919) @@ -82,7 +82,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, + PSig, Siginfo, Kevent11, Iovec, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Jan 13 13:53:05 2018 (r327918) +++ head/usr.bin/truss/syscalls.c Sat Jan 13 13:59:35 2018 (r327919) @@ -386,6 +386,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, + { .name = "readv", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, @@ -520,6 +522,8 @@ static struct syscall decoded_syscalls[] = { { Siginfo | OUT, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, + { .name = "writev", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, /* Linux ABI */ { .name = "linux_access", .ret_type = 1, .nargs = 2, @@ -2137,6 +2141,68 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, " }"); } else fprintf(fp, "0x%lx", args[sc->offset]); + break; + } +#define IOV_LIMIT 26 + case Iovec: { + /* + * Print argument as an array of struct iovec, where the next + * syscall argument is the number of elements of the array. + */ + struct iovec iov[IOV_LIMIT]; + size_t max_string = trussinfo->strsize; + char tmp2[max_string + 1], *tmp3; + size_t len; + int i, iovcnt; + bool buf_truncated, iov_truncated; + + iovcnt = args[sc->offset + 1]; + if (iovcnt <= 0) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + if (iovcnt > IOV_LIMIT) { + iovcnt = IOV_LIMIT; + iov_truncated = true; + } else { + iov_truncated = false; + } + if (get_struct(pid, (void *)args[sc->offset], + &iov, iovcnt * sizeof(struct iovec)) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + + fprintf(fp, "%s", "["); + for (i = 0; i < iovcnt; i++) { + len = iov[i].iov_len; + if (len > max_string) { + len = max_string; + buf_truncated = true; + } else { + buf_truncated = false; + } + fprintf(fp, "%s{", (i > 0) ? "," : ""); + if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) + != -1) { + tmp3 = malloc(len * 4 + 1); + while (len) { + if (strvisx(tmp3, tmp2, len, + VIS_CSTYLE|VIS_TAB|VIS_NL) <= + (int)max_string) + break; + len--; + buf_truncated = true; + } + fprintf(fp, "\"%s\"%s", tmp3, + buf_truncated ? "..." : ""); + free(tmp3); + } else { + fprintf(fp, "0x%p", iov[i].iov_base); + } + fprintf(fp, ",%zu}", iov[i].iov_len); + } + fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); break; } From owner-svn-src-all@freebsd.org Sat Jan 13 14:10:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3461E684CC; Sat, 13 Jan 2018 14:10:07 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6413669; Sat, 13 Jan 2018 14:10:07 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C121413D8A; Sat, 13 Jan 2018 14:10:06 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DEA61X071621; Sat, 13 Jan 2018 14:10:06 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DEA6Xn071615; Sat, 13 Jan 2018 14:10:06 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201801131410.w0DEA6Xn071615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 13 Jan 2018 14:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327920 - in stable/11: share/man/man4 sys/conf sys/dev/watchdog sys/kern sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: karels X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/watchdog sys/kern sys/sys X-SVN-Commit-Revision: 327920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 14:10:07 -0000 Author: karels Date: Sat Jan 13 14:10:05 2018 New Revision: 327920 URL: https://svnweb.freebsd.org/changeset/base/327920 Log: MFC r327505: make SW_WATCHDOG dynamic Enable the hardclock-based watchdog previously conditional on the SW_WATCHDOG option whenever hardware watchdogs are not found, and watchdogd attempts to enable the watchdog. The SW_WATCHDOG option still causes the sofware watchdog to be enabled even if there is a hardware watchdog. This does not change the other software-based watchdog enabled by the --softtimeout option to watchdogd. Note that the code to reprime the watchdog during kernel core dumps is no longer conditional on SW_WATCHDOG. I think this was previously a bug. Reviewed by: imp alfred bjk MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13713 Modified: stable/11/share/man/man4/watchdog.4 stable/11/sys/conf/NOTES stable/11/sys/dev/watchdog/watchdog.c stable/11/sys/kern/kern_clock.c stable/11/sys/kern/kern_dump.c stable/11/sys/sys/watchdog.h Modified: stable/11/share/man/man4/watchdog.4 ============================================================================== --- stable/11/share/man/man4/watchdog.4 Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/share/man/man4/watchdog.4 Sat Jan 13 14:10:05 2018 (r327920) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2009 +.Dd January 2, 2018 .Dt WATCHDOG 4 .Os .Sh NAME @@ -40,8 +40,11 @@ facility is used for controlling hardware and software .Pp The device .Pa /dev/fido -responds to a single +supports several optional .Xr ioctl 2 +calls for configuration, and +responds to a single operational +.Xr ioctl call, .Dv WDIOCPATPAT . It takes a single argument which represents a timeout value specified as a @@ -60,12 +63,16 @@ indicates that the will be kept from timing out from the kernel. .Pp The +.Dv WDIOCPATPAT .Xr ioctl 2 call will return success if just one of the available .Xr watchdog 9 implementations supports setting the timeout to the specified timeout. This means that at least one watchdog is armed. +By default, this will be a hardware watchdog if one is present, but if +no hardware watchdog is able to process the request, a default software +watchdog is enabled. If the call fails, for instance if none of .Xr watchdog 9 @@ -77,8 +84,53 @@ To disable the watchdogs pass If disarming the watchdog(s) failed an error is returned. The watchdog might still be armed! +.Pp +The optional configuration +.Xr ioctl +commands are listed here, along with the type of the parameter used. +Examples of their use can be found in +.Xr watchdogd 8 . +.Bl -tag -width "WDIOC_SETSOFTTIMEOUTACT int " +.It Dv WDIOC_SETTIMEOUT Fa int +set/reset the timer +.It Dv WDIOC_GETTIMEOUT Fa int +get total timeout +.It Dv WDIOC_GETTIMELEFT Fa int +get time left +.It Dv WDIOC_GETPRETIMEOUT Fa int +get the pre-timeout +.It Dv WDIOC_SETPRETIMEOUT Fa int +set the pre-timeout +.It Dv WDIOC_SETPRETIMEOUTACT Fa int +Set the action when a pre-timeout occurs (see +.Li WD_SOFT_* +below). +.It Dv WDIOC_SETSOFT Fa int +Use an internal software watchdog instead of hardware. +There is also an external software watchdog, which is used by default +if no hardware watchdog was attached. +.It Dv WDIOC_SETSOFTTIMEOUTACT Fa int +Set the action whan a soft timeout occurs. +.El +.Pp +The actions that may be specified for the pre-timeout or the internal software +watchdog are listed here. +Multiple actions can be specified by ORing values together. +.Bl -tag -width WD_SOFT_PRINT +.It Dv WD_SOFT_PANIC +panic +.It Dv WD_SOFT_DDB +enter debugger +.It Dv WD_SOFT_LOG +log(9) +.It Dv WD_SOFT_PRINT +printf(9) +.El .Sh RETURN VALUES -The ioctl returns zero on success and non-zero on failure. +The +.Dv WDIOCPATPAT +.Xr ioctl +returns zero on success and non-zero on failure. .Bl -tag -width Er .It Bq Er EOPNOTSUPP No watchdog present in the kernel or @@ -89,6 +141,10 @@ Watchdog could not be disabled (timeout value of 0). .It Bq Er EINVAL Invalid flag combination passed. .El +.Pp +The configuration +.Xr ioctl +operations return zero on success and non-zero on failure. .Sh EXAMPLES .Bd -literal -offset indent #include @@ -122,8 +178,10 @@ Enables a watchdog to recover from a potentially freez .Pp .Dl "options SW_WATCHDOG" .Pp -in your kernel config adds a software watchdog in the kernel, dropping to KDB -or panic-ing when firing. +in your kernel config forces a software watchdog in the kernel +to be configured even if a hardware watchdog is configured, +dropping to KDB or panicking when firing, depending +on the KDB and KDB_UNATTENDED kernel configuration options. .Sh SEE ALSO .Xr watchdogd 8 , .Xr watchdog 9 Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/sys/conf/NOTES Sat Jan 13 14:10:05 2018 (r327920) @@ -2656,7 +2656,9 @@ options BOOTP_WIRED_TO=fxp0 # Use interface fxp0 for options BOOTP_BLOCKSIZE=8192 # Override NFS block size # -# Add software watchdog routines. +# Enable software watchdog routines, even if hardware watchdog is present. +# By default, software watchdog timer is enabled only if no hardware watchdog +# is present. # options SW_WATCHDOG Modified: stable/11/sys/dev/watchdog/watchdog.c ============================================================================== --- stable/11/sys/dev/watchdog/watchdog.c Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/sys/dev/watchdog/watchdog.c Sat Jan 13 14:10:05 2018 (r327920) @@ -76,6 +76,9 @@ SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u_secs, CT static int wd_lastpat_valid = 0; static time_t wd_lastpat = 0; /* when the watchdog was last patted */ +/* Hook for external software watchdog to register for use if needed */ +void (*wdog_software_attach)(void); + static void pow2ns_to_ts(int pow2ns, struct timespec *ts) { @@ -118,6 +121,7 @@ int wdog_kern_pat(u_int utim) { int error; + static int first = 1; if ((utim & WD_LASTVAL) != 0 && (utim & WD_INTERVAL) > 0) return (EINVAL); @@ -159,6 +163,17 @@ wdog_kern_pat(u_int utim) } else { EVENTHANDLER_INVOKE(watchdog_list, utim, &error); } + /* + * If we no hardware watchdog responded, we have not tried to + * attach an external software watchdog, and one is available, + * attach it now and retry. + */ + if (error == EOPNOTSUPP && first && *wdog_software_attach != NULL) { + (*wdog_software_attach)(); + EVENTHANDLER_INVOKE(watchdog_list, utim, &error); + } + first = 0; + wd_set_pretimeout(wd_pretimeout, true); /* * If we were able to arm/strobe the watchdog, then Modified: stable/11/sys/kern/kern_clock.c ============================================================================== --- stable/11/sys/kern/kern_clock.c Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/sys/kern/kern_clock.c Sat Jan 13 14:10:05 2018 (r327920) @@ -333,15 +333,19 @@ read_cpu_time(long *cp_time) } } -#ifdef SW_WATCHDOG #include static int watchdog_ticks; static int watchdog_enabled; static void watchdog_fire(void); static void watchdog_config(void *, u_int, int *); -#endif /* SW_WATCHDOG */ +static void +watchdog_attach(void) +{ + EVENTHANDLER_REGISTER(watchdog_list, watchdog_config, NULL, 0); +} + /* * Clock handling routines. * @@ -409,8 +413,14 @@ initclocks(dummy) if (profhz == 0) profhz = i; psratio = profhz / i; + #ifdef SW_WATCHDOG - EVENTHANDLER_REGISTER(watchdog_list, watchdog_config, NULL, 0); + /* Enable hardclock watchdog now, even if a hardware watchdog exists. */ + watchdog_attach(); +#else + /* Volunteer to run a software watchdog. */ + if (wdog_software_attach == NULL) + wdog_software_attach = watchdog_attach; #endif } @@ -481,10 +491,8 @@ hardclock(int usermode, uintfptr_t pc) #ifdef DEVICE_POLLING hardclock_device_poll(); /* this is very short and quick */ #endif /* DEVICE_POLLING */ -#ifdef SW_WATCHDOG if (watchdog_enabled > 0 && --watchdog_ticks <= 0) watchdog_fire(); -#endif /* SW_WATCHDOG */ } void @@ -495,9 +503,7 @@ hardclock_cnt(int cnt, int usermode) struct proc *p = td->td_proc; int *t = DPCPU_PTR(pcputicks); int flags, global, newticks; -#ifdef SW_WATCHDOG int i; -#endif /* SW_WATCHDOG */ /* * Update per-CPU and possibly global ticks values. @@ -557,13 +563,11 @@ hardclock_cnt(int cnt, int usermode) atomic_store_rel_int(&devpoll_run, 0); } #endif /* DEVICE_POLLING */ -#ifdef SW_WATCHDOG if (watchdog_enabled > 0) { i = atomic_fetchadd_int(&watchdog_ticks, -newticks); if (i > 0 && i <= newticks) watchdog_fire(); } -#endif /* SW_WATCHDOG */ } if (curcpu == CPU_FIRST()) cpu_tick_calibration(); @@ -841,8 +845,6 @@ SYSCTL_PROC(_kern, KERN_CLOCKRATE, clockrate, 0, 0, sysctl_kern_clockrate, "S,clockinfo", "Rate and period of various kernel clocks"); -#ifdef SW_WATCHDOG - static void watchdog_config(void *unused __unused, u_int cmd, int *error) { @@ -891,5 +893,3 @@ watchdog_fire(void) panic("watchdog timeout"); #endif } - -#endif /* SW_WATCHDOG */ Modified: stable/11/sys/kern/kern_dump.c ============================================================================== --- stable/11/sys/kern/kern_dump.c Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/sys/kern/kern_dump.c Sat Jan 13 14:10:05 2018 (r327920) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_watchdog.h" - #include #include #include @@ -36,9 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG #include -#endif #include #include #include @@ -195,9 +191,7 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, int seqnr, vo } dumpsys_map_chunk(pa, chunk, &va); -#ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); -#endif error = dump_write(di, va, 0, dumplo, sz); dumpsys_unmap_chunk(pa, chunk, va); Modified: stable/11/sys/sys/watchdog.h ============================================================================== --- stable/11/sys/sys/watchdog.h Sat Jan 13 13:59:35 2018 (r327919) +++ stable/11/sys/sys/watchdog.h Sat Jan 13 14:10:05 2018 (r327920) @@ -110,6 +110,14 @@ EVENTHANDLER_DECLARE(watchdog_list, watchdog_fn); u_int wdog_kern_last_timeout(void); int wdog_kern_pat(u_int utim); + +/* + * The following function pointer is used to attach a software watchdog + * if no hardware watchdog has been attached, and if the software module + * has initialized the function pointer. + */ + +extern void (*wdog_software_attach)(void); #endif #endif /* _SYS_WATCHDOG_H */ From owner-svn-src-all@freebsd.org Sat Jan 13 14:10:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D558E68589; Sat, 13 Jan 2018 14:10:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE4B637C9; Sat, 13 Jan 2018 14:10:46 +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 2A56A13DA0; Sat, 13 Jan 2018 14:10:46 +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 w0DEAjdS072417; Sat, 13 Jan 2018 14:10:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DEAjn9072416; Sat, 13 Jan 2018 14:10:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201801131410.w0DEAjn9072416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 13 Jan 2018 14:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327921 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 14:10:47 -0000 Author: tuexen Date: Sat Jan 13 14:10:45 2018 New Revision: 327921 URL: https://svnweb.freebsd.org/changeset/base/327921 Log: Fix a typo introduced in r327919. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Jan 13 14:10:05 2018 (r327920) +++ head/usr.bin/truss/syscalls.c Sat Jan 13 14:10:45 2018 (r327921) @@ -2143,7 +2143,7 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "0x%lx", args[sc->offset]); break; } -#define IOV_LIMIT 26 +#define IOV_LIMIT 16 case Iovec: { /* * Print argument as an array of struct iovec, where the next From owner-svn-src-all@freebsd.org Sat Jan 13 14:10:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46EA9E68592; Sat, 13 Jan 2018 14:10:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20AA237CA; Sat, 13 Jan 2018 14:10:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53E3A13DA1; Sat, 13 Jan 2018 14:10:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DEAkUG072429; Sat, 13 Jan 2018 14:10:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DEAkLE072428; Sat, 13 Jan 2018 14:10:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201801131410.w0DEAkLE072428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 13 Jan 2018 14:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327922 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 327922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 14:10:47 -0000 Author: manu Date: Sat Jan 13 14:10:45 2018 New Revision: 327922 URL: https://svnweb.freebsd.org/changeset/base/327922 Log: dwmmc_hisi: Fix build when option MMCCAM is defined Modified: head/sys/dev/mmc/host/dwmmc_hisi.c Modified: head/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_hisi.c Sat Jan 13 14:10:45 2018 (r327921) +++ head/sys/dev/mmc/host/dwmmc_hisi.c Sat Jan 13 14:10:45 2018 (r327922) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include +#include "opt_mmccam.h" + static device_probe_t hisi_dwmmc_probe; static device_attach_t hisi_dwmmc_attach; From owner-svn-src-all@freebsd.org Sat Jan 13 14:14:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FBEBE68B21; Sat, 13 Jan 2018 14:14:52 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBC193E11; Sat, 13 Jan 2018 14:14:51 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054EB13F17; Sat, 13 Jan 2018 14:14:51 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DEEoab075681; Sat, 13 Jan 2018 14:14:50 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DEEo6O075680; Sat, 13 Jan 2018 14:14:50 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201801131414.w0DEEo6O075680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 13 Jan 2018 14:14: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: r327923 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: karels X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 327923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 14:14:52 -0000 Author: karels Date: Sat Jan 13 14:14:50 2018 New Revision: 327923 URL: https://svnweb.freebsd.org/changeset/base/327923 Log: Add info about SW_WATCHDOG change to be dynamic in the common case. Modified: stable/11/UPDATING Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sat Jan 13 14:10:45 2018 (r327922) +++ stable/11/UPDATING Sat Jan 13 14:14:50 2018 (r327923) @@ -16,6 +16,12 @@ 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. +20180113: + The SW_WATCHDOG option is no longer necessary to enable the + hardclock-based software watchdog if no hardware watchdog is + configured. As before, SW_WATCHDOG will cause the software + watchdog to be enabled even if a hardware watchdog is configured. + 20180108: lint(1) binaries and library are no longer built by default. To enable building them, define WITH_LINT in src.conf. If you are using From owner-svn-src-all@freebsd.org Sat Jan 13 15:04:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 782BDE6D77B for ; Sat, 13 Jan 2018 15:04:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-35.consmr.mail.gq1.yahoo.com (sonic302-35.consmr.mail.gq1.yahoo.com [98.137.68.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F63E68D35 for ; Sat, 13 Jan 2018 15:04:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515855847; bh=Yxmxw+15H3urifUvE8WdrAXawTgyy4sj0j25Zx/QrYo=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=YVe2NYwhO+p8WdSWwrKPlYkBSyqlFBYHSlG1M1wq0aH41rK/bTgH10eJG/CK/UxpbZ45I6QTJPfPLSJIs4VBSl+vSQzA1PlIyRbpRh7vn+mKnj1dpSqdnPGqkU+gdRf9mhd5yZrAz5wqAVzgCGuFYSb8brCtcoWXvg9q/2pHmtS7LbGxrMrG6A3IoSQCmSkzRqxP9+Pu272CIMkmiJygOMjB78oEtkZNf3W4ZNtkiBkL+icRpkh6ngfz6oPvCPK081qZ9gn1kqV5FrxOeHFflU7P+Y12fS/JBOS8HgXMWCAP96NZlH7Fr9NR3pBuWbdOec3gu5wWBI+bMX7EuiTMEQ== X-YMail-OSG: _V4LkeYVM1n4o26SVaiMSiN5tC0YFGPxpZj6SJNgeav5DYc5NPUJfIpkUl7bjvv 5V8FtZUo3rKcRWkDvmMPszPfrjpDyshj4ItbLOIQ839zZQ4wSb.cDsYNa0mzsj2hcJggyaN695jb 4042JwZoO8UnD79dKd2dGxT9qFF16q6fzbE.keI4ETIs6sTH770IMyQn4XSr90UAlr9A5aVSNvJy ZqrxBGf_SOMlndgkkv2.VJLM4amJyDNr9VixMOD7bDlALhl3wI9V7hRA1odn0XSJ_ROKscW9IxL1 MAJfR.P_a9rygLssaQTY4w73A4wAiW86O_kBtw1vyTpA56IL_iEozQP0B8BOUqopV7YjwsU3AQKp 2AjrC_tiwQ440fhphwnh6JsDx3I2wuVGOM1DKCizoDeVmRuz32jBJ35Y_5QpDPyxDCtmyVdpbqjG RNiXM.S5hUT4I4rJrA2VFA5lgkimSzah9ElY98WFEXw0a.zqf7YqpJwA_iffN4N0JSXSQiBCT Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 15:04:07 +0000 Received: from smtpgate104.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([10.215.136.172]) by smtp415.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID c6059abbb4b6d80597dfb2aa1b7eec8c; Sat, 13 Jan 2018 15:04:05 +0000 (UTC) Subject: Re: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801130136.w0D1abhS054355@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> Date: Sat, 13 Jan 2018 10:04:05 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801130136.w0D1abhS054355@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 15:04:09 -0000 On 12/01/2018 20:36, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Jan 13 01:36:37 2018 > New Revision: 327906 > URL: https://svnweb.freebsd.org/changeset/base/327906 > ... > > Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 01:36:37 2018 (r327906) > @@ -0,0 +1,129 @@ > +/*- > + * Copyright (c) 2018 Justin Hibbits > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + Can we please add SPDX ID tags, specially on new code? I had them added to the guidelines: https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html It is just not fun for me anymore to go hunting for untagged files and they keep appearing ;). Pedro. > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +/* > + * From the P1022 manual, sequence for writing to L2CTL is: > + * - mbar > + * - isync > + * - write > + * - read > + * - mbar > + */ > +#define L2_CTL 0x0 > +#define L2CTL_L2E 0x80000000 > +#define L2CTL_L2I 0x40000000 > +struct mpc85xx_cache_softc { > + struct resource *sc_mem; > +}; > + > +static int > +mpc85xx_cache_probe(device_t dev) > +{ > + > + if (!ofw_bus_is_compatible(dev, "cache")) > + return (ENXIO); > + > + device_set_desc(dev, "MPC85xx L2 cache"); > + return (0); > +} > + > +static int > +mpc85xx_cache_attach(device_t dev) > +{ > + struct mpc85xx_cache_softc *sc = device_get_softc(dev); > + int rid; > + int cache_line_size, cache_size; > + > + /* Map registers. */ > + rid = 0; > + sc->sc_mem = bus_alloc_resource_any(dev, > + SYS_RES_MEMORY, &rid, RF_ACTIVE); > + if (sc->sc_mem == NULL) > + return (ENOMEM); > + > + /* Enable cache and flash invalidate. */ > + __asm __volatile ("mbar; isync" ::: "memory"); > + bus_write_4(sc->sc_mem, L2_CTL, L2CTL_L2E | L2CTL_L2I); > + bus_read_4(sc->sc_mem, L2_CTL); > + __asm __volatile ("mbar" ::: "memory"); > + > + cache_line_size = 0; > + cache_size = 0; > + OF_getencprop(ofw_bus_get_node(dev), "cache-size", &cache_size, > + sizeof(cache_size)); > + OF_getencprop(ofw_bus_get_node(dev), "cache-line-size", > + &cache_line_size, sizeof(cache_line_size)); > + > + if (cache_line_size != 0 && cache_size != 0) > + device_printf(dev, > + "L2 cache size: %dKB, cache line size: %d bytes\n", > + cache_size / 1024, cache_line_size); > + > + return (0); > +} > + > +static device_method_t mpc85xx_cache_methods[] = { > + /* device methods */ > + DEVMETHOD(device_probe, mpc85xx_cache_probe), > + DEVMETHOD(device_attach, mpc85xx_cache_attach), > + > + DEVMETHOD_END > +}; > + > +static driver_t mpc85xx_cache_driver = { > + "cache", > + mpc85xx_cache_methods, > + sizeof(struct mpc85xx_cache_softc), > +}; > +static devclass_t mpc85xx_cache_devclass; > + > +EARLY_DRIVER_MODULE(mpc85xx_cache, simplebus, mpc85xx_cache_driver, > + mpc85xx_cache_devclass, NULL, NULL, > + BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); > From owner-svn-src-all@freebsd.org Sat Jan 13 15:33:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C4F7E6EAE7; Sat, 13 Jan 2018 15:33:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F0569B30; Sat, 13 Jan 2018 15:33:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it0-x234.google.com with SMTP id f143so12555148itb.0; Sat, 13 Jan 2018 07:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cUlLONn9zroFNuFg2dqmhQsKbVNou5YZd6WBXK+ZdgI=; b=YJJ9kc4d6bFj5ZE1txgGvNyLZXqRs9cl+5BvhZWgw2+HP4/wOM6QvAAA2owOLDPjGl FjiQIqQ/v0Eds6C/CIh6AzdvOqC+tR+e2tLPOrbZaIvcFfDeNfaqxfnqA0uRu8gbRMxI 6U6hsAFizDKSaur3qfsUem7lRGdcqFvgxUV2AdMZDcy60yEXL+t9vqtmvC3YXM0ObKaK 8SNb0AoTBvB9l9poDv92e7iI/X1Lf538tf3D4o+6VTlqm10B58o18wwEPFp/DzssYzgb skm2jGHjN9LObetDXsQ3PbeHNNbAr0V7jXwKl/uibmIFSXzTpATOwZC9dDBQMm/iQthE dmmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=cUlLONn9zroFNuFg2dqmhQsKbVNou5YZd6WBXK+ZdgI=; b=jvO93Gj+4cSLhd+8bWig6kPXDhkQLS40iM4a8xv++Eyzr3NIk1LUzMJX+y+fDNUgyn MyXd+NjX9CaJyq4j3rMxomJGp8zniMdxO8dQF1fqSud+t7Z03lb/ua7wVXzq6AxCwJwJ wg4O3XjOiptDHEtJm0sCGYYhNa96QopeHxzBtMr6cX2Y4ZhzXZzrWIpRQs9m1E6r9mKE wMHstNfTh7T2kggMgl6IUwKsa+JPAMtYO9fmbztbF6iQ/AUYZUhLV6xbeU6mbWKhTle8 yGBh6oP7qqxks8vGRnsZnnwHLkJUlKX9HtudBJELOAOVnFtFFQwxpTVjxH7Tc3Tgv8h9 WbvQ== X-Gm-Message-State: AKwxyteyJkVW4SEjkaarqAP6TMAf3kLf666pPN/aL8aZlcDpMi70qlmO XM0HU13vzcjuHvSksz1Xt4y2NBi1ItUmECXYr44= X-Google-Smtp-Source: ACJfBour5TbWU9mD0iVqookCc2gS33AGlS4fEtVkTpNHFEmbqmhekXOfbhonty1AZmkjW9woJI2Ez+P/Vm7vx9j9HoU= X-Received: by 10.36.10.81 with SMTP id 78mr9315994itw.117.1515857627101; Sat, 13 Jan 2018 07:33:47 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.79.158.10 with HTTP; Sat, 13 Jan 2018 07:33:46 -0800 (PST) Received: by 10.79.158.10 with HTTP; Sat, 13 Jan 2018 07:33:46 -0800 (PST) In-Reply-To: <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> References: <201801130136.w0D1abhS054355@repo.freebsd.org> <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> From: Justin Hibbits Date: Sat, 13 Jan 2018 09:33:46 -0600 X-Google-Sender-Auth: N47aU44x5HzPhEzM02FFsD5clw8 Message-ID: Subject: Re: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 15:33:48 -0000 On Jan 13, 2018 09:04, "Pedro Giffuni" wrote: On 12/01/2018 20:36, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Jan 13 01:36:37 2018 > New Revision: 327906 > URL: https://svnweb.freebsd.org/changeset/base/327906 > ... > > > Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 01:36:37 2018 > (r327906) > @@ -0,0 +1,129 @@ > +/*- > + * Copyright (c) 2018 Justin Hibbits > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > Can we please add SPDX ID tags, specially on new code? I had them added to the guidelines: https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committ ers-guide/pref-license.html It is just not fun for me anymore to go hunting for untagged files and they keep appearing ;). Pedro. D'oh, sorry. I had used an existing boilerplate template I have lying around that didn't have the SPDX tags. I'll update and fix this. - Justin From owner-svn-src-all@freebsd.org Sat Jan 13 15:38:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1F41E6EE57 for ; Sat, 13 Jan 2018 15:38:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-17.consmr.mail.bf2.yahoo.com (sonic306-17.consmr.mail.bf2.yahoo.com [74.6.132.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9614069E7A for ; Sat, 13 Jan 2018 15:38:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515857924; bh=5F2mMvwl192eA4erdZEoM4zH36Qx6C8dSi762BZg+BA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=X6fzuB0SVFb8v51lOOEzESxlc3cNY3Ez+Xe55SMkeBztLWDN/1EJ3N2eL5/ZwlPr/WIdlsmnv3+6/FJ+pC8ktuNfQm1xRA3r5q+ptxn6ySugvhQqb8V1SrKoh5PAV3FdCpdS0J5ITlu0/1/FZrgcfGCug0I1ou51sYJNYnvJgnNO4GCRVR9OoUS0AlwucW38z2Og5zSxliLcD2lzA2r5+/eamBIbWaWb+rCTYqVDqKPMRCQz9nh8uyuGkA7m0uAVzvM4AIPg3QzI2BazjDBb2r4v5h3GZLMCTvS8OPfkqoEaNGMh77U2GrGNyykE0SBEK6/EEFU8gENWK9kMPAytEg== X-YMail-OSG: 5J630t4VM1km36IpWibsoOkRKsz5oPlhQuOwxHi2bxeiwNSwpiJVx2nCCggrEF3 EEAL.5o5Mm691W39Vam0VLXOGalwuCUMtz1cvbfo35488D_jAu84J0EgQ1u875C0L_U88W8GpkF4 zr6plkHmxq0Y9498gz8XORVp31ETSmrB_YFQjRGPCxyxb3jY5Gd9yk5HB26N9Oo68xSi3ZUejQi2 d7GY13aok7XageT_bOvUeFKRuO9I3eNKlGJUZoQRbTQ7Ggolw_mLFVQEoamMaul5DG9Hev1DPoiq 1a75kY0bhG7gsyzY1uvUT95U51hJK9F9J4piTbXlQf7gAlVvtH.Zs4Bg3wLSqd_46eEDrBnTS6pw t1thsJWMcAscOmKqce1A3uycfxkT_UNCyyOyghuG0d.EXwb3ACz0Yg_nAlazesk_fcdTW3Aa.VMx mKBUTdZ8Hhc9yUuC6vdbkM48peX6AlE7uSoFC64AZ3QuDPM374aJWKQUsLkM1Zvw1Pyt9Xsf_ Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 13 Jan 2018 15:38:44 +0000 Received: from smtp101.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.8]) ([68.142.231.32]) by smtp414.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID c140936c2d074626e2ad935f93bc2ebc; Sat, 13 Jan 2018 15:38:42 +0000 (UTC) Subject: Re: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801130136.w0D1abhS054355@repo.freebsd.org> <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <3bd7260a-4bac-2718-9836-15bb25cbc793@FreeBSD.org> Date: Sat, 13 Jan 2018 10:38:43 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 15:38:46 -0000 ... On 13/01/2018 10:33, Justin Hibbits wrote: > > > On Jan 13, 2018 09:04, "Pedro Giffuni" > wrote: > > > > On 12/01/2018 20:36, Justin Hibbits wrote: > > Author: jhibbits > Date: Sat Jan 13 01:36:37 2018 > New Revision: 327906 > URL: https://svnweb.freebsd.org/changeset/base/327906 > > ... > > > Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c > ============================================================================== > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 > 01:36:37 2018        (r327906) > @@ -0,0 +1,129 @@ > +/*- > + * Copyright (c) 2018 Justin Hibbits > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > > > Can we please add SPDX ID tags, specially on new code? > I had them added to the guidelines: > > https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html > > > It is just not fun for me anymore to go hunting for untagged files > and they keep appearing ;). > > Pedro. > > > D'oh, sorry. I had used an existing boilerplate template I have lying > around that didn't have the SPDX tags. I'll update and fix this. > It's OK, no hurry. Pedro. From owner-svn-src-all@freebsd.org Sat Jan 13 16:21:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99AC7E7123C; Sat, 13 Jan 2018 16:21:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 754E66B849; Sat, 13 Jan 2018 16:21:14 +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 BEE2415538; Sat, 13 Jan 2018 16:21:13 +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 w0DGLDQk026576; Sat, 13 Jan 2018 16:21:13 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DGLDiC026575; Sat, 13 Jan 2018 16:21:13 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201801131621.w0DGLDiC026575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 13 Jan 2018 16:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327924 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 327924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 16:21:14 -0000 Author: marius Date: Sat Jan 13 16:21:13 2018 New Revision: 327924 URL: https://svnweb.freebsd.org/changeset/base/327924 Log: Fix a bug introduced in r327339; at the point in time re-tuning is executed, the interrupt aggregation code might have disabled the SDHCI_INT_DMA_END and/or SDHCI_INT_RESPONSE bits in slot->intmask and the SDHCI_SIGNAL_ENABLE register respectively. So when restoring the interrupt masks based on the previous contents of slot->intmask in sdhci_exec_tuning(), ensure that the SDHCI_INT_ENABLE register doesn't lose these two bits. While at it and in the spirit of r327339, let sdhci_tuning_intmask() set the tuning error and re-tuning interrupt bits based on the SDHCI_TUNING_ENABLED rather than the SDHCI_TUNING_SUPPORTED flag being set, i. e. only when (re-)tuning is actually used. Currently, this changes makes no net difference, though. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jan 13 14:14:50 2018 (r327923) +++ head/sys/dev/sdhci/sdhci.c Sat Jan 13 16:21:13 2018 (r327924) @@ -273,7 +273,7 @@ sdhci_tuning_intmask(struct sdhci_slot *slot) uint32_t intmask; intmask = 0; - if (slot->opt & SDHCI_TUNING_SUPPORTED) { + if (slot->opt & SDHCI_TUNING_ENABLED) { intmask |= SDHCI_INT_TUNEERR; if (slot->retune_mode == SDHCI_RETUNE_MODE_2 || slot->retune_mode == SDHCI_RETUNE_MODE_3) @@ -1439,9 +1439,17 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset) DELAY(1000); } + /* + * Restore DMA usage and interrupts. + * Note that the interrupt aggregation code might have cleared + * SDHCI_INT_DMA_END and/or SDHCI_INT_RESPONSE in slot->intmask + * and SDHCI_SIGNAL_ENABLE respectively so ensure SDHCI_INT_ENABLE + * doesn't lose these. + */ slot->opt = opt; slot->intmask = intmask; - WR4(slot, SDHCI_INT_ENABLE, intmask); + WR4(slot, SDHCI_INT_ENABLE, intmask | SDHCI_INT_DMA_END | + SDHCI_INT_RESPONSE); WR4(slot, SDHCI_SIGNAL_ENABLE, intmask); if ((hostctrl2 & (SDHCI_CTRL2_EXEC_TUNING | From owner-svn-src-all@freebsd.org Sat Jan 13 16:31:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A746E71BF2; Sat, 13 Jan 2018 16:31:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45C4D6BD8E; Sat, 13 Jan 2018 16:31:08 +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 835D1155D6; Sat, 13 Jan 2018 16:31:07 +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 w0DGV7VA032747; Sat, 13 Jan 2018 16:31:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DGV7vO032746; Sat, 13 Jan 2018 16:31:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201801131631.w0DGV7vO032746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 13 Jan 2018 16:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327925 - head/sys/dev/wbwd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/wbwd X-SVN-Commit-Revision: 327925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 16:31:08 -0000 Author: mav Date: Sat Jan 13 16:31:07 2018 New Revision: 327925 URL: https://svnweb.freebsd.org/changeset/base/327925 Log: Add IDs for Nuvoton NCT6793/NCT6795. MFC after: 2 weeks Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Sat Jan 13 16:21:13 2018 (r327924) +++ head/sys/dev/wbwd/wbwd.c Sat Jan 13 16:31:07 2018 (r327925) @@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$"); enum chips { w83627hf, w83627s, w83697hf, w83697ug, w83637hf, w83627thf, w83687thf, w83627ehf, w83627dhg, w83627uhg, w83667hg, w83627dhg_p, w83667hg_b, nct6775, nct6776, nct6779, nct6791, - nct6792, nct6102 }; + nct6792, nct6793, nct6795, nct6102 }; struct wb_softc { device_t dev; @@ -252,6 +252,16 @@ struct winbond_vendor_device_id { .chip = nct6792, .descr = "Nuvoton NCT6792", }, + { + .device_id = 0xd1, + .chip = nct6793, + .descr = "Nuvoton NCT6793", + }, + { + .device_id = 0xd3, + .chip = nct6795, + .descr = "Nuvoton NCT6795", + }, }; static void @@ -810,6 +820,8 @@ wb_attach(device_t dev) case nct6779: case nct6791: case nct6792: + case nct6793: + case nct6795: case nct6102: /* * These chips have a fixed WDTO# output pin (W83627UHG), From owner-svn-src-all@freebsd.org Sat Jan 13 16:32:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FA91E71CF9; Sat, 13 Jan 2018 16:32: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD0466C0C0; Sat, 13 Jan 2018 16:32:10 +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 25C0B1571D; Sat, 13 Jan 2018 16:32:10 +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 w0DGW9Rq034279; Sat, 13 Jan 2018 16:32:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DGW9xt034278; Sat, 13 Jan 2018 16:32:09 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201801131632.w0DGW9xt034278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 13 Jan 2018 16:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327926 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 327926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 16:32:11 -0000 Author: marius Date: Sat Jan 13 16:32:09 2018 New Revision: 327926 URL: https://svnweb.freebsd.org/changeset/base/327926 Log: Fix a bug introduced in r327355; in mmcsd_ioctl_cmd() when ensuring that userland doesn't switch partitions on its own, compare against the partition mmcsd_ioctl_cmd() is going to switch to (based on the device node used) rather than the currently selected partition. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sat Jan 13 16:31:07 2018 (r327925) +++ head/sys/dev/mmc/mmcsd.c Sat Jan 13 16:32:09 2018 (r327926) @@ -920,7 +920,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io */ if (cmd.opcode == MMC_SWITCH_FUNC && dp != NULL && (((uint8_t *)dp)[EXT_CSD_PART_CONFIG] & - EXT_CSD_PART_CONFIG_ACC_MASK) != sc->part_curr) { + EXT_CSD_PART_CONFIG_ACC_MASK) != part->type) { err = EINVAL; goto out; } From owner-svn-src-all@freebsd.org Sat Jan 13 17:04:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEDD9E736C2; Sat, 13 Jan 2018 17:04:31 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2846D26D; Sat, 13 Jan 2018 17:04:31 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C3BB218A93; Sat, 13 Jan 2018 17:04:30 +0000 (UTC) Date: Sat, 13 Jan 2018 17:04:30 +0000 From: Alexey Dokuchaev To: Jason Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc Message-ID: <20180113170430.GA52597@FreeBSD.org> References: <201706150715.v5F7F6aT031218@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201706150715.v5F7F6aT031218@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:04:31 -0000 On Thu, Jun 15, 2017 at 07:15:06AM +0000, Jason Evans wrote: > New Revision: 319971 > URL: https://svnweb.freebsd.org/changeset/base/319971 > > Log: > Update jemalloc to 5.0.0. I've finally bisected the problem of `games/quake2lnx' failing to start (hanging) in GLX mode down to this commit. Reverting it and making "all install" under `/usr/src/lib/libc' restores correct operation. If I run it as ``env LD_PRELOAD=/lib/libthr.so.3 quake2 ...'' it starts normally. Do you have any ideas what might have broken it? Is this a problem with how the Quake2 binary is linked, or with jemalloc? To reproduce: $ cd /usr/ports/games/quake2lnx && make all install $ quake2 +set vid_ref glx (I'd appreciate if you could build/install `games/quake2lnx', it is straightforward and fast, and does not require any commercial data files. Thanks.) ./danfe From owner-svn-src-all@freebsd.org Sat Jan 13 17:21:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20369E7429E; Sat, 13 Jan 2018 17:21:47 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE93C6DC56; Sat, 13 Jan 2018 17:21:46 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375E915F32; Sat, 13 Jan 2018 17:21:46 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DHLkmu054634; Sat, 13 Jan 2018 17:21:46 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DHLjTs054631; Sat, 13 Jan 2018 17:21:45 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201801131721.w0DHLjTs054631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 13 Jan 2018 17:21:45 +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: r327927 - in stable/11: sbin/ifconfig sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: in stable/11: sbin/ifconfig sys/net X-SVN-Commit-Revision: 327927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:21:47 -0000 Author: bryanv Date: Sat Jan 13 17:21:45 2018 New Revision: 327927 URL: https://svnweb.freebsd.org/changeset/base/327927 Log: MFC r327375, r327385, r327386: Add support for IPv6 scoped addresses to vxlan Advertise IFCAP_LINKSTAT after r326480 added link status support Add macro for vxlan list mutex lock and unlock Modified: stable/11/sbin/ifconfig/ifvxlan.c stable/11/sys/net/if_vxlan.c stable/11/sys/net/if_vxlan.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/ifvxlan.c ============================================================================== --- stable/11/sbin/ifconfig/ifvxlan.c Sat Jan 13 16:32:09 2018 (r327926) +++ stable/11/sbin/ifconfig/ifvxlan.c Sat Jan 13 17:21:45 2018 (r327927) @@ -236,25 +236,23 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *) sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (IN_MULTICAST(ntohl(addr.s_addr))) + if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "local address cannot be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_MULTICAST(addr)) + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "local address cannot be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -267,10 +265,10 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_LOCAL_ADDR4; - params.vxlp_local_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_local_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_LOCAL_ADDR6; - params.vxlp_local_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_local_sa.in6 = cmd.vxlcmd_sa.in6; } return; } @@ -298,25 +296,23 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *)sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (IN_MULTICAST(ntohl(addr.s_addr))) + if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "remote address cannot be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_MULTICAST(addr)) + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "remote address cannot be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -329,10 +325,10 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR4; - params.vxlp_remote_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_remote_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR6; - params.vxlp_remote_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_remote_sa.in6 = cmd.vxlcmd_sa.in6; } return; } @@ -360,25 +356,23 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct in_addr addr = ((struct sockaddr_in *)sa)->sin_addr; + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (!IN_MULTICAST(ntohl(addr.s_addr))) + if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "group address must be multicast"); - cmd.vxlcmd_sa.in4.sin_family = AF_INET; - cmd.vxlcmd_sa.in4.sin_addr = addr; + cmd.vxlcmd_sa.in4 = *sin; break; } #endif #ifdef INET6 case AF_INET6: { - struct in6_addr *addr = &((struct sockaddr_in6 *)sa)->sin6_addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - if (!IN6_IS_ADDR_MULTICAST(addr)) + if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "group address must be multicast"); - cmd.vxlcmd_sa.in6.sin6_family = AF_INET6; - cmd.vxlcmd_sa.in6.sin6_addr = *addr; + cmd.vxlcmd_sa.in6 = *sin6; break; } #endif @@ -391,10 +385,10 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) if (!vxlan_exists(s)) { if (cmd.vxlcmd_sa.sa.sa_family == AF_INET) { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR4; - params.vxlp_remote_in4 = cmd.vxlcmd_sa.in4.sin_addr; + params.vxlp_remote_sa.in4 = cmd.vxlcmd_sa.in4; } else { params.vxlp_with |= VXLAN_PARAM_WITH_REMOTE_ADDR6; - params.vxlp_remote_in6 = cmd.vxlcmd_sa.in6.sin6_addr; + params.vxlp_remote_sa.in6 = cmd.vxlcmd_sa.in6; } return; } Modified: stable/11/sys/net/if_vxlan.c ============================================================================== --- stable/11/sys/net/if_vxlan.c Sat Jan 13 16:32:09 2018 (r327926) +++ stable/11/sys/net/if_vxlan.c Sat Jan 13 17:21:45 2018 (r327927) @@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include +#include + struct vxlan_softc; LIST_HEAD(vxlan_softc_head, vxlan_softc); @@ -215,9 +217,9 @@ static void vxlan_ftable_fini(struct vxlan_softc *); static void vxlan_ftable_flush(struct vxlan_softc *, int); static void vxlan_ftable_expire(struct vxlan_softc *); static int vxlan_ftable_update_locked(struct vxlan_softc *, - const struct sockaddr *, const uint8_t *, + const union vxlan_sockaddr *, const uint8_t *, struct rm_priotracker *); -static int vxlan_ftable_update(struct vxlan_softc *, +static int vxlan_ftable_learn(struct vxlan_softc *, const struct sockaddr *, const uint8_t *); static int vxlan_ftable_sysctl_dump(SYSCTL_HANDLER_ARGS); @@ -358,6 +360,7 @@ static void vxlan_sockaddr_in_copy(union vxlan_sockadd static int vxlan_sockaddr_supported(const union vxlan_sockaddr *, int); static int vxlan_sockaddr_in_any(const union vxlan_sockaddr *); static int vxlan_sockaddr_in_multicast(const union vxlan_sockaddr *); +static int vxlan_sockaddr_in6_embedscope(union vxlan_sockaddr *); static int vxlan_can_change_config(struct vxlan_softc *); static int vxlan_check_vni(uint32_t); @@ -378,7 +381,11 @@ static const char vxlan_name[] = "vxlan"; static MALLOC_DEFINE(M_VXLAN, vxlan_name, "Virtual eXtensible LAN Interface"); static struct if_clone *vxlan_cloner; + static struct mtx vxlan_list_mtx; +#define VXLAN_LIST_LOCK() mtx_lock(&vxlan_list_mtx) +#define VXLAN_LIST_UNLOCK() mtx_unlock(&vxlan_list_mtx) + static LIST_HEAD(, vxlan_socket) vxlan_socket_list; static eventhandler_tag vxlan_ifdetach_event_tag; @@ -576,10 +583,10 @@ vxlan_ftable_expire(struct vxlan_softc *sc) } static int -vxlan_ftable_update_locked(struct vxlan_softc *sc, const struct sockaddr *sa, - const uint8_t *mac, struct rm_priotracker *tracker) +vxlan_ftable_update_locked(struct vxlan_softc *sc, + const union vxlan_sockaddr *vxlsa, const uint8_t *mac, + struct rm_priotracker *tracker) { - union vxlan_sockaddr vxlsa; struct vxlan_ftable_entry *fe; int error; @@ -596,7 +603,7 @@ again: fe->vxlfe_expire = time_uptime + sc->vxl_ftable_timeout; if (!VXLAN_FE_IS_DYNAMIC(fe) || - vxlan_sockaddr_in_equal(&fe->vxlfe_raddr, sa)) + vxlan_sockaddr_in_equal(&fe->vxlfe_raddr, &vxlsa->sa)) return (0); if (!VXLAN_LOCK_WOWNED(sc)) { VXLAN_RUNLOCK(sc, tracker); @@ -604,7 +611,7 @@ again: sc->vxl_stats.ftable_lock_upgrade_failed++; goto again; } - vxlan_sockaddr_in_copy(&fe->vxlfe_raddr, sa); + vxlan_sockaddr_in_copy(&fe->vxlfe_raddr, &vxlsa->sa); return (0); } @@ -624,16 +631,8 @@ again: if (fe == NULL) return (ENOMEM); - /* - * The source port may be randomly select by the remove host, so - * use the port of the default destination address. - */ - vxlan_sockaddr_copy(&vxlsa, sa); - vxlsa.in4.sin_port = sc->vxl_dst_addr.in4.sin_port; + vxlan_ftable_entry_init(sc, fe, mac, &vxlsa->sa, VXLAN_FE_FLAG_DYNAMIC); - vxlan_ftable_entry_init(sc, fe, mac, &vxlsa.sa, - VXLAN_FE_FLAG_DYNAMIC); - /* The prior lookup failed, so the insert should not. */ error = vxlan_ftable_entry_insert(sc, fe); MPASS(error == 0); @@ -642,14 +641,28 @@ again: } static int -vxlan_ftable_update(struct vxlan_softc *sc, const struct sockaddr *sa, +vxlan_ftable_learn(struct vxlan_softc *sc, const struct sockaddr *sa, const uint8_t *mac) { struct rm_priotracker tracker; + union vxlan_sockaddr vxlsa; int error; + /* + * The source port may be randomly selected by the remote host, so + * use the port of the default destination address. + */ + vxlan_sockaddr_copy(&vxlsa, sa); + vxlsa.in4.sin_port = sc->vxl_dst_addr.in4.sin_port; + + if (VXLAN_SOCKADDR_IS_IPV6(&vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(&vxlsa); + if (error) + return (error); + } + VXLAN_RLOCK(sc, &tracker); - error = vxlan_ftable_update_locked(sc, sa, mac, &tracker); + error = vxlan_ftable_update_locked(sc, &vxlsa, mac, &tracker); VXLAN_UNLOCK(sc, &tracker); return (error); @@ -881,11 +894,11 @@ vxlan_socket_release(struct vxlan_socket *vso) { int destroy; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); destroy = VXLAN_SO_RELEASE(vso); if (destroy != 0) LIST_REMOVE(vso, vxlso_entry); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); if (destroy != 0) vxlan_socket_destroy(vso); @@ -896,14 +909,14 @@ vxlan_socket_lookup(union vxlan_sockaddr *vxlsa) { struct vxlan_socket *vso; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); LIST_FOREACH(vso, &vxlan_socket_list, vxlso_entry) { if (vxlan_sockaddr_cmp(&vso->vxlso_laddr, &vxlsa->sa) == 0) { VXLAN_SO_ACQUIRE(vso); break; } } - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); return (vso); } @@ -912,10 +925,10 @@ static void vxlan_socket_insert(struct vxlan_socket *vso) { - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); VXLAN_SO_ACQUIRE(vso); LIST_INSERT_HEAD(&vxlan_socket_list, vso, vxlso_entry); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); } static int @@ -1051,8 +1064,8 @@ vxlan_socket_ifdetach(struct vxlan_socket *vso, struct static struct vxlan_socket * vxlan_socket_mc_lookup(const union vxlan_sockaddr *vxlsa) { - struct vxlan_socket *vso; union vxlan_sockaddr laddr; + struct vxlan_socket *vso; laddr = *vxlsa; @@ -1406,7 +1419,7 @@ vxlan_setup_multicast_interface(struct vxlan_softc *sc ifp = ifunit_ref(sc->vxl_mc_ifname); if (ifp == NULL) { - if_printf(sc->vxl_ifp, "multicast interfaces %s does " + if_printf(sc->vxl_ifp, "multicast interface %s does " "not exist\n", sc->vxl_mc_ifname); return (ENOENT); } @@ -1830,6 +1843,13 @@ vxlan_ctrl_get_config(struct vxlan_softc *sc, void *ar cfg->vxlc_ttl = sc->vxl_ttl; VXLAN_RUNLOCK(sc, &tracker); +#ifdef INET6 + if (VXLAN_SOCKADDR_IS_IPV6(&cfg->vxlc_local_sa)) + sa6_recoverscope(&cfg->vxlc_local_sa.in6); + if (VXLAN_SOCKADDR_IS_IPV6(&cfg->vxlc_remote_sa)) + sa6_recoverscope(&cfg->vxlc_remote_sa.in6); +#endif + return (0); } @@ -1869,6 +1889,11 @@ vxlan_ctrl_set_local_addr(struct vxlan_softc *sc, void return (EINVAL); if (vxlan_sockaddr_in_multicast(vxlsa) != 0) return (EINVAL); + if (VXLAN_SOCKADDR_IS_IPV6(vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(vxlsa); + if (error) + return (error); + } VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { @@ -1893,6 +1918,11 @@ vxlan_ctrl_set_remote_addr(struct vxlan_softc *sc, voi if (!VXLAN_SOCKADDR_IS_IPV46(vxlsa)) return (EINVAL); + if (VXLAN_SOCKADDR_IS_IPV6(vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(vxlsa); + if (error) + return (error); + } VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { @@ -2093,6 +2123,12 @@ vxlan_ctrl_ftable_entry_add(struct vxlan_softc *sc, vo if (vxlsa.sa.sa_family != sc->vxl_dst_addr.sa.sa_family) return (EAFNOSUPPORT); + if (VXLAN_SOCKADDR_IS_IPV6(&vxlsa)) { + error = vxlan_sockaddr_in6_embedscope(&vxlsa); + if (error) + return (error); + } + fe = vxlan_ftable_entry_alloc(); if (fe == NULL) return (ENOMEM); @@ -2248,7 +2284,6 @@ vxlan_pick_source_port(struct vxlan_softc *sc, struct range = sc->vxl_max_port - sc->vxl_min_port + 1; - /* check if flowid is set and not opaque */ if (M_HASHTYPE_ISHASH(m)) hash = m->m_pkthdr.flowid; else @@ -2536,7 +2571,7 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, st } if (sc->vxl_flags & VXLAN_FLAG_LEARN) - vxlan_ftable_update(sc, sa, eh->ether_shost); + vxlan_ftable_learn(sc, sa, eh->ether_shost); m_clrprotoflags(m); m->m_pkthdr.rcvif = ifp; @@ -2588,6 +2623,18 @@ vxlan_set_user_config(struct vxlan_softc *sc, struct i if (vxlp->vxlp_with & (VXLAN_PARAM_WITH_LOCAL_ADDR6 | VXLAN_PARAM_WITH_REMOTE_ADDR6)) return (EAFNOSUPPORT); +#else + if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR6) { + int error = vxlan_sockaddr_in6_embedscope(&vxlp->vxlp_local_sa); + if (error) + return (error); + } + if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR6) { + int error = vxlan_sockaddr_in6_embedscope( + &vxlp->vxlp_remote_sa); + if (error) + return (error); + } #endif if (vxlp->vxlp_with & VXLAN_PARAM_WITH_VNI) { @@ -2598,21 +2645,25 @@ vxlan_set_user_config(struct vxlan_softc *sc, struct i if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR4) { sc->vxl_src_addr.in4.sin_len = sizeof(struct sockaddr_in); sc->vxl_src_addr.in4.sin_family = AF_INET; - sc->vxl_src_addr.in4.sin_addr = vxlp->vxlp_local_in4; + sc->vxl_src_addr.in4.sin_addr = + vxlp->vxlp_local_sa.in4.sin_addr; } else if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_ADDR6) { sc->vxl_src_addr.in6.sin6_len = sizeof(struct sockaddr_in6); sc->vxl_src_addr.in6.sin6_family = AF_INET6; - sc->vxl_src_addr.in6.sin6_addr = vxlp->vxlp_local_in6; + sc->vxl_src_addr.in6.sin6_addr = + vxlp->vxlp_local_sa.in6.sin6_addr; } if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR4) { sc->vxl_dst_addr.in4.sin_len = sizeof(struct sockaddr_in); sc->vxl_dst_addr.in4.sin_family = AF_INET; - sc->vxl_dst_addr.in4.sin_addr = vxlp->vxlp_remote_in4; + sc->vxl_dst_addr.in4.sin_addr = + vxlp->vxlp_remote_sa.in4.sin_addr; } else if (vxlp->vxlp_with & VXLAN_PARAM_WITH_REMOTE_ADDR6) { sc->vxl_dst_addr.in6.sin6_len = sizeof(struct sockaddr_in6); sc->vxl_dst_addr.in6.sin6_family = AF_INET6; - sc->vxl_dst_addr.in6.sin6_addr = vxlp->vxlp_remote_in6; + sc->vxl_dst_addr.in6.sin6_addr = + vxlp->vxlp_remote_sa.in6.sin6_addr; } if (vxlp->vxlp_with & VXLAN_PARAM_WITH_LOCAL_PORT) @@ -2696,6 +2747,8 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifp->if_ioctl = vxlan_ioctl; ifp->if_transmit = vxlan_transmit; ifp->if_qflush = vxlan_qflush; + ifp->if_capabilities |= IFCAP_LINKSTATE; + ifp->if_capenable |= IFCAP_LINKSTATE; ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2931,6 +2984,21 @@ vxlan_sockaddr_in_multicast(const union vxlan_sockaddr } static int +vxlan_sockaddr_in6_embedscope(union vxlan_sockaddr *vxladdr) +{ + int error; + + MPASS(VXLAN_SOCKADDR_IS_IPV6(vxladdr)); +#ifdef INET6 + error = sa6_embedscope(&vxladdr->in6, V_ip6_use_defzone); +#else + error = EAFNOSUPPORT; +#endif + + return (error); +} + +static int vxlan_can_change_config(struct vxlan_softc *sc) { struct ifnet *ifp; @@ -3052,10 +3120,10 @@ vxlan_ifdetach_event(void *arg __unused, struct ifnet if ((ifp->if_flags & IFF_MULTICAST) == 0) return; - mtx_lock(&vxlan_list_mtx); + VXLAN_LIST_LOCK(); LIST_FOREACH(vso, &vxlan_socket_list, vxlso_entry) vxlan_socket_ifdetach(vso, ifp, &list); - mtx_unlock(&vxlan_list_mtx); + VXLAN_LIST_UNLOCK(); LIST_FOREACH_SAFE(sc, &list, vxl_ifdetach_list, tsc) { LIST_REMOVE(sc, vxl_ifdetach_list); Modified: stable/11/sys/net/if_vxlan.h ============================================================================== --- stable/11/sys/net/if_vxlan.h Sat Jan 13 16:32:09 2018 (r327926) +++ stable/11/sys/net/if_vxlan.h Sat Jan 13 17:21:45 2018 (r327927) @@ -54,6 +54,12 @@ struct vxlan_header { #define VXLAN_PORT 4789 #define VXLAN_LEGACY_PORT 8472 +union vxlan_sockaddr { + struct sockaddr sa; + struct sockaddr_in in4; + struct sockaddr_in6 in6; +}; + struct ifvxlanparam { uint64_t vxlp_with; @@ -72,10 +78,8 @@ struct ifvxlanparam { #define VXLAN_PARAM_WITH_LEARN 0x1000 uint32_t vxlp_vni; - struct in_addr vxlp_local_in4; - struct in6_addr vxlp_local_in6; - struct in_addr vxlp_remote_in4; - struct in6_addr vxlp_remote_in6; + union vxlan_sockaddr vxlp_local_sa; + union vxlan_sockaddr vxlp_remote_sa; uint16_t vxlp_local_port; uint16_t vxlp_remote_port; uint16_t vxlp_min_port; @@ -85,12 +89,6 @@ struct ifvxlanparam { uint32_t vxlp_ftable_max; uint8_t vxlp_ttl; uint8_t vxlp_learn; -}; - -union vxlan_sockaddr { - struct sockaddr sa; - struct sockaddr_in in4; - struct sockaddr_in6 in6; }; #define VXLAN_SOCKADDR_IS_IPV4(_vxsin) ((_vxsin)->sa.sa_family == AF_INET) From owner-svn-src-all@freebsd.org Sat Jan 13 17:25:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B77E8E74675; Sat, 13 Jan 2018 17:25:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 924056DEB2; Sat, 13 Jan 2018 17:25:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C3D15F69; Sat, 13 Jan 2018 17:25:48 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DHPmWX055585; Sat, 13 Jan 2018 17:25:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DHPmY5055584; Sat, 13 Jan 2018 17:25:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801131725.w0DHPmY5055584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 17:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327928 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 327928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:25:49 -0000 Author: jhibbits Date: Sat Jan 13 17:25:48 2018 New Revision: 327928 URL: https://svnweb.freebsd.org/changeset/base/327928 Log: Add SPDX identifier to header Reported by: pfg Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:21:45 2018 (r327927) +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:25:48 2018 (r327928) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2018 Justin Hibbits * All rights reserved. * From owner-svn-src-all@freebsd.org Sat Jan 13 17:36:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D56E7502C; Sat, 13 Jan 2018 17:36:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 517446E6B9; Sat, 13 Jan 2018 17:36:12 +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 7C3AE1610B; Sat, 13 Jan 2018 17:36: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 w0DHaB4o059599; Sat, 13 Jan 2018 17:36:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DHaBtm059598; Sat, 13 Jan 2018 17:36:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201801131736.w0DHaBtm059598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 13 Jan 2018 17:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327929 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 327929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:36:12 -0000 Author: marius Date: Sat Jan 13 17:36:11 2018 New Revision: 327929 URL: https://svnweb.freebsd.org/changeset/base/327929 Log: Use the correct revision specifier (EXT_CSD revision rather than system specification version) for deciding whether the EXT_CSD register includes the EXT_CSD_GEN_CMD6_TIME field. Submitted by: Masanobu SAITOH Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Sat Jan 13 17:25:48 2018 (r327928) +++ head/sys/dev/mmc/mmc.c Sat Jan 13 17:36:11 2018 (r327929) @@ -1868,7 +1868,7 @@ mmc_discover_cards(struct mmc_softc *sc) * units of 10 ms), defaulting to 500 ms. */ ivar->cmd6_time = 500 * 1000; - if (ivar->csd.spec_vers >= 6) + if (ivar->raw_ext_csd[EXT_CSD_REV] >= 6) ivar->cmd6_time = 10 * ivar->raw_ext_csd[EXT_CSD_GEN_CMD6_TIME]; /* Handle HC erase sector size. */ From owner-svn-src-all@freebsd.org Sat Jan 13 17:47:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6A8E75A7C; Sat, 13 Jan 2018 17:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9BF66EF1E; Sat, 13 Jan 2018 17:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0594C162B6; Sat, 13 Jan 2018 17:47:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DHlY6P063671; Sat, 13 Jan 2018 17:47:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DHlYh8063668; Sat, 13 Jan 2018 17:47:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201801131747.w0DHlYh8063668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 13 Jan 2018 17:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327930 - in head/contrib/llvm/tools/clang: include/clang/AST lib/AST lib/Sema X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm/tools/clang: include/clang/AST lib/AST lib/Sema X-SVN-Commit-Revision: 327930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:47:36 -0000 Author: dim Date: Sat Jan 13 17:47:34 2018 New Revision: 327930 URL: https://svnweb.freebsd.org/changeset/base/327930 Log: Pull in r314499 from upstream clang trunk (by Daniel Marjamäki): [Sema] Suppress warnings for C's zero initializer Patch by S. Gilles! Differential Revision: https://reviews.llvm.org/D28148 Pull in r314838 from upstream clang trunk (by Richard Smith): Suppress -Wmissing-braces warning when aggregate-initializing a struct with a single field that is itself an aggregate. In C++, such initialization of std::array types is guaranteed to work by the standard, is completely idiomatic, and the "suggested" alternative from Clang was technically invalid. Together, these suppress unneeded "suggest braces around initialization of subobject" warnings for C++11 initializer lists. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Modified: head/contrib/llvm/tools/clang/include/clang/AST/Expr.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Expr.h Sat Jan 13 17:36:11 2018 (r327929) +++ head/contrib/llvm/tools/clang/include/clang/AST/Expr.h Sat Jan 13 17:47:34 2018 (r327930) @@ -3986,6 +3986,10 @@ class InitListExpr : public Expr { (public) /// initializer)? bool isTransparent() const; + /// Is this the zero initializer {0} in a language which considers it + /// idiomatic? + bool isIdiomaticZeroInitializer(const LangOptions &LangOpts) const; + SourceLocation getLBraceLoc() const { return LBraceLoc; } void setLBraceLoc(SourceLocation Loc) { LBraceLoc = Loc; } SourceLocation getRBraceLoc() const { return RBraceLoc; } @@ -3994,6 +3998,9 @@ class InitListExpr : public Expr { (public) bool isSemanticForm() const { return AltForm.getInt(); } InitListExpr *getSemanticForm() const { return isSemanticForm() ? nullptr : AltForm.getPointer(); + } + bool isSyntacticForm() const { + return !AltForm.getInt() || !AltForm.getPointer(); } InitListExpr *getSyntacticForm() const { return isSemanticForm() ? AltForm.getPointer() : nullptr; Modified: head/contrib/llvm/tools/clang/lib/AST/Expr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/Expr.cpp Sat Jan 13 17:36:11 2018 (r327929) +++ head/contrib/llvm/tools/clang/lib/AST/Expr.cpp Sat Jan 13 17:47:34 2018 (r327930) @@ -1899,6 +1899,17 @@ bool InitListExpr::isTransparent() const { getInit(0)->getType().getCanonicalType(); } +bool InitListExpr::isIdiomaticZeroInitializer(const LangOptions &LangOpts) const { + assert(isSyntacticForm() && "only test syntactic form as zero initializer"); + + if (LangOpts.CPlusPlus || getNumInits() != 1) { + return false; + } + + const IntegerLiteral *Lit = dyn_cast(getInit(0)); + return Lit && Lit->getValue() == 0; +} + SourceLocation InitListExpr::getLocStart() const { if (InitListExpr *SyntacticForm = getSyntacticForm()) return SyntacticForm->getLocStart(); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Sat Jan 13 17:36:11 2018 (r327929) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Sat Jan 13 17:47:34 2018 (r327930) @@ -826,6 +826,34 @@ int InitListChecker::numStructUnionElements(QualType D return InitializableMembers - structDecl->hasFlexibleArrayMember(); } +/// Determine whether Entity is an entity for which it is idiomatic to elide +/// the braces in aggregate initialization. +static bool isIdiomaticBraceElisionEntity(const InitializedEntity &Entity) { + // Recursive initialization of the one and only field within an aggregate + // class is considered idiomatic. This case arises in particular for + // initialization of std::array, where the C++ standard suggests the idiom of + // + // std::array arr = {1, 2, 3}; + // + // (where std::array is an aggregate struct containing a single array field. + + // FIXME: Should aggregate initialization of a struct with a single + // base class and no members also suppress the warning? + if (Entity.getKind() != InitializedEntity::EK_Member || !Entity.getParent()) + return false; + + auto *ParentRD = + Entity.getParent()->getType()->castAs()->getDecl(); + if (CXXRecordDecl *CXXRD = dyn_cast(ParentRD)) + if (CXXRD->getNumBases()) + return false; + + auto FieldIt = ParentRD->field_begin(); + assert(FieldIt != ParentRD->field_end() && + "no fields but have initializer for member?"); + return ++FieldIt == ParentRD->field_end(); +} + /// Check whether the range of the initializer \p ParentIList from element /// \p Index onwards can be used to initialize an object of type \p T. Update /// \p Index to indicate how many elements of the list were consumed. @@ -886,7 +914,9 @@ void InitListChecker::CheckImplicitInitList(const Init } // Complain about missing braces. - if (T->isArrayType() || T->isRecordType()) { + if ((T->isArrayType() || T->isRecordType()) && + !ParentIList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()) && + !isIdiomaticBraceElisionEntity(Entity)) { SemaRef.Diag(StructuredSubobjectInitList->getLocStart(), diag::warn_missing_braces) << StructuredSubobjectInitList->getSourceRange() @@ -1833,7 +1863,9 @@ void InitListChecker::CheckStructUnionTypes( // worthwhile to skip over the rest of the initializer, though. RecordDecl *RD = DeclType->getAs()->getDecl(); RecordDecl::field_iterator FieldEnd = RD->field_end(); - bool CheckForMissingFields = true; + bool CheckForMissingFields = + !IList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()); + while (Index < IList->getNumInits()) { Expr *Init = IList->getInit(Index); From owner-svn-src-all@freebsd.org Sat Jan 13 17:55:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC0FE761E1; Sat, 13 Jan 2018 17:55:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA4DD6F6B8; Sat, 13 Jan 2018 17:55:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F24E216460; Sat, 13 Jan 2018 17:55:22 +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 w0DHtMaw068068; Sat, 13 Jan 2018 17:55:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DHtM2c068067; Sat, 13 Jan 2018 17:55:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801131755.w0DHtM2c068067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 13 Jan 2018 17:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327932 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 327932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 17:55:24 -0000 Author: cem Date: Sat Jan 13 17:55:22 2018 New Revision: 327932 URL: https://svnweb.freebsd.org/changeset/base/327932 Log: amd64: Add a 48-bit MAXADDR constant Some devices (e.g., ccp(4) -- to be committed) can only access the low 48 bits of physical memory. Reviewed by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/x86/include/bus.h Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Sat Jan 13 17:52:55 2018 (r327931) +++ head/sys/x86/include/bus.h Sat Jan 13 17:55:22 2018 (r327932) @@ -118,6 +118,7 @@ #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF #if defined(__amd64__) || defined(PAE) +#define BUS_SPACE_MAXADDR_48BIT 0xFFFFFFFFFFFFULL #define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFULL #else #define BUS_SPACE_MAXADDR 0xFFFFFFFF From owner-svn-src-all@freebsd.org Sat Jan 13 18:04:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAD85E76B6F; Sat, 13 Jan 2018 18:04:37 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AEE46FF88; Sat, 13 Jan 2018 18:04:37 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.15.2/8.15.2) with ESMTPS id w0DI2UFw096871 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Jan 2018 02:02:31 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.15.2/8.15.2/Submit) id w0DI2TMF096869; Sun, 14 Jan 2018 02:02:29 +0800 (CST) (envelope-from kevlo) Date: Sun, 14 Jan 2018 02:02:29 +0800 From: Kevin Lo To: Pedro Giffuni Cc: Justin Hibbits , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx Message-ID: <20180113180229.GA96844@ns.kevlo.org> References: <201801130136.w0D1abhS054355@repo.freebsd.org> <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> <3bd7260a-4bac-2718-9836-15bb25cbc793@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3bd7260a-4bac-2718-9836-15bb25cbc793@FreeBSD.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:04:38 -0000 On Sat, Jan 13, 2018 at 10:38:43AM -0500, Pedro Giffuni wrote: > > ... > > > On 13/01/2018 10:33, Justin Hibbits wrote: > > > > > > On Jan 13, 2018 09:04, "Pedro Giffuni" > > wrote: > > > > > > > > On 12/01/2018 20:36, Justin Hibbits wrote: > > > > Author: jhibbits > > Date: Sat Jan 13 01:36:37 2018 > > New Revision: 327906 > > URL: https://svnweb.freebsd.org/changeset/base/327906 > > > > ... > > > > > > Added: head/sys/powerpc/mpc85xx/mpc85xx_cache.c > > ============================================================================== > > --- /dev/null   00:00:00 1970   (empty, because file is newly > > added) > > +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 > > 01:36:37 2018        (r327906) > > @@ -0,0 +1,129 @@ > > +/*- > > + * Copyright (c) 2018 Justin Hibbits > > + * All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or > > without > > + * modification, are permitted provided that the following > > conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above > > copyright > > + *    notice, this list of conditions and the following > > disclaimer. > > + * 2. Redistributions in binary form must reproduce the above > > copyright > > + *    notice, this list of conditions and the following > > disclaimer in the > > + *    documentation and/or other materials provided with the > > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > > ``AS IS'' AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > > LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > > PARTICULAR PURPOSE > > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > > CONTRIBUTORS BE LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, > > OR CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > > SUBSTITUTE GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > > INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > > CONTRACT, STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > > ARISING IN ANY WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > > POSSIBILITY OF > > + * SUCH DAMAGE. > > + * > > + * $FreeBSD$ > > + */ > > + > > > > > > Can we please add SPDX ID tags, specially on new code? > > I had them added to the guidelines: > > > > https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html > > > > > > It is just not fun for me anymore to go hunting for untagged files > > and they keep appearing ;). > > > > Pedro. > > > > > > D'oh, sorry. I had used an existing boilerplate template I have lying > > around that didn't have the SPDX tags. I'll update and fix this. > > > It's OK, no hurry. The diff below adds SPDX tag to the example copyright. Index: share/examples/etc/bsd-style-copyright =================================================================== --- share/examples/etc/bsd-style-copyright (revision 327932) +++ share/examples/etc/bsd-style-copyright (working copy) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) [year] [your name] * All rights reserved. * From owner-svn-src-all@freebsd.org Sat Jan 13 18:09:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F49E76DCE; Sat, 13 Jan 2018 18:09:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CD1B7013B; Sat, 13 Jan 2018 18:09:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C587165F7; Sat, 13 Jan 2018 18:09:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DI9A88072647; Sat, 13 Jan 2018 18:09:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DI9AZw072646; Sat, 13 Jan 2018 18:09:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801131809.w0DI9AZw072646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 13 Jan 2018 18:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:09:11 -0000 Author: pfg Date: Sat Jan 13 18:09:09 2018 New Revision: 327934 URL: https://svnweb.freebsd.org/changeset/base/327934 Log: zstd: Use memalloc(9) for calloc macro. This is in contrib code but since we only have memalloc(9) in current we will not upstream this. Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 17:56:46 2018 (r327933) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 18:09:09 2018 (r327934) @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) #define free(x) (free)((x), M_ZSTD) /* in zstd's use of calloc, a is always 1 */ -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) #endif #ifdef __cplusplus From owner-svn-src-all@freebsd.org Sat Jan 13 18:26:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CAD0E77FDC; Sat, 13 Jan 2018 18:26:58 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E00070C41; Sat, 13 Jan 2018 18:26:57 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-it0-f47.google.com with SMTP id 68so12833732ite.4; Sat, 13 Jan 2018 10:26:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zt5s977nAepjTiZDQcGf4z04Rqk/EvgLsQCj8i+eQts=; b=Lhf2RDDm+408sET2jzCdFDtshiTz+UKf3Oe2CwIXi+LlbasE9Y+p2tMCtZQSdmJJKC Yv6xjw5Pq7ivlEkvSLC/biYvIfUicVgiylZhBsdRr84n7bXlPgcaDxDSlG1+n++eM7nM 9HWW3+ccR7UsBZXCNdyt3nNiTNfecVm+/RSpAr+4wRUW3IMvWVzG7le5RStVcI+RJdjg Cas+eTD7VXsaYZzVT7D09MD+wMMhecF0Br4cE2wG4RzmtlTiDufmwACQzIwC8Dvjuaxx GznKnyrhuH7aNEW5H/8NsOG/rvkovOL0ssBuMjDOtVb152C5VOf73EWb2D2Vc6HtuojT M05g== X-Gm-Message-State: AKwxytd1Lc1T3IAplHybt7c2P5qacLKftzDNwRyH7YFS+JpCV40iXHAf urVM4ydXfyktd4flnR7B+IzwhAqp X-Google-Smtp-Source: ACJfBou0aBg6rQ7mo/06GezohhVrq2jaDpyfFfrGllBgG5/RiBeLgdRB4s+RA6GOad7J2FsrVIwLjg== X-Received: by 10.36.123.9 with SMTP id q9mr1803658itc.21.1515868010692; Sat, 13 Jan 2018 10:26:50 -0800 (PST) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id p198sm3483169itp.11.2018.01.13.10.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 10:26:50 -0800 (PST) Received: by mail-io0-f181.google.com with SMTP id k18so9165544ioc.11; Sat, 13 Jan 2018 10:26:50 -0800 (PST) X-Received: by 10.107.21.65 with SMTP id 62mr28758068iov.148.1515868010019; Sat, 13 Jan 2018 10:26:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.149.147 with HTTP; Sat, 13 Jan 2018 10:26:29 -0800 (PST) In-Reply-To: <201801131725.w0DHPmY5055584@repo.freebsd.org> References: <201801131725.w0DHPmY5055584@repo.freebsd.org> From: Kyle Evans Date: Sat, 13 Jan 2018 12:26:29 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327928 - head/sys/powerpc/mpc85xx To: Pedro Giffuni Cc: src-committers , Justin Hibbits , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:26:58 -0000 On Sat, Jan 13, 2018 at 11:25 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Jan 13 17:25:48 2018 > New Revision: 327928 > URL: https://svnweb.freebsd.org/changeset/base/327928 > > Log: > Add SPDX identifier to header > > Reported by: pfg > > Modified: > head/sys/powerpc/mpc85xx/mpc85xx_cache.c > > Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c > ============================================================================== > --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:21:45 2018 (r327927) > +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:25:48 2018 (r327928) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > * Copyright (c) 2018 Justin Hibbits > * All rights reserved. > * Doesn't BSD-2-Clause-FreeBSD imply that the license includes the following disclaimer? "The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project." That's what the SPDX license list seems to imply. I have some stuff I've recently added that I need to go back and tag. From owner-svn-src-all@freebsd.org Sat Jan 13 18:28:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EFC6E780FF for ; Sat, 13 Jan 2018 18:28:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic315-22.consmr.mail.gq1.yahoo.com (sonic315-22.consmr.mail.gq1.yahoo.com [98.137.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB2D270DBB for ; Sat, 13 Jan 2018 18:28:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515868098; bh=/CG693PVVVst0YaX96grwzO+LqX9xg/o5xXMpXCPUE4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=NvL4TMtr7z6WAqnFoMDdkDvMl/mkSrhdxFfhnGUSV40iLQ1fRD8DONk9oUGiElaow++zDO6LVWizFvgVhegd3vGCLXKsCOMq9+MbgUs5gADwCZLgjyHnSEMdTEvPM3sowQdMHWnijc8dllS4VPBK3yRGn1k1YqG6oM2siHveaN8SEsfGQEq2GRsFj8UGfxKoeuQOPn2iaCgL4Pj5LX7noFpKNKEOY7mPvzl5tHyQlTu9haJ0BlKeQNNpUBuqCoQ62voaqMPWrXw8t1xG8UJOUzn/AThSC7UCEgYLpL8piHNHLJnUm0MJDhXd+dzbMj/V0nJykCmbPXDqF1cJEVmvqg== X-YMail-OSG: 8fsOZ2kVM1lMt24Jvy0re_ZYn4z32lVN0MzfynFFBX3QW.LYfoUWm6YmvyhmpPa K_VV1my.q_dJynEHxJpdwtOA4AGKzIuG5QRgY1dJeZeBpvSbFr2W9TGOV3BAZv0cHi1Lz7cx.1fb fCq5WzQYChZ2Nql0gVmIkzW4XHe8UDaJMo9uoaD5eXN1EER7KNr4Jj9q8Kpan4lyrlOA1q_m0iwO nH1AeWDp9pSduk8U9R77ot7.mbYDqLno3YROg4QbI8OPguegxV02mAOAkAAl6EyDPjn7F3eVExvp 1L3udzAnQL_nyvpL4d8t.tFnxkoU3AufFbGphocnHAfhs3_9uskmQngAXhQYGo.XDqon9phWsNy8 PmuAaa.n25LxJxkSD5dM2iyr0.c9xhQG6GPnI.N1n1xe3XLDGtiS1KOG7O_JkS3g63.1sZ_2m1RX z4z0ezz5neNktvJgT1Q29vkduoG8FmK6qfWYKZgMFl15Hh3fV3e6HG9Ueizq74_kRXyLhfW7g Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 18:28:18 +0000 Received: from smtp105.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([68.180.227.8]) by smtp408.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 2572581542d13f9dc796fb18cf7128fa; Sat, 13 Jan 2018 18:28:14 +0000 (UTC) Subject: Re: svn commit: r327906 - in head/sys: conf powerpc/mpc85xx To: Kevin Lo Cc: Justin Hibbits , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201801130136.w0D1abhS054355@repo.freebsd.org> <40f39e41-f051-0758-fe15-55c1dab64c9c@FreeBSD.org> <3bd7260a-4bac-2718-9836-15bb25cbc793@FreeBSD.org> <20180113180229.GA96844@ns.kevlo.org> From: Pedro Giffuni Message-ID: <60e0548a-107a-6618-f29e-81804eafea75@FreeBSD.org> Date: Sat, 13 Jan 2018 13:28:13 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180113180229.GA96844@ns.kevlo.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:28:25 -0000 On 01/13/18 13:02, Kevin Lo wrote: > On Sat, Jan 13, 2018 at 10:38:43AM -0500, Pedro Giffuni wrote: >> ... >> >> >> On 13/01/2018 10:33, Justin Hibbits wrote: >>> ... >>> >>> >>> Can we please add SPDX ID tags, specially on new code? >>> I had them added to the guidelines: >>> >>> https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html >>> >>> >>> It is just not fun for me anymore to go hunting for untagged files >>> and they keep appearing ;). >>> >>> Pedro. >>> >>> >>> D'oh, sorry. I had used an existing boilerplate template I have lying >>> around that didn't have the SPDX tags. I'll update and fix this. >>> >> It's OK, no hurry. > The diff below adds SPDX tag to the example copyright. > > Index: share/examples/etc/bsd-style-copyright > =================================================================== > --- share/examples/etc/bsd-style-copyright (revision 327932) > +++ share/examples/etc/bsd-style-copyright (working copy) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > * Copyright (c) [year] [your name] > * All rights reserved. > * Hmm ... and now I am in doubt if we should include the FreeBSD suffix in the identifier: the example could be used for non FreeBSD projects. I'll certainly update it though, Thanks! From owner-svn-src-all@freebsd.org Sat Jan 13 18:28:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1186E78137; Sat, 13 Jan 2018 18:28:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6DB070DEE; Sat, 13 Jan 2018 18:28:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10CC71692E; Sat, 13 Jan 2018 18:28:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DISURC080689; Sat, 13 Jan 2018 18:28:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DISUXE080688; Sat, 13 Jan 2018 18:28:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801131828.w0DISUXE080688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 13 Jan 2018 18:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327935 - head/share/examples/etc X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/share/examples/etc X-SVN-Commit-Revision: 327935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:28:32 -0000 Author: pfg Date: Sat Jan 13 18:28:30 2018 New Revision: 327935 URL: https://svnweb.freebsd.org/changeset/base/327935 Log: Add SPDX identifier for the example license. For project files we should use the -FreeBSD prefix but for this example assume it is going to be used for some general purpose. Submitted by: kevlo Modified: head/share/examples/etc/bsd-style-copyright Modified: head/share/examples/etc/bsd-style-copyright ============================================================================== --- head/share/examples/etc/bsd-style-copyright Sat Jan 13 18:09:09 2018 (r327934) +++ head/share/examples/etc/bsd-style-copyright Sat Jan 13 18:28:30 2018 (r327935) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) [year] [your name] * All rights reserved. * From owner-svn-src-all@freebsd.org Sat Jan 13 18:33:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFAC8E78664; Sat, 13 Jan 2018 18:33:54 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5085071492; Sat, 13 Jan 2018 18:33:53 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.182.8.155]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lmr1w-1f4GCU0RXo-00h6JP; Sat, 13 Jan 2018 19:33:46 +0100 Date: Sat, 13 Jan 2018 19:33:12 +0100 From: "O. Hartmann" To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd Message-ID: <20180113193339.549bf55a@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201801131809.w0DI9AZw072646@repo.freebsd.org> References: <201801131809.w0DI9AZw072646@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/zrACyMS6vy8QRQ5v5SB5uA5"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:SgyQRpJHiSnkp+IGxS9pTi6xu6zyjnmBsVvyOcxMKl9xaXyrvS1 0lfksblaao+7OLp1jMTDaly3d87fAzu7YU0FsmaBJefAXvQZthIm1nMKYlX0Hl0kbd6qIZE X5PUR8bwyMNvNdaraE3+saaeDRbDuRKScj/J1E/5miTjHpAAe+NsgOdQpDFLOphj9lbzEKk 0pUStcwtvKVq1gkKs+Wiw== X-UI-Out-Filterresults: notjunk:1;V01:K0:9Gw05CFXG28=:Tlo2osxZsqdYnL7PZ79yYi XuY/gahXCEmwWcGdhhaopGAWW/cYUZHQWu7UbtgOCtuj5xkecQwWZUhNJiT9/qLmhPvAu+yzN bLGrWExqNrjue6S6OAgDDiZJ8WDEldomDJ0E+mOkbnKfrGa/aHWEGZHwHIc7xXG/h03LPe0Tn y35c++M7D6Ju9+1PJIq7hdkdloMK0X/v1pxgzUUBsM1GsgYARjvpi+1YqUyX4kzrsHcqNZmIm Dknv1wp8V+g8+R+Xa6aHC/Xvy7QJAzYI39ukwoaeO4C3XxLE1nG4JsVRIQgkN0RPU+bl951xo ZBpjwWI8lV19+9GQSsi87jTKibgWRNI7Bd0pRYfeKmLcD9EOSvNtFg/BRLJLS4lZu1tZ7IrwQ 1fbwqAQAnGbPOtAfFDw7TFPFd4hNbUbPstw/qHQ1xXTST0AUlLaXnlGB3HSNW409E3xLt6hnQ Xcwl5uE7igdIWEql6XH4P0YdJrHo4Eeag8w2mZeF2k28y31eWsNA9tySN7//oO9zmMtflpaYc 8zOeqvFbff9hMy1p/xWKCvmV6H/dayQ7Xp6QueBWmK/GzQ0hjIqcAevSWTsT4QkeOkde4BLZz IpEiy/3AcoyNq3svW0krLnTu6QZXONIOEBoEw14OCHYeqa668GlGInvG6b6h/awPE1lz8eROQ 57bANcO0pO2iV/+wP9hirteTyBUB8SCDMyF+b2BEP6fGGWxQ9HOGF8YPVTDynXqjI7dU4Whi/ 0X7lx6kVBSYZKYKV2pO9Y4G+x/1q6bMOM/ArUmm14wID7JO3Qwdp4F5N7SFUkhMnuATaaGb+Z b92xZmMWp/rDG1xH1n10uL08H2m5g== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:33:55 -0000 --Sig_/zrACyMS6vy8QRQ5v5SB5uA5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 13 Jan 2018 18:09:10 +0000 (UTC) "Pedro F. Giffuni" schrieb: > Author: pfg > Date: Sat Jan 13 18:09:09 2018 > New Revision: 327934 > URL: https://svnweb.freebsd.org/changeset/base/327934 >=20 > Log: > zstd: Use memalloc(9) for calloc macro. > =20 > This is in contrib code but since we only have memalloc(9) in current we > will not upstream this. >=20 > Modified: > head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >=20 > Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 17:56:46 > 2018 (r327933) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat > Jan 13 18:09:09 2018 (r327934) @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); > #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) > #define free(x) (free)((x), M_ZSTD) > /* in zstd's use of calloc, a is always 1 */ > -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) > +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) > #endif > =20 > #ifdef __cplusplus > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" You reference "memalloc(9)" - but on recent CURRENT, there is no such manpa= ge available. regards, oh --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/zrACyMS6vy8QRQ5v5SB5uA5 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWlpRAwAKCRDS528fyFhY lL3xAf4i6fhl2Bch0g8mGPTfUJpGpKWLwcI9SO3bHr3nDjNiwVpBneC2zNmeTLsd NdP/YbiyahDR09SyFhtlDtIXueMHAgCOL06LhqtT9jdCzo/OIwiGrmvOZhvJt749 Nf9W5YFU6j5LLLt5gb/vzKkTSz0fIHcWIkDmfSicojZSwwh0P8Cj =4Oux -----END PGP SIGNATURE----- --Sig_/zrACyMS6vy8QRQ5v5SB5uA5-- From owner-svn-src-all@freebsd.org Sat Jan 13 18:44:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B1A6E78D7E; Sat, 13 Jan 2018 18:44:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D230671A28; Sat, 13 Jan 2018 18:44:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 889E54722D; Sat, 13 Jan 2018 19:44:20 +0100 (CET) From: Dimitry Andric Message-Id: <65C751BF-FC03-4541-8D2A-A02C3A1B2A13@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_2E627374-C599-40D1-8129-6BFF3E93C96D"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd Date: Sat, 13 Jan 2018 19:44:14 +0100 In-Reply-To: <201801131809.w0DI9AZw072646@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "Pedro F. Giffuni" References: <201801131809.w0DI9AZw072646@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:44:29 -0000 --Apple-Mail=_2E627374-C599-40D1-8129-6BFF3E93C96D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 13 Jan 2018, at 19:09, Pedro F. Giffuni wrote: >=20 > Author: pfg > Date: Sat Jan 13 18:09:09 2018 > New Revision: 327934 > URL: https://svnweb.freebsd.org/changeset/base/327934 >=20 > Log: > zstd: Use memalloc(9) for calloc macro. >=20 > This is in contrib code but since we only have memalloc(9) in current = we > will not upstream this. >=20 > Modified: > head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >=20 > Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 = 17:56:46 2018 (r327933) > +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 = 18:09:09 2018 (r327934) > @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); > #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) > #define free(x) (free)((x), M_ZSTD) > /* in zstd's use of calloc, a is always 1 */ > -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) > +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | = M_ZERO) > #endif >=20 > #ifdef __cplusplus s/memalloc/mallocarray/g, in the commit message? -Dimitry --Apple-Mail=_2E627374-C599-40D1-8129-6BFF3E93C96D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWlpTgwAKCRCwXqMKLiCW owI3AKC9VGFp4w/ejuRUF58BNgKNwRslAQCfTi1D71K4jmjbvLhjYIrBgNAM96w= =ufB6 -----END PGP SIGNATURE----- --Apple-Mail=_2E627374-C599-40D1-8129-6BFF3E93C96D-- From owner-svn-src-all@freebsd.org Sat Jan 13 18:46:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3EBEE78F30; Sat, 13 Jan 2018 18:46:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0F871BBA; Sat, 13 Jan 2018 18:46:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 989C416C51; Sat, 13 Jan 2018 18:46:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DIkWdo089011; Sat, 13 Jan 2018 18:46:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DIkVgS089005; Sat, 13 Jan 2018 18:46:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801131846.w0DIkVgS089005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 18:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327936 - in head: share/man/man4 sys/arm/allwinner sys/dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/man/man4 sys/arm/allwinner sys/dev/extres/syscon X-SVN-Commit-Revision: 327936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:46:33 -0000 Author: kevans Date: Sat Jan 13 18:46:31 2018 New Revision: 327936 URL: https://svnweb.freebsd.org/changeset/base/327936 Log: Introduce aw_syscon(4) for earlier attachment Attaching syscon_generic earlier than BUS_PASS_DEFAULT makes it more difficult for specific syscon drivers to attach to the syscon node and to get ordering right. Further discussion yielded the following set of decisions: - Move syscon_generic to BUS_PASS_DEFAULT - If a platform needs a syscon with different attach order or probe behavior, it should subclass syscon_generic and match on the SoC specific compat string - When we come across a need for a syscon that attaches earlier but only specifies compatible = "syscon", we should create a syscon_exclusive driver that provides generic access but probes earlier and only matches if "syscon" is the only compatible. Such fdt nodes do exist in the wild right now, but we don't really use them at the moment. Additionally: - Any syscon provider that has needs any more complex than a spinlock solely for syscon access and a single memory resource should subclass syscon directly rather than attempting to subclass syscon_generic or add complexity to it. syscon_generic's attach/detach methods may be made public should the need arise to subclass it with additional attach/detach behavior. We introduce aw_syscon(4) that just subclasses syscon_generic but probes earlier to meet our requirements for if_awg and implements #2 above for this specific situation. It currently only matches a64/a83t/h3 since these are the only platforms that really need it at the time being. Discussed with: ian Reviewed by: manu, andrew, bcr (manpages, content unchanged since review) Differential Revision: https://reviews.freebsd.org/D13793 Added: head/share/man/man4/aw_syscon.4 (contents, props changed) head/sys/arm/allwinner/aw_syscon.c (contents, props changed) head/sys/dev/extres/syscon/syscon_generic.h (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/arm/allwinner/files.allwinner head/sys/dev/extres/syscon/syscon_generic.c Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Jan 13 18:28:30 2018 (r327935) +++ head/share/man/man4/Makefile Sat Jan 13 18:46:31 2018 (r327936) @@ -74,6 +74,7 @@ MAN= aac.4 \ ${_aw_mmc.4} \ ${_aw_rtc.4} \ ${_aw_sid.4} \ + ${_aw_syscon.4} \ axe.4 \ axge.4 \ bce.4 \ @@ -765,6 +766,7 @@ _aw_gpio.4= aw_gpio.4 _aw_mmc.4= aw_mmc.4 _aw_rtc.4= aw_rtc.4 _aw_sid.4= aw_sid.4 +_aw_syscon.4= aw_syscon.4 .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Added: head/share/man/man4/aw_syscon.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_syscon.4 Sat Jan 13 18:46:31 2018 (r327936) @@ -0,0 +1,60 @@ +.\"- +.\" Copyright (c) 2018 Kyle Evans +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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 January 7, 2018 +.Dt AW_SYSCON 4 +.Os +.Sh NAME +.Nm aw_syscon +.Nd driver for the system controller in Allwinner SoC +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner system controller. +This controller provides registers for tying together related functionality in a +common space. +.Nm +is required for ethernet functionality on supported devices. +.Sh HARDWARE +The +.Nm +driver supports the system controller with one of the following compatible +strings: +.Pp +.Bl -bullet -compact +.It +allwinner,sun50i-a64-system-controller +.It +allwinner,sun8i-a83t-system-controller +.It +allwinner,sun8i-h3-system-controller +.El +.Sh AUTHORS +The +.Nm +device driver was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . Added: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_syscon.c Sat Jan 13 18:46:31 2018 (r327936) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2018 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +/* + * Allwinner syscon driver + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun50i-a64-system-controller", 1}, + {"allwinner,sun8i-a83t-system-controller", 1}, + {"allwinner,sun8i-h3-system-controller", 1}, + {NULL, 0} +}; + +static int +aw_syscon_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner syscon"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t aw_syscon_methods[] = { + DEVMETHOD(device_probe, aw_syscon_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(aw_syscon, aw_syscon_driver, aw_syscon_methods, + sizeof(struct syscon_generic_softc), syscon_generic_driver); + +static devclass_t aw_syscon_devclass; +/* aw_syscon needs to attach prior to if_awg */ +EARLY_DRIVER_MODULE(aw_syscon, simplebus, aw_syscon_driver, aw_syscon_devclass, + 0, 0, BUS_PASS_DEFAULT - 1000); +MODULE_VERSION(aw_syscon, 1); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sat Jan 13 18:28:30 2018 (r327935) +++ head/sys/arm/allwinner/files.allwinner Sat Jan 13 18:46:31 2018 (r327936) @@ -15,6 +15,7 @@ arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_rsb.c optional rsb | p2wi arm/allwinner/aw_rtc.c standard +arm/allwinner/aw_syscon.c optional ext_resources syscon arm/allwinner/aw_ts.c standard arm/allwinner/aw_usbphy.c optional ehci | ohci arm/allwinner/aw_wdog.c standard Modified: head/sys/dev/extres/syscon/syscon_generic.c ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.c Sat Jan 13 18:28:30 2018 (r327935) +++ head/sys/dev/extres/syscon/syscon_generic.c Sat Jan 13 18:46:31 2018 (r327936) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include "syscon_if.h" #include "syscon.h" +#include "syscon_generic.h" MALLOC_DECLARE(M_SYSCON); @@ -60,22 +61,15 @@ static int syscon_generic_modify_4(struct syscon *sysc /* * Generic syscon driver (FDT) */ -struct syscon_generic_softc { - device_t dev; - struct syscon *syscon; - struct resource *mem_res; - struct mtx mtx; -}; - static struct ofw_compat_data compat_data[] = { {"syscon", 1}, {NULL, 0} }; -#define SYSCON_LOCK(_sc) mtx_lock(&(_sc)->mtx) -#define SYSCON_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define SYSCON_LOCK(_sc) mtx_lock_spin(&(_sc)->mtx) +#define SYSCON_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->mtx) #define SYSCON_LOCK_INIT(_sc) mtx_init(&(_sc)->mtx, \ - device_get_nameunit((_sc)->dev), "syscon", MTX_DEF) + device_get_nameunit((_sc)->dev), "syscon", MTX_SPIN) #define SYSCON_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx); #define SYSCON_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED); #define SYSCON_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_NOTOWNED); @@ -156,8 +150,8 @@ syscon_generic_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res == NULL) { @@ -181,7 +175,6 @@ syscon_generic_detach(device_t dev) struct syscon_generic_softc *sc; sc = device_get_softc(dev); - if (sc->syscon != NULL) { syscon_unregister(sc->syscon); free(sc->syscon, M_SYSCON); @@ -206,11 +199,7 @@ static device_method_t syscon_generic_dmethods[] = { DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, syscon_generic_dmethods, sizeof(struct syscon_generic_softc)); static devclass_t syscon_generic_devclass; -/* - * syscon_generic needs to attach before other devices that may require it, such - * as if_awg, but later than others to give way for more specialized syscon - * implementations. - */ + EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver, - syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT - 1000); + syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT); MODULE_VERSION(syscon_generic, 1); Added: head/sys/dev/extres/syscon/syscon_generic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/syscon/syscon_generic.h Sat Jan 13 18:46:31 2018 (r327936) @@ -0,0 +1,40 @@ +/*- + * Copyright 2018 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_SYSCON_GENERIC_H +#define DEV_SYSCON_GENERIC_H + +struct syscon_generic_softc { + device_t dev; + struct syscon *syscon; + struct resource *mem_res; + struct mtx mtx; +}; + +DECLARE_CLASS(syscon_generic_driver); + +#endif /* DEV_SYSCON_GENERIC_H */ From owner-svn-src-all@freebsd.org Sat Jan 13 18:46:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7E2E78F33 for ; Sat, 13 Jan 2018 18:46:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-36.consmr.mail.gq1.yahoo.com (sonic302-36.consmr.mail.gq1.yahoo.com [98.137.68.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD8D871BBD for ; Sat, 13 Jan 2018 18:46:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515869187; bh=X+5YNohHpG+cHuOpbSes1C+aWwfxX6x/qAkNzatHLRE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=l5dqU6wX6GtHsM8/XrzwH8iHlzA+RZ2HTcD1E+wDgOtPFBGLco89TC55eU86wzb0mTiZopm5EzZh2Dwe2SFU4CbFIEQV5EVOJvz/qQs8qvpp4obhCf4FMiK1KQKLRi5SXsK414clcrNpmhnqEmaBNLOmmZPkcjxtJ/xfw7d29ldWy7k+gPBioWAHSmfdicvszaTRfAh6l/f3RbEdkr/5jdWXpgjQmnd+breAumW0Lew6V7w0OO4bi1do/1pvKtew3ad7+CMUis5+blw4nPT6/cLME3Y+nb6EcwsoFiFMV0ejQ6gCAGneObhDOxPf0jP24SuMsijt+q4Oroxd/O7o/A== X-YMail-OSG: PTnuY3MVM1kY_EegpgCFueHxSmwY5nvuMF170QF7v6OLtmljzSIxFrF9sfBHWs9 pUxF23jEe9dUrKaryPX2k_lQE0BQLNPkrnZWNtM972b8_7obdqtWT1EcqiZVrcXATQYfatF5i37d xP8TllUbsAT4YURv1L8JcTKW0WUAo62FACxSXNC7O02I1v2xbH5Ow1bpzUX9qp2RUPdIiTcAOdjW qBYUJL6DngqH3_RHL74HroNAuEX8h7JmP3UihcFFlCriOxWzF5vEgFbYCvjfMunWzIQrd_mdnBwT u6u2nzFMT19lvGOQyR29UoQZWnltIDWqsFZB1ZCxFhx6J9NsaVkKYZlakyL5HYyr5IA.BEIzvP5S 5sQRvS1PGlfDHHEXf16EIXWL9XIRrStw_MWUtN.uql07XcC1oimIZL7P6Jp2s7ntzsCUszANhDkd eVX0o3qBJzlzOkEA7J_nFZ2dlNb96GxPSxKTaLvgnmz97F3YHicbsgdFKz20n9C7JYiNWGAIX Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 18:46:27 +0000 Received: from smtp107.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([10.211.35.149]) by smtp404.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 098556ea92db86deb3372d59b6ccc9e6; Sat, 13 Jan 2018 18:46:25 +0000 (UTC) Subject: Re: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131809.w0DI9AZw072646@repo.freebsd.org> <65C751BF-FC03-4541-8D2A-A02C3A1B2A13@FreeBSD.org> From: Pedro Giffuni Message-ID: Date: Sat, 13 Jan 2018 13:46:25 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <65C751BF-FC03-4541-8D2A-A02C3A1B2A13@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:46:34 -0000 On 01/13/18 13:44, Dimitry Andric wrote: > On 13 Jan 2018, at 19:09, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sat Jan 13 18:09:09 2018 >> New Revision: 327934 >> URL: https://svnweb.freebsd.org/changeset/base/327934 >> >> Log: >> zstd: Use memalloc(9) for calloc macro. >> >> This is in contrib code but since we only have memalloc(9) in current we >> will not upstream this. >> >> Modified: >> head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >> >> Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >> ============================================================================== >> --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 17:56:46 2018 (r327933) >> +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 18:09:09 2018 (r327934) >> @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); >> #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) >> #define free(x) (free)((x), M_ZSTD) >> /* in zstd's use of calloc, a is always 1 */ >> -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) >> +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) >> #endif >> >> #ifdef __cplusplus > s/memalloc/mallocarray/g, in the commit message? Oops ..yeah.. mind glitch. Should I revert/fix it? Pedro. From owner-svn-src-all@freebsd.org Sat Jan 13 18:56:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53B5AE7970C for ; Sat, 13 Jan 2018 18:56:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic302-36.consmr.mail.gq1.yahoo.com (sonic302-36.consmr.mail.gq1.yahoo.com [98.137.68.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DEC2723B2 for ; Sat, 13 Jan 2018 18:56:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515869764; bh=q2qNcTASJIRmZ0orWgIdKPYRu37F07TmFr+LfRbHCEc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=n6feKq0eRI/55OJlNdT2EQu9eWUARr5mv5y8IhHbIbZQkwpGIYShz4XrJtvSENo8iYqGnrD5I44SWa51jPQFwjY9pWk42hAEM5WYnBlUklBLtdXjB5ZWzYkOOZpYOrMmqFzGl/RrT4xLMB6xfFqdABjxnCpyGoRRaWxwNZE13hS4yJWuJP1VkHHltY9cF2tggTrZlNf8m78rzuIhCD/3wDQXpXE4VMQSKdSHVchdQmLUisO+BULPLucnGhIqSrEpMnhYS0KWo0eYpYwCHHLkB8skKAqQ32LUnCnAjnHmyjOw74iBQuuoDXLs3HJdcWuQGQLLCct7AtvbnoZWERemAw== X-YMail-OSG: M4_JIx0VM1mPmy.QqW2c35eNnuY26wNosWj1xe2JhZdY9WzqJe0JqKxUEnEF0Za Nh4WD.IrlvxJYj.fsCklrhnAJZzVEsghGGt_QURcf_dDE3ypmyiV4p3ekmkq1iq_OvnJl2wOYVU9 wpzUaN9E4pl1dH16itC5iUimhiOpKs4xEVp2ZqL8HrkG_QyIqRI.oK2wBrW9JRTNr.Bf1ts4OhjX 5HSaSijBrXccixJ8L1qxosJXxPT0wi.erlz1wqeHaT6J63tEh8Thz7Dm.4qA5.fmgLTFwUy4HKyf Bq38smRBKRcd8ON1dD1i09sIvjMbco2P.G14gSeNU_Bq8MGsSvnEMZ3JB28STJZMyTnl16AY_WhR 3_JpF9M4kj0r6guOwYE7ckUMt6YHEh.C6ofeazkHgOfb3XkV5mfwZSTML__FLnrUK5Bb9wUJW44k t6_zhRbnUk_NMkDQYvPhtk4GM_c3sSe3YoAd9vwyDlMwym7d.ZCQ8HRufM5dvsWKAK.BWSiRr Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 18:56:04 +0000 Received: from smtpgate102.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([10.214.153.45]) by smtp411.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID ec4a0d578193683c99ac631cd3d9b51e; Sat, 13 Jan 2018 18:55:59 +0000 (UTC) Subject: Re: svn commit: r327928 - head/sys/powerpc/mpc85xx To: Kyle Evans Cc: src-committers , Justin Hibbits , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131725.w0DHPmY5055584@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sat, 13 Jan 2018 13:55:59 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:56:05 -0000 Hello; On 01/13/18 13:26, Kyle Evans wrote: > On Sat, Jan 13, 2018 at 11:25 AM, Justin Hibbits wrote: >> Author: jhibbits >> Date: Sat Jan 13 17:25:48 2018 >> New Revision: 327928 >> URL: https://svnweb.freebsd.org/changeset/base/327928 >> >> Log: >> Add SPDX identifier to header >> >> Reported by: pfg >> >> Modified: >> head/sys/powerpc/mpc85xx/mpc85xx_cache.c >> >> Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c >> ============================================================================== >> --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:21:45 2018 (r327927) >> +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:25:48 2018 (r327928) >> @@ -1,4 +1,6 @@ >> /*- >> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> + * >> * Copyright (c) 2018 Justin Hibbits >> * All rights reserved. >> * > Doesn't BSD-2-Clause-FreeBSD imply that the license includes the > following disclaimer? > > "The views and conclusions contained in the software and documentation > are those of the authors and should not be interpreted as representing > official policies, either expressed or implied, of the FreeBSD > Project." > > That's what the SPDX license list seems to imply. I have some stuff > I've recently added that I need to go back and tag. No, the SPDX guys pointed to our website: https://www.freebsd.org/copyright/freebsd-license.html And by mistake they added the documentation project disclaimer, but that last paragraph is not part of the license. At some point I reported the issue but they haven't fixed it. Pedro. From owner-svn-src-all@freebsd.org Sat Jan 13 18:56:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF6E9E797CB; Sat, 13 Jan 2018 18:56:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBA2472512; Sat, 13 Jan 2018 18:56:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0554E16DF3; Sat, 13 Jan 2018 18:56:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DIugE6093126; Sat, 13 Jan 2018 18:56:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DIugDH093125; Sat, 13 Jan 2018 18:56:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801131856.w0DIugDH093125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 13 Jan 2018 18:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327937 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 18:56:44 -0000 Author: pfg Date: Sat Jan 13 18:56:42 2018 New Revision: 327937 URL: https://svnweb.freebsd.org/changeset/base/327937 Log: Revert r327934 to fix the log message. Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 18:46:31 2018 (r327936) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 18:56:42 2018 (r327937) @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) #define free(x) (free)((x), M_ZSTD) /* in zstd's use of calloc, a is always 1 */ -#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) +#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) #endif #ifdef __cplusplus From owner-svn-src-all@freebsd.org Sat Jan 13 19:00:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC550E79A4B; Sat, 13 Jan 2018 19:00:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B68207272F; Sat, 13 Jan 2018 19:00:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD08F16E03; Sat, 13 Jan 2018 19:00:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DJ0fB0093359; Sat, 13 Jan 2018 19:00:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DJ0frR093354; Sat, 13 Jan 2018 19:00:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801131900.w0DJ0frR093354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 19:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327938 - head/sys/dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/syscon X-SVN-Commit-Revision: 327938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:00:43 -0000 Author: kevans Date: Sat Jan 13 19:00:41 2018 New Revision: 327938 URL: https://svnweb.freebsd.org/changeset/base/327938 Log: Add SPDX tags to syscon bits, correct inconsistency in Copyright line. Modified: head/sys/dev/extres/syscon/syscon.c head/sys/dev/extres/syscon/syscon.h head/sys/dev/extres/syscon/syscon_generic.c head/sys/dev/extres/syscon/syscon_generic.h Modified: head/sys/dev/extres/syscon/syscon.c ============================================================================== --- head/sys/dev/extres/syscon/syscon.c Sat Jan 13 18:56:42 2018 (r327937) +++ head/sys/dev/extres/syscon/syscon.c Sat Jan 13 19:00:41 2018 (r327938) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2017 Kyle Evans * All rights reserved. * Modified: head/sys/dev/extres/syscon/syscon.h ============================================================================== --- head/sys/dev/extres/syscon/syscon.h Sat Jan 13 18:56:42 2018 (r327937) +++ head/sys/dev/extres/syscon/syscon.h Sat Jan 13 19:00:41 2018 (r327938) @@ -1,5 +1,7 @@ /*- - * Copyright 2017 Kyle Evans + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/extres/syscon/syscon_generic.c ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.c Sat Jan 13 18:56:42 2018 (r327937) +++ head/sys/dev/extres/syscon/syscon_generic.c Sat Jan 13 19:00:41 2018 (r327938) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Michal Meloun * All rights reserved. * Modified: head/sys/dev/extres/syscon/syscon_generic.h ============================================================================== --- head/sys/dev/extres/syscon/syscon_generic.h Sat Jan 13 18:56:42 2018 (r327937) +++ head/sys/dev/extres/syscon/syscon_generic.h Sat Jan 13 19:00:41 2018 (r327938) @@ -1,5 +1,7 @@ /*- - * Copyright 2018 Kyle Evans + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Sat Jan 13 19:02:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B8F5E79CBB; Sat, 13 Jan 2018 19:02:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7F372AE4; Sat, 13 Jan 2018 19:02:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F3DE16F7B; Sat, 13 Jan 2018 19:02:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DJ290g095230; Sat, 13 Jan 2018 19:02:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DJ29R7095229; Sat, 13 Jan 2018 19:02:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801131902.w0DJ29R7095229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 19:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327939 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 327939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:02:10 -0000 Author: kevans Date: Sat Jan 13 19:02:08 2018 New Revision: 327939 URL: https://svnweb.freebsd.org/changeset/base/327939 Log: Add SPDX tag to aw_syscon(4) Modified: head/sys/arm/allwinner/aw_syscon.c Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Sat Jan 13 19:00:41 2018 (r327938) +++ head/sys/arm/allwinner/aw_syscon.c Sat Jan 13 19:02:08 2018 (r327939) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2018 Kyle Evans * All rights reserved. * From owner-svn-src-all@freebsd.org Sat Jan 13 19:02:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C100FE79D5D; Sat, 13 Jan 2018 19:02:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D73372CFC; Sat, 13 Jan 2018 19:02:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E635C16F9B; Sat, 13 Jan 2018 19:02:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DJ2pYo097643; Sat, 13 Jan 2018 19:02:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DJ2p5m097642; Sat, 13 Jan 2018 19:02:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801131902.w0DJ2p5m097642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 13 Jan 2018 19:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/freebsd X-SVN-Commit-Revision: 327940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:02:52 -0000 Author: pfg Date: Sat Jan 13 19:02:51 2018 New Revision: 327940 URL: https://svnweb.freebsd.org/changeset/base/327940 Log: zstd: Use mallocarray(9) for calloc macro. This is in contrib code but since we only have mallocarray(9) in current we will not upstream this. This effectively brings back r327934, which was reverted to correct the log message. Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h ============================================================================== --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:08 2018 (r327939) +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:51 2018 (r327940) @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) #define free(x) (free)((x), M_ZSTD) /* in zstd's use of calloc, a is always 1 */ -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) #endif #ifdef __cplusplus From owner-svn-src-all@freebsd.org Sat Jan 13 19:03:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80C2E79E26; Sat, 13 Jan 2018 19:03:34 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B847472E4E; Sat, 13 Jan 2018 19:03:34 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-it0-f51.google.com with SMTP id r6so12896561itr.3; Sat, 13 Jan 2018 11:03:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4OWTl8FfCH9zaN1NHtTHfrRh3dGrOUS8fIv/8AINdM0=; b=fjBV8fvzfPK77bV5gNifmIELaime+Kqd/+OHJMja2QAeAkMuMuKuPis7xZJWKaIVRA 6Z8LlKvTOdexwYFyHnWuXnT/uem0P0QZE3l/FlqDtruGfZMBv4cAGv6UMrqAB9/Fe8ri hItKdUWVYh7vhc5WAukDuH96iK8QpCUeuLwdMdcKfk5fXM2m/3HDUCTtbyJcLkxdc5AY cLHdh35zDH0lljhPw/uCbORSFpPuSYvqzjEaR62KSmbRCCmoVS3d2CSA0B9f6q9EXYSV cXp/RCcSyxG/feGlJbHyHKec1IfNDyBFGW5MFXb4QggFYDgwBRBaTQBuJg5s5ojh7FQm SBwA== X-Gm-Message-State: AKwxytdCz/M0IY/+Qcm79JHsbBkaj0Rjw5J1wSv4pLuTQyN5fgeR3db0 QLfG/YJTFdQrWCD9M8UCuOVkogQq X-Google-Smtp-Source: ACJfBovlCWRcKvtwWBvIFIkZDHMzMtjGYtCk1k3/M0Tbd72a1FMPJ0F1OKGYJqzfUsIjCe8pB+PNrg== X-Received: by 10.36.222.66 with SMTP id d63mr8162788itg.99.1515870208384; Sat, 13 Jan 2018 11:03:28 -0800 (PST) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id f63sm14584235ioj.43.2018.01.13.11.03.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 11:03:28 -0800 (PST) Received: by mail-it0-f49.google.com with SMTP id r6so12896519itr.3; Sat, 13 Jan 2018 11:03:27 -0800 (PST) X-Received: by 10.36.4.212 with SMTP id 203mr4097034itb.132.1515870207615; Sat, 13 Jan 2018 11:03:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.149.147 with HTTP; Sat, 13 Jan 2018 11:03:07 -0800 (PST) In-Reply-To: References: <201801131725.w0DHPmY5055584@repo.freebsd.org> From: Kyle Evans Date: Sat, 13 Jan 2018 13:03:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327928 - head/sys/powerpc/mpc85xx To: Pedro Giffuni Cc: src-committers , Justin Hibbits , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:03:35 -0000 On Sat, Jan 13, 2018 at 12:55 PM, Pedro Giffuni wrote: > Hello; > > > > On 01/13/18 13:26, Kyle Evans wrote: >> >> On Sat, Jan 13, 2018 at 11:25 AM, Justin Hibbits >> wrote: >>> >>> Author: jhibbits >>> Date: Sat Jan 13 17:25:48 2018 >>> New Revision: 327928 >>> URL: https://svnweb.freebsd.org/changeset/base/327928 >>> >>> Log: >>> Add SPDX identifier to header >>> >>> Reported by: pfg >>> >>> Modified: >>> head/sys/powerpc/mpc85xx/mpc85xx_cache.c >>> >>> Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c >>> >>> ============================================================================== >>> --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:21:45 2018 >>> (r327927) >>> +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 17:25:48 2018 >>> (r327928) >>> @@ -1,4 +1,6 @@ >>> /*- >>> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >>> + * >>> * Copyright (c) 2018 Justin Hibbits >>> * All rights reserved. >>> * >> >> Doesn't BSD-2-Clause-FreeBSD imply that the license includes the >> following disclaimer? >> >> "The views and conclusions contained in the software and documentation >> are those of the authors and should not be interpreted as representing >> official policies, either expressed or implied, of the FreeBSD >> Project." >> >> That's what the SPDX license list seems to imply. I have some stuff >> I've recently added that I need to go back and tag. > > No, the SPDX guys pointed to our website: > > https://www.freebsd.org/copyright/freebsd-license.html > > And by mistake they added the documentation project disclaimer, but that > last paragraph is not part of the license. At some point I reported the > issue but they haven't fixed it. Thanks for the clarification! From owner-svn-src-all@freebsd.org Sat Jan 13 19:23:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E78E7ACD7; Sat, 13 Jan 2018 19:23:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEFC07385D; Sat, 13 Jan 2018 19:23:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id b77so12707684itd.0; Sat, 13 Jan 2018 11:23:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=iDQKLMPrAzRbtt3aQwemw36Is+O+xJ0hTxVC19RKEKw=; b=pEPPWxRD+qWdWsBgyzcSorncwdB7+xejLNrFZqZX+tUZNlWM4SDQZJN/MGo5dFwLaT lrgdRA+TpA/LgDoiTWxFSnEisOzQ6iOKt5uI3uACOvYPhT9L4L5fCp6uKqoHiNcCyh67 AHL9lY/GDlUvumtx+A7GpxEuckZwFCf2ydfxVfHyvScwQHdu47PCuLvADg72BXhcSE5w 1K3cXCDIbmihavNWtLXjG26vBM1cWCdq0WBHRJVseYcKc6qjVLMyMQGhW3J+bBNOJ2JY tIP816lpz1+MfeT/FavRyClTSLoLYqKSMAAtDKB0tfpC4ZfqxbxoUT6Bt0zoPF6WhHji dVOg== X-Gm-Message-State: AKwxytdTt8XPQu5HAHqd6OLoMG8zmyA9YxvbaHjh0gbdOJHIaUlzJwY/ ZKKsuIb9HCkUBDKkW19pYTIU+8cK X-Google-Smtp-Source: ACJfBosB9U67hjzUpy+NikfAg4e7WJAeHj0XwBKW7r8KTs/q5n4/AQfarzR08eVp0gTroh4etllqxw== X-Received: by 10.36.144.198 with SMTP id x189mr8786638itd.94.1515871392669; Sat, 13 Jan 2018 11:23:12 -0800 (PST) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com. [209.85.223.178]) by smtp.gmail.com with ESMTPSA id e22sm1010513ioj.79.2018.01.13.11.23.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 11:23:12 -0800 (PST) Received: by mail-io0-f178.google.com with SMTP id f89so1219405ioj.4; Sat, 13 Jan 2018 11:23:12 -0800 (PST) X-Received: by 10.107.53.223 with SMTP id k92mr30719846ioo.38.1515871392339; Sat, 13 Jan 2018 11:23:12 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.74.80 with HTTP; Sat, 13 Jan 2018 11:23:11 -0800 (PST) In-Reply-To: <201801131809.w0DI9AZw072646@repo.freebsd.org> References: <201801131809.w0DI9AZw072646@repo.freebsd.org> From: Conrad Meyer Date: Sat, 13 Jan 2018 11:23:11 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:23:19 -0000 On Sat, Jan 13, 2018 at 10:09 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jan 13 18:09:09 2018 > New Revision: 327934 > URL: https://svnweb.freebsd.org/changeset/base/327934 > > Log: > zstd: Use memalloc(9) for calloc macro. > > This is in contrib code but since we only have memalloc(9) in current we > will not upstream this. Fortunately, zstd_kfreebsd.h is not contrib code but local code. We don't have to worry about upstreaming this change. Please consider including review from Allan Jude, Warner, or myself on future zstd changes. We've tried to be very careful not to modify contrib code. For the record, though, I approve this change. Best, Conrad > Modified: > head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h From owner-svn-src-all@freebsd.org Sat Jan 13 19:24:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96E19E7B15F; Sat, 13 Jan 2018 19:24:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 639D973B48; Sat, 13 Jan 2018 19:24:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f51.google.com with SMTP id q8so1202909itb.2; Sat, 13 Jan 2018 11:24:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Iqgup9bJOMHioc9XQFBwna1j7Hy0+eX3mkVHM+0hWd0=; b=gxcG4wo5tVKgHOVDRKrY8RoSRZXljJ0D9DC9HKlR87R/e6up77ifKoZtf+mlTaI5os E5iWn6TLUfi88lzF+y+D3c0vggDW0TMTm2wb5bNR+nq6y5UbCuu+ebfdtvPN4NKg92vY 5nqvnIi8XRsot3lLEXWaKqFEr+mbnxMrta+o0WMJjdqkS94ctDky4weuPRrADHGx1zD6 5rhgAvLegnzo2pJaO9UMd44rL0TgGTYYmVZLGv51Hk271/fKyvydDJwxVul4Vt8LHwpt U7jbLhv7HNckueePyWoeqWnVPUkD8xouz4DkFc7wbTzsy0LFIYyAPz7UZdF3SCWm6Xsa SfwQ== X-Gm-Message-State: AKwxytei+uePzVVdo/UpjkyYnVu+LLBGyX1YxWVNdN+jaIXuy/8hiqth eL+iiM8KV2RmeDvZ6fFmmkBX9D0+ X-Google-Smtp-Source: ACJfBotx6XXf1vJNla/IL8S1CRPTWH/nKuPWIAp65IoXn4il93UqimMPA0lAx0r2gWcOWSz6XVlt8A== X-Received: by 10.36.1.66 with SMTP id 63mr9295502itk.104.1515871458642; Sat, 13 Jan 2018 11:24:18 -0800 (PST) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id q2sm3440710ite.17.2018.01.13.11.24.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 11:24:18 -0800 (PST) Received: by mail-it0-f43.google.com with SMTP id q8so1202897itb.2; Sat, 13 Jan 2018 11:24:18 -0800 (PST) X-Received: by 10.36.114.193 with SMTP id x184mr8897496itc.71.1515871458231; Sat, 13 Jan 2018 11:24:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.74.80 with HTTP; Sat, 13 Jan 2018 11:24:17 -0800 (PST) In-Reply-To: <201801131902.w0DJ2p5m097642@repo.freebsd.org> References: <201801131902.w0DJ2p5m097642@repo.freebsd.org> From: Conrad Meyer Date: Sat, 13 Jan 2018 11:24:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:24:20 -0000 This is not in contrib code -- https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html . On Sat, Jan 13, 2018 at 11:02 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jan 13 19:02:51 2018 > New Revision: 327940 > URL: https://svnweb.freebsd.org/changeset/base/327940 > > Log: > zstd: Use mallocarray(9) for calloc macro. > > This is in contrib code but since we only have mallocarray(9) in current > we will not upstream this. > > This effectively brings back r327934, which was reverted to correct the > log message. > > Modified: > head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > > Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > ============================================================================== > --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:08 2018 (r327939) > +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:51 2018 (r327940) > @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); > #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) > #define free(x) (free)((x), M_ZSTD) > /* in zstd's use of calloc, a is always 1 */ > -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) > +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) > #endif > > #ifdef __cplusplus > From owner-svn-src-all@freebsd.org Sat Jan 13 19:54:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA54E7C89F for ; Sat, 13 Jan 2018 19:54:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-37.consmr.mail.gq1.yahoo.com (sonic303-37.consmr.mail.gq1.yahoo.com [98.137.64.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A573A74A94 for ; Sat, 13 Jan 2018 19:54:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515873261; bh=Rbn9NZx+TOdpHW12SF7c+slwQghMF9MYUPNyp9mPNck=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=I500I6IABq/Nm79FZ0gqBVNddfzcIdcIyfLe749nuVki2+Lznicdx8TcUq0TG1rYkH9mbMSEIDngV/hAOXqhcU3aqcpVbhumr+vkDK3brrqTUI3mIaJaJV5fm+QmwRLKxM2QAOTehWv6tOvsEjUQpCx70Jmih3j/ZVs60IK1n92La8+V25K1ek8uHKKgxKtEIB7iA8PEfypTGB0WlXu8gNYElCZzqHJLQbjpdYGUZ5QKy4nCco5Xbiw/4NCSoP5bhFwQX4vhrogYjrgsSd1j1qEHq3mujApeeqsEmTTfR2Cb5Z2xBzafIRRF/35eda91CSwbfJORiIltCJembW2J8w== X-YMail-OSG: aWu9jm0VM1nPa1rfrUc0XpJWBu6AqUc0agvVK_rCejBRD2r1teMWwA0tL_q9LkJ T7tOH4a._C7A71OhV5yrmOpiRrqwqjnx4TB38xPkErI7bLDzVkc1AZFzNGZTmTXtCOz0y1oegDK5 w_9.nrIECHbj8WNjrMKv8j7Tk8Ho95dkh6.WCofcs54wLwR2IwAhduwdDe9oPibZ4AglCos3QHBS WNxnQI047BCNuQyiKQhLMrh1lGofbNc.sigMY5sWVcox2JFTG4LKldfmlUpuyCLY0A33zwGx.9pR 2nwaqzGNa09ovkRAnRCvmZsNZbHZL2BaoNWB.T03mMQCnzXh4lWGR9vyxaRJm9wdOURhk1l1N5Fz kjHbcgoereJ5T.DwHSyFGPkDzpFxJdevnQ9Nn4jfzHSiqkhJrEz1fTz1oD8yyNRHCBPoG_yzaKtU UPUEWUvSSnYnnY_gmej9855zFTgwcKB21c41YeBjgajSmuLdVMM80BsPWE_n1LALAs2k4YjwrhA- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 19:54:21 +0000 Received: from smtp108.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([216.39.57.224]) by smtp408.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 36f354086b769ddf992a87b591bd6e8e; Sat, 13 Jan 2018 19:54:19 +0000 (UTC) Subject: Re: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131902.w0DJ2p5m097642@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sat, 13 Jan 2018 14:54:19 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:54:27 -0000 Hmm ... On 01/13/18 14:24, Conrad Meyer wrote: > This is not in contrib code -- > https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html > . Thanks, I read it late... Shouldn't the local code be in usr.bin/zstd ? Pedro. > > On Sat, Jan 13, 2018 at 11:02 AM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sat Jan 13 19:02:51 2018 >> New Revision: 327940 >> URL: https://svnweb.freebsd.org/changeset/base/327940 >> >> Log: >> zstd: Use mallocarray(9) for calloc macro. >> >> This is in contrib code but since we only have mallocarray(9) in current >> we will not upstream this. >> >> This effectively brings back r327934, which was reverted to correct the >> log message. >> >> Modified: >> head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >> >> Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h >> ============================================================================== >> --- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:08 2018 (r327939) >> +++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h Sat Jan 13 19:02:51 2018 (r327940) >> @@ -46,7 +46,7 @@ MALLOC_DECLARE(M_ZSTD); >> #define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) >> #define free(x) (free)((x), M_ZSTD) >> /* in zstd's use of calloc, a is always 1 */ >> -#define calloc(a,b) (malloc)((a)*(b), M_ZSTD, M_WAITOK | M_ZERO) >> +#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) >> #endif >> >> #ifdef __cplusplus >> From owner-svn-src-all@freebsd.org Sat Jan 13 19:58:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07868E7CAFD; Sat, 13 Jan 2018 19:58:15 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB1274C80; Sat, 13 Jan 2018 19:58:14 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 2CEE213771; Sat, 13 Jan 2018 19:58:07 +0000 (UTC) Subject: Re: svn commit: r327934 - head/sys/contrib/zstd/lib/freebsd To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131809.w0DI9AZw072646@repo.freebsd.org> From: Allan Jude Message-ID: <63f8d491-edef-5b92-8b4c-04f64c15c847@freebsd.org> Date: Sat, 13 Jan 2018 14:58:06 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:58:15 -0000 On 2018-01-13 14:23, Conrad Meyer wrote: > On Sat, Jan 13, 2018 at 10:09 AM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Sat Jan 13 18:09:09 2018 >> New Revision: 327934 >> URL: https://svnweb.freebsd.org/changeset/base/327934 >> >> Log: >> zstd: Use memalloc(9) for calloc macro. >> >> This is in contrib code but since we only have memalloc(9) in current we >> will not upstream this. > > Fortunately, zstd_kfreebsd.h is not contrib code but local code. We > don't have to worry about upstreaming this change. Please consider > including review from Allan Jude, Warner, or myself on future zstd > changes. We've tried to be very careful not to modify contrib code. > > For the record, though, I approve this change. > > Best, > Conrad > >> Modified: >> head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h > Looks good to me too -- Allan Jude From owner-svn-src-all@freebsd.org Sat Jan 13 19:58:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DADC6E7CBE4; Sat, 13 Jan 2018 19:58:56 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6EF574DF1; Sat, 13 Jan 2018 19:58:56 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9D6B713777; Sat, 13 Jan 2018 19:58:55 +0000 (UTC) Subject: Re: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd To: Pedro Giffuni , cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131902.w0DJ2p5m097642@repo.freebsd.org> From: Allan Jude Message-ID: Date: Sat, 13 Jan 2018 14:58:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:58:57 -0000 On 2018-01-13 14:54, Pedro Giffuni wrote: > Hmm ... > > > On 01/13/18 14:24, Conrad Meyer wrote: >> This is not in contrib code -- >> https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html >> . > > Thanks, I read it late... > > Shouldn't the local code be in usr.bin/zstd ? > > Pedro. > This .h file is only used for the kernel version of zstd, not the userland version. -- Allan Jude From owner-svn-src-all@freebsd.org Sat Jan 13 19:59:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D1CE7CCA7; Sat, 13 Jan 2018 19:59:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 882FA74F40; Sat, 13 Jan 2018 19:59:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id c17so9344610iod.1; Sat, 13 Jan 2018 11:59:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=TfSx/SNfCrfC+PFVDHqWDV696oXuVu/Tdll2aTerVlY=; b=gL64YJhlRguXVVc3/rLecJUw8q/Jv5Gz4/FSXRkBrikSN/b4Zr6P8S7v3XUmD6R3I3 ZI835CrO7RROEpx/JRcScslr9AynLqYqdRMiqIZE7x4Arh1A5fTM7MjfDMETzTmyprpp kvipzODquWTkCzaQ5R90fZPi7Yp8uh8w5zbwAfM1U2y6GtM2peW5leMPNt2AY3GMOYhS 8IaofhX5+nm/lo9MaHSO7YZmi7zhFGoDvu/vg00XJjEfp+dfyski28Ho0g83/pXWzho7 ayi0gmGtAJryYD5Rzhs6NIBdCAU65E459tcs0wQXJVxIXIjRndv80c6usS/olTw25N/E weEQ== X-Gm-Message-State: AKwxytf3O/nkNg1Gk0QBzRbMxTbuKBVjR75snCpYE7DidCR95elcxeaA SmKxfi9s32GTF5dS7RbwV+G6FmnU X-Google-Smtp-Source: ACJfBotBrsPPz8yk7+Igt/DQ9oIHPhEz++z1WH1kpN99+e2Gq8g3MSiMa8lxGjqrBf5DHWXFy2KFTA== X-Received: by 10.107.205.203 with SMTP id d194mr27705731iog.42.1515873568269; Sat, 13 Jan 2018 11:59:28 -0800 (PST) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id f202sm3460117itc.40.2018.01.13.11.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jan 2018 11:59:28 -0800 (PST) Received: by mail-it0-f48.google.com with SMTP id q8so1255071itb.2; Sat, 13 Jan 2018 11:59:28 -0800 (PST) X-Received: by 10.36.249.67 with SMTP id l64mr9111687ith.119.1515873568031; Sat, 13 Jan 2018 11:59:28 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.74.80 with HTTP; Sat, 13 Jan 2018 11:59:27 -0800 (PST) In-Reply-To: References: <201801131902.w0DJ2p5m097642@repo.freebsd.org> From: Conrad Meyer Date: Sat, 13 Jan 2018 11:59:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd To: Pedro Giffuni Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 19:59:29 -0000 On Sat, Jan 13, 2018 at 11:54 AM, Pedro Giffuni wrote: > On 01/13/18 14:24, Conrad Meyer wrote: > > This is not in contrib code -- > https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html > . > Thanks, I read it late... > > Shouldn't the local code be in usr.bin/zstd ? No =E2=80=94 this code ports zstd to the kernel. It would not make sense i= n usr.bin. Conrad From owner-svn-src-all@freebsd.org Sat Jan 13 20:06:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3D6E7D360 for ; Sat, 13 Jan 2018 20:06:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic315-23.consmr.mail.gq1.yahoo.com (sonic315-23.consmr.mail.gq1.yahoo.com [98.137.65.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A42C2755E4 for ; Sat, 13 Jan 2018 20:06:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515873978; bh=8GtiqrVZjKyskH9EavZFIVGSuFXWoPoH1E3aY/JgTkQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=qMHmTj9K7RA9Apz0gCc9ewQ9OOlSMQdmS3/JNDehn4XSBk0hwAVvgdKECkX1Z3SJwRxKBh115D77Y7D0HdEkHVwCI9wVZpSHu5JZrTmjjQUwVOLONo8sFisuOMim7GjqRNkMe1CzMD/jExlWRSrHSZ+86d02epFNGfLf1busG4OtKnBDTcC9tsZdRWtvhQNz1hqN/Ck9RomAqoMSgxKhGHncwQieNEaaeVuXIP4H8vMX3b9aYaIZY6UEwNBjBEEllZr05Vh0fmN/CU1Q3LbpRqvbY6zc1sy9uQLLfw1vPZSS+B1BpPfhrhK7MBuB3qFpV44U2+D9pDGs0NLo8+BvkQ== X-YMail-OSG: ZzAfhXAVM1lIJDoWIwk2HiHomvzzu2Y6Jnb1aD4cPnP5UGGretgd7P7q1dzPffX imGXKd27mf0OIsnqTv8zUBLX62HdtjQ4VWPu36hNcegWDURjad14lZXnbqPndL0bWZtqyU_DaW4f 3Qq71dPIVFrWj6OXGLBpfSiyDDK3pGYBdg_qk_9WoxeSBMYFmJ2Z43.f9o8XmpksdpslNxvslkBj LBrLBuroPDntP_SsnDu28iK1f8W9tjJoemAcdYd22n2AFvki3A11aSNL.GNxLSW.t71FZwspvvZv YrYgCTVrgqmQ7AiVvlFVlqUv6SbCEMFUgcwtAaQhR_cHz0FkQHl8hcFJdK2eO9xYfauUbk6IKPf8 Pur2P545Kl2Q5wHNdVAn701kPAuZASmQI8fpekdEMqHhrWwH2phEX9h0W8cTgvALFMLU72FViyRE Rvp8ISy1pBN1z.BDG5Xbk_kJzP6kNxKu8R9VWwQxNz1zlNIWDLCsDCw2XXFz768DRoIasLdLK Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Jan 2018 20:06:18 +0000 Received: from smtp105.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.8]) ([68.180.227.8]) by smtp411.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 76389664bd9a2b15e2c1394267129846; Sat, 13 Jan 2018 20:06:13 +0000 (UTC) Subject: Re: svn commit: r327940 - head/sys/contrib/zstd/lib/freebsd To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801131902.w0DJ2p5m097642@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <8b3461ef-0d7d-fc61-5f27-0639301683dd@FreeBSD.org> Date: Sat, 13 Jan 2018 15:06:12 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 20:06:24 -0000 On 13/01/2018 14:59, Conrad Meyer wrote: > On Sat, Jan 13, 2018 at 11:54 AM, Pedro Giffuni wrote: >> On 01/13/18 14:24, Conrad Meyer wrote: >> >> This is not in contrib code -- >> https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html >> . >> Thanks, I read it late... >> >> Shouldn't the local code be in usr.bin/zstd ? > No — this code ports zstd to the kernel. It would not make sense in usr.bin. Bah, yes, it should be somewhere else under sys but then if you use it for ZFS and somewhere else, it's not clear where it should go .. nevermind. I was just backtracing. Please add yourself to the MAINTAINERS file if you want pre-commit reviews. Pedro. From owner-svn-src-all@freebsd.org Sat Jan 13 20:35:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC52E7EA17; Sat, 13 Jan 2018 20:35:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C652766AA; Sat, 13 Jan 2018 20:35:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EB4C17DDF; Sat, 13 Jan 2018 20:35:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DKZXkd035081; Sat, 13 Jan 2018 20:35:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DKZX8k035079; Sat, 13 Jan 2018 20:35:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801132035.w0DKZX8k035079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 13 Jan 2018 20:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327941 - head/usr.sbin/timed/timed X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.sbin/timed/timed X-SVN-Commit-Revision: 327941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 20:35:34 -0000 Author: eadler Date: Sat Jan 13 20:35:32 2018 New Revision: 327941 URL: https://svnweb.freebsd.org/changeset/base/327941 Log: timed: slave is an infinite loop, mark it as such Modified: head/usr.sbin/timed/timed/extern.h head/usr.sbin/timed/timed/slave.c Modified: head/usr.sbin/timed/timed/extern.h ============================================================================== --- head/usr.sbin/timed/timed/extern.h Sat Jan 13 19:02:51 2018 (r327940) +++ head/usr.sbin/timed/timed/extern.h Sat Jan 13 20:35:32 2018 (r327941) @@ -77,7 +77,7 @@ void print(struct tsp *, struct sockaddr_in *); void prthp(clock_t); void rmnetmachs(struct netinfo *); void setstatus(void); -int slave(void); +void slave(void) __dead2; void slaveack(void); void spreadtime(void); void suppress(struct sockaddr_in *, char *, struct netinfo *); Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat Jan 13 19:02:51 2018 (r327940) +++ head/usr.sbin/timed/timed/slave.c Sat Jan 13 20:35:32 2018 (r327941) @@ -56,7 +56,7 @@ static void schgdate(struct tsp *, char *); static void setmaster(struct tsp *); static void answerdelay(void); -int +void slave(void) { int tries; From owner-svn-src-all@freebsd.org Sat Jan 13 21:08:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D930DEA4312; Sat, 13 Jan 2018 21:08:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B442F77926; Sat, 13 Jan 2018 21:08:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECCDC182EC; Sat, 13 Jan 2018 21:08:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DL8cSH047937; Sat, 13 Jan 2018 21:08:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DL8cwH047935; Sat, 13 Jan 2018 21:08:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801132108.w0DL8cwH047935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 21:08:38 +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: r327942 - stable/11/sys/boot/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot/fdt X-SVN-Commit-Revision: 327942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:08:40 -0000 Author: kevans Date: Sat Jan 13 21:08:38 2018 New Revision: 327942 URL: https://svnweb.freebsd.org/changeset/base/327942 Log: MFC (conceptually) r327298, r327299: Fix overlay application behavior This is a direct commit to stable/11 due to restructuring of sys/boot => stand in -HEAD. The diff remains the same and it simply applied to the previous location. MFC r327298: stand/fdt: Fix loading of multiple fdt_overlays fdt_load_dtb_overlays was written to unload previous overlay when a new valid one is come across. fdt_apply_overlays further down is written to iterate over all .dtbo's currently loaded and apply them one-by-one. Correct fdt_load_dtb_overlays to stop dropping valid overlays that were previously loaded and match expectations. MFC r327299: stand/fdt: Avoid bailout when dtbo has no fixups In the case of a simple dtbo where fragment uses target-path and the overlay contains no references, /__fixups__ will not be included by either our dtc or dtc from ports, but the file still has valid fragments to be applied. Additional testing found that /__symbols__ might also be omitted if it's empty, which is not necessarily an error. Modified: stable/11/sys/boot/fdt/fdt_loader_cmd.c stable/11/sys/boot/fdt/fdt_overlay.c Modified: stable/11/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/11/sys/boot/fdt/fdt_loader_cmd.c Sat Jan 13 20:35:32 2018 (r327941) +++ stable/11/sys/boot/fdt/fdt_loader_cmd.c Sat Jan 13 21:08:38 2018 (r327942) @@ -280,14 +280,12 @@ fdt_load_dtb_file(const char * filename) static int fdt_load_dtb_overlay(const char * filename) { - struct preloaded_file *bfp, *oldbfp; + struct preloaded_file *bfp; struct fdt_header header; int err; debugf("fdt_load_dtb_overlay(%s)\n", filename); - oldbfp = file_findfile(filename, "dtbo"); - /* Attempt to load and validate a new dtb from a file. */ if ((bfp = file_loadraw(filename, "dtbo", 1)) == NULL) { printf("failed to load file '%s'\n", filename); @@ -308,10 +306,6 @@ fdt_load_dtb_overlay(const char * filename) fdt_strerror(err)); return (1); } - - /* A new dtb was validated, discard any previous file. */ - if (oldbfp) - file_discard(oldbfp); return (0); } Modified: stable/11/sys/boot/fdt/fdt_overlay.c ============================================================================== --- stable/11/sys/boot/fdt/fdt_overlay.c Sat Jan 13 20:35:32 2018 (r327941) +++ stable/11/sys/boot/fdt/fdt_overlay.c Sat Jan 13 21:08:38 2018 (r327942) @@ -324,10 +324,16 @@ fdt_overlay_do_fixups(void *main_fdtp, void *overlay_f main_symbols_o = fdt_path_offset(main_fdtp, "/__symbols__"); overlay_fixups_o = fdt_path_offset(overlay_fdtp, "/__fixups__"); - if (main_symbols_o < 0) + if (main_symbols_o < 0) { + if (main_symbols_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); - if (overlay_fixups_o < 0) + } + if (overlay_fixups_o < 0) { + if (overlay_fixups_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); + } for (fixup_prop_o = fdt_first_property_offset(overlay_fdtp, overlay_fixups_o); fixup_prop_o >= 0; From owner-svn-src-all@freebsd.org Sat Jan 13 21:10:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85840EA4657; Sat, 13 Jan 2018 21:10:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6004677C41; Sat, 13 Jan 2018 21:10:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD46182F8; Sat, 13 Jan 2018 21:10:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLAgqY048066; Sat, 13 Jan 2018 21:10:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLAgKt048065; Sat, 13 Jan 2018 21:10:42 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801132110.w0DLAgKt048065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 13 Jan 2018 21:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327943 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 327943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:10:43 -0000 Author: jhibbits Date: Sat Jan 13 21:10:42 2018 New Revision: 327943 URL: https://svnweb.freebsd.org/changeset/base/327943 Log: Include only the headers needed The extra headers came through evolution of the file. Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 21:08:38 2018 (r327942) +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sat Jan 13 21:10:42 2018 (r327943) @@ -32,21 +32,12 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include #include -#include -#include -#include -#include #include -#include -#include -#include #include #include From owner-svn-src-all@freebsd.org Sat Jan 13 21:19:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B454EA4E8B; Sat, 13 Jan 2018 21:19:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1535E7824A; Sat, 13 Jan 2018 21:19:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5306218486; Sat, 13 Jan 2018 21:19:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLJumt052361; Sat, 13 Jan 2018 21:19:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLJu9T052359; Sat, 13 Jan 2018 21:19:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801132119.w0DLJu9T052359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 21:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r327944 - in stable/11/sys/boot: efi/fdt uboot/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: efi/fdt uboot/fdt X-SVN-Commit-Revision: 327944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:19:57 -0000 Author: kevans Date: Sat Jan 13 21:19:55 2018 New Revision: 327944 URL: https://svnweb.freebsd.org/changeset/base/327944 Log: MFC (conceptually) r327350: Consistently apply fdt_overlays This is a direct commit to stable/11 due to restructuring of sys/boot => stand in -HEAD. The diff remains the same and it is simply applied to the previous location. MFC r327350: stand/fdt: Consistently apply fdt_overlays Overlays were previously not applied when U-Boot provides FDT or EFI provides FDT, only when we load FDT from /boot/dtb given name from U-Boot. Make all three paths lead to loading fdt_overlays and applying them, so that fdt_overlays can be expected to Just Work. Modified: stable/11/sys/boot/efi/fdt/efi_fdt.c stable/11/sys/boot/uboot/fdt/uboot_fdt.c Modified: stable/11/sys/boot/efi/fdt/efi_fdt.c ============================================================================== --- stable/11/sys/boot/efi/fdt/efi_fdt.c Sat Jan 13 21:10:42 2018 (r327943) +++ stable/11/sys/boot/efi/fdt/efi_fdt.c Sat Jan 13 21:19:55 2018 (r327944) @@ -44,19 +44,27 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; + const char *s; hdr = efi_get_table(&fdtdtb); - if (hdr != NULL) { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by EFI at %p.\n", hdr); - return (0); - } + if (hdr == NULL) + return (1); + if (fdt_load_dtb_addr(hdr) != 0) + return (1); + printf("Using DTB provided by EFI at %p.\n", hdr); + + s = getenv("fdt_overlays"); + if (s != NULL && *s != '\0') { + printf("Loading DTB overlays: '%s'\n", s); + fdt_load_dtb_overlays(s); } - return (1); + return (0); } void fdt_platform_fixups(void) { + + fdt_apply_overlays(); } Modified: stable/11/sys/boot/uboot/fdt/uboot_fdt.c ============================================================================== --- stable/11/sys/boot/uboot/fdt/uboot_fdt.c Sat Jan 13 21:10:42 2018 (r327943) +++ stable/11/sys/boot/uboot/fdt/uboot_fdt.c Sat Jan 13 21:19:55 2018 (r327944) @@ -64,7 +64,8 @@ fdt_platform_load_dtb(void) if (fdt_load_dtb_addr(hdr) == 0) { printf("Using DTB provided by U-Boot at " "address %p.\n", hdr); - return (0); + rv = 0; + goto exit; } } } @@ -83,9 +84,11 @@ fdt_platform_load_dtb(void) if (fdt_load_dtb_file(s) == 0) { printf("Loaded DTB from file '%s'.\n", s); rv = 0; + goto exit; } } +exit: if (rv == 0) { s = getenv("fdt_overlays"); if (s == NULL) From owner-svn-src-all@freebsd.org Sat Jan 13 21:27:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8537AEA547B; Sat, 13 Jan 2018 21:27:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 600FD78700; Sat, 13 Jan 2018 21:27:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 989751862E; Sat, 13 Jan 2018 21:27:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLRaeO056676; Sat, 13 Jan 2018 21:27:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLRaex056673; Sat, 13 Jan 2018 21:27:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201801132127.w0DLRaex056673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 13 Jan 2018 21:27:36 +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: r327945 - stable/11/sys/boot/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot/fdt X-SVN-Commit-Revision: 327945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:27:37 -0000 Author: kevans Date: Sat Jan 13 21:27:36 2018 New Revision: 327945 URL: https://svnweb.freebsd.org/changeset/base/327945 Log: MFC (conceptually) r327376, r327416: Improve libfdt compatibility This is a direct commit to stable/11 due to restructuring of sys/boot => stand in -HEAD. The diff remains the same and it is simply applied to the previous location. MFC r327376: stand/fdt: Swap libfdt include order libfdt.h should be included before fdt.h, as hinted at by all of libfdt/; standard include order being libfdt.h, libfdt_env.h, fdt.h. The current include order also causes problems when libfdt gets updated, as fdt.h requires some definitions from libfdt.h. MFC r327416: stand/fdt: Make fdt_overlay_apply signature-compatible with libfdt libfdt will assume a writable fdt overlay blob has been passed in, so make ours compatible to allow easier review when we try to drop libfdt into place. overlay from the calling context is writable, making it safe to simply rip out everything related to copying the overlay blob in fdt_overlay_apply. I note here that we still have problems: fdt_overlay_apply, both our version and libfdt's, may fail and have already clobbered the base fdt to some extent. Future work will make sure we don't apply a potentially bogus fdt, instead discarding the base fdt if we had an error. Modified: stable/11/sys/boot/fdt/fdt_loader_cmd.c stable/11/sys/boot/fdt/fdt_overlay.c stable/11/sys/boot/fdt/fdt_overlay.h Modified: stable/11/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/11/sys/boot/fdt/fdt_loader_cmd.c Sat Jan 13 21:19:55 2018 (r327944) +++ stable/11/sys/boot/fdt/fdt_loader_cmd.c Sat Jan 13 21:27:36 2018 (r327945) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include #include @@ -385,7 +385,8 @@ fdt_apply_overlays() for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { printf("applying DTB overlay '%s'\n", fp->f_name); COPYOUT(fp->f_addr, overlay, fp->f_size); - fdt_overlay_apply(new_fdtp, overlay, fp->f_size); + /* Both overlay and new_fdtp may be modified in place */ + fdt_overlay_apply(new_fdtp, overlay); } free(fdtp); Modified: stable/11/sys/boot/fdt/fdt_overlay.c ============================================================================== --- stable/11/sys/boot/fdt/fdt_overlay.c Sat Jan 13 21:19:55 2018 (r327944) +++ stable/11/sys/boot/fdt/fdt_overlay.c Sat Jan 13 21:27:36 2018 (r327945) @@ -409,41 +409,23 @@ fdt_overlay_apply_fragments(void *main_fdtp, void *ove } int -fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp, size_t overlay_length) +fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp) { - void *overlay_copy; - int rv; - rv = 0; - - /* We modify overlay in-place, so we need writable copy */ - overlay_copy = malloc(overlay_length); - if (overlay_copy == NULL) { - printf("failed to allocate memory for overlay copy\n"); + if (fdt_overlay_do_fixups(main_fdtp, overlay_fdtp) < 0) { + printf("failed to perform fixups in overlay\n"); return (-1); } - memcpy(overlay_copy, overlay_fdtp, overlay_length); - - if (fdt_overlay_do_fixups(main_fdtp, overlay_copy) < 0) { - printf("failed to perform fixups in overlay\n"); - rv = -1; - goto out; - } - - if (fdt_overlay_do_local_fixups(main_fdtp, overlay_copy) < 0) { + if (fdt_overlay_do_local_fixups(main_fdtp, overlay_fdtp) < 0) { printf("failed to perform local fixups in overlay\n"); - rv = -1; - goto out; + return (-1); } - if (fdt_overlay_apply_fragments(main_fdtp, overlay_copy) < 0) { + if (fdt_overlay_apply_fragments(main_fdtp, overlay_fdtp) < 0) { printf("failed to apply fragments\n"); - rv = -1; + return (-1); } -out: - free(overlay_copy); - - return (rv); + return (0); } Modified: stable/11/sys/boot/fdt/fdt_overlay.h ============================================================================== --- stable/11/sys/boot/fdt/fdt_overlay.h Sat Jan 13 21:19:55 2018 (r327944) +++ stable/11/sys/boot/fdt/fdt_overlay.h Sat Jan 13 21:27:36 2018 (r327945) @@ -29,6 +29,6 @@ #ifndef FDT_OVERLAY_H #define FDT_OVERLAY_H -int fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp, size_t overlay_length); +int fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp); #endif /* FDT_OVERLAY_H */ From owner-svn-src-all@freebsd.org Sat Jan 13 21:36:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 125DAEA5D6A; Sat, 13 Jan 2018 21:36:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1E7378DFD; Sat, 13 Jan 2018 21:36:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D38F187E4; Sat, 13 Jan 2018 21:36:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLae7r060834; Sat, 13 Jan 2018 21:36:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLaeDi060833; Sat, 13 Jan 2018 21:36:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801132136.w0DLaeDi060833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 13 Jan 2018 21:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327946 - head/usr.bin/limits X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/limits X-SVN-Commit-Revision: 327946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:36:41 -0000 Author: eadler Date: Sat Jan 13 21:36:39 2018 New Revision: 327946 URL: https://svnweb.freebsd.org/changeset/base/327946 Log: limits(1): fix grammar Submitted by: yuri PR: 225147 MFC After: 1 week Modified: head/usr.bin/limits/limits.1 Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Sat Jan 13 21:27:36 2018 (r327945) +++ head/usr.bin/limits/limits.1 Sat Jan 13 21:36:39 2018 (r327946) @@ -82,7 +82,7 @@ login capabilities database. .It Nm Fl e Op Ar limitflags This usage determines values of resource settings according to .Ar limitflags , -but does not set them itself. +but does not set them. Like the previous usage, it outputs these values to standard output, except that it will emit them in .Ic eval @@ -180,7 +180,7 @@ options. Select .Dq "eval mode" formatting for output. -This is valid only on display mode and cannot be used when running a +This is valid only in display mode and cannot be used when running a command. The exact syntax used for output depends upon the type of shell from which From owner-svn-src-all@freebsd.org Sat Jan 13 21:37:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CDAEA5E52; Sat, 13 Jan 2018 21:37:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB9778F80; Sat, 13 Jan 2018 21:37:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F829187E6; Sat, 13 Jan 2018 21:37:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLbFZU060909; Sat, 13 Jan 2018 21:37:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLbF24060908; Sat, 13 Jan 2018 21:37:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201801132137.w0DLbF24060908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 13 Jan 2018 21:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327947 - head/usr.bin/limits X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/limits X-SVN-Commit-Revision: 327947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:37:16 -0000 Author: eadler Date: Sat Jan 13 21:37:14 2018 New Revision: 327947 URL: https://svnweb.freebsd.org/changeset/base/327947 Log: limits(1): also bump .Dd... PR: 225147 MFC After: 1 week Modified: head/usr.bin/limits/limits.1 Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Sat Jan 13 21:36:39 2018 (r327946) +++ head/usr.bin/limits/limits.1 Sat Jan 13 21:37:14 2018 (r327947) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2013 +.Dd January 13, 2018 .Dt LIMITS 1 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Jan 13 21:39:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B83EA60BB; Sat, 13 Jan 2018 21:39:47 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7686C7911F; Sat, 13 Jan 2018 21:39:47 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF324187E8; Sat, 13 Jan 2018 21:39:46 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DLdkcs061041; Sat, 13 Jan 2018 21:39:46 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DLdk9K061040; Sat, 13 Jan 2018 21:39:46 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201801132139.w0DLdk9K061040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 13 Jan 2018 21:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327948 - head/sys/dev/virtio/console X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/sys/dev/virtio/console X-SVN-Commit-Revision: 327948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 21:39:47 -0000 Author: bryanv Date: Sat Jan 13 21:39:46 2018 New Revision: 327948 URL: https://svnweb.freebsd.org/changeset/base/327948 Log: Fix possible panic when creating VirtIO console dev aliases Since we have no control over the name, the MAKEDEV_CHECKNAME flag must be used to return an error on an invalid (to devfs) name instead of panicing. r305900 that originally added this feature also introduced a few other bugs: - Proper locking not performed - Theoretically broke the expectation that the control event buffer would not span more than one pages, but did not update the CTASSERT that was in place to prevent this. However, since the struct virtio_console_control and the bulk buffer together were quite small, this could not have happened. Also workaround an QEMU VirtIO spec violation in that it includes the NUL terminator in the buffer length when the spec says it is not included. PR: 223531 MFC after: 1 week Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Sat Jan 13 21:37:14 2018 (r327947) +++ head/sys/dev/virtio/console/virtio_console.c Sat Jan 13 21:39:46 2018 (r327948) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -58,14 +59,19 @@ __FBSDID("$FreeBSD$"); #define VTCON_MAX_PORTS 32 #define VTCON_TTY_PREFIX "V" +#define VTCON_TTY_ALIAS_PREFIX "vtcon" #define VTCON_BULK_BUFSZ 128 +#define VTCON_CTRL_BUFSZ 128 /* - * The buffer cannot cross more than one page boundary due to the + * The buffers cannot cross more than one page boundary due to the * size of the sglist segment array used. */ CTASSERT(VTCON_BULK_BUFSZ <= PAGE_SIZE); +CTASSERT(VTCON_CTRL_BUFSZ <= PAGE_SIZE); +CTASSERT(sizeof(struct virtio_console_config) <= VTCON_CTRL_BUFSZ); + struct vtcon_softc; struct vtcon_softc_port; @@ -80,6 +86,7 @@ struct vtcon_port { int vtcport_flags; #define VTCON_PORT_FLAG_GONE 0x01 #define VTCON_PORT_FLAG_CONSOLE 0x02 +#define VTCON_PORT_FLAG_ALIAS 0x04 #if defined(KDB) int vtcport_alt_break_state; @@ -193,6 +200,8 @@ static void vtcon_port_requeue_buf(struct vtcon_port static int vtcon_port_populate(struct vtcon_port *); static void vtcon_port_destroy(struct vtcon_port *); static int vtcon_port_create(struct vtcon_softc *, int); +static void vtcon_port_dev_alias(struct vtcon_port *, const char *, + size_t); static void vtcon_port_drain_bufs(struct virtqueue *); static void vtcon_port_drain(struct vtcon_port *); static void vtcon_port_teardown(struct vtcon_port *); @@ -599,8 +608,7 @@ vtcon_ctrl_event_enqueue(struct vtcon_softc *sc, vq = sc->vtcon_ctrl_rxvq; sglist_init(&sg, 2, segs); - error = sglist_append(&sg, control, - sizeof(struct virtio_console_control) + VTCON_BULK_BUFSZ); + error = sglist_append(&sg, control, VTCON_CTRL_BUFSZ); KASSERT(error == 0, ("%s: error %d adding control to sglist", __func__, error)); @@ -613,10 +621,7 @@ vtcon_ctrl_event_create(struct vtcon_softc *sc) struct virtio_console_control *control; int error; - control = malloc( - sizeof(struct virtio_console_control) + VTCON_BULK_BUFSZ, - M_DEVBUF, M_ZERO | M_NOWAIT); - + control = malloc(VTCON_CTRL_BUFSZ, M_DEVBUF, M_ZERO | M_NOWAIT); if (control == NULL) return (ENOMEM); @@ -633,8 +638,7 @@ vtcon_ctrl_event_requeue(struct vtcon_softc *sc, { int error; - bzero(control, sizeof(struct virtio_console_control) + - VTCON_BULK_BUFSZ); + bzero(control, VTCON_CTRL_BUFSZ); error = vtcon_ctrl_event_enqueue(sc, control); KASSERT(error == 0, @@ -811,19 +815,36 @@ vtcon_ctrl_port_name_event(struct vtcon_softc *sc, int dev = sc->vtcon_dev; scport = &sc->vtcon_ports[id]; + /* + * The VirtIO specification says the NUL terminator is not included in + * the length, but QEMU includes it. Adjust the length if needed. + */ + if (name == NULL || len == 0) + return; + if (name[len - 1] == '\0') { + len--; + if (len == 0) + return; + } + + VTCON_LOCK(sc); port = scport->vcsp_port; if (port == NULL) { + VTCON_UNLOCK(sc); device_printf(dev, "%s: name port %d, but does not exist\n", __func__, id); return; } - tty_makealias(port->vtcport_tty, "vtcon/%*s", (int)len, name); + VTCON_PORT_LOCK(port); + VTCON_UNLOCK(sc); + vtcon_port_dev_alias(port, name, len); + VTCON_PORT_UNLOCK(port); } static void vtcon_ctrl_process_event(struct vtcon_softc *sc, - struct virtio_console_control *control, void *payload, size_t plen) + struct virtio_console_control *control, void *data, size_t data_len) { device_t dev; int id; @@ -857,9 +878,7 @@ vtcon_ctrl_process_event(struct vtcon_softc *sc, break; case VIRTIO_CONSOLE_PORT_NAME: - if (payload != NULL && plen > 0) - vtcon_ctrl_port_name_event(sc, id, - (const char *)payload, plen); + vtcon_ctrl_port_name_event(sc, id, (const char *)data, data_len); break; } } @@ -870,10 +889,10 @@ vtcon_ctrl_task_cb(void *xsc, int pending) struct vtcon_softc *sc; struct virtqueue *vq; struct virtio_console_control *control; + void *data; + size_t data_len; int detached; uint32_t len; - size_t plen; - void *payload; sc = xsc; vq = sc->vtcon_ctrl_rxvq; @@ -882,19 +901,19 @@ vtcon_ctrl_task_cb(void *xsc, int pending) while ((detached = (sc->vtcon_flags & VTCON_FLAG_DETACHED)) == 0) { control = virtqueue_dequeue(vq, &len); - payload = NULL; - plen = 0; - if (control == NULL) break; - if (len > sizeof(*control)) { - payload = (void *)(control + 1); - plen = len - sizeof(*control); + if (len > sizeof(struct virtio_console_control)) { + data = (void *) &control[1]; + data_len = len - sizeof(struct virtio_console_control); + } else { + data = NULL; + data_len = 0; } VTCON_UNLOCK(sc); - vtcon_ctrl_process_event(sc, control, payload, plen); + vtcon_ctrl_process_event(sc, control, data, data_len); VTCON_LOCK(sc); vtcon_ctrl_event_requeue(sc, control); } @@ -1130,6 +1149,40 @@ vtcon_port_create(struct vtcon_softc *sc, int id) device_get_unit(dev), id); return (0); +} + +static void +vtcon_port_dev_alias(struct vtcon_port *port, const char *name, size_t len) +{ + struct vtcon_softc *sc; + struct cdev *pdev; + struct tty *tp; + int i, error; + + sc = port->vtcport_sc; + tp = port->vtcport_tty; + + if (port->vtcport_flags & VTCON_PORT_FLAG_ALIAS) + return; + + /* Port name is UTF-8, but we can only handle ASCII. */ + for (i = 0; i < len; i++) { + if (!isascii(name[i])) + return; + } + + /* + * Port name may not conform to the devfs requirements so we cannot use + * tty_makealias() because the MAKEDEV_CHECKNAME flag must be specified. + */ + error = make_dev_alias_p(MAKEDEV_NOWAIT | MAKEDEV_CHECKNAME, &pdev, + tp->t_dev, "%s/%*s", VTCON_TTY_ALIAS_PREFIX, (int)len, name); + if (error) { + device_printf(sc->vtcon_dev, + "%s: cannot make dev alias (%s/%*s) error %d\n", __func__, + VTCON_TTY_ALIAS_PREFIX, (int)len, name, error); + } else + port->vtcport_flags |= VTCON_PORT_FLAG_ALIAS; } static void From owner-svn-src-all@freebsd.org Sat Jan 13 22:30:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9912EB31C1; Sat, 13 Jan 2018 22:30:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C42D7B2D2; Sat, 13 Jan 2018 22:30:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A5F018FD6; Sat, 13 Jan 2018 22:30:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DMUZv8082821; Sat, 13 Jan 2018 22:30:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DMUVmF081985; Sat, 13 Jan 2018 22:30:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801132230.w0DMUVmF081985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 13 Jan 2018 22:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp sound/midi sound/pci/hda s... X-SVN-Commit-Revision: 327949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 22:30:36 -0000 Author: pfg Date: Sat Jan 13 22:30:30 2018 New Revision: 327949 URL: https://svnweb.freebsd.org/changeset/base/327949 Log: dev: make some use of mallocarray(9). Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Modified: head/sys/dev/aacraid/aacraid.c head/sys/dev/advansys/advansys.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/beri/virtio/virtio.c head/sys/dev/bnxt/if_bnxt.c head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_phy_lp.c head/sys/dev/ciss/ciss.c head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/dev/esp/ncr53c9x.c head/sys/dev/fb/splash.c head/sys/dev/gpio/gpiobus.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iwi/if_iwi.c head/sys/dev/kbd/kbd.c head/sys/dev/liquidio/base/lio_request_manager.c head/sys/dev/liquidio/lio_main.c head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_mapping.c head/sys/dev/mps/mps.c head/sys/dev/mps/mps_mapping.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/mrsas/mrsas.c head/sys/dev/mxge/if_mxge.c head/sys/dev/netmap/if_ptnet.c head/sys/dev/nvme/nvme_ns.c head/sys/dev/pst/pst-iop.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/rp/rp.c head/sys/dev/rp/rp_isa.c head/sys/dev/rp/rp_pci.c head/sys/dev/sound/midi/midi.c head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/syscons/fire/fire_saver.c head/sys/dev/virtio/console/virtio_console.c head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vnic/nicvf_queues.c head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/aacraid/aacraid.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1458,7 +1458,7 @@ aac_convert_sgraw2(struct aac_softc *sc, struct aac_ra int i, j, pos; u_int32_t addr_low; - sge = malloc(nseg_new * sizeof(struct aac_sge_ieee1212), + sge = mallocarray(nseg_new, sizeof(struct aac_sge_ieee1212), M_AACRAIDBUF, M_NOWAIT|M_ZERO); if (sge == NULL) return nseg; Modified: head/sys/dev/advansys/advansys.c ============================================================================== --- head/sys/dev/advansys/advansys.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/advansys/advansys.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1255,7 +1255,7 @@ adv_attach(adv) * a transaction and use it for mapping the queue to the * upper level SCSI transaction it represents. */ - adv->ccb_infos = malloc(sizeof(*adv->ccb_infos) * adv->max_openings, + adv->ccb_infos = mallocarray(adv->max_openings, sizeof(*adv->ccb_infos), M_DEVBUF, M_NOWAIT); if (adv->ccb_infos == NULL) Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jan 13 22:30:30 2018 (r327949) @@ -901,9 +901,8 @@ ath_edma_setup_rxfifo(struct ath_softc *sc, HAL_RX_QUE re->m_fifolen); /* Allocate ath_buf FIFO array, pre-zero'ed */ - re->m_fifo = malloc(sizeof(struct ath_buf *) * re->m_fifolen, - M_ATHDEV, - M_NOWAIT | M_ZERO); + re->m_fifo = mallocarray(re->m_fifolen, sizeof(struct ath_buf *), + M_ATHDEV, M_NOWAIT | M_ZERO); if (re->m_fifo == NULL) { device_printf(sc->sc_dev, "%s: malloc failed\n", __func__); Modified: head/sys/dev/beri/virtio/virtio.c ============================================================================== --- head/sys/dev/beri/virtio/virtio.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/beri/virtio/virtio.c Sat Jan 13 22:30:30 2018 (r327949) @@ -250,7 +250,7 @@ getcopy(struct iovec *iov, int n) struct iovec *tiov; int i; - tiov = malloc(n * sizeof(struct iovec), M_DEVBUF, M_NOWAIT); + tiov = mallocarray(n, sizeof(struct iovec), M_DEVBUF, M_NOWAIT); for (i = 0; i < n; i++) { tiov[i].iov_base = iov[i].iov_base; tiov[i].iov_len = iov[i].iov_len; Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/bnxt/if_bnxt.c Sat Jan 13 22:30:30 2018 (r327949) @@ -351,7 +351,7 @@ bnxt_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc = iflib_get_softc(ctx); - softc->tx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * ntxqsets, + softc->tx_cp_rings = mallocarray(ntxqsets, sizeof(struct bnxt_cp_ring), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->tx_cp_rings) { device_printf(iflib_get_dev(ctx), @@ -359,7 +359,7 @@ bnxt_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, rc = ENOMEM; goto cp_alloc_fail; } - softc->tx_rings = malloc(sizeof(struct bnxt_ring) * ntxqsets, + softc->tx_rings = mallocarray(ntxqsets, sizeof(struct bnxt_ring), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->tx_rings) { device_printf(iflib_get_dev(ctx), @@ -446,7 +446,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc = iflib_get_softc(ctx); - softc->rx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * nrxqsets, + softc->rx_cp_rings = mallocarray(nrxqsets, sizeof(struct bnxt_cp_ring), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->rx_cp_rings) { device_printf(iflib_get_dev(ctx), @@ -454,7 +454,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, rc = ENOMEM; goto cp_alloc_fail; } - softc->rx_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, + softc->rx_rings = mallocarray(nrxqsets, sizeof(struct bnxt_ring), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->rx_rings) { device_printf(iflib_get_dev(ctx), @@ -462,7 +462,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, rc = ENOMEM; goto ring_alloc_fail; } - softc->ag_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, + softc->ag_rings = mallocarray(nrxqsets, sizeof(struct bnxt_ring), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->ag_rings) { device_printf(iflib_get_dev(ctx), @@ -470,7 +470,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, rc = ENOMEM; goto ag_alloc_fail; } - softc->grp_info = malloc(sizeof(struct bnxt_grp_info) * nrxqsets, + softc->grp_info = mallocarray(nrxqsets, sizeof(struct bnxt_grp_info), M_DEVBUF, M_NOWAIT | M_ZERO); if (!softc->grp_info) { device_printf(iflib_get_dev(ctx), @@ -540,9 +540,10 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc->rx_rings[i].paddr = paddrs[i * nrxqs + 1]; /* Allocate the TPA start buffer */ - softc->rx_rings[i].tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * - (RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT), - M_DEVBUF, M_NOWAIT | M_ZERO); + softc->rx_rings[i].tpa_start = mallocarray( + RX_TPA_START_CMPL_AGG_ID_MASK >> RX_TPA_START_CMPL_AGG_ID_SFT, + sizeof(struct bnxt_full_tpa_start), M_DEVBUF, + M_NOWAIT | M_ZERO); if (softc->rx_rings[i].tpa_start == NULL) { rc = -ENOMEM; device_printf(softc->dev, Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/bwn/if_bwn.c Sat Jan 13 22:30:30 2018 (r327949) @@ -2677,8 +2677,8 @@ bwn_dma_ringsetup(struct bwn_mac *mac, int controller_ if (for_tx) dr->dr_numslots = BWN_TXRING_SLOTS; - dr->dr_meta = malloc(dr->dr_numslots * sizeof(struct bwn_dmadesc_meta), - M_DEVBUF, M_NOWAIT | M_ZERO); + dr->dr_meta = mallocarray(dr->dr_numslots, + sizeof(struct bwn_dmadesc_meta), M_DEVBUF, M_NOWAIT | M_ZERO); if (dr->dr_meta == NULL) goto fail0; Modified: head/sys/dev/bwn/if_bwn_phy_lp.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_lp.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/bwn/if_bwn_phy_lp.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1127,7 +1127,7 @@ bwn_phy_lp_bugfix(struct bwn_mac *mac) uint8_t mode; int8_t txpwridx; - tabs = (uint32_t *)malloc(sizeof(uint32_t) * size, M_DEVBUF, + tabs = (uint32_t *)mallocarray(size, sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (tabs == NULL) { device_printf(sc->sc_dev, "failed to allocate buffer.\n"); Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/ciss/ciss.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1427,7 +1427,7 @@ ciss_init_logical(struct ciss_softc *sc) } sc->ciss_logical = - malloc(sc->ciss_max_logical_bus * sizeof(struct ciss_ldrive *), + mallocarray(sc->ciss_max_logical_bus, sizeof(struct ciss_ldrive *), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical == NULL) { error = ENXIO; @@ -1436,7 +1436,7 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i < sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(sc->ciss_cfg->max_logical_supported * + mallocarray(sc->ciss_cfg->max_logical_supported, sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { @@ -1549,7 +1549,7 @@ ciss_init_physical(struct ciss_softc *sc) } sc->ciss_controllers = - malloc(sc->ciss_max_logical_bus * sizeof (union ciss_device_address), + mallocarray(sc->ciss_max_logical_bus, sizeof(union ciss_device_address), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_controllers == NULL) { @@ -1566,7 +1566,7 @@ ciss_init_physical(struct ciss_softc *sc) } sc->ciss_physical = - malloc(sc->ciss_max_physical_bus * sizeof(struct ciss_pdrive *), + mallocarray(sc->ciss_max_physical_bus, sizeof(struct ciss_pdrive *), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_physical == NULL) { ciss_printf(sc, "Could not allocate memory for physical device map\n"); @@ -2873,7 +2873,7 @@ ciss_cam_init(struct ciss_softc *sc) */ maxbus = max(sc->ciss_max_logical_bus, sc->ciss_max_physical_bus + CISS_PHYSICAL_BASE); - sc->ciss_cam_sim = malloc(maxbus * sizeof(struct cam_sim*), + sc->ciss_cam_sim = mallocarray(maxbus, sizeof(struct cam_sim*), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_cam_sim == NULL) { ciss_printf(sc, "can't allocate memory for controller SIM\n"); Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1900,7 +1900,7 @@ ccr_newsession(device_t dev, uint32_t *sidp, struct cr } } if (sess == -1) { - s = malloc(sizeof(*s) * (sc->nsessions + 1), M_CCR, + s = mallocarray(sc->nsessions + 1, sizeof(*s), M_CCR, M_NOWAIT | M_ZERO); if (s == NULL) { mtx_unlock(&sc->lock); Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/esp/ncr53c9x.c Sat Jan 13 22:30:30 2018 (r327949) @@ -292,7 +292,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *sc) } else sc->sc_imess_self = 0; - sc->sc_tinfo = malloc(sc->sc_ntarg * sizeof(sc->sc_tinfo[0]), + sc->sc_tinfo = mallocarray(sc->sc_ntarg, sizeof(sc->sc_tinfo[0]), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->sc_tinfo == NULL) { device_printf(sc->sc_dev, Modified: head/sys/dev/fb/splash.c ============================================================================== --- head/sys/dev/fb/splash.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/fb/splash.c Sat Jan 13 22:30:30 2018 (r327949) @@ -136,8 +136,8 @@ splash_register(splash_decoder_t *decoder) break; } if ((i >= decoders) && (decoders % DECODER_ARRAY_DELTA) == 0) { - p = malloc(sizeof(*p)*(decoders + DECODER_ARRAY_DELTA), - M_DEVBUF, M_NOWAIT); + p = mallocarray(decoders + DECODER_ARRAY_DELTA, + sizeof(*p), M_DEVBUF, M_NOWAIT); if (p == NULL) return ENOMEM; if (decoder_set != NULL) { Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/gpio/gpiobus.c Sat Jan 13 22:30:30 2018 (r327949) @@ -235,7 +235,7 @@ gpiobus_init_softc(device_t dev) /* Pins = GPIO_PIN_MAX() + 1 */ sc->sc_npins++; - sc->sc_pins = malloc(sizeof(*sc->sc_pins) * sc->sc_npins, M_DEVBUF, + sc->sc_pins = mallocarray(sc->sc_npins, sizeof(*sc->sc_pins), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->sc_pins == NULL) return (ENOMEM); @@ -251,11 +251,11 @@ gpiobus_alloc_ivars(struct gpiobus_ivar *devi) { /* Allocate pins and flags memory. */ - devi->pins = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF, + devi->pins = mallocarray(devi->npins, sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (devi->pins == NULL) return (ENOMEM); - devi->flags = malloc(sizeof(uint32_t) * devi->npins, M_DEVBUF, + devi->flags = mallocarray(devi->npins, sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (devi->flags == NULL) { free(devi->pins, M_DEVBUF); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/if_ndis/if_ndis.c Sat Jan 13 22:30:30 2018 (r327949) @@ -665,8 +665,8 @@ ndis_attach(device_t dev) if (sc->ndis_maxpkts == 0) sc->ndis_maxpkts = 10; - sc->ndis_txarray = malloc(sizeof(ndis_packet *) * - sc->ndis_maxpkts, M_DEVBUF, M_NOWAIT|M_ZERO); + sc->ndis_txarray = mallocarray(sc->ndis_maxpkts, + sizeof(ndis_packet *), M_DEVBUF, M_NOWAIT|M_ZERO); /* Allocate a pool of ndis_packets for TX encapsulation. */ Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/iwi/if_iwi.c Sat Jan 13 22:30:30 2018 (r327949) @@ -640,7 +640,7 @@ iwi_alloc_tx_ring(struct iwi_softc *sc, struct iwi_tx_ goto fail; } - ring->data = malloc(count * sizeof (struct iwi_tx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct iwi_tx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); @@ -748,7 +748,7 @@ iwi_alloc_rx_ring(struct iwi_softc *sc, struct iwi_rx_ ring->count = count; ring->cur = 0; - ring->data = malloc(count * sizeof (struct iwi_rx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct iwi_rx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/kbd/kbd.c Sat Jan 13 22:30:30 2018 (r327949) @@ -94,17 +94,18 @@ kbd_realloc_array(void) { keyboard_t **new_kbd; keyboard_switch_t **new_kbdsw; - int newsize; + u_int newsize; int s; s = spltty(); newsize = rounddown(keyboards + ARRAY_DELTA, ARRAY_DELTA); - new_kbd = malloc(sizeof(*new_kbd)*newsize, M_DEVBUF, M_NOWAIT|M_ZERO); + new_kbd = mallocarray(newsize, sizeof(*new_kbd), M_DEVBUF, + M_NOWAIT|M_ZERO); if (new_kbd == NULL) { splx(s); return (ENOMEM); } - new_kbdsw = malloc(sizeof(*new_kbdsw)*newsize, M_DEVBUF, + new_kbdsw = mallocarray(newsize, sizeof(*new_kbdsw), M_DEVBUF, M_NOWAIT|M_ZERO); if (new_kbdsw == NULL) { free(new_kbd, M_DEVBUF); Modified: head/sys/dev/liquidio/base/lio_request_manager.c ============================================================================== --- head/sys/dev/liquidio/base/lio_request_manager.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/liquidio/base/lio_request_manager.c Sat Jan 13 22:30:30 2018 (r327949) @@ -110,7 +110,7 @@ lio_init_instr_queue(struct octeon_device *oct, union * Initialize a list to holds requests that have been posted to * Octeon but has yet to be fetched by octeon */ - iq->request_list = malloc(sizeof(*iq->request_list) * num_descs, + iq->request_list = mallocarray(num_descs, sizeof(*iq->request_list), M_DEVBUF, M_NOWAIT | M_ZERO); if (iq->request_list == NULL) { lio_dev_err(oct, "Alloc failed for IQ[%d] nr free list\n", Modified: head/sys/dev/liquidio/lio_main.c ============================================================================== --- head/sys/dev/liquidio/lio_main.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/liquidio/lio_main.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1724,12 +1724,12 @@ lio_setup_glists(struct octeon_device *oct, struct lio struct lio_gather *g; int i, j; - lio->glist_lock = malloc(num_iqs * sizeof(*lio->glist_lock), M_DEVBUF, - M_NOWAIT | M_ZERO); + lio->glist_lock = mallocarray(num_iqs, sizeof(*lio->glist_lock), + M_DEVBUF, M_NOWAIT | M_ZERO); if (lio->glist_lock == NULL) return (1); - lio->ghead = malloc(num_iqs * sizeof(*lio->ghead), M_DEVBUF, + lio->ghead = mallocarray(num_iqs, sizeof(*lio->ghead), M_DEVBUF, M_NOWAIT | M_ZERO); if (lio->ghead == NULL) { free((void *)lio->glist_lock, M_DEVBUF); @@ -1743,10 +1743,10 @@ lio_setup_glists(struct octeon_device *oct, struct lio * allocate memory to store virtual and dma base address of * per glist consistent memory */ - lio->glists_virt_base = malloc(num_iqs * sizeof(void *), M_DEVBUF, + lio->glists_virt_base = mallocarray(num_iqs, sizeof(void *), M_DEVBUF, M_NOWAIT | M_ZERO); - lio->glists_dma_base = malloc(num_iqs * sizeof(vm_paddr_t), M_DEVBUF, - M_NOWAIT | M_ZERO); + lio->glists_dma_base = mallocarray(num_iqs, sizeof(vm_paddr_t), + M_DEVBUF, M_NOWAIT | M_ZERO); if ((lio->glists_virt_base == NULL) || (lio->glists_dma_base == NULL)) { lio_delete_glists(oct, lio); return (1); Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mpr/mpr.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1192,7 +1192,7 @@ mpr_alloc_queues(struct mpr_softc *sc) nq = sc->msi_msgs; mpr_dprint(sc, MPR_INIT|MPR_XINFO, "Allocating %d I/O queues\n", nq); - sc->queues = malloc(sizeof(struct mpr_queue) * nq, M_MPR, + sc->queues = mallocarray(nq, sizeof(struct mpr_queue), M_MPR, M_NOWAIT|M_ZERO); if (sc->queues == NULL) return (ENOMEM); Modified: head/sys/dev/mpr/mpr_mapping.c ============================================================================== --- head/sys/dev/mpr/mpr_mapping.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mpr/mpr_mapping.c Sat Jan 13 22:30:30 2018 (r327949) @@ -2141,27 +2141,27 @@ mpr_mapping_allocate_memory(struct mpr_softc *sc) { uint32_t dpm_pg0_sz; - sc->mapping_table = malloc((sizeof(struct dev_mapping_table) * - sc->max_devices), M_MPR, M_ZERO|M_NOWAIT); + sc->mapping_table = mallocarray(sc->max_devices, + sizeof(struct dev_mapping_table), M_MPR, M_ZERO|M_NOWAIT); if (!sc->mapping_table) goto free_resources; - sc->removal_table = malloc((sizeof(struct map_removal_table) * - sc->max_devices), M_MPR, M_ZERO|M_NOWAIT); + sc->removal_table = mallocarray(sc->max_devices, + sizeof(struct map_removal_table), M_MPR, M_ZERO|M_NOWAIT); if (!sc->removal_table) goto free_resources; - sc->enclosure_table = malloc((sizeof(struct enc_mapping_table) * - sc->max_enclosures), M_MPR, M_ZERO|M_NOWAIT); + sc->enclosure_table = mallocarray(sc->max_enclosures, + sizeof(struct enc_mapping_table), M_MPR, M_ZERO|M_NOWAIT); if (!sc->enclosure_table) goto free_resources; - sc->dpm_entry_used = malloc((sizeof(u8) * sc->max_dpm_entries), + sc->dpm_entry_used = mallocarray(sc->max_dpm_entries, sizeof(u8), M_MPR, M_ZERO|M_NOWAIT); if (!sc->dpm_entry_used) goto free_resources; - sc->dpm_flush_entry = malloc((sizeof(u8) * sc->max_dpm_entries), + sc->dpm_flush_entry = mallocarray(sc->max_dpm_entries, sizeof(u8), M_MPR, M_ZERO|M_NOWAIT); if (!sc->dpm_flush_entry) goto free_resources; @@ -2912,7 +2912,7 @@ mpr_mapping_topology_change_event(struct mpr_softc *sc if (!num_entries) goto out; - phy_change = malloc(sizeof(struct _map_phy_change) * num_entries, + phy_change = mallocarray(num_entries, sizeof(struct _map_phy_change), M_MPR, M_NOWAIT|M_ZERO); topo_change.phy_details = phy_change; if (!phy_change) @@ -2963,7 +2963,7 @@ mpr_mapping_pcie_topology_change_event(struct mpr_soft if (!num_entries) goto out; - port_change = malloc(sizeof(struct _map_port_change) * num_entries, + port_change = mallocarray(num_entries, sizeof(struct _map_port_change), M_MPR, M_NOWAIT|M_ZERO); topo_change.port_details = port_change; if (!port_change) @@ -3003,7 +3003,7 @@ mpr_mapping_ir_config_change_event(struct mpr_softc *s struct dev_mapping_table *mt_entry; u16 element_flags; - wwid_table = malloc(sizeof(u64) * event_data->NumElements, M_MPR, + wwid_table = mallocarray(event_data->NumElements, sizeof(u64), M_MPR, M_NOWAIT | M_ZERO); if (!wwid_table) goto out; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mps/mps.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1164,12 +1164,12 @@ static int mps_alloc_queues(struct mps_softc *sc) { struct mps_queue *q; - int nq, i; + u_int nq, i; nq = sc->msi_msgs; mps_dprint(sc, MPS_INIT|MPS_XINFO, "Allocating %d I/O queues\n", nq); - sc->queues = malloc(sizeof(struct mps_queue) * nq, M_MPT2, + sc->queues = mallocarray(nq, sizeof(struct mps_queue), M_MPT2, M_NOWAIT|M_ZERO); if (sc->queues == NULL) return (ENOMEM); Modified: head/sys/dev/mps/mps_mapping.c ============================================================================== --- head/sys/dev/mps/mps_mapping.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mps/mps_mapping.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1694,27 +1694,27 @@ mps_mapping_allocate_memory(struct mps_softc *sc) { uint32_t dpm_pg0_sz; - sc->mapping_table = malloc((sizeof(struct dev_mapping_table) * - sc->max_devices), M_MPT2, M_ZERO|M_NOWAIT); + sc->mapping_table = mallocarray(sc->max_devices, + sizeof(struct dev_mapping_table), M_MPT2, M_ZERO|M_NOWAIT); if (!sc->mapping_table) goto free_resources; - sc->removal_table = malloc((sizeof(struct map_removal_table) * - sc->max_devices), M_MPT2, M_ZERO|M_NOWAIT); + sc->removal_table = mallocarray(sc->max_devices, + sizeof(struct map_removal_table), M_MPT2, M_ZERO|M_NOWAIT); if (!sc->removal_table) goto free_resources; - sc->enclosure_table = malloc((sizeof(struct enc_mapping_table) * - sc->max_enclosures), M_MPT2, M_ZERO|M_NOWAIT); + sc->enclosure_table = mallocarray(sc->max_enclosures, + sizeof(struct enc_mapping_table), M_MPT2, M_ZERO|M_NOWAIT); if (!sc->enclosure_table) goto free_resources; - sc->dpm_entry_used = malloc((sizeof(u8) * sc->max_dpm_entries), + sc->dpm_entry_used = mallocarray(sc->max_dpm_entries, sizeof(u8), M_MPT2, M_ZERO|M_NOWAIT); if (!sc->dpm_entry_used) goto free_resources; - sc->dpm_flush_entry = malloc((sizeof(u8) * sc->max_dpm_entries), + sc->dpm_flush_entry = mallocarray(sc->max_dpm_entries, sizeof(u8), M_MPT2, M_ZERO|M_NOWAIT); if (!sc->dpm_flush_entry) goto free_resources; @@ -2451,7 +2451,7 @@ mps_mapping_topology_change_event(struct mps_softc *sc if (!num_entries) goto out; - phy_change = malloc(sizeof(struct _map_phy_change) * num_entries, + phy_change = mallocarray(num_entries, sizeof(struct _map_phy_change), M_MPT2, M_NOWAIT|M_ZERO); topo_change.phy_details = phy_change; if (!phy_change) @@ -2492,7 +2492,7 @@ mps_mapping_ir_config_change_event(struct mps_softc *s struct dev_mapping_table *mt_entry; u16 element_flags; - wwid_table = malloc(sizeof(u64) * event_data->NumElements, M_MPT2, + wwid_table = mallocarray(event_data->NumElements, sizeof(u64), M_MPT2, M_NOWAIT | M_ZERO); if (!wwid_table) goto out; Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mpt/mpt_cam.c Sat Jan 13 22:30:30 2018 (r327949) @@ -637,8 +637,8 @@ mptsas_sas_io_unit_pg0(struct mpt_softc *mpt, struct m } portinfo->num_phys = buffer->NumPhys; - portinfo->phy_info = malloc(sizeof(*portinfo->phy_info) * - portinfo->num_phys, M_DEVBUF, M_NOWAIT|M_ZERO); + portinfo->phy_info = mallocarray(portinfo->num_phys, + sizeof(*portinfo->phy_info), M_DEVBUF, M_NOWAIT|M_ZERO); if (portinfo->phy_info == NULL) { free(buffer, M_DEVBUF); error = ENOMEM; @@ -4234,7 +4234,7 @@ mpt_add_target_commands(struct mpt_softc *mpt) max = mpt->mpt_max_tgtcmds; } mpt->tgt_cmd_ptrs = - malloc(max * sizeof (request_t *), M_DEVBUF, M_NOWAIT | M_ZERO); + mallocarray(max, sizeof(request_t *), M_DEVBUF, M_NOWAIT | M_ZERO); if (mpt->tgt_cmd_ptrs == NULL) { mpt_prt(mpt, "mpt_add_target_commands: could not allocate cmd ptrs\n"); Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mrsas/mrsas.c Sat Jan 13 22:30:30 2018 (r327949) @@ -2566,7 +2566,8 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) * Allocate the dynamic array first and then allocate individual * commands. */ - sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_cmd, M_MRSAS, M_NOWAIT); + sc->mpt_cmd_list = mallocarray(max_cmd, sizeof(struct mrsas_mpt_cmd *), + M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list) { device_printf(sc->mrsas_dev, "Cannot alloc memory for mpt_cmd_list.\n"); return (ENOMEM); Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/mxge/if_mxge.c Sat Jan 13 22:30:30 2018 (r327949) @@ -688,7 +688,7 @@ z_alloc(void *nil, u_int items, u_int size) { void *ptr; - ptr = malloc(items * size, M_TEMP, M_NOWAIT); + ptr = mallocarray(items, size, M_TEMP, M_NOWAIT); return ptr; } @@ -4390,8 +4390,8 @@ mxge_alloc_slices(mxge_softc_t *sc) sc->rx_ring_size = cmd.data0; max_intr_slots = 2 * (sc->rx_ring_size / sizeof (mcp_dma_addr_t)); - bytes = sizeof (*sc->ss) * sc->num_slices; - sc->ss = malloc(bytes, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->ss = mallocarray(sc->num_slices, sizeof(*sc->ss), M_DEVBUF, + M_NOWAIT | M_ZERO); if (sc->ss == NULL) return (ENOMEM); for (i = 0; i < sc->num_slices; i++) { @@ -4563,8 +4563,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) err = ENOSPC; goto abort_with_msix; } - bytes = sizeof (*sc->msix_irq_res) * sc->num_slices; - sc->msix_irq_res = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); + sc->msix_irq_res = mallocarray(sc->num_slices, + sizeof(*sc->msix_irq_res), M_DEVBUF, M_NOWAIT|M_ZERO); if (sc->msix_irq_res == NULL) { err = ENOMEM; goto abort_with_msix; @@ -4583,8 +4583,8 @@ mxge_add_msix_irqs(mxge_softc_t *sc) } } - bytes = sizeof (*sc->msix_ih) * sc->num_slices; - sc->msix_ih = malloc(bytes, M_DEVBUF, M_NOWAIT|M_ZERO); + sc->msix_ih = mallocarray(sc->num_slices, sizeof(*sc->msix_ih), + M_DEVBUF, M_NOWAIT|M_ZERO); for (i = 0; i < sc->num_slices; i++) { err = bus_setup_intr(sc->dev, sc->msix_irq_res[i], Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/netmap/if_ptnet.c Sat Jan 13 22:30:30 2018 (r327949) @@ -351,7 +351,7 @@ ptnet_attach(device_t dev) sc->num_tx_rings = num_tx_rings; /* Allocate and initialize per-queue data structures. */ - sc->queues = malloc(sizeof(struct ptnet_queue) * sc->num_rings, + sc->queues = mallocarray(sc->num_rings, sizeof(struct ptnet_queue), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->queues == NULL) { err = ENOMEM; Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/nvme/nvme_ns.c Sat Jan 13 22:30:30 2018 (r327949) @@ -321,7 +321,8 @@ nvme_allocate_child_bios(int num_bios) struct bio **child_bios; int err = 0, i; - child_bios = malloc(num_bios * sizeof(struct bio *), M_NVME, M_NOWAIT); + child_bios = mallocarray(num_bios, sizeof(struct bio *), M_NVME, + M_NOWAIT); if (child_bios == NULL) return (NULL); Modified: head/sys/dev/pst/pst-iop.c ============================================================================== --- head/sys/dev/pst/pst-iop.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/pst/pst-iop.c Sat Jan 13 22:30:30 2018 (r327949) @@ -323,7 +323,7 @@ iop_get_lct(struct iop_softc *sc) contigfree(reply, ALLOCSIZE, M_PSTIOP); return 0; } - if (!(sc->lct = malloc(reply->table_size * sizeof(struct i2o_lct_entry), + if (!(sc->lct = mallocarray(reply->table_size, sizeof(struct i2o_lct_entry), M_PSTIOP, M_NOWAIT | M_ZERO))) { contigfree(reply, ALLOCSIZE, M_PSTIOP); return 0; Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/ral/rt2560.c Sat Jan 13 22:30:30 2018 (r327949) @@ -488,7 +488,7 @@ rt2560_alloc_tx_ring(struct rt2560_softc *sc, struct r goto fail; } - ring->data = malloc(count * sizeof (struct rt2560_tx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct rt2560_tx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); @@ -632,8 +632,8 @@ rt2560_alloc_rx_ring(struct rt2560_softc *sc, struct r goto fail; } - ring->data = malloc(count * sizeof (struct rt2560_rx_data), M_DEVBUF, - M_NOWAIT | M_ZERO); + ring->data = mallocarray(count, sizeof (struct rt2560_rx_data), + M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); error = ENOMEM; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/ral/rt2661.c Sat Jan 13 22:30:30 2018 (r327949) @@ -497,7 +497,7 @@ rt2661_alloc_tx_ring(struct rt2661_softc *sc, struct r goto fail; } - ring->data = malloc(count * sizeof (struct rt2661_tx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct rt2661_tx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); @@ -638,7 +638,7 @@ rt2661_alloc_rx_ring(struct rt2661_softc *sc, struct r goto fail; } - ring->data = malloc(count * sizeof (struct rt2661_rx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct rt2661_rx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); Modified: head/sys/dev/rp/rp.c ============================================================================== --- head/sys/dev/rp/rp.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/rp/rp.c Sat Jan 13 22:30:30 2018 (r327949) @@ -732,7 +732,8 @@ rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int ctlp->num_ports = num_ports; ctlp->rp = rp = (struct rp_port *) - malloc(sizeof(struct rp_port) * num_ports, M_DEVBUF, M_NOWAIT | M_ZERO); + mallocarray(num_ports, sizeof(struct rp_port), M_DEVBUF, + M_NOWAIT | M_ZERO); if (rp == NULL) { device_printf(ctlp->dev, "rp_attachcommon: Could not malloc rp_ports structures.\n"); retval = ENOMEM; Modified: head/sys/dev/rp/rp_isa.c ============================================================================== --- head/sys/dev/rp/rp_isa.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/rp/rp_isa.c Sat Jan 13 22:30:30 2018 (r327949) @@ -178,8 +178,10 @@ rp_probe(device_t dev) /* The IO ports of AIOPs for an ISA controller are discrete. */ ctlp->io_num = 1; - ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * MAX_AIOPS_PER_BOARD, M_DEVBUF, M_NOWAIT | M_ZERO); - ctlp->io = malloc(sizeof(*(ctlp->io)) * MAX_AIOPS_PER_BOARD, M_DEVBUF, M_NOWAIT | M_ZERO); + ctlp->io_rid = mallocarray(MAX_AIOPS_PER_BOARD, sizeof(*(ctlp->io_rid)), + M_DEVBUF, M_NOWAIT | M_ZERO); + ctlp->io = mallocarray(MAX_AIOPS_PER_BOARD, sizeof(*(ctlp->io)), + M_DEVBUF, M_NOWAIT | M_ZERO); if (ctlp->io_rid == NULL || ctlp->io == NULL) { device_printf(dev, "rp_attach: Out of memory.\n"); retval = ENOMEM; Modified: head/sys/dev/rp/rp_pci.c ============================================================================== --- head/sys/dev/rp/rp_pci.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/rp/rp_pci.c Sat Jan 13 22:30:30 2018 (r327949) @@ -164,8 +164,10 @@ rp_pciattach(device_t dev) /* The IO ports of AIOPs for a PCI controller are continuous. */ ctlp->io_num = 1; - ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, M_DEVBUF, M_NOWAIT | M_ZERO); - ctlp->io = malloc(sizeof(*(ctlp->io)) * ctlp->io_num, M_DEVBUF, M_NOWAIT | M_ZERO); + ctlp->io_rid = mallocarray(ctlp->io_num, sizeof(*(ctlp->io_rid)), + M_DEVBUF, M_NOWAIT | M_ZERO); + ctlp->io = mallocarray(ctlp->io_num, sizeof(*(ctlp->io)), M_DEVBUF, + M_NOWAIT | M_ZERO); if (ctlp->io_rid == NULL || ctlp->io == NULL) { device_printf(dev, "rp_pciattach: Out of memory.\n"); retval = ENOMEM; Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/sound/midi/midi.c Sat Jan 13 22:30:30 2018 (r327949) @@ -340,14 +340,15 @@ midi_init(kobj_class_t cls, int unit, int channel, voi mtx_lock(&m->qlock); if (inqsize) - buf = malloc(sizeof(MIDI_TYPE) * inqsize, M_MIDI, M_NOWAIT); + buf = mallocarray(inqsize, sizeof(MIDI_TYPE), M_MIDI, M_NOWAIT); else buf = NULL; MIDIQ_INIT(m->inq, buf, inqsize); if (outqsize) - buf = malloc(sizeof(MIDI_TYPE) * outqsize, M_MIDI, M_NOWAIT); + buf = mallocarray(outqsize, sizeof(MIDI_TYPE), M_MIDI, + M_NOWAIT); else buf = NULL; m->hiwat = outqsize / 2; Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/sound/pci/hda/hdaa.c Sat Jan 13 22:30:30 2018 (r327949) @@ -3034,8 +3034,8 @@ hdaa_audio_ctl_parse(struct hdaa_devinfo *devinfo) if (max < 1) return; - ctls = (struct hdaa_audio_ctl *)malloc( - sizeof(*ctls) * max, M_HDAA, M_ZERO | M_NOWAIT); + ctls = (struct hdaa_audio_ctl *)mallocarray(max, + sizeof(*ctls), M_HDAA, M_ZERO | M_NOWAIT); if (ctls == NULL) { /* Blekh! */ @@ -3187,8 +3187,8 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo) if (max < 1) return; - as = (struct hdaa_audio_as *)malloc( - sizeof(*as) * max, M_HDAA, M_ZERO | M_NOWAIT); + as = (struct hdaa_audio_as *)mallocarray(max, + sizeof(*as), M_HDAA, M_ZERO | M_NOWAIT); if (as == NULL) { /* Blekh! */ @@ -4078,8 +4078,8 @@ hdaa_audio_bind_as(struct hdaa_devinfo *devinfo) cnt += as[j].num_chans; } if (devinfo->num_chans == 0) { - devinfo->chans = (struct hdaa_chan *)malloc( - sizeof(struct hdaa_chan) * cnt, + devinfo->chans = (struct hdaa_chan *)mallocarray(cnt, + sizeof(struct hdaa_chan), M_HDAA, M_ZERO | M_NOWAIT); if (devinfo->chans == NULL) { device_printf(devinfo->dev, @@ -5491,8 +5491,8 @@ hdaa_prepare_pcms(struct hdaa_devinfo *devinfo) devinfo->num_devs = max(ardev, apdev) + max(drdev, dpdev); devinfo->devs = - (struct hdaa_pcm_devinfo *)malloc( - devinfo->num_devs * sizeof(struct hdaa_pcm_devinfo), + (struct hdaa_pcm_devinfo *)mallocarray( + devinfo->num_devs, sizeof(struct hdaa_pcm_devinfo), M_HDAA, M_ZERO | M_NOWAIT); if (devinfo->devs == NULL) { device_printf(devinfo->dev, Modified: head/sys/dev/syscons/fire/fire_saver.c ============================================================================== --- head/sys/dev/syscons/fire/fire_saver.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/syscons/fire/fire_saver.c Sat Jan 13 22:30:30 2018 (r327949) @@ -155,7 +155,7 @@ fire_init(video_adapter_t *adp) scrw = info.vi_width; scrh = info.vi_height; - buf = (u_char *)malloc(scrw * (scrh + 1), M_DEVBUF, M_NOWAIT); + buf = (u_char *)mallocarray(scrw, scrh + 1, M_DEVBUF, M_NOWAIT); if (buf) { bzero(buf, scrw * (scrh + 1)); } else { Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/virtio/console/virtio_console.c Sat Jan 13 22:30:30 2018 (r327949) @@ -474,11 +474,11 @@ static int vtcon_alloc_scports(struct vtcon_softc *sc) { struct vtcon_softc_port *scport; - int max, i; + u_int max, i; max = sc->vtcon_max_ports; - sc->vtcon_ports = malloc(sizeof(struct vtcon_softc_port) * max, + sc->vtcon_ports = mallocarray(max, sizeof(struct vtcon_softc_port), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vtcon_ports == NULL) return (ENOMEM); @@ -497,7 +497,8 @@ vtcon_alloc_virtqueues(struct vtcon_softc *sc) device_t dev; struct vq_alloc_info *info; struct vtcon_softc_port *scport; - int i, idx, portidx, nvqs, error; + u_int i, idx, portidx, nvqs; + int error; dev = sc->vtcon_dev; @@ -505,7 +506,8 @@ vtcon_alloc_virtqueues(struct vtcon_softc *sc) if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) nvqs += 2; - info = malloc(sizeof(struct vq_alloc_info) * nvqs, M_TEMP, M_NOWAIT); + info = mallocarray(nvqs, sizeof(struct vq_alloc_info), M_TEMP, + M_NOWAIT); if (info == NULL) return (ENOMEM); Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Sat Jan 13 22:30:30 2018 (r327949) @@ -507,7 +507,7 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n if (nvqs <= 0) return (EINVAL); - sc->vtmmio_vqs = malloc(nvqs * sizeof(struct vtmmio_virtqueue), + sc->vtmmio_vqs = mallocarray(nvqs, sizeof(struct vtmmio_virtqueue), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vtmmio_vqs == NULL) return (ENOMEM); Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Jan 13 22:30:30 2018 (r327949) @@ -755,9 +755,9 @@ vtnet_alloc_rxtx_queues(struct vtnet_softc *sc) npairs = sc->vtnet_max_vq_pairs; - sc->vtnet_rxqs = malloc(sizeof(struct vtnet_rxq) * npairs, M_DEVBUF, + sc->vtnet_rxqs = mallocarray(npairs, sizeof(struct vtnet_rxq), M_DEVBUF, M_NOWAIT | M_ZERO); - sc->vtnet_txqs = malloc(sizeof(struct vtnet_txq) * npairs, M_DEVBUF, + sc->vtnet_txqs = mallocarray(npairs, sizeof(struct vtnet_txq), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vtnet_rxqs == NULL || sc->vtnet_txqs == NULL) return (ENOMEM); @@ -887,7 +887,8 @@ vtnet_alloc_virtqueues(struct vtnet_softc *sc) if (sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) nvqs++; - info = malloc(sizeof(struct vq_alloc_info) * nvqs, M_TEMP, M_NOWAIT); + info = mallocarray(nvqs, sizeof(struct vq_alloc_info), M_TEMP, + M_NOWAIT); if (info == NULL) return (ENOMEM); Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/virtio/pci/virtio_pci.c Sat Jan 13 22:30:30 2018 (r327949) @@ -491,7 +491,7 @@ vtpci_alloc_virtqueues(device_t dev, int flags, int nv if (nvqs <= 0) return (EINVAL); - sc->vtpci_vqs = malloc(nvqs * sizeof(struct vtpci_virtqueue), + sc->vtpci_vqs = mallocarray(nvqs, sizeof(struct vtpci_virtqueue), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vtpci_vqs == NULL) return (ENOMEM); @@ -927,7 +927,7 @@ vtpci_alloc_intr_resources(struct vtpci_softc *sc) /* Subtract one for the configuration changed interrupt. */ nvq_intrs = sc->vtpci_nmsix_resources - 1; - intr = sc->vtpci_msix_vq_interrupts = malloc(nvq_intrs * + intr = sc->vtpci_msix_vq_interrupts = mallocarray(nvq_intrs, sizeof(struct vtpci_interrupt), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vtpci_msix_vq_interrupts == NULL) return (ENOMEM); Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Sat Jan 13 22:30:30 2018 (r327949) @@ -959,7 +959,7 @@ vmxnet3_init_rxq(struct vmxnet3_softc *sc, int q) rxr = &rxq->vxrxq_cmd_ring[i]; rxr->vxrxr_rid = i; rxr->vxrxr_ndesc = sc->vmx_nrxdescs; - rxr->vxrxr_rxbuf = malloc(rxr->vxrxr_ndesc * + rxr->vxrxr_rxbuf = mallocarray(rxr->vxrxr_ndesc, sizeof(struct vmxnet3_rxbuf), M_DEVBUF, M_NOWAIT | M_ZERO); if (rxr->vxrxr_rxbuf == NULL) return (ENOMEM); @@ -987,7 +987,7 @@ vmxnet3_init_txq(struct vmxnet3_softc *sc, int q) txq->vxtxq_id = q; txr->vxtxr_ndesc = sc->vmx_ntxdescs; - txr->vxtxr_txbuf = malloc(txr->vxtxr_ndesc * + txr->vxtxr_txbuf = mallocarray(txr->vxtxr_ndesc, sizeof(struct vmxnet3_txbuf), M_DEVBUF, M_NOWAIT | M_ZERO); if (txr->vxtxr_txbuf == NULL) return (ENOMEM); @@ -1023,10 +1023,10 @@ vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *sc) sc->vmx_max_ntxqueues = 1; } - sc->vmx_rxq = malloc(sizeof(struct vmxnet3_rxqueue) * - sc->vmx_max_nrxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); - sc->vmx_txq = malloc(sizeof(struct vmxnet3_txqueue) * - sc->vmx_max_ntxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_rxq = mallocarray(sc->vmx_max_nrxqueues, + sizeof(struct vmxnet3_rxqueue), M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_txq = mallocarray(sc->vmx_max_ntxqueues, + sizeof(struct vmxnet3_txqueue), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vmx_rxq == NULL || sc->vmx_txq == NULL) return (ENOMEM); Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/vnic/nicvf_queues.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1104,7 +1104,7 @@ nicvf_init_snd_queue(struct nicvf *nic, struct snd_que } /* Allocate send buffers array */ - sq->snd_buff = malloc(sizeof(*sq->snd_buff) * q_len, M_NICVF, + sq->snd_buff = mallocarray(q_len, sizeof(*sq->snd_buff), M_NICVF, (M_NOWAIT | M_ZERO)); if (sq->snd_buff == NULL) { device_printf(nic->dev, Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/xen/blkback/blkback.c Sat Jan 13 22:30:30 2018 (r327949) @@ -3166,7 +3166,7 @@ xbb_alloc_requests(struct xbb_softc *xbb) /* * Allocate request book keeping datastructures. */ - xbb->requests = malloc(xbb->max_requests * sizeof(*xbb->requests), + xbb->requests = mallocarray(xbb->max_requests, sizeof(*xbb->requests), M_XENBLOCKBACK, M_NOWAIT|M_ZERO); if (xbb->requests == NULL) { xenbus_dev_fatal(xbb->dev, ENOMEM, @@ -3194,7 +3194,7 @@ xbb_alloc_request_lists(struct xbb_softc *xbb) * If no requests can be merged, we need 1 request list per * in flight request. */ - xbb->request_lists = malloc(xbb->max_requests * + xbb->request_lists = mallocarray(xbb->max_requests, sizeof(*xbb->request_lists), M_XENBLOCKBACK, M_NOWAIT|M_ZERO); if (xbb->request_lists == NULL) { xenbus_dev_fatal(xbb->dev, ENOMEM, @@ -3222,7 +3222,7 @@ xbb_alloc_request_lists(struct xbb_softc *xbb) } #endif /* XBB_USE_BOUNCE_BUFFERS */ - reqlist->gnt_handles = malloc(xbb->max_reqlist_segments * + reqlist->gnt_handles = mallocarray(xbb->max_reqlist_segments, sizeof(*reqlist->gnt_handles), M_XENBLOCKBACK, M_NOWAIT|M_ZERO); if (reqlist->gnt_handles == NULL) { Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jan 13 21:39:46 2018 (r327948) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jan 13 22:30:30 2018 (r327949) @@ -1306,8 +1306,8 @@ xbd_connect(struct xbd_softc *sc) } /* Per-transaction data allocation. */ - sc->xbd_shadow = malloc(sizeof(*sc->xbd_shadow) * sc->xbd_max_requests, - M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); + sc->xbd_shadow = mallocarray(sc->xbd_max_requests, + sizeof(*sc->xbd_shadow), M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); if (sc->xbd_shadow == NULL) { bus_dma_tag_destroy(sc->xbd_io_dmat); xenbus_dev_fatal(sc->xbd_dev, ENOMEM, @@ -1320,9 +1320,8 @@ xbd_connect(struct xbd_softc *sc) void * indirectpages; cm = &sc->xbd_shadow[i]; - cm->cm_sg_refs = malloc( - sizeof(grant_ref_t) * sc->xbd_max_request_segments, - M_XENBLOCKFRONT, M_NOWAIT); + cm->cm_sg_refs = mallocarray(sc->xbd_max_request_segments, + sizeof(grant_ref_t), M_XENBLOCKFRONT, M_NOWAIT); if (cm->cm_sg_refs == NULL) break; cm->cm_id = i; From owner-svn-src-all@freebsd.org Sat Jan 13 22:34:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5BCEB3687 for ; Sat, 13 Jan 2018 22:34:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic309-35.consmr.mail.ne1.yahoo.com (sonic309-35.consmr.mail.ne1.yahoo.com [66.163.184.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFD537B730 for ; Sat, 13 Jan 2018 22:34:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515882869; bh=i5NMKWD3wgmlpnuvUSTvvmgzyjgC24n1kJnLYnuXcrs=; h=Subject:From:To:References:Date:In-Reply-To:From:Subject; b=P1iCi3MOFGAL5V+XBzLdAqUZPddXK1KCqjD76022M05r/6HWQTIl4OOyLH5bgslbgW/ujqm1nU37H46jrb+3xrZe9ko+D7aZinzcZQNcqnLdhxciHBxgDgDszHXHc8Q+iu/g4IPPIBKI3tBmo56nuz91AJY2Px8ec5ebzP1ww10JJvJ9WeetIEaGno2R7HnJKiaHLL/UJCKyekURB+y36QpNtK5AYCuZve7/rCZuGyAYkYaDqNUsKVCmM/Zz0B9KxuTG3W7rzSuzW5Bpzv/BPJM5Qzikv86ORDpvp6GScIT56zpvA0G74/KBA4jmH9LQSCN0n9Fk72rc2EpMgdP+4g== X-YMail-OSG: PuK9uloVM1m8brSagtTWlHLlpb5TrA4DvpYATeesMTPuaAcwxeoYUZY881awH_I xVZ33ef8pXuiBnNenpwEIs1RE.POhXc2oDqHhAPSRmPN3QPfIEHUZZIGZt2fyvVEvFATUTYXEjDf YR8KHtnWnUMwGpJ0rDf2ZML9FqD.TSFbHj77wwsXYbtvYFj9FGVMhWMaWfUYo_k8Ntp0nps3TR_r ExeAjfJ79K0tKS.SjzH0xL7vtNox7Sumb7r6LZv3la8m64uvMjzrfp4VGue8TKiIPbgtZKAVoa19 1OBnUS19YyJ0SZmANOv0Lrqj6tXhBUW63st8YWjEjySqvG_8VkCAkkGiCxfIe2icqnL8yOovJxt0 tBT6xA8Kx3bUrpBFPwRCSE1x5.8iYmecbRwhC8xVpYRcIaQUfjN8FfWGdhzczOvMLPvHRJHOgKyE jheH_eaZqMAoo2W1R.oP8_9SwvHuKKioPrtpAtQtLhZU3ucCfBk4dLW5UHzGqzYB22OGWT046 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Sat, 13 Jan 2018 22:34:29 +0000 Received: from smtp235.mail.ne1.yahoo.com (EHLO [192.168.0.8]) ([10.218.253.206]) by smtp410.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID a8138e14407a32871ff47ab2d66e5170; Sat, 13 Jan 2018 22:34:25 +0000 (UTC) Subject: Re: svn commit: r327949 - in head/sys/dev: aacraid advansys ath beri/virtio bnxt bwn ciss cxgbe/crypto esp fb gpio if_ndis iwi kbd liquidio liquidio/base mpr mps mpt mrsas mxge netmap nvme pst ral rp s... From: Pedro Giffuni To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132230.w0DMUVmF081985@repo.freebsd.org> Message-ID: <7fe2a0bb-8592-75bc-6f58-cb77e2d6044c@FreeBSD.org> Date: Sat, 13 Jan 2018 17:34:24 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801132230.w0DMUVmF081985@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 22:34:37 -0000 On 01/13/18 17:30, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jan 13 22:30:30 2018 > New Revision: 327949 > URL: https://svnweb.freebsd.org/changeset/base/327949 > > Log: > dev: make some use of mallocarray(9). > > Focus on code where we are doing multiplications within malloc(9). None of > these is likely to overflow, however the change is still useful as some > static checkers can benefit from the allocation attributes we use for > mallocarray. > > This initial sweep only covers malloc(9) calls with M_NOWAIT. No good > reason but I started doing the changes before r327796 and at that time it > was convenient to make sure the sorrounding code could handle NULL values. > For the record, this was part of https://reviews.freebsd.org/D13837 I didn't mention it in the commit log because I am not ready to close the revision yet. Pedro. From owner-svn-src-all@freebsd.org Sat Jan 13 23:14:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C91EB5893; Sat, 13 Jan 2018 23:14:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1E7F7D1C0; Sat, 13 Jan 2018 23:14:54 +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 0360C19815; Sat, 13 Jan 2018 23:14:54 +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 w0DNErbf002698; Sat, 13 Jan 2018 23:14:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DNEra5002692; Sat, 13 Jan 2018 23:14:53 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201801132314.w0DNEra5002692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 13 Jan 2018 23:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc ps3 X-SVN-Commit-Revision: 327950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 23:14:55 -0000 Author: nwhitehorn Date: Sat Jan 13 23:14:53 2018 New Revision: 327950 URL: https://svnweb.freebsd.org/changeset/base/327950 Log: Document places we assume that physical memory is direct-mapped at zero by using a new macro PHYS_TO_DMAP, which deliberately has the same name as the equivalent macro on amd64. This also sets the stage for moving the direct map to another base address. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/slb.c head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/uma_machdep.c head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Jan 13 22:30:30 2018 (r327949) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Jan 13 23:14:53 2018 (r327950) @@ -540,7 +540,8 @@ moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, siz DISABLE_TRANS(msr); for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { /* If this address is direct-mapped, skip remapping */ - if (hw_direct_map && translations[i].om_va == pa_base && + if (hw_direct_map && + translations[i].om_va == PHYS_TO_DMAP(pa_base) && moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) == LPTE_M) continue; @@ -633,7 +634,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel pvo = alloc_pvo_entry(1 /* bootstrap */); pvo->pvo_vaddr |= PVO_WIRED | PVO_LARGE; - init_pvo_entry(pvo, kernel_pmap, pa); + init_pvo_entry(pvo, kernel_pmap, PHYS_TO_DMAP(pa)); /* * Set memory access as guarded if prefetch within @@ -1111,7 +1112,8 @@ moea64_copy_page(mmu_t mmu, vm_page_t msrc, vm_page_t src = VM_PAGE_TO_PHYS(msrc); if (hw_direct_map) { - bcopy((void *)src, (void *)dst, PAGE_SIZE); + bcopy((void *)PHYS_TO_DMAP(src), (void *)PHYS_TO_DMAP(dst), + PAGE_SIZE); } else { mtx_lock(&moea64_scratchpage_mtx); @@ -1136,11 +1138,13 @@ moea64_copy_pages_dmap(mmu_t mmu, vm_page_t *ma, vm_of while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - a_cp = (char *)VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT]) + + a_cp = (char *)PHYS_TO_DMAP( + VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])) + a_pg_offset; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - b_cp = (char *)VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT]) + + b_cp = (char *)PHYS_TO_DMAP( + VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])) + b_pg_offset; bcopy(a_cp, b_cp, cnt); a_offset += cnt; @@ -1200,7 +1204,7 @@ moea64_zero_page_area(mmu_t mmu, vm_page_t m, int off, panic("moea64_zero_page: size + off > PAGE_SIZE"); if (hw_direct_map) { - bzero((caddr_t)pa + off, size); + bzero((caddr_t)PHYS_TO_DMAP(pa) + off, size); } else { mtx_lock(&moea64_scratchpage_mtx); moea64_set_scratchpage_pa(mmu, 0, pa); @@ -1224,7 +1228,7 @@ moea64_zero_page(mmu_t mmu, vm_page_t m) moea64_set_scratchpage_pa(mmu, 0, pa); va = moea64_scratchpage_va[0]; } else { - va = pa; + va = PHYS_TO_DMAP(pa); } for (off = 0; off < PAGE_SIZE; off += cacheline_size) @@ -1241,7 +1245,7 @@ moea64_quick_enter_page(mmu_t mmu, vm_page_t m) vm_paddr_t pa = VM_PAGE_TO_PHYS(m); if (hw_direct_map) - return (pa); + return (PHYS_TO_DMAP(pa)); /* * MOEA64_PTE_REPLACE does some locking, so we can't just grab @@ -1402,7 +1406,7 @@ moea64_syncicache(mmu_t mmu, pmap_t pmap, vm_offset_t } else if (pmap == kernel_pmap) { __syncicache((void *)va, sz); } else if (hw_direct_map) { - __syncicache((void *)pa, sz); + __syncicache((void *)PHYS_TO_DMAP(pa), sz); } else { /* Use the scratch page to set up a temp mapping */ @@ -1565,7 +1569,7 @@ moea64_init(mmu_t mmu) if (!hw_direct_map) { installed_mmu = mmu; - uma_zone_set_allocf(moea64_pvo_zone,moea64_uma_page_alloc); + uma_zone_set_allocf(moea64_pvo_zone, moea64_uma_page_alloc); } #ifdef COMPAT_FREEBSD32 @@ -1855,7 +1859,7 @@ moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa if (moea64_calc_wimg(va, VM_MEMATTR_DEFAULT) != LPTE_M) break; if (va == pa_end) - return (pa_start); + return (PHYS_TO_DMAP(pa_start)); } sva = *virt; va = sva; Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Jan 13 22:30:30 2018 (r327949) +++ head/sys/powerpc/aim/slb.c Sat Jan 13 23:14:53 2018 (r327950) @@ -497,7 +497,7 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, i if (m == NULL) return (NULL); - va = (void *) VM_PAGE_TO_PHYS(m); + va = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); if (!hw_direct_map) pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sat Jan 13 22:30:30 2018 (r327949) +++ head/sys/powerpc/include/vmparam.h Sat Jan 13 23:14:53 2018 (r327950) @@ -238,5 +238,15 @@ struct pmap_physseg { #define SFBUF_NOMD #define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map #define SFBUF_PHYS_DMAP(x) (x) + +/* + * We (usually) have a direct map of all physical memory. All + * uses of this macro must be gated by a check on hw_direct_map! + * The location of the direct map may not be 1:1 in future, so use + * of the macro is recommended; it may also grow an assert that hw_direct_map + * is set. + */ +#define PHYS_TO_DMAP(x) x +#define DMAP_TO_PHYS(x) x #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Sat Jan 13 22:30:30 2018 (r327949) +++ head/sys/powerpc/powerpc/uma_machdep.c Sat Jan 13 23:14:53 2018 (r327950) @@ -71,10 +71,12 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int if ((vm_offset_t)pa != pa) return (NULL); - va = (void *)(vm_offset_t)pa; - - if (!hw_direct_map) - pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); + if (!hw_direct_map) { + pmap_kenter(pa, pa); + va = (void *)(vm_offset_t)pa; + } else { + va = (void *)(vm_offset_t)PHYS_TO_DMAP(pa); + } if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sat Jan 13 22:30:30 2018 (r327949) +++ head/sys/powerpc/ps3/platform_ps3.c Sat Jan 13 23:14:53 2018 (r327950) @@ -226,7 +226,7 @@ static int ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) { /* kernel is spinning on 0x40 == -1 right now */ - volatile uint32_t *secondary_spin_sem = (uint32_t *)(0x40); + volatile uint32_t *secondary_spin_sem = (uint32_t *)PHYS_TO_DMAP(0x40); int remote_pir = pc->pc_hwref; int timeout; From owner-svn-src-all@freebsd.org Sat Jan 13 23:24:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8570E5C012; Sat, 13 Jan 2018 23:24:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2DE7D8B8; Sat, 13 Jan 2018 23:24:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w0DNOfod099633 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Jan 2018 01:24:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0DNOfod099633 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0DNOfJf099632; Sun, 14 Jan 2018 01:24:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Jan 2018 01:24:41 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180113232441.GV1684@kib.kiev.ua> References: <201801132314.w0DNEra5002692@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801132314.w0DNEra5002692@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 23:24:49 -0000 On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: > +/* > + * We (usually) have a direct map of all physical memory. All > + * uses of this macro must be gated by a check on hw_direct_map! > + * The location of the direct map may not be 1:1 in future, so use > + * of the macro is recommended; it may also grow an assert that hw_direct_map > + * is set. > + */ > +#define PHYS_TO_DMAP(x) x > +#define DMAP_TO_PHYS(x) x Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. From owner-svn-src-all@freebsd.org Sat Jan 13 23:29:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C888E5C404; Sat, 13 Jan 2018 23:29:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 174D67DC0A; Sat, 13 Jan 2018 23:29:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w0DNT0Z7026221 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 13 Jan 2018 15:29:01 -0800 Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801132314.w0DNEra5002692@repo.freebsd.org> <20180113232441.GV1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: <010d0153-8931-a3c2-db21-dfcbaf848fc0@freebsd.org> Date: Sat, 13 Jan 2018 15:28:59 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180113232441.GV1684@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbXA+BLLZigOJRHWfOciRD1qWnBea3ivbeu37VDmTNKWd6NmXii/IMAku+B1kvN5NSbWIYwwAg5sW3o3SCH6Ar5dTfnp4UCecE= X-Sonic-ID: C;ai+XiLn45xGegeBQ9eIpJw== M;WBgaibn45xGegeBQ9eIpJw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 23:29:03 -0000 On 01/13/18 15:24, Konstantin Belousov wrote: > On Sat, Jan 13, 2018 at 11:14:53PM +0000, Nathan Whitehorn wrote: >> +/* >> + * We (usually) have a direct map of all physical memory. All >> + * uses of this macro must be gated by a check on hw_direct_map! >> + * The location of the direct map may not be 1:1 in future, so use >> + * of the macro is recommended; it may also grow an assert that hw_direct_map >> + * is set. >> + */ >> +#define PHYS_TO_DMAP(x) x >> +#define DMAP_TO_PHYS(x) x > Take a look at the sys/vm/vm_page.c:vm_page_free_prep() function. > I think the checks in there should work as designed, unless I'm missing something. Am I? -Nathan From owner-svn-src-all@freebsd.org Sat Jan 13 23:31:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1D6E5C794; Sat, 13 Jan 2018 23:31:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C234D7DF55; Sat, 13 Jan 2018 23:31:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 001EE19AD5; Sat, 13 Jan 2018 23:31:21 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0DNVLoQ007819; Sat, 13 Jan 2018 23:31:21 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0DNVLZl007817; Sat, 13 Jan 2018 23:31:21 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201801132331.w0DNVLZl007817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Sat, 13 Jan 2018 23:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327951 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 327951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 23:31:23 -0000 Author: n_hibma Date: Sat Jan 13 23:31:21 2018 New Revision: 327951 URL: https://svnweb.freebsd.org/changeset/base/327951 Log: Add support for Quectel EC25. Submitted by: Samuel Crookes MFC after: 3 days Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sat Jan 13 23:14:53 2018 (r327950) +++ head/sys/dev/usb/serial/u3g.c Sat Jan 13 23:31:21 2018 (r327951) @@ -491,6 +491,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(QUANTA, GLX, 0), U3G_DEV(QUANTA, Q101, 0), U3G_DEV(QUANTA, Q111, 0), + U3G_DEV(QUECTEL, EC25, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC313U, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Jan 13 23:14:53 2018 (r327950) +++ head/sys/dev/usb/usbdevs Sat Jan 13 23:31:21 2018 (r327951) @@ -751,6 +751,7 @@ vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor THINGM 0x27b8 ThingM vendor PLANEX 0x2c02 Planex Communications +vendor QUECTEL 0x2c7c Quectel Wireless Solutions vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. vendor AEI 0x3334 AEI @@ -3812,11 +3813,14 @@ product QUANTA GKE 0xea05 HSDPA modem product QUANTA GLE 0xea06 HSDPA modem product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS -/* Qtronix products */ -product QTRONIX 980N 0x2011 Scorpion-980N keyboard +/* Quectel products */ +product QUECTEL EC25 0x0125 LTE modem /* Quickshot products */ product QUICKSHOT STRIKEPAD 0x6238 USB StrikePad + +/* Qtronix products */ +product QTRONIX 980N 0x2011 Scorpion-980N keyboard /* Radio Shack */ product RADIOSHACK USBCABLE 0x4026 USB to Serial Cable From owner-svn-src-all@freebsd.org Sat Jan 13 23:54:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4C0DE60BA7 for ; Sat, 13 Jan 2018 23:54:18 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F6E77EA7C for ; Sat, 13 Jan 2018 23:54:18 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-io0-x229.google.com with SMTP id b198so6933795iof.6 for ; Sat, 13 Jan 2018 15:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8q70L55Qnofs8yiwA2St2ejFBfUDxh+C35ITTLUAZIQ=; b=MjPDyXSpkN66cfhTK1iOZ0RAnR9zQOoPd/7TV0E4NY+5MR/TlHfR0nMUSSD184c6Xz mHKtLMGaNkzZg8b8BFnxlvGdDDcXKDkYF9l/SqzP6QUFfiyVF0nl0E2r+QCMkJ7J7fei hZ9ELD1g0WCWYFtlZhBlIIrsOMoZuTVYJHahjwGcbfc9uq5UxRbSChnK2vj0sjTek9VL Lvd0wk4FEUncTZEpwZsLcmVpww0oVfEyudpaxHx9SUpzit07wPKnDy34eaaO/pmQ7vV2 MX+m+nJh2eRbRytpn2up8lLZ9CGmL7s/EmbPXQOFpXRx/zaGwbKZoJACpw3ODnbWIEMa Pkeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8q70L55Qnofs8yiwA2St2ejFBfUDxh+C35ITTLUAZIQ=; b=pxEb4kkJM+xpDKUs0WrsBUnBuZhruus90QXH4KULCfuM1srkxefYdnqoQxxlnjNL8Y ggftIgX/le7wJwFxvUbdGXfC0KfgKSYKrAKzIUFk9Klk/hbAJ6gzTkmoJtsiWvLZXXaD mBo/RiRg3yyGBxN2FXQcoq2WoPRC0LFAkqUYZ7OH8uXnu7xHENIHfau6dMglIzZNavkf oO/oRDgktdDM0GglNKoqqg7NYpC9sxMw5F4ZaMvorm83MH9KX04jBBPPHwOtdLClShdJ H2jPJZCgtD3k9OFQhtRYfaQMRQ6wDRHBItNZvALVbezkpZMVl3O5h/86g/7CCCabW0mI UY7w== X-Gm-Message-State: AKwxytdbmo2zMafhwF8DMhFH46wI2Nnel32xpmngQ3h5NzS3yA+dzEYD mY5c8tY7BIxvK6oC4Kl/7vPKffneKsU6oSN9784Gww== X-Google-Smtp-Source: ACJfBosS5JPIw/xIDFc7rE8cRsmcxWvCyFySD+iwqImACJx9X3yscFlLXvB0vYENmnSJ01xo6BQrH5whn+DHjhZCxtA= X-Received: by 10.107.112.7 with SMTP id l7mr3097736ioc.178.1515887657632; Sat, 13 Jan 2018 15:54:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.37.13 with HTTP; Sat, 13 Jan 2018 15:54:17 -0800 (PST) In-Reply-To: <187e75c7-343f-aea6-cb59-61c77fd64023@freebsd.org> References: <201801121401.w0CE1cW4058239@repo.freebsd.org> <187e75c7-343f-aea6-cb59-61c77fd64023@freebsd.org> From: Marcin Wojtas Date: Sun, 14 Jan 2018 00:54:17 +0100 Message-ID: Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: mmel@freebsd.org Cc: Warner Losh , Andrew Turner , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 Jan 2018 23:54:18 -0000 Hi Michal, 2018-01-12 18:15 GMT+01:00 Michal Meloun : > > > On 12.01.2018 15:54, Warner Losh wrote: >> >> >> >> On Fri, Jan 12, 2018 at 7:52 AM, Andrew Turner > > wrote: >> >> >> >>> On 12 Jan 2018, at 14:37, Warner Losh >> > wrote: >>> >>> >>> >>> On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner >> > wrote: >>> >>> >>> >>>> On 12 Jan 2018, at 14:10, Marcin Wojtas >>> > wrote: >>>> >>>> Hi Andrew, >>>> >>>> >>>> >>>> 2018-01-12 15:01 GMT+01:00 Andrew Turner >>> >: >>>> >>>>> Author: andrew >>>>> Date: Fri Jan 12 14:01:38 2018 >>>>> New Revision: 327876 >>>>> URL: https://svnweb.freebsd.org/changeset/base/327876 >>>>> >>>>> >>>>> Log: >>>>> Workaround Spectre Variant 2 on arm64. >>>>> >>>>> We need to handle two cases: >>>>> >>>>> 1. One process attacking another process. >>>>> 2. A process attacking the kernel. >>>>> >>>>> For the first case we clear the branch predictor state on >>>>> context switch >>>>> between different processes. For the second we do this when >>>>> taking an >>>>> instruction abort on a non-userspace address. >>>>> >>>>> To clear the branch predictor state a per-CPU function >>>>> pointer has been >>>>> added. This is set by the new cpu errata code based on if >>>>> the CPU is >>>>> known to be affected. >>>>> >>>>> On Cortex-A57, A72, A73, and A75 we call into the PSCI >>>>> firmware as newer >>>>> versions of this will clear the branch predictor state for us. >>>>> >>>>> It has been reported the ThunderX is unaffected, however >>>>> the ThunderX2 is >>>>> vulnerable. The Qualcomm Falkor core is also affected. As >>>>> FreeBSD doesn't >>>>> yet run on the ThunderX2 or Falkor no workaround is >>>>> included for these CPUs. >>>> >>>> >>>> Regardless ThunderX2 / Falkor work-arounds, do I understand >>>> correctly >>>> that pure CA72 machines, such as Marvell Armada 7k/8k are >>>> immune to >>>> Variant 2 now? >>> >>> >>> It is my understanding that the A72 will be immune with this >>> patch and an updated Arm Trusted Firmware as documented in [1]. >>> >>> Andrew >>> >>> [1] >>> >>> https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firmware-Security-Advisory-TFV-6 >>> >>> >>> >>> >>> Are you also working on aarch32 mitigation? >> >> >> No. I think a similar technique could be used, however as aarch32 >> has instructions to invalidate the branch predictor these can be >> used directly. >> >> >> That's my reading as well. It looks fairly easy to do it always, but I've >> not researched it sufficiently. >> > > I work on patches for armv6/7. But for aarch32, there is, unfortunately, > much less information available about affective mitigation of variant 2. > BPIALL while switching pmap is clear and we have it in code for years > (well, BPIALL is effectively NOP for A15/A17, it must be explicitly > enabled). > But is not clear for me for which trap is branch predictor flush necessary. > As for armv7, I believe the brand new patches on top of this branch could be helpful: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=kpti Best regards, Marcin