From owner-svn-src-all@freebsd.org Sun Sep 29 02:55:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B78DEED60C; Sun, 29 Sep 2019 02:55:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46gqsn4V1mz3yyg; Sun, 29 Sep 2019 02:55:57 +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 7EB5FB61F; Sun, 29 Sep 2019 02:55:57 +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 x8T2tvZS082190; Sun, 29 Sep 2019 02:55:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T2tvMh082189; Sun, 29 Sep 2019 02:55:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909290255.x8T2tvMh082189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 29 Sep 2019 02:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352861 - stable/12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/uart X-SVN-Commit-Revision: 352861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 02:55:57 -0000 Author: mav Date: Sun Sep 29 02:55:57 2019 New Revision: 352861 URL: https://svnweb.freebsd.org/changeset/base/352861 Log: MFC r352369: Relax TX draining in ns8250_bus_transmit(). Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested. This is partial revert of r317659. Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/12/sys/dev/uart/uart_dev_ns8250.c Sat Sep 28 23:08:19 2019 (r352860) +++ stable/12/sys/dev/uart/uart_dev_ns8250.c Sun Sep 29 02:55:57 2019 (r352861) @@ -1026,13 +1026,8 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_txdatasz > 1) { - if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) - ns8250_drain(bas, UART_DRAIN_TRANSMITTER); - } else { - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - DELAY(4); - } + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); From owner-svn-src-all@freebsd.org Sun Sep 29 02:56:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5920ED71E; Sun, 29 Sep 2019 02:56:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46gqtH5Kxwz406T; Sun, 29 Sep 2019 02:56:23 +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 9A603B623; Sun, 29 Sep 2019 02:56:23 +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 x8T2uNDf082273; Sun, 29 Sep 2019 02:56:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T2uNc2082272; Sun, 29 Sep 2019 02:56:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909290256.x8T2uNc2082272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 29 Sep 2019 02:56: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: r352862 - stable/11/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/uart X-SVN-Commit-Revision: 352862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 02:56:23 -0000 Author: mav Date: Sun Sep 29 02:56:23 2019 New Revision: 352862 URL: https://svnweb.freebsd.org/changeset/base/352862 Log: MFC r352369: Relax TX draining in ns8250_bus_transmit(). Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested. This is partial revert of r317659. Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/11/sys/dev/uart/uart_dev_ns8250.c Sun Sep 29 02:55:57 2019 (r352861) +++ stable/11/sys/dev/uart/uart_dev_ns8250.c Sun Sep 29 02:56:23 2019 (r352862) @@ -988,13 +988,8 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_txdatasz > 1) { - if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) - ns8250_drain(bas, UART_DRAIN_TRANSMITTER); - } else { - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - DELAY(4); - } + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); From owner-svn-src-all@freebsd.org Sun Sep 29 03:12:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3520EEE5C; Sun, 29 Sep 2019 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grDz4JX4z41gW; Sun, 29 Sep 2019 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78C9EBA7B; Sun, 29 Sep 2019 03:12:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8T3CZdc095236; Sun, 29 Sep 2019 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3CZux095235; Sun, 29 Sep 2019 03:12:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909290312.x8T3CZux095235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 29 Sep 2019 03:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352863 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 352863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:12:35 -0000 Author: kevans Date: Sun Sep 29 03:12:35 2019 New Revision: 352863 URL: https://svnweb.freebsd.org/changeset/base/352863 Log: fdt_slicer: bump to SI_ORDER_THIRD following r347183 r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between them and the initialization of devsoftc.mtx in devinit, but missed this dependency on g_flashmap that may now lose the race against GEOM classes/g_init. There's a great comment that describes the situation that has also been updated with the new ordering of GEOM classes. Reported by: bdragon MFC after: 4 days Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Sun Sep 29 02:56:23 2019 (r352862) +++ head/sys/dev/fdt/fdt_slicer.c Sun Sep 29 03:12:35 2019 (r352863) @@ -159,12 +159,12 @@ fdt_slicer_cleanup(void) } /* - * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), + * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); -SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL); static int mod_handler(module_t mod, int type, void *data) @@ -181,6 +181,6 @@ static moduledata_t fdt_slicer_mod = { "fdt_slicer", mod_handler, NULL }; -DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); MODULE_DEPEND(fdt_slicer, g_flashmap, 0, 0, 0); MODULE_VERSION(fdt_slicer, 1); From owner-svn-src-all@freebsd.org Sun Sep 29 03:26:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B83CAEFBD7; Sun, 29 Sep 2019 03:26: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grY14SRVz42WX; Sun, 29 Sep 2019 03:26: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 7C6BCBE2F; Sun, 29 Sep 2019 03:26: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 x8T3QT2O001557; Sun, 29 Sep 2019 03:26:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3QT3w001556; Sun, 29 Sep 2019 03:26:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909290326.x8T3QT3w001556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 29 Sep 2019 03:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352864 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:26:29 -0000 Author: kevans Date: Sun Sep 29 03:26:29 2019 New Revision: 352864 URL: https://svnweb.freebsd.org/changeset/base/352864 Log: MFD_*: swap ordering This API is still young enough that I would expect no one to be dependant on this yet... Swap the ordering while it's young to match Linux values to potentially ease implementation of linuxolator syscall, being able to reuse existing constants. Modified: head/sys/sys/mman.h Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Sun Sep 29 03:12:35 2019 (r352863) +++ head/sys/sys/mman.h Sun Sep 29 03:26:29 2019 (r352864) @@ -193,8 +193,8 @@ /* * Flags for memfd_create(). */ -#define MFD_ALLOW_SEALING 0x00000001 -#define MFD_CLOEXEC 0x00000002 +#define MFD_CLOEXEC 0x00000001 +#define MFD_ALLOW_SEALING 0x00000002 /* UNSUPPORTED */ #define MFD_HUGETLB 0x00000004 From owner-svn-src-all@freebsd.org Sun Sep 29 03:36:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF016F04F3; Sun, 29 Sep 2019 03:36: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grn05YKyz43BT; Sun, 29 Sep 2019 03:36: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 A35B6C03A; Sun, 29 Sep 2019 03:36: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 x8T3aq8Y007274; Sun, 29 Sep 2019 03:36:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3apkI007271; Sun, 29 Sep 2019 03:36:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909290336.x8T3apkI007271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 29 Sep 2019 03:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352865 - in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 352865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:36:53 -0000 Author: cy Date: Sun Sep 29 03:36:50 2019 New Revision: 352865 URL: https://svnweb.freebsd.org/changeset/base/352865 Log: MFC r352304, r352540 r352304: No longer mlock() ntpd pages by default in memory thus allowing its pages to page as necessary. To restore historic BSD behaviour add the following to ntp.conf: rlimit memlock 32 Discussed on: freebsd-current@ between Sept 6-9, 2019 Reported by: Users using ASLR with stack gap != 0 Reviewed by: ian, kib, rgrimes (all previous versions) Differential Revision: https://reviews.freebsd.org/D21581 r352540: Follow up on r352304 which disabled default mlockall() at startup. Unfortunately though the original tarball supports this in ./configure (for Linux), to fully support disabling of mlockall() by default requires a little extra help otherwise the following is logged in syslog: Cannot set RLIMIT_MEMLOCK: Operation not permitted Modified: stable/12/UPDATING stable/12/contrib/ntp/ntpd/ntpd.c stable/12/usr.sbin/ntp/config.h stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/UPDATING stable/11/contrib/ntp/ntpd/ntpd.c stable/11/etc/ntp.conf stable/11/usr.sbin/ntp/config.h Directory Properties: stable/11/ (props changed) Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/UPDATING Sun Sep 29 03:36:50 2019 (r352865) @@ -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. +20190913: + ntpd no longer by default locks its pages in memory, allowing them + to be paged out by the kernel. Use rlimit memlock to restore + historic BSD behaviour. For example, add "rlimit memlock 32" + to ntp.conf to lock up to 32 MB of ntpd address space in memory. + 20190914: The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls and the "-o sync_unmount" and "-o init_backgrounded" mount options have Modified: stable/12/contrib/ntp/ntpd/ntpd.c ============================================================================== --- stable/12/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:36:50 2019 (r352865) @@ -999,7 +999,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Modified: stable/12/usr.sbin/ntp/config.h ============================================================================== --- stable/12/usr.sbin/ntp/config.h Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/usr.sbin/ntp/config.h Sun Sep 29 03:36:50 2019 (r352865) @@ -287,7 +287,7 @@ #define DEFAULT_HZ 100 /* Default number of megabytes for RLIMIT_MEMLOCK */ -#define DFLT_RLIMIT_MEMLOCK 32 +#define DFLT_RLIMIT_MEMLOCK -1 /* Default number of 4k pages for RLIMIT_STACK */ #define DFLT_RLIMIT_STACK 50 Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/ntp.conf Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/usr.sbin/ntp/ntpd/ntp.conf Sun Sep 29 03:36:50 2019 (r352865) @@ -102,3 +102,11 @@ restrict ::1 # Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" + +# Specify the number of megabytes of memory that should be allocated and +# locked. -1 (default) means "do not lock the process into memory". +# 0 means "lock whatever memory the process wants into memory". Any other +# number means to lock up to that number of megabytes into memory. +# 0 may result in a segfault when ASLR with stack gap randomization +# is enabled. +#rlimit memlock 32 From owner-svn-src-all@freebsd.org Sun Sep 29 03:36:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9D95F04DE; Sun, 29 Sep 2019 03:36:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grmz5wccz43BJ; Sun, 29 Sep 2019 03:36:51 +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 AEB38C039; Sun, 29 Sep 2019 03:36: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 x8T3apRt007265; Sun, 29 Sep 2019 03:36:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3ao4G007261; Sun, 29 Sep 2019 03:36:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909290336.x8T3ao4G007261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 29 Sep 2019 03:36: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: r352865 - in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 352865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:36:52 -0000 Author: cy Date: Sun Sep 29 03:36:50 2019 New Revision: 352865 URL: https://svnweb.freebsd.org/changeset/base/352865 Log: MFC r352304, r352540 r352304: No longer mlock() ntpd pages by default in memory thus allowing its pages to page as necessary. To restore historic BSD behaviour add the following to ntp.conf: rlimit memlock 32 Discussed on: freebsd-current@ between Sept 6-9, 2019 Reported by: Users using ASLR with stack gap != 0 Reviewed by: ian, kib, rgrimes (all previous versions) Differential Revision: https://reviews.freebsd.org/D21581 r352540: Follow up on r352304 which disabled default mlockall() at startup. Unfortunately though the original tarball supports this in ./configure (for Linux), to fully support disabling of mlockall() by default requires a little extra help otherwise the following is logged in syslog: Cannot set RLIMIT_MEMLOCK: Operation not permitted Modified: stable/11/UPDATING stable/11/contrib/ntp/ntpd/ntpd.c stable/11/etc/ntp.conf stable/11/usr.sbin/ntp/config.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/UPDATING stable/12/contrib/ntp/ntpd/ntpd.c stable/12/usr.sbin/ntp/config.h stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/UPDATING Sun Sep 29 03:36:50 2019 (r352865) @@ -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. +20190913: + ntpd no longer by default locks its pages in memory, allowing them + to be paged out by the kernel. Use rlimit memlock to restore + historic BSD behaviour. For example, add "rlimit memlock 32" + to ntp.conf to lock up to 32 MB of ntpd address space in memory. + 20190723: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 8.0.1. Please see the 20141231 entry below for Modified: stable/11/contrib/ntp/ntpd/ntpd.c ============================================================================== --- stable/11/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:36:50 2019 (r352865) @@ -991,7 +991,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Modified: stable/11/etc/ntp.conf ============================================================================== --- stable/11/etc/ntp.conf Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/etc/ntp.conf Sun Sep 29 03:36:50 2019 (r352865) @@ -102,3 +102,11 @@ restrict ::1 # Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" + +# Specify the number of megabytes of memory that should be allocated and +# locked. -1 (default) means "do not lock the process into memory". +# 0 means "lock whatever memory the process wants into memory". Any other +# number means to lock up to that number of megabytes into memory. +# 0 may result in a segfault when ASLR with stack gap randomization +# is enabled. +#rlimit memlock 32 Modified: stable/11/usr.sbin/ntp/config.h ============================================================================== --- stable/11/usr.sbin/ntp/config.h Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/usr.sbin/ntp/config.h Sun Sep 29 03:36:50 2019 (r352865) @@ -287,7 +287,7 @@ #define DEFAULT_HZ 100 /* Default number of megabytes for RLIMIT_MEMLOCK */ -#define DFLT_RLIMIT_MEMLOCK 32 +#define DFLT_RLIMIT_MEMLOCK -1 /* Default number of 4k pages for RLIMIT_STACK */ #define DFLT_RLIMIT_STACK 50 From owner-svn-src-all@freebsd.org Sun Sep 29 03:41:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0D43F0714; Sun, 29 Sep 2019 03:41:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grt43nmvz43WG; Sun, 29 Sep 2019 03:41:16 +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 6576DC086; Sun, 29 Sep 2019 03:41:16 +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 x8T3fGFK011745; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3fGN4011744; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909290341.x8T3fGN4011744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 29 Sep 2019 03:41: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: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 352866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:41:16 -0000 Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0xffff as bad. Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:36:50 2019 (r352865) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:41:15 2019 (r352866) @@ -6730,8 +6730,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0xffff) + hdrsum = 0x0000; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); From owner-svn-src-all@freebsd.org Sun Sep 29 03:41:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50E02F0728; Sun, 29 Sep 2019 03:41:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grt51K3wz43WK; Sun, 29 Sep 2019 03:41:17 +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 10272C089; Sun, 29 Sep 2019 03:41:17 +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 x8T3fGi8011757; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3fGUh011756; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909290341.x8T3fGUh011756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 29 Sep 2019 03:41:16 +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: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/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 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 352866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:41:17 -0000 Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0xffff as bad. Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:36:50 2019 (r352865) +++ stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:41:15 2019 (r352866) @@ -6695,8 +6695,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0xffff) + hdrsum = 0x0000; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); From owner-svn-src-all@freebsd.org Sun Sep 29 03:41:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEE23F0718; Sun, 29 Sep 2019 03:41:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46grt465KGz43WJ; Sun, 29 Sep 2019 03:41:16 +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 B5C22C088; Sun, 29 Sep 2019 03:41:16 +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 x8T3fGDn011751; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T3fGo5011750; Sun, 29 Sep 2019 03:41:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909290341.x8T3fGo5011750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 29 Sep 2019 03:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 352866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 03:41:17 -0000 Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0xffff as bad. Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:36:50 2019 (r352865) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Sep 29 03:41:15 2019 (r352866) @@ -6730,8 +6730,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0xffff) + hdrsum = 0x0000; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); From owner-svn-src-all@freebsd.org Sun Sep 29 06:12:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A69CF511B; Sun, 29 Sep 2019 06:12: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46gwDz6RWsz4B1s; Sun, 29 Sep 2019 06:12: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 C18B8DD63; Sun, 29 Sep 2019 06:12: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 x8T6CpA6001134; Sun, 29 Sep 2019 06:12:51 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8T6CpIs001133; Sun, 29 Sep 2019 06:12:51 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201909290612.x8T6CpIs001133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sun, 29 Sep 2019 06:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352867 - stable/12/lib/libkvm X-SVN-Group: stable-12 X-SVN-Commit-Author: karels X-SVN-Commit-Paths: stable/12/lib/libkvm X-SVN-Commit-Revision: 352867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 06:12:52 -0000 Author: karels Date: Sun Sep 29 06:12:51 2019 New Revision: 352867 URL: https://svnweb.freebsd.org/changeset/base/352867 Log: MFC r352597: Add support for ps -H on corefiles in libkvm Add support for kernel threads in kvm_getprocs() and the underlying kvm_proclist() in libkvm when fetching from a kernel core file. This has been missing/needed for several releases, when kernel threads became normal threads. The loop over the processes now contains a sub-loop for threads, which iterates beyond the first thread only when threads are requested. Also set some fields such as tid that were previously uninitialized. Sponsored by: Forcepoint LLC Modified: stable/12/lib/libkvm/kvm_proc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libkvm/kvm_proc.c ============================================================================== --- stable/12/lib/libkvm/kvm_proc.c Sun Sep 29 03:41:15 2019 (r352866) +++ stable/12/lib/libkvm/kvm_proc.c Sun Sep 29 06:12:51 2019 (r352867) @@ -67,6 +67,7 @@ __SCCSID("@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"); #include #include #include +#include #include #include #include @@ -130,13 +131,16 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc struct proc pproc; struct sysentvec sysent; char svname[KI_EMULNAMELEN]; + struct thread *td = NULL; + bool first_thread; kp = &kinfo_proc; kp->ki_structsize = sizeof(kinfo_proc); /* - * Loop on the processes. this is completely broken because we need to be - * able to loop on the threads and merge the ones that are the same process some how. + * Loop on the processes, then threads within the process if requested. */ + if (what == KERN_PROC_ALL) + what |= KERN_PROC_INC_THREAD; for (; cnt < maxcnt && p != NULL; p = LIST_NEXT(&proc, p_list)) { memset(kp, 0, sizeof *kp); if (KREAD(kd, (u_long)p, &proc)) { @@ -145,15 +149,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc } if (proc.p_state == PRS_NEW) continue; - if (proc.p_state != PRS_ZOMBIE) { - if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), - &mtd)) { - _kvm_err(kd, kd->program, - "can't read thread at %p", - TAILQ_FIRST(&proc.p_threads)); - return (-1); - } - } if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { kp->ki_ruid = ucred.cr_ruid; kp->ki_svuid = ucred.cr_svuid; @@ -222,6 +217,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_addr = 0; /* XXX uarea */ /* kp->ki_kstack = proc.p_thread.td_kstack; XXXKSE */ kp->ki_args = proc.p_args; + kp->ki_numthreads = proc.p_numthreads; kp->ki_tracep = proc.p_tracevp; kp->ki_textvp = proc.p_textvp; kp->ki_fd = proc.p_fd; @@ -285,9 +281,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_sid = sess.s_sid; (void)memcpy(kp->ki_login, sess.s_login, sizeof(kp->ki_login)); - kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; - if (sess.s_leader == p) - kp->ki_kiflag |= KI_SLEADER; if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) { if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) { _kvm_err(kd, kd->program, @@ -330,9 +323,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc nopgrp: kp->ki_tdev = NODEV; } - if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) - (void)kvm_read(kd, (u_long)mtd.td_wmesg, - kp->ki_wmesg, WMESGLEN); (void)kvm_read(kd, (u_long)proc.p_vmspace, (char *)&vmspace, sizeof(vmspace)); @@ -374,85 +364,127 @@ nopgrp: sizeof(svname)); if (svname[0] != 0) strlcpy(kp->ki_emul, svname, KI_EMULNAMELEN); - if ((proc.p_state != PRS_ZOMBIE) && - (mtd.td_blocked != 0)) { - kp->ki_kiflag |= KI_LOCKBLOCK; - if (mtd.td_lockname) - (void)kvm_read(kd, - (u_long)mtd.td_lockname, - kp->ki_lockname, LOCKNAMELEN); - kp->ki_lockname[LOCKNAMELEN] = 0; - } kp->ki_runtime = cputick2usec(proc.p_rux.rux_runtime); kp->ki_pid = proc.p_pid; - kp->ki_siglist = proc.p_siglist; - SIGSETOR(kp->ki_siglist, mtd.td_siglist); - kp->ki_sigmask = mtd.td_sigmask; kp->ki_xstat = KW_EXITCODE(proc.p_xexit, proc.p_xsig); kp->ki_acflag = proc.p_acflag; kp->ki_lock = proc.p_lock; - if (proc.p_state != PRS_ZOMBIE) { - kp->ki_swtime = (ticks - proc.p_swtick) / hz; - kp->ki_flag = proc.p_flag; - kp->ki_sflag = 0; - kp->ki_nice = proc.p_nice; - kp->ki_traceflag = proc.p_traceflag; - if (proc.p_state == PRS_NORMAL) { - if (TD_ON_RUNQ(&mtd) || - TD_CAN_RUN(&mtd) || - TD_IS_RUNNING(&mtd)) { - kp->ki_stat = SRUN; - } else if (mtd.td_state == - TDS_INHIBITED) { - if (P_SHOULDSTOP(&proc)) { - kp->ki_stat = SSTOP; - } else if ( - TD_IS_SLEEPING(&mtd)) { - kp->ki_stat = SSLEEP; - } else if (TD_ON_LOCK(&mtd)) { - kp->ki_stat = SLOCK; - } else { - kp->ki_stat = SWAIT; - } + kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ + + /* Per-thread items; iterate as appropriate. */ + td = TAILQ_FIRST(&proc.p_threads); + for (first_thread = true; cnt < maxcnt && td != NULL && + (first_thread || (what & KERN_PROC_INC_THREAD)); + first_thread = false) { + if (proc.p_state != PRS_ZOMBIE) { + if (KREAD(kd, (u_long)td, &mtd)) { + _kvm_err(kd, kd->program, + "can't read thread at %p", td); + return (-1); } + if (what & KERN_PROC_INC_THREAD) + td = TAILQ_NEXT(&mtd, td_plist); + } else + td = NULL; + if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) + (void)kvm_read(kd, (u_long)mtd.td_wmesg, + kp->ki_wmesg, WMESGLEN); + else + memset(kp->ki_wmesg, 0, WMESGLEN); + if (proc.p_pgrp == NULL) { + kp->ki_kiflag = 0; } else { - kp->ki_stat = SIDL; + kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; + if (sess.s_leader == p) + kp->ki_kiflag |= KI_SLEADER; } - /* Stuff from the thread */ - kp->ki_pri.pri_level = mtd.td_priority; - kp->ki_pri.pri_native = mtd.td_base_pri; - kp->ki_lastcpu = mtd.td_lastcpu; - kp->ki_wchan = mtd.td_wchan; - kp->ki_oncpu = mtd.td_oncpu; - if (mtd.td_name[0] != '\0') - strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); - kp->ki_pctcpu = 0; - kp->ki_rqindex = 0; + if ((proc.p_state != PRS_ZOMBIE) && + (mtd.td_blocked != 0)) { + kp->ki_kiflag |= KI_LOCKBLOCK; + if (mtd.td_lockname) + (void)kvm_read(kd, + (u_long)mtd.td_lockname, + kp->ki_lockname, LOCKNAMELEN); + else + memset(kp->ki_lockname, 0, + LOCKNAMELEN); + kp->ki_lockname[LOCKNAMELEN] = 0; + } else + kp->ki_kiflag &= ~KI_LOCKBLOCK; + kp->ki_siglist = proc.p_siglist; + if (proc.p_state != PRS_ZOMBIE) { + SIGSETOR(kp->ki_siglist, mtd.td_siglist); + kp->ki_sigmask = mtd.td_sigmask; + kp->ki_swtime = (ticks - proc.p_swtick) / hz; + kp->ki_flag = proc.p_flag; + kp->ki_sflag = 0; + kp->ki_nice = proc.p_nice; + kp->ki_traceflag = proc.p_traceflag; + if (proc.p_state == PRS_NORMAL) { + if (TD_ON_RUNQ(&mtd) || + TD_CAN_RUN(&mtd) || + TD_IS_RUNNING(&mtd)) { + kp->ki_stat = SRUN; + } else if (mtd.td_state == + TDS_INHIBITED) { + if (P_SHOULDSTOP(&proc)) { + kp->ki_stat = SSTOP; + } else if ( + TD_IS_SLEEPING(&mtd)) { + kp->ki_stat = SSLEEP; + } else if (TD_ON_LOCK(&mtd)) { + kp->ki_stat = SLOCK; + } else { + kp->ki_stat = SWAIT; + } + } + } else { + kp->ki_stat = SIDL; + } + /* Stuff from the thread */ + kp->ki_pri.pri_level = mtd.td_priority; + kp->ki_pri.pri_native = mtd.td_base_pri; + kp->ki_lastcpu = mtd.td_lastcpu; + kp->ki_wchan = mtd.td_wchan; + kp->ki_oncpu = mtd.td_oncpu; + if (mtd.td_name[0] != '\0') + strlcpy(kp->ki_tdname, mtd.td_name, + sizeof(kp->ki_tdname)); + else + memset(kp->ki_tdname, 0, + sizeof(kp->ki_tdname)); + kp->ki_pctcpu = 0; + kp->ki_rqindex = 0; - /* - * Note: legacy fields; wraps at NO_CPU_OLD or the - * old max CPU value as appropriate - */ - if (mtd.td_lastcpu == NOCPU) - kp->ki_lastcpu_old = NOCPU_OLD; - else if (mtd.td_lastcpu > MAXCPU_OLD) - kp->ki_lastcpu_old = MAXCPU_OLD; - else - kp->ki_lastcpu_old = mtd.td_lastcpu; + /* + * Note: legacy fields; wraps at NO_CPU_OLD + * or the old max CPU value as appropriate + */ + if (mtd.td_lastcpu == NOCPU) + kp->ki_lastcpu_old = NOCPU_OLD; + else if (mtd.td_lastcpu > MAXCPU_OLD) + kp->ki_lastcpu_old = MAXCPU_OLD; + else + kp->ki_lastcpu_old = mtd.td_lastcpu; - if (mtd.td_oncpu == NOCPU) - kp->ki_oncpu_old = NOCPU_OLD; - else if (mtd.td_oncpu > MAXCPU_OLD) - kp->ki_oncpu_old = MAXCPU_OLD; - else - kp->ki_oncpu_old = mtd.td_oncpu; - } else { - kp->ki_stat = SZOMB; + if (mtd.td_oncpu == NOCPU) + kp->ki_oncpu_old = NOCPU_OLD; + else if (mtd.td_oncpu > MAXCPU_OLD) + kp->ki_oncpu_old = MAXCPU_OLD; + else + kp->ki_oncpu_old = mtd.td_oncpu; + kp->ki_tid = mtd.td_tid; + } else { + memset(&kp->ki_sigmask, 0, + sizeof(kp->ki_sigmask)); + kp->ki_stat = SZOMB; + kp->ki_tid = 0; + } + + bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); + ++bp; + ++cnt; } - kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ - bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); - ++bp; - ++cnt; } return (cnt); } @@ -466,7 +498,7 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a u_long a_zombproc, int maxcnt) { struct kinfo_proc *bp = kd->procbase; - int acnt, zcnt; + int acnt, zcnt = 0; struct proc *p; if (KREAD(kd, a_allproc, &p)) { @@ -477,13 +509,15 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a if (acnt < 0) return (acnt); - if (KREAD(kd, a_zombproc, &p)) { - _kvm_err(kd, kd->program, "cannot read zombproc"); - return (-1); + if (a_zombproc != 0) { + if (KREAD(kd, a_zombproc, &p)) { + _kvm_err(kd, kd->program, "cannot read zombproc"); + return (-1); + } + zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); + if (zcnt < 0) + zcnt = 0; } - zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); - if (zcnt < 0) - zcnt = 0; return (acnt + zcnt); } @@ -568,16 +602,19 @@ kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt) liveout: nprocs = size == 0 ? 0 : size / kd->procbase->ki_structsize; } else { - struct nlist nl[7], *p; + struct nlist nl[6], *p; + struct nlist nlz[2]; nl[0].n_name = "_nprocs"; nl[1].n_name = "_allproc"; - nl[2].n_name = "_zombproc"; - nl[3].n_name = "_ticks"; - nl[4].n_name = "_hz"; - nl[5].n_name = "_cpu_tick_frequency"; - nl[6].n_name = 0; + nl[2].n_name = "_ticks"; + nl[3].n_name = "_hz"; + nl[4].n_name = "_cpu_tick_frequency"; + nl[5].n_name = 0; + nlz[0].n_name = "_zombproc"; + nlz[1].n_name = 0; + if (!kd->arch->ka_native(kd)) { _kvm_err(kd, kd->program, "cannot read procs from non-native core"); @@ -591,19 +628,27 @@ liveout: "%s: no such symbol", p->n_name); return (0); } + (void) kvm_nlist(kd, nlz); /* attempt to get zombproc */ if (KREAD(kd, nl[0].n_value, &nprocs)) { _kvm_err(kd, kd->program, "can't read nprocs"); return (0); } - if (KREAD(kd, nl[3].n_value, &ticks)) { + /* + * If returning all threads, we don't know how many that + * might be. Presume that there are, on average, no more + * than 10 threads per process. + */ + if (op == KERN_PROC_ALL || (op & KERN_PROC_INC_THREAD)) + nprocs *= 10; /* XXX */ + if (KREAD(kd, nl[2].n_value, &ticks)) { _kvm_err(kd, kd->program, "can't read ticks"); return (0); } - if (KREAD(kd, nl[4].n_value, &hz)) { + if (KREAD(kd, nl[3].n_value, &hz)) { _kvm_err(kd, kd->program, "can't read hz"); return (0); } - if (KREAD(kd, nl[5].n_value, &cpu_tick_frequency)) { + if (KREAD(kd, nl[4].n_value, &cpu_tick_frequency)) { _kvm_err(kd, kd->program, "can't read cpu_tick_frequency"); return (0); @@ -614,7 +659,7 @@ liveout: return (0); nprocs = kvm_deadprocs(kd, op, arg, nl[1].n_value, - nl[2].n_value, nprocs); + nlz[0].n_value, nprocs); if (nprocs <= 0) { _kvm_freeprocs(kd); nprocs = 0; From owner-svn-src-all@freebsd.org Sun Sep 29 09:25:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B297DFA9FE; Sun, 29 Sep 2019 09:25:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46h0WZ35Wzz4L7T; Sun, 29 Sep 2019 09:25:46 +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 x8T9PWdt041380 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 29 Sep 2019 12:25:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8T9PWdt041380 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8T9PWti041378; Sun, 29 Sep 2019 12:25:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 Sep 2019 12:25:32 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352846 - head/lib/libc/sys Message-ID: <20190929092532.GO44691@kib.kiev.ua> References: <201909281715.x8SHFmZR034892@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909281715.x8SHFmZR034892@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46h0WZ35Wzz4L7T X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 09:25:46 -0000 On Sat, Sep 28, 2019 at 05:15:48PM +0000, Warner Losh wrote: > Author: imp > Date: Sat Sep 28 17:15:48 2019 > New Revision: 352846 > URL: https://svnweb.freebsd.org/changeset/base/352846 > > Log: > Revert the mode_t -> int changes and add a warning in the BUGS section instead. > > While FreeBSD's implementation of these expect an int inside of libc, that's an > implementation detail that we can hide from the user as it's the natural > promotion of the current mode_t type and before it is used in the kernel, it's > converted back to the narrower type that's the current definition of mode_t. As > such, documenting int is at best confusing and at worst misleading. Instead add > a note that these args are variadic and as such calling conventions may differ > from non-variadic arguments. > > Modified: > head/lib/libc/sys/mq_open.2 > head/lib/libc/sys/open.2 > > Modified: head/lib/libc/sys/mq_open.2 > ============================================================================== > --- head/lib/libc/sys/mq_open.2 Sat Sep 28 14:20:28 2019 (r352845) > +++ head/lib/libc/sys/mq_open.2 Sat Sep 28 17:15:48 2019 (r352846) > @@ -37,7 +37,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 15, 2014 > +.Dd September 28, 2019 > .Dt MQ_OPEN 2 > .Os > .Sh NAME > @@ -133,7 +133,7 @@ Create a message queue. > It requires two additional arguments: > .Fa mode , > which is of type > -.Vt int , > +.Vt mode_t , > and > .Fa attr , > which is a pointer to an > @@ -317,6 +317,13 @@ This implementation places strict requirements on the > it must begin with a slash > .Pq Ql / > and contain no other slash characters. > +.Pp > +The > +.Fa mode > +and > +.Fa attr > +arguments are variadic and may result in different calling conventions > +than might otherwise be expected. > .Sh COPYRIGHT > Portions of this text are reprinted and reproduced in electronic form > from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- > > Modified: head/lib/libc/sys/open.2 > ============================================================================== > --- head/lib/libc/sys/open.2 Sat Sep 28 14:20:28 2019 (r352845) > +++ head/lib/libc/sys/open.2 Sat Sep 28 17:15:48 2019 (r352846) > @@ -28,7 +28,7 @@ > .\" @(#)open.2 8.2 (Berkeley) 11/16/93 > .\" $FreeBSD$ > .\" > -.Dd September 17, 2019 > +.Dd September 28, 2019 > .Dt OPEN 2 > .Os > .Sh NAME > @@ -61,7 +61,7 @@ In this case > and > .Fn openat > require an additional argument > -.Fa "int mode" , > +.Fa "mode_t mode" , > and the file is created with mode > .Fa mode > as described in > @@ -615,3 +615,8 @@ permits searches. > The present implementation of the > .Fa openat > checks the current permissions of directory instead. > +.Pp > +The > +.Fa mode > +argument is variadic and may result in different calling conventions > +than might otherwise be expected. This note is also very confusing. Assume that somebody knows calling conventions and then see this note. Now she would be equally misdirected because it is completely not clear what different conventions are mentioned there, esp. because there are no. Also, as I noted before, this note in whatever form does not belongs to BUSS section. From owner-svn-src-all@freebsd.org Sun Sep 29 10:45:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB534FCF59; Sun, 29 Sep 2019 10:45:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46h2HG420Mz4RnQ; Sun, 29 Sep 2019 10:45:14 +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 6D7B218EC9; Sun, 29 Sep 2019 10:45:14 +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 x8TAjEdf066799; Sun, 29 Sep 2019 10:45:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TAjD6J066797; Sun, 29 Sep 2019 10:45:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909291045.x8TAjD6J066797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 29 Sep 2019 10:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352868 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 352868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 10:45:14 -0000 Author: tuexen Date: Sun Sep 29 10:45:13 2019 New Revision: 352868 URL: https://svnweb.freebsd.org/changeset/base/352868 Log: RFC 7112 requires a host to put the complete IP header chain including the TCP header in the first IP packet. Enforce this in tcp_output(). In addition make sure that at least one byte payload fits in the TCP segement to allow making progress. Without this check, a kernel with INVARIANTS will panic. This issue was found by running an instance of syzkaller. Reviewed by: jtl@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21665 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun Sep 29 06:12:51 2019 (r352867) +++ head/sys/netinet/tcp_output.c Sun Sep 29 10:45:13 2019 (r352868) @@ -941,6 +941,20 @@ send: if (tp->t_flags & TF_NEEDFIN) sendalot = 1; } else { + if (optlen + ipoptlen >= tp->t_maxseg) { + /* + * Since we don't have enough space to put + * the IP header chain and the TCP header in + * one packet as required by RFC 7112, don't + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. + */ + SOCKBUF_UNLOCK(&so->so_snd); + error = EMSGSIZE; + sack_rxmit = 0; + goto out; + } len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; if (dont_sendalot) Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Sun Sep 29 06:12:51 2019 (r352867) +++ head/sys/netinet/tcp_stacks/bbr.c Sun Sep 29 10:45:13 2019 (r352868) @@ -13343,12 +13343,14 @@ send: } } else { /* Not doing TSO */ - if (optlen + ipoptlen > tp->t_maxseg) { + if (optlen + ipoptlen >= tp->t_maxseg) { /* * Since we don't have enough space to put * the IP header chain and the TCP header in * one packet as required by RFC 7112, don't - * send it. + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. */ SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sun Sep 29 06:12:51 2019 (r352867) +++ head/sys/netinet/tcp_stacks/rack.c Sun Sep 29 10:45:13 2019 (r352868) @@ -9200,12 +9200,14 @@ send: sendalot = 1; } else { - if (optlen + ipoptlen > tp->t_maxseg) { + if (optlen + ipoptlen >= tp->t_maxseg) { /* * Since we don't have enough space to put * the IP header chain and the TCP header in * one packet as required by RFC 7112, don't - * send it. + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. */ SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; From owner-svn-src-all@freebsd.org Sun Sep 29 11:33:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7239DFDC35; Sun, 29 Sep 2019 11:33:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 46h3LM5Hp4z4TNw; Sun, 29 Sep 2019 11:32:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 26EA443E0E9; Sun, 29 Sep 2019 21:32:54 +1000 (AEST) Date: Sun, 29 Sep 2019 21:32:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352846 - head/lib/libc/sys In-Reply-To: <20190929092532.GO44691@kib.kiev.ua> Message-ID: <20190929204450.X1042@besplex.bde.org> References: <201909281715.x8SHFmZR034892@repo.freebsd.org> <20190929092532.GO44691@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Fu6Zn4o2tIin4RjUpeQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46h3LM5Hp4z4TNw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.246 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-2.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-7.02), ipnet: 211.28.0.0/14(-3.28), asn: 4804(-2.42), country: AU(0.01)]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[246.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[246.132.29.211.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 11:33:01 -0000 On Sun, 29 Sep 2019, Konstantin Belousov wrote: > On Sat, Sep 28, 2019 at 05:15:48PM +0000, Warner Losh wrote: >> Author: imp >> Date: Sat Sep 28 17:15:48 2019 >> New Revision: 352846 >> URL: https://svnweb.freebsd.org/changeset/base/352846 >> >> Log: >> Revert the mode_t -> int changes and add a warning in the BUGS section instead. >> >> While FreeBSD's implementation of these expect an int inside of libc, that's an >> implementation detail that we can hide from the user as it's the natural >> promotion of the current mode_t type and before it is used in the kernel, it's >> converted back to the narrower type that's the current definition of mode_t. As >> such, documenting int is at best confusing and at worst misleading. Instead add >> a note that these args are variadic and as such calling conventions may differ >> from non-variadic arguments. >> >> Modified: >> head/lib/libc/sys/mq_open.2 >> head/lib/libc/sys/open.2 >> >> Modified: head/lib/libc/sys/mq_open.2 >> ============================================================================== >> --- head/lib/libc/sys/mq_open.2 Sat Sep 28 14:20:28 2019 (r352845) >> +++ head/lib/libc/sys/mq_open.2 Sat Sep 28 17:15:48 2019 (r352846) >> @@ -37,7 +37,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd September 15, 2014 >> +.Dd September 28, 2019 >> .Dt MQ_OPEN 2 >> .Os >> .Sh NAME >> @@ -133,7 +133,7 @@ Create a message queue. >> It requires two additional arguments: >> .Fa mode , >> which is of type >> -.Vt int , >> +.Vt mode_t , >> and >> .Fa attr , >> which is a pointer to an >> @@ -317,6 +317,13 @@ This implementation places strict requirements on the >> it must begin with a slash >> .Pq Ql / >> and contain no other slash characters. >> +.Pp >> +The >> +.Fa mode >> +and >> +.Fa attr >> +arguments are variadic and may result in different calling conventions >> +than might otherwise be expected. >> .Sh COPYRIGHT >> Portions of this text are reprinted and reproduced in electronic form >> from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- >> >> Modified: head/lib/libc/sys/open.2 >> ============================================================================== >> --- head/lib/libc/sys/open.2 Sat Sep 28 14:20:28 2019 (r352845) >> +++ head/lib/libc/sys/open.2 Sat Sep 28 17:15:48 2019 (r352846) >> @@ -28,7 +28,7 @@ >> .\" @(#)open.2 8.2 (Berkeley) 11/16/93 >> .\" $FreeBSD$ >> .\" >> -.Dd September 17, 2019 >> +.Dd September 28, 2019 >> .Dt OPEN 2 >> .Os >> .Sh NAME >> @@ -61,7 +61,7 @@ In this case >> and >> .Fn openat >> require an additional argument >> -.Fa "int mode" , >> +.Fa "mode_t mode" , >> and the file is created with mode >> .Fa mode >> as described in >> @@ -615,3 +615,8 @@ permits searches. >> The present implementation of the >> .Fa openat >> checks the current permissions of directory instead. >> +.Pp >> +The >> +.Fa mode >> +argument is variadic and may result in different calling conventions >> +than might otherwise be expected. > This note is also very confusing. > > Assume that somebody knows calling conventions and then see this note. > Now she would be equally misdirected because it is completely not clear > what different conventions are mentioned there, esp. because there are no. > > Also, as I noted before, this note in whatever form does not belongs to > BUSS section. I was going to say "Indeed. The man page already gives the type mode_t for the mode, so the fix should be to remind the reader that since open() is variadic, the caller MUST supply an arg whose type is the default promotion of mode_t [and this is most easily done by starting with or casting to an arg whose type is precisely mode_t]. POSIX gets this wronger. It says "the file mode shall be set to the value of the argument following the oflag argument taken as type mode_t". It never defines the actual type of this arg. Since open() is variadic, the actual type is the default promotion of whatever the caller passes. Nothing forbids the caller passing a long long or even a long double, or even any type with any encoding. Literally, this requires the implementation to "take" the arg as a mode_t using an unspecified conversion method after using magic beyond va_arg() to determine the type and value of the arg. POSIX give an example where the arg type is precisely mode_t, but this is just an example of one arg type that works. All this was in the 2001 version of POSIX and remains unfixed in the 2018 version. So the man page was wrong after all. It was not bug for bug compatible with POSIX, since it says that the additional argument is "mode_t mode" but POSIX allows any type that can be "taken" as a mode_t. This shouldn't change the fix. The BUGS section is not the place to document bugs in POSIX. Bruce From owner-svn-src-all@freebsd.org Sun Sep 29 15:17:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 915C21231C1; Sun, 29 Sep 2019 15:17:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46h8Kz3JC1z4d7V; Sun, 29 Sep 2019 15:17:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 553361BF27; Sun, 29 Sep 2019 15:17:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8TFHxjj026243; Sun, 29 Sep 2019 15:17:59 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TFHw7L026241; Sun, 29 Sep 2019 15:17:58 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201909291517.x8TFHw7L026241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 29 Sep 2019 15:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352869 - in head: contrib/netbsd-tests/lib/libc/sys tests/sys/posixshm tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys tests/sys/posixshm tests/sys/vm X-SVN-Commit-Revision: 352869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 15:17:59 -0000 Author: jilles Date: Sun Sep 29 15:17:58 2019 New Revision: 352869 URL: https://svnweb.freebsd.org/changeset/base/352869 Log: Adjust tests after page fault changes in r352807 Commit r352807 fixed various signal numbers and codes from page faults; adjust the tests so they expect the fixes to be present. PR: 211924 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c head/tests/sys/posixshm/posixshm_test.c head/tests/sys/vm/page_fault_signal.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Sun Sep 29 10:45:13 2019 (r352868) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Sun Sep 29 15:17:58 2019 (r352869) @@ -480,10 +480,6 @@ ATF_TC_BODY(mmap_truncate_signal, tc) int fd, sta; pid_t pid; -#ifdef __FreeBSD__ - atf_tc_expect_fail("testcase fails with SIGSEGV on FreeBSD; bug # 211924"); -#endif - fd = open(path, O_RDWR | O_CREAT, 0700); if (fd < 0) Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Sun Sep 29 10:45:13 2019 (r352868) +++ head/tests/sys/posixshm/posixshm_test.c Sun Sep 29 15:17:58 2019 (r352869) @@ -697,7 +697,7 @@ ATF_TC_BODY(object_resize, tc) /* * The previous ftruncate(2) shrunk the backing object * so that this address is no longer valid, so reading - * from it should trigger a SIGSEGV. + * from it should trigger a SIGBUS. */ c = page[pagesize]; fprintf(stderr, "child: page 1: '%c'\n", c); @@ -707,7 +707,7 @@ ATF_TC_BODY(object_resize, tc) if (wait(&status) < 0) atf_tc_fail("wait failed; errno=%d", errno); - if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGSEGV) + if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGBUS) atf_tc_fail("child terminated with status %x", status); /* Grow the object back to 2 pages. */ Modified: head/tests/sys/vm/page_fault_signal.c ============================================================================== --- head/tests/sys/vm/page_fault_signal.c Sun Sep 29 10:45:13 2019 (r352868) +++ head/tests/sys/vm/page_fault_signal.c Sun Sep 29 15:17:58 2019 (r352869) @@ -129,7 +129,6 @@ ATF_TC_BODY(page_fault_signal__bus_objerr_1, tc) int fd; int sz; - atf_tc_expect_fail("bug 211924"); sz = getpagesize(); fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); ATF_REQUIRE(fd != -1); @@ -153,7 +152,6 @@ ATF_TC_BODY(page_fault_signal__bus_objerr_2, tc) int r; int sz; - atf_tc_expect_fail("bug 211924"); sz = getpagesize(); fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); ATF_REQUIRE(fd != -1); From owner-svn-src-all@freebsd.org Sun Sep 29 17:30:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6ECA125B7E; Sun, 29 Sep 2019 17:30: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hCGV4tw2z3GVP; Sun, 29 Sep 2019 17:30: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 86C041D6C2; Sun, 29 Sep 2019 17:30:10 +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 x8THUAKN006867; Sun, 29 Sep 2019 17:30:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8THUA3f006866; Sun, 29 Sep 2019 17:30:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909291730.x8THUA3f006866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 29 Sep 2019 17:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352870 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 17:30:10 -0000 Author: kevans Date: Sun Sep 29 17:30:10 2019 New Revision: 352870 URL: https://svnweb.freebsd.org/changeset/base/352870 Log: memfd_create(3): Don't actually force hugetlb size with MFD_HUGETLB The size flags are only required to select a size on systems that support multiple sizes. MFD_HUGETLB by itself is valid. Modified: head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Sun Sep 29 15:17:58 2019 (r352869) +++ head/lib/libc/sys/shm_open.c Sun Sep 29 17:30:10 2019 (r352870) @@ -88,9 +88,6 @@ memfd_create(const char *name, unsigned int flags) if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | MFD_HUGE_MASK)) != 0) return (EINVAL); - /* HUGETLB set with no size specified. */ - if ((flags & MFD_HUGETLB) != 0 && (flags & MFD_HUGE_MASK) == 0) - return (EINVAL); /* Size specified but no HUGETLB. */ if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) return (EINVAL); From owner-svn-src-all@freebsd.org Sun Sep 29 18:33:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 425F712748C; Sun, 29 Sep 2019 18:33:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hDgZ12c0z3Kdl; Sun, 29 Sep 2019 18:33:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 068661E364; Sun, 29 Sep 2019 18:33: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 x8TIXT3p047124; Sun, 29 Sep 2019 18:33:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TIXTso047123; Sun, 29 Sep 2019 18:33:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909291833.x8TIXTso047123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 29 Sep 2019 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352871 - releng/12.1/sys/arm/freescale/imx X-SVN-Group: releng X-SVN-Commit-Author: ian X-SVN-Commit-Paths: releng/12.1/sys/arm/freescale/imx X-SVN-Commit-Revision: 352871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 18:33:30 -0000 Author: ian Date: Sun Sep 29 18:33:29 2019 New Revision: 352871 URL: https://svnweb.freebsd.org/changeset/base/352871 Log: MFC r352363: Apply a runtime patch to the FDT data for imx6 to fix iomuxc problems. The latest imported FDT data defines a node for an iomuxc-gpr device, which we don't support (or need, right now) in addition to the usual iomuxc device. Unfortunately, the dts improperly assigns overlapping ranges of mmio space to both devices. The -gpr device is also a syscon and simple_mfd device. At runtime the simple_mfd driver attaches for the iomuxc-gpr node, then when the real iomuxc driver comes along later, it fails to attach because it tries to allocate its register space, and it's already partially in use by the bogus instance of simple_mfd. This change works around the problem by simply disabling the node for the iomuxc-gpr device, since we don't need it for anything. Approved by: re@ (gjb) Modified: releng/12.1/sys/arm/freescale/imx/imx6_machdep.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- releng/12.1/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 29 17:30:10 2019 (r352870) +++ releng/12.1/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 29 18:33:29 2019 (r352871) @@ -148,12 +148,43 @@ fix_fdt_interrupt_data(void) OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); } +static void +fix_fdt_iomuxc_data(void) +{ + phandle_t node; + + /* + * The linux dts defines two nodes with the same mmio address range, + * iomuxc-gpr and the regular iomuxc. The -grp node is a simple_mfd and + * a syscon, but it only has access to a small subset of the iomuxc + * registers, so it can't serve as the accessor for the iomuxc driver's + * register IO. But right now, the simple_mfd driver attaches first, + * preventing the real iomuxc driver from allocating its mmio register + * range because it partially overlaps with the -gpr range. + * + * For now, by far the easiest thing to do to keep imx6 working is to + * just disable the iomuxc-gpr node because we don't have a driver for + * it anyway, we just need to prevent attachment of simple_mfd. + * + * If we ever write a -gpr driver, this code should probably switch to + * modifying the reg property so that the range covers all the iomuxc + * regs, then the -gpr driver can be a regular syscon driver that iomuxc + * uses for register access. + */ + node = OF_finddevice("/soc/aips-bus@2000000/iomuxc-gpr@20e0000"); + if (node != -1) + OF_setprop(node, "status", "disabled", sizeof("disabled")); +} + static int imx6_attach(platform_t plat) { /* Fix soc interrupt-parent property. */ fix_fdt_interrupt_data(); + + /* Fix iomuxc-gpr and iomuxc nodes both using the same mmio range. */ + fix_fdt_iomuxc_data(); /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); From owner-svn-src-all@freebsd.org Sun Sep 29 20:05:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53986128FF3; Sun, 29 Sep 2019 20:05:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hGk51YGTz3QB1; Sun, 29 Sep 2019 20:05:49 +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 19A991F436; Sun, 29 Sep 2019 20:05:49 +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 x8TK5mEA001367; Sun, 29 Sep 2019 20:05:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TK5mSd001366; Sun, 29 Sep 2019 20:05:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909292005.x8TK5mSd001366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 29 Sep 2019 20:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352872 - stable/12/sbin/fsck_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/fsck_msdosfs X-SVN-Commit-Revision: 352872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 20:05:49 -0000 Author: delphij Date: Sun Sep 29 20:05:48 2019 New Revision: 352872 URL: https://svnweb.freebsd.org/changeset/base/352872 Log: MFC r351802: Correct overflow logic in fullpath(). Obtained from: OpenBSD Modified: stable/12/sbin/fsck_msdosfs/dir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/dir.c Sun Sep 29 18:33:29 2019 (r352871) +++ stable/12/sbin/fsck_msdosfs/dir.c Sun Sep 29 20:05:48 2019 (r352872) @@ -168,20 +168,24 @@ fullpath(struct dosDirEntry *dir) char *cp, *np; int nl; - cp = namebuf + sizeof namebuf - 1; - *cp = '\0'; - do { + cp = namebuf + sizeof namebuf; + *--cp = '\0'; + + for(;;) { np = dir->lname[0] ? dir->lname : dir->name; nl = strlen(np); - if ((cp -= nl) <= namebuf + 1) + if (cp <= namebuf + 1 + nl) { + *--cp = '?'; break; + } + cp -= nl; memcpy(cp, np, nl); + dir = dir->parent; + if (!dir) + break; *--cp = '/'; - } while ((dir = dir->parent) != NULL); - if (dir) - *--cp = '?'; - else - cp++; + } + return cp; } From owner-svn-src-all@freebsd.org Sun Sep 29 20:08:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D5F412909D; Sun, 29 Sep 2019 20:08:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hGmv0Ms2z3QJv; Sun, 29 Sep 2019 20:08:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E439A1F438; Sun, 29 Sep 2019 20:08:14 +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 x8TK8E5d001533; Sun, 29 Sep 2019 20:08:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TK8EFj001532; Sun, 29 Sep 2019 20:08:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909292008.x8TK8EFj001532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 29 Sep 2019 20:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352873 - stable/11/sbin/fsck_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/fsck_msdosfs X-SVN-Commit-Revision: 352873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 20:08:15 -0000 Author: delphij Date: Sun Sep 29 20:08:14 2019 New Revision: 352873 URL: https://svnweb.freebsd.org/changeset/base/352873 Log: MFC r351802: Correct overflow logic in fullpath(). Obtained from: OpenBSD Modified: stable/11/sbin/fsck_msdosfs/dir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/11/sbin/fsck_msdosfs/dir.c Sun Sep 29 20:05:48 2019 (r352872) +++ stable/11/sbin/fsck_msdosfs/dir.c Sun Sep 29 20:08:14 2019 (r352873) @@ -168,20 +168,24 @@ fullpath(struct dosDirEntry *dir) char *cp, *np; int nl; - cp = namebuf + sizeof namebuf - 1; - *cp = '\0'; - do { + cp = namebuf + sizeof namebuf; + *--cp = '\0'; + + for(;;) { np = dir->lname[0] ? dir->lname : dir->name; nl = strlen(np); - if ((cp -= nl) <= namebuf + 1) + if (cp <= namebuf + 1 + nl) { + *--cp = '?'; break; + } + cp -= nl; memcpy(cp, np, nl); + dir = dir->parent; + if (!dir) + break; *--cp = '/'; - } while ((dir = dir->parent) != NULL); - if (dir) - *--cp = '?'; - else - cp++; + } + return cp; } From owner-svn-src-all@freebsd.org Sun Sep 29 20:44:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09497129EC2; Sun, 29 Sep 2019 20:44:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hHZP6Qc4z3xPZ; Sun, 29 Sep 2019 20:44:13 +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 C086C1FBA2; Sun, 29 Sep 2019 20:44:13 +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 x8TKiDRB024951; Sun, 29 Sep 2019 20:44:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TKiDf8024950; Sun, 29 Sep 2019 20:44:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909292044.x8TKiDf8024950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 29 Sep 2019 20:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352874 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 352874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 20:44:14 -0000 Author: mjg Date: Sun Sep 29 20:44:13 2019 New Revision: 352874 URL: https://svnweb.freebsd.org/changeset/base/352874 Log: amd64 pmap: batch chunk removal in pmap_remove_pages pv list lock is the main bottleneck during poudriere -j 104 and pmap_remove_pages is the most impactful consumer. It frees chunks with the lock held even though it plays no role in correctness. Moreover chunks are often freed in groups, sample counts during buildkernel (0-sized frees removed): value ------------- Distribution ------------- count 0 | 0 1 | 8 2 |@@@@@@@ 19329 4 |@@@@@@@@@@@@@@@@@@@@@@ 58517 8 | 1085 16 | 71 32 |@@@@@@@@@@ 24919 64 | 899 128 | 7 256 | 2 512 | 0 Thus: 1. batch freeing 2. move it past unlocking pv list Reviewed by: alc (previous version), markj (previous version), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21832 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Sep 29 20:08:14 2019 (r352873) +++ head/sys/amd64/amd64/pmap.c Sun Sep 29 20:44:13 2019 (r352874) @@ -1105,7 +1105,10 @@ static caddr_t crashdumpmap; #define MAPDEV_FLUSHCACHE 0x0000001 /* Flush cache after mapping. */ #define MAPDEV_SETATTR 0x0000002 /* Modify existing attrs. */ +TAILQ_HEAD(pv_chunklist, pv_chunk); + static void free_pv_chunk(struct pv_chunk *pc); +static void free_pv_chunk_batch(struct pv_chunklist *batch); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); static int popcnt_pc_map_pq(uint64_t *map); @@ -4248,13 +4251,10 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) } static void -free_pv_chunk(struct pv_chunk *pc) +free_pv_chunk_dequeued(struct pv_chunk *pc) { vm_page_t m; - mtx_lock(&pv_chunks_mutex); - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); - mtx_unlock(&pv_chunks_mutex); PV_STAT(atomic_subtract_int(&pv_entry_spare, _NPCPV)); PV_STAT(atomic_subtract_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); @@ -4265,6 +4265,35 @@ free_pv_chunk(struct pv_chunk *pc) vm_page_free(m); } +static void +free_pv_chunk(struct pv_chunk *pc) +{ + + mtx_lock(&pv_chunks_mutex); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + mtx_unlock(&pv_chunks_mutex); + free_pv_chunk_dequeued(pc); +} + +static void +free_pv_chunk_batch(struct pv_chunklist *batch) +{ + struct pv_chunk *pc, *npc; + + if (TAILQ_EMPTY(batch)) + return; + + mtx_lock(&pv_chunks_mutex); + TAILQ_FOREACH(pc, batch, pc_list) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + } + mtx_unlock(&pv_chunks_mutex); + + TAILQ_FOREACH_SAFE(pc, batch, pc_list, npc) { + free_pv_chunk_dequeued(pc); + } +} + /* * Returns a new PV entry, allocating a new PV chunk from the system when * needed. If this PV chunk allocation fails and a PV list lock pointer was @@ -6865,6 +6894,7 @@ pmap_remove_pages(pmap_t pmap) pt_entry_t *pte, tpte; pt_entry_t PG_M, PG_RW, PG_V; struct spglist free; + struct pv_chunklist free_chunks; vm_page_t m, mpte, mt; pv_entry_t pv; struct md_page *pvh; @@ -6900,6 +6930,7 @@ pmap_remove_pages(pmap_t pmap) PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); + TAILQ_INIT(&free_chunks); SLIST_INIT(&free); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { @@ -7027,13 +7058,14 @@ pmap_remove_pages(pmap_t pmap) PV_STAT(atomic_subtract_long(&pv_entry_count, freed)); if (allfree) { TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); - free_pv_chunk(pc); + TAILQ_INSERT_TAIL(&free_chunks, pc, pc_list); } } if (lock != NULL) rw_wunlock(lock); pmap_invalidate_all(pmap); pmap_pkru_deassign_all(pmap); + free_pv_chunk_batch(&free_chunks); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, true); } From owner-svn-src-all@freebsd.org Sun Sep 29 22:34:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1FD412CA72; Sun, 29 Sep 2019 22:34:02 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hL163qbgz43kZ; Sun, 29 Sep 2019 22:34:02 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EC74210D2; Sun, 29 Sep 2019 22:34:02 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8TMY2Mc090144; Sun, 29 Sep 2019 22:34:02 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TMY260090143; Sun, 29 Sep 2019 22:34:02 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201909292234.x8TMY260090143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Sun, 29 Sep 2019 22:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352875 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: ray X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 352875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 22:34:02 -0000 Author: ray Date: Sun Sep 29 22:34:01 2019 New Revision: 352875 URL: https://svnweb.freebsd.org/changeset/base/352875 Log: ections into expected offset in binary format. Calculate binary file offset using address field, bacause software know only offset to known data, not where to load segment. With that patch, kernel .data section can have any alignment/offset - kernel boor fine. PR: 235391 Reviewed by: markj MFC after: 1 month Differential Revision: D21827 Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 20:44:13 2019 (r352874) +++ head/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 22:34:01 2019 (r352875) @@ -49,22 +49,23 @@ create_binary(int ifd, int ofd) Elf *e; Elf_Scn *scn; Elf_Data *d; + Elf64_Addr baseaddr; GElf_Shdr sh; - off_t base, off; + off_t baseoff, off; int elferr; if ((e = elf_begin(ifd, ELF_C_READ, NULL)) == NULL) errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); - base = 0; - if (lseek(ofd, base, SEEK_SET) < 0) + baseoff = 0; + if (lseek(ofd, baseoff, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); /* * Find base offset in the first iteration. */ - base = -1; + baseoff = -1; scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { if (gelf_getshdr(scn, &sh) == NULL) { @@ -76,14 +77,16 @@ create_binary(int ifd, int ofd) sh.sh_type == SHT_NOBITS || sh.sh_size == 0) continue; - if (base == -1 || (off_t) sh.sh_offset < base) - base = sh.sh_offset; + if (baseoff == -1 || (off_t) sh.sh_offset < baseoff) { + baseoff = sh.sh_offset; + baseaddr = sh.sh_addr; + } } elferr = elf_errno(); if (elferr != 0) warnx("elf_nextscn failed: %s", elf_errmsg(elferr)); - if (base == -1) + if (baseoff == -1) return; /* @@ -110,8 +113,8 @@ create_binary(int ifd, int ofd) if (d->d_buf == NULL || d->d_size == 0) continue; - /* lseek to section offset relative to `base'. */ - off = sh.sh_offset - base; + /* lseek to section offset relative to `baseaddr'. */ + off = sh.sh_addr - baseaddr; if (lseek(ofd, off, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); From owner-svn-src-all@freebsd.org Sun Sep 29 22:36:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 209EF12CB39 for ; Sun, 29 Sep 2019 22:36:37 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hL435ZTvz43yV for ; Sun, 29 Sep 2019 22:36:35 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-ua1-x941.google.com with SMTP id r19so3544073uap.9 for ; Sun, 29 Sep 2019 15:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddteam-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=jCcBopMlywAwiHjAlH6j0GOMoJl6nc7sLL+4xxITBlM=; b=YIUMdt9/9XjKYXdcntJ/1FkadGNrG4lya8wWZ+DZUMRlxgLRiR5dNzVZAbUY/EvkYk LaSoDJZ4jcxiDwUi+/fGRqX2HpFbxO/14xLZWu7z+6jqjUkJAVfbbZnICzrf/yqRnO1L R801f66UsuEVGXX1adUvpK7aAPY1u3djmaHb19Qrs3KW+fqQCVLHLhFXKm8jQOL8fGmS sPrjjKN+KxvVozFx/bLaeHovcjpllNnGPqHh+BVvdvE/AdkoP7NcAZQby6DrRXr342R5 O6e+JpUnf9et/Wkf/l2ZH+rMsBmgeH9/V711e7IgF2Fq7cmxwB1T+AMqJxU3Ijgqx4jk 1Mpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=jCcBopMlywAwiHjAlH6j0GOMoJl6nc7sLL+4xxITBlM=; b=CLr1wCAOru+ouo1TgNoOL1KD5bgK4Jhdmm0cOKzhxeTkLqwtRI+gsKuyHOmQdBMSLs 0bR6WA0ENO7G2MxVeNjYR6dQ6BXM0dJQaOTDsurR+VV1ygcu7SM+C9eTCKwY9TaoTPd2 3eRUrQtmRY6kzX7TcGOpdM7Ld+oSGK/53YGCFCKScz8S51fuoTmPNMWXvLxpx2HYWenI x4VWXt0x0DNutpt46PHRNIcSD3fJweO6jsdt+9GE82jzblOaPKhF74meiH3oQTqjdEEi YLnRVv2TSdfXRtAM+uPTOZNnNz69V0eBG1RDARuGIgIlTtV7SDyhCTSsg72uuOyQzMnr zfOw== X-Gm-Message-State: APjAAAV0gCuNni6ZiiZk3uq1wPCuXvPBmn7wiXAiAbCD+LRhPbU6W6W+ sASuRZvPOanngHYa4bTmo2DePXjnkw2n4h8WTuigyg== X-Google-Smtp-Source: APXvYqz66fbvcYb1Zrzyxrphn1r1aFMDdGt5MQ63Bg8zNU0gLRdcVmvCH9i2i3nm2dwguv3OZTwZJCBuKRb7fTQS510= X-Received: by 2002:ab0:1c0b:: with SMTP id a11mr10069932uaj.65.1569796594751; Sun, 29 Sep 2019 15:36:34 -0700 (PDT) MIME-Version: 1.0 References: <201909292234.x8TMY260090143@repo.freebsd.org> In-Reply-To: <201909292234.x8TMY260090143@repo.freebsd.org> From: Oleksandr Rybalko Date: Mon, 30 Sep 2019 01:36:23 +0300 Message-ID: Subject: Re: svn commit: r352875 - head/contrib/elftoolchain/elfcopy To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46hL435ZTvz43yV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ddteam-net.20150623.gappssmtp.com header.s=20150623 header.b=YIUMdt9/; dmarc=none; spf=softfail (mx1.freebsd.org: 2607:f8b0:4864:20::941 is neither permitted nor denied by domain of ray@ddteam.net) smtp.mailfrom=ray@ddteam.net X-Spamd-Result: default: False [-1.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; R_DKIM_ALLOW(-0.20)[ddteam-net.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ddteam-net.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[1.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; DMARC_NA(0.00)[ddteam.net]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.36)[ip: (3.00), ipnet: 2607:f8b0::/32(-2.58), asn: 15169(-2.17), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 22:36:37 -0000 Should be "Put sections into expected offset in binary format." Sorry. =D0=BF=D0=BD, 30 =D0=B2=D0=B5=D1=80. 2019 =D0=BE 01:34 Aleksandr Rybalko =D0=BF=D0=B8=D1=88=D0=B5: > Author: ray > Date: Sun Sep 29 22:34:01 2019 > New Revision: 352875 > URL: https://svnweb.freebsd.org/changeset/base/352875 > > Log: > ections into expected offset in binary format. > Calculate binary file offset using address field, bacause software know > only offset to known data, not where to load segment. > With that patch, kernel .data section can have any alignment/offset - > kernel boor fine. > > PR: 235391 > Reviewed by: markj > MFC after: 1 month > Differential Revision: D21827 > > Modified: > head/contrib/elftoolchain/elfcopy/binary.c > > Modified: head/contrib/elftoolchain/elfcopy/binary.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/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 20:44:13 2019 > (r352874) > +++ head/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 22:34:01 2019 > (r352875) > @@ -49,22 +49,23 @@ create_binary(int ifd, int ofd) > Elf *e; > Elf_Scn *scn; > Elf_Data *d; > + Elf64_Addr baseaddr; > GElf_Shdr sh; > - off_t base, off; > + off_t baseoff, off; > int elferr; > > if ((e =3D elf_begin(ifd, ELF_C_READ, NULL)) =3D=3D NULL) > errx(EXIT_FAILURE, "elf_begin() failed: %s", > elf_errmsg(-1)); > > - base =3D 0; > - if (lseek(ofd, base, SEEK_SET) < 0) > + baseoff =3D 0; > + if (lseek(ofd, baseoff, SEEK_SET) < 0) > err(EXIT_FAILURE, "lseek failed"); > > /* > * Find base offset in the first iteration. > */ > - base =3D -1; > + baseoff =3D -1; > scn =3D NULL; > while ((scn =3D elf_nextscn(e, scn)) !=3D NULL) { > if (gelf_getshdr(scn, &sh) =3D=3D NULL) { > @@ -76,14 +77,16 @@ create_binary(int ifd, int ofd) > sh.sh_type =3D=3D SHT_NOBITS || > sh.sh_size =3D=3D 0) > continue; > - if (base =3D=3D -1 || (off_t) sh.sh_offset < base) > - base =3D sh.sh_offset; > + if (baseoff =3D=3D -1 || (off_t) sh.sh_offset < baseoff) = { > + baseoff =3D sh.sh_offset; > + baseaddr =3D sh.sh_addr; > + } > } > elferr =3D elf_errno(); > if (elferr !=3D 0) > warnx("elf_nextscn failed: %s", elf_errmsg(elferr)); > > - if (base =3D=3D -1) > + if (baseoff =3D=3D -1) > return; > > /* > @@ -110,8 +113,8 @@ create_binary(int ifd, int ofd) > if (d->d_buf =3D=3D NULL || d->d_size =3D=3D 0) > continue; > > - /* lseek to section offset relative to `base'. */ > - off =3D sh.sh_offset - base; > + /* lseek to section offset relative to `baseaddr'. */ > + off =3D sh.sh_addr - baseaddr; > if (lseek(ofd, off, SEEK_SET) < 0) > err(EXIT_FAILURE, "lseek failed"); > > --=20 WBW ------- Rybalko Aleksandr From owner-svn-src-all@freebsd.org Sun Sep 29 22:37:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D827512CBD0; Sun, 29 Sep 2019 22:37:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hL5g5w16z446W; Sun, 29 Sep 2019 22:37:59 +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 AF2BA210E8; Sun, 29 Sep 2019 22:37:59 +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 x8TMbxdY091065; Sun, 29 Sep 2019 22:37:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TMbxaj091064; Sun, 29 Sep 2019 22:37:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909292237.x8TMbxaj091064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 29 Sep 2019 22:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352876 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 352876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 22:37:59 -0000 Author: markj Date: Sun Sep 29 22:37:59 2019 New Revision: 352876 URL: https://svnweb.freebsd.org/changeset/base/352876 Log: MFC r351628, r351744: Update and clean up the UMA man page. Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/zone.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Sun Sep 29 22:34:01 2019 (r352875) +++ stable/12/share/man/man9/Makefile Sun Sep 29 22:37:59 2019 (r352876) @@ -2273,15 +2273,27 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zalloc.9 \ zone.9 uma_zalloc_arg.9 \ zone.9 uma_zalloc_domain.9 \ + zone.9 uma_zalloc_pcpu.9 \ + zone.9 uma_zalloc_pcpu_arg.9 \ + zone.9 uma_zcache_create.9 \ zone.9 uma_zcreate.9 \ zone.9 uma_zdestroy.9 \ zone.9 uma_zfree.9 \ zone.9 uma_zfree_arg.9 \ zone.9 uma_zfree_domain.9 \ + zone.9 uma_zfree_pcpu.9 \ + zone.9 uma_zfree_pcpu_arg.9 \ zone.9 uma_zone_get_cur.9 \ zone.9 uma_zone_get_max.9 \ + zone.9 uma_zone_prealloc.9 \ + zone.9 uma_zone_reserve.9 \ + zone.9 uma_zone_reserve_kva.9 \ + zone.9 uma_zone_set_allocf.9 \ + zone.9 uma_zone_set_freef.9 \ zone.9 uma_zone_set_max.9 \ + zone.9 uma_zone_set_maxaction.9 \ + zone.9 uma_zone_set_maxcache.9 \ zone.9 uma_zone_set_warning.9 \ - zone.9 uma_zone_set_maxaction.9 + zone.9 uma_zsecond_create.9 .include Modified: stable/12/share/man/man9/zone.9 ============================================================================== --- stable/12/share/man/man9/zone.9 Sun Sep 29 22:34:01 2019 (r352875) +++ stable/12/share/man/man9/zone.9 Sun Sep 29 22:37:59 2019 (r352876) @@ -25,40 +25,62 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2018 -.Dt ZONE 9 +.Dd August 30, 2019 +.Dt UMA 9 .Os .Sh NAME -.Nm uma_zcreate , -.Nm uma_zalloc , -.Nm uma_zalloc_arg , -.Nm uma_zalloc_domain , -.Nm uma_zfree , -.Nm uma_zfree_arg , -.Nm uma_zfree_domain , -.Nm uma_zdestroy , -.Nm uma_zone_set_max , -.Nm uma_zone_get_max , -.Nm uma_zone_get_cur , -.Nm uma_zone_set_warning , -.Nm uma_zone_set_maxaction -.Nd zone allocator +.Nm UMA +.Nd general-purpose kernel object allocator .Sh SYNOPSIS .In sys/param.h .In sys/queue.h .In vm/uma.h +.Cd "options UMA_FIRSTTOUCH" +.Cd "options UMA_XDOMAIN" +.Bd -literal +typedef int (*uma_ctor)(void *mem, int size, void *arg, int flags); +typedef void (*uma_dtor)(void *mem, int size, void *arg); +typedef int (*uma_init)(void *mem, int size, int flags); +typedef void (*uma_fini)(void *mem, int size); +typedef int (*uma_import)(void *arg, void **store, int count, int domain, + int flags); +typedef void (*uma_release)(void *arg, void **store, int count); +typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t size, int domain, + uint8_t *pflag, int wait); +typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); + +.Ed .Ft uma_zone_t .Fo uma_zcreate .Fa "char *name" "int size" -.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init uminit" "uma_fini fini" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" .Fa "int align" "uint16_t flags" .Fc +.Ft uma_zone_t +.Fo uma_zcache_create +.Fa "char *name" "int size" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" +.Fa "uma_import zimport" "uma_release zrelease" +.Fa "void *arg" "int flags" +.Fc +.Ft uma_zone_t +.Fo uma_zsecond_create +.Fa "char *name" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" +.Fa "uma_zone_t master" +.Fc +.Ft void +.Fn uma_zdestroy "uma_zone_t zone" .Ft "void *" .Fn uma_zalloc "uma_zone_t zone" "int flags" .Ft "void *" .Fn uma_zalloc_arg "uma_zone_t zone" "void *arg" "int flags" .Ft "void *" .Fn uma_zalloc_domain "uma_zone_t zone" "void *arg" "int domain" "int flags" +.Ft "void *" +.Fn uma_zalloc_pcpu "uma_zone_t zone" "int flags" +.Ft "void *" +.Fn uma_zalloc_pcpu_arg "uma_zone_t zone" "void *arg" "int flags" .Ft void .Fn uma_zfree "uma_zone_t zone" "void *item" .Ft void @@ -66,10 +88,24 @@ .Ft void .Fn uma_zfree_domain "uma_zone_t zone" "void *item" "void *arg" .Ft void -.Fn uma_zdestroy "uma_zone_t zone" +.Fn uma_zfree_pcpu "uma_zone_t zone" "void *item" +.Ft void +.Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" +.Ft void +.Fn uma_prealloc "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_reserve "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_reserve_kva "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" +.Ft void +.Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" .Ft int .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" .Ft int +.Fn uma_zone_set_maxcache "uma_zone_t zone" "int nitems" +.Ft int .Fn uma_zone_get_max "uma_zone_t zone" .Ft int .Fn uma_zone_get_cur "uma_zone_t zone" @@ -77,34 +113,56 @@ .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" .Ft void .Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)" +.Ft void +.Fn uma_reclaim .In sys/sysctl.h .Fn SYSCTL_UMA_MAX parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr .Fn SYSCTL_UMA_CUR parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr .Sh DESCRIPTION -The zone allocator provides an efficient interface for managing -dynamically-sized collections of items of identical size. -The zone allocator can work with preallocated zones as well as with -runtime-allocated ones, and is therefore available much earlier in the -boot process than other memory management routines. The zone allocator -provides per-cpu allocation caches with linear scalability on SMP +UMA (Universal Memory Allocator) provides an efficient interface for managing +dynamically-sized collections of items of identical size, referred to as zones. +Zones keep track of which items are in use and which +are not, and UMA provides functions for allocating items from a zone and +for releasing them back, making them available for subsequent allocation requests. +Zones maintain per-CPU caches with linear scalability on SMP systems as well as round-robin and first-touch policies for NUMA systems. +The number of items cached per CPU is bounded, and each zone additionally +maintains an unbounded cache of items that is used to quickly satisfy +per-CPU cache allocation misses. .Pp -A zone is an extensible collection of items of identical size. -The zone allocator keeps track of which items are in use and which -are not, and provides functions for allocating items from the zone and -for releasing them back (which makes them available for later use). +Two types of zones exist: regular zones and cache zones. +In a regular zone, items are allocated from a slab, which is one or more +virtually contiguous memory pages that have been allocated from the kernel's +page allocator. +Internally, slabs are managed by a UMA keg, which is responsible for allocating +slabs and keeping track of their usage by one or more zones. +In typical usage, there is one keg per zone, so slabs are not shared among +multiple zones. .Pp -After the first allocation of an item, -it will have been cleared to zeroes, however subsequent allocations -will retain the contents as of the last free. +Normal zones import items from a keg, and release items back to that keg if +requested. +Cache zones do not have a keg, and instead use custom import and release +methods. +For example, some collections of kernel objects are statically allocated +at boot-time, and the size of the collection does not change. +A cache zone can be used to implement an efficient allocator for the objects in +such a collection. .Pp The .Fn uma_zcreate -function creates a new zone from which items may then be allocated from. +and +.Fn uma_zcache_create +functions create a new regular zone and cache zone, respectively. The +.Fn uma_zsecond_create +function creates a regular zone which shares the keg of the zone +specified by the +.Fa master +argument. +The .Fa name argument is a text name of the zone for debugging and stats; this memory should not be freed until the zone has been deallocated. @@ -114,7 +172,7 @@ The and .Fa dtor arguments are callback functions that are called by -the uma subsystem at the time of the call to +the UMA subsystem at the time of the call to .Fn uma_zalloc and .Fn uma_zfree @@ -126,49 +184,91 @@ A good usage for the .Fa ctor and .Fa dtor -callbacks -might be to adjust a global count of the number of objects allocated. +callbacks might be to initialize a data structure embedded in the item, +such as a +.Xr queue 3 +head. .Pp The -.Fa uminit +.Fa zinit and -.Fa fini -arguments are used to optimize the allocation of -objects from the zone. -They are called by the uma subsystem whenever -it needs to allocate or free several items to satisfy requests or memory -pressure. +.Fa zfini +arguments are used to optimize the allocation of items from the zone. +They are called by the UMA subsystem whenever +it needs to allocate or free items to satisfy requests or memory pressure. A good use for the -.Fa uminit +.Fa zinit and -.Fa fini +.Fa zfini callbacks might be to -initialize and destroy mutexes contained within the object. -This would -allow one to re-use already initialized mutexes when an object is returned -from the uma subsystem's object cache. +initialize and destroy a mutex contained within an item. +This would allow one to avoid destroying and re-initializing the mutex +each time the item is freed and re-allocated. They are not called on each call to .Fn uma_zalloc and .Fn uma_zfree -but rather in a batch mode on several objects. +but rather when an item is imported into a zone's cache, and when a zone +releases an item to the slab allocator, typically as a response to memory +pressure. .Pp +For +.Fn uma_zcache_create , +the +.Fa zimport +and +.Fa zrelease +functions are called to import items into the zone and to release items +from the zone, respectively. The +.Fa zimport +function should store pointers to items in the +.Fa store +array, which contains a maximum of +.Fa count +entries. +The function must return the number of imported items, which may be less than +the maximum. +Similarly, the +.Fa store +parameter to the +.Fa zrelease +function contains an array of +.Fa count +pointers to items. +The +.Fa arg +parameter passed to +.Fn uma_zcache_create +is provided to the import and release functions. +The +.Fa domain +parameter to +.Fa zimport +specifies the requested +.Xr numa 4 +domain for the allocation. +It is either a NUMA domain number or the special value +.Dv UMA_ANYDOMAIN . +.Pp +The .Fa flags -argument of the +argument of .Fn uma_zcreate +and +.Fn uma_zcache_create is a subset of the following flags: .Bl -tag -width "foo" .It Dv UMA_ZONE_NOFREE -Slabs of the zone are never returned back to VM. +Slabs allocated to the zone's keg are never freed. .It Dv UMA_ZONE_NODUMP -Pages belonging to the zone will not be included into mini-dumps. +Pages belonging to the zone will not be included in minidumps. .It Dv UMA_ZONE_PCPU An allocation from zone would have .Va mp_ncpu shadow copies, that are privately assigned to CPUs. -A CPU can address its private copy using base allocation address plus -multiple of current CPU id and +A CPU can address its private copy using base the allocation address plus +a multiple of the current CPU ID and .Fn sizeof "struct pcpu" : .Bd -literal -offset indent foo_zone = uma_zcreate(..., UMA_ZONE_PCPU); @@ -179,7 +279,15 @@ critical_enter(); foo_pcpu = (foo_t *)zpcpu_get(foo_base); /* do something with foo_pcpu */ critical_exit(); + .Ed +Note that +.Dv M_ZERO +cannot be used when allocating items from a PCPU zone. +To obtain zeroed memory from a PCPU zone, use the +.Fn uma_zalloc_pcpu +function and its variants instead, and pass +.Dv M_ZERO . .It Dv UMA_ZONE_OFFPAGE By default book-keeping of items within a slab is done in the slab page itself. This flag explicitly tells subsystem that book-keeping structure should be @@ -220,24 +328,40 @@ subsystem. The zone is for the VM subsystem. .It Dv UMA_ZONE_NUMA The zone should use a first-touch NUMA policy rather than the round-robin -default. Callers that do not free memory on the same domain it is allocated -from will cause mixing in per-cpu caches. See -.Xr numa 9 for more details. +default. +If the +.Dv UMA_FIRSTTOUCH +kernel option is configured, all zones implicitly use a first-touch policy, +and the +.Dv UMA_ZONE_NUMA +flag has no effect. +The +.Dv UMA_XDOMAIN +kernel option, when configured, causes UMA to do the extra tracking to ensure +that allocations from first-touch zones are always local. +Otherwise, consumers that do not free memory on the same domain from which it +was allocated will cause mixing in per-CPU caches. +See +.Xr numa 4 +for more details. .El .Pp +Zones can be destroyed using +.Fn uma_zdestroy , +freeing all memory that is cached in the zone. +All items allocated from the zone must be freed to the zone before the zone +may be safely destroyed. +.Pp To allocate an item from a zone, simply call .Fn uma_zalloc -with a pointer to that zone -and set the +with a pointer to that zone and set the .Fa flags argument to selected flags as documented in .Xr malloc 9 . -It will return a pointer to an item if successful, -or +It will return a pointer to an item if successful, or .Dv NULL in the rare case where all items in the zone are in use and the -allocator is unable to grow the zone -and +allocator is unable to grow the zone and .Dv M_NOWAIT is specified. .Pp @@ -253,7 +377,7 @@ then .Fn uma_zfree does nothing. .Pp -The variations +The variants .Fn uma_zalloc_arg and .Fn uma_zfree_arg @@ -262,29 +386,71 @@ specify an argument for the .Dv ctor and .Dv dtor -functions, respectively. -The +functions of the zone, respectively. +The .Fn uma_zalloc_domain function allows callers to specify a fixed -.Xr numa 9 domain to allocate from. This uses a guaranteed but slow path in -the allocator which reduces concurrency. The +.Xr numa 4 +domain to allocate from. +This uses a guaranteed but slow path in the allocator which reduces +concurrency. +The .Fn uma_zfree_domain -function should be used to return memory allocated in this fashion. This -function infers the domain from the pointer and does not require it as an +function should be used to return memory allocated in this fashion. +This function infers the domain from the pointer and does not require it as an argument. .Pp -Created zones, -which are empty, -can be destroyed using -.Fn uma_zdestroy , -freeing all memory that was allocated for the zone. -All items allocated from the zone with +The +.Fn uma_zone_prealloc +function allocates slabs for the requested number of items, typically following +the initial creation of a zone. +Subsequent allocations from the zone will be satisfied using the pre-allocated +slabs. +Note that slab allocation is performed with the +.Dv M_WAITOK +flag, so +.Fn uma_zone_prealloc +may sleep. +.Pp +The +.Fn uma_zone_reserve +function sets the number of reserved items for the zone. .Fn uma_zalloc -must have been freed with -.Fn uma_zfree -before. +and variants will ensure that the zone contains at least the reserved number +of free items. +Reserved items may be allocated by specifying +.Dv M_USE_RESERVE +in the allocation request flags. +.Fn uma_zone_reserve +does not perform any pre-allocation by itself. .Pp The +.Fn uma_zone_reserve_kva +function pre-allocates kernel virtual address space for the requested +number of items. +Subsequent allocations from the zone will be satisfied using the pre-allocated +address space. +Note that unlike +.Fn uma_zone_reserve , +.Fn uma_zone_reserve_kva +does not restrict the use of the pre-allocation to +.Dv M_USE_RESERVE +requests. +.Pp +The +.Fn uma_zone_set_allocf +and +.Fn uma_zone_set_freef +functions allow a zone's default slab allocation and free functions to be +overridden. +This is useful if the zone's items have special memory allocation constraints. +For example, if multi-page objects are required to be physically contiguous, +an +.Fa allocf +function which requests contiguous memory from the kernel's page allocator +may be used. +.Pp +The .Fn uma_zone_set_max function limits the number of items .Pq and therefore memory @@ -304,12 +470,21 @@ because all of the remaining free items may be in the other CPUs when the limit is hit. .Pp The +.Fn uma_zone_set_maxcache +function limits the number of free items which may be cached in the zone, +excluding the per-CPU caches, which are bounded in size. +For example, to implement a +.Ql pure +per-CPU cache, a cache zone may be configured with a maximum cache size of 0. +.Pp +The .Fn uma_zone_get_max function returns the effective upper limit number of items for a zone. .Pp The .Fn uma_zone_get_cur -function returns the approximate current occupancy of the zone. +function returns an approximation of the number of items currently allocated +from the zone. The returned value is approximate because appropriate synchronisation to determine an exact value is not performed by the implementation. This ensures low overhead at the expense of potentially stale data being used @@ -338,7 +513,7 @@ this function should do very little work (similar to a The .Fn SYSCTL_UMA_MAX parent nbr name access zone descr macro declares a static -.Xr sysctl +.Xr sysctl 9 oid that exports the effective upper limit number of items for a zone. The .Fa zone @@ -355,7 +530,7 @@ macro is provided to create this type of oid dynamical The .Fn SYSCTL_UMA_CUR parent nbr name access zone descr macro declares a static read-only -.Xr sysctl +.Xr sysctl 9 oid that exports the approximate current occupancy of the zone. The .Fa zone @@ -366,15 +541,6 @@ A read of the oid returns value obtained through The .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr macro is provided to create this type of oid dynamically. -.Sh RETURN VALUES -The -.Fn uma_zalloc -function returns a pointer to an item, or -.Dv NULL -if the zone ran out of unused items -and -.Dv M_NOWAIT -was specified. .Sh IMPLEMENTATION NOTES The memory that these allocation calls return is not executable. The @@ -385,7 +551,14 @@ flag to allocate executable memory. Not all platforms enforce a distinction between executable and non-executable memory. .Sh SEE ALSO +.Xr numa 4 , +.Xr vmstat 8 , .Xr malloc 9 +.Rs +.%A Jeff Bonwick +.%T "The Slab Allocator: An Object-Caching Kernel Memory Allocator" +.%D 1994 +.Re .Sh HISTORY The zone allocator first appeared in .Fx 3.0 . From owner-svn-src-all@freebsd.org Sun Sep 29 22:41:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 900EE12CE46; Sun, 29 Sep 2019 22:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hL9H3Fh3z44J2; Sun, 29 Sep 2019 22:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38D2C2111C; Sun, 29 Sep 2019 22:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8TMf74c091301; Sun, 29 Sep 2019 22:41:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TMf76K091300; Sun, 29 Sep 2019 22:41:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909292241.x8TMf76K091300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 29 Sep 2019 22:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352877 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 352877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 22:41:07 -0000 Author: markj Date: Sun Sep 29 22:41:06 2019 New Revision: 352877 URL: https://svnweb.freebsd.org/changeset/base/352877 Log: MFC r351728, r352581 (by kib), r352606 (by kib): Add a sysctl to dump kernel mappings and their properties on amd64. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Sun Sep 29 22:37:59 2019 (r352876) +++ stable/12/sys/amd64/amd64/pmap.c Sun Sep 29 22:41:06 2019 (r352877) @@ -124,6 +124,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2083,6 +2084,41 @@ pmap_cache_mask(pmap_t pmap, boolean_t is_pde) return (mask); } +static int +pmap_pat_index(pmap_t pmap, pt_entry_t pte, bool is_pde) +{ + int pat_flag, pat_idx; + + pat_idx = 0; + switch (pmap->pm_type) { + case PT_X86: + case PT_RVI: + /* The PAT bit is different for PTE's and PDE's. */ + pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; + + if ((pte & pat_flag) != 0) + pat_idx |= 0x4; + if ((pte & PG_NC_PCD) != 0) + pat_idx |= 0x2; + if ((pte & PG_NC_PWT) != 0) + pat_idx |= 0x1; + break; + case PT_EPT: + if ((pte & EPT_PG_IGNORE_PAT) != 0) + panic("EPT PTE %#lx has no PAT memory type", pte); + pat_idx = (pte & EPT_PG_MEMORY_TYPE(0x7)) >> 3; + break; + } + + /* See pmap_init_pat(). */ + if (pat_idx == 4) + pat_idx = 0; + if (pat_idx == 7) + pat_idx = 3; + + return (pat_idx); +} + bool pmap_ps_enabled(pmap_t pmap) { @@ -9907,6 +9943,271 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offse return (error); } +/* + * Track a range of the kernel's virtual address space that is contiguous + * in various mapping attributes. + */ +struct pmap_kernel_map_range { + vm_offset_t sva; + pt_entry_t attrs; + int ptes; + int pdes; + int pdpes; +}; + +static void +sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_map_range *range, + vm_offset_t eva) +{ + const char *mode; + int i, pat_idx; + + if (eva <= range->sva) + return; + + pat_idx = pmap_pat_index(kernel_pmap, range->attrs, true); + for (i = 0; i < PAT_INDEX_SIZE; i++) + if (pat_index[i] == pat_idx) + break; + + switch (i) { + case PAT_WRITE_BACK: + mode = "WB"; + break; + case PAT_WRITE_THROUGH: + mode = "WT"; + break; + case PAT_UNCACHEABLE: + mode = "UC"; + break; + case PAT_UNCACHED: + mode = "U-"; + break; + case PAT_WRITE_PROTECTED: + mode = "WP"; + break; + case PAT_WRITE_COMBINING: + mode = "WC"; + break; + default: + printf("%s: unknown PAT mode %#x for range 0x%016lx-0x%016lx\n", + __func__, pat_idx, range->sva, eva); + mode = "??"; + break; + } + + sbuf_printf(sb, "0x%016lx-0x%016lx r%c%c%c%c %s %d %d %d\n", + range->sva, eva, + (range->attrs & X86_PG_RW) != 0 ? 'w' : '-', + (range->attrs & pg_nx) != 0 ? '-' : 'x', + (range->attrs & X86_PG_U) != 0 ? 'u' : 's', + (range->attrs & X86_PG_G) != 0 ? 'g' : '-', + mode, range->pdpes, range->pdes, range->ptes); + + /* Reset to sentinel value. */ + range->sva = KVADDR(NPML4EPG - 1, NPDPEPG - 1, NPDEPG - 1, NPTEPG - 1); +} + +/* + * Determine whether the attributes specified by a page table entry match those + * being tracked by the current range. This is not quite as simple as a direct + * flag comparison since some PAT modes have multiple representations. + */ +static bool +sysctl_kmaps_match(struct pmap_kernel_map_range *range, pt_entry_t attrs) +{ + pt_entry_t diff, mask; + + mask = X86_PG_G | X86_PG_RW | X86_PG_U | X86_PG_PDE_CACHE | pg_nx; + diff = (range->attrs ^ attrs) & mask; + if (diff == 0) + return (true); + if ((diff & ~X86_PG_PDE_PAT) == 0 && + pmap_pat_index(kernel_pmap, range->attrs, true) == + pmap_pat_index(kernel_pmap, attrs, true)) + return (true); + return (false); +} + +static void +sysctl_kmaps_reinit(struct pmap_kernel_map_range *range, vm_offset_t va, + pt_entry_t attrs) +{ + + memset(range, 0, sizeof(*range)); + range->sva = va; + range->attrs = attrs; +} + +/* + * Given a leaf PTE, derive the mapping's attributes. If they do not match + * those of the current run, dump the address range and its attributes, and + * begin a new run. + */ +static void +sysctl_kmaps_check(struct sbuf *sb, struct pmap_kernel_map_range *range, + vm_offset_t va, pml4_entry_t pml4e, pdp_entry_t pdpe, pd_entry_t pde, + pt_entry_t pte) +{ + pt_entry_t attrs; + + attrs = pml4e & (X86_PG_RW | X86_PG_U | pg_nx); + + attrs |= pdpe & pg_nx; + attrs &= pg_nx | (pdpe & (X86_PG_RW | X86_PG_U)); + if ((pdpe & PG_PS) != 0) { + attrs |= pdpe & (X86_PG_G | X86_PG_PDE_CACHE); + } else if (pde != 0) { + attrs |= pde & pg_nx; + attrs &= pg_nx | (pde & (X86_PG_RW | X86_PG_U)); + } + if ((pde & PG_PS) != 0) { + attrs |= pde & (X86_PG_G | X86_PG_PDE_CACHE); + } else if (pte != 0) { + attrs |= pte & pg_nx; + attrs &= pg_nx | (pte & (X86_PG_RW | X86_PG_U)); + attrs |= pte & (X86_PG_G | X86_PG_PTE_CACHE); + + /* Canonicalize by always using the PDE PAT bit. */ + if ((attrs & X86_PG_PTE_PAT) != 0) + attrs ^= X86_PG_PDE_PAT | X86_PG_PTE_PAT; + } + + if (range->sva > va || !sysctl_kmaps_match(range, attrs)) { + sysctl_kmaps_dump(sb, range, va); + sysctl_kmaps_reinit(range, va, attrs); + } +} + +static int +sysctl_kmaps(SYSCTL_HANDLER_ARGS) +{ + struct pmap_kernel_map_range range; + struct sbuf sbuf, *sb; + pml4_entry_t pml4e; + pdp_entry_t *pdp, pdpe; + pd_entry_t *pd, pde; + pt_entry_t *pt, pte; + vm_offset_t sva; + vm_paddr_t pa; + int error, i, j, k, l; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sb = &sbuf; + sbuf_new_for_sysctl(sb, NULL, PAGE_SIZE, req); + + /* Sentinel value. */ + range.sva = KVADDR(NPML4EPG - 1, NPDPEPG - 1, NPDEPG - 1, NPTEPG - 1); + + /* + * Iterate over the kernel page tables without holding the kernel pmap + * lock. Outside of the large map, kernel page table pages are never + * freed, so at worst we will observe inconsistencies in the output. + * Within the large map, ensure that PDP and PD page addresses are + * valid before descending. + */ + for (sva = 0, i = pmap_pml4e_index(sva); i < NPML4EPG; i++) { + switch (i) { + case PML4PML4I: + sbuf_printf(sb, "\nRecursive map:\n"); + break; + case DMPML4I: + sbuf_printf(sb, "\nDirect map:\n"); + break; + case KPML4BASE: + sbuf_printf(sb, "\nKernel map:\n"); + break; + case LMSPML4I: + sbuf_printf(sb, "\nLarge map:\n"); + break; + } + + /* Convert to canonical form. */ + if (sva == 1ul << 47) + sva |= -1ul << 48; + +restart: + pml4e = kernel_pmap->pm_pml4[i]; + if ((pml4e & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPML4); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPML4; + continue; + } + pa = pml4e & PG_FRAME; + pdp = (pdp_entry_t *)PHYS_TO_DMAP(pa); + + for (j = pmap_pdpe_index(sva); j < NPDPEPG; j++) { + pdpe = pdp[j]; + if ((pdpe & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPDP); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPDP; + continue; + } + pa = pdpe & PG_FRAME; + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) + goto restart; + if ((pdpe & PG_PS) != 0) { + sva = rounddown2(sva, NBPDP); + sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, + 0, 0); + range.pdpes++; + sva += NBPDP; + continue; + } + pd = (pd_entry_t *)PHYS_TO_DMAP(pa); + + for (k = pmap_pde_index(sva); k < NPDEPG; k++) { + pde = pd[k]; + if ((pde & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPDR); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPDR; + continue; + } + pa = pde & PG_FRAME; + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) + goto restart; + if ((pde & PG_PS) != 0) { + sva = rounddown2(sva, NBPDR); + sysctl_kmaps_check(sb, &range, sva, + pml4e, pdpe, pde, 0); + range.pdes++; + sva += NBPDR; + continue; + } + pt = (pt_entry_t *)PHYS_TO_DMAP(pa); + + for (l = pmap_pte_index(sva); l < NPTEPG; l++, + sva += PAGE_SIZE) { + pte = pt[l]; + if ((pte & X86_PG_V) == 0) { + sysctl_kmaps_dump(sb, &range, + sva); + continue; + } + sysctl_kmaps_check(sb, &range, sva, + pml4e, pdpe, pde, pte); + range.ptes++; + } + } + } + } + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} +SYSCTL_OID(_vm_pmap, OID_AUTO, kernel_maps, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_kmaps, "A", + "Dump kernel address layout"); + #ifdef DDB DB_SHOW_COMMAND(pte, pmap_print_pte) { @@ -9930,25 +10231,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) PG_V = pmap_valid_bit(pmap); pml4 = pmap_pml4e(pmap, va); - db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + db_printf("VA 0x%016lx pml4e 0x%016lx", va, *pml4); if ((*pml4 & PG_V) == 0) { db_printf("\n"); return; } pdp = pmap_pml4e_to_pdpe(pml4, va); - db_printf(" pdpe %#016lx", *pdp); + db_printf(" pdpe 0x%016lx", *pdp); if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { db_printf("\n"); return; } pde = pmap_pdpe_to_pde(pdp, va); - db_printf(" pde %#016lx", *pde); + db_printf(" pde 0x%016lx", *pde); if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { db_printf("\n"); return; } pte = pmap_pde_to_pte(pde, va); - db_printf(" pte %#016lx\n", *pte); + db_printf(" pte 0x%016lx\n", *pte); } DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) From owner-svn-src-all@freebsd.org Sun Sep 29 23:47:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F098612DD3F; Sun, 29 Sep 2019 23:47:23 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hMdl64SBz46YY; Sun, 29 Sep 2019 23:47:23 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3FA521D35; Sun, 29 Sep 2019 23:47:23 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8TNlNMc032054; Sun, 29 Sep 2019 23:47:23 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8TNlNPl032053; Sun, 29 Sep 2019 23:47:23 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201909292347.x8TNlNPl032053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Sun, 29 Sep 2019 23:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352878 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: ray X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 352878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Sep 2019 23:47:24 -0000 Author: ray Date: Sun Sep 29 23:47:23 2019 New Revision: 352878 URL: https://svnweb.freebsd.org/changeset/base/352878 Log: Initialize baseaddr to suppres warning. Pointy hat to: ray Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 22:41:06 2019 (r352877) +++ head/contrib/elftoolchain/elfcopy/binary.c Sun Sep 29 23:47:23 2019 (r352878) @@ -58,6 +58,7 @@ create_binary(int ifd, int ofd) errx(EXIT_FAILURE, "elf_begin() failed: %s", elf_errmsg(-1)); + baseaddr = 0; baseoff = 0; if (lseek(ofd, baseoff, SEEK_SET) < 0) err(EXIT_FAILURE, "lseek failed"); From owner-svn-src-all@freebsd.org Mon Sep 30 00:01:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 575EA12E20D; Mon, 30 Sep 2019 00:01:55 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hMyW1fFgz475n; Mon, 30 Sep 2019 00:01:55 +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 001BC220B6; Mon, 30 Sep 2019 00:01:54 +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 x8U01sH2043344; Mon, 30 Sep 2019 00:01:54 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U01sue043341; Mon, 30 Sep 2019 00:01:54 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909300001.x8U01sue043341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 30 Sep 2019 00:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352879 - stable/12/share/timedef X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/share/timedef X-SVN-Commit-Revision: 352879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 00:01:55 -0000 Author: lwhsu Date: Mon Sep 30 00:01:54 2019 New Revision: 352879 URL: https://svnweb.freebsd.org/changeset/base/352879 Log: MFC r349225: Finsh readding Big5 in r317204, which was reverting r315568. This commit reverts r315569. Reported by: Ting-Wei Lan Discussed with: kevlo Sponsored by: The FreeBSD Foundation Added: stable/12/share/timedef/zh_TW.Big5.src - copied unchanged from r349225, head/share/timedef/zh_TW.Big5.src Modified: stable/12/share/timedef/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/timedef/Makefile ============================================================================== --- stable/12/share/timedef/Makefile Sun Sep 29 23:47:23 2019 (r352878) +++ stable/12/share/timedef/Makefile Mon Sep 30 00:01:54 2019 (r352879) @@ -128,6 +128,7 @@ LOCALES+= zh_CN.GBK LOCALES+= zh_CN.UTF-8 LOCALES+= zh_CN.eucCN LOCALES+= zh_HK.UTF-8 +LOCALES+= zh_TW.Big5 LOCALES+= zh_TW.UTF-8 Copied: stable/12/share/timedef/zh_TW.Big5.src (from r349225, head/share/timedef/zh_TW.Big5.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/timedef/zh_TW.Big5.src Mon Sep 30 00:01:54 2019 (r352879, copy of r349225, head/share/timedef/zh_TW.Big5.src) @@ -0,0 +1,87 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# Short month names +¡@¢°¤ë +¡@¢±¤ë +¡@¢²¤ë +¡@¢³¤ë +¡@¢´¤ë +¡@¢µ¤ë +¡@¢¶¤ë +¡@¢·¤ë +¡@¢¸¤ë +¢°¢¯¤ë +¢°¢°¤ë +¢°¢±¤ë +# +# Long month names (as in a date) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# Short weekday names +¶g¤é +¶g¤@ +¶g¤G +¶g¤T +¶g¥| +¶g¤­ +¶g¤» +# +# Long weekday names +¬P´Á¤é +¬P´Á¤@ +¬P´Á¤G +¬P´Á¤T +¬P´Á¥| +¬P´Á¤­ +¬P´Á¤» +# +# X_fmt +%H®É%M¤À%S¬í +# +# x_fmt +%Y/%m/%d +# +# c_fmt +%a %b/%e %T %Y +# +# AM/PM +¤W¤È +¤U¤È +# +# date_fmt +%Y¦~%_m¤ë%e¤é %A %X %Z +# +# Long month names (without case ending) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# md_order +md +# +# ampm_fmt +%I:%M:%S %p +# EOF From owner-svn-src-all@freebsd.org Mon Sep 30 01:24:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 422D312F671; Mon, 30 Sep 2019 01:24:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hPp513xqz49vp; Mon, 30 Sep 2019 01:24:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0324522F1B; Mon, 30 Sep 2019 01:24:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8U1OiOH090130; Mon, 30 Sep 2019 01:24:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U1Oi5g090129; Mon, 30 Sep 2019 01:24:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909300124.x8U1Oi5g090129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 01:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352880 - stable/12/sys/dev/jme X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/jme X-SVN-Commit-Revision: 352880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 01:24:45 -0000 Author: markj Date: Mon Sep 30 01:24:44 2019 New Revision: 352880 URL: https://svnweb.freebsd.org/changeset/base/352880 Log: MFC r352626: Fix a harmless typo. Modified: stable/12/sys/dev/jme/if_jme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/jme/if_jme.c ============================================================================== --- stable/12/sys/dev/jme/if_jme.c Mon Sep 30 00:01:54 2019 (r352879) +++ stable/12/sys/dev/jme/if_jme.c Mon Sep 30 01:24:44 2019 (r352880) @@ -569,7 +569,7 @@ jme_map_intr_vector(struct jme_softc *sc) MSINUM_INTR_SOURCE(2, N_INTR_TXQ3_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ4_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ4_COMP); - map[MSINUM_REG_INDEX(N_INTR_TXQ4_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_TXQ5_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ5_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ6_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ6_COMP); From owner-svn-src-all@freebsd.org Mon Sep 30 01:25:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3807D12F6D6; Mon, 30 Sep 2019 01:25:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hPpg0l9Rz4B2r; Mon, 30 Sep 2019 01:25:15 +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 F23A922F1C; Mon, 30 Sep 2019 01:25:14 +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 x8U1PEgF090217; Mon, 30 Sep 2019 01:25:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U1PEQD090216; Mon, 30 Sep 2019 01:25:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909300125.x8U1PEQD090216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 01:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352881 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 352881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 01:25:15 -0000 Author: markj Date: Mon Sep 30 01:25:14 2019 New Revision: 352881 URL: https://svnweb.freebsd.org/changeset/base/352881 Log: MFC r352624: Set NX on some non-leaf direct map page table entries. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Mon Sep 30 01:24:44 2019 (r352880) +++ stable/12/sys/amd64/amd64/pmap.c Mon Sep 30 01:25:14 2019 (r352881) @@ -1544,13 +1544,13 @@ create_pagetables(vm_paddr_t *firstaddr) } for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); - pdp_p[i] |= X86_PG_RW | X86_PG_V; + pdp_p[i] |= X86_PG_RW | X86_PG_V | pg_nx; } /* * Instead of using a 1G page for the memory containing the kernel, - * use 2M pages with appropriate permissions. (If using 1G pages, - * this will partially overwrite the PDPEs above.) + * use 2M pages with read-only and no-execute permissions. (If using 1G + * pages, this will partially overwrite the PDPEs above.) */ if (ndm1g) { pd_p = (pd_entry_t *)DMPDkernphys; @@ -1560,7 +1560,7 @@ create_pagetables(vm_paddr_t *firstaddr) bootaddr_rwx(i << PDRSHIFT); for (i = 0; i < nkdmpde; i++) pdp_p[i] = (DMPDkernphys + ptoa(i)) | X86_PG_RW | - X86_PG_V; + X86_PG_V | pg_nx; } /* And recursively map PML4 to itself in order to get PTmap */ @@ -1571,7 +1571,7 @@ create_pagetables(vm_paddr_t *firstaddr) /* Connect the Direct Map slot(s) up to the PML4. */ for (i = 0; i < ndmpdpphys; i++) { p4_p[DMPML4I + i] = DMPDPphys + ptoa(i); - p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V; + p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V | pg_nx; } /* Connect the KVA slots up to the PML4 */ From owner-svn-src-all@freebsd.org Mon Sep 30 01:25:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF05D12F73E; Mon, 30 Sep 2019 01:25: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hPq648pVz4B90; Mon, 30 Sep 2019 01:25:38 +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 7306A22F1D; Mon, 30 Sep 2019 01:25:38 +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 x8U1PcSA090285; Mon, 30 Sep 2019 01:25:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U1PbIb090280; Mon, 30 Sep 2019 01:25:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909300125.x8U1PbIb090280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 01:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352882 - in stable/12/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Commit-Revision: 352882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 01:25:38 -0000 Author: markj Date: Mon Sep 30 01:25:37 2019 New Revision: 352882 URL: https://svnweb.freebsd.org/changeset/base/352882 Log: MFC r352627: Implement x86 dtrace_invop_(un)init() in C. Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Mon Sep 30 01:25:14 2019 (r352881) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Mon Sep 30 01:25:37 2019 (r352882) @@ -150,22 +150,6 @@ bp_ret: END(dtrace_invop_start) /* -void dtrace_invop_init(void) -*/ - ENTRY(dtrace_invop_init) - movq $dtrace_invop_start, dtrace_invop_jump_addr(%rip) - ret - END(dtrace_invop_init) - -/* -void dtrace_invop_uninit(void) -*/ - ENTRY(dtrace_invop_uninit) - movq $0, dtrace_invop_jump_addr(%rip) - ret - END(dtrace_invop_uninit) - -/* greg_t dtrace_getfp(void) */ ENTRY(dtrace_getfp) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Sep 30 01:25:14 2019 (r352881) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Sep 30 01:25:37 2019 (r352882) @@ -48,8 +48,12 @@ #include extern void dtrace_getnanotime(struct timespec *tsp); +extern int (*dtrace_invop_jump_addr)(struct trapframe *); -int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop_start(struct trapframe *frame); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); @@ -107,6 +111,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap } kmem_free(hdlr, 0); +} + +void +dtrace_invop_init(void) +{ + + dtrace_invop_jump_addr = dtrace_invop_start; +} + +void +dtrace_invop_uninit(void) +{ + + dtrace_invop_jump_addr = NULL; } /*ARGSUSED*/ Modified: stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S Mon Sep 30 01:25:14 2019 (r352881) +++ stable/12/sys/cddl/dev/dtrace/i386/dtrace_asm.S Mon Sep 30 01:25:37 2019 (r352882) @@ -135,22 +135,6 @@ invop_nop: END(dtrace_invop_start) /* -void dtrace_invop_init(void) -*/ - ENTRY(dtrace_invop_init) - movl $dtrace_invop_start, dtrace_invop_jump_addr - ret - END(dtrace_invop_init) - -/* -void dtrace_invop_uninit(void) -*/ - ENTRY(dtrace_invop_uninit) - movl $0, dtrace_invop_jump_addr - ret - END(dtrace_invop_uninit) - -/* greg_t dtrace_getfp(void) */ Modified: stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Sep 30 01:25:14 2019 (r352881) +++ stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Sep 30 01:25:37 2019 (r352882) @@ -51,8 +51,12 @@ extern uintptr_t kernelbase; extern void dtrace_getnanotime(struct timespec *tsp); +extern int (*dtrace_invop_jump_addr)(struct trapframe *); -int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop_start(struct trapframe *frame); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); @@ -110,6 +114,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap } kmem_free(hdlr, 0); +} + +void +dtrace_invop_init(void) +{ + + dtrace_invop_jump_addr = dtrace_invop_start; +} + +void +dtrace_invop_uninit(void) +{ + + dtrace_invop_jump_addr = NULL; } void From owner-svn-src-all@freebsd.org Mon Sep 30 01:59:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DDAF12FDAB; Mon, 30 Sep 2019 01:59:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hQZ83fThz4C5x; Mon, 30 Sep 2019 01:59:28 +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 605BA2346E; Mon, 30 Sep 2019 01:59:28 +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 x8U1xSqT008208; Mon, 30 Sep 2019 01:59:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U1xRWZ008205; Mon, 30 Sep 2019 01:59:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909300159.x8U1xRWZ008205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 30 Sep 2019 01:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352883 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 352883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 01:59:28 -0000 Author: imp Date: Mon Sep 30 01:59:27 2019 New Revision: 352883 URL: https://svnweb.freebsd.org/changeset/base/352883 Log: MFC r351828: Support doorbell strides != 0. Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c stable/12/sys/dev/nvme/nvme_private.h stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Sep 30 01:25:37 2019 (r352882) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Sep 30 01:59:27 2019 (r352883) @@ -90,19 +90,25 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller struct nvme_qpair *qpair; uint32_t cap_lo; uint16_t mqes; - int i, error, num_entries, num_trackers; + int i, error, num_entries, num_trackers, max_entries; - num_entries = NVME_IO_ENTRIES; - TUNABLE_INT_FETCH("hw.nvme.io_entries", &num_entries); - /* - * NVMe spec sets a hard limit of 64K max entries, but - * devices may specify a smaller limit, so we need to check - * the MQES field in the capabilities register. + * NVMe spec sets a hard limit of 64K max entries, but devices may + * specify a smaller limit, so we need to check the MQES field in the + * capabilities register. We have to cap the number of entries to the + * current stride allows for in BAR 0/1, otherwise the remainder entries + * are inaccessable. MQES should reflect this, and this is just a + * fail-safe. */ + max_entries = + (rman_get_size(ctrlr->resource) - nvme_mmio_offsetof(doorbell[0])) / + (1 << (ctrlr->dstrd + 1)); + num_entries = NVME_IO_ENTRIES; + TUNABLE_INT_FETCH("hw.nvme.io_entries", &num_entries); cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); mqes = NVME_CAP_LO_MQES(cap_lo); num_entries = min(num_entries, mqes + 1); + num_entries = min(num_entries, max_entries); num_trackers = NVME_IO_TRACKERS; TUNABLE_INT_FETCH("hw.nvme.io_trackers", &num_trackers); @@ -110,9 +116,9 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller num_trackers = max(num_trackers, NVME_MIN_IO_TRACKERS); num_trackers = min(num_trackers, NVME_MAX_IO_TRACKERS); /* - * No need to have more trackers than entries in the submit queue. - * Note also that for a queue size of N, we can only have (N-1) - * commands outstanding, hence the "-1" here. + * No need to have more trackers than entries in the submit queue. Note + * also that for a queue size of N, we can only have (N-1) commands + * outstanding, hence the "-1" here. */ num_trackers = min(num_trackers, (num_entries-1)); @@ -1120,7 +1126,6 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de uint32_t cap_lo; uint32_t cap_hi; uint32_t to; - uint8_t dstrd; uint8_t mpsmin; int status, timeout_period; @@ -1128,14 +1133,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de mtx_init(&ctrlr->lock, "nvme ctrlr lock", NULL, MTX_DEF); - /* - * Software emulators may set the doorbell stride to something - * other than zero, but this driver is not set up to handle that. - */ cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); - dstrd = NVME_CAP_HI_DSTRD(cap_hi); - if (dstrd != 0) - return (ENXIO); + ctrlr->dstrd = NVME_CAP_HI_DSTRD(cap_hi) + 2; mpsmin = NVME_CAP_HI_MPSMIN(cap_hi); ctrlr->min_page_size = 1 << (12 + mpsmin); Modified: stable/12/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/12/sys/dev/nvme/nvme_private.h Mon Sep 30 01:25:37 2019 (r352882) +++ stable/12/sys/dev/nvme/nvme_private.h Mon Sep 30 01:59:27 2019 (r352883) @@ -297,6 +297,9 @@ struct nvme_controller { /** timeout period in seconds */ uint32_t timeout_period; + /** doorbell stride */ + uint32_t dstrd; + struct nvme_qpair adminq; struct nvme_qpair *ioq; Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Mon Sep 30 01:25:37 2019 (r352882) +++ stable/12/sys/dev/nvme/nvme_qpair.c Mon Sep 30 01:59:27 2019 (r352883) @@ -622,8 +622,8 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai qpair->phase = !qpair->phase; /* 3 */ } - nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].cq_hdbl, - qpair->cq_head); + bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle, + qpair->cq_hdbl_off, qpair->cq_head); } return (done != 0); } @@ -731,8 +731,15 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ qpair->cpl_bus_addr = queuemem_phys + cmdsz; prpmem_phys = queuemem_phys + cmdsz + cplsz; - qpair->sq_tdbl_off = nvme_mmio_offsetof(doorbell[id].sq_tdbl); - qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[id].cq_hdbl); + /* + * Calcuate the stride of the doorbell register. Many emulators set this + * value to correspond to a cache line. However, some hardware has set + * it to various small values. + */ + qpair->sq_tdbl_off = nvme_mmio_offsetof(doorbell[0]) + + (id << (ctrlr->dstrd + 1)); + qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[0]) + + (id << (ctrlr->dstrd + 1)) + (1 << ctrlr->dstrd); TAILQ_INIT(&qpair->free_tr); TAILQ_INIT(&qpair->outstanding_tr); @@ -950,9 +957,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st wmb(); #endif - nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].sq_tdbl, - qpair->sq_tail); - + bus_space_write_4(qpair->ctrlr->bus_tag, qpair->ctrlr->bus_handle, + qpair->sq_tdbl_off, qpair->sq_tail); qpair->num_cmds++; } From owner-svn-src-all@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C67BF8730; Mon, 30 Sep 2019 02:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hRJh37Nfz4DL8; Mon, 30 Sep 2019 02:32: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 4EB9023B88; Mon, 30 Sep 2019 02:32: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 x8U2WqIP031111; Mon, 30 Sep 2019 02:32:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U2Wq89031110; Mon, 30 Sep 2019 02:32:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909300232.x8U2Wq89031110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 30 Sep 2019 02:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352884 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 352884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 02:32:52 -0000 Author: cy Date: Mon Sep 30 02:32:51 2019 New Revision: 352884 URL: https://svnweb.freebsd.org/changeset/base/352884 Log: MFC r352783: Fix a typo. Modified: stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ippool.8 Mon Sep 30 01:59:27 2019 (r352883) +++ stable/12/contrib/ipfilter/man/ippool.8 Mon Sep 30 02:32:51 2019 (r352884) @@ -108,7 +108,7 @@ Sets the hashing seed to the number specified. Only f type pools. .TP .B -t -Sets the type of pool being defined. Myst be one of +Sets the type of pool being defined. Must be one of .B tree, .B hash, .B group-map. From owner-svn-src-all@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD44BF8737; Mon, 30 Sep 2019 02:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hRJh5Tp0z4DL9; Mon, 30 Sep 2019 02:32: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 A02DD23B89; Mon, 30 Sep 2019 02:32: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 x8U2Wq1a031117; Mon, 30 Sep 2019 02:32:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U2WqY7031116; Mon, 30 Sep 2019 02:32:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909300232.x8U2WqY7031116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 30 Sep 2019 02:32:52 +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: r352884 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 352884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 02:32:52 -0000 Author: cy Date: Mon Sep 30 02:32:51 2019 New Revision: 352884 URL: https://svnweb.freebsd.org/changeset/base/352884 Log: MFC r352783: Fix a typo. Modified: stable/10/contrib/ipfilter/man/ippool.8 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/10/contrib/ipfilter/man/ippool.8 Mon Sep 30 01:59:27 2019 (r352883) +++ stable/10/contrib/ipfilter/man/ippool.8 Mon Sep 30 02:32:51 2019 (r352884) @@ -108,7 +108,7 @@ Sets the hashing seed to the number specified. Only f type pools. .TP .B -t -Sets the type of pool being defined. Myst be one of +Sets the type of pool being defined. Must be one of .B tree, .B hash, .B group-map. From owner-svn-src-all@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D92FF872C; Mon, 30 Sep 2019 02:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hRJh0j1Yz4DL7; Mon, 30 Sep 2019 02:32: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 F03CA23B87; Mon, 30 Sep 2019 02:32: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 x8U2WpcN031103; Mon, 30 Sep 2019 02:32:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U2WpGf031102; Mon, 30 Sep 2019 02:32:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909300232.x8U2WpGf031102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 30 Sep 2019 02:32: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: r352884 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 352884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 02:32:52 -0000 Author: cy Date: Mon Sep 30 02:32:51 2019 New Revision: 352884 URL: https://svnweb.freebsd.org/changeset/base/352884 Log: MFC r352783: Fix a typo. Modified: stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Mon Sep 30 01:59:27 2019 (r352883) +++ stable/11/contrib/ipfilter/man/ippool.8 Mon Sep 30 02:32:51 2019 (r352884) @@ -108,7 +108,7 @@ Sets the hashing seed to the number specified. Only f type pools. .TP .B -t -Sets the type of pool being defined. Myst be one of +Sets the type of pool being defined. Must be one of .B tree, .B hash, .B group-map. From owner-svn-src-all@freebsd.org Mon Sep 30 03:35:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BB91F9AC7; Mon, 30 Sep 2019 03:35:49 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hSjK2PZnz4H9V; Mon, 30 Sep 2019 03:35:49 +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 36A36246CE; Mon, 30 Sep 2019 03:35:49 +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 x8U3Zndi068087; Mon, 30 Sep 2019 03:35:49 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U3Zm2I068086; Mon, 30 Sep 2019 03:35:48 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909300335.x8U3Zm2I068086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 30 Sep 2019 03:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352885 - releng/12.1/share/timedef X-SVN-Group: releng X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: releng/12.1/share/timedef X-SVN-Commit-Revision: 352885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 03:35:49 -0000 Author: lwhsu Date: Mon Sep 30 03:35:48 2019 New Revision: 352885 URL: https://svnweb.freebsd.org/changeset/base/352885 Log: MFC r349225: Finsh readding Big5 in r317204, which was reverting r315568. This commit reverts r315569. Reported by: Ting-Wei Lan Discussed with: kevlo Sponsored by: The FreeBSD Foundation Approved by: re (delphij) Added: releng/12.1/share/timedef/zh_TW.Big5.src - copied unchanged from r352879, stable/12/share/timedef/zh_TW.Big5.src Modified: releng/12.1/share/timedef/Makefile Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/share/timedef/Makefile ============================================================================== --- releng/12.1/share/timedef/Makefile Mon Sep 30 02:32:51 2019 (r352884) +++ releng/12.1/share/timedef/Makefile Mon Sep 30 03:35:48 2019 (r352885) @@ -128,6 +128,7 @@ LOCALES+= zh_CN.GBK LOCALES+= zh_CN.UTF-8 LOCALES+= zh_CN.eucCN LOCALES+= zh_HK.UTF-8 +LOCALES+= zh_TW.Big5 LOCALES+= zh_TW.UTF-8 Copied: releng/12.1/share/timedef/zh_TW.Big5.src (from r352879, stable/12/share/timedef/zh_TW.Big5.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.1/share/timedef/zh_TW.Big5.src Mon Sep 30 03:35:48 2019 (r352885, copy of r352879, stable/12/share/timedef/zh_TW.Big5.src) @@ -0,0 +1,87 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# Short month names +¡@¢°¤ë +¡@¢±¤ë +¡@¢²¤ë +¡@¢³¤ë +¡@¢´¤ë +¡@¢µ¤ë +¡@¢¶¤ë +¡@¢·¤ë +¡@¢¸¤ë +¢°¢¯¤ë +¢°¢°¤ë +¢°¢±¤ë +# +# Long month names (as in a date) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# Short weekday names +¶g¤é +¶g¤@ +¶g¤G +¶g¤T +¶g¥| +¶g¤­ +¶g¤» +# +# Long weekday names +¬P´Á¤é +¬P´Á¤@ +¬P´Á¤G +¬P´Á¤T +¬P´Á¥| +¬P´Á¤­ +¬P´Á¤» +# +# X_fmt +%H®É%M¤À%S¬í +# +# x_fmt +%Y/%m/%d +# +# c_fmt +%a %b/%e %T %Y +# +# AM/PM +¤W¤È +¤U¤È +# +# date_fmt +%Y¦~%_m¤ë%e¤é %A %X %Z +# +# Long month names (without case ending) +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë +# +# md_order +md +# +# ampm_fmt +%I:%M:%S %p +# EOF From owner-svn-src-all@freebsd.org Mon Sep 30 04:54:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38E1AFB45D; Mon, 30 Sep 2019 04:54:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hVRb0dBgz4Nfs; Mon, 30 Sep 2019 04:54:03 +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 EDE9B2551B; Mon, 30 Sep 2019 04:54:02 +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 x8U4s2Ec019210; Mon, 30 Sep 2019 04:54:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U4s2Mc019209; Mon, 30 Sep 2019 04:54:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909300454.x8U4s2Mc019209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 30 Sep 2019 04:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352886 - releng/12.1/sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: releng/12.1/sys/netinet X-SVN-Commit-Revision: 352886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 04:54:03 -0000 Author: tuexen Date: Mon Sep 30 04:54:02 2019 New Revision: 352886 URL: https://svnweb.freebsd.org/changeset/base/352886 Log: MFS r352508: Don't write to memory outside of the allocated array for SACK blocks. PR: 240837 Approved by: re (delphij@) Obtained from: rrs@ Sponsored by: Netflix, Inc. Modified: releng/12.1/sys/netinet/tcp_sack.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/netinet/tcp_sack.c ============================================================================== --- releng/12.1/sys/netinet/tcp_sack.c Mon Sep 30 03:35:48 2019 (r352885) +++ releng/12.1/sys/netinet/tcp_sack.c Mon Sep 30 04:54:02 2019 (r352886) @@ -235,7 +235,7 @@ tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_st saved_blks[n].start = mid_blk.start; saved_blks[n++].end = mid_blk.end; } - for (j = 0; (j < tp->rcv_numsacks) && (j < MAX_SACK_BLKS-1); j++) { + for (j = 0; (j < tp->rcv_numsacks) && (n < MAX_SACK_BLKS); j++) { if (((SEQ_LT(tp->sackblks[j].end, mid_blk.start) || SEQ_GT(tp->sackblks[j].start, mid_blk.end)) && (SEQ_GT(tp->sackblks[j].start, tp->rcv_nxt)))) From owner-svn-src-all@freebsd.org Mon Sep 30 05:43:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D765AFC1DB; Mon, 30 Sep 2019 05:43:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hWY95DF6z4Qy0; Mon, 30 Sep 2019 05:43:57 +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 965EC25DEA; Mon, 30 Sep 2019 05:43:57 +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 x8U5hvmW049074; Mon, 30 Sep 2019 05:43:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U5hvfi049073; Mon, 30 Sep 2019 05:43:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909300543.x8U5hvfi049073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 30 Sep 2019 05:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352887 - stable/12/sbin/newfs_msdos X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/newfs_msdos X-SVN-Commit-Revision: 352887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 05:43:57 -0000 Author: delphij Date: Mon Sep 30 05:43:57 2019 New Revision: 352887 URL: https://svnweb.freebsd.org/changeset/base/352887 Log: MFC r351382: When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for FSI_Nxt_Free instead of providing a wrong value. With this change, fsck_msdosfs would no longer complain about invalid FSInfo information. Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- stable/12/sbin/newfs_msdos/mkfs_msdos.c Mon Sep 30 04:54:02 2019 (r352886) +++ stable/12/sbin/newfs_msdos/mkfs_msdos.c Mon Sep 30 05:43:57 2019 (r352887) @@ -717,7 +717,7 @@ mkfs_msdos(const char *fname, const char *dtype, const mk4(img, 0x41615252); mk4(img + MINBPS - 28, 0x61417272); mk4(img + MINBPS - 24, 0xffffffff); - mk4(img + MINBPS - 20, bpb.bpbRootClust); + mk4(img + MINBPS - 20, 0xffffffff); mk2(img + MINBPS - 2, DOSMAGIC); } else if (lsn >= bpb.bpbResSectors && lsn < dir && !((lsn - bpb.bpbResSectors) % From owner-svn-src-all@freebsd.org Mon Sep 30 06:04:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1176FC786; Mon, 30 Sep 2019 06:04:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hX0l4D0xz4Rm2; Mon, 30 Sep 2019 06:04:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70C8126160; Mon, 30 Sep 2019 06:04: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 x8U64Nb2061335; Mon, 30 Sep 2019 06:04:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U64NXx061334; Mon, 30 Sep 2019 06:04:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909300604.x8U64NXx061334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 30 Sep 2019 06:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352888 - stable/12/sys/contrib/zlib X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/contrib/zlib X-SVN-Commit-Revision: 352888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 06:04:23 -0000 Author: delphij Date: Mon Sep 30 06:04:22 2019 New Revision: 352888 URL: https://svnweb.freebsd.org/changeset/base/352888 Log: MFC r351501: MFV r351500: Fix CLEAR_HASH macro to be usable as a single statement. Modified: stable/12/sys/contrib/zlib/deflate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/zlib/deflate.c ============================================================================== --- stable/12/sys/contrib/zlib/deflate.c Mon Sep 30 05:43:57 2019 (r352887) +++ stable/12/sys/contrib/zlib/deflate.c Mon Sep 30 06:04:22 2019 (r352888) @@ -190,8 +190,11 @@ local const config configuration_table[10] = { * prev[] will be initialized on the fly. */ #define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + do { \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, \ + (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + } while (0) /* =========================================================================== * Slide the hash table when sliding the window down (could be avoided with 32 From owner-svn-src-all@freebsd.org Mon Sep 30 06:09:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E9D6FC850; Mon, 30 Sep 2019 06:09:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hX6h6rSyz4Rvh; Mon, 30 Sep 2019 06:09:32 +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 CF41A26164; Mon, 30 Sep 2019 06:09:32 +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 x8U69WWt061690; Mon, 30 Sep 2019 06:09:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U69W9a061688; Mon, 30 Sep 2019 06:09:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909300609.x8U69W9a061688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 30 Sep 2019 06:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352889 - stable/12/usr.bin/top X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/usr.bin/top X-SVN-Commit-Revision: 352889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 06:09:33 -0000 Author: dim Date: Mon Sep 30 06:09:32 2019 New Revision: 352889 URL: https://svnweb.freebsd.org/changeset/base/352889 Log: MFC r352804: Correct the final argument name in the top(1) manpage. The description talks about 'number', while the final argument was 'count'. Since 'count' is already used for the count of displays, change the final argument name to 'number'. MFC r352818: Make fractional delays for top(1) work for interactive mode. In r334906, the -s option was changed to allow fractional times, but this only functioned correctly for batch mode. In interactive mode, any delay below 1.0 would get floored to zero. This would put top(1) into a tight loop, which could be difficult to interrupt. Fix this by storing the -s option value (after validation) into a struct timeval, and using that struct consistently for delaying with select(2). Next up is to allow interactive entry of a fractional delay value. MFC r352819: Allow entering fractional delays in top(1) interactive mode. This uses the same logic as with the -s option, first validating the entered value, then storing the result in a struct timeval. Modified: stable/12/usr.bin/top/top.1 stable/12/usr.bin/top/top.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/top/top.1 ============================================================================== --- stable/12/usr.bin/top/top.1 Mon Sep 30 06:04:22 2019 (r352888) +++ stable/12/usr.bin/top/top.1 Mon Sep 30 06:09:32 2019 (r352889) @@ -15,7 +15,7 @@ .Op Fl s Ar time .Op Fl o Ar field .Op Fl p Ar pid -.Op Ar count +.Op Ar number .Sh DESCRIPTION .Nm displays the top @@ -144,7 +144,7 @@ no information is available about the percentage of ti .It Fl s Ar time Set the delay between screen updates to .Ar time -seconds. +seconds, which may be fractional. The default delay between updates is 1 second. .It Fl o Ar field Sort the process display area on the specified field. Modified: stable/12/usr.bin/top/top.c ============================================================================== --- stable/12/usr.bin/top/top.c Mon Sep 30 06:04:22 2019 (r352888) +++ stable/12/usr.bin/top/top.c Mon Sep 30 06:09:32 2019 (r352889) @@ -232,7 +232,7 @@ main(int argc, const char *argv[]) static char tempbuf2[50]; sigset_t old_sigmask, new_sigmask; int topn = Infinity; - double delay = 2; + struct timeval delay = { 2, 0 }; int displays = 0; /* indicates unspecified */ int sel_ret = 0; time_t curr_time; @@ -371,21 +371,27 @@ main(int argc, const char *argv[]) break; } - case 's': - delay = strtod(optarg, &nptr); - if (nptr == optarg) { - warnx("warning: invalid delay"); - delay = 2; - warnings++; - } - if (delay < 0) { - warnx("warning: seconds delay should be positive -- using default"); - delay = 2; - warnings++; - } + case 's': + { + double delay_d = strtod(optarg, &nptr); + if (nptr == optarg) + { + warnx("warning: invalid delay"); + warnings++; + } + else if (delay_d <= 0) + { + warnx("warning: seconds delay should be positive -- using default"); + warnings++; + } + else + { + delay.tv_sec = delay_d; + delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; + } + break; + } - break; - case 'q': /* be quick about it */ errno = 0; i = setpriority(PRIO_PROCESS, 0, PRIO_MIN); @@ -698,7 +704,8 @@ restart: no_command = true; if (!interactive) { - usleep(delay * 1e6); + timeout = delay; + select(0, NULL, NULL, NULL, &timeout); if (leaveflag) { end_screen(); exit(0); @@ -712,8 +719,7 @@ restart: /* set up arguments for select with timeout */ FD_ZERO(&readfds); FD_SET(0, &readfds); /* for standard input */ - timeout.tv_sec = delay; - timeout.tv_usec = 0; + timeout = delay; if (leaveflag) { end_screen(); @@ -874,14 +880,22 @@ restart: case CMD_delay: /* new seconds delay */ new_message(MT_standout, "Seconds to delay: "); - if ((i = readline(tempbuf1, 8, true)) > -1) + if ((i = readline(tempbuf1, 8, false)) > 0) { - if ((delay = i) == 0) + double delay_d = strtod(tempbuf1, &nptr); + if (nptr == tempbuf1 || delay_d <= 0) { - delay = 1; + new_message(MT_standout, " Invalid delay"); + putchar('\r'); + no_command = true; } + else + { + delay.tv_sec = delay_d; + delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; + clear_message(); + } } - clear_message(); break; case CMD_displays: /* change display count */ From owner-svn-src-all@freebsd.org Mon Sep 30 06:38:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 336CDFD28D; Mon, 30 Sep 2019 06:38:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hXmC0ZGRz4TD5; Mon, 30 Sep 2019 06:38:35 +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 EB185266C1; Mon, 30 Sep 2019 06:38:34 +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 x8U6cYbW079253; Mon, 30 Sep 2019 06:38:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U6cYS9079252; Mon, 30 Sep 2019 06:38:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909300638.x8U6cYS9079252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 30 Sep 2019 06:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352890 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 06:38:35 -0000 Author: delphij Date: Mon Sep 30 06:38:34 2019 New Revision: 352890 URL: https://svnweb.freebsd.org/changeset/base/352890 Log: MFC r351417: r351417: INVARIANTS: treat LA_LOCKED as the same of LA_XLOCKED in mtx_assert. Modified: stable/12/sys/kern/kern_mutex.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mutex.c ============================================================================== --- stable/12/sys/kern/kern_mutex.c Mon Sep 30 06:09:32 2019 (r352889) +++ stable/12/sys/kern/kern_mutex.c Mon Sep 30 06:38:34 2019 (r352890) @@ -176,6 +176,21 @@ void assert_mtx(const struct lock_object *lock, int what) { + /* + * Treat LA_LOCKED as if LA_XLOCKED was asserted. + * + * Some callers of lc_assert uses LA_LOCKED to indicate that either + * a shared lock or write lock was held, while other callers uses + * the more strict LA_XLOCKED (used as MA_OWNED). + * + * Mutex is the only lock class that can not be shared, as a result, + * we can reasonably consider the caller really intends to assert + * LA_XLOCKED when they are asserting LA_LOCKED on a mutex object. + */ + if (what & LA_LOCKED) { + what &= ~LA_LOCKED; + what |= LA_XLOCKED; + } mtx_assert((const struct mtx *)lock, what); } From owner-svn-src-all@freebsd.org Mon Sep 30 07:27:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A4AFE160; Mon, 30 Sep 2019 07:27:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hYrD3VWRz4WFj; Mon, 30 Sep 2019 07:27:08 +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 575622704B; Mon, 30 Sep 2019 07:27: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 x8U7R87w008783; Mon, 30 Sep 2019 07:27:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U7R8ZI008782; Mon, 30 Sep 2019 07:27:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909300727.x8U7R8ZI008782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 30 Sep 2019 07:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352891 - stable/12/sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 352891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 07:27:08 -0000 Author: delphij Date: Mon Sep 30 07:27:07 2019 New Revision: 352891 URL: https://svnweb.freebsd.org/changeset/base/352891 Log: MFC r351325: r351325: Fix sound on headset jack for ThinkPad T51. Modified: stable/12/sys/dev/sound/pci/hda/hdaa_patches.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdaa_patches.c Mon Sep 30 06:38:34 2019 (r352890) +++ stable/12/sys/dev/sound/pci/hda/hdaa_patches.c Mon Sep 30 07:27:07 2019 (r352891) @@ -429,6 +429,15 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC298 && HDA_DEV_MATCH(LENOVO_ALL_SUBVENDOR, subid)) { + switch (nid) { + case 23: + config = 0x03a1103f; + break; + case 33: + config = 0x2121101f; + break; + } } else if (id == HDA_CODEC_ALC298 && subid == DELL_XPS9560_SUBVENDOR) { switch (nid) { case 24: From owner-svn-src-all@freebsd.org Mon Sep 30 07:42:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEB8FFE65F; Mon, 30 Sep 2019 07:42:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hZ9X4740z4Wt8; Mon, 30 Sep 2019 07:42:08 +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 70E8327393; Mon, 30 Sep 2019 07:42:08 +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 x8U7g8Cf019585; Mon, 30 Sep 2019 07:42:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U7g8UU019584; Mon, 30 Sep 2019 07:42:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909300742.x8U7g8UU019584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 30 Sep 2019 07:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352892 - stable/12/lib/libthr/thread X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libthr/thread X-SVN-Commit-Revision: 352892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 07:42:08 -0000 Author: kib Date: Mon Sep 30 07:42:07 2019 New Revision: 352892 URL: https://svnweb.freebsd.org/changeset/base/352892 Log: MFC r352620: Fix destruction of the robust mutexes. Modified: stable/12/lib/libthr/thread/thr_mutex.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libthr/thread/thr_mutex.c ============================================================================== --- stable/12/lib/libthr/thread/thr_mutex.c Mon Sep 30 07:27:07 2019 (r352891) +++ stable/12/lib/libthr/thread/thr_mutex.c Mon Sep 30 07:42:07 2019 (r352892) @@ -474,7 +474,11 @@ _thr_mutex_destroy(pthread_mutex_t *mutex) if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(_get_curthread(), m1); + if ((uint32_t)m1->m_lock.m_owner != + UMUTEX_RB_OWNERDEAD) { + mutex_assert_not_owned( + _get_curthread(), m1); + } __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED; From owner-svn-src-all@freebsd.org Mon Sep 30 07:43:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54E6AFE6D6; Mon, 30 Sep 2019 07:43:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hZBX1CSmz4X2g; Mon, 30 Sep 2019 07:43:00 +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 0CC93273BF; Mon, 30 Sep 2019 07:43:00 +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 x8U7gxtW020482; Mon, 30 Sep 2019 07:42:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8U7gxu4020481; Mon, 30 Sep 2019 07:42:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909300742.x8U7gxu4020481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 30 Sep 2019 07:42:59 +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: r352893 - stable/11/lib/libthr/thread X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libthr/thread X-SVN-Commit-Revision: 352893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 07:43:00 -0000 Author: kib Date: Mon Sep 30 07:42:59 2019 New Revision: 352893 URL: https://svnweb.freebsd.org/changeset/base/352893 Log: MFC r352620: Fix destruction of the robust mutexes. Modified: stable/11/lib/libthr/thread/thr_mutex.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libthr/thread/thr_mutex.c ============================================================================== --- stable/11/lib/libthr/thread/thr_mutex.c Mon Sep 30 07:42:07 2019 (r352892) +++ stable/11/lib/libthr/thread/thr_mutex.c Mon Sep 30 07:42:59 2019 (r352893) @@ -469,7 +469,11 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex) if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(_get_curthread(), m1); + if ((uint32_t)m1->m_lock.m_owner != + UMUTEX_RB_OWNERDEAD) { + mutex_assert_not_owned( + _get_curthread(), m1); + } __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED; From owner-svn-src-all@freebsd.org Mon Sep 30 12:06:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B2931266DF; Mon, 30 Sep 2019 12:06:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hh363fkcz3KXX; Mon, 30 Sep 2019 12:06:58 +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 60CA323B2; Mon, 30 Sep 2019 12:06:58 +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 x8UC6wc0077997; Mon, 30 Sep 2019 12:06:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UC6woZ077996; Mon, 30 Sep 2019 12:06:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909301206.x8UC6woZ077996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 30 Sep 2019 12:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352894 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 12:06:58 -0000 Author: tuexen Date: Mon Sep 30 12:06:57 2019 New Revision: 352894 URL: https://svnweb.freebsd.org/changeset/base/352894 Log: Don't use stack memory which is not initialized. Thanks to Mark Wodrich for reporting this issue for the userland stack in https://github.com/sctplab/usrsctp/issues/380 This issue was also found for usrsctp by OSS-fuzz in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17778 MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon Sep 30 07:42:59 2019 (r352893) +++ head/sys/netinet/sctp_asconf.c Mon Sep 30 12:06:57 2019 (r352894) @@ -236,6 +236,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc "process_asconf_add_ip: using source addr "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } + net = NULL; /* add the address */ if (bad_address) { m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -250,17 +251,19 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph, aparam_length); } else { - /* notify upper layer */ - sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); - if (send_hb) { - sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + if (net != NULL) { + /* notify upper layer */ + sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } } return (m_reply); From owner-svn-src-all@freebsd.org Mon Sep 30 13:26:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C88C127BF1; Mon, 30 Sep 2019 13:26:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hjpc6N69z3P78; Mon, 30 Sep 2019 13:26:16 +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 BA02F3206; Mon, 30 Sep 2019 13:26:16 +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 x8UDQG9L025347; Mon, 30 Sep 2019 13:26:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UDQGhF025346; Mon, 30 Sep 2019 13:26:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909301326.x8UDQGhF025346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 30 Sep 2019 13:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352895 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 13:26:17 -0000 Author: kevans Date: Mon Sep 30 13:26:16 2019 New Revision: 352895 URL: https://svnweb.freebsd.org/changeset/base/352895 Log: syscalls.master: consistency, move ); to newline (no functional change) Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Sep 30 12:06:57 2019 (r352894) +++ head/sys/kern/syscalls.master Mon Sep 30 13:26:16 2019 (r352895) @@ -3193,7 +3193,8 @@ _Out_writes_bytes_opt_(*oldlenp) void *old, _Inout_opt_ size_t *oldlenp, _In_reads_bytes_opt_(newlen) void *new, - size_t newlen); + size_t newlen + ); } 571 AUE_SHMOPEN STD { int shm_open2( From owner-svn-src-all@freebsd.org Mon Sep 30 13:33:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B28127FA7; Mon, 30 Sep 2019 13:33:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hjz62qm0z3PlV; Mon, 30 Sep 2019 13:33:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F1033C2; Mon, 30 Sep 2019 13:33:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UDXci9031151; Mon, 30 Sep 2019 13:33:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UDXclL031150; Mon, 30 Sep 2019 13:33:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909301333.x8UDXclL031150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Sep 2019 13:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352896 - stable/12/sys/dev/vt X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/vt X-SVN-Commit-Revision: 352896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 13:33:38 -0000 Author: avg Date: Mon Sep 30 13:33:37 2019 New Revision: 352896 URL: https://svnweb.freebsd.org/changeset/base/352896 Log: MFC r352505: vt: fix problems with trying to switch to a closed VT Modified: stable/12/sys/dev/vt/vt_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vt/vt_core.c ============================================================================== --- stable/12/sys/dev/vt/vt_core.c Mon Sep 30 13:26:16 2019 (r352895) +++ stable/12/sys/dev/vt/vt_core.c Mon Sep 30 13:33:37 2019 (r352896) @@ -335,7 +335,7 @@ static void vt_switch_timer(void *arg) { - vt_late_window_switch((struct vt_window *)arg); + (void)vt_late_window_switch((struct vt_window *)arg); } static int @@ -457,13 +457,22 @@ vt_window_postswitch(struct vt_window *vw) static int vt_late_window_switch(struct vt_window *vw) { + struct vt_window *curvw; int ret; callout_stop(&vw->vw_proc_dead_timer); ret = vt_window_switch(vw); - if (ret) + if (ret != 0) { + /* + * If the switch hasn't happened, then return the VT + * to the current owner, if any. + */ + curvw = vw->vw_device->vd_curwindow; + if (curvw->vw_smode.mode == VT_PROCESS) + (void)vt_window_postswitch(curvw); return (ret); + } /* Notify owner process about terminal availability. */ if (vw->vw_smode.mode == VT_PROCESS) { @@ -509,6 +518,19 @@ vt_proc_window_switch(struct vt_window *vw) return (0); /* success */ } + /* + * Early check for an attempt to switch to a non-functional VT. + * The same check is done in vt_window_switch(), but it's better + * to fail as early as possible to avoid needless pre-switch + * actions. + */ + VT_LOCK(vd); + if ((vw->vw_flags & (VWF_OPENED|VWF_CONSOLE)) == 0) { + VT_UNLOCK(vd); + return (EINVAL); + } + VT_UNLOCK(vd); + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -1792,7 +1814,7 @@ finish_vt_rel(struct vt_window *vw, int release, int * vw->vw_flags &= ~VWF_SWWAIT_REL; if (release) { callout_drain(&vw->vw_proc_dead_timer); - vt_late_window_switch(vw->vw_switch_to); + (void)vt_late_window_switch(vw->vw_switch_to); } return (0); } From owner-svn-src-all@freebsd.org Mon Sep 30 13:34:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9089128024; Mon, 30 Sep 2019 13:34:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hk074Rrsz3PvW; Mon, 30 Sep 2019 13:34:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D07B33C4; Mon, 30 Sep 2019 13:34:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UDYVfj031253; Mon, 30 Sep 2019 13:34:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UDYVv5031252; Mon, 30 Sep 2019 13:34:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909301334.x8UDYVv5031252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Sep 2019 13:34:31 +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: r352897 - stable/11/sys/dev/vt X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/vt X-SVN-Commit-Revision: 352897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 13:34:31 -0000 Author: avg Date: Mon Sep 30 13:34:30 2019 New Revision: 352897 URL: https://svnweb.freebsd.org/changeset/base/352897 Log: MFC r352505: vt: fix problems with trying to switch to a closed VT Modified: stable/11/sys/dev/vt/vt_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_core.c ============================================================================== --- stable/11/sys/dev/vt/vt_core.c Mon Sep 30 13:33:37 2019 (r352896) +++ stable/11/sys/dev/vt/vt_core.c Mon Sep 30 13:34:30 2019 (r352897) @@ -316,7 +316,7 @@ static void vt_switch_timer(void *arg) { - vt_late_window_switch((struct vt_window *)arg); + (void)vt_late_window_switch((struct vt_window *)arg); } static int @@ -438,13 +438,22 @@ vt_window_postswitch(struct vt_window *vw) static int vt_late_window_switch(struct vt_window *vw) { + struct vt_window *curvw; int ret; callout_stop(&vw->vw_proc_dead_timer); ret = vt_window_switch(vw); - if (ret) + if (ret != 0) { + /* + * If the switch hasn't happened, then return the VT + * to the current owner, if any. + */ + curvw = vw->vw_device->vd_curwindow; + if (curvw->vw_smode.mode == VT_PROCESS) + (void)vt_window_postswitch(curvw); return (ret); + } /* Notify owner process about terminal availability. */ if (vw->vw_smode.mode == VT_PROCESS) { @@ -490,6 +499,19 @@ vt_proc_window_switch(struct vt_window *vw) return (0); /* success */ } + /* + * Early check for an attempt to switch to a non-functional VT. + * The same check is done in vt_window_switch(), but it's better + * to fail as early as possible to avoid needless pre-switch + * actions. + */ + VT_LOCK(vd); + if ((vw->vw_flags & (VWF_OPENED|VWF_CONSOLE)) == 0) { + VT_UNLOCK(vd); + return (EINVAL); + } + VT_UNLOCK(vd); + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -1718,7 +1740,7 @@ finish_vt_rel(struct vt_window *vw, int release, int * vw->vw_flags &= ~VWF_SWWAIT_REL; if (release) { callout_drain(&vw->vw_proc_dead_timer); - vt_late_window_switch(vw->vw_switch_to); + (void)vt_late_window_switch(vw->vw_switch_to); } return (0); } From owner-svn-src-all@freebsd.org Mon Sep 30 14:05:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59204128B96; Mon, 30 Sep 2019 14:05:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hkh91h0Lz3xqN; Mon, 30 Sep 2019 14:05:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E25A3B8A; Mon, 30 Sep 2019 14:05:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UE5ip0049533; Mon, 30 Sep 2019 14:05:44 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UE5i3w049532; Mon, 30 Sep 2019 14:05:44 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201909301405.x8UE5i3w049532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 30 Sep 2019 14:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352898 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 352898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 14:05:45 -0000 Author: vangyzen Date: Mon Sep 30 14:05:44 2019 New Revision: 352898 URL: https://svnweb.freebsd.org/changeset/base/352898 Log: Fix coredump_phnum_test when kern.compress_user_cores != 0 If `kern.compress_user_cores` is non-zero, decompress the core file. Use `sysctl -f` to restore previous values. Don't bother restoring `ulimit -c`, since that's a per-process value. Check more commands with `atf_check`. Reviewed by: olivier ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21820 Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Mon Sep 30 13:34:30 2019 (r352897) +++ head/tests/sys/kern/coredump_phnum_test.sh Mon Sep 30 14:05:44 2019 (r352898) @@ -40,21 +40,31 @@ coredump_phnum_head() coredump_phnum_body() { # Set up core dumping - cat > coredump_phnum_restore_state.sh <<-EOF - #!/bin/sh - ulimit -c '$(ulimit -c)' - sysctl kern.coredump=$(sysctl -n kern.coredump) - sysctl kern.corefile='$(sysctl -n kern.corefile)' - sysctl kern.compress_user_cores='$(sysctl -n kern.compress_user_cores)' -EOF + atf_check -o save:coredump_phnum_restore_state sysctl -e \ + kern.coredump kern.corefile ulimit -c unlimited - sysctl kern.coredump=1 - sysctl kern.compress_user_cores=0 - sysctl kern.corefile="$(pwd)/coredump_phnum_helper.core" + atf_check -o ignore sysctl kern.coredump=1 + atf_check -o ignore sysctl kern.corefile=coredump_phnum_helper.core + atf_check -o save:cuc sysctl -n kern.compress_user_cores + read cuc < cuc atf_check -s signal:sigabrt "$(atf_get_srcdir)/coredump_phnum_helper" + case "$cuc" in + 0) + ;; + 1) + atf_check gunzip coredump_phnum_helper.core.gz + ;; + 2) + atf_check zstd -qd coredump_phnum_helper.core.zst + ;; + *) + atf_skip "unsupported kern.compress_user_cores=$cuc" + ;; + esac + # Check that core looks good if [ ! -f coredump_phnum_helper.core ]; then atf_fail "Helper program did not dump core" @@ -76,10 +86,11 @@ EOF coredump_phnum_cleanup() { rm -f coredump_phnum_helper.core - if [ -f coredump_phnum_restore_state.sh ]; then - . ./coredump_phnum_restore_state.sh + if [ -f coredump_phnum_restore_state ]; then + sysctl -f coredump_phnum_restore_state + rm -f coredump_phnum_restore_state fi - rm -f coredump_phnum_restore_state.sh + rm -f cuc } atf_init_test_cases() From owner-svn-src-all@freebsd.org Mon Sep 30 14:11:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C403128E51; Mon, 30 Sep 2019 14:11:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hkqB3F2qz3yTq; Mon, 30 Sep 2019 14:11:50 +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 528F93D2B; Mon, 30 Sep 2019 14:11:50 +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 x8UEBo6S052370; Mon, 30 Sep 2019 14:11:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UEBn2W052367; Mon, 30 Sep 2019 14:11:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909301411.x8UEBn2W052367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Sep 2019 14:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352899 - releng/12.1/lib/msun/src X-SVN-Group: releng X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: releng/12.1/lib/msun/src X-SVN-Commit-Revision: 352899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 14:11:50 -0000 Author: jhibbits Date: Mon Sep 30 14:11:49 2019 New Revision: 352899 URL: https://svnweb.freebsd.org/changeset/base/352899 Log: MF stable/12 r352685: libm: Include float.h to get LDBL_MANT_DIG The long double aliases of double functions are only exposed as aliases if LDBL_MANT_DIG is 53 (same as DBL_MANT_DIG). Without float.h included these files were not exposing weak aliases as expected, leading to link failures if programs use the *l functions. This should fix editors/calligra on targets with 64-bit long double, which uses erfl and erfcl. Found on powerpc64. Approved by: re(delphij) Modified: releng/12.1/lib/msun/src/s_cbrt.c releng/12.1/lib/msun/src/s_cproj.c releng/12.1/lib/msun/src/s_erf.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/lib/msun/src/s_cbrt.c ============================================================================== --- releng/12.1/lib/msun/src/s_cbrt.c Mon Sep 30 14:05:44 2019 (r352898) +++ releng/12.1/lib/msun/src/s_cbrt.c Mon Sep 30 14:11:49 2019 (r352899) @@ -15,6 +15,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include "math.h" #include "math_private.h" Modified: releng/12.1/lib/msun/src/s_cproj.c ============================================================================== --- releng/12.1/lib/msun/src/s_cproj.c Mon Sep 30 14:05:44 2019 (r352898) +++ releng/12.1/lib/msun/src/s_cproj.c Mon Sep 30 14:11:49 2019 (r352899) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "math_private.h" Modified: releng/12.1/lib/msun/src/s_erf.c ============================================================================== --- releng/12.1/lib/msun/src/s_erf.c Mon Sep 30 14:05:44 2019 (r352898) +++ releng/12.1/lib/msun/src/s_erf.c Mon Sep 30 14:11:49 2019 (r352899) @@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$"); * erfc/erf(NaN) is NaN */ - +#include #include "math.h" #include "math_private.h" From owner-svn-src-all@freebsd.org Mon Sep 30 14:16:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22136128F9C; Mon, 30 Sep 2019 14:16: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hkwr73Jfz3yvD; Mon, 30 Sep 2019 14:16: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 D607C3D84; Mon, 30 Sep 2019 14:16: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 x8UEGinp056274; Mon, 30 Sep 2019 14:16:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UEGixj056273; Mon, 30 Sep 2019 14:16:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909301416.x8UEGixj056273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 30 Sep 2019 14:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352900 - releng/12.1/lib/libthr/thread X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/12.1/lib/libthr/thread X-SVN-Commit-Revision: 352900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 14:16:45 -0000 Author: kib Date: Mon Sep 30 14:16:44 2019 New Revision: 352900 URL: https://svnweb.freebsd.org/changeset/base/352900 Log: MFC r352620, MFS12 r352892: Fix destruction of the robust mutexes. Approved by: re (gjb) Modified: releng/12.1/lib/libthr/thread/thr_mutex.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/lib/libthr/thread/thr_mutex.c ============================================================================== --- releng/12.1/lib/libthr/thread/thr_mutex.c Mon Sep 30 14:11:49 2019 (r352899) +++ releng/12.1/lib/libthr/thread/thr_mutex.c Mon Sep 30 14:16:44 2019 (r352900) @@ -474,7 +474,11 @@ _thr_mutex_destroy(pthread_mutex_t *mutex) if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(_get_curthread(), m1); + if ((uint32_t)m1->m_lock.m_owner != + UMUTEX_RB_OWNERDEAD) { + mutex_assert_not_owned( + _get_curthread(), m1); + } __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED; From owner-svn-src-all@freebsd.org Mon Sep 30 14:19:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D99AA1290F9; Mon, 30 Sep 2019 14:19:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hkzq5Mrrz40F4; Mon, 30 Sep 2019 14:19: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 9CA563D8E; Mon, 30 Sep 2019 14:19: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 x8UEJJ7o056604; Mon, 30 Sep 2019 14:19:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UEJIq8056599; Mon, 30 Sep 2019 14:19:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909301419.x8UEJIq8056599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Sep 2019 14:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352901 - in releng/12.1: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common lib/libbe X-SVN-Group: releng X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in releng/12.1: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common lib/libbe X-SVN-Commit-Revision: 352901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 14:19:19 -0000 Author: avg Date: Mon Sep 30 14:19:18 2019 New Revision: 352901 URL: https://svnweb.freebsd.org/changeset/base/352901 Log: Merge from stable/12 r352595: Add -vnP support to 'zfs send' for bookmarks Approved by: re (gjb) Modified: releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c releng/12.1/lib/libbe/be.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Sep 30 14:16:44 2019 (r352900) +++ releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Sep 30 14:19:18 2019 (r352901) @@ -190,8 +190,8 @@ .Ar snapshot .Nm .Cm send -.Op Fl Lce -.Op Fl i Ar snapshot Ns | Ns bookmark +.Op Fl LPcenv +.Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm send @@ -2764,7 +2764,7 @@ on future versions of .It Xo .Nm .Cm send -.Op Fl Lce +.Op Fl LPcenv .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2778,7 +2778,7 @@ stream generated from a filesystem or volume is receiv name will be .Pq --head-- . .Bl -tag -width indent -.It Fl i Ar snapshot Ns | Ns bookmark +.It Fl i Ar snapshot Ns | Ns Ar bookmark Generate an incremental send stream. The incremental source must be an earlier snapshot in the destination's history. @@ -2790,6 +2790,23 @@ specified as the last component of the name If the incremental target is a clone, the incremental source can be the origin snapshot, or an earlier snapshot in the origin's filesystem, or the origin's origin, etc. +.It Fl n, -dryrun +Do a dry-run +.Pq Qq No-op +send. +Do not generate any actual send data. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to determine what data will be sent. +In this case, the verbose output will be written to standard output +.Po contrast with a non-dry-run, where the stream is written to standard output +and the verbose output goes to standard error +.Pc . +.It Fl v, -verbose +Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .It Fl L, -large-block Generate a stream which may contain blocks larger than 128KB. This flag @@ -2806,6 +2823,8 @@ See for details on ZFS feature flags and the .Sy large_blocks feature. +.It Fl P, -parsable +Print machine-parsable verbose information about the stream package generated. .It Fl c, -compressed Generate a more compact stream by using compressed WRITE records for blocks which are compressed on disk and in memory (see the Modified: releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Sep 30 14:16:44 2019 (r352900) +++ releng/12.1/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Sep 30 14:19:18 2019 (r352901) @@ -290,7 +290,7 @@ get_usage(zfs_help_t idx) case HELP_SEND: return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] " "\n" - "\tsend [-Le] [-i snapshot|bookmark] " + "\tsend [-LPcenv] [-i snapshot|bookmark] " "\n" "\tsend [-nvPe] -t \n")); case HELP_SET: @@ -3928,13 +3928,11 @@ zfs_do_send(int argc, char **argv) if (strchr(argv[0], '@') == NULL || (fromname && strchr(fromname, '#') != NULL)) { char frombuf[ZFS_MAX_DATASET_NAME_LEN]; - enum lzc_send_flags lzc_flags = 0; if (flags.replicate || flags.doall || flags.props || - flags.dedup || flags.dryrun || flags.verbose || - flags.progress) { - (void) fprintf(stderr, - gettext("Error: " + flags.dedup || (strchr(argv[0], '@') == NULL && + (flags.dryrun || flags.verbose || flags.progress))) { + (void) fprintf(stderr, gettext("Error: " "Unsupported flag with filesystem or bookmark.\n")); return (1); } @@ -3943,13 +3941,6 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); - if (flags.largeblock) - lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; - if (flags.embed_data) - lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; - if (flags.compress) - lzc_flags |= LZC_SEND_FLAG_COMPRESS; - if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { /* @@ -3963,7 +3954,7 @@ zfs_do_send(int argc, char **argv) (void) strlcat(frombuf, fromname, sizeof (frombuf)); fromname = frombuf; } - err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags); + err = zfs_send_one(zhp, fromname, STDOUT_FILENO, flags); zfs_close(zhp); return (err != 0); } Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Sep 30 14:16:44 2019 (r352900) +++ releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Sep 30 14:19:18 2019 (r352901) @@ -660,7 +660,7 @@ typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, vo extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); -extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); +extern int zfs_send_one(zfs_handle_t *, const char *, int, sendflags_t flags); extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd, const char *); extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Sep 30 14:16:44 2019 (r352900) +++ releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Sep 30 14:19:18 2019 (r352901) @@ -1190,16 +1190,14 @@ send_print_verbose(FILE *fout, const char *tosnap, con } } - if (size != 0) { - if (parsable) { - (void) fprintf(fout, "\t%llu", - (longlong_t)size); - } else { - char buf[16]; - zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - " estimated size is %s"), buf); - } + if (parsable) { + (void) fprintf(fout, "\t%llu", + (longlong_t)size); + } else if (size != 0) { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + " estimated size is %s"), buf); } (void) fprintf(fout, "\n"); } @@ -2037,17 +2035,40 @@ err_out: } int -zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, - enum lzc_send_flags flags) +zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t flags) { - int err; + int err = 0; libzfs_handle_t *hdl = zhp->zfs_hdl; - + enum lzc_send_flags lzc_flags = 0; + FILE *fout = (flags.verbose && flags.dryrun) ? stdout : stderr; char errbuf[1024]; + + if (flags.largeblock) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; + if (flags.embed_data) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags.compress) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; + + if (flags.verbose) { + uint64_t size = 0; + err = lzc_send_space(zhp->zfs_name, from, lzc_flags, &size); + if (err == 0) { + send_print_verbose(fout, zhp->zfs_name, from, size, + flags.parsable); + } else { + (void) fprintf(stderr, "Cannot estimate send size: " + "%s\n", strerror(errno)); + } + } + + if (flags.dryrun) + return (err); + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "warning: cannot send '%s'"), zhp->zfs_name); - err = lzc_send(zhp->zfs_name, from, fd, flags); + err = lzc_send(zhp->zfs_name, from, fd, lzc_flags); if (err != 0) { switch (errno) { case EXDEV: Modified: releng/12.1/lib/libbe/be.c ============================================================================== --- releng/12.1/lib/libbe/be.c Mon Sep 30 14:16:44 2019 (r352900) +++ releng/12.1/lib/libbe/be.c Mon Sep 30 14:19:18 2019 (r352901) @@ -775,6 +775,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in char snap_name[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; zfs_handle_t *zfs; + sendflags_t flags = { 0 }; int err; if ((err = be_snapshot(lbh, bootenv, NULL, true, snap_name)) != 0) @@ -786,7 +787,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); - err = zfs_send_one(zfs, NULL, fd, 0); + err = zfs_send_one(zfs, NULL, fd, flags); zfs_close(zfs); return (err); From owner-svn-src-all@freebsd.org Mon Sep 30 14:22:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A6B6129350; Mon, 30 Sep 2019 14:22:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46hl313Zpmz40c2; Mon, 30 Sep 2019 14:22:05 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1iEwYl-000PHD-B7; Mon, 30 Sep 2019 17:21:55 +0300 Date: Mon, 30 Sep 2019 17:21:55 +0300 From: Slawa Olhovchenkov To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352868 - in head/sys/netinet: . tcp_stacks Message-ID: <20190930142155.GC38096@zxy.spb.ru> References: <201909291045.x8TAjD6J066797@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909291045.x8TAjD6J066797@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 46hl313Zpmz40c2 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of slw@zxy.spb.ru has no SPF policy when checking 195.70.199.98) smtp.mailfrom=slw@zxy.spb.ru X-Spamd-Result: default: False [-0.38 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.64)[-0.637,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.65)[-0.645,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zxy.spb.ru]; TO_DN_SOME(0.00)[]; AUTH_NA(1.00)[]; IP_SCORE(0.00)[country: RU(0.01)]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5495, ipnet:195.70.192.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 14:22:06 -0000 On Sun, Sep 29, 2019 at 10:45:13AM +0000, Michael Tuexen wrote: > Author: tuexen > Date: Sun Sep 29 10:45:13 2019 > New Revision: 352868 > URL: https://svnweb.freebsd.org/changeset/base/352868 > > Log: > RFC 7112 requires a host to put the complete IP header chain > including the TCP header in the first IP packet. > Enforce this in tcp_output(). In addition make sure that at least > one byte payload fits in the TCP segement to allow making progress. > Without this check, a kernel with INVARIANTS will panic. > This issue was found by running an instance of syzkaller. How to posible this? Host required to handle packets up to 576 bytes, how to IP and TCP options can exhaust this size? From owner-svn-src-all@freebsd.org Mon Sep 30 14:32:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CCEF12971F; Mon, 30 Sep 2019 14:32:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hlHF6WNXz41PZ; Mon, 30 Sep 2019 14:32:41 +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 B601C4195; Mon, 30 Sep 2019 14:32:41 +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 x8UEWfQH068347; Mon, 30 Sep 2019 14:32:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UEWfLS068346; Mon, 30 Sep 2019 14:32:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909301432.x8UEWfLS068346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 30 Sep 2019 14:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352902 - releng/12.1/sbin/fsck_msdosfs X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/12.1/sbin/fsck_msdosfs X-SVN-Commit-Revision: 352902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 14:32:42 -0000 Author: delphij Date: Mon Sep 30 14:32:41 2019 New Revision: 352902 URL: https://svnweb.freebsd.org/changeset/base/352902 Log: MFS r352872: MFC r351802: Correct overflow logic in fullpath(). Obtained from: OpenBSD Approved by: re (gjb) Modified: releng/12.1/sbin/fsck_msdosfs/dir.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sbin/fsck_msdosfs/dir.c ============================================================================== --- releng/12.1/sbin/fsck_msdosfs/dir.c Mon Sep 30 14:19:18 2019 (r352901) +++ releng/12.1/sbin/fsck_msdosfs/dir.c Mon Sep 30 14:32:41 2019 (r352902) @@ -168,20 +168,24 @@ fullpath(struct dosDirEntry *dir) char *cp, *np; int nl; - cp = namebuf + sizeof namebuf - 1; - *cp = '\0'; - do { + cp = namebuf + sizeof namebuf; + *--cp = '\0'; + + for(;;) { np = dir->lname[0] ? dir->lname : dir->name; nl = strlen(np); - if ((cp -= nl) <= namebuf + 1) + if (cp <= namebuf + 1 + nl) { + *--cp = '?'; break; + } + cp -= nl; memcpy(cp, np, nl); + dir = dir->parent; + if (!dir) + break; *--cp = '/'; - } while ((dir = dir->parent) != NULL); - if (dir) - *--cp = '?'; - else - cp++; + } + return cp; } From owner-svn-src-all@freebsd.org Mon Sep 30 15:00:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70C0512A2D3; Mon, 30 Sep 2019 15:00:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hlvC1l1Xz43Gf; Mon, 30 Sep 2019 15:00:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EFCA4540; Mon, 30 Sep 2019 15:00:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UF0No6081539; Mon, 30 Sep 2019 15:00:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UF0MZk081538; Mon, 30 Sep 2019 15:00:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909301500.x8UF0MZk081538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 30 Sep 2019 15:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352903 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 352903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 15:00:23 -0000 Author: manu Date: Mon Sep 30 15:00:22 2019 New Revision: 352903 URL: https://svnweb.freebsd.org/changeset/base/352903 Log: arm64: rockchip: correct reset value If bit is 0 the reset is not asserted. Also register our self as a reset provider, this was commented in r352850 Reported by: mmel Modified: head/sys/arm64/rockchip/clk/rk_cru.c Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Mon Sep 30 14:32:41 2019 (r352902) +++ head/sys/arm64/rockchip/clk/rk_cru.c Mon Sep 30 15:00:22 2019 (r352903) @@ -155,7 +155,7 @@ rk_cru_reset_is_asserted(device_t dev, intptr_t id, bo val = CCU_READ4(sc, reg); mtx_unlock(&sc->mtx); - *reset = true; + *reset = false; if (val & (1 << bit)) *reset = true; @@ -265,9 +265,8 @@ rk_cru_attach(device_t dev) clk_set_assigned(dev, node); - /* If we have resets, register our self as a reset provider */ - /* if (sc->resets) */ - /* hwreset_register_ofw_provider(dev); */ + /* register our self as a reset provider */ + hwreset_register_ofw_provider(dev); return (0); } From owner-svn-src-all@freebsd.org Mon Sep 30 15:01:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E65612A372; Mon, 30 Sep 2019 15:01:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hlw62kbbz43YL; Mon, 30 Sep 2019 15:01:10 +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 426AB457C; Mon, 30 Sep 2019 15:01:10 +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 x8UF1AUl082416; Mon, 30 Sep 2019 15:01:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UF1ACY082415; Mon, 30 Sep 2019 15:01:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909301501.x8UF1ACY082415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 30 Sep 2019 15:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352904 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 352904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 15:01:10 -0000 Author: manu Date: Mon Sep 30 15:01:09 2019 New Revision: 352904 URL: https://svnweb.freebsd.org/changeset/base/352904 Log: arm64: rockchip: rk_clk_pll: Check mode on recalc If the pll is in slow or deep slow mode return the correct frequency. Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Mon Sep 30 15:00:22 2019 (r352903) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Mon Sep 30 15:01:09 2019 (r352904) @@ -367,7 +367,7 @@ rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *f uint32_t postdiv1, postdiv2, fracdiv; uint32_t con1, con2, con3, con4; uint64_t foutvco; - + uint32_t mode; sc = clknode_get_softc(clk); DEVICE_LOCK(clk); @@ -376,6 +376,21 @@ rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *f READ4(clk, sc->base_offset + 8, &con3); READ4(clk, sc->base_offset + 0xC, &con4); DEVICE_UNLOCK(clk); + + /* + * if we are in slow mode the output freq + * is the parent one, the 24Mhz external oscillator + * if we are in deep mode the output freq is 32.768khz + */ + mode = (con4 & RK3399_CLK_PLL_MODE_MASK) >> RK3399_CLK_PLL_MODE_SHIFT; + if (mode == RK3399_CLK_PLL_MODE_SLOW) { + dprintf("pll in slow mode, con4=%x\n", con4); + return (0); + } else if (mode == RK3399_CLK_PLL_MODE_DEEPSLOW) { + dprintf("pll in deep slow, con4=%x\n", con4); + *freq = 32768; + return (0); + } dprintf("con0: %x\n", con1); dprintf("con1: %x\n", con2); From owner-svn-src-all@freebsd.org Mon Sep 30 15:08:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACC6D12A665; Mon, 30 Sep 2019 15:08:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hm4t477vz43v4; Mon, 30 Sep 2019 15:08:46 +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 6C6F346F4; Mon, 30 Sep 2019 15:08:46 +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 x8UF8k2J087340; Mon, 30 Sep 2019 15:08:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UF8kge087339; Mon, 30 Sep 2019 15:08:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909301508.x8UF8kge087339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Sep 2019 15:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352905 - releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: releng X-SVN-Commit-Author: avg X-SVN-Commit-Paths: releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 352905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 15:08:46 -0000 Author: avg Date: Mon Sep 30 15:08:45 2019 New Revision: 352905 URL: https://svnweb.freebsd.org/changeset/base/352905 Log: Merge from stable/12 r352723: fix dsl_scan_ds_clone_swapped logic PR: 239566 Approved by: re (gjb) Modified: releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Sep 30 15:01:09 2019 (r352904) +++ releng/12.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Sep 30 15:08:45 2019 (r352905) @@ -2014,16 +2014,17 @@ ds_clone_swapped_bookmark(dsl_dataset_t *ds1, dsl_data } /* - * Called when a parent dataset and its clone are swapped. If we were + * Called when an origin dataset and its clone are swapped. If we were * currently traversing the dataset, we need to switch to traversing the - * newly promoted parent. + * newly promoted clone. */ void dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_dataset_t *ds2, dmu_tx_t *tx) { dsl_pool_t *dp = ds1->ds_dir->dd_pool; dsl_scan_t *scn = dp->dp_scan; - uint64_t mintxg; + uint64_t mintxg1, mintxg2; + boolean_t ds1_queued, ds2_queued; if (!dsl_scan_is_running(scn)) return; @@ -2031,44 +2032,81 @@ dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_data ds_clone_swapped_bookmark(ds1, ds2, &scn->scn_phys.scn_bookmark); ds_clone_swapped_bookmark(ds1, ds2, &scn->scn_phys_cached.scn_bookmark); - if (scan_ds_queue_contains(scn, ds1->ds_object, &mintxg)) { - scan_ds_queue_remove(scn, ds1->ds_object); - scan_ds_queue_insert(scn, ds2->ds_object, mintxg); + /* + * Handle the in-memory scan queue. + */ + ds1_queued = scan_ds_queue_contains(scn, ds1->ds_object, &mintxg1); + ds2_queued = scan_ds_queue_contains(scn, ds2->ds_object, &mintxg2); + + /* Sanity checking. */ + if (ds1_queued) { + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); } - if (scan_ds_queue_contains(scn, ds2->ds_object, &mintxg)) { + if (ds2_queued) { + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + + if (ds1_queued && ds2_queued) { + /* + * If both are queued, we don't need to do anything. + * The swapping code below would not handle this case correctly, + * since we can't insert ds2 if it is already there. That's + * because scan_ds_queue_insert() prohibits a duplicate insert + * and panics. + */ + } else if (ds1_queued) { + scan_ds_queue_remove(scn, ds1->ds_object); + scan_ds_queue_insert(scn, ds2->ds_object, mintxg1); + } else if (ds2_queued) { scan_ds_queue_remove(scn, ds2->ds_object); - scan_ds_queue_insert(scn, ds1->ds_object, mintxg); + scan_ds_queue_insert(scn, ds1->ds_object, mintxg2); } - if (zap_lookup_int_key(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, - ds1->ds_object, &mintxg) == 0) { - int err; - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); - VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, + /* + * Handle the on-disk scan queue. + * The on-disk state is an out-of-date version of the in-memory state, + * so the in-memory and on-disk values for ds1_queued and ds2_queued may + * be different. Therefore we need to apply the swap logic to the + * on-disk state independently of the in-memory state. + */ + ds1_queued = zap_lookup_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds1->ds_object, &mintxg1) == 0; + ds2_queued = zap_lookup_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds2->ds_object, &mintxg2) == 0; + + /* Sanity checking. */ + if (ds1_queued) { + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + if (ds2_queued) { + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + + if (ds1_queued && ds2_queued) { + /* + * If both are queued, we don't need to do anything. + * Alternatively, we could check for EEXIST from + * zap_add_int_key() and back out to the original state, but + * that would be more work than checking for this case upfront. + */ + } else if (ds1_queued) { + VERIFY3S(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, ds1->ds_object, tx)); - err = zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg, tx); - VERIFY(err == 0 || err == EEXIST); - if (err == EEXIST) { - /* Both were there to begin with */ - VERIFY(0 == zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, - ds1->ds_object, mintxg, tx)); - } + VERIFY3S(0, ==, zap_add_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg1, tx)); zfs_dbgmsg("clone_swap ds %llu; in queue; " "replacing with %llu", (u_longlong_t)ds1->ds_object, (u_longlong_t)ds2->ds_object); - } - if (zap_lookup_int_key(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, - ds2->ds_object, &mintxg) == 0) { - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); - VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, + } else if (ds2_queued) { + VERIFY3S(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, ds2->ds_object, tx)); - VERIFY(0 == zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg, tx)); + VERIFY3S(0, ==, zap_add_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg2, tx)); zfs_dbgmsg("clone_swap ds %llu; in queue; " "replacing with %llu", (u_longlong_t)ds2->ds_object, From owner-svn-src-all@freebsd.org Mon Sep 30 15:59:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15A9D12B693; Mon, 30 Sep 2019 15:59:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hnC06hDFz46cp; Mon, 30 Sep 2019 15:59:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9A474FE0; Mon, 30 Sep 2019 15:59: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 x8UFx8GD017833; Mon, 30 Sep 2019 15:59:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UFx8Ff017830; Mon, 30 Sep 2019 15:59:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909301559.x8UFx8Ff017830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 15:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352906 - in head/sys: dev/vmware/vmxnet3 net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 352906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 15:59:09 -0000 Author: markj Date: Mon Sep 30 15:59:07 2019 New Revision: 352906 URL: https://svnweb.freebsd.org/changeset/base/352906 Log: Add IFLIB_SINGLE_IRQ_RX_ONLY. As of r347221 the iflib legacy interrupt mode setup assumes that drivers perform both receive and transmit processing from the interrupt handler. This assumption is invalid in the vmxnet3 driver, so introduce the IFLIB_SINGLE_IRQ_RX_ONLY flag to make iflib avoid tx processing in the interrupt handler. PR: 239118 Reported and tested by: Juraj Lutter Obtained from: marius Reviewed by: gallatin MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21831 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 30 15:59:07 2019 (r352906) @@ -287,7 +287,7 @@ static struct if_shared_ctx vmxnet3_sctx_init = { .isc_vendor_info = vmxnet3_vendor_info_array, .isc_driver_version = "2", .isc_driver = &vmxnet3_iflib_driver, - .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_SINGLE_IRQ_RX_ONLY, /* * Number of receive queues per receive queue set, with associated Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/net/iflib.c Mon Sep 30 15:59:07 2019 (r352906) @@ -6059,6 +6059,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte gtask_fn_t *fn; void *q; int err, tqrid; + bool rx_only; q = &ctx->ifc_rxqs[0]; info = &rxq[0].ifr_filter_info; @@ -6066,17 +6067,19 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte tqg = qgroup_if_io_tqg; tqrid = *rid; fn = _task_fn_rx; + rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0; ctx->ifc_flags |= IFC_LEGACY; info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = q; + info->ifi_ctx = rx_only ? ctx : q; dev = ctx->ifc_dev; /* We allocate a single interrupt resource */ - if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx, - NULL, info, name)) != 0) + err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx : + iflib_fast_intr_rxtx, NULL, info, name); + if (err != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); res = irq->ii_res; Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/net/iflib.h Mon Sep 30 15:59:07 2019 (r352906) @@ -366,6 +366,11 @@ typedef enum { * Driver will pass the media */ #define IFLIB_DRIVER_MEDIA 0x20000 +/* + * When using a single hardware interrupt for the interface, only process RX + * interrupts instead of doing combined RX/TX processing. + */ +#define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000 /* * field accessors From owner-svn-src-all@freebsd.org Mon Sep 30 16:10:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0C9912BB56; Mon, 30 Sep 2019 16:10: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hnSM3skYz47Gs; Mon, 30 Sep 2019 16:10: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 68AAE52E0; Mon, 30 Sep 2019 16:10:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UGAhJp023991; Mon, 30 Sep 2019 16:10:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UGAhup023990; Mon, 30 Sep 2019 16:10:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909301610.x8UGAhup023990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 16:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352907 - head/contrib/elftoolchain/cxxfilt X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/cxxfilt X-SVN-Commit-Revision: 352907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 16:10:43 -0000 Author: markj Date: Mon Sep 30 16:10:42 2019 New Revision: 352907 URL: https://svnweb.freebsd.org/changeset/base/352907 Log: Capsicumize c++filt(1). Reviewed by: emaste Discussed with: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21106 Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Sep 30 15:59:07 2019 (r352906) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Sep 30 16:10:42 2019 (r352907) @@ -25,6 +25,8 @@ */ #include + +#include #include #include #include @@ -164,6 +166,11 @@ main(int argc, char **argv) argv += optind; argc -= optind; + + if (caph_limit_stdio() < 0) + err(EXIT_FAILURE, "failed to limit stdio rights"); + if (caph_enter() < 0) + err(EXIT_FAILURE, "failed to enter capability mode"); if (*argv != NULL) { for (n = 0; n < argc; n++) { From owner-svn-src-all@freebsd.org Mon Sep 30 16:19:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03A6712BECB; Mon, 30 Sep 2019 16:19:07 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hnf24lxpz47lh; Mon, 30 Sep 2019 16:19:06 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [10.0.1.118] (unknown [212.201.121.94]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id D8CD0721E280D; Mon, 30 Sep 2019 18:19:02 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352868 - in head/sys/netinet: . tcp_stacks From: Michael Tuexen In-Reply-To: <20190930142155.GC38096@zxy.spb.ru> Date: Mon, 30 Sep 2019 18:19:02 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <04D392FE-C3CC-4433-90F7-B19600304171@freebsd.org> References: <201909291045.x8TAjD6J066797@repo.freebsd.org> <20190930142155.GC38096@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 46hnf24lxpz47lh X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 16:19:07 -0000 > On 30. Sep 2019, at 16:21, Slawa Olhovchenkov wrote: > > On Sun, Sep 29, 2019 at 10:45:13AM +0000, Michael Tuexen wrote: > >> Author: tuexen >> Date: Sun Sep 29 10:45:13 2019 >> New Revision: 352868 >> URL: https://svnweb.freebsd.org/changeset/base/352868 >> >> Log: >> RFC 7112 requires a host to put the complete IP header chain >> including the TCP header in the first IP packet. >> Enforce this in tcp_output(). In addition make sure that at least >> one byte payload fits in the TCP segement to allow making progress. >> Without this check, a kernel with INVARIANTS will panic. >> This issue was found by running an instance of syzkaller. > > How to posible this? > Host required to handle packets up to 576 bytes, how to IP and TCP > options can exhaust this size? You are thinking about IPv4. There you have small limits. But in the IPv6 case, you can have header chains longer than, for example, 1500 bytes. And you can trigger these using the socket API. That is how syzkaller found this issue. Best regards Michael From owner-svn-src-all@freebsd.org Mon Sep 30 17:26:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7DBD12D50F; Mon, 30 Sep 2019 17:26: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hq834rl0z4CLL; Mon, 30 Sep 2019 17:26: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 84E7660FF; Mon, 30 Sep 2019 17:26:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UHQhi6070552; Mon, 30 Sep 2019 17:26:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UHQh85070551; Mon, 30 Sep 2019 17:26:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909301726.x8UHQh85070551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 17:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352908 - head/contrib/elftoolchain/nm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/nm X-SVN-Commit-Revision: 352908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 17:26:43 -0000 Author: markj Date: Mon Sep 30 17:26:42 2019 New Revision: 352908 URL: https://svnweb.freebsd.org/changeset/base/352908 Log: nm: Adjust argc and argv in get_opt(). This refactoring makes it slightly easier to capsicumize nm(1). Discussed with: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/nm/nm.c Modified: head/contrib/elftoolchain/nm/nm.c ============================================================================== --- head/contrib/elftoolchain/nm/nm.c Mon Sep 30 16:10:42 2019 (r352907) +++ head/contrib/elftoolchain/nm/nm.c Mon Sep 30 17:26:42 2019 (r352908) @@ -179,7 +179,7 @@ static int cmp_size(const void *, const void *); static int cmp_value(const void *, const void *); static void filter_dest(void); static int filter_insert(fn_filter); -static void get_opt(int, char **); +static void get_opt(int *, char ***); static int get_sym(Elf *, struct sym_head *, int, size_t, size_t, const char *, const char **, int); static const char * get_sym_name(Elf *, const GElf_Sym *, size_t, @@ -441,18 +441,18 @@ parse_demangle_option(const char *opt) } static void -get_opt(int argc, char **argv) +get_opt(int *argc, char ***argv) { int ch; bool is_posix, oflag; - if (argc <= 0 || argv == NULL) + if (*argc <= 0 || *argv == NULL) return; oflag = is_posix = false; nm_opts.t = RADIX_HEX; - while ((ch = getopt_long(argc, argv, "ABCDF:PSVaefghlnoprst:uvx", - nm_longopts, NULL)) != -1) { + while ((ch = getopt_long(*argc, *argv, "ABCDF:PSVaefghlnoprst:uvx", + nm_longopts, NULL)) != -1) { switch (ch) { case 'A': nm_opts.print_name = PRINT_NAME_FULL; @@ -573,6 +573,8 @@ get_opt(int argc, char **argv) usage(1); } } + *argc -= optind; + *argv += optind; /* * In POSIX mode, the '-o' option controls the output radix. @@ -2115,8 +2117,8 @@ main(int argc, char **argv) int rtn; global_init(); - get_opt(argc, argv); - rtn = read_files(argc - optind, argv + optind); + get_opt(&argc, &argv); + rtn = read_files(argc, argv); global_dest(); exit(rtn); From owner-svn-src-all@freebsd.org Mon Sep 30 17:28:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B98B712D5A2; Mon, 30 Sep 2019 17:28:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hq9X4Rp4z4CT5; Mon, 30 Sep 2019 17:28:00 +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 7D24B6100; Mon, 30 Sep 2019 17:28:00 +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 x8UHS0Am070660; Mon, 30 Sep 2019 17:28:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UHS0QF070658; Mon, 30 Sep 2019 17:28:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909301728.x8UHS0QF070658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 17:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352909 - in head: contrib/elftoolchain/nm usr.bin/nm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: contrib/elftoolchain/nm usr.bin/nm X-SVN-Commit-Revision: 352909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 17:28:00 -0000 Author: markj Date: Mon Sep 30 17:27:59 2019 New Revision: 352909 URL: https://svnweb.freebsd.org/changeset/base/352909 Log: Capsicumize nm(1). Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21107 Modified: head/contrib/elftoolchain/nm/nm.c head/usr.bin/nm/Makefile Modified: head/contrib/elftoolchain/nm/nm.c ============================================================================== --- head/contrib/elftoolchain/nm/nm.c Mon Sep 30 17:26:42 2019 (r352908) +++ head/contrib/elftoolchain/nm/nm.c Mon Sep 30 17:27:59 2019 (r352909) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,9 @@ #include #include +#include +#include + #include "_elftc.h" ELFTC_VCSID("$Id: nm.c 3504 2016-12-17 15:33:16Z kaiwang27 $"); @@ -165,6 +169,8 @@ struct nm_prog_options { fn_sym_print value_print_fn; fn_sym_print size_print_fn; + + fileargs_t *fileargs; }; #define CHECK_SYM_PRINT_DATA(p) (p->headp == NULL || p->sh_num == 0 || \ @@ -177,6 +183,7 @@ static int cmp_name(const void *, const void *); static int cmp_none(const void *, const void *); static int cmp_size(const void *, const void *); static int cmp_value(const void *, const void *); +static void enter_cap_mode(int, char **); static void filter_dest(void); static int filter_insert(fn_filter); static void get_opt(int *, char ***); @@ -393,6 +400,36 @@ cmp_value(const void *lp, const void *rp) } static void +enter_cap_mode(int argc, char **argv) +{ + cap_rights_t rights; + fileargs_t *fa; + char *defaultfn; + + cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R); + + if (argc == 0) { + defaultfn = strdup(nm_info.def_filename); + if (defaultfn == NULL) + err(EXIT_FAILURE, "strdup"); + argc = 1; + argv = &defaultfn; + } + + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); + if (fa == NULL) + err(EXIT_FAILURE, "failed to initialize fileargs"); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0) + err(EXIT_FAILURE, "failed to limit stdio rights"); + if (caph_enter_casper() < 0) + err(EXIT_FAILURE, "failed to enter capability mode"); + + nm_opts.fileargs = fa; +} + +static void filter_dest(void) { struct filter_entry *e; @@ -766,6 +803,7 @@ global_init(void) nm_opts.elem_print_fn = &sym_elem_print_all; nm_opts.value_print_fn = &sym_value_dec_print; nm_opts.size_print_fn = &sym_size_dec_print; + nm_opts.fileargs = NULL; SLIST_INIT(&nm_out_filter); } @@ -1469,7 +1507,7 @@ read_object(const char *filename) assert(filename != NULL && "filename is null"); - if ((fd = open(filename, O_RDONLY)) == -1) { + if ((fd = fileargs_open(nm_opts.fileargs, filename)) == -1) { warn("'%s'", filename); return (1); } @@ -2118,6 +2156,7 @@ main(int argc, char **argv) global_init(); get_opt(&argc, &argv); + enter_cap_mode(argc, argv); rtn = read_files(argc, argv); global_dest(); Modified: head/usr.bin/nm/Makefile ============================================================================== --- head/usr.bin/nm/Makefile Mon Sep 30 17:26:42 2019 (r352908) +++ head/usr.bin/nm/Makefile Mon Sep 30 17:27:59 2019 (r352909) @@ -11,6 +11,12 @@ PROG= nm LIBADD= dwarf elftc elf +.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) && !defined(NXB_TARGET) +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+= -DWITH_CASPER +.endif + CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common .include From owner-svn-src-all@freebsd.org Mon Sep 30 17:34:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D550112D886; Mon, 30 Sep 2019 17:34:25 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hqJx5Hxwz4Cy8; Mon, 30 Sep 2019 17:34:25 +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 9526562DD; Mon, 30 Sep 2019 17:34:25 +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 x8UHYPLM076586; Mon, 30 Sep 2019 17:34:25 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UHYPfb076585; Mon, 30 Sep 2019 17:34:25 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909301734.x8UHYPfb076585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 30 Sep 2019 17:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352910 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 352910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 17:34:25 -0000 Author: erj Date: Mon Sep 30 17:34:25 2019 New Revision: 352910 URL: https://svnweb.freebsd.org/changeset/base/352910 Log: MFC r352655: iflib: Remove redundant VLAN events deregistration This fixes a kernel panic that can occur when unloading an iflib-using driver. Sponsored by: Intel Corporation Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Mon Sep 30 17:27:59 2019 (r352909) +++ stable/12/sys/net/iflib.c Mon Sep 30 17:34:25 2019 (r352910) @@ -4260,6 +4260,9 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag if ((vtag == 0) || (vtag > 4095)) return; + if (iflib_in_detach(ctx)) + return; + CTX_LOCK(ctx); IFDI_VLAN_REGISTER(ctx, vtag); /* Re-init to load the changes */ @@ -5024,12 +5027,6 @@ iflib_device_deregister(if_ctx_t ctx) CTX_LOCK(ctx); iflib_stop(ctx); CTX_UNLOCK(ctx); - - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); iflib_netmap_detach(ifp); ether_ifdetach(ifp); From owner-svn-src-all@freebsd.org Mon Sep 30 17:36:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 921C112D931; Mon, 30 Sep 2019 17:36:50 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hqMk3Jlzz4D5c; Mon, 30 Sep 2019 17:36:50 +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 383A962DE; Mon, 30 Sep 2019 17:36:50 +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 x8UHan2F076761; Mon, 30 Sep 2019 17:36:49 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UHanii076758; Mon, 30 Sep 2019 17:36:49 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909301736.x8UHanii076758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 30 Sep 2019 17:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352911 - stable/12/sys/dev/ixgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/ixgbe X-SVN-Commit-Revision: 352911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 17:36:50 -0000 Author: erj Date: Mon Sep 30 17:36:49 2019 New Revision: 352911 URL: https://svnweb.freebsd.org/changeset/base/352911 Log: MFC r352656: ix/ixv: Read MSI-X bar from device config This fixes an issue with some HP-branded Intel 10G cards not being able to use MSI-X. Sponsored by: Intel Corporation Modified: stable/12/sys/dev/ixgbe/if_ix.c stable/12/sys/dev/ixgbe/if_ixv.c stable/12/sys/dev/ixgbe/ixgbe.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/12/sys/dev/ixgbe/if_ix.c Mon Sep 30 17:34:25 2019 (r352910) +++ stable/12/sys/dev/ixgbe/if_ix.c Mon Sep 30 17:36:49 2019 (r352911) @@ -1011,12 +1011,13 @@ ixgbe_if_attach_pre(if_ctx_t ctx) CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; if (adapter->hw.mac.type == ixgbe_mac_82598EB) { scctx->isc_tx_nsegments = IXGBE_82598_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); } else { scctx->isc_tx_csum_flags |= CSUM_SCTP |CSUM_IP6_SCTP; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82599_BAR); } + + scctx->isc_msix_bar = pci_msix_table_bar(dev); + scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: stable/12/sys/dev/ixgbe/if_ixv.c ============================================================================== --- stable/12/sys/dev/ixgbe/if_ixv.c Mon Sep 30 17:34:25 2019 (r352910) +++ stable/12/sys/dev/ixgbe/if_ixv.c Mon Sep 30 17:36:49 2019 (r352911) @@ -495,7 +495,7 @@ ixv_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: stable/12/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/12/sys/dev/ixgbe/ixgbe.h Mon Sep 30 17:34:25 2019 (r352910) +++ stable/12/sys/dev/ixgbe/ixgbe.h Mon Sep 30 17:36:49 2019 (r352911) @@ -189,8 +189,6 @@ #define MAX_NUM_MULTICAST_ADDRESSES 128 #define IXGBE_82598_SCATTER 100 #define IXGBE_82599_SCATTER 32 -#define MSIX_82598_BAR 3 -#define MSIX_82599_BAR 4 #define IXGBE_TSO_SIZE 262140 #define IXGBE_RX_HDR 128 #define IXGBE_VFTA_SIZE 128 From owner-svn-src-all@freebsd.org Mon Sep 30 18:22:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F07F112EA18; Mon, 30 Sep 2019 18:22:34 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hrNV61y0z4GSh; Mon, 30 Sep 2019 18:22:34 +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 B34026BE4; Mon, 30 Sep 2019 18:22:34 +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 x8UIMYhx006071; Mon, 30 Sep 2019 18:22:34 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UIMXfF006067; Mon, 30 Sep 2019 18:22:33 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909301822.x8UIMXfF006067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 30 Sep 2019 18:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352912 - in releng/12.1/sys: dev/ixgbe net X-SVN-Group: releng X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in releng/12.1/sys: dev/ixgbe net X-SVN-Commit-Revision: 352912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 18:22:35 -0000 Author: erj Date: Mon Sep 30 18:22:33 2019 New Revision: 352912 URL: https://svnweb.freebsd.org/changeset/base/352912 Log: MFC r352910 and r352911 MFC r352910: iflib: Remove redundant VLAN events deregistration MFC r352911: ix/ixv: Read MSI-X bar from device config These fix an issue with a kernel panic on unload with an iflib-using driver and allow certain HP-branded Intel 10G cards to use MSI-X, respectively. Approved by: re@ (gjb@) Sponsored by: Intel Corporation Modified: releng/12.1/sys/dev/ixgbe/if_ix.c releng/12.1/sys/dev/ixgbe/if_ixv.c releng/12.1/sys/dev/ixgbe/ixgbe.h releng/12.1/sys/net/iflib.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/ixgbe/if_ix.c ============================================================================== --- releng/12.1/sys/dev/ixgbe/if_ix.c Mon Sep 30 17:36:49 2019 (r352911) +++ releng/12.1/sys/dev/ixgbe/if_ix.c Mon Sep 30 18:22:33 2019 (r352912) @@ -1011,12 +1011,13 @@ ixgbe_if_attach_pre(if_ctx_t ctx) CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; if (adapter->hw.mac.type == ixgbe_mac_82598EB) { scctx->isc_tx_nsegments = IXGBE_82598_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); } else { scctx->isc_tx_csum_flags |= CSUM_SCTP |CSUM_IP6_SCTP; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82599_BAR); } + + scctx->isc_msix_bar = pci_msix_table_bar(dev); + scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: releng/12.1/sys/dev/ixgbe/if_ixv.c ============================================================================== --- releng/12.1/sys/dev/ixgbe/if_ixv.c Mon Sep 30 17:36:49 2019 (r352911) +++ releng/12.1/sys/dev/ixgbe/if_ixv.c Mon Sep 30 18:22:33 2019 (r352912) @@ -495,7 +495,7 @@ ixv_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: releng/12.1/sys/dev/ixgbe/ixgbe.h ============================================================================== --- releng/12.1/sys/dev/ixgbe/ixgbe.h Mon Sep 30 17:36:49 2019 (r352911) +++ releng/12.1/sys/dev/ixgbe/ixgbe.h Mon Sep 30 18:22:33 2019 (r352912) @@ -189,8 +189,6 @@ #define MAX_NUM_MULTICAST_ADDRESSES 128 #define IXGBE_82598_SCATTER 100 #define IXGBE_82599_SCATTER 32 -#define MSIX_82598_BAR 3 -#define MSIX_82599_BAR 4 #define IXGBE_TSO_SIZE 262140 #define IXGBE_RX_HDR 128 #define IXGBE_VFTA_SIZE 128 Modified: releng/12.1/sys/net/iflib.c ============================================================================== --- releng/12.1/sys/net/iflib.c Mon Sep 30 17:36:49 2019 (r352911) +++ releng/12.1/sys/net/iflib.c Mon Sep 30 18:22:33 2019 (r352912) @@ -4260,6 +4260,9 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag if ((vtag == 0) || (vtag > 4095)) return; + if (iflib_in_detach(ctx)) + return; + CTX_LOCK(ctx); IFDI_VLAN_REGISTER(ctx, vtag); /* Re-init to load the changes */ @@ -5024,12 +5027,6 @@ iflib_device_deregister(if_ctx_t ctx) CTX_LOCK(ctx); iflib_stop(ctx); CTX_UNLOCK(ctx); - - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); iflib_netmap_detach(ifp); ether_ifdetach(ifp); From owner-svn-src-all@freebsd.org Mon Sep 30 19:03:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD9E412F940; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hsHz5Xj1z4JXK; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1E6E7337; Mon, 30 Sep 2019 19:03:43 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UJ3hvE029498; Mon, 30 Sep 2019 19:03:43 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UJ3h3f029497; Mon, 30 Sep 2019 19:03:43 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <201909301903.x8UJ3h3f029497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Mon, 30 Sep 2019 19:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352913 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 352913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 19:03:43 -0000 Author: kaktus Date: Mon Sep 30 19:03:43 2019 New Revision: 352913 URL: https://svnweb.freebsd.org/changeset/base/352913 Log: libsysdecode: decode PROT_MAX flags Extend libsysdecode to pretty-print PROT_MAX flags and fix decoding of regular protection flags broken since r349240. before: truss: mmap(0x0,40960,0x30000,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000<>196608,0x21002,0xffffffff,0) after: truss: mmap(0x0,40960,PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000,0x21002,0xffffffff,0) Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D21706 Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Mon Sep 30 18:22:33 2019 (r352912) +++ head/lib/libsysdecode/flags.c Mon Sep 30 19:03:43 2019 (r352913) @@ -657,8 +657,18 @@ sysdecode_mlockall_flags(FILE *fp, int flags, int *rem bool sysdecode_mmap_prot(FILE *fp, int prot, int *rem) { + int protm; + bool printed; - return (print_mask_int(fp, mmapprot, prot, rem)); + printed = false; + protm = PROT_MAX_EXTRACT(prot); + if (protm != 0) { + fputs("PROT_MAX(", fp); + printed = print_mask_int(fp, mmapprot, protm, rem); + fputs(")|", fp); + prot = protm; + } + return (print_mask_int(fp, mmapprot, prot, rem) || printed); } bool From owner-svn-src-all@freebsd.org Mon Sep 30 19:05:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C48B512FA1E; Mon, 30 Sep 2019 19:05:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hsKk4q2Qz4Jlh; Mon, 30 Sep 2019 19:05:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 883E4733C; Mon, 30 Sep 2019 19:05:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UJ5EE0029625; Mon, 30 Sep 2019 19:05:14 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UJ5EB0029624; Mon, 30 Sep 2019 19:05:14 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <201909301905.x8UJ5EB0029624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Mon, 30 Sep 2019 19:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352914 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 352914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 19:05:14 -0000 Author: kaktus Date: Mon Sep 30 19:05:14 2019 New Revision: 352914 URL: https://svnweb.freebsd.org/changeset/base/352914 Log: linux_renameat2: don't add extra \n on error. linux_msg() already adds \n at the end of all messages. Reported by: emaste, kib (mentor), mjg (mentor) Reviewed by: kib (mentor), mjg (mentor) Differential Revision: https://reviews.freebsd.org/D21852 Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Sep 30 19:03:43 2019 (r352913) +++ head/sys/compat/linux/linux_file.c Mon Sep 30 19:05:14 2019 (r352914) @@ -704,7 +704,7 @@ linux_renameat2(struct thread *td, struct linux_rename int error, olddfd, newdfd; if (args->flags != 0) { - linux_msg(td, "renameat2 unsupported flags 0x%x\n", + linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); return (EINVAL); } From owner-svn-src-all@freebsd.org Mon Sep 30 19:10:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE3E812FC0B; Mon, 30 Sep 2019 19:10:39 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hsRz5zlkz4K6B; Mon, 30 Sep 2019 19:10:39 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from [172.20.0.193] (193-106-244-222.noc.fibertech.net.pl [193.106.244.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: kaktus/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D37A128C2A; Mon, 30 Sep 2019 19:10:38 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) From: =?utf-8?Q?Pawe=C5=82_Biernacki?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352914 - head/sys/compat/linux Date: Mon, 30 Sep 2019 21:10:35 +0200 References: <201909301905.x8UJ5EB0029624@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201909301905.x8UJ5EB0029624@repo.freebsd.org> Message-Id: <30C3B920-8F83-4677-A984-4701A505D4AC@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 19:10:40 -0000 > On 30 Sep 2019, at 21:05, Pawel Biernacki wrote: >=20 > Author: kaktus > Date: Mon Sep 30 19:05:14 2019 > New Revision: 352914 > URL: https://svnweb.freebsd.org/changeset/base/352914 >=20 > Log: > linux_renameat2: don't add extra \n on error. >=20 > linux_msg() already adds \n at the end of all messages. >=20 > Reported by: emaste, kib (mentor), mjg (mentor) > Reviewed by: kib (mentor), mjg (mentor) Should be: Reviewed by: emaste, kib (mentor), mjg (mentor) Approved by: kib (mentor), mjg (mentor) > Differential Revision: https://reviews.freebsd.org/D21852 >=20 > Modified: > head/sys/compat/linux/linux_file.c >=20 > Modified: head/sys/compat/linux/linux_file.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/compat/linux/linux_file.c Mon Sep 30 19:03:43 2019 = (r352913) > +++ head/sys/compat/linux/linux_file.c Mon Sep 30 19:05:14 2019 = (r352914) > @@ -704,7 +704,7 @@ linux_renameat2(struct thread *td, struct = linux_rename > int error, olddfd, newdfd; >=20 > if (args->flags !=3D 0) { > - linux_msg(td, "renameat2 unsupported flags 0x%x\n", > + linux_msg(td, "renameat2 unsupported flags 0x%x", > args->flags); > return (EINVAL); > } From owner-svn-src-all@freebsd.org Mon Sep 30 19:24:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A172130237; Mon, 30 Sep 2019 19:24:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hslp0NRwz4L0J; Mon, 30 Sep 2019 19:24:22 +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 E5F6C76E9; Mon, 30 Sep 2019 19:24:21 +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 x8UJOLPX041313; Mon, 30 Sep 2019 19:24:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UJOLFI041312; Mon, 30 Sep 2019 19:24:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909301924.x8UJOLFI041312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 30 Sep 2019 19:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352915 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 352915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 19:24:22 -0000 Author: dim Date: Mon Sep 30 19:24:21 2019 New Revision: 352915 URL: https://svnweb.freebsd.org/changeset/base/352915 Log: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. PR: 240928 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Modified: head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Mon Sep 30 19:05:14 2019 (r352914) +++ head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Mon Sep 30 19:24:21 2019 (r352915) @@ -154,6 +154,15 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter MFI->insert(MBBI, NewMI); // Insert the new inst return NewMI; } + } + + if (!MI.isConvertibleTo3Addr()) + return nullptr; + + switch (MI.getOpcode()) { + default: + // Only convert instructions that we've verified are safe. + return nullptr; case X86::ADD64ri32: case X86::ADD64ri8: case X86::ADD64ri32_DB: @@ -162,24 +171,24 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter case X86::ADD32ri8: case X86::ADD32ri_DB: case X86::ADD32ri8_DB: - case X86::ADD16ri: - case X86::ADD16ri8: - case X86::ADD16ri_DB: - case X86::ADD16ri8_DB: if (!MI.getOperand(2).isImm()) { // convertToThreeAddress will call getImm() // which requires isImm() to be true return nullptr; } break; - case X86::ADD16rr: - case X86::ADD16rr_DB: - if (MI.getOperand(1).getReg() != MI.getOperand(2).getReg()) { - // if src1 != src2, then convertToThreeAddress will - // need to create a Virtual register, which we cannot do - // after register allocation. - return nullptr; - } + case X86::SHL64ri: + case X86::SHL32ri: + case X86::INC64r: + case X86::INC32r: + case X86::DEC64r: + case X86::DEC32r: + case X86::ADD64rr: + case X86::ADD64rr_DB: + case X86::ADD32rr: + case X86::ADD32rr_DB: + // These instructions are all fine to convert. + break; } return TII->convertToThreeAddress(MFI, MI, nullptr); } From owner-svn-src-all@freebsd.org Mon Sep 30 20:39:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EAE9131984; Mon, 30 Sep 2019 20:39:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hvQQ0QZ2z4PYt; Mon, 30 Sep 2019 20:39:26 +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 E763A83EE; Mon, 30 Sep 2019 20:39:25 +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 x8UKdPeY083288; Mon, 30 Sep 2019 20:39:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UKdPec083287; Mon, 30 Sep 2019 20:39:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909302039.x8UKdPec083287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 20:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352916 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 352916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 20:39:26 -0000 Author: markj Date: Mon Sep 30 20:39:25 2019 New Revision: 352916 URL: https://svnweb.freebsd.org/changeset/base/352916 Log: Remove more identifiers orphaned by r351742. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D21642 Modified: head/sys/amd64/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Mon Sep 30 19:24:21 2019 (r352915) +++ head/sys/amd64/include/pmap.h Mon Sep 30 20:39:25 2019 (r352916) @@ -201,13 +201,6 @@ #define NDMPML4E 8 /* - * NPAPML4E is the maximum number of PML4 entries that will be - * used to implement the page array. This should be roughly 3% of - * NPDPML4E owing to 3% overhead for struct vm_page. - */ -#define NPAPML4E 1 - -/* * These values control the layout of virtual memory. The starting address * of the direct map, which is controlled by DMPML4I, must be a multiple of * its size. (See the PHYS_TO_DMAP() and DMAP_TO_PHYS() macros.) @@ -226,8 +219,7 @@ #define PML4PML4I (NPML4EPG/2) /* Index of recursive pml4 mapping */ #define KPML4BASE (NPML4EPG-NKPML4E) /* KVM at highest addresses */ -#define PAPML4I (KPML4BASE-1-NPAPML4E) /* Below KVM */ -#define DMPML4I rounddown(PAPML4I-NDMPML4E, NDMPML4E) /* Below pages */ +#define DMPML4I rounddown(KPML4BASE-NDMPML4E, NDMPML4E) /* Below KVM */ #define KPML4I (NPML4EPG-1) #define KPDPI (NPDPEPG-2) /* kernbase at -2GB */ From owner-svn-src-all@freebsd.org Mon Sep 30 20:58:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12BF013207A; Mon, 30 Sep 2019 20:58:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hvrP6llCz4R3F; Mon, 30 Sep 2019 20:58:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB32287E3; Mon, 30 Sep 2019 20:58:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UKwT61096016; Mon, 30 Sep 2019 20:58:29 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UKwT1A096015; Mon, 30 Sep 2019 20:58:29 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201909302058.x8UKwT1A096015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 30 Sep 2019 20:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352917 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 20:58:30 -0000 Author: brooks Date: Mon Sep 30 20:58:29 2019 New Revision: 352917 URL: https://svnweb.freebsd.org/changeset/base/352917 Log: Restore the ability to set capenabled directly in syscalls.conf. This fixes generation of cloudabi syscall tables broken in r340424. Reviewed by: kevans, emaste MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21821 Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Sep 30 20:39:25 2019 (r352916) +++ head/sys/kern/makesyscalls.sh Mon Sep 30 20:58:29 2019 (r352917) @@ -64,7 +64,9 @@ if [ -n "$2" ]; then . "$2" fi -if [ -r $capabilities_conf ]; then +if [ -n "$capenabled" ]; then + # do nothing +elif [ -r $capabilities_conf ]; then capenabled=`egrep -v '^#|^$' $capabilities_conf` capenabled=`echo $capenabled | sed 's/ /,/g'` else From owner-svn-src-all@freebsd.org Mon Sep 30 21:00:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4CA713211A; Mon, 30 Sep 2019 21:00:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hvtY5F8vz4RCP; Mon, 30 Sep 2019 21:00:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96EFC87EF; Mon, 30 Sep 2019 21:00:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UL0Lup096230; Mon, 30 Sep 2019 21:00:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UL0Jfv096219; Mon, 30 Sep 2019 21:00:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201909302100.x8UL0Jfv096219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 30 Sep 2019 21:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352918 - in head/sys/compat: cloudabi32 cloudabi64 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys/compat: cloudabi32 cloudabi64 X-SVN-Commit-Revision: 352918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 21:00:21 -0000 Author: brooks Date: Mon Sep 30 21:00:19 2019 New Revision: 352918 URL: https://svnweb.freebsd.org/changeset/base/352918 Log: Regen after r347228 and r352693. No functional change. Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_syscall.h head/sys/compat/cloudabi32/cloudabi32_syscalls.c head/sys/compat/cloudabi32/cloudabi32_sysent.c head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ @@ -356,6 +356,12 @@ int cloudabi_sys_thread_yield(struct thread *, struct #endif /* COMPAT_FREEBSD11 */ + + +#ifdef COMPAT_FREEBSD12 + + +#endif /* COMPAT_FREEBSD12 */ #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL Modified: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ @@ -356,6 +356,12 @@ int cloudabi_sys_thread_yield(struct thread *, struct #endif /* COMPAT_FREEBSD11 */ + + +#ifdef COMPAT_FREEBSD12 + + +#endif /* COMPAT_FREEBSD12 */ #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Mon Sep 30 20:58:29 2019 (r352917) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Mon Sep 30 21:00:19 2019 (r352918) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ From owner-svn-src-all@freebsd.org Mon Sep 30 21:14:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2C8413249E; Mon, 30 Sep 2019 21:14:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hwBx5k8Sz4RvL; Mon, 30 Sep 2019 21:14:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83EE8B97; Mon, 30 Sep 2019 21:14:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ULEXCD007586; Mon, 30 Sep 2019 21:14:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ULEXaO007585; Mon, 30 Sep 2019 21:14:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201909302114.x8ULEXaO007585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 30 Sep 2019 21:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352919 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 21:14:33 -0000 Author: brooks Date: Mon Sep 30 21:14:33 2019 New Revision: 352919 URL: https://svnweb.freebsd.org/changeset/base/352919 Log: Update cloudabi(32|64) sysents with "make sysent". MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Sep 30 21:00:19 2019 (r352918) +++ head/Makefile.inc1 Mon Sep 30 21:14:33 2019 (r352919) @@ -1467,6 +1467,8 @@ packageworld: .PHONY _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 +_sysent_dirs+= sys/compat/cloudabi32 \ + sys/compat/cloudabi64 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ sys/arm64/linux \ From owner-svn-src-all@freebsd.org Mon Sep 30 21:48:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4FA5132E87; Mon, 30 Sep 2019 21:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hwxn4rcJz4TJ3; Mon, 30 Sep 2019 21:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A5B290F6; Mon, 30 Sep 2019 21:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ULmDFN026211; Mon, 30 Sep 2019 21:48:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ULmCOt026207; Mon, 30 Sep 2019 21:48:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201909302148.x8ULmCOt026207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 30 Sep 2019 21:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352920 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 352920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 21:48:13 -0000 Author: mmacy Date: Mon Sep 30 21:48:12 2019 New Revision: 352920 URL: https://svnweb.freebsd.org/changeset/base/352920 Log: Add conv=fdatasync flag to dd The fdatasync flag performs an fdatasync(2) on the output file before closing it. This will be useful for the ZFS test suite. Submitted by: Ryan Moeller Reviewed by: manpages, mmacy@ MFC after: 1 week Sponsored by: iXSystems, Inc. Differential Revision: https://reviews.freebsd.org/D21373 Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Sep 30 21:14:33 2019 (r352919) +++ head/bin/dd/args.c Mon Sep 30 21:48:12 2019 (r352920) @@ -77,7 +77,7 @@ static off_t get_off_t(const char *); static const struct arg { const char *name; void (*f)(char *); - u_int set, noset; + uint64_t set, noset; } args[] = { { "bs", f_bs, C_BS, C_BS|C_IBS|C_OBS|C_OSYNC }, { "cbs", f_cbs, C_CBS, C_CBS }, @@ -314,12 +314,13 @@ f_status(char *arg) static const struct conv { const char *name; - u_int set, noset; + uint64_t set, noset; const u_char *ctab; } clist[] = { { "ascii", C_ASCII, C_EBCDIC, e2a_POSIX }, { "block", C_BLOCK, C_UNBLOCK, NULL }, { "ebcdic", C_EBCDIC, C_ASCII, a2e_POSIX }, + { "fdatasync", C_FDATASYNC, 0, NULL }, { "fsync", C_FSYNC, 0, NULL }, { "ibm", C_EBCDIC, C_ASCII, a2ibm_POSIX }, { "lcase", C_LCASE, C_UCASE, NULL }, Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Mon Sep 30 21:14:33 2019 (r352919) +++ head/bin/dd/dd.1 Mon Sep 30 21:48:12 2019 (r352920) @@ -252,6 +252,10 @@ are maps used in historic and .No pre- Ns Bx 4.3 reno systems. +.It Cm fdatasync +Perform an +.Xr fdatasync 2 +on the output file before closing it. .It Cm fsync Perform an .Xr fsync 2 Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Sep 30 21:14:33 2019 (r352919) +++ head/bin/dd/dd.c Mon Sep 30 21:48:12 2019 (r352920) @@ -83,7 +83,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -u_int ddflags = 0; /* conversion options */ +uint64_t ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ @@ -164,7 +164,7 @@ setup(void) errx(1, "files is not supported for non-tape devices"); cap_rights_set(&rights, CAP_FTRUNCATE, CAP_IOCTL, CAP_WRITE); - if (ddflags & C_FSYNC) + if (ddflags & (C_FDATASYNC | C_FSYNC)) cap_rights_set(&rights, CAP_FSYNC); if (out.name == NULL) { /* No way to check for read access here. */ @@ -511,6 +511,9 @@ dd_close(void) if (ddflags & C_FSYNC) { if (fsync(out.fd) == -1) err(1, "fsyncing %s", out.name); + } else if (ddflags & C_FDATASYNC) { + if (fdatasync(out.fd) == -1) + err(1, "fdatasyncing %s", out.name); } } Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Sep 30 21:14:33 2019 (r352919) +++ head/bin/dd/dd.h Mon Sep 30 21:48:12 2019 (r352920) @@ -70,38 +70,39 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x00000001 -#define C_BLOCK 0x00000002 -#define C_BS 0x00000004 -#define C_CBS 0x00000008 -#define C_COUNT 0x00000010 -#define C_EBCDIC 0x00000020 -#define C_FILES 0x00000040 -#define C_IBS 0x00000080 -#define C_IF 0x00000100 -#define C_LCASE 0x00000200 -#define C_NOERROR 0x00000400 -#define C_NOTRUNC 0x00000800 -#define C_OBS 0x00001000 -#define C_OF 0x00002000 -#define C_OSYNC 0x00004000 -#define C_PAREVEN 0x00008000 -#define C_PARNONE 0x00010000 -#define C_PARODD 0x00020000 -#define C_PARSET 0x00040000 -#define C_SEEK 0x00080000 -#define C_SKIP 0x00100000 -#define C_SPARSE 0x00200000 -#define C_SWAB 0x00400000 -#define C_SYNC 0x00800000 -#define C_UCASE 0x01000000 -#define C_UNBLOCK 0x02000000 -#define C_FILL 0x04000000 -#define C_STATUS 0x08000000 -#define C_NOXFER 0x10000000 -#define C_NOINFO 0x20000000 -#define C_PROGRESS 0x40000000 -#define C_FSYNC 0x80000000 +#define C_ASCII 0x0000000000000001ULL +#define C_BLOCK 0x0000000000000002ULL +#define C_BS 0x0000000000000004ULL +#define C_CBS 0x0000000000000008ULL +#define C_COUNT 0x0000000000000010ULL +#define C_EBCDIC 0x0000000000000020ULL +#define C_FILES 0x0000000000000040ULL +#define C_IBS 0x0000000000000080ULL +#define C_IF 0x0000000000000100ULL +#define C_LCASE 0x0000000000000200ULL +#define C_NOERROR 0x0000000000000400ULL +#define C_NOTRUNC 0x0000000000000800ULL +#define C_OBS 0x0000000000001000ULL +#define C_OF 0x0000000000002000ULL +#define C_OSYNC 0x0000000000004000ULL +#define C_PAREVEN 0x0000000000008000ULL +#define C_PARNONE 0x0000000000010000ULL +#define C_PARODD 0x0000000000020000ULL +#define C_PARSET 0x0000000000040000ULL +#define C_SEEK 0x0000000000080000ULL +#define C_SKIP 0x0000000000100000ULL +#define C_SPARSE 0x0000000000200000ULL +#define C_SWAB 0x0000000000400000ULL +#define C_SYNC 0x0000000000800000ULL +#define C_UCASE 0x0000000001000000ULL +#define C_UNBLOCK 0x0000000002000000ULL +#define C_FILL 0x0000000004000000ULL +#define C_STATUS 0x0000000008000000ULL +#define C_NOXFER 0x0000000010000000ULL +#define C_NOINFO 0x0000000020000000ULL +#define C_PROGRESS 0x0000000040000000ULL +#define C_FSYNC 0x0000000080000000ULL +#define C_FDATASYNC 0x0000000100000000ULL #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Mon Sep 30 21:14:33 2019 (r352919) +++ head/bin/dd/extern.h Mon Sep 30 21:48:12 2019 (r352920) @@ -58,7 +58,7 @@ extern STAT st; extern void (*cfunc)(void); extern uintmax_t cpy_cnt; extern size_t cbsz; -extern u_int ddflags; +extern uint64_t ddflags; extern size_t speed; extern uintmax_t files_cnt; extern const u_char *ctab; From owner-svn-src-all@freebsd.org Mon Sep 30 21:53:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B68A513321C; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hx3p4Nyxz4Tl2; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79F4992D6; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ULrQlt031851; Mon, 30 Sep 2019 21:53:26 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ULrQoO031850; Mon, 30 Sep 2019 21:53:26 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201909302153.x8ULrQoO031850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 30 Sep 2019 21:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352921 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 352921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 21:53:26 -0000 Author: mmacy Date: Mon Sep 30 21:53:26 2019 New Revision: 352921 URL: https://svnweb.freebsd.org/changeset/base/352921 Log: dd: Check result of close(2) for errors close(2) can return errors from previous operations which should not be ignored. PR: 229616 Submitted by: Thomas Hurst Reported by: Thomas Hurst Reviewed by: mmacy@ Obtained from: Ryan Moeller MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21376 Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Sep 30 21:48:12 2019 (r352920) +++ head/bin/dd/dd.c Mon Sep 30 21:53:26 2019 (r352921) @@ -124,7 +124,8 @@ main(int argc __unused, char *argv[]) * descriptor explicitly so that the summary handler (called * from an atexit() hook) includes this work. */ - close(out.fd); + if (close(out.fd) == -1 && errno != EINTR) + err(1, "close"); exit(0); } From owner-svn-src-all@freebsd.org Mon Sep 30 21:56:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B935D1334B3; Mon, 30 Sep 2019 21:56:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hx7b4RzSz4V2s; Mon, 30 Sep 2019 21:56:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 786AD92F6; Mon, 30 Sep 2019 21:56:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ULuhl9032098; Mon, 30 Sep 2019 21:56:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ULugWF032095; Mon, 30 Sep 2019 21:56:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201909302156.x8ULugWF032095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 30 Sep 2019 21:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352922 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 352922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 21:56:43 -0000 Author: mmacy Date: Mon Sep 30 21:56:42 2019 New Revision: 352922 URL: https://svnweb.freebsd.org/changeset/base/352922 Log: Add oflag=fsync and oflag=sync capability to dd Sets the O_FSYNC flag on the output file. oflag=fsync and oflag=sync are synonyms just as O_FSYNC and O_SYNC are synonyms. This functionality is intended to improve portability of dd commands in the ZFS test suite. Submitted by: Ryan Moeller Reviewed by: manpages, mmacy@ MFC after: 1 week Sponsored by: iXsytems, Inc. Differential Revision: https://reviews.freebsd.org/D21422 Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Sep 30 21:53:26 2019 (r352921) +++ head/bin/dd/args.c Mon Sep 30 21:56:42 2019 (r352922) @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); static int c_arg(const void *, const void *); static int c_conv(const void *, const void *); +static int c_oflag(const void *, const void *); static void f_bs(char *); static void f_cbs(char *); static void f_conv(char *); @@ -67,6 +68,7 @@ static void f_ibs(char *); static void f_if(char *); static void f_obs(char *); static void f_of(char *); +static void f_oflag(char *); static void f_seek(char *); static void f_skip(char *); static void f_speed(char *); @@ -90,6 +92,7 @@ static const struct arg { { "iseek", f_skip, C_SKIP, C_SKIP }, { "obs", f_obs, C_OBS, C_BS|C_OBS }, { "of", f_of, C_OF, C_OF }, + { "oflag", f_oflag, 0, 0 }, { "oseek", f_seek, C_SEEK, C_SEEK }, { "seek", f_seek, C_SEEK, C_SEEK }, { "skip", f_skip, C_SKIP, C_SKIP }, @@ -348,8 +351,8 @@ f_conv(char *arg) while (arg != NULL) { tmp.name = strsep(&arg, ","); - cp = bsearch(&tmp, clist, sizeof(clist) / sizeof(struct conv), - sizeof(struct conv), c_conv); + cp = bsearch(&tmp, clist, nitems(clist), sizeof(struct conv), + c_conv); if (cp == NULL) errx(1, "unknown conversion %s", tmp.name); if (ddflags & cp->noset) @@ -366,6 +369,37 @@ c_conv(const void *a, const void *b) return (strcmp(((const struct conv *)a)->name, ((const struct conv *)b)->name)); +} + +static const struct oflag { + const char *name; + uint64_t set; +} olist[] = { + { "fsync", C_OFSYNC }, + { "sync", C_OFSYNC }, +}; + +static void +f_oflag(char *arg) +{ + struct oflag *op, tmp; + + while (arg != NULL) { + tmp.name = strsep(&arg, ","); + op = bsearch(&tmp, olist, nitems(olist), sizeof(struct oflag), + c_oflag); + if (op == NULL) + errx(1, "unknown open flag %s", tmp.name); + ddflags |= op->set; + } +} + +static int +c_oflag(const void *a, const void *b) +{ + + return (strcmp(((const struct oflag *)a)->name, + ((const struct oflag *)b)->name)); } static intmax_t Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Mon Sep 30 21:53:26 2019 (r352921) +++ head/bin/dd/dd.1 Mon Sep 30 21:56:42 2019 (r352922) @@ -123,6 +123,19 @@ If an initial portion of the output file is seeked pas .Cm oseek operand), the output file is truncated at that point. +.It Cm oflag Ns = Ns Ar value Ns Op , Ns Ar value ... +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width "fsync" +.It Cm fsync +Set the O_FSYNC flag on the output file to make writes synchronous. +.It Cm sync +Set the O_SYNC flag on the output file to make writes synchronous. +This is synonymous with the +.Cm fsync +value. +.El .It Cm oseek Ns = Ns Ar n Seek on the output file .Ar n Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Sep 30 21:53:26 2019 (r352921) +++ head/bin/dd/dd.c Mon Sep 30 21:56:42 2019 (r352922) @@ -143,6 +143,7 @@ static void setup(void) { u_int cnt; + int oflags; cap_rights_t rights; unsigned long cmds[] = { FIODTYPE, MTIOCTOP }; @@ -171,17 +172,28 @@ setup(void) /* No way to check for read access here. */ out.fd = STDOUT_FILENO; out.name = "stdout"; + if (ddflags & C_OFSYNC) { + oflags = fcntl(out.fd, F_GETFL); + if (oflags == -1) + err(1, "unable to get fd flags for stdout"); + oflags |= O_FSYNC; + if (fcntl(out.fd, F_SETFL, oflags) == -1) + err(1, "unable to set fd flags for stdout"); + } } else { -#define OFLAGS \ - (O_CREAT | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC)) - out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE); + oflags = O_CREAT; + if (!(ddflags & (C_SEEK | C_NOTRUNC))) + oflags |= O_TRUNC; + if (ddflags & C_OFSYNC) + oflags |= O_FSYNC; + out.fd = open(out.name, O_RDWR | oflags, DEFFILEMODE); /* * May not have read access, so try again with write only. * Without read we may have a problem if output also does * not support seeks. */ if (out.fd == -1) { - out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE); + out.fd = open(out.name, O_WRONLY | oflags, DEFFILEMODE); out.flags |= NOREAD; cap_rights_clear(&rights, CAP_READ); } Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Sep 30 21:53:26 2019 (r352921) +++ head/bin/dd/dd.h Mon Sep 30 21:56:42 2019 (r352922) @@ -103,6 +103,7 @@ typedef struct { #define C_PROGRESS 0x0000000040000000ULL #define C_FSYNC 0x0000000080000000ULL #define C_FDATASYNC 0x0000000100000000ULL +#define C_OFSYNC 0x0000000200000000ULL #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) From owner-svn-src-all@freebsd.org Mon Sep 30 22:00:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75F89133590; Mon, 30 Sep 2019 22:00:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hxDK2d2bz4VDm; Mon, 30 Sep 2019 22:00:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EE5E9440; Mon, 30 Sep 2019 22:00:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UM0n0P032398; Mon, 30 Sep 2019 22:00:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UM0mU5032395; Mon, 30 Sep 2019 22:00:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201909302200.x8UM0mU5032395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 30 Sep 2019 22:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352923 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 352923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Sep 2019 22:00:49 -0000 Author: mmacy Date: Mon Sep 30 22:00:48 2019 New Revision: 352923 URL: https://svnweb.freebsd.org/changeset/base/352923 Log: Add iflag=fullblock to dd Normally, count=n means read(2) will be called n times on the input to dd. If the read() returns short, as may happen when reading from a pipe, fewer bytes will be copied from the input. With conv=sync the buffer is padded with zeros to fill the rest of the block. iflag=fullblock causes dd to continue reading until the block is full, so that count=n means n full blocks are copied. This flag is compatible with illumos and GNU dd and is used in the ZFS test suite. Submitted by: Ryan Moeller Reviewed by: manpages, mmacy@ MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D21441 Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Sep 30 21:56:42 2019 (r352922) +++ head/bin/dd/args.c Mon Sep 30 22:00:48 2019 (r352923) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); static int c_arg(const void *, const void *); static int c_conv(const void *, const void *); +static int c_iflag(const void *, const void *); static int c_oflag(const void *, const void *); static void f_bs(char *); static void f_cbs(char *); @@ -66,6 +67,7 @@ static void f_files(char *); static void f_fillchar(char *); static void f_ibs(char *); static void f_if(char *); +static void f_iflag(char *); static void f_obs(char *); static void f_of(char *); static void f_oflag(char *); @@ -89,6 +91,7 @@ static const struct arg { { "fillchar", f_fillchar, C_FILL, C_FILL }, { "ibs", f_ibs, C_IBS, C_BS|C_IBS }, { "if", f_if, C_IF, C_IF }, + { "iflag", f_iflag, 0, 0 }, { "iseek", f_skip, C_SKIP, C_SKIP }, { "obs", f_obs, C_OBS, C_BS|C_OBS }, { "of", f_of, C_OF, C_OF }, @@ -259,7 +262,39 @@ f_if(char *arg) in.name = arg; } +static const struct iflag { + const char *name; + uint64_t set, noset; +} ilist[] = { + { "fullblock", C_IFULLBLOCK, C_SYNC }, +}; + static void +f_iflag(char *arg) +{ + struct iflag *ip, tmp; + + while (arg != NULL) { + tmp.name = strsep(&arg, ","); + ip = bsearch(&tmp, ilist, nitems(ilist), sizeof(struct iflag), + c_iflag); + if (ip == NULL) + errx(1, "unknown iflag %s", tmp.name); + if (ddflags & ip->noset) + errx(1, "%s: illegal conversion combination", tmp.name); + ddflags |= ip->set; + } +} + +static int +c_iflag(const void *a, const void *b) +{ + + return (strcmp(((const struct iflag *)a)->name, + ((const struct iflag *)b)->name)); +} + +static void f_obs(char *arg) { uintmax_t res; @@ -339,7 +374,7 @@ static const struct conv { { "parset", C_PARSET, C_PARODD|C_PAREVEN|C_PARNONE, NULL}, { "sparse", C_SPARSE, 0, NULL }, { "swab", C_SWAB, 0, NULL }, - { "sync", C_SYNC, 0, NULL }, + { "sync", C_SYNC, C_IFULLBLOCK, NULL }, { "ucase", C_UCASE, C_LCASE, NULL }, { "unblock", C_UNBLOCK, C_BLOCK, NULL }, }; Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Mon Sep 30 21:56:42 2019 (r352922) +++ head/bin/dd/dd.1 Mon Sep 30 22:00:48 2019 (r352923) @@ -102,6 +102,22 @@ bytes instead of the default 512. Read input from .Ar file instead of the standard input. +.It Cm iflag Ns = Ns Ar value Ns Op , Ns Ar value ... +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width "fullblock" +.It Cm fullblock +Reading from the input file may not obtain a full block. +When a read returns short, continue reading to fill the block. +Without this flag, +.Cm count +limits the number of times +.Xr read 2 +is called on the input rather than the number of blocks copied in full. +May not be combined with +.Cm conv=sync . +.El .It Cm iseek Ns = Ns Ar n Seek on the input file .Ar n Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Sep 30 21:56:42 2019 (r352922) +++ head/bin/dd/dd.c Mon Sep 30 22:00:48 2019 (r352923) @@ -408,13 +408,15 @@ dd_in(void) memset(in.dbp, 0, in.dbsz); } - n = read(in.fd, in.dbp, in.dbsz); - if (n == 0) { - in.dbrcnt = 0; + in.dbrcnt = 0; +fill: + n = read(in.fd, in.dbp + in.dbrcnt, in.dbsz - in.dbrcnt); + + /* EOF */ + if (n == 0 && in.dbrcnt == 0) return; - } - /* Read error. */ + /* Read error */ if (n == -1) { /* * If noerror not specified, die. POSIX requires that @@ -438,26 +440,26 @@ dd_in(void) /* If sync not specified, omit block and continue. */ if (!(ddflags & C_SYNC)) continue; + } - /* Read errors count as full blocks. */ - in.dbcnt += in.dbrcnt = in.dbsz; - ++st.in_full; + /* If conv=sync, use the entire block. */ + if (ddflags & C_SYNC) + n = in.dbsz; - /* Handle full input blocks. */ - } else if ((size_t)n == (size_t)in.dbsz) { - in.dbcnt += in.dbrcnt = n; - ++st.in_full; + /* Count the bytes read for this block. */ + in.dbrcnt += n; - /* Handle partial input blocks. */ - } else { - /* If sync, use the entire block. */ - if (ddflags & C_SYNC) - in.dbcnt += in.dbrcnt = in.dbsz; - else - in.dbcnt += in.dbrcnt = n; + /* Count the number of full and partial blocks. */ + if (in.dbrcnt == in.dbsz) + ++st.in_full; + else if (ddflags & C_IFULLBLOCK && n != 0) + goto fill; /* these don't count */ + else ++st.in_part; - } + /* Count the total bytes read for this file. */ + in.dbcnt += in.dbrcnt; + /* * POSIX states that if bs is set and no other conversions * than noerror, notrunc or sync are specified, the block @@ -478,6 +480,7 @@ dd_in(void) swapbytes(in.dbp, (size_t)n); } + /* Advance to the next block. */ in.dbp += in.dbrcnt; (*cfunc)(); if (need_summary) Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Sep 30 21:56:42 2019 (r352922) +++ head/bin/dd/dd.h Mon Sep 30 22:00:48 2019 (r352923) @@ -104,6 +104,7 @@ typedef struct { #define C_FSYNC 0x0000000080000000ULL #define C_FDATASYNC 0x0000000100000000ULL #define C_OFSYNC 0x0000000200000000ULL +#define C_IFULLBLOCK 0x0000000400000000ULL #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) From owner-svn-src-all@freebsd.org Tue Oct 1 03:35:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0529913EEAB; Tue, 1 Oct 2019 03:35:55 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46j4fy6Nl6z3Mvv; Tue, 1 Oct 2019 03:35:54 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFBDFD5AE; Tue, 1 Oct 2019 03:35:54 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x913ZsJE035985; Tue, 1 Oct 2019 03:35:54 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x913Zs4c035984; Tue, 1 Oct 2019 03:35:54 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201910010335.x913Zs4c035984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 1 Oct 2019 03:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352924 - stable/12/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-12 X-SVN-Commit-Author: sef X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 352924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 03:35:55 -0000 Author: sef Date: Tue Oct 1 03:35:54 2019 New Revision: 352924 URL: https://svnweb.freebsd.org/changeset/base/352924 Log: MFC r352580: Fix a regression introduced in r344601 for zfs send Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Sep 30 22:00:48 2019 (r352923) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Oct 1 03:35:54 2019 (r352924) @@ -1289,13 +1289,11 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); - if (sdd->progress && sdd->dryrun) { + if (sdd->verbose || sdd->progress) { (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, flags, &size); sdd->size += size; - } - if (sdd->verbose) { send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, size, sdd->parsable); @@ -1663,7 +1661,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla fromname = name; } - if (flags->progress) { + if (flags->progress || flags->verbose) { error = lzc_send_space(zhp->zfs_name, fromname, lzc_flags, &size); if (error == 0) @@ -1933,7 +1931,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->progress || sdd.snapholds != NULL) { + if (flags->progress || flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data, From owner-svn-src-all@freebsd.org Tue Oct 1 08:21:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E215B130065; Tue, 1 Oct 2019 08:21:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jC0j5g4vz4ZQv; Tue, 1 Oct 2019 08:21:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A696F1895F; Tue, 1 Oct 2019 08:21:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x918LffI005984; Tue, 1 Oct 2019 08:21:41 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x918LfOg005983; Tue, 1 Oct 2019 08:21:41 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201910010821.x918LfOg005983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 1 Oct 2019 08:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352925 - head/sys/dev/xen/control X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/control X-SVN-Commit-Revision: 352925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 08:21:41 -0000 Author: royger Date: Tue Oct 1 08:21:41 2019 New Revision: 352925 URL: https://svnweb.freebsd.org/changeset/base/352925 Log: xen/ctrl: acknowledge all control requests Currently only suspend requests are acknowledged by writing an empty string back to the xenstore control node, but poweroff or reboot requests are not acknowledged and FreeBSD simply proceeds to perform the desired action. Fix this by acknowledging all requests, and remove the suspend specific ack done in the handler. Sponsored by: Citrix Systems R&D MFC after: 3 days Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Tue Oct 1 03:35:54 2019 (r352924) +++ head/sys/dev/xen/control/control.c Tue Oct 1 08:21:41 2019 (r352925) @@ -221,12 +221,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE * drivers need this. */ @@ -368,6 +362,11 @@ xctrl_on_watch_event(struct xs_watch *watch, const cha &result_len, (void **)&result); if (error != 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error = xs_write(XST_NIL, "control", "shutdown", ""); + if (error != 0) + printf("unable to ack shutdown request, proceeding anyway\n"); reason = xctrl_shutdown_reasons; last_reason = reason + nitems(xctrl_shutdown_reasons); From owner-svn-src-all@freebsd.org Tue Oct 1 13:36:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D1ED1369B0; Tue, 1 Oct 2019 13:36:02 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jKzP70SRz3N2N; Tue, 1 Oct 2019 13:36:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF7CB1C1D6; Tue, 1 Oct 2019 13:36:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91Da13p091825; Tue, 1 Oct 2019 13:36:01 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91Da1ao091824; Tue, 1 Oct 2019 13:36:01 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201910011336.x91Da1ao091824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 1 Oct 2019 13:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352926 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: rstone X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 13:36:02 -0000 Author: rstone Date: Tue Oct 1 13:36:01 2019 New Revision: 352926 URL: https://svnweb.freebsd.org/changeset/base/352926 Log: Clean up duplicate entries in sys/conf/files Reviewed by: imp Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 1 08:21:41 2019 (r352925) +++ head/sys/conf/files Tue Oct 1 13:36:01 2019 (r352926) @@ -679,7 +679,7 @@ crypto/blowfish/bf_ecb.c optional ipsec | ipsec_suppor crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support -crypto/chacha20/chacha.c optional crypto | ipsec | ipsec_support +crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb @@ -1777,7 +1777,6 @@ dev/iicbus/ds1307.c optional ds1307 dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds1374 dev/iicbus/ds1672.c optional ds1672 dev/iicbus/ds3231.c optional ds3231 -dev/iicbus/rtc8583.c optional rtc8583 dev/iicbus/syr827.c optional syr827 ext_resources fdt dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic @@ -3173,11 +3172,9 @@ dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc -dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 -dev/uart/uart_dev_sab82532.c optional uart scc +dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 | uart scc dev/uart/uart_dev_snps.c optional uart uart_snps fdt -dev/uart/uart_dev_z8530.c optional uart uart_z8530 -dev/uart/uart_dev_z8530.c optional uart scc +dev/uart/uart_dev_z8530.c optional uart uart_z8530 | uart scc dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.c optional uart @@ -3951,7 +3948,6 @@ kgssapi/gsstest.c optional kgssapi_debug # the file should be moved to conf/files. from here. # libkern/arc4random.c standard -crypto/chacha20/chacha.c standard libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard From owner-svn-src-all@freebsd.org Tue Oct 1 14:55:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D7961384AD; Tue, 1 Oct 2019 14:55:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jMkt1qb0z3xck; Tue, 1 Oct 2019 14:55:18 +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 1EB6C1D01F; Tue, 1 Oct 2019 14:55: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 x91EtHbB040899; Tue, 1 Oct 2019 14:55:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91EtHUg040894; Tue, 1 Oct 2019 14:55:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910011455.x91EtHUg040894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 1 Oct 2019 14:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352927 - in head: release/picobsd/tinyware/simple_httpd share/mk tools/build/options usr.sbin usr.sbin/httpd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: release/picobsd/tinyware/simple_httpd share/mk tools/build/options usr.sbin usr.sbin/httpd X-SVN-Commit-Revision: 352927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 14:55:18 -0000 Author: kevans Date: Tue Oct 1 14:55:16 2019 New Revision: 352927 URL: https://svnweb.freebsd.org/changeset/base/352927 Log: Move simple_httpd out of picobsd, add HTTPD option (default OFF) picobsd/tinyware has had this compact HTTPD server for a long time, and some people do use it. Move it out into usr.sbin well in advance of any action being taken on picobsd. This has been gated behind an HTTPD option defaulted to *off*, primarily for two reasons: 1.) This code likely needs a good audit, as it's been living off in picobsd land for a long time, and 2.) We don't currently ship an httpd and this may not be a welcome surprise. Reviewed by: eugen Differential Revision: https://reviews.freebsd.org/D21724 Added: head/tools/build/options/WITHOUT_HTTPD (contents, props changed) head/tools/build/options/WITH_HTTPD (contents, props changed) head/usr.sbin/httpd/ - copied from r352926, head/release/picobsd/tinyware/simple_httpd/ Deleted: head/release/picobsd/tinyware/simple_httpd/ Modified: head/share/mk/src.opts.mk head/usr.sbin/Makefile head/usr.sbin/httpd/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Oct 1 13:36:01 2019 (r352926) +++ head/share/mk/src.opts.mk Tue Oct 1 14:55:16 2019 (r352927) @@ -198,6 +198,7 @@ __DEFAULT_NO_OPTIONS = \ EXPERIMENTAL \ GNU_GREP_COMPAT \ HESIOD \ + HTTPD \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ Added: head/tools/build/options/WITHOUT_HTTPD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_HTTPD Tue Oct 1 14:55:16 2019 (r352927) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to neither build nor install httpd Added: head/tools/build/options/WITH_HTTPD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_HTTPD Tue Oct 1 14:55:16 2019 (r352927) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build and install httpd Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Oct 1 13:36:01 2019 (r352926) +++ head/usr.sbin/Makefile Tue Oct 1 14:55:16 2019 (r352927) @@ -138,6 +138,7 @@ SUBDIR.${MK_FMTREE}+= fmtree SUBDIR.${MK_FREEBSD_UPDATE}+= freebsd-update SUBDIR.${MK_GSSAPI}+= gssd SUBDIR.${MK_GPIO}+= gpioctl +SUBDIR.${MK_HTTPD}+= httpd SUBDIR.${MK_INET6}+= ip6addrctl SUBDIR.${MK_INET6}+= mld6query SUBDIR.${MK_INET6}+= ndp Modified: head/usr.sbin/httpd/Makefile ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/Makefile Tue Oct 1 13:36:01 2019 (r352926) +++ head/usr.sbin/httpd/Makefile Tue Oct 1 14:55:16 2019 (r352927) @@ -1,7 +1,7 @@ # $FreeBSD$ # -PROG=simple_httpd -SRCS= simple_httpd.c +PROG= httpd +SRCS= simple_httpd.c MAN= WARNS?=6 From owner-svn-src-all@freebsd.org Tue Oct 1 14:56:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6314813852E; Tue, 1 Oct 2019 14:56:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jMmJ20Fsz3xmc; Tue, 1 Oct 2019 14:56:32 +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 27B6C1D025; Tue, 1 Oct 2019 14:56: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 x91EuW4l040995; Tue, 1 Oct 2019 14:56:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91EuWeC040994; Tue, 1 Oct 2019 14:56:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910011456.x91EuWeC040994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 1 Oct 2019 14:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352928 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 352928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 14:56:32 -0000 Author: kevans Date: Tue Oct 1 14:56:31 2019 New Revision: 352928 URL: https://svnweb.freebsd.org/changeset/base/352928 Log: Regen src.conf(5) after r352927 (HTTPD option added) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Oct 1 14:55:16 2019 (r352927) +++ head/share/man/man5/src.conf.5 Tue Oct 1 14:56:31 2019 (r352928) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 17, 2019 +.Dd October 1, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -868,6 +868,8 @@ and related utilities. Set to build Hesiod support. .It Va WITHOUT_HTML Set to not build HTML docs. +.It Va WITH_HTTPD +Set to build and install httpd .It Va WITHOUT_HYPERV Set to not build or install HyperV utilities. .Pp From owner-svn-src-all@freebsd.org Tue Oct 1 15:10:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1C18138847; Tue, 1 Oct 2019 15:10:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jN4W5k9bz3yKp; Tue, 1 Oct 2019 15:10:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A49C41D1E9; Tue, 1 Oct 2019 15:10:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91FAZEh046849; Tue, 1 Oct 2019 15:10:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91FAZxT046847; Tue, 1 Oct 2019 15:10:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910011510.x91FAZxT046847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 1 Oct 2019 15:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352929 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 15:10:35 -0000 Author: kevans Date: Tue Oct 1 15:10:35 2019 New Revision: 352929 URL: https://svnweb.freebsd.org/changeset/base/352929 Log: Add a top-level makeman target Abstracting away the details of how src.conf(5) is generated is arguably a good thing; do so with a top-level makeman target. Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Tue Oct 1 14:56:31 2019 (r352928) +++ head/Makefile Tue Oct 1 15:10:35 2019 (r352929) @@ -34,6 +34,7 @@ # targets - Print a list of supported TARGET/TARGET_ARCH pairs # for world and kernel targets. # toolchains - Build a toolchain for all world and kernel targets. +# makeman - Regenerate src.conf(5) # sysent - (Re)build syscall entries from syscalls.master. # xdev - xdev-build + xdev-install for the architecture # specified with TARGET and TARGET_ARCH. @@ -132,7 +133,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries maninstall \ obj objlink showconfig tags toolchain update \ - sysent \ + makeman sysent \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _build-metadata _cross-tools _includes _libraries \ build32 distribute32 install32 buildsoft distributesoft installsoft \ Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 1 14:56:31 2019 (r352928) +++ head/Makefile.inc1 Tue Oct 1 15:10:35 2019 (r352929) @@ -1465,6 +1465,10 @@ packageworld: .PHONY . endif .endfor +makeman: .PHONY + ${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \ + ${.CURDIR}/share/man/man5/src.conf.5 + _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 _sysent_dirs+= sys/compat/cloudabi32 \ From owner-svn-src-all@freebsd.org Tue Oct 1 15:33:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4DED138E83; Tue, 1 Oct 2019 15:33:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jNbH4pcDz40Tm; Tue, 1 Oct 2019 15:33:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 885651D753; Tue, 1 Oct 2019 15:33:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91FXl2H064106; Tue, 1 Oct 2019 15:33:47 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91FXluG064105; Tue, 1 Oct 2019 15:33:47 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201910011533.x91FXluG064105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 1 Oct 2019 15:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352930 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 352930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 15:33:47 -0000 Author: alc Date: Tue Oct 1 15:33:47 2019 New Revision: 352930 URL: https://svnweb.freebsd.org/changeset/base/352930 Log: In short, pmap_enter_quick_locked("user space", ..., VM_PROT_READ) doesn't work. More precisely, it doesn't set ATTR_AP(ATTR_AP_USER) in the page table entry, so any attempt to read from the mapped page by user space generates a page fault. This problem has gone unnoticed because the page fault handler, vm_fault(), will ultimately call pmap_enter(), which replaces the non-working page table entry with one that has ATTR_AP(ATTR_AP_USER) set. This change reduces the number of page faults during a "buildworld" by about 19.4%. Reviewed by: andrew, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21841 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Oct 1 15:10:35 2019 (r352929) +++ head/sys/arm64/arm64/pmap.c Tue Oct 1 15:33:47 2019 (r352930) @@ -3752,8 +3752,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v ATTR_AP(ATTR_AP_RO) | L3_PAGE; if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) l3_val |= ATTR_XN; - else if (va < VM_MAXUSER_ADDRESS) - l3_val |= ATTR_PXN; + if (va < VM_MAXUSER_ADDRESS) + l3_val |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; /* * Now validate mapping with RO protection From owner-svn-src-all@freebsd.org Tue Oct 1 16:23:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35628139DA4; Tue, 1 Oct 2019 16:23:14 +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 46jPhK004Dz42c5; Tue, 1 Oct 2019 16:23:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 069B83C0199; Tue, 1 Oct 2019 16:23:06 +0000 (UTC) Date: Tue, 1 Oct 2019 16:23:05 +0000 From: Brooks Davis To: Konstantin Belousov Cc: Warner Losh , Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352795 - head/lib/libc/sys Message-ID: <20191001162305.GM93439@spindle.one-eyed-alien.net> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wTWi5aaYRw9ix9vO" Content-Disposition: inline In-Reply-To: <20190928072548.GN44691@kib.kiev.ua> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46jPhK004Dz42c5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.49 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.59)[ip: (-9.38), ipnet: 199.48.128.0/22(-4.67), asn: 36236(-3.86), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 16:23:14 -0000 --wTWi5aaYRw9ix9vO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 28, 2019 at 10:25:48AM +0300, Konstantin Belousov wrote: > On Fri, Sep 27, 2019 at 03:19:59PM -0600, Warner Losh wrote: > > On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > >=20 > > > On 9/27/19, Konstantin Belousov wrote: > > > > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > > > >> On 9/27/19, Warner Losh wrote: > > > >> > Document varadic args as int, since you can't have short varad= ic > > > args > > > >> > (they are > > > >> > promoted to ints). > > > >> > > > > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > > > >> > - `openat` takes variadic args > > > >> > - variadic args cannot be 16-bit, and indeed the code uses int > > > >> > - the manpage currently kinda implies the argument is 16-bit by > > > >> > saying > > > >> > `mode_t` > > > >> > > > > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs > > > >> to be changed? > > > > > > > > Yes, users must pass mode_t, and the man page is written for users. > > > > Implementation needs to be aware of the implicit promotion and hand= le > > > > it accordingly. > > > > > > > > In theory, mode_t might be wider than int. > > > > > > > > > > So I think the change should be reverted. Whatever workaround is being > > > in place in rust should remain for the current codebase. > > > > >=20 > > Rust needs to understand that it's not C. It's mistake was assuming it = was > > just like C and this is a case where the languages differ because C is = so > > quirky. > >=20 > >=20 > > > If anyone is to fixed the problem they should bump mode_t to uint32_t, > > > to match Linux. This is ABI breakage, I don't know how that's handled. > > > > >=20 > > That's not going to happen. And there's no need. It would cause more > > heartache than it's worth. > >=20 > >=20 > > > I have no interest in handling any of this, but the change committed > > > is definitely wrong. > > > > >=20 > > I tend to agree, but the manual was/is incomplete. The arg *IS* promote= d to > > an int, per normal C rules, so that part is right and there's no > > type-checking against truncation or the wrong type being used as would = be > > the case if it weren't varadic (so don't pass a long here). > >=20 > > However, type purity aside, that's not how things are implemented. Open= is > > expecting an int (as is openat): > >=20 > > int > > open(const char *path, int flags, ...) > > { > > va_list ap; > > int mode; > >=20 > > if ((flags & O_CREAT) !=3D 0) { > > va_start(ap, flags); > > mode =3D va_arg(ap, int); > > va_end(ap); > > } else { > > mode =3D 0; > > } > > return (((int (*)(int, const char *, int, ...)) > > __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)= ); > > } > >=20 > > so the change, from that perspective, actually documents the interface = (so > > isn't definitely wrong, and my guarded 'tend to agree'). So if you did > > change the type of mode_t, the above code might be wrong afterwards (he= nce > > my can of worms comment). And then we're passing it again through a var= adic > > function pointer... > >=20 > > So while POSIX says one thing, we implement something else. Should we > > document POSIX or what we implement? > I do not see how did you come to this conclusion. >=20 > > Or do we fix our implementation to > > match the docs? For all programs that don't pass in a 'long' or a point= er, > > the difference is zero, however. > ... on all supported architectures. On 32bit it actually does not matter= even > for long or pointers. But this is irrelevant, because correct programs > must only pass mode_t as the third arg, and then our libc does the right > thing on all currently supported platforms. More, I do not expect that > this fragment would need any revisions for future architectures. >=20 > >=20 > > To be honest, though, quibbling over how it should be implemented aside= , I > > think we should actually do the following: > >=20 > > diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 > > index a771461e2e49..aa912b797f74 100644 > > --- a/lib/libc/sys/open.2 > > +++ b/lib/libc/sys/open.2 > > @@ -61,7 +61,7 @@ In this case > > and > > .Fn openat > > require an additional argument > > -.Fa "int mode" , > > +.Fa "mode_t mode" , > > and the file is created with mode > > .Fa mode > > as described in > > @@ -615,3 +615,8 @@ permits searches. > > The present implementation of the > > .Fa openat > > checks the current permissions of directory instead. > > +.Pp > > +The > > +.Fa mode > > +argument is varadic and may result in different calling conventions > > +than might otherwise be expected. > I do not see how this could be useful for a user trying to call open(2). > I think it would be much easier to understand and use if you simply menti= on > that 'on all supported arches, mode_t is promoted to int by C rules for > implicit conversions of arguments for variadic functions'. And perhaps > put it somewhere else, not in the BUGS section. I think this would be a good solution. Note that the actual ABI constraint on variadic syscalls in FreeBSD is that they have exactly the same calling convention as if the argument is explicitly declared because we have on infrastructure to handle them any other way. Specifically, calling a function of type: int open(const char *path, int flags, ...); with a mode_t as a variadic argument must be identical to calling a function of type: int open(const char *path, int flags, mode_t mode); This isn't true with CHERI and as a result I've moved the variadic argument handling (except for syscall() and __syscall()) into libc. -- Brooks --wTWi5aaYRw9ix9vO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdk31pAAoJEKzQXbSebgfArsAH/A3U2SdkTPQ8c3U5S96GTGZr gu5WTaBA30L96cdc42c5HzAcUBNPb2iqFa4uo/7VVfQTr81pYg6igJKvor4Db5yw BcRgruFreBl9sL559J2W0UPsu3G5UvuX7aZajMysx295LkEIf1nMg1n2wYdlL2Kf 83ZiGG3JlsYKXoLKhxiVHy0NvcUBrGC0x8s4L3diTrr0RBgKqoC3OqITXypuG9BD /E2wKByVkhDoRB71Cb0RKuib8SGH/464fM7SPX/0c1Ydc7PBp7UByI2w+yATREH8 AznNGbdpnefxtZJbEdmxdvayLWH9Lv/Shvp6yXznf+SucehNKqM891ty7/49uY0= =PX8t -----END PGP SIGNATURE----- --wTWi5aaYRw9ix9vO-- From owner-svn-src-all@freebsd.org Tue Oct 1 16:33:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A01713A21E; Tue, 1 Oct 2019 16:33:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jPw9198dz439Z; Tue, 1 Oct 2019 16:33:28 +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 x91GXKSV026953 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 1 Oct 2019 19:33:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x91GXKSV026953 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x91GXKFO026952; Tue, 1 Oct 2019 19:33:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 1 Oct 2019 19:33:20 +0300 From: Konstantin Belousov To: Brooks Davis Cc: Warner Losh , Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352795 - head/lib/libc/sys Message-ID: <20191001163320.GX44691@kib.kiev.ua> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> <20191001162305.GM93439@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001162305.GM93439@spindle.one-eyed-alien.net> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46jPw9198dz439Z X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(0.00)[ip: (-2.75), ipnet: 2001:470::/32(-4.52), asn: 6939(-3.33), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 16:33:30 -0000 On Tue, Oct 01, 2019 at 04:23:05PM +0000, Brooks Davis wrote: > On Sat, Sep 28, 2019 at 10:25:48AM +0300, Konstantin Belousov wrote: > > On Fri, Sep 27, 2019 at 03:19:59PM -0600, Warner Losh wrote: > > > On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > > > > > > > On 9/27/19, Konstantin Belousov wrote: > > > > > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > > > > >> On 9/27/19, Warner Losh wrote: > > > > >> > Document varadic args as int, since you can't have short varadic > > > > args > > > > >> > (they are > > > > >> > promoted to ints). > > > > >> > > > > > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > > > > >> > - `openat` takes variadic args > > > > >> > - variadic args cannot be 16-bit, and indeed the code uses int > > > > >> > - the manpage currently kinda implies the argument is 16-bit by > > > > >> > saying > > > > >> > `mode_t` > > > > >> > > > > > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs > > > > >> to be changed? > > > > > > > > > > Yes, users must pass mode_t, and the man page is written for users. > > > > > Implementation needs to be aware of the implicit promotion and handle > > > > > it accordingly. > > > > > > > > > > In theory, mode_t might be wider than int. > > > > > > > > > > > > > So I think the change should be reverted. Whatever workaround is being > > > > in place in rust should remain for the current codebase. > > > > > > > > > > Rust needs to understand that it's not C. It's mistake was assuming it was > > > just like C and this is a case where the languages differ because C is so > > > quirky. > > > > > > > > > > If anyone is to fixed the problem they should bump mode_t to uint32_t, > > > > to match Linux. This is ABI breakage, I don't know how that's handled. > > > > > > > > > > That's not going to happen. And there's no need. It would cause more > > > heartache than it's worth. > > > > > > > > > > I have no interest in handling any of this, but the change committed > > > > is definitely wrong. > > > > > > > > > > I tend to agree, but the manual was/is incomplete. The arg *IS* promoted to > > > an int, per normal C rules, so that part is right and there's no > > > type-checking against truncation or the wrong type being used as would be > > > the case if it weren't varadic (so don't pass a long here). > > > > > > However, type purity aside, that's not how things are implemented. Open is > > > expecting an int (as is openat): > > > > > > int > > > open(const char *path, int flags, ...) > > > { > > > va_list ap; > > > int mode; > > > > > > if ((flags & O_CREAT) != 0) { > > > va_start(ap, flags); > > > mode = va_arg(ap, int); > > > va_end(ap); > > > } else { > > > mode = 0; > > > } > > > return (((int (*)(int, const char *, int, ...)) > > > __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)); > > > } > > > > > > so the change, from that perspective, actually documents the interface (so > > > isn't definitely wrong, and my guarded 'tend to agree'). So if you did > > > change the type of mode_t, the above code might be wrong afterwards (hence > > > my can of worms comment). And then we're passing it again through a varadic > > > function pointer... > > > > > > So while POSIX says one thing, we implement something else. Should we > > > document POSIX or what we implement? > > I do not see how did you come to this conclusion. > > > > > Or do we fix our implementation to > > > match the docs? For all programs that don't pass in a 'long' or a pointer, > > > the difference is zero, however. > > ... on all supported architectures. On 32bit it actually does not matter even > > for long or pointers. But this is irrelevant, because correct programs > > must only pass mode_t as the third arg, and then our libc does the right > > thing on all currently supported platforms. More, I do not expect that > > this fragment would need any revisions for future architectures. > > > > > > > > To be honest, though, quibbling over how it should be implemented aside, I > > > think we should actually do the following: > > > > > > diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 > > > index a771461e2e49..aa912b797f74 100644 > > > --- a/lib/libc/sys/open.2 > > > +++ b/lib/libc/sys/open.2 > > > @@ -61,7 +61,7 @@ In this case > > > and > > > .Fn openat > > > require an additional argument > > > -.Fa "int mode" , > > > +.Fa "mode_t mode" , > > > and the file is created with mode > > > .Fa mode > > > as described in > > > @@ -615,3 +615,8 @@ permits searches. > > > The present implementation of the > > > .Fa openat > > > checks the current permissions of directory instead. > > > +.Pp > > > +The > > > +.Fa mode > > > +argument is varadic and may result in different calling conventions > > > +than might otherwise be expected. > > I do not see how this could be useful for a user trying to call open(2). > > I think it would be much easier to understand and use if you simply mention > > that 'on all supported arches, mode_t is promoted to int by C rules for > > implicit conversions of arguments for variadic functions'. And perhaps > > put it somewhere else, not in the BUGS section. > > I think this would be a good solution. > > > Note that the actual ABI constraint on variadic syscalls in FreeBSD is > that they have exactly the same calling convention as if the argument is > explicitly declared because we have on infrastructure to handle them any > other way. Specifically, calling a function of type: > > int open(const char *path, int flags, ...); > > with a mode_t as a variadic argument must be identical to calling a > function of type: > > int open(const char *path, int flags, mode_t mode); It is not quite true, surprisingly, on amd64. At least the ABI requires the caller to put the number of XMM registers used for param passing into %eax for variadic functions. I think both gcc and clang can live without this hint in modern times. > > This isn't true with CHERI and as a result I've moved the variadic > argument handling (except for syscall() and __syscall()) into libc. > > -- Brooks From owner-svn-src-all@freebsd.org Tue Oct 1 17:05:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E337113B1BF; Tue, 1 Oct 2019 17:05:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jQcx5kbzz45wN; Tue, 1 Oct 2019 17:05:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A96811E7AC; Tue, 1 Oct 2019 17:05:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91H5L8e018187; Tue, 1 Oct 2019 17:05:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91H5LXB018186; Tue, 1 Oct 2019 17:05:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910011705.x91H5LXB018186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 1 Oct 2019 17:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352931 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 17:05:22 -0000 Author: emaste Date: Tue Oct 1 17:05:21 2019 New Revision: 352931 URL: https://svnweb.freebsd.org/changeset/base/352931 Log: sysalls.master: remove superfluous ellipsis in comment A single period is sufficient in this comment, and making this change lets us find references to varargs syscalls by searching for ... Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Oct 1 15:33:47 2019 (r352930) +++ head/sys/kern/syscalls.master Tue Oct 1 17:05:21 2019 (r352931) @@ -948,7 +948,7 @@ ; Syscalls 151-180 inclusive are reserved for vendor-specific ; system calls. (This includes various calls added for compatibity ; with other Unix variants.) -; Some of these calls are now supported by BSD... +; Some of these calls are now supported by BSD. 151 AUE_NULL UNIMPL sem_lock (BSD/OS 2.x) 152 AUE_NULL UNIMPL sem_wakeup (BSD/OS 2.x) 153 AUE_NULL UNIMPL asyncdaemon (BSD/OS 2.x) From owner-svn-src-all@freebsd.org Tue Oct 1 17:08:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1925213B345; Tue, 1 Oct 2019 17:08:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jQhn6yNdz46fg; Tue, 1 Oct 2019 17:08:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id c6so49739154ioo.13; Tue, 01 Oct 2019 10:08:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zKWLm6PSpZI+0V5PW7QOEo2czlK5EcJxpT1+9SaLhpI=; b=CYtF9kvUD6Z4jrjlwHqPxcYZCc5iBHfp3ouuRHhx2CSeaktAuLt389LKs+/BDX6THS C7iuZLWDo8wSWPVOPNo0e9yznSMDKWhpQxKhPgaxOEihUeAoo39GLydc41V6k1yorDV1 eUZoMnNlpnAcNiroFKN6POngDQb4WW78W/D8IBMBsB+50jxjG+kTVskYqYBnK110dh50 qXGCyXQ9MlOfGvE+cNX/16cnehQGr8UFS3ORCPyEm3dclUspIRAYW1+nYo4I2vHvn6Vt wBHiwwmTuS2BbO6PkUwqc3d2dD3utWeCeRkVOEcdtDXlHin4H8Q9OUvkRYn50PLEgZC9 DVIg== X-Gm-Message-State: APjAAAXCwmtAocwgy7n1yDKCCnUTjm7DHGZOrUPfFAQWPNNM0QOw+YdT hDij+lT+gOfQOyz7DGmDp8Yl2egiYDd6iZVNUbowPw== X-Google-Smtp-Source: APXvYqwN98VDd7mJaywqIqkSUFu3O7yG9XHhC26kmjE1m8zfUPcHdWBqmxSC++vFGHGvt8QO5AUEwGFyhpQKw5CrZUo= X-Received: by 2002:a92:d2c6:: with SMTP id w6mr25515234ilg.18.1569949720371; Tue, 01 Oct 2019 10:08:40 -0700 (PDT) MIME-Version: 1.0 References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> <20191001162305.GM93439@spindle.one-eyed-alien.net> In-Reply-To: <20191001162305.GM93439@spindle.one-eyed-alien.net> From: Ed Maste Date: Tue, 1 Oct 2019 13:08:27 -0400 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46jQhn6yNdz46fg X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 17:08:42 -0000 On Tue, 1 Oct 2019 at 12:23, Brooks Davis wrote: > > This isn't true with CHERI and as a result I've moved the variadic > argument handling (except for syscall() and __syscall()) into libc. My grep found: open, openat, fcntl, semsys, msgsys, shmsys Is that the full list? From owner-svn-src-all@freebsd.org Tue Oct 1 18:05:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BDDC13C699; Tue, 1 Oct 2019 18:05:52 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jRym0rWwz49Fb; Tue, 1 Oct 2019 18:05:52 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F0C1F24E; Tue, 1 Oct 2019 18:05:52 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91I5pvn053871; Tue, 1 Oct 2019 18:05:51 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91I5pN2053870; Tue, 1 Oct 2019 18:05:51 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201910011805.x91I5pN2053870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 1 Oct 2019 18:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352932 - releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: releng X-SVN-Commit-Author: sef X-SVN-Commit-Paths: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 352932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 18:05:52 -0000 Author: sef Date: Tue Oct 1 18:05:51 2019 New Revision: 352932 URL: https://svnweb.freebsd.org/changeset/base/352932 Log: Fix a regression introduced in r344601, and work properly with the -v and -n options. PR: 240640 Reported by: Andriy Gapon Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D21709 Approved by: re Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Oct 1 17:05:21 2019 (r352931) +++ releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Oct 1 18:05:51 2019 (r352932) @@ -1289,13 +1289,11 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); - if (sdd->progress && sdd->dryrun) { + if (sdd->verbose || sdd->progress) { (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, flags, &size); sdd->size += size; - } - if (sdd->verbose) { send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, size, sdd->parsable); @@ -1663,7 +1661,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla fromname = name; } - if (flags->progress) { + if (flags->progress || flags->verbose) { error = lzc_send_space(zhp->zfs_name, fromname, lzc_flags, &size); if (error == 0) @@ -1933,7 +1931,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->progress || sdd.snapholds != NULL) { + if (flags->progress || flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data, From owner-svn-src-all@freebsd.org Tue Oct 1 18:13:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0903A13CA58; Tue, 1 Oct 2019 18:13:00 +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 46jS6z6SLpz4B1q; Tue, 1 Oct 2019 18:12:59 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E024B3C0199; Tue, 1 Oct 2019 18:12:58 +0000 (UTC) Date: Tue, 1 Oct 2019 18:12:58 +0000 From: Brooks Davis To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352795 - head/lib/libc/sys Message-ID: <20191001181258.GO93439@spindle.one-eyed-alien.net> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> <20191001162305.GM93439@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0z5c7mBtSy1wdr4F" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46jS6z6SLpz4B1q X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 18:13:00 -0000 --0z5c7mBtSy1wdr4F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 01, 2019 at 01:08:27PM -0400, Ed Maste wrote: > On Tue, 1 Oct 2019 at 12:23, Brooks Davis wrote: > > > > This isn't true with CHERI and as a result I've moved the variadic > > argument handling (except for syscall() and __syscall()) into libc. >=20 > My grep found: open, openat, fcntl, semsys, msgsys, shmsys > Is that the full list? Also ioctl. I didn't handle the *sys() ones since they are internal only. -- Brooks --0z5c7mBtSy1wdr4F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdk5cpAAoJEKzQXbSebgfAiGgIAJrHof+NupOgynjqeG40uqi3 3A0BP9Ab7iI3xLM9TnsNCIiEHhIU8pPH++TIoGhZhATxj50/Zm3vaEBWVL0lBcwH V5LxJVaU93SMcPo9yvP+onSVx8lJew+locd+387lOJgU4OLL0GTQ8ojKNFJziRk1 0qn8ARhKJR+5WMK6T9Nsx9XEyS2WgpRJEyIKvHZE9tzKnhHNvoXNME79YevzjTPX HRTuZ24hrc/VNo/RDK/uOku1L5OS/RfTD7z38FSHJDRN7RT8x7IMIGZ0n3s1NywM zaLuFCcYgRxInEDOLOHR0/J2wDL+/TAoYJ2xtmKJaHAV3JfeXaMjHnSU+fjQgJc= =iWl9 -----END PGP SIGNATURE----- --0z5c7mBtSy1wdr4F-- From owner-svn-src-all@freebsd.org Tue Oct 1 18:14:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8DCA13CB0F; Tue, 1 Oct 2019 18:14:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jS8t4xtyz4BFX; Tue, 1 Oct 2019 18:14:38 +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 8D1921F41C; Tue, 1 Oct 2019 18:14: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 x91IEcCK060047; Tue, 1 Oct 2019 18:14:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91IEcMB060045; Tue, 1 Oct 2019 18:14:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910011814.x91IEcMB060045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 1 Oct 2019 18:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352935 - in head/usr.sbin: . httpd simple_httpd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin: . httpd simple_httpd X-SVN-Commit-Revision: 352935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 18:14:38 -0000 Author: kevans Date: Tue Oct 1 18:14:37 2019 New Revision: 352935 URL: https://svnweb.freebsd.org/changeset/base/352935 Log: Move httpd to simple_httpd... This avoids PATH conflicts with a real httpd, as a user will likely almost always prefer the more fully-featured httpd. This also lines up with the historical name of the program. Added: head/usr.sbin/simple_httpd/ - copied from r352934, head/usr.sbin/httpd/ Deleted: head/usr.sbin/httpd/ Modified: head/usr.sbin/Makefile head/usr.sbin/simple_httpd/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Oct 1 18:13:45 2019 (r352934) +++ head/usr.sbin/Makefile Tue Oct 1 18:14:37 2019 (r352935) @@ -138,7 +138,7 @@ SUBDIR.${MK_FMTREE}+= fmtree SUBDIR.${MK_FREEBSD_UPDATE}+= freebsd-update SUBDIR.${MK_GSSAPI}+= gssd SUBDIR.${MK_GPIO}+= gpioctl -SUBDIR.${MK_HTTPD}+= httpd +SUBDIR.${MK_HTTPD}+= simple_httpd SUBDIR.${MK_INET6}+= ip6addrctl SUBDIR.${MK_INET6}+= mld6query SUBDIR.${MK_INET6}+= ndp Modified: head/usr.sbin/simple_httpd/Makefile ============================================================================== --- head/usr.sbin/httpd/Makefile Tue Oct 1 18:13:45 2019 (r352934) +++ head/usr.sbin/simple_httpd/Makefile Tue Oct 1 18:14:37 2019 (r352935) @@ -1,7 +1,6 @@ # $FreeBSD$ # -PROG= httpd -SRCS= simple_httpd.c +PROG= simple_httpd MAN= WARNS?=6 From owner-svn-src-all@freebsd.org Tue Oct 1 18:16:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 577CE13CBD3; Tue, 1 Oct 2019 18:16:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jSCF1d0Qz4BPV; Tue, 1 Oct 2019 18:16:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id z19so50579496ior.0; Tue, 01 Oct 2019 11:16:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O4vmmZiAcm9Yvuuj63PQtQmqL/GcsxeZIwdVvTMdoGQ=; b=d9VTUhLnhjwtjhp6T8szyqV4VUeoso1+6Q1nJFj5+DNAXb53nT16ZqxF82/15vJf5N xV7QHV0xKOIZocHOelLkSJQdtVxR+vfLAFWrdnc/TG9TOKPKLUTmkISB7JhGY8WfxG/5 A2jg+NmIKK7y5tHXOoF5GFfaCu3T+tw801hUYrOlx1M/9/SIv2j6efpHaupLhiEz6tPD mLYArQwFCNdKyuKXQDbAlC4Mtis5b0ma31wN31LgmI/7tt+cEsov9IElxX01XVIVn0qb 1iRfNEWEfd17buItEeV/RKrfYgvTrgo3dDGUPdpZJVY3NFz3JINNq7VWPtdKicczhuot 8hBw== X-Gm-Message-State: APjAAAWBqBX9A4lEAtJIvcAHE16UckfPzG+dcKWYEXAFBJaqdRlb2gcD ubOjPkmCCvEffr4kzDPl/u6DOnvXB3ypWpwmIQ+coA== X-Google-Smtp-Source: APXvYqx1421MrrfqDqceDRer7fmtZPvRTJ0fxSE3ol4FOqkdA5/9Wmf3rL5ymXFHxIiNwRedAuVLlLhritfMORE8D4o= X-Received: by 2002:a05:6602:2503:: with SMTP id i3mr7924969ioe.18.1569953799565; Tue, 01 Oct 2019 11:16:39 -0700 (PDT) MIME-Version: 1.0 References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> <20191001162305.GM93439@spindle.one-eyed-alien.net> <20191001181258.GO93439@spindle.one-eyed-alien.net> In-Reply-To: <20191001181258.GO93439@spindle.one-eyed-alien.net> From: Ed Maste Date: Tue, 1 Oct 2019 14:16:27 -0400 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46jSCF1d0Qz4BPV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 18:16:41 -0000 On Tue, 1 Oct 2019 at 14:13, Brooks Davis wrote: > > Also ioctl. I didn't handle the *sys() ones since they are internal only. Ah, yes - I didn't notice ioctl because syscalls.master lacked a XXX or ... comment. From owner-svn-src-all@freebsd.org Tue Oct 1 18:30:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E96F913CE79; Tue, 1 Oct 2019 18:30:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jSVk5s4Kz4C0B; Tue, 1 Oct 2019 18:30:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC5301F5F9; Tue, 1 Oct 2019 18:30:06 +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 x91IU6G1066380; Tue, 1 Oct 2019 18:30:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91IU6tk066379; Tue, 1 Oct 2019 18:30:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910011830.x91IU6tk066379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 18:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352936 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 352936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 18:30:07 -0000 Author: manu Date: Tue Oct 1 18:30:06 2019 New Revision: 352936 URL: https://svnweb.freebsd.org/changeset/base/352936 Log: arm64: rockchip: rk805: Switch to iicdev_{readfrom,writeto} This simpify the code a bit. Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Tue Oct 1 18:14:37 2019 (r352935) +++ head/sys/arm64/rockchip/rk805.c Tue Oct 1 18:30:06 2019 (r352936) @@ -227,24 +227,16 @@ static struct rk805_regdef rk808_regdefs[] = { static int rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { + int err; - return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); + err = iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT); + return (err); } static int rk805_write(device_t dev, uint8_t reg, uint8_t data) { - struct iic_msg msg; - uint8_t buf[2]; - - buf[0] = reg; - buf[1] = data; - msg.slave = iicbus_get_addr(dev); - msg.flags = IIC_M_WR; - msg.buf = buf; - msg.len = sizeof(buf); - - return (iicbus_transfer_excl(dev, &msg, 1, IIC_INTRWAIT)); + return (iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); } static int From owner-svn-src-all@freebsd.org Tue Oct 1 18:32:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9FEA13D04E; Tue, 1 Oct 2019 18:32:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jSYR5tv6z4CLL; Tue, 1 Oct 2019 18:32:27 +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 AD7181F7A4; Tue, 1 Oct 2019 18:32:27 +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 x91IWRFh072046; Tue, 1 Oct 2019 18:32:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91IWRrN072045; Tue, 1 Oct 2019 18:32:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910011832.x91IWRrN072045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 18:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352937 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 352937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 18:32:28 -0000 Author: manu Date: Tue Oct 1 18:32:27 2019 New Revision: 352937 URL: https://svnweb.freebsd.org/changeset/base/352937 Log: syr827: Switch to iicdev_{readfrom,writeto} Also use IIC_INTRWAIT as we need this to work with the rockchip i2c driver. Modified: head/sys/dev/iicbus/syr827.c Modified: head/sys/dev/iicbus/syr827.c ============================================================================== --- head/sys/dev/iicbus/syr827.c Tue Oct 1 18:30:06 2019 (r352936) +++ head/sys/dev/iicbus/syr827.c Tue Oct 1 18:32:27 2019 (r352937) @@ -90,42 +90,13 @@ struct syr827_softc { static int syr827_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { - struct syr827_softc *sc; - struct iic_msg msg[2]; - - sc = device_get_softc(dev); - - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 1; - msg[0].buf = ® - - msg[1].slave = sc->addr; - msg[1].flags = IIC_M_RD; - msg[1].len = size; - msg[1].buf = data; - - return (iicbus_transfer(dev, msg, 2)); + return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); } static int syr827_write(device_t dev, uint8_t reg, uint8_t val) { - struct syr827_softc *sc; - struct iic_msg msg; - uint8_t buffer[2]; - - sc = device_get_softc(dev); - - buffer[0] = reg; - buffer[1] = val; - - msg.slave = sc->addr; - msg.flags = IIC_M_WR; - msg.len = 2; - msg.buf = buffer; - - return (iicbus_transfer(dev, &msg, 1)); + return (iicdev_writeto(dev, reg, &val, 1, IIC_INTRWAIT)); } static int From owner-svn-src-all@freebsd.org Tue Oct 1 19:39:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4F3113EAEE; Tue, 1 Oct 2019 19:39: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jV2D62cnz4JGh; Tue, 1 Oct 2019 19:39: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 B1D10202AD; Tue, 1 Oct 2019 19:39: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 x91Jd0Qw010822; Tue, 1 Oct 2019 19:39:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91Jd0tK010821; Tue, 1 Oct 2019 19:39:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201910011939.x91Jd0tK010821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 1 Oct 2019 19:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352938 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 352938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 19:39:00 -0000 Author: ian Date: Tue Oct 1 19:39:00 2019 New Revision: 352938 URL: https://svnweb.freebsd.org/changeset/base/352938 Log: Add 8 and 16 bit versions of atomic_cmpset and atomic_fcmpset for arm. This adds 8 and 16 bit versions of the cmpset and fcmpset functions. Macros are used to generate all the flavors from the same set of instructions; the macro expansion handles the couple minor differences between each size variation (generating ldrexb/ldrexh/ldrex for 8/16/32, etc). In addition to handling new sizes, the instruction sequences used for cmpset and fcmpset are rewritten to be a bit shorter/faster, and the new sequence will not return false when *dst==*old but the store-exclusive fails because of concurrent writers. Instead, it just loops like ldrex/strex sequences normally do until it gets a non-conflicted store. The manpage allows LL/SC architectures to bogusly return false, but there's no reason to actually do so, at least on arm. Reviewed by: cognet Modified: head/sys/arm/include/atomic-v4.h head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Tue Oct 1 18:32:27 2019 (r352937) +++ head/sys/arm/include/atomic-v4.h Tue Oct 1 19:39:00 2019 (r352938) @@ -113,6 +113,43 @@ atomic_clear_64(volatile uint64_t *address, uint64_t c } static __inline int +atomic_fcmpset_8(volatile uint8_t *p, volatile uint8_t *cmpval, volatile uint8_t newval) +{ + int ret; + + __with_interrupts_disabled( + { + ret = *p; + if (*p == *cmpval) { + *p = newval; + ret = 1; + } else { + *cmpval = *p; + ret = 0; + } + }); + return (ret); +} +static __inline int +atomic_fcmpset_16(volatile uint16_t *p, volatile uint16_t *cmpval, volatile uint16_t newval) +{ + int ret; + + __with_interrupts_disabled( + { + ret = *p; + if (*p == *cmpval) { + *p = newval; + ret = 1; + } else { + *cmpval = *p; + ret = 0; + } + }); + return (ret); +} + +static __inline int atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval) { int ret; @@ -150,6 +187,40 @@ atomic_fcmpset_64(volatile u_int64_t *p, volatile u_in } static __inline int +atomic_cmpset_8(volatile uint8_t *p, volatile uint8_t cmpval, volatile uint8_t newval) +{ + int ret; + + __with_interrupts_disabled( + { + if (*p == cmpval) { + *p = newval; + ret = 1; + } else { + ret = 0; + } + }); + return (ret); +} + +static __inline int +atomic_cmpset_16(volatile uint16_t *p, volatile uint16_t cmpval, volatile uint16_t newval) +{ + int ret; + + __with_interrupts_disabled( + { + if (*p == cmpval) { + *p = newval; + ret = 1; + } else { + ret = 0; + } + }); + return (ret); +} + +static __inline int atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int ret; @@ -450,6 +521,10 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v) #define atomic_fcmpset_rel_32 atomic_fcmpset_32 #define atomic_fcmpset_acq_32 atomic_fcmpset_32 #ifdef _KERNEL +#define atomic_fcmpset_rel_8 atomic_fcmpset_8 +#define atomic_fcmpset_acq_8 atomic_fcmpset_8 +#define atomic_fcmpset_rel_16 atomic_fcmpset_16 +#define atomic_fcmpset_acq_16 atomic_fcmpset_16 #define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fcmpset_acq_64 atomic_fcmpset_64 #endif @@ -458,6 +533,10 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v) #define atomic_cmpset_rel_32 atomic_cmpset_32 #define atomic_cmpset_acq_32 atomic_cmpset_32 #ifdef _KERNEL +#define atomic_cmpset_rel_8 atomic_cmpset_8 +#define atomic_cmpset_acq_8 atomic_cmpset_8 +#define atomic_cmpset_rel_16 atomic_cmpset_16 +#define atomic_cmpset_acq_16 atomic_cmpset_16 #define atomic_cmpset_rel_64 atomic_cmpset_64 #define atomic_cmpset_acq_64 atomic_cmpset_64 #endif Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Tue Oct 1 18:32:27 2019 (r352937) +++ head/sys/arm/include/atomic-v6.h Tue Oct 1 19:39:00 2019 (r352938) @@ -190,224 +190,380 @@ ATOMIC_ACQ_REL(clear, 32) ATOMIC_ACQ_REL(clear, 64) ATOMIC_ACQ_REL_LONG(clear) +#define ATOMIC_FCMPSET_CODE(RET, TYPE, SUF) \ + { \ + TYPE tmp; \ + \ + __asm __volatile( \ + "1: ldrex" SUF " %[tmp], [%[ptr]] \n" \ + " ldr %[ret], [%[oldv]] \n" \ + " teq %[tmp], %[ret] \n" \ + " ittee ne \n" \ + " str" SUF "ne %[tmp], [%[oldv]] \n" \ + " movne %[ret], #0 \n" \ + " strex" SUF "eq %[ret], %[newv], [%[ptr]] \n" \ + " eorseq %[ret], #1 \n" \ + " beq 1b \n" \ + : [ret] "=&r" (RET), \ + [tmp] "=&r" (tmp) \ + : [ptr] "r" (_ptr), \ + [oldv] "r" (_old), \ + [newv] "r" (_new) \ + : "cc", "memory"); \ + } + +#define ATOMIC_FCMPSET_CODE64(RET) \ + { \ + uint64_t cmp, tmp; \ + \ + __asm __volatile( \ + "1: ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" \ + " ldrd %Q[cmp], %R[cmp], [%[oldv]] \n" \ + " teq %Q[tmp], %Q[cmp] \n" \ + " it eq \n" \ + " teqeq %R[tmp], %R[cmp] \n" \ + " ittee ne \n" \ + " movne %[ret], #0 \n" \ + " strdne %[cmp], [%[oldv]] \n" \ + " strexdeq %[ret], %Q[newv], %R[newv], [%[ptr]] \n" \ + " eorseq %[ret], #1 \n" \ + " beq 1b \n" \ + : [ret] "=&r" (RET), \ + [cmp] "=&r" (cmp), \ + [tmp] "=&r" (tmp) \ + : [ptr] "r" (_ptr), \ + [oldv] "r" (_old), \ + [newv] "r" (_new) \ + : "cc", "memory"); \ + } + static __inline int -atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +atomic_fcmpset_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) { - uint32_t tmp; - uint32_t _cmpval = *cmpval; int ret; - __asm __volatile( - " mov %0, #1 \n" - " ldrex %1, [%2] \n" - " cmp %1, %3 \n" - " it eq \n" - " strexeq %0, %4, [%2] \n" - : "=&r" (ret), "=&r" (tmp), "+r" (p), "+r" (_cmpval), "+r" (newval) - : : "cc", "memory"); - *cmpval = tmp; - return (!ret); + ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); + return (ret); } static __inline int -atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +atomic_fcmpset_acq_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) { - uint64_t tmp; - uint64_t _cmpval = *cmpval; int ret; - __asm __volatile( - "1: mov %[ret], #1 \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" - " teq %Q[tmp], %Q[_cmpval] \n" - " ite eq \n" - " teqeq %R[tmp], %R[_cmpval] \n" - " bne 2f \n" - " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n" - "2: \n" - : [ret] "=&r" (ret), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [_cmpval] "r" (_cmpval), - [newval] "r" (newval) - : "cc", "memory"); - *cmpval = tmp; - return (!ret); + ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); + dmb(); + return (ret); } static __inline int -atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval) +atomic_fcmpset_rel_8(volatile uint8_t *_ptr, uint8_t *_old, uint8_t _new) { + int ret; - return (atomic_fcmpset_32((volatile uint32_t *)p, - (uint32_t *)cmpval, newval)); + dmb(); + ATOMIC_FCMPSET_CODE(ret, uint8_t, "b"); + return (ret); } static __inline int -atomic_fcmpset_acq_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +atomic_fcmpset_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) { int ret; - ret = atomic_fcmpset_64(p, cmpval, newval); + ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); + return (ret); +} + +static __inline int +atomic_fcmpset_acq_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) +{ + int ret; + + ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); dmb(); return (ret); } static __inline int -atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval) +atomic_fcmpset_rel_16(volatile uint16_t *_ptr, uint16_t *_old, uint16_t _new) { int ret; - ret = atomic_fcmpset_long(p, cmpval, newval); dmb(); + ATOMIC_FCMPSET_CODE(ret, uint16_t, "h"); return (ret); } static __inline int -atomic_fcmpset_acq_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +atomic_fcmpset_32(volatile uint32_t *_ptr, uint32_t *_old, uint32_t _new) { + int ret; + ATOMIC_FCMPSET_CODE(ret, uint32_t, ""); + return (ret); +} + +static __inline int +atomic_fcmpset_acq_32(volatile uint32_t *_ptr, uint32_t *_old, uint32_t _new) +{ int ret; - ret = atomic_fcmpset_32(p, cmpval, newval); + ATOMIC_FCMPSET_CODE(ret, uint32_t, ""); dmb(); return (ret); } static __inline int -atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) +atomic_fcmpset_rel_32(volatile uint32_t *_ptr, uint32_t *_old, uint32_t _new) { + int ret; dmb(); - return (atomic_fcmpset_32(p, cmpval, newval)); + ATOMIC_FCMPSET_CODE(ret, uint32_t, ""); + return (ret); } static __inline int -atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) +atomic_fcmpset_long(volatile long *_ptr, long *_old, long _new) { + int ret; + ATOMIC_FCMPSET_CODE(ret, long, ""); + return (ret); +} + +static __inline int +atomic_fcmpset_acq_long(volatile long *_ptr, long *_old, long _new) +{ + int ret; + + ATOMIC_FCMPSET_CODE(ret, long, ""); dmb(); - return (atomic_fcmpset_64(p, cmpval, newval)); + return (ret); } static __inline int -atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval) +atomic_fcmpset_rel_long(volatile long *_ptr, long *_old, long _new) { + int ret; dmb(); - return (atomic_fcmpset_long(p, cmpval, newval)); + ATOMIC_FCMPSET_CODE(ret, long, ""); + return (ret); } static __inline int -atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +atomic_fcmpset_64(volatile uint64_t *_ptr, uint64_t *_old, uint64_t _new) { int ret; - __asm __volatile( - "1: ldrex %0, [%1] \n" - " cmp %0, %2 \n" - " itt ne \n" - " movne %0, #0 \n" - " bne 2f \n" - " strex %0, %3, [%1] \n" - " cmp %0, #0 \n" - " ite eq \n" - " moveq %0, #1 \n" - " bne 1b \n" - "2:" - : "=&r" (ret), "+r" (p), "+r" (cmpval), "+r" (newval) - : : "cc", "memory"); + ATOMIC_FCMPSET_CODE64(ret); return (ret); } static __inline int -atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +atomic_fcmpset_acq_64(volatile uint64_t *_ptr, uint64_t *_old, uint64_t _new) { - uint64_t tmp; - uint32_t ret; + int ret; - __asm __volatile( - "1: \n" - " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" - " teq %Q[tmp], %Q[cmpval] \n" - " itee eq \n" - " teqeq %R[tmp], %R[cmpval] \n" - " movne %[ret], #0 \n" - " bne 2f \n" - " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n" - " teq %[ret], #0 \n" - " it ne \n" - " bne 1b \n" - " mov %[ret], #1 \n" - "2: \n" - : [ret] "=&r" (ret), - [tmp] "=&r" (tmp) - : [ptr] "r" (p), - [cmpval] "r" (cmpval), - [newval] "r" (newval) - : "cc", "memory"); + ATOMIC_FCMPSET_CODE64(ret); + dmb(); return (ret); } static __inline int -atomic_cmpset_long(volatile u_long *p, u_long cmpval, u_long newval) +atomic_fcmpset_rel_64(volatile uint64_t *_ptr, uint64_t *_old, uint64_t _new) { + int ret; - return (atomic_cmpset_32((volatile uint32_t *)p, cmpval, newval)); + dmb(); + ATOMIC_FCMPSET_CODE64(ret); + return (ret); } +#define ATOMIC_CMPSET_CODE(RET, SUF) \ + { \ + __asm __volatile( \ + "1: ldrex" SUF " %[ret], [%[ptr]] \n" \ + " teq %[ret], %[oldv] \n" \ + " itee ne \n" \ + " movne %[ret], #0 \n" \ + " strex" SUF "eq %[ret], %[newv], [%[ptr]] \n" \ + " eorseq %[ret], #1 \n" \ + " beq 1b \n" \ + : [ret] "=&r" (RET) \ + : [ptr] "r" (_ptr), \ + [oldv] "r" (_old), \ + [newv] "r" (_new) \ + : "cc", "memory"); \ + } + +#define ATOMIC_CMPSET_CODE64(RET) \ + { \ + uint64_t tmp; \ + \ + __asm __volatile( \ + "1: ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" \ + " teq %Q[tmp], %Q[oldv] \n" \ + " it eq \n" \ + " teqeq %R[tmp], %R[oldv] \n" \ + " itee ne \n" \ + " movne %[ret], #0 \n" \ + " strexdeq %[ret], %Q[newv], %R[newv], [%[ptr]] \n" \ + " eorseq %[ret], #1 \n" \ + " beq 1b \n" \ + : [ret] "=&r" (RET), \ + [tmp] "=&r" (tmp) \ + : [ptr] "r" (_ptr), \ + [oldv] "r" (_old), \ + [newv] "r" (_new) \ + : "cc", "memory"); \ + } + static __inline int -atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +atomic_cmpset_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) { int ret; - ret = atomic_cmpset_32(p, cmpval, newval); + ATOMIC_CMPSET_CODE(ret, "b"); + return (ret); +} + +static __inline int +atomic_cmpset_acq_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) +{ + int ret; + + ATOMIC_CMPSET_CODE(ret, "b"); dmb(); return (ret); } static __inline int -atomic_cmpset_acq_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +atomic_cmpset_rel_8(volatile uint8_t *_ptr, uint8_t _old, uint8_t _new) { int ret; - ret = atomic_cmpset_64(p, cmpval, newval); dmb(); + ATOMIC_CMPSET_CODE(ret, "b"); return (ret); } static __inline int -atomic_cmpset_acq_long(volatile u_long *p, u_long cmpval, u_long newval) +atomic_cmpset_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) { int ret; - ret = atomic_cmpset_long(p, cmpval, newval); + ATOMIC_CMPSET_CODE(ret, "h"); + return (ret); +} + +static __inline int +atomic_cmpset_acq_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) +{ + int ret; + + ATOMIC_CMPSET_CODE(ret, "h"); dmb(); return (ret); } static __inline int -atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +atomic_cmpset_rel_16(volatile uint16_t *_ptr, uint16_t _old, uint16_t _new) { + int ret; dmb(); - return (atomic_cmpset_32(p, cmpval, newval)); + ATOMIC_CMPSET_CODE(ret, "h"); + return (ret); } static __inline int -atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +atomic_cmpset_32(volatile uint32_t *_ptr, uint32_t _old, uint32_t _new) { + int ret; + ATOMIC_CMPSET_CODE(ret, ""); + return (ret); +} + +static __inline int +atomic_cmpset_acq_32(volatile uint32_t *_ptr, uint32_t _old, uint32_t _new) +{ + int ret; + + ATOMIC_CMPSET_CODE(ret, ""); dmb(); - return (atomic_cmpset_64(p, cmpval, newval)); + return (ret); } static __inline int -atomic_cmpset_rel_long(volatile u_long *p, u_long cmpval, u_long newval) +atomic_cmpset_rel_32(volatile uint32_t *_ptr, uint32_t _old, uint32_t _new) { + int ret; dmb(); - return (atomic_cmpset_long(p, cmpval, newval)); + ATOMIC_CMPSET_CODE(ret, ""); + return (ret); +} + +static __inline int +atomic_cmpset_long(volatile long *_ptr, long _old, long _new) +{ + int ret; + + ATOMIC_CMPSET_CODE(ret, ""); + return (ret); +} + +static __inline int +atomic_cmpset_acq_long(volatile long *_ptr, long _old, long _new) +{ + int ret; + + ATOMIC_CMPSET_CODE(ret, ""); + dmb(); + return (ret); +} + +static __inline int +atomic_cmpset_rel_long(volatile long *_ptr, long _old, long _new) +{ + int ret; + + dmb(); + ATOMIC_CMPSET_CODE(ret, ""); + return (ret); +} + +static __inline int +atomic_cmpset_64(volatile uint64_t *_ptr, uint64_t _old, uint64_t _new) +{ + int ret; + + ATOMIC_CMPSET_CODE64(ret); + return (ret); +} + +static __inline int +atomic_cmpset_acq_64(volatile uint64_t *_ptr, uint64_t _old, uint64_t _new) +{ + int ret; + + ATOMIC_CMPSET_CODE64(ret); + dmb(); + return (ret); +} + +static __inline int +atomic_cmpset_rel_64(volatile uint64_t *_ptr, uint64_t _old, uint64_t _new) +{ + int ret; + + dmb(); + ATOMIC_CMPSET_CODE64(ret); + return (ret); } static __inline uint32_t From owner-svn-src-all@freebsd.org Tue Oct 1 19:49:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F21613ED7C; Tue, 1 Oct 2019 19:49:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jVGY6WwFz4JrK; Tue, 1 Oct 2019 19:49:41 +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 x91JnWRB073700 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 1 Oct 2019 22:49:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x91JnWRB073700 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x91JnWJM073699; Tue, 1 Oct 2019 22:49:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 1 Oct 2019 22:49:32 +0300 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352938 - head/sys/arm/include Message-ID: <20191001194932.GZ44691@kib.kiev.ua> References: <201910011939.x91Jd0tK010821@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201910011939.x91Jd0tK010821@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46jVGY6WwFz4JrK X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 19:49:42 -0000 On Tue, Oct 01, 2019 at 07:39:00PM +0000, Ian Lepore wrote: > Author: ian > Date: Tue Oct 1 19:39:00 2019 > New Revision: 352938 > URL: https://svnweb.freebsd.org/changeset/base/352938 > > Log: > Add 8 and 16 bit versions of atomic_cmpset and atomic_fcmpset for arm. > > This adds 8 and 16 bit versions of the cmpset and fcmpset functions. Macros > are used to generate all the flavors from the same set of instructions; the > macro expansion handles the couple minor differences between each size > variation (generating ldrexb/ldrexh/ldrex for 8/16/32, etc). > > In addition to handling new sizes, the instruction sequences used for cmpset > and fcmpset are rewritten to be a bit shorter/faster, and the new sequence > will not return false when *dst==*old but the store-exclusive fails because > of concurrent writers. Instead, it just loops like ldrex/strex sequences > normally do until it gets a non-conflicted store. The manpage allows LL/SC > architectures to bogusly return false, but there's no reason to actually do > so, at least on arm. The reason is to avoid nested loops. The outer control for retry was the initial design decision for fcmpset() comparing to cmpset(). casueword() also started following this approach after the fixes for ll/sc looping after the external control. From owner-svn-src-all@freebsd.org Tue Oct 1 19:53:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13E1013EF74 for ; Tue, 1 Oct 2019 19:53:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jVLZ30rFz4KDn for ; Tue, 1 Oct 2019 19:53:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1569959588; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=hbn3ppRSOfPrbq9kR+0/LjCDcpY3dZjg8F1/7Q0MyUkyNhEcWIDwkzqY04RGCKNnJzxhKMoJxms6e ibsXLXt3yD1d3DRis9/uW+U+CRTcoutPdflcoHhXqDHkGdpbvPBc8qs8/EJvXwoXjqPWZa4+uvr95F wiRi2mu/J4KN4ldfay2QaEA7zAEfgJ7r5PzJ/h+W/Apx1Eq+Tnz+gkuUFNI+jb1wxgxSM9xeV1snZN A0pzV1ot1xlgUU7lax661oY6cS/Nb4TodDWocJY1rW1uNahcB0sBu82Y05ERqiDmcPGSPwbdZx0cu8 79iihhGAsc5t4o+5WH49CP5L08dEPIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=QWdjeUDQxJ7SdJtwUpUQ7w1K+eU6EfDm0w9Gvq4jWoo=; b=ZVvvBr63qWJV3sMjrVZz33nqnlvpTyHYrbPDU09iF6A/rKQkNnTIcpYWuY7GaTdZvnj4H5REgzCCS BFs6/Ur2QzGYLeLkznH/Q9q9BqjXW+pH1VJ+q1+3p1bQoYpc1ySM+8PPSHVCafZ7czqx8KrOZ686C0 vKNkx+K9Izxy1Lvwpwe9lyIGDg5tL0/qd2NsOxO3bJKwsQXWCJGeWi6vNv4IjoAqhRsweYRFVSWt90 TwCNs3EfH3wWT5mMHrJO7uHJv91wjhKFoE+ouf6/OiS8X/VNVO3DVt3lIdwkJ0uUznAV0Fo9vAWVTe mhO5GKvPWng2pzoJC2OZfz7/OAYU+nQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=QWdjeUDQxJ7SdJtwUpUQ7w1K+eU6EfDm0w9Gvq4jWoo=; b=tPKoHCd4GRrxni89O7L7qcXdYQKJmHsmRJPSN+8tYO5/w315En/h/OFYUSjzPYKsf4rwgbBGnCpGe yYNbmetXQD6bDGFXr5pIoiglwPRfdDvpLTSVbjr18IPBmj00Fvd8LNxX2mjcPZ/K2lKdg2AYCBvEx+ hawPOk16VBm734LbNGHmgzG20XvQv6HyX2aVWcEZfC++bcj/IcaagbjlRK+QB9vtkvDpkDwCweoy1H JQGnx9/UJXgS+Y3pXiG0UTEYr06mEcxXhw3CUHwYrtHzHvfNkCuKZLPRxiaLn4CBUg9YFgVCIwadeu q5mrkGSB5/iQ1gN6wNmpzstgZrs8CQA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 15804196-e485-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 15804196-e485-11e9-85ed-13b9aae3a1d2; Tue, 01 Oct 2019 19:53:06 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x91Jr5dF056663; Tue, 1 Oct 2019 13:53:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352938 - head/sys/arm/include From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 01 Oct 2019 13:53:05 -0600 In-Reply-To: <20191001194932.GZ44691@kib.kiev.ua> References: <201910011939.x91Jd0tK010821@repo.freebsd.org> <20191001194932.GZ44691@kib.kiev.ua> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jVLZ30rFz4KDn X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 19:53:11 -0000 On Tue, 2019-10-01 at 22:49 +0300, Konstantin Belousov wrote: > On Tue, Oct 01, 2019 at 07:39:00PM +0000, Ian Lepore wrote: > > Author: ian > > Date: Tue Oct 1 19:39:00 2019 > > New Revision: 352938 > > URL: https://svnweb.freebsd.org/changeset/base/352938 > > > > Log: > > Add 8 and 16 bit versions of atomic_cmpset and atomic_fcmpset for arm. > > > > This adds 8 and 16 bit versions of the cmpset and fcmpset functions. Macros > > are used to generate all the flavors from the same set of instructions; the > > macro expansion handles the couple minor differences between each size > > variation (generating ldrexb/ldrexh/ldrex for 8/16/32, etc). > > > > In addition to handling new sizes, the instruction sequences used for cmpset > > and fcmpset are rewritten to be a bit shorter/faster, and the new sequence > > will not return false when *dst==*old but the store-exclusive fails because > > of concurrent writers. Instead, it just loops like ldrex/strex sequences > > normally do until it gets a non-conflicted store. The manpage allows LL/SC > > architectures to bogusly return false, but there's no reason to actually do > > so, at least on arm. > > The reason is to avoid nested loops. The outer control for retry was the > initial design decision for fcmpset() comparing to cmpset(). casueword() > also started following this approach after the fixes for ll/sc looping > after the external control. If the implementation is forbidden from looping, then the manpage should say so. What I commited meets the requirements currently stated in the manpage. Until somebody explains to me why it is somehow harmful to return the RIGHT information at a cost of either 0 or 1 extra cpu cycle, it's staying the way it is. -- Ian From owner-svn-src-all@freebsd.org Tue Oct 1 20:09:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55DE713F36B; Tue, 1 Oct 2019 20:09:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jVjL1ddBz4LTg; Tue, 1 Oct 2019 20:09:26 +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 01BBF207F9; Tue, 1 Oct 2019 20:09:26 +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 x91K9PUA028363; Tue, 1 Oct 2019 20:09:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91K9P94028362; Tue, 1 Oct 2019 20:09:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201910012009.x91K9P94028362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Oct 2019 20:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352939 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 352939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 20:09:26 -0000 Author: mav Date: Tue Oct 1 20:09:25 2019 New Revision: 352939 URL: https://svnweb.freebsd.org/changeset/base/352939 Log: Improve latency of synchronous 128KB writes. Before my ZIL space optimization few years ago 128KB writes were logged as two 64KB+ records in two 128KB log blocks. After that change it became ~124KB+/4KB+ in two 128KB log blocks to free space in the second block for another record. Unfortunately in case of 128KB only writes, when space in the second block remained unused, that change increased write latency by imbalancing checksum computation time between parallel threads. This change introduces new 68KB log block size, used for both writes below 67KB and 128KB-sharp writes. Writes of 68-127KB are still using one 128KB block to not increase processing overhead. Writes above 131KB are still using full 128KB blocks, since possible saving there is small. Mixed loads will likely also fall back to previous 128KB, since code uses maximum of the last 10 requested block sizes. On a simple 128KB write test with queue depth of 1 this change demonstrates ~15-20% performance improvement. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Oct 1 19:39:00 2019 (r352938) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Oct 1 20:09:25 2019 (r352939) @@ -1351,11 +1351,17 @@ zil_lwb_write_open(zilog_t *zilog, lwb_t *lwb) * aligned to 4KB) actually gets written. However, we can't always just * allocate SPA_OLD_MAXBLOCKSIZE as the slog space could be exhausted. */ -uint64_t zil_block_buckets[] = { - 4096, /* non TX_WRITE */ - 8192+4096, /* data base */ - 32*1024 + 4096, /* NFS writes */ - UINT64_MAX +struct { + uint64_t limit; + uint64_t blksz; +} zil_block_buckets[] = { + { 4096, 4096 }, /* non TX_WRITE */ + { 8192 + 4096, 8192 + 4096 }, /* database */ + { 32768 + 4096, 32768 + 4096 }, /* NFS writes */ + { 65536 + 4096, 65536 + 4096 }, /* 64KB writes */ + { 131072, 131072 }, /* < 128KB writes */ + { 131072 + 4096, 65536 + 4096 }, /* 128KB writes */ + { UINT64_MAX, SPA_OLD_MAXBLOCKSIZE}, /* > 128KB writes */ }; /* @@ -1432,11 +1438,9 @@ zil_lwb_write_issue(zilog_t *zilog, lwb_t *lwb) * pool log space. */ zil_blksz = zilog->zl_cur_used + sizeof (zil_chain_t); - for (i = 0; zil_blksz > zil_block_buckets[i]; i++) + for (i = 0; zil_blksz > zil_block_buckets[i].limit; i++) continue; - zil_blksz = zil_block_buckets[i]; - if (zil_blksz == UINT64_MAX) - zil_blksz = SPA_OLD_MAXBLOCKSIZE; + zil_blksz = zil_block_buckets[i].blksz; zilog->zl_prev_blks[zilog->zl_prev_rotor] = zil_blksz; for (i = 0; i < ZIL_PREV_BLKS; i++) zil_blksz = MAX(zil_blksz, zilog->zl_prev_blks[i]); From owner-svn-src-all@freebsd.org Tue Oct 1 20:21:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FC3B13F947; Tue, 1 Oct 2019 20:21:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jVzf0nVbz4MFn; Tue, 1 Oct 2019 20:21:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F7120B31; Tue, 1 Oct 2019 20:21:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91KLnpQ040033; Tue, 1 Oct 2019 20:21:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91KLn3h040032; Tue, 1 Oct 2019 20:21:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910012021.x91KLn3h040032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 20:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352940 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 352940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 20:21:50 -0000 Author: manu Date: Tue Oct 1 20:21:49 2019 New Revision: 352940 URL: https://svnweb.freebsd.org/changeset/base/352940 Log: generic_ohci: Look for the phy based on the id phy-names was never in the bindings schema even if it was present in some DTS. Get the optional phy based on its ID. Modified: head/sys/dev/usb/controller/generic_ohci.c Modified: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ohci.c Tue Oct 1 20:09:25 2019 (r352939) +++ head/sys/dev/usb/controller/generic_ohci.c Tue Oct 1 20:21:49 2019 (r352940) @@ -107,6 +107,7 @@ generic_ohci_attach(device_t dev) int off; struct clk_list *clkp; clk_t clk; + phandle_t node; #endif sc->ohci_sc.sc_bus.parent = dev; @@ -114,6 +115,8 @@ generic_ohci_attach(device_t dev) sc->ohci_sc.sc_bus.devices_max = OHCI_MAX_DEVICES; sc->ohci_sc.sc_bus.dma_bits = 32; + node = ofw_bus_get_node(dev); + /* get all DMA memory */ if (usb_bus_mem_alloc_all(&sc->ohci_sc.sc_bus, USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { @@ -183,7 +186,7 @@ generic_ohci_attach(device_t dev) } /* Enable phy */ - if (phy_get_by_ofw_name(dev, 0, "usb", &sc->phy) == 0) { + if (phy_get_by_ofw_idx(dev, node, 0, &sc->phy) == 0) { err = phy_enable(sc->phy); if (err != 0) { device_printf(dev, "Could not enable phy\n"); From owner-svn-src-all@freebsd.org Tue Oct 1 20:22:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEC5C13FA29; Tue, 1 Oct 2019 20:22:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jW0t5PJTz4MdG; Tue, 1 Oct 2019 20:22:54 +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 9D18920B75; Tue, 1 Oct 2019 20:22:54 +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 x91KMsxx040374; Tue, 1 Oct 2019 20:22:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91KMsmB040373; Tue, 1 Oct 2019 20:22:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910012022.x91KMsmB040373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 20:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352941 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 352941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 20:22:54 -0000 Author: manu Date: Tue Oct 1 20:22:54 2019 New Revision: 352941 URL: https://svnweb.freebsd.org/changeset/base/352941 Log: arm: allwinner: a10_ehci: Look for the phy based on the id phy-names was never in the bindings schema even if it was present in some DTS. Get the optional phy based on its ID. PR: 240978 Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Tue Oct 1 20:21:49 2019 (r352940) +++ head/sys/arm/allwinner/a10_ehci.c Tue Oct 1 20:22:54 2019 (r352941) @@ -144,6 +144,7 @@ a10_ehci_attach(device_t self) struct aw_ehci_softc *aw_sc = device_get_softc(self); ehci_softc_t *sc = &aw_sc->sc; const struct aw_ehci_conf *conf; + phandle_t node; bus_space_handle_t bsh; int err, rid, off; struct clk_list *clkp; @@ -154,6 +155,8 @@ a10_ehci_attach(device_t self) conf = USB_CONF(self); + node = ofw_bus_get_node(self); + /* initialise some bus fields */ sc->sc_bus.parent = self; sc->sc_bus.devices = sc->sc_devices; @@ -241,7 +244,7 @@ a10_ehci_attach(device_t self) } /* Enable USB PHY */ - if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + if (phy_get_by_ofw_idx(self, node, 0, &aw_sc->phy) == 0) { err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST); if (err != 0) { device_printf(self, "Could not set phy to host mode\n"); From owner-svn-src-all@freebsd.org Tue Oct 1 20:30:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 368D813FBE0 for ; Tue, 1 Oct 2019 20:30:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jW97056Yz4MsN for ; Tue, 1 Oct 2019 20:30:02 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1569961801; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=P6zImxuC+7Y9sppRd6L9coYCsQEzkOy8DaIC+BGEmrjuNc6SP5w4QP+y60FomaxKMNsal8PoYnLAe /5ZZT2VGbpHiIKvM5Vw/8xi5iGATGR6lHuqJaQOv9SC2ahNWA3cz44PJoMLjOmTWKyTvuIjXQn1Y2g ZazOjFHELykS2y/KRJ7AKJ0sEdbbDoFQCdWzWvsM1RgFHieClAwhuIcuMicEBHQMYUZNYGOTaOPZm9 9wULTL8OyGD366qmvnekxug3oBddkVSq/2AUeAF00LKqT6zacwNByuXoQgjYEWSA4vCCswDLpSq+6r X8wK1JtM1XV/DP9aYIstze+o8kL0N/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=3lFS9j01VDetCcCgmxnRykbFYOTsFChiBlkFGUvjub0=; b=QrkKhLBrIvHaIO/RgGpkFUzDnnv+KFAqcOgz62ZG6vkcK//wo3ZJrvP8LEtObuVUwrcZsbLcdblTt eMHW3fWx2Y0chFAVuaull90i1kwOt8AVIJiLYvHKOy7eYG3+SeiI1aWk3INkJczHfwSpHw54S0t9Rt SagRo2UVAk1OCnJn5OfsU8AdM86QRKMb4tpDVlmoPnyJkE/6dpf8aXFzi8nLT8vvC7VyOfeMTvKTi8 FtOP9+grwcWNz/3I/I4/rkw4t9RLr5YuMa4ZrhZNFKPCzMbrsDbDNfsAlxL3idoJ/Tkn7GzJkCdUTI NAQalzg1BjuIUXX/daLmR7weD/O7fxg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=3lFS9j01VDetCcCgmxnRykbFYOTsFChiBlkFGUvjub0=; b=hOidfHmmHdFIDz2QRPaFh5e9gXLFqcDV/c9BXZE0K/8q/nMuBRpnGUbqfGoZW+CVGor5dnJ1eM1Xe ocxvZFFBj4t5LE6Lhn+97fkQCVmXS4QF7i+gyzbBqzRkKN1BwQvpAC/EXDsmMzwvWm1jVPJa1XcETi fVMSDVAlWdLLwkqBquvrXc6Vq18B33lK5fJsjOUsyNOh/BxNZdKzF8JZJVa1gPyugPGxZZ3mRxRHi3 QXFWyae1bs34QZBB7d6jC2U/9anwJSWxmsISD9A+cpHAl52etI8eQVxNWDsb6dqLjiCPxnD4unYGTx 113GYZGjpHdFiEQP3qNTv2f+35Whf+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 3cf880bb-e48a-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 3cf880bb-e48a-11e9-85ed-13b9aae3a1d2; Tue, 01 Oct 2019 20:30:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x91KTw8f056795; Tue, 1 Oct 2019 14:29:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352940 - head/sys/dev/usb/controller From: Ian Lepore To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 01 Oct 2019 14:29:58 -0600 In-Reply-To: <201910012021.x91KLn3h040032@repo.freebsd.org> References: <201910012021.x91KLn3h040032@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jW97056Yz4MsN X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 20:30:03 -0000 On Tue, 2019-10-01 at 20:21 +0000, Emmanuel Vadot wrote: > Author: manu > Date: Tue Oct 1 20:21:49 2019 > New Revision: 352940 > URL: https://svnweb.freebsd.org/changeset/base/352940 > > Log: > generic_ohci: Look for the phy based on the id > > phy-names was never in the bindings schema even if it was present > in some DTS. Get the optional phy based on its ID. > The phys= property comes from the generic phys.txt binding, and in there, it says that phy-names= is mandatory if phys= is present. There used to be a usb_phy= property that didn't have a corresponding names property, but I can't even find the binding doc that mentions it anymore; it probably got deprecated why the generic phys binding was created. -- Ian From owner-svn-src-all@freebsd.org Tue Oct 1 20:32:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1507413FDE8; Tue, 1 Oct 2019 20:32:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jWCR6wQZz4NCS; Tue, 1 Oct 2019 20:32:03 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0B8920C0E; Tue, 1 Oct 2019 20:32:03 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91KW39E043283; Tue, 1 Oct 2019 20:32:03 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91KW3Ya043282; Tue, 1 Oct 2019 20:32:03 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910012032.x91KW3Ya043282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 1 Oct 2019 20:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352942 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 20:32:04 -0000 Author: sjg Date: Tue Oct 1 20:32:03 2019 New Revision: 352942 URL: https://svnweb.freebsd.org/changeset/base/352942 Log: Need to use ${${_${group}DIR_${file}}} for STAGE_DIR STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting ${STAGE_OBJTOP}BINDIR rather than ${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR Reviewed by: stevek MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21858 Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Tue Oct 1 20:22:54 2019 (r352941) +++ head/share/mk/bsd.files.mk Tue Oct 1 20:32:03 2019 (r352942) @@ -109,7 +109,7 @@ STAGE_AS_${file}= ${${group}NAME_${file}} # we need to expand ${group}DIR_${file} and replace # all '/' and '*' with '_' to make a safe target name. STAGE_AS_SETS+= ${${_${group}DIR_${file}}:C,[/*],_,g} -STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR_${file}} +STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}} stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file} installfiles-${group}: _${group}INS1_${file} From owner-svn-src-all@freebsd.org Tue Oct 1 20:34:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B20D13FEB8; Tue, 1 Oct 2019 20:34:43 +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 46jWGT5l6Hz4NQ3; Tue, 1 Oct 2019 20:34:41 +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 ecada7e9; Tue, 1 Oct 2019 22:34:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=r2S0+3Pb9EAEnWAohkx90i8tlCE=; b=Elwm18nGQpSPZBqvLb2yhQRrTgCi ifyuCptmdm11biAQPvOoORWWXNJ7zGXrjPyvPUwJzgylA08MOJi1rX90F+iri0Vq NMgZh3NO/qcn8TrXBjfP70iWukiDB+Gdm+POE7yWZaqrWmrZSEiLG7q1zBmQteIz wbsRTZYdkemiZyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=hZm27+q4TpeBajmiXxMiXgzNOTTf8XowNP6vJMce/gHriuHw3PO51uwK BGB28xreeeg0Kc3N7PS17K3g0dFqNTKHvr5X1vEd4liQCHU7fILDvMXyxxVhSr0J pMqDCgCyHn6L7hsz0xAiwZprE0oeLAIJHV9oW1A0CBibuUV30hY= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 33e222c7 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 1 Oct 2019 22:34:34 +0200 (CEST) Date: Tue, 1 Oct 2019 22:34:33 +0200 From: Emmanuel Vadot To: Ian Lepore Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352940 - head/sys/dev/usb/controller Message-Id: <20191001223433.a63f00e6209d424d947f75e1@bidouilliste.com> In-Reply-To: References: <201910012021.x91KLn3h040032@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jWGT5l6Hz4NQ3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=Elwm18nG; dmarc=none; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; NEURAL_HAM_MEDIUM(-0.83)[-0.828,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; DMARC_NA(0.00)[bidouilliste.com]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.37)[ip: (-0.77), ipnet: 212.83.160.0/19(2.50), asn: 12876(0.12), country: FR(-0.00)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 20:34:43 -0000 On Tue, 01 Oct 2019 14:29:58 -0600 Ian Lepore wrote: > On Tue, 2019-10-01 at 20:21 +0000, Emmanuel Vadot wrote: > > Author: manu > > Date: Tue Oct 1 20:21:49 2019 > > New Revision: 352940 > > URL: https://svnweb.freebsd.org/changeset/base/352940 > > > > Log: > > generic_ohci: Look for the phy based on the id > > > > phy-names was never in the bindings schema even if it was present > > in some DTS. Get the optional phy based on its ID. > > > > The phys= property comes from the generic phys.txt binding, and in > there, it says that phy-names= is mandatory if phys= is present. There > used to be a usb_phy= property that didn't have a corresponding names > property, but I can't even find the binding doc that mentions it > anymore; it probably got deprecated why the generic phys binding was > created. > > -- Ian Huh right, I've missed the phy-bindings.txt document somehow, I'll go complain on the linux ML then. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Tue Oct 1 22:13:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5C4AF9D62; Tue, 1 Oct 2019 22:13:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jYSR3x27z4T9y; Tue, 1 Oct 2019 22:13:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4DB4D49CC; Tue, 1 Oct 2019 22:13:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id D135122243; Tue, 1 Oct 2019 18:13:26 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute5.internal (MEProxy); Tue, 01 Oct 2019 18:13:26 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrgeehgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreertdenucfhrhhomhepfdeurhgrugcuffgrvhhishdfuceosghrugeshfhrvggvuefu ffdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecurfgrrhgrmhepmh grihhlfhhrohhmpegsrhgrugdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidq jedtjeeifedvfedvqddukedtieelieekkedqsghrugeppefhrhgvvgeuufffrdhorhhgse hsohdugehkrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 846C4E00A6; Tue, 1 Oct 2019 18:13:26 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-334-g7f5110b-fmstable-20191001v2 Mime-Version: 1.0 Message-Id: <680b08c2-10d7-4080-9170-e5d71cafacd0@www.fastmail.com> In-Reply-To: <201909061425.x86EPfno078236@repo.freebsd.org> References: <201909061425.x86EPfno078236@repo.freebsd.org> Date: Tue, 01 Oct 2019 16:12:41 -0600 From: "Brad Davis" To: "Randall Stewart" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351934 - in head/sys: netinet netinet/tcp_stacks sys Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 22:13:27 -0000 On Fri, Sep 6, 2019, at 8:25 AM, Randall Stewart wrote: > Author: rrs > Date: Fri Sep 6 14:25:41 2019 > New Revision: 351934 > URL: https://svnweb.freebsd.org/changeset/base/351934 > > Log: > This adds the final tweaks to LRO that will now allow me > to add BBR. These changes make it so you can get an > array of timestamps instead of a compressed ack/data segment. > BBR uses this to aid with its delivery estimates. We also > now (via Drew's suggestions) will not go to the expense of > the tcb lookup if no stack registers to want this feature. If > HPTS is not present the feature is not present either and you > just get the compressed behavior. Hi Randall, This (+ the fixes in r351950, r351951, r351952) break TCP over a VLAN interface for me. 15:57:27.437022 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 64) 192.168.1.247.51621 > 192.168.1.31.22: Flags [S], cksum 0x829c (correct), seq 954393965, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 1140851693 ecr 0,sackOK,eol], length 0 15:57:27.437055 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60, bad cksum 0 (->b655)!) 192.168.1.31.22 > 192.168.1.247.51621: Flags [S.], cksum 0x8495 (incorrect -> 0x7d08), seq 532354280, ack 954393966, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 1641644043 ecr 1140851693], length 0 15:57:27.449358 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 90, bad cksum 0 (->b637)!) 192.168.1.31.22 > 192.168.1.247.51621: Flags [P.], cksum 0x84b3 (incorrect -> 0xe69e), seq 1:39, ack 1, win 1026, options [nop,nop,TS val 1641644055 ecr 1140851693], length 38 15:58:00.363155 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->b65d)!) 192.168.1.31.22 > 192.168.1.247.51619: Flags [.], cksum 0x848d (incorrect -> 0x98dd), seq 733444611, ack 2137820470, win 1026, options [nop,nop,TS val 3639423932 ecr 1140820150], length 0 15:58:30.078521 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->b65d)!) 192.168.1.31.22 > 192.168.1.247.51621: Flags [.], cksum 0x848d (incorrect -> 0xb2f9), seq 39, ack 1, win 1026, options [nop,nop,TS val 1641706684 ecr 1140851693], length 0 Disabling LRO fixes it. Let me know if I can provide any more information. Thanks, Brad Davis From owner-svn-src-all@freebsd.org Tue Oct 1 22:19:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E368F9EF6; Tue, 1 Oct 2019 22:19:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jYb537TLz4TZp; Tue, 1 Oct 2019 22:19:13 +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 31CC921F2F; Tue, 1 Oct 2019 22:19:13 +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 x91MJD9A006737; Tue, 1 Oct 2019 22:19:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91MJDru006736; Tue, 1 Oct 2019 22:19:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910012219.x91MJDru006736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 22:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352943 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 352943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 22:19:13 -0000 Author: manu Date: Tue Oct 1 22:19:12 2019 New Revision: 352943 URL: https://svnweb.freebsd.org/changeset/base/352943 Log: arm: allwinner: a10_ehci: Enable all phys Even if there should be only one phy enable all the ones declared in the dts just to be sure. Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Tue Oct 1 20:32:03 2019 (r352942) +++ head/sys/arm/allwinner/a10_ehci.c Tue Oct 1 22:19:12 2019 (r352943) @@ -93,11 +93,16 @@ struct hwrst_list { hwreset_t rst; }; +struct phy_list { + TAILQ_ENTRY(phy_list) next; + phy_t phy; +}; + struct aw_ehci_softc { ehci_softc_t sc; TAILQ_HEAD(, clk_list) clk_list; TAILQ_HEAD(, hwrst_list) rst_list; - phy_t phy; + TAILQ_HEAD(, phy_list) phy_list; }; struct aw_ehci_conf { @@ -144,19 +149,18 @@ a10_ehci_attach(device_t self) struct aw_ehci_softc *aw_sc = device_get_softc(self); ehci_softc_t *sc = &aw_sc->sc; const struct aw_ehci_conf *conf; - phandle_t node; bus_space_handle_t bsh; int err, rid, off; struct clk_list *clkp; clk_t clk; struct hwrst_list *rstp; hwreset_t rst; + struct phy_list *phyp; + phy_t phy; uint32_t reg_value = 0; conf = USB_CONF(self); - node = ofw_bus_get_node(self); - /* initialise some bus fields */ sc->sc_bus.parent = self; sc->sc_bus.devices = sc->sc_devices; @@ -244,17 +248,21 @@ a10_ehci_attach(device_t self) } /* Enable USB PHY */ - if (phy_get_by_ofw_idx(self, node, 0, &aw_sc->phy) == 0) { - err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST); + TAILQ_INIT(&aw_sc->phy_list); + for (off = 0; phy_get_by_ofw_idx(self, 0, off, &phy) == 0; off++) { + err = phy_usb_set_mode(phy, PHY_USB_MODE_HOST); if (err != 0) { device_printf(self, "Could not set phy to host mode\n"); goto error; } - err = phy_enable(aw_sc->phy); + err = phy_enable(phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); goto error; } + phyp = malloc(sizeof(*phyp), M_DEVBUF, M_WAITOK | M_ZERO); + phyp->phy = phy; + TAILQ_INSERT_TAIL(&aw_sc->phy_list, phyp, next); } /* Configure port */ @@ -289,6 +297,7 @@ a10_ehci_detach(device_t self) uint32_t reg_value = 0; struct clk_list *clk, *clk_tmp; struct hwrst_list *rst, *rst_tmp; + struct phy_list *phy, *phy_tmp; conf = USB_CONF(self); @@ -348,6 +357,16 @@ a10_ehci_detach(device_t self) hwreset_release(rst->rst); TAILQ_REMOVE(&aw_sc->rst_list, rst, next); free(rst, M_DEVBUF); + } + + /* Disable phys */ + TAILQ_FOREACH_SAFE(phy, &aw_sc->phy_list, next, phy_tmp) { + err = phy_disable(phy->phy); + if (err != 0) + device_printf(self, "Could not disable phy\n"); + phy_release(phy->phy); + TAILQ_REMOVE(&aw_sc->phy_list, phy, next); + free(phy, M_DEVBUF); } return (0); From owner-svn-src-all@freebsd.org Tue Oct 1 22:20:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8E5F9F89; Tue, 1 Oct 2019 22:20:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jYc35cYNz4Tjd; Tue, 1 Oct 2019 22:20:03 +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 A414821F33; Tue, 1 Oct 2019 22:20:03 +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 x91MK3r4006869; Tue, 1 Oct 2019 22:20:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91MK3up006867; Tue, 1 Oct 2019 22:20:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910012220.x91MK3up006867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Oct 2019 22:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352944 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 352944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 22:20:03 -0000 Author: manu Date: Tue Oct 1 22:20:03 2019 New Revision: 352944 URL: https://svnweb.freebsd.org/changeset/base/352944 Log: generic_ehci: Enable all phys and resets The number of phys and resets is not defined and it controller dependent so enable/disable every one of them. Modified: head/sys/dev/usb/controller/generic_ohci.c Modified: head/sys/dev/usb/controller/generic_ohci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ohci.c Tue Oct 1 22:19:12 2019 (r352943) +++ head/sys/dev/usb/controller/generic_ohci.c Tue Oct 1 22:20:03 2019 (r352944) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include "generic_usb_if.h" @@ -69,15 +70,23 @@ struct clk_list { TAILQ_ENTRY(clk_list) next; clk_t clk; }; +struct phy_list { + TAILQ_ENTRY(phy_list) next; + phy_t phy; +}; +struct hwrst_list { + TAILQ_ENTRY(hwrst_list) next; + hwreset_t rst; +}; #endif struct generic_ohci_softc { ohci_softc_t ohci_sc; #ifdef EXT_RESOURCES - hwreset_t rst; - phy_t phy; - TAILQ_HEAD(, clk_list) clk_list; + TAILQ_HEAD(, clk_list) clk_list; + TAILQ_HEAD(, phy_list) phy_list; + TAILQ_HEAD(, hwrst_list) rst_list; #endif }; @@ -106,8 +115,11 @@ generic_ohci_attach(device_t dev) #ifdef EXT_RESOURCES int off; struct clk_list *clkp; + struct phy_list *phyp; + struct hwrst_list *rstp; clk_t clk; - phandle_t node; + phy_t phy; + hwreset_t rst; #endif sc->ohci_sc.sc_bus.parent = dev; @@ -115,8 +127,6 @@ generic_ohci_attach(device_t dev) sc->ohci_sc.sc_bus.devices_max = OHCI_MAX_DEVICES; sc->ohci_sc.sc_bus.dma_bits = 32; - node = ofw_bus_get_node(dev); - /* get all DMA memory */ if (usb_bus_mem_alloc_all(&sc->ohci_sc.sc_bus, USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { @@ -176,22 +186,34 @@ generic_ohci_attach(device_t dev) } /* De-assert reset */ - if (hwreset_get_by_ofw_idx(dev, 0, 0, &sc->rst) == 0) { - err = hwreset_deassert(sc->rst); + TAILQ_INIT(&sc->rst_list); + for (off = 0; hwreset_get_by_ofw_idx(dev, 0, off, &rst) == 0; off++) { + err = hwreset_deassert(rst); if (err != 0) { - device_printf(dev, "Could not de-assert reset %d\n", - off); + device_printf(dev, "Could not de-assert reset\n"); goto error; } + rstp = malloc(sizeof(*rstp), M_DEVBUF, M_WAITOK | M_ZERO); + rstp->rst = rst; + TAILQ_INSERT_TAIL(&sc->rst_list, rstp, next); } /* Enable phy */ - if (phy_get_by_ofw_idx(dev, node, 0, &sc->phy) == 0) { - err = phy_enable(sc->phy); + TAILQ_INIT(&sc->phy_list); + for (off = 0; phy_get_by_ofw_idx(dev, 0, off, &phy) == 0; off++) { + err = phy_usb_set_mode(phy, PHY_USB_MODE_HOST); if (err != 0) { + device_printf(dev, "Could not set phy to host mode\n"); + goto error; + } + err = phy_enable(phy); + if (err != 0) { device_printf(dev, "Could not enable phy\n"); goto error; } + phyp = malloc(sizeof(*phyp), M_DEVBUF, M_WAITOK | M_ZERO); + phyp->phy = phy; + TAILQ_INSERT_TAIL(&sc->phy_list, phyp, next); } #endif @@ -219,6 +241,8 @@ generic_ohci_detach(device_t dev) int err; #ifdef EXT_RESOURCES struct clk_list *clk, *clk_tmp; + struct phy_list *phy, *phy_tmp; + struct hwrst_list *rst, *rst_tmp; #endif /* during module unload there are lots of children leftover */ @@ -260,13 +284,23 @@ generic_ohci_detach(device_t dev) #ifdef EXT_RESOURCES /* Disable phy */ - if (sc->phy) { - err = phy_disable(sc->phy); + TAILQ_FOREACH_SAFE(phy, &sc->phy_list, next, phy_tmp) { + err = phy_disable(phy->phy); if (err != 0) device_printf(dev, "Could not disable phy\n"); - phy_release(sc->phy); + phy_release(phy->phy); + TAILQ_REMOVE(&sc->phy_list, phy, next); + free(phy, M_DEVBUF); } + /* Assert reset */ + TAILQ_FOREACH_SAFE(rst, &sc->rst_list, next, rst_tmp) { + hwreset_assert(rst->rst); + hwreset_release(rst->rst); + TAILQ_REMOVE(&sc->rst_list, rst, next); + free(rst, M_DEVBUF); + } + /* Disable clock */ TAILQ_FOREACH_SAFE(clk, &sc->clk_list, next, clk_tmp) { err = clk_disable(clk->clk); @@ -279,14 +313,6 @@ generic_ohci_detach(device_t dev) clk_get_name(clk->clk)); TAILQ_REMOVE(&sc->clk_list, clk, next); free(clk, M_DEVBUF); - } - - /* De-assert reset */ - if (sc->rst) { - err = hwreset_assert(sc->rst); - if (err != 0) - device_printf(dev, "Could not assert reset\n"); - hwreset_release(sc->rst); } #endif From owner-svn-src-all@freebsd.org Tue Oct 1 23:26:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AC01FAFC2; Tue, 1 Oct 2019 23:26:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jb5927XNz4X8b; Tue, 1 Oct 2019 23:26:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D44C22B6F; Tue, 1 Oct 2019 23:26:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91NQrUe048050; Tue, 1 Oct 2019 23:26:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91NQrWJ048049; Tue, 1 Oct 2019 23:26:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910012326.x91NQrWJ048049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 1 Oct 2019 23:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352946 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 23:26:53 -0000 Author: mckusick Date: Tue Oct 1 23:26:52 2019 New Revision: 352946 URL: https://svnweb.freebsd.org/changeset/base/352946 Log: MFC of 352453 Check bread_gb() return value in cluster_collectbufs() code. Modified: stable/12/sys/kern/vfs_cluster.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_cluster.c ============================================================================== --- stable/12/sys/kern/vfs_cluster.c Tue Oct 1 22:52:18 2019 (r352945) +++ stable/12/sys/kern/vfs_cluster.c Tue Oct 1 23:26:52 2019 (r352946) @@ -706,6 +706,14 @@ cluster_write(struct vnode *vp, struct buf *bp, u_quad struct cluster_save *buflist; buflist = cluster_collectbufs(vp, bp, gbflags); + if (buflist == NULL) { + /* + * Cluster build failed so just write + * it now. + */ + bawrite(bp); + return; + } endbp = &buflist->bs_children [buflist->bs_nchildren - 1]; if (VOP_REALLOCBLKS(vp, buflist)) { @@ -1045,7 +1053,7 @@ cluster_collectbufs(struct vnode *vp, struct buf *last struct cluster_save *buflist; struct buf *bp; daddr_t lbn; - int i, len; + int i, j, len, error; len = vp->v_lastw - vp->v_cstart + 1; buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), @@ -1053,8 +1061,18 @@ cluster_collectbufs(struct vnode *vp, struct buf *last buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) { - (void)bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, + error = bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, gbflags, &bp); + if (error != 0) { + /* + * If read fails, release collected buffers + * and return failure. + */ + for (j = 0; j < i; j++) + brelse(buflist->bs_children[j]); + free(buflist, M_SEGMENT); + return (NULL); + } buflist->bs_children[i] = bp; if (bp->b_blkno == bp->b_lblkno) VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, From owner-svn-src-all@freebsd.org Tue Oct 1 23:28:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C17A9FB07C; Tue, 1 Oct 2019 23:28:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jb6t4XN1z4XGx; Tue, 1 Oct 2019 23:28:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F49522B75; Tue, 1 Oct 2019 23:28:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x91NSMt1048173; Tue, 1 Oct 2019 23:28:22 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x91NSM2M048172; Tue, 1 Oct 2019 23:28:22 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910012328.x91NSM2M048172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 1 Oct 2019 23:28: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: r352947 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 352947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Oct 2019 23:28:22 -0000 Author: mckusick Date: Tue Oct 1 23:28:22 2019 New Revision: 352947 URL: https://svnweb.freebsd.org/changeset/base/352947 Log: MFC of 352453 Check bread_gb() return value in cluster_collectbufs() code. Modified: stable/11/sys/kern/vfs_cluster.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_cluster.c ============================================================================== --- stable/11/sys/kern/vfs_cluster.c Tue Oct 1 23:26:52 2019 (r352946) +++ stable/11/sys/kern/vfs_cluster.c Tue Oct 1 23:28:22 2019 (r352947) @@ -702,6 +702,14 @@ cluster_write(struct vnode *vp, struct buf *bp, u_quad struct cluster_save *buflist; buflist = cluster_collectbufs(vp, bp, gbflags); + if (buflist == NULL) { + /* + * Cluster build failed so just write + * it now. + */ + bawrite(bp); + return; + } endbp = &buflist->bs_children [buflist->bs_nchildren - 1]; if (VOP_REALLOCBLKS(vp, buflist)) { @@ -1054,7 +1062,7 @@ cluster_collectbufs(struct vnode *vp, struct buf *last struct cluster_save *buflist; struct buf *bp; daddr_t lbn; - int i, len; + int i, j, len, error; len = vp->v_lastw - vp->v_cstart + 1; buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), @@ -1062,8 +1070,18 @@ cluster_collectbufs(struct vnode *vp, struct buf *last buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) { - (void)bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, + error = bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, gbflags, &bp); + if (error != 0) { + /* + * If read fails, release collected buffers + * and return failure. + */ + for (j = 0; j < i; j++) + brelse(buflist->bs_children[j]); + free(buflist, M_SEGMENT); + return (NULL); + } buflist->bs_children[i] = bp; if (bp->b_blkno == bp->b_lblkno) VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, From owner-svn-src-all@freebsd.org Wed Oct 2 01:05:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC7EEFD031; Wed, 2 Oct 2019 01:05:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jdGz4vVqz4bgl; Wed, 2 Oct 2019 01:05:31 +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 8845623D49; Wed, 2 Oct 2019 01:05:31 +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 x9215Vno007329; Wed, 2 Oct 2019 01:05:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9215T6i007321; Wed, 2 Oct 2019 01:05:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910020105.x9215T6i007321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 01:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352948 - in head: etc/mtree secure secure/caroot secure/caroot/blacklisted secure/caroot/trusted share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree secure secure/caroot secure/caroot/blacklisted secure/caroot/trusted share/mk X-SVN-Commit-Revision: 352948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 01:05:31 -0000 Author: kevans Date: Wed Oct 2 01:05:29 2019 New Revision: 352948 URL: https://svnweb.freebsd.org/changeset/base/352948 Log: [1/3] Initial infrastructure for SSL root bundle in base This setup will add the trusted certificates from the Mozilla NSS bundle to base. This commit includes: - CAROOT option to opt out of installation of certs - mtree amendments for final destinations - infrastructure to fetch/update certs, along with instructions A follow-up commit will add a certctl(8) utility to give the user control over trust specifics. Another follow-up commit will actually commit the initial result of updatecerts. This work was done primarily by allanjude@, with minor contributions by myself. No objection from: secteam Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16856 Added: head/secure/caroot/ head/secure/caroot/MAca-bundle.pl (contents, props changed) head/secure/caroot/Makefile (contents, props changed) head/secure/caroot/README (contents, props changed) head/secure/caroot/blacklisted/ head/secure/caroot/blacklisted/Makefile (contents, props changed) head/secure/caroot/trusted/ head/secure/caroot/trusted/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/secure/Makefile head/share/mk/src.opts.mk Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Oct 1 23:28:22 2019 (r352947) +++ head/etc/mtree/BSD.usr.dist Wed Oct 2 01:05:29 2019 (r352948) @@ -194,6 +194,12 @@ uk_UA.KOI8-U .. .. + certs + blacklisted + .. + trusted + .. + .. dict .. doc Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Tue Oct 1 23:28:22 2019 (r352947) +++ head/secure/Makefile Wed Oct 2 01:05:29 2019 (r352948) @@ -8,6 +8,8 @@ SUBDIR_PARALLEL= SUBDIR.${MK_TESTS}+= tests +SUBDIR.${MK_CAROOT}+= caroot + # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ Added: head/secure/caroot/MAca-bundle.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/MAca-bundle.pl Wed Oct 2 01:05:29 2019 (r352948) @@ -0,0 +1,272 @@ +#!/usr/bin/env perl +## +## MAca-bundle.pl -- Regenerate ca-root-nss.crt from the Mozilla certdata.txt +## +## Rewritten in September 2011 by Matthias Andree to heed untrust +## + +## Copyright (c) 2011, 2013 Matthias Andree +## All rights reserved. +## Copyright (c) 2018, Allan Jude +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are +## met: +## +## * Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## +## * Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +## FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +## COPYRIGHT HOLDER 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. + +use strict; +use Carp; +use MIME::Base64; +use Getopt::Long; + +my $VERSION = '$FreeBSD$'; +my $inputfh = *STDIN; +my $debug = 0; +my $infile; +my $outputdir; +my %labels; +my %certs; +my %trusts; + +$debug++ + if defined $ENV{'WITH_DEBUG'} + and $ENV{'WITH_DEBUG'} !~ m/(?i)^(no|0|false|)$/; + +GetOptions ( + "debug+" => \$debug, + "infile:s" => \$infile, + "outputdir:s" => \$outputdir) + or die("Error in command line arguments\n$0 [-d] [-i input-file] [-o output-dir]\n"); + +if ($infile) { + open($inputfh, "<", $infile) or die "Failed to open $infile"; +} + +sub print_header($$) +{ + my $dstfile = shift; + my $label = shift; + + if ($outputdir) { + print $dstfile <) { + last if /^END/; + my (undef,@oct) = split /\\/; + my @bin = map(chr(oct), @oct); + $data .= join('', @bin); + } + + return $data; +} + + +sub grabcert($) +{ + my $ifh = shift; + my $certdata; + my $cka_label; + my $serial; + + while (<$ifh>) { + chomp; + last if ($_ eq ''); + + if (/^CKA_LABEL UTF8 "([^"]+)"/) { + $cka_label = $1; + } + + if (/^CKA_VALUE MULTILINE_OCTAL/) { + $certdata = graboct($ifh); + } + + if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) { + $serial = graboct($ifh); + } + } + return ($serial, $cka_label, $certdata); +} + +sub grabtrust($) { + my $ifh = shift; + my $cka_label; + my $serial; + my $maytrust = 0; + my $distrust = 0; + + while (<$ifh>) { + chomp; + last if ($_ eq ''); + + if (/^CKA_LABEL UTF8 "([^"]+)"/) { + $cka_label = $1; + } + + if (/^CKA_SERIAL_NUMBER MULTILINE_OCTAL/) { + $serial = graboct($ifh); + } + + if (/^CKA_TRUST_(SERVER_AUTH|EMAIL_PROTECTION|CODE_SIGNING) CK_TRUST (\S+)$/) + { + if ($2 eq 'CKT_NSS_NOT_TRUSTED') { + $distrust = 1; + } elsif ($2 eq 'CKT_NSS_TRUSTED_DELEGATOR') { + $maytrust = 1; + } elsif ($2 ne 'CKT_NSS_MUST_VERIFY_TRUST') { + confess "Unknown trust setting on line $.:\n" + . "$_\n" + . "Script must be updated:"; + } + } + } + + if (!$maytrust && !$distrust && $debug) { + print STDERR "line $.: no explicit trust/distrust found for $cka_label\n"; + } + + my $trust = ($maytrust and not $distrust); + return ($serial, $cka_label, $trust); +} + +if (!$outputdir) { + print_header(*STDOUT, ""); +} + +while (<$inputfh>) { + if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) { + my ($serial, $label, $certdata) = grabcert($inputfh); + if (defined $certs{$label."\0".$serial}) { + warn "Certificate $label duplicated!\n"; + } + $certs{$label."\0".$serial} = $certdata; + # We store the label in a separate hash because truncating the key + # with \0 was causing garbage data after the end of the text. + $labels{$label."\0".$serial} = $label; + } elsif (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/) { + my ($serial, $label, $trust) = grabtrust($inputfh); + if (defined $trusts{$label."\0".$serial}) { + warn "Trust for $label duplicated!\n"; + } + $trusts{$label."\0".$serial} = $trust; + $labels{$label."\0".$serial} = $label; + } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) { + print "## Source: \"certdata.txt\" CVS revision $1\n##\n\n"; + } +} + +sub label_to_filename(@) { + my @res = @_; + map { s/\0.*//; s/[^[:alnum:]\-]/_/g; $_ = "$_.pem"; } @res; + return wantarray ? @res : $res[0]; +} + +# weed out untrusted certificates +my $untrusted = 0; +foreach my $it (keys %trusts) { + if (!$trusts{$it}) { + if (!exists($certs{$it})) { + warn "Found trust for nonexistent certificate $labels{$it}\n" if $debug; + } else { + delete $certs{$it}; + warn "Skipping untrusted $labels{$it}\n" if $debug; + $untrusted++; + } + } +} + +if (!$outputdir) { + print "## Untrusted certificates omitted from this bundle: $untrusted\n\n"; +} +print STDERR "## Untrusted certificates omitted from this bundle: $untrusted\n"; + +my $certcount = 0; +foreach my $it (sort {uc($a) cmp uc($b)} keys %certs) { + my $fh = *STDOUT; + my $filename; + if (!exists($trusts{$it})) { + die "Found certificate without trust block,\naborting"; + } + if ($outputdir) { + $filename = label_to_filename($labels{$it}); + open($fh, ">", "$outputdir/$filename") or die "Failed to open certificate $filename"; + print_header($fh, $labels{$it}); + } + printcert($fh, $labels{$it}, $certs{$it}); + if ($outputdir) { + close($fh) or die "Unable to close: $filename"; + } else { + print $fh "\n\n\n"; + } + $certcount++; + print STDERR "Trusting $certcount: $labels{$it}\n" if $debug; +} + +if ($certcount < 25) { + die "Certificate count of $certcount is implausibly low.\nAbort"; +} + +if (!$outputdir) { + print "## Number of certificates: $certcount\n"; + print "## End of file.\n"; +} +print STDERR "## Number of certificates: $certcount\n"; Added: head/secure/caroot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/Makefile Wed Oct 2 01:05:29 2019 (r352948) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +PACKAGE= caroot + +CLEANFILES+= certdata.txt + +SUBDIR+= trusted +SUBDIR+= blacklisted + +.include + +# To be used by secteam@ to update the trusted certificates + +fetchcerts: .PHONY + fetch --no-sslv3 --no-tlsv1 -o certdata.txt 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt' + +cleancerts: .PHONY + @${MAKE} -C ${.CURDIR}/trusted ${.TARGET} + +updatecerts: .PHONY cleancerts fetchcerts + perl ${.CURDIR}/MAca-bundle.pl -i certdata.txt -o ${.CURDIR}/trusted Added: head/secure/caroot/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/README Wed Oct 2 01:05:29 2019 (r352948) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +This directory contains the scripts to update the TLS CA Root Certificates +that comprise the 'root trust store'. + +The 'updatecerts' make target should be run periodically by secteam@ +specifically when there is an important change to the list of trusted root +certificates included by Mozilla. + +It will: + 1) Remove the old trusted certificates (cleancerts) + 2) Download the latest certdata.txt from Mozilla (fetchcerts) + 3) Split certdata.txt into the individual .pem files (updatecerts) + +Then the results should manually be inspected (svn status) + 1) Any no-longer-trusted certificates should be moved to the + blacklisted directory (svn mv) + 2) any newly added certificates will need to be added (svn add) + + +The following make targets exist: + +cleancerts: + Delete the old certificates, run as a dependency of updatecerts. + +fetchcerts: + Download the latest certdata.txt from the Mozilla NSS hg repo + See the changelog here: + https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt + +updatecerts: + Runs a perl script (MAca-bundle.pl) on the downloaded certdata.txt + to generate the individual certificate files (.pem) and store them + in the trusted/ directory. Added: head/secure/caroot/blacklisted/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/blacklisted/Makefile Wed Oct 2 01:05:29 2019 (r352948) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +BINDIR= /usr/share/certs/blacklisted + +FILES= + +.include Added: head/secure/caroot/trusted/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Makefile Wed Oct 2 01:05:29 2019 (r352948) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +BINDIR= /usr/share/certs/trusted + +TRUSTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true + +FILES+= ${TRUSTED_CERTS} + +cleancerts: + @[ -z "${TRUSTED_CERTS}" ] || rm ${TRUSTED_CERTS} + +.include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Oct 1 23:28:22 2019 (r352947) +++ head/share/mk/src.opts.mk Wed Oct 2 01:05:29 2019 (r352948) @@ -77,6 +77,7 @@ __DEFAULT_YES_OPTIONS = \ BZIP2 \ CALENDAR \ CAPSICUM \ + CAROOT \ CASPER \ CCD \ CDDL \ From owner-svn-src-all@freebsd.org Wed Oct 2 01:05:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999BFFD0AD; Wed, 2 Oct 2019 01:05:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jdHQ3HHPz4bpW; Wed, 2 Oct 2019 01:05: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 5455E23D4A; Wed, 2 Oct 2019 01:05: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 x9215s67007391; Wed, 2 Oct 2019 01:05:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9215rI4007388; Wed, 2 Oct 2019 01:05:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910020105.x9215rI4007388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 01:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352949 - in head/usr.sbin: . certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin: . certctl X-SVN-Commit-Revision: 352949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 01:05:54 -0000 Author: kevans Date: Wed Oct 2 01:05:53 2019 New Revision: 352949 URL: https://svnweb.freebsd.org/changeset/base/352949 Log: [2/3] Add certctl(8) This is a simple utility to hash all trusted on the system into /etc/ssl/certs. It also allows the user to blacklist certificates they do not trust. This work was done primarily by allanjude@, with minor contributions by myself. No objection from: secteam Differential Revision: https://reviews.freebsd.org/D16857 Added: head/usr.sbin/certctl/ head/usr.sbin/certctl/Makefile (contents, props changed) head/usr.sbin/certctl/certctl.8 (contents, props changed) head/usr.sbin/certctl/certctl.sh (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Oct 2 01:05:29 2019 (r352948) +++ head/usr.sbin/Makefile Wed Oct 2 01:05:53 2019 (r352949) @@ -124,6 +124,9 @@ SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd +.if ${MK_CAROOT} != "no" +SUBDIR.${MK_OPENSSL}+= certctl +.endif SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_DIALOG}+= bsdconfig SUBDIR.${MK_EFI}+= efivar efidp efibootmgr Added: head/usr.sbin/certctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/certctl/Makefile Wed Oct 2 01:05:53 2019 (r352949) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SCRIPTS=certctl.sh +MAN= certctl.8 + +.include Added: head/usr.sbin/certctl/certctl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/certctl/certctl.8 Wed Oct 2 01:05:53 2019 (r352949) @@ -0,0 +1,119 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright 2018 Allan Jude +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted providing that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 19, 2019 +.Dt CERTCTL 8 +.Os +.Sh NAME +.Nm certctl +.Nd "tool for managing trusted and blacklist TLS certificates" +.Sh SYNOPSIS +.Nm +.Op Fl v +.Ic list +.Nm +.Op Fl v +.Ic blacklisted +.Nm +.Op Fl nv +.Ic rehash +.Nm +.Op Fl nv +.Ic blacklist Ar file +.Nm +.Op Fl nv +.Ic unblacklist Ar file +.Sh DESCRIPTION +The +.Nm +utility manages the list of TLS Certificate Authorities that are trusted by +applications that use OpenSSL. +.Pp +Flags: +.Bl -tag -width 4n +.It Fl n +No-Op mode, do not actually perform any actions. +.It Fl v +be verbose, print details about actions before performing them. +.El +.Pp +Primary command functions: +.Bl -tag -width blacklisted +.It Ic list +List all currently trusted certificate authorities. +.It Ic blacklisted +List all currently blacklisted certificates. +.It Ic rehash +Rebuild the list of trusted certificate authorities by scanning all directories +in +.Ev TRUSTPATH +and all blacklisted certificates in +.Ev BLACKLISTPATH . +A symbolic link to each trusted certificate is placed in +.Ev CERTDESTDIR +and each blacklisted certificate in +.Ev BLACKLISTDESTDIR . +.It Ic blacklist +Add the specified file to the blacklist. +.It Ic unblacklist +Remove the specified file from the blacklist. +.El +.Sh ENVIRONMENT +.Bl -tag -width BLACKLISTDESTDIR +.It Ev DESTDIR +Alternate destination directory to operate on. +.It Ev TRUSTPATH +List of paths to search for trusted certificates. +Default: +.Pa /usr/share/certs/trusted +.Pa /usr/local/share/certs /usr/local/etc/ssl/certs +.It Ev BLACKLISTPATH +List of paths to search for blacklisted certificates. +Default: +.Pa /usr/share/certs/blacklisted +.Pa /usr/local/etc/ssl/blacklisted +.It Ev CERTDESTDIR +Destination directory for symbolic links to trusted certificates. +Default: +.Pa /etc/ssl/certs +.It Ev BLACKLISTDESTDIR +Destination directory for symbolic links to blacklisted certificates. +Default: +.Pa /etc/ssl/blacklisted +.It Ev EXTENSIONS +List of file extensions to read as certificate files. +Default: *.pem *.crt *.cer *.crl *.0 +.El +.Sh SEE ALSO +.Xr openssl 1 +.Sh HISTORY +.Nm +first appeared in +.Fx 12.0 +.Sh AUTHORS +.An Allan Jude Aq Mt allanjude@freebsd.org Added: head/usr.sbin/certctl/certctl.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/certctl/certctl.sh Wed Oct 2 01:05:53 2019 (r352949) @@ -0,0 +1,230 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2018 Allan Jude +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing 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$ + +############################################################ CONFIGURATION + +: ${DESTDIR:=} +: ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} +: ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} +: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} +: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} +: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${VERBOSE:=0} + +############################################################ GLOBALS + +SCRIPTNAME="${0##*/}" +ERRORS=0 +NOOP=0 + +############################################################ FUNCTIONS + +do_hash() +{ + local hash + + if hash=$( openssl x509 -noout -subject_hash -in "$1" ); then + echo "$hash" + return 0 + else + echo "Error: $1" >&2 + ERRORS=$(( $ERRORS + 1 )) + return 1 + fi +} + +create_trusted_link() +{ + local hash + + hash=$( do_hash "$1" ) || return + if [ -e "$BLACKLISTDESTDIR/$hash.0" ]; then + echo "Skipping blacklisted certificate $1 ($BLACKLISTDESTDIR/$hash.0)" + return 1 + fi + [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" + [ $NOOP -eq 0 ] && ln -fs "$1" "$CERTDESTDIR/$hash.0" +} + +create_blacklisted() +{ + local hash + + hash=$( do_hash "$1" ) || return + [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to blacklist" + [ $NOOP -eq 0 ] && ln -fs "$1" "$BLACKLISTDESTDIR/$hash.0" +} + +do_scan() +{ + local CFUNC CSEARCH CPATH CFILE + local oldIFS="$IFS" + CFUNC="$1" + CSEARCH="$2" + + IFS=: + set -- $CSEARCH + IFS="$oldIFS" + for CPATH in "$@"; do + [ -d "$CPATH" ] || continue + echo "Scanning $CPATH for certificates..." + cd "$CPATH" + for CFILE in $EXTENSIONS; do + [ -e "$CFILE" ] || continue + [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" + "$CFUNC" "$CPATH/$CFILE" + done + cd - + done +} + +do_list() +{ + local CFILE subject + + if [ -e "$1" ]; then + cd "$1" + for CFILE in *.0; do + if [ ! -s "$CFILE" ]; then + echo "Unable to read $CFILE" >&2 + ERRORS=$(( $ERRORS + 1 )) + continue + fi + subject= + if [ $VERBOSE -eq 0 ]; then + subject=$( openssl x509 -noout -subject -nameopt multiline -in "$CFILE" | + sed -n '/commonName/s/.*= //p' ) + fi + [ "$subject" ] || + subject=$( openssl x509 -noout -subject -in "$CFILE" ) + printf "%s\t%s\n" "$CFILE" "$subject" + done + cd - + fi +} + +cmd_rehash() +{ + + [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" + [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" + [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + + do_scan create_blacklisted "$BLACKLISTPATH" + do_scan create_trusted_link "$TRUSTPATH" +} + +cmd_list() +{ + echo "Listing Trusted Certificates:" + do_list "$CERTDESTDIR" +} + +cmd_blacklist() +{ + local BPATH + + shift # verb + [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + for BFILE in "$@"; do + echo "Adding $BFILE to blacklist" + create_blacklisted "$BFILE" + done +} + +cmd_unblacklist() +{ + local BFILE hash + + shift # verb + for BFILE in "$@"; do + if [ -s "$BFILE" ]; then + hash=$( do_hash "$BFILE" ) + echo "Removing $hash.0 from blacklist" + [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$hash.0" + elif [ -e "$BLACKLISTDESTDIR/$BFILE" ]; then + echo "Removing $BFILE from blacklist" + [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$BFILE" + else + echo "Cannot find $BFILE" >&2 + ERRORS=$(( $ERRORS + 1 )) + fi + done +} + +cmd_blacklisted() +{ + echo "Listing Blacklisted Certificates:" + do_list "$BLACKLISTDESTDIR" +} + +usage() +{ + exec >&2 + echo "Manage the TLS trusted certificates on the system" + echo " $SCRIPTNAME [-v] list" + echo " List trusted certificates" + echo " $SCRIPTNAME [-v] blacklisted" + echo " List blacklisted certificates" + echo " $SCRIPTNAME [-nv] rehash" + echo " Generate hash links for all certificates" + echo " $SCRIPTNAME [-nv] blacklist " + echo " Add to the list of blacklisted certificates" + echo " $SCRIPTNAME [-nv] unblacklist " + echo " Remove from the list of blacklisted certificates" + exit 64 +} + +############################################################ MAIN + +while getopts nv flag; do + case "$flag" in + n) NOOP=1 ;; + v) VERBOSE=$(( $VERBOSE + 1 )) ;; + esac +done +shift $(( $OPTIND - 1 )) + +[ $# -gt 0 ] || usage +case "$1" in +list) cmd_list ;; +rehash) cmd_rehash ;; +blacklist) cmd_blacklist "$@" ;; +unblacklist) cmd_unblacklist "$@" ;; +blacklisted) cmd_blacklisted ;; +*) usage # NOTREACHED +esac + +retval=$? +[ $ERRORS -gt 0 ] && echo "Encountered $ERRORS errors" >&2 +exit $retval + +################################################################################ +# END +################################################################################ From owner-svn-src-all@freebsd.org Wed Oct 2 01:06:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02EC0FD227; Wed, 2 Oct 2019 01:06: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jdJG69vFz4c1G; Wed, 2 Oct 2019 01:06:38 +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 9E10323D86; Wed, 2 Oct 2019 01:06: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 x9216cCF007473; Wed, 2 Oct 2019 01:06:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9216cZK007472; Wed, 2 Oct 2019 01:06:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910020106.x9216cZK007472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 01:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352950 - in head/usr.sbin: etcupdate mergemaster X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin: etcupdate mergemaster X-SVN-Commit-Revision: 352950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 01:06:39 -0000 Author: kevans Date: Wed Oct 2 01:06:37 2019 New Revision: 352950 URL: https://svnweb.freebsd.org/changeset/base/352950 Log: [3/3] etcupdate and mergemaster support for certctl This commit add support for certctl in mergemaster and etcupdate. Both will either rehash or prompt for rehash as new certificates are trusted/blacklisted. This work was done primarily by allanjude@, with minor contributions by myself. No objection from: secteam Differential Revision: https://reviews.freebsd.org/D17389 Modified: head/usr.sbin/etcupdate/etcupdate.sh head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Wed Oct 2 01:05:53 2019 (r352949) +++ head/usr.sbin/etcupdate/etcupdate.sh Wed Oct 2 01:06:37 2019 (r352950) @@ -595,6 +595,13 @@ post_install_file() NEWALIAS_WARN=yes fi ;; + /usr/share/certs/trusted/*) + /usr/share/certs/blacklisted/*) + log "certctl rehash" + if [ -z "$dryrun" ]; then + env DESTDIR=${DESTDIR} certctl rehash >&3 2>&1 + fi + ;; /etc/login.conf) log "cap_mkdb ${DESTDIR}$1" if [ -z "$dryrun" ]; then Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed Oct 2 01:05:53 2019 (r352949) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Oct 2 01:06:37 2019 (r352950) @@ -883,6 +883,10 @@ mm_install () { /etc/mail/aliases) NEED_NEWALIASES=yes ;; + /usr/share/certs/trusted/*) + /usr/share/certs/blacklisted/*) + NEED_CERTCTL=yes + ;; /etc/login.conf) NEED_CAP_MKDB=yes ;; @@ -1351,6 +1355,23 @@ case "${NEED_PWD_MKDB}" in echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'" echo " to rebuild your password files" run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd' + fi + ;; +esac + +case "${NEED_CERTCTL}" in +'') ;; +*) + echo '' + echo "*** You installed files in /etc/ssl/certs, so make sure that you run" + if [ -n "${DESTDIR}" ]; then + echo " 'env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash" + else + echo " '/usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "/usr/sbin/certctl rehash" fi ;; esac From owner-svn-src-all@freebsd.org Wed Oct 2 01:27:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CD0EFD6FE; Wed, 2 Oct 2019 01:27:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jdmk6DhWz4csD; Wed, 2 Oct 2019 01:27:50 +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 B66D124119; Wed, 2 Oct 2019 01:27:50 +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 x921RonE019267; Wed, 2 Oct 2019 01:27:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x921RoFV019266; Wed, 2 Oct 2019 01:27:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910020127.x921RoFV019266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 01:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352951 - head/secure/caroot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/secure/caroot X-SVN-Commit-Revision: 352951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 01:27:51 -0000 Author: kevans Date: Wed Oct 2 01:27:50 2019 New Revision: 352951 URL: https://svnweb.freebsd.org/changeset/base/352951 Log: caroot: add @generated tags to extracted .pem As is the current trend; while these files are manually curated, they are still generated. If they end up in a review, it would be helpful to also take the hint and hide them. Modified: head/secure/caroot/MAca-bundle.pl Modified: head/secure/caroot/MAca-bundle.pl ============================================================================== --- head/secure/caroot/MAca-bundle.pl Wed Oct 2 01:06:37 2019 (r352950) +++ head/secure/caroot/MAca-bundle.pl Wed Oct 2 01:27:50 2019 (r352951) @@ -39,6 +39,7 @@ use MIME::Base64; use Getopt::Long; my $VERSION = '$FreeBSD$'; +my $generated = '@' . 'generated'; my $inputfh = *STDIN; my $debug = 0; my $infile; @@ -78,6 +79,8 @@ sub print_header($$) ## Extracted from nss ## with $VERSION ## +## $generated +## EOFH } else { print $dstfile < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C4F4FDEBD; Wed, 2 Oct 2019 01:42:24 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jf5X1Tl4z4ddk; Wed, 2 Oct 2019 01:42:24 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 7423A61AA; Wed, 2 Oct 2019 01:42:23 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1d.0.190908 Date: Tue, 01 Oct 2019 18:42:14 -0700 Subject: Re: svn commit: r352925 - head/sys/dev/xen/control From: Ravi Pokala To: Roger Pau =?UTF-8?B?TW9ubsOp?= , , , Message-ID: <5E0C7E54-2657-4E70-8A18-84C4EE29D4FA@panasas.com> Thread-Topic: svn commit: r352925 - head/sys/dev/xen/control References: <201910010821.x918LfOg005983@repo.freebsd.org> In-Reply-To: <201910010821.x918LfOg005983@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 01:42:24 -0000 Hi Roger, If I'm understanding this diff correctly, all of (poweroff, reboot, suspend= ) will use the common string "shutdown", rather than an event-specific strin= g. Is that what we want? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Roger Pau Monn=C3=A9 Date: 2019-10-01, Tuesday at 01:21 To: , , Subject: svn commit: r352925 - head/sys/dev/xen/control Author: royger Date: Tue Oct 1 08:21:41 2019 New Revision: 352925 URL: https://svnweb.freebsd.org/changeset/base/352925 =20 Log: xen/ctrl: acknowledge all control requests =20 Currently only suspend requests are acknowledged by writing an empty string back to the xenstore control node, but poweroff or reboot requests are not acknowledged and FreeBSD simply proceeds to perform the desired action. =20 Fix this by acknowledging all requests, and remove the suspend specif= ic ack done in the handler. =20 Sponsored by: Citrix Systems R&D MFC after: 3 days =20 Modified: head/sys/dev/xen/control/control.c =20 Modified: head/sys/dev/xen/control/control.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/xen/control/control.c Tue Oct 1 03:35:54 2019 (r35292= 4) +++ head/sys/dev/xen/control/control.c Tue Oct 1 08:21:41 2019 (r35292= 5) @@ -221,12 +221,6 @@ xctrl_suspend() KASSERT((PCPU_GET(cpuid) =3D=3D 0), ("Not running on CPU#0")); =20 /* - * Clear our XenStore node so the toolstack knows we are - * responding to the suspend request. - */ - xs_write(XST_NIL, "control", "shutdown", ""); - - /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAF= E * drivers need this. */ @@ -368,6 +362,11 @@ xctrl_on_watch_event(struct xs_watch *watch, const= cha &result_len, (void **)&result); if (error !=3D 0) return; + + /* Acknowledge the request by writing back an empty string. */ + error =3D xs_write(XST_NIL, "control", "shutdown", ""); + if (error !=3D 0) + printf("unable to ack shutdown request, proceeding anyway\n"); =20 reason =3D xctrl_shutdown_reasons; last_reason =3D reason + nitems(xctrl_shutdown_reasons); =20 From owner-svn-src-all@freebsd.org Wed Oct 2 01:46:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 836B3FDF9F for ; Wed, 2 Oct 2019 01:46:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jfBK2Gntz4dtw for ; Wed, 2 Oct 2019 01:46:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id p10so13335513qkg.8 for ; Tue, 01 Oct 2019 18:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cb+GP2r9BtigKMl8dgHXqDK1+XcovZV8H5XUQdWq/7M=; b=mCVc//XgD3qXpAs0GZb15kubmGms0q5SMZnBInHublBFOGfm84reloz3pHKyt0Py52 M3/8X3Qy5hDii7Rn40Qf3SF7kcUSaY7I3bPOxD3Le/5Bll8Xa1+dKEboWEwYRErhhVaB U2vM5GyKJbQgEZTciXUq51ItONNcjZmf4PV1SmLAhsmurkbRah2VktS/ToiMJ54ROfP9 6yxbvvKWmBHnBW7xrrEqXr3da37kaH8ZfqRQa9smaL8c6DqqyonPPaBWG7fgqJRJ/zdV LBtSKhyZ/+UCf83BKukfuv0CH08Hpg3nkMkWoW4olgjKlVd/rtevpPe+lmEH7/JtkpKS ny5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cb+GP2r9BtigKMl8dgHXqDK1+XcovZV8H5XUQdWq/7M=; b=mYH1qHdIbyqPzW3uOydet5den3Qyb96wWVMbdPOOL4X2USaKIPMRtwZoK+pYaqAOHo 74HXeNm9idNTmDnD+RMbb8PQQucyc4Qsp7sbYOExkn22J7BeEAvER6CbC0S03W+0qVTD SQWxdQYEdDIgVak1sF4R4udqzfPIPxbeR1rsnXF0RFKTS+oa1VR0fEdMI7YZYrwexoAT Lk37li4ZYZwnn2kYOL4yxdb1DVCIAbjyrDbtaOY0TaViYy9o5OFv96gFh6oaqggqFMNE 7mE0/ycLu3ij/Nkk15Lx63d9xe7B0bMmVmvuSYxY9yIX6fKGIKqkvfVr1IL/ADvESsIi FJgQ== X-Gm-Message-State: APjAAAVhiVrucizuzurNEsezCOfY4Zdj2rzcZ2snCjYZnBgDPDlhLy9h QlcjsBedggLJpiRDAXa6IOsoH+8x3rrkAZ2/1GD0dnRj X-Google-Smtp-Source: APXvYqwunA2If0tru62TsFgk4LJo56Jaskt0WUfrCK+G2c+r2Uwxtg4fYPKFtrhhYE19ZyU1AkIYM43Xj62D+yyE3u4= X-Received: by 2002:a37:6787:: with SMTP id b129mr1406266qkc.60.1569980791500; Tue, 01 Oct 2019 18:46:31 -0700 (PDT) MIME-Version: 1.0 References: <201910012021.x91KLn3h040032@repo.freebsd.org> <20191001223433.a63f00e6209d424d947f75e1@bidouilliste.com> In-Reply-To: <20191001223433.a63f00e6209d424d947f75e1@bidouilliste.com> From: Warner Losh Date: Tue, 1 Oct 2019 19:46:19 -0600 Message-ID: Subject: Re: svn commit: r352940 - head/sys/dev/usb/controller To: Emmanuel Vadot Cc: Ian Lepore , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46jfBK2Gntz4dtw X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=mCVc//Xg; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::735) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.84 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[5.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.84)[ip: (-9.39), ipnet: 2607:f8b0::/32(-2.58), asn: 15169(-2.16), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 01:46:34 -0000 On Tue, Oct 1, 2019, 2:34 PM Emmanuel Vadot wrote: > On Tue, 01 Oct 2019 14:29:58 -0600 > Ian Lepore wrote: > > > On Tue, 2019-10-01 at 20:21 +0000, Emmanuel Vadot wrote: > > > Author: manu > > > Date: Tue Oct 1 20:21:49 2019 > > > New Revision: 352940 > > > URL: https://svnweb.freebsd.org/changeset/base/352940 > > > > > > Log: > > > generic_ohci: Look for the phy based on the id > > > > > > phy-names was never in the bindings schema even if it was present > > > in some DTS. Get the optional phy based on its ID. > > > > > > > The phys= property comes from the generic phys.txt binding, and in > > there, it says that phy-names= is mandatory if phys= is present. There > > used to be a usb_phy= property that didn't have a corresponding names > > property, but I can't even find the binding doc that mentions it > > anymore; it probably got deprecated why the generic phys binding was > > created. > > > > -- Ian > > Huh right, I've missed the phy-bindings.txt document somehow, I'll go > complain on the linux ML then. > They are always eager for examples of breakage. Warner -- > Emmanuel Vadot > From owner-svn-src-all@freebsd.org Wed Oct 2 02:37:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC29AFEE8A; Wed, 2 Oct 2019 02:37:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jgKC4c0Lz3C5J; Wed, 2 Oct 2019 02:37:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63D5A24D61; Wed, 2 Oct 2019 02:37:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x922bZ1u060436; Wed, 2 Oct 2019 02:37:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x922bZb2060434; Wed, 2 Oct 2019 02:37:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910020237.x922bZb2060434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 02:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352952 - in head: sys/kern tests/sys/posixshm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: sys/kern tests/sys/posixshm X-SVN-Commit-Revision: 352952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 02:37:35 -0000 Author: kevans Date: Wed Oct 2 02:37:34 2019 New Revision: 352952 URL: https://svnweb.freebsd.org/changeset/base/352952 Log: shm_open2(2): completely unbreak kern_shm_open2(), since conception, completely fails to pass the mode along to kern_shm_open(). This breaks most uses of it. Add tests alongside this that actually check the mode of the returned files. PR: 240934 [pulseaudio breakage] Reported by: ler, Andrew Gierth [postgres breakage] Diagnosed by: Andrew Gierth (great catch) Tested by: ler, tmunro Pointy hat to: kevans Modified: head/sys/kern/uipc_shm.c head/tests/sys/posixshm/posixshm_test.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Oct 2 01:27:50 2019 (r352951) +++ head/sys/kern/uipc_shm.c Wed Oct 2 02:37:34 2019 (r352952) @@ -1484,7 +1484,7 @@ kern_shm_open2(struct thread *td, const char *path, in initial_seals = F_SEAL_SEAL; if ((shmflags & SHM_ALLOW_SEALING) != 0) initial_seals &= ~F_SEAL_SEAL; - return (kern_shm_open(td, path, flags, 0, NULL, initial_seals)); + return (kern_shm_open(td, path, flags, mode, NULL, initial_seals)); } /* Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Wed Oct 2 01:27:50 2019 (r352951) +++ head/tests/sys/posixshm/posixshm_test.c Wed Oct 2 02:37:34 2019 (r352952) @@ -881,7 +881,41 @@ ATF_TC_BODY(cloexec, tc) close(fd); } +ATF_TC_WITHOUT_HEAD(mode); +ATF_TC_BODY(mode, tc) +{ + struct stat st; + int fd; + mode_t restore_mask; + gen_test_path(); + + /* Remove inhibitions from umask */ + restore_mask = umask(0); + fd = shm_open(test_path, O_CREAT | O_RDWR, 0600); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE((st.st_mode & ACCESSPERMS) == 0600); + close(fd); + ATF_REQUIRE(shm_unlink(test_path) == 0); + + fd = shm_open(test_path, O_CREAT | O_RDWR, 0660); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE((st.st_mode & ACCESSPERMS) == 0660); + close(fd); + ATF_REQUIRE(shm_unlink(test_path) == 0); + + fd = shm_open(test_path, O_CREAT | O_RDWR, 0666); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE((st.st_mode & ACCESSPERMS) == 0666); + close(fd); + ATF_REQUIRE(shm_unlink(test_path) == 0); + + umask(restore_mask); +} + ATF_TP_ADD_TCS(tp) { @@ -914,6 +948,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, unlink_path_too_long); ATF_TP_ADD_TC(tp, object_resize); ATF_TP_ADD_TC(tp, cloexec); + ATF_TP_ADD_TC(tp, mode); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Wed Oct 2 06:15:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18A2B123800; Wed, 2 Oct 2019 06:15:31 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jm8f6fv6z3MLd; Wed, 2 Oct 2019 06:15:30 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C731A27536; Wed, 2 Oct 2019 06:15:30 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x926FU4p091149; Wed, 2 Oct 2019 06:15:30 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x926FUJj091147; Wed, 2 Oct 2019 06:15:30 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201910020615.x926FUJj091147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 2 Oct 2019 06:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352953 - in head/usr.bin: killall split X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: in head/usr.bin: killall split X-SVN-Commit-Revision: 352953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 06:15:31 -0000 Author: kan Date: Wed Oct 2 06:15:30 2019 New Revision: 352953 URL: https://svnweb.freebsd.org/changeset/base/352953 Log: Convert pnmatch to single element array in regexec calls The regexec function is declared as taking an array of regmatch_t elements, and passing in the pointer to singleton element, while correct, triggers a Coverity warning. Convert the singleton into an array of one to silence the warning. Reported by: Coverity Coverity CID: 1009732, 1009733 MFC after: 2 weeks Modified: head/usr.bin/killall/killall.c head/usr.bin/split/split.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 (r352952) +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 (r352953) @@ -98,7 +98,7 @@ main(int ac, char **av) struct stat sb; struct passwd *pw; regex_t rgx; - regmatch_t pmatch; + regmatch_t pmatch[1]; int i, j, ch; char buf[256]; char first; @@ -361,9 +361,9 @@ main(int ac, char **av) } } if (mflag) { - pmatch.rm_so = 0; - pmatch.rm_eo = strlen(thiscmd); - if (regexec(&rgx, thiscmd, 0, &pmatch, + pmatch[0].rm_so = 0; + pmatch[0].rm_eo = strlen(thiscmd); + if (regexec(&rgx, thiscmd, 0, pmatch, REG_STARTEND) != 0) matched = 0; regfree(&rgx); @@ -387,9 +387,9 @@ main(int ac, char **av) } } if (mflag) { - pmatch.rm_so = 0; - pmatch.rm_eo = strlen(thiscmd); - if (regexec(&rgx, thiscmd, 0, &pmatch, + pmatch[0].rm_so = 0; + pmatch[0].rm_eo = strlen(thiscmd); + if (regexec(&rgx, thiscmd, 0, pmatch, REG_STARTEND) == 0) matched = 1; regfree(&rgx); Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) @@ -281,11 +281,11 @@ split2(void) /* Check if we need to start a new file */ if (pflag) { - regmatch_t pmatch; + regmatch_t pmatch[1]; - pmatch.rm_so = 0; - pmatch.rm_eo = len - 1; - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) == 0) + pmatch[0].rm_so = 0; + pmatch[0].rm_eo = len - 1; + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) == 0) newfile(); } else if (lcnt++ == numlines) { newfile(); From owner-svn-src-all@freebsd.org Wed Oct 2 07:02:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40A241246A2; Wed, 2 Oct 2019 07:02:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jnCN0vWLz3PY3; Wed, 2 Oct 2019 07:02:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id z19so54617862ior.0; Wed, 02 Oct 2019 00:02:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Lo9rf17BD6rYIKM8WWgyg/Y5LjfecYFXAmN1Zv/NWLo=; b=hBcJmjxlBGnvo08DdEGtM/Jy5t3koLiL7IV/osyf/x5F5ZoBXCUiwmDxCno5XSfSSg 75YPirYRl5L67YvtUQ3Z8wFAmir2n5RPZBe06dAlJrvvODTWihPstxMeLCgb0vYe6tpR M6nQc8jYJpvUuJsqRl89jk42a6ucRKK59Zx17ms26dt4F+ascTloXACtBZJrPksFkFYq vlgB4zmZ87kHYhqhagm4/LnO0JHN5aO71azRAcK2t04CNVYH5rAMy3OFjAvb5viItF37 RHM5QHEkph25kPFJjRc/ULRFhrHe3S11UAnSE3UBgSyx/SmYsin5dF4ya8UocdjNQOIT olww== X-Gm-Message-State: APjAAAV6QYl7L2OF7ummil0keZ1q5qUOngJK1Rz/iPJbz0ATjxhP7Fj0 eGluOWpXaGZrX1PSRR8O1WoBKwml X-Google-Smtp-Source: APXvYqxQIqyrRXlq71ZN4i+caYHWqoDQdKLH7zHxdpQ7/WrtohFJne+z/+o/JGMcyp5yA1XoImk7bA== X-Received: by 2002:a5d:9903:: with SMTP id x3mr2103529iol.28.1569999774492; Wed, 02 Oct 2019 00:02:54 -0700 (PDT) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com. [209.85.166.47]) by smtp.gmail.com with ESMTPSA id k5sm8632899ilg.17.2019.10.02.00.02.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Oct 2019 00:02:54 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id a1so54530035ioc.6; Wed, 02 Oct 2019 00:02:53 -0700 (PDT) X-Received: by 2002:a92:aa48:: with SMTP id j69mr2410124ili.231.1569999773575; Wed, 02 Oct 2019 00:02:53 -0700 (PDT) MIME-Version: 1.0 References: <201910020615.x926FUJj091147@repo.freebsd.org> In-Reply-To: <201910020615.x926FUJj091147@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 2 Oct 2019 00:02:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352953 - in head/usr.bin: killall split To: Alexander Kabaev Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46jnCN0vWLz3PY3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 07:02:56 -0000 Hi Alexander, Coverity has millions of spurious warnings of this class and they're basically all false positives. I think we should instead try to figure out how to disable this class of warning on our codebase, since it is largely incorrect. I would encourage reverting this change, because it uglies up the code for no functional benefit. The code was correct before the change; only Coverity was wrong. Best, Conrad On Tue, Oct 1, 2019 at 11:15 PM Alexander Kabaev wrote: > > Author: kan > Date: Wed Oct 2 06:15:30 2019 > New Revision: 352953 > URL: https://svnweb.freebsd.org/changeset/base/352953 > > Log: > Convert pnmatch to single element array in regexec calls > > The regexec function is declared as taking an array of regmatch_t > elements, and passing in the pointer to singleton element, while > correct, triggers a Coverity warning. Convert the singleton into > an array of one to silence the warning. > > Reported by: Coverity > Coverity CID: 1009732, 1009733 > MFC after: 2 weeks > > Modified: > head/usr.bin/killall/killall.c > head/usr.bin/split/split.c > > Modified: head/usr.bin/killall/killall.c > ============================================================================== > --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 (r352952) > +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 (r352953) > @@ -98,7 +98,7 @@ main(int ac, char **av) > struct stat sb; > struct passwd *pw; > regex_t rgx; > - regmatch_t pmatch; > + regmatch_t pmatch[1]; > int i, j, ch; > char buf[256]; > char first; > @@ -361,9 +361,9 @@ main(int ac, char **av) > } > } > if (mflag) { > - pmatch.rm_so = 0; > - pmatch.rm_eo = strlen(thiscmd); > - if (regexec(&rgx, thiscmd, 0, &pmatch, > + pmatch[0].rm_so = 0; > + pmatch[0].rm_eo = strlen(thiscmd); > + if (regexec(&rgx, thiscmd, 0, pmatch, > REG_STARTEND) != 0) > matched = 0; > regfree(&rgx); > @@ -387,9 +387,9 @@ main(int ac, char **av) > } > } > if (mflag) { > - pmatch.rm_so = 0; > - pmatch.rm_eo = strlen(thiscmd); > - if (regexec(&rgx, thiscmd, 0, &pmatch, > + pmatch[0].rm_so = 0; > + pmatch[0].rm_eo = strlen(thiscmd); > + if (regexec(&rgx, thiscmd, 0, pmatch, > REG_STARTEND) == 0) > matched = 1; > regfree(&rgx); > > Modified: head/usr.bin/split/split.c > ============================================================================== > --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) > +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) > @@ -281,11 +281,11 @@ split2(void) > > /* Check if we need to start a new file */ > if (pflag) { > - regmatch_t pmatch; > + regmatch_t pmatch[1]; > > - pmatch.rm_so = 0; > - pmatch.rm_eo = len - 1; > - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) == 0) > + pmatch[0].rm_so = 0; > + pmatch[0].rm_eo = len - 1; > + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) == 0) > newfile(); > } else if (lcnt++ == numlines) { > newfile(); From owner-svn-src-all@freebsd.org Wed Oct 2 07:53:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8F01256DD; Wed, 2 Oct 2019 07:53:07 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jpKH5dMWz3yFs; Wed, 2 Oct 2019 07:53:07 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from localhost (unknown [212.230.157.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: royger) by smtp.freebsd.org (Postfix) with ESMTPSA id 3E7418BF9; Wed, 2 Oct 2019 07:53:07 +0000 (UTC) (envelope-from royger@FreeBSD.org) Date: Wed, 2 Oct 2019 09:53:02 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352925 - head/sys/dev/xen/control Message-ID: <20191002075302.caak27hnk5vlpqgr@Air-de-Roger> References: <201910010821.x918LfOg005983@repo.freebsd.org> <5E0C7E54-2657-4E70-8A18-84C4EE29D4FA@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5E0C7E54-2657-4E70-8A18-84C4EE29D4FA@panasas.com> User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 07:53:07 -0000 On Tue, Oct 01, 2019 at 06:42:14PM -0700, Ravi Pokala wrote: > Hi Roger, > > If I'm understanding this diff correctly, all of (poweroff, reboot, suspend) will use the common string "shutdown", rather than an event-specific string. Is that what we want? I think there's some misunderstanding here. All power control events use the same xenstore node (~/control/shutdown), but the command read from it is different depending on the requested action (poweroff, reboot, halt...). See [0] for a slightly more detailed description of the xenstore node. Note that this commit doesn't change any of this logic, it just clears the contents of ~/control/shutdown (by writing "") so the toolstack knows FreeBSD has acknowledged the request and it's processing it. Roger. [0] http://xenbits.xen.org/docs/4.12-testing/misc/xenstore-paths.html#platform-feature-and-control-paths From owner-svn-src-all@freebsd.org Wed Oct 2 09:03:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D0C6127C8F; Wed, 2 Oct 2019 09:03:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jqts2FWgz43Hj; Wed, 2 Oct 2019 09:03:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20CBC29376; Wed, 2 Oct 2019 09:03:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9293nRS092276; Wed, 2 Oct 2019 09:03:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9293mHM092273; Wed, 2 Oct 2019 09:03:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020903.x9293mHM092273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352954 - head/sys/contrib/rdma/krping X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/contrib/rdma/krping X-SVN-Commit-Revision: 352954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:03:49 -0000 Author: hselasky Date: Wed Oct 2 09:03:48 2019 New Revision: 352954 URL: https://svnweb.freebsd.org/changeset/base/352954 Log: Notify all sleeping threads of device removal in krping. Implement d_purge for krping_cdevsw. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c head/sys/contrib/rdma/krping/krping.h head/sys/contrib/rdma/krping/krping_dev.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Wed Oct 2 06:15:30 2019 (r352953) +++ head/sys/contrib/rdma/krping/krping.c Wed Oct 2 09:03:48 2019 (r352954) @@ -2189,3 +2189,17 @@ krping_walk_cb_list(void (*f)(struct krping_stats *, v (*f)(cb->pd ? &cb->stats : NULL, arg); mutex_unlock(&krping_mutex); } + +void +krping_cancel_all(void) +{ + struct krping_cb *cb; + + mutex_lock(&krping_mutex); + list_for_each_entry(cb, &krping_cbs, list) { + cb->state = ERROR; + wake_up_interruptible(&cb->sem); + } + mutex_unlock(&krping_mutex); +} + Modified: head/sys/contrib/rdma/krping/krping.h ============================================================================== --- head/sys/contrib/rdma/krping/krping.h Wed Oct 2 06:15:30 2019 (r352953) +++ head/sys/contrib/rdma/krping/krping.h Wed Oct 2 09:03:48 2019 (r352954) @@ -17,3 +17,4 @@ struct krping_stats { int krping_doit(char *); void krping_walk_cb_list(void (*)(struct krping_stats *, void *), void *); int krping_sigpending(void); +void krping_cancel_all(void); Modified: head/sys/contrib/rdma/krping/krping_dev.c ============================================================================== --- head/sys/contrib/rdma/krping/krping_dev.c Wed Oct 2 06:15:30 2019 (r352953) +++ head/sys/contrib/rdma/krping/krping_dev.c Wed Oct 2 09:03:48 2019 (r352954) @@ -40,6 +40,7 @@ static d_open_t krping_open; static d_close_t krping_close; static d_read_t krping_read; static d_write_t krping_write; +static d_purge_t krping_purge; /* Character device entry points */ static struct cdevsw krping_cdevsw = { @@ -48,6 +49,7 @@ static struct cdevsw krping_cdevsw = { .d_close = krping_close, .d_read = krping_read, .d_write = krping_write, + .d_purge = krping_purge, .d_name = "krping", }; @@ -208,6 +210,13 @@ krping_write(struct cdev *dev, struct uio *uio, int io done: free(krpingmsg, M_DEVBUF); return(err); +} + +static void +krping_purge(struct cdev *dev __unused) +{ + + krping_cancel_all(); } int From owner-svn-src-all@freebsd.org Wed Oct 2 09:06:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1170F127D83; Wed, 2 Oct 2019 09:06:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jqxf6j2Dz43RY; Wed, 2 Oct 2019 09:06:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABFEC29377; Wed, 2 Oct 2019 09:06:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9296EHE092451; Wed, 2 Oct 2019 09:06:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9296Dr0092447; Wed, 2 Oct 2019 09:06:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020906.x9296Dr0092447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352955 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 352955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:06:15 -0000 Author: hselasky Date: Wed Oct 2 09:06:13 2019 New Revision: 352955 URL: https://svnweb.freebsd.org/changeset/base/352955 Log: Make sure the transmit loop doesn't get starved in ipoib. When the software send queue gets filled up, callbacks to if_transmit will stop. Make sure the transmit callback routine checks the send queue and outputs any remaining mbufs. Else the remaining mbufs may simply sit in the output queue blocking the transmit path. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed Oct 2 09:03:48 2019 (r352954) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed Oct 2 09:06:13 2019 (r352955) @@ -536,7 +536,7 @@ void ipoib_drain_cq(struct ipoib_dev_priv *priv); int ipoib_dma_map_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req, int max); void ipoib_dma_unmap_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req); -int ipoib_poll_tx(struct ipoib_dev_priv *priv); +int ipoib_poll_tx(struct ipoib_dev_priv *priv, bool do_start); void ipoib_dma_unmap_rx(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req); void ipoib_dma_mb(struct ipoib_dev_priv *priv, struct mbuf *mb, unsigned int length); @@ -763,5 +763,7 @@ extern int ipoib_debug_level; #endif /* CONFIG_INFINIBAND_IPOIB_DEBUG_DATA */ #define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff) + +void ipoib_start_locked(struct ifnet *, struct ipoib_dev_priv *); #endif /* _IPOIB_H */ Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Wed Oct 2 09:03:48 2019 (r352954) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Wed Oct 2 09:06:13 2019 (r352955) @@ -618,8 +618,10 @@ void ipoib_cm_send(struct ipoib_dev_priv *priv, struct struct ipoib_cm_tx_buf *tx_req; struct ifnet *dev = priv->dev; - if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) - while (ipoib_poll_tx(priv)); /* nothing */ + if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) { + while (ipoib_poll_tx(priv, false)) + ; /* nothing */ + } m_adj(mb, sizeof(struct ipoib_pseudoheader)); if (unlikely(mb->m_pkthdr.len > tx->mtu)) { Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Wed Oct 2 09:03:48 2019 (r352954) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Wed Oct 2 09:06:13 2019 (r352955) @@ -366,7 +366,7 @@ static void ipoib_ib_handle_tx_wc(struct ipoib_dev_pri } int -ipoib_poll_tx(struct ipoib_dev_priv *priv) +ipoib_poll_tx(struct ipoib_dev_priv *priv, bool do_start) { int n, i; @@ -379,6 +379,9 @@ ipoib_poll_tx(struct ipoib_dev_priv *priv) ipoib_ib_handle_tx_wc(priv, wc); } + if (do_start && n != 0) + ipoib_start_locked(priv->dev, priv); + return n == MAX_SEND_CQE; } @@ -425,7 +428,7 @@ static void drain_tx_cq(struct ipoib_dev_priv *priv) struct ifnet *dev = priv->dev; spin_lock(&priv->lock); - while (ipoib_poll_tx(priv)) + while (ipoib_poll_tx(priv, true)) ; /* nothing */ if (dev->if_drv_flags & IFF_DRV_OACTIVE) @@ -482,7 +485,7 @@ ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *m void *phead; if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) - while (ipoib_poll_tx(priv)) + while (ipoib_poll_tx(priv, false)) ; /* nothing */ m_adj(mb, sizeof (struct ipoib_pseudoheader)); @@ -762,7 +765,7 @@ void ipoib_drain_cq(struct ipoib_dev_priv *priv) spin_unlock(&priv->drain_lock); spin_lock(&priv->lock); - while (ipoib_poll_tx(priv)) + while (ipoib_poll_tx(priv, true)) ; /* nothing */ spin_unlock(&priv->lock); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Wed Oct 2 09:03:48 2019 (r352954) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Wed Oct 2 09:06:13 2019 (r352955) @@ -773,17 +773,13 @@ ipoib_send_one(struct ipoib_dev_priv *priv, struct mbu return 0; } - -static void -_ipoib_start(struct ifnet *dev, struct ipoib_dev_priv *priv) +void +ipoib_start_locked(struct ifnet *dev, struct ipoib_dev_priv *priv) { struct mbuf *mb; - if ((dev->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) - return; + assert_spin_locked(&priv->lock); - spin_lock(&priv->lock); while (!IFQ_DRV_IS_EMPTY(&dev->if_snd) && (dev->if_drv_flags & IFF_DRV_OACTIVE) == 0) { IFQ_DRV_DEQUEUE(&dev->if_snd, mb); @@ -792,6 +788,18 @@ _ipoib_start(struct ifnet *dev, struct ipoib_dev_priv IPOIB_MTAP(dev, mb); ipoib_send_one(priv, mb); } +} + +static void +_ipoib_start(struct ifnet *dev, struct ipoib_dev_priv *priv) +{ + + if ((dev->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return; + + spin_lock(&priv->lock); + ipoib_start_locked(dev, priv); spin_unlock(&priv->lock); } From owner-svn-src-all@freebsd.org Wed Oct 2 09:09:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 566D2127EEC; Wed, 2 Oct 2019 09:09:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr1P1b27z43dp; Wed, 2 Oct 2019 09:09:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19C722937D; Wed, 2 Oct 2019 09:09:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9299S5P092638; Wed, 2 Oct 2019 09:09:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9299SHf092637; Wed, 2 Oct 2019 09:09:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020909.x9299SHf092637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352956 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 352956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:09:29 -0000 Author: hselasky Date: Wed Oct 2 09:09:28 2019 New Revision: 352956 URL: https://svnweb.freebsd.org/changeset/base/352956 Log: Fix reported max SGE calculation in mlx5ib. Add the 512 bytes limit of RDMA READ and the size of remote address to the max SGE calculation. Submitted by: slavash@ Linux commit: 288c01b746aa MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Oct 2 09:06:13 2019 (r352955) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Oct 2 09:09:28 2019 (r352956) @@ -636,6 +636,7 @@ static int mlx5_ib_query_device(struct ib_device *ibde struct mlx5_ib_dev *dev = to_mdev(ibdev); struct mlx5_core_dev *mdev = dev->mdev; int err = -ENOMEM; + int max_sq_desc; int max_rq_sg; int max_sq_sg; u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz); @@ -758,9 +759,10 @@ static int mlx5_ib_query_device(struct ib_device *ibde props->max_qp_wr = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz); max_rq_sg = MLX5_CAP_GEN(mdev, max_wqe_sz_rq) / sizeof(struct mlx5_wqe_data_seg); - max_sq_sg = (MLX5_CAP_GEN(mdev, max_wqe_sz_sq) - - sizeof(struct mlx5_wqe_ctrl_seg)) / - sizeof(struct mlx5_wqe_data_seg); + max_sq_desc = min_t(int, MLX5_CAP_GEN(mdev, max_wqe_sz_sq), 512); + max_sq_sg = (max_sq_desc - sizeof(struct mlx5_wqe_ctrl_seg) - + sizeof(struct mlx5_wqe_raddr_seg)) / + sizeof(struct mlx5_wqe_data_seg); props->max_sge = min(max_rq_sg, max_sq_sg); props->max_sge_rd = MLX5_MAX_SGE_RD; props->max_cq = 1 << MLX5_CAP_GEN(mdev, log_max_cq); Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Wed Oct 2 09:06:13 2019 (r352955) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Wed Oct 2 09:09:28 2019 (r352956) @@ -346,6 +346,29 @@ static int calc_send_wqe(struct ib_qp_init_attr *attr) return ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB); } +static int get_send_sge(struct ib_qp_init_attr *attr, int wqe_size) +{ + int max_sge; + + if (attr->qp_type == IB_QPT_RC) + max_sge = (min_t(int, wqe_size, 512) - + sizeof(struct mlx5_wqe_ctrl_seg) - + sizeof(struct mlx5_wqe_raddr_seg)) / + sizeof(struct mlx5_wqe_data_seg); + else if (attr->qp_type == IB_QPT_XRC_INI) + max_sge = (min_t(int, wqe_size, 512) - + sizeof(struct mlx5_wqe_ctrl_seg) - + sizeof(struct mlx5_wqe_xrc_seg) - + sizeof(struct mlx5_wqe_raddr_seg)) / + sizeof(struct mlx5_wqe_data_seg); + else + max_sge = (wqe_size - sq_overhead(attr)) / + sizeof(struct mlx5_wqe_data_seg); + + return min_t(int, max_sge, wqe_size - sq_overhead(attr) / + sizeof(struct mlx5_wqe_data_seg)); +} + static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, struct mlx5_ib_qp *qp) { @@ -382,7 +405,11 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struc return -ENOMEM; } qp->sq.wqe_shift = ilog2(MLX5_SEND_WQE_BB); - qp->sq.max_gs = attr->cap.max_send_sge; + qp->sq.max_gs = get_send_sge(attr, wqe_size); + if (qp->sq.max_gs < attr->cap.max_send_sge) + return -ENOMEM; + + attr->cap.max_send_sge = qp->sq.max_gs; qp->sq.max_post = wq_size / wqe_size; attr->cap.max_send_wr = qp->sq.max_post; From owner-svn-src-all@freebsd.org Wed Oct 2 09:11:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 462921280DA; Wed, 2 Oct 2019 09:11:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr3B1918z43vf; Wed, 2 Oct 2019 09:11:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C518293AC; Wed, 2 Oct 2019 09:11:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929B1tr093733; Wed, 2 Oct 2019 09:11:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929B1kY093732; Wed, 2 Oct 2019 09:11:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020911.x929B1kY093732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352957 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 352957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:11:02 -0000 Author: hselasky Date: Wed Oct 2 09:11:01 2019 New Revision: 352957 URL: https://svnweb.freebsd.org/changeset/base/352957 Log: Update warning and error print formats in mlx5ib. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Wed Oct 2 09:09:28 2019 (r352956) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Wed Oct 2 09:11:01 2019 (r352957) @@ -46,11 +46,11 @@ pr_debug("%s:%s:%d:(pid %d): " format, (dev)->ib_dev.n __LINE__, current->pid, ##arg) #define mlx5_ib_err(dev, format, arg...) \ -pr_err("%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ +pr_err("%s: ERR: %s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ __LINE__, current->pid, ##arg) #define mlx5_ib_warn(dev, format, arg...) \ -pr_warn("%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ +pr_warn("%s: WARN: %s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ __LINE__, current->pid, ##arg) #define field_avail(type, fld, sz) (offsetof(type, fld) + \ From owner-svn-src-all@freebsd.org Wed Oct 2 09:12:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 365E61281FB; Wed, 2 Oct 2019 09:12:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr5L0dkJz44Bm; Wed, 2 Oct 2019 09:12:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE45E29539; Wed, 2 Oct 2019 09:12:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929CrBQ098349; Wed, 2 Oct 2019 09:12:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929CrR6098348; Wed, 2 Oct 2019 09:12:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020912.x929CrR6098348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352958 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:12:54 -0000 Author: hselasky Date: Wed Oct 2 09:12:53 2019 New Revision: 352958 URL: https://svnweb.freebsd.org/changeset/base/352958 Log: Make sure the number of IRQ vectors doesn't exceed 256 in mlx5core. The "intr" field in "struct mlx5_ifc_eqc_bits" is only 8 bits wide. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:11:01 2019 (r352957) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:12:53 2019 (r352958) @@ -275,7 +275,10 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev) else nvec += MLX5_CAP_GEN(dev, num_ports) * num_online_cpus(); - nvec = min_t(int, nvec, num_eqs); + if (nvec > num_eqs) + nvec = num_eqs; + if (nvec > 256) + nvec = 256; /* limit of firmware API */ if (nvec <= MLX5_EQ_VEC_COMP_BASE) return -ENOMEM; From owner-svn-src-all@freebsd.org Wed Oct 2 09:14:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90E7F1282B8; Wed, 2 Oct 2019 09:14:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr6f3HQdz44Kg; Wed, 2 Oct 2019 09:14:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 541382953A; Wed, 2 Oct 2019 09:14:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929E2xX098458; Wed, 2 Oct 2019 09:14:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929E2vN098457; Wed, 2 Oct 2019 09:14:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020914.x929E2vN098457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352959 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:14:02 -0000 Author: hselasky Date: Wed Oct 2 09:14:01 2019 New Revision: 352959 URL: https://svnweb.freebsd.org/changeset/base/352959 Log: Check return value of mlx5_vector2eqn() function in mlx5en. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:12:53 2019 (r352958) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:14:01 2019 (r352959) @@ -1914,12 +1914,14 @@ mlx5e_create_cq(struct mlx5e_priv *priv, param->wq.buf_numa_node = 0; param->wq.db_numa_node = 0; + err = mlx5_vector2eqn(mdev, eq_ix, &eqn_not_used, &irqn); + if (err) + return (err); + err = mlx5_cqwq_create(mdev, ¶m->wq, param->cqc, &cq->wq, &cq->wq_ctrl); if (err) return (err); - - mlx5_vector2eqn(mdev, eq_ix, &eqn_not_used, &irqn); mcq->cqe_sz = 64; mcq->set_ci_db = cq->wq_ctrl.db.db; From owner-svn-src-all@freebsd.org Wed Oct 2 09:15:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C795D128340; Wed, 2 Oct 2019 09:15:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr7v4ZMyz44St; Wed, 2 Oct 2019 09:15:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 813442953B; Wed, 2 Oct 2019 09:15:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929F7ec098559; Wed, 2 Oct 2019 09:15:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929F7ON098558; Wed, 2 Oct 2019 09:15:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020915.x929F7ON098558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352960 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:15:07 -0000 Author: hselasky Date: Wed Oct 2 09:15:07 2019 New Revision: 352960 URL: https://svnweb.freebsd.org/changeset/base/352960 Log: Fix for missing cleanup code in error case in mlx5en. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:14:01 2019 (r352959) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:15:07 2019 (r352960) @@ -1133,13 +1133,13 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st err = mlx5_fpga_device_start(dev); if (err) { dev_err(&pdev->dev, "fpga device start failed %d\n", err); - goto err_fpga_start; + goto err_fs; } err = mlx5_register_device(dev); if (err) { dev_err(&pdev->dev, "mlx5_register_device failed %d\n", err); - goto err_fs; + goto err_fpga; } set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); @@ -1148,7 +1148,9 @@ out: mutex_unlock(&dev->intf_state_mutex); return 0; -err_fpga_start: +err_fpga: + mlx5_fpga_device_stop(dev); + err_fs: mlx5_cleanup_fs(dev); From owner-svn-src-all@freebsd.org Wed Oct 2 09:16:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D75641283CA; Wed, 2 Oct 2019 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jr9G5Kwdz44cj; Wed, 2 Oct 2019 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A5252953E; Wed, 2 Oct 2019 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929GIkt098669; Wed, 2 Oct 2019 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929GIXM098667; Wed, 2 Oct 2019 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020916.x929GIXM098667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352961 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:16:18 -0000 Author: hselasky Date: Wed Oct 2 09:16:17 2019 New Revision: 352961 URL: https://svnweb.freebsd.org/changeset/base/352961 Log: Implement macro for asserting priv lock in mlx5en. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:15:07 2019 (r352960) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:16:17 2019 (r352961) @@ -988,6 +988,7 @@ struct mlx5e_priv { #define PRIV_LOCK(priv) sx_xlock(&(priv)->state_lock) #define PRIV_UNLOCK(priv) sx_xunlock(&(priv)->state_lock) #define PRIV_LOCKED(priv) sx_xlocked(&(priv)->state_lock) +#define PRIV_ASSERT_LOCKED(priv) sx_assert(&(priv)->state_lock, SA_XLOCKED) struct sx state_lock; /* Protects Interface state */ struct mlx5_uar cq_uar; u32 pdn; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:15:07 2019 (r352960) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:16:17 2019 (r352961) @@ -772,6 +772,8 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *priv) struct ifaddr *ifa; struct ifmultiaddr *ifma; + PRIV_ASSERT_LOCKED(priv); + /* XXX adding this entry might not be needed */ mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc, LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr))); From owner-svn-src-all@freebsd.org Wed Oct 2 09:22:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F9B112883C; Wed, 2 Oct 2019 09:22:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrJJ3z9Cz4533; Wed, 2 Oct 2019 09:22:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5394C296EA; Wed, 2 Oct 2019 09:22:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929MObX001962; Wed, 2 Oct 2019 09:22:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929MMwB001955; Wed, 2 Oct 2019 09:22:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020922.x929MMwB001955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352962 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 352962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:22:24 -0000 Author: hselasky Date: Wed Oct 2 09:22:22 2019 New Revision: 352962 URL: https://svnweb.freebsd.org/changeset/base/352962 Log: Add support for Multi-Physical Function Switch, MPFS, in mlx5en. MPFS is a logical switch in the Mellanox device which forward packets based on a hardware driven L2 address table, to one or more physical- or virtual- functions. The physical- or virtual- function is required to tell the MPFS by using the MPFS firmware commands, which unicast MAC addresses it is requesting from the physical port's traffic. Broadcast and multicast traffic however, is copied to all listening physical- and virtual- functions and does not need a rule in the MPFS switching table. Linux commit: eeb66cdb682678bfd1f02a4547e3649b38ffea7e MFC after: 3 days Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c (contents, props changed) head/sys/dev/mlx5/mpfs.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/modules/mlx5/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 2 09:16:17 2019 (r352961) +++ head/sys/conf/files Wed Oct 2 09:22:22 2019 (r352962) @@ -4727,6 +4727,8 @@ dev/mlx5/mlx5_core/mlx5_main.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mcg.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_mpfs.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mr.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_pagealloc.c optional mlx5 pci \ Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:16:17 2019 (r352961) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:22:22 2019 (r352962) @@ -717,6 +717,12 @@ struct mlx5_core_dev { struct mlx5_rsvd_gids reserved_gids; atomic_t roce_en; } roce; + + struct { + spinlock_t spinlock; +#define MLX5_MPFS_TABLE_MAX 32 + long bitmap[BITS_TO_LONGS(MLX5_MPFS_TABLE_MAX)]; + } mpfs; #ifdef CONFIG_MLX5_FPGA struct mlx5_fpga_device *fpga; #endif Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:16:17 2019 (r352961) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:22:22 2019 (r352962) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -1130,10 +1131,16 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st goto err_free_comp_eqs; } + err = mlx5_mpfs_init(dev); + if (err) { + mlx5_core_err(dev, "mpfs init failed %d\n", err); + goto err_fs; + } + err = mlx5_fpga_device_start(dev); if (err) { dev_err(&pdev->dev, "fpga device start failed %d\n", err); - goto err_fs; + goto err_mpfs; } err = mlx5_register_device(dev); @@ -1151,6 +1158,9 @@ out: err_fpga: mlx5_fpga_device_stop(dev); +err_mpfs: + mlx5_mpfs_destroy(dev); + err_fs: mlx5_cleanup_fs(dev); @@ -1216,6 +1226,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, mlx5_unregister_device(dev); mlx5_fpga_device_stop(dev); + mlx5_mpfs_destroy(dev); mlx5_cleanup_fs(dev); unmap_bf_area(dev); mlx5_wait_for_reclaim_vfs_pages(dev); Added: head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c Wed Oct 2 09:22:22 2019 (r352962) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2019, Mellanox Technologies, Ltd. 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 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 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 +#include +#include +#include + +#define MPFS_LOCK(dev) spin_lock(&(dev)->mpfs.spinlock) +#define MPFS_UNLOCK(dev) spin_unlock(&(dev)->mpfs.spinlock) + +int +mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u32 *p_index, const u8 *mac) +{ + const u32 l2table_size = MIN(1U << MLX5_CAP_GEN(dev, log_max_l2_table), + MLX5_MPFS_TABLE_MAX); + u32 in[MLX5_ST_SZ_DW(set_l2_table_entry_in)] = {}; + u32 out[MLX5_ST_SZ_DW(set_l2_table_entry_out)] = {}; + u8 *in_mac_addr; + u32 index; + int err; + + if (!MLX5_CAP_GEN(dev, eswitch_flow_table)) { + *p_index = 0; + return (0); + } + + MPFS_LOCK(dev); + index = find_first_zero_bit(dev->mpfs.bitmap, l2table_size); + if (index < l2table_size) + set_bit(index, dev->mpfs.bitmap); + MPFS_UNLOCK(dev); + + if (index >= l2table_size) + return (-ENOMEM); + + MLX5_SET(set_l2_table_entry_in, in, opcode, MLX5_CMD_OP_SET_L2_TABLE_ENTRY); + MLX5_SET(set_l2_table_entry_in, in, table_index, index); + + in_mac_addr = MLX5_ADDR_OF(set_l2_table_entry_in, in, mac_address); + ether_addr_copy(&in_mac_addr[2], mac); + + err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); + if (err != 0) { + MPFS_LOCK(dev); + clear_bit(index, dev->mpfs.bitmap); + MPFS_UNLOCK(dev); + } else { + *p_index = index; + } + return (err); +} + +int +mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u32 index) +{ + u32 in[MLX5_ST_SZ_DW(delete_l2_table_entry_in)] = {}; + u32 out[MLX5_ST_SZ_DW(delete_l2_table_entry_out)] = {}; + int err; + + if (!MLX5_CAP_GEN(dev, eswitch_flow_table)) { + if (index != 0) + return (-EINVAL); + return (0); + } + + MLX5_SET(delete_l2_table_entry_in, in, opcode, MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY); + MLX5_SET(delete_l2_table_entry_in, in, table_index, index); + + err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); + if (err == 0) { + MPFS_LOCK(dev); + clear_bit(index, dev->mpfs.bitmap); + MPFS_UNLOCK(dev); + } + return (err); +} + +int +mlx5_mpfs_init(struct mlx5_core_dev *dev) +{ + + spin_lock_init(&dev->mpfs.spinlock); + bitmap_zero(dev->mpfs.bitmap, MLX5_MPFS_TABLE_MAX); + return (0); +} + +void +mlx5_mpfs_destroy(struct mlx5_core_dev *dev) +{ + u32 num; + + num = bitmap_weight(dev->mpfs.bitmap, MLX5_MPFS_TABLE_MAX); + if (num != 0) + dev_err(&dev->pdev->dev, "Leaking %u MPFS MAC table entries\n", num); + + spin_lock_destroy(&dev->mpfs.spinlock); +} Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:16:17 2019 (r352961) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:22:22 2019 (r352962) @@ -29,6 +29,7 @@ #include #include +#include #define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v) @@ -54,6 +55,7 @@ enum { struct mlx5e_eth_addr_hash_node { LIST_ENTRY(mlx5e_eth_addr_hash_node) hlist; u8 action; + u32 mpfs_index; struct mlx5e_eth_addr_info ai; }; @@ -63,29 +65,23 @@ mlx5e_hash_eth_addr(const u8 * addr) return (addr[5]); } -static void +static bool mlx5e_add_eth_addr_to_hash(struct mlx5e_eth_addr_hash_head *hash, - const u8 * addr) + struct mlx5e_eth_addr_hash_node *hn_new) { struct mlx5e_eth_addr_hash_node *hn; - int ix = mlx5e_hash_eth_addr(addr); + u32 ix = mlx5e_hash_eth_addr(hn_new->ai.addr); LIST_FOREACH(hn, &hash[ix], hlist) { - if (bcmp(hn->ai.addr, addr, ETHER_ADDR_LEN) == 0) { + if (bcmp(hn->ai.addr, hn_new->ai.addr, ETHER_ADDR_LEN) == 0) { if (hn->action == MLX5E_ACTION_DEL) hn->action = MLX5E_ACTION_NONE; - return; + free(hn_new, M_MLX5EN); + return (false); } } - - hn = malloc(sizeof(*hn), M_MLX5EN, M_NOWAIT | M_ZERO); - if (hn == NULL) - return; - - ether_addr_copy(hn->ai.addr, addr); - hn->action = MLX5E_ACTION_ADD; - - LIST_INSERT_HEAD(&hash[ix], hn, hlist); + LIST_INSERT_HEAD(&hash[ix], hn_new, hlist); + return (true); } static void @@ -757,6 +753,8 @@ mlx5e_execute_action(struct mlx5e_priv *priv, case MLX5E_ACTION_DEL: mlx5e_del_eth_addr_from_flow_table(priv, &hn->ai); + if (hn->mpfs_index != -1U) + mlx5_mpfs_del_mac(priv->mdev, hn->mpfs_index); mlx5e_del_eth_addr_from_hash(hn); break; @@ -765,36 +763,139 @@ mlx5e_execute_action(struct mlx5e_priv *priv, } } +static struct mlx5e_eth_addr_hash_node * +mlx5e_move_hn(struct mlx5e_eth_addr_hash_head *fh, struct mlx5e_eth_addr_hash_head *uh) +{ + struct mlx5e_eth_addr_hash_node *hn; + + hn = LIST_FIRST(fh); + if (hn != NULL) { + LIST_REMOVE(hn, hlist); + LIST_INSERT_HEAD(uh, hn, hlist); + } + return (hn); +} + +static struct mlx5e_eth_addr_hash_node * +mlx5e_remove_hn(struct mlx5e_eth_addr_hash_head *fh) +{ + struct mlx5e_eth_addr_hash_node *hn; + + hn = LIST_FIRST(fh); + if (hn != NULL) + LIST_REMOVE(hn, hlist); + return (hn); +} + static void mlx5e_sync_ifp_addr(struct mlx5e_priv *priv) { + struct mlx5e_eth_addr_hash_head head_free; + struct mlx5e_eth_addr_hash_head head_uc; + struct mlx5e_eth_addr_hash_head head_mc; + struct mlx5e_eth_addr_hash_node *hn; struct ifnet *ifp = priv->ifp; struct ifaddr *ifa; struct ifmultiaddr *ifma; + bool success = false; + size_t x; + size_t num; PRIV_ASSERT_LOCKED(priv); - /* XXX adding this entry might not be needed */ - mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc, + LIST_INIT(&head_free); + LIST_INIT(&head_uc); + LIST_INIT(&head_mc); +retry: + num = 1; + + if_addr_rlock(ifp); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + num++; + } + if_addr_runlock(ifp); + + if_maddr_rlock(ifp); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + num++; + } + if_maddr_runlock(ifp); + + /* allocate place holders */ + for (x = 0; x != num; x++) { + hn = malloc(sizeof(*hn), M_MLX5EN, M_WAITOK | M_ZERO); + hn->action = MLX5E_ACTION_ADD; + hn->mpfs_index = -1U; + LIST_INSERT_HEAD(&head_free, hn, hlist); + } + + hn = mlx5e_move_hn(&head_free, &head_uc); + if (hn == NULL) + goto cleanup; + + ether_addr_copy(hn->ai.addr, LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr))); if_addr_rlock(ifp); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_LINK) continue; - mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc, + hn = mlx5e_move_hn(&head_free, &head_uc); + if (hn == NULL) + break; + ether_addr_copy(hn->ai.addr, LLADDR((struct sockaddr_dl *)ifa->ifa_addr)); } if_addr_runlock(ifp); + if (ifa != NULL) + goto cleanup; if_maddr_rlock(ifp); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_mc, + hn = mlx5e_move_hn(&head_free, &head_mc); + if (hn == NULL) + break; + ether_addr_copy(hn->ai.addr, LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); } if_maddr_runlock(ifp); + if (ifma != NULL) + goto cleanup; + + /* insert L2 unicast addresses into hash list */ + + while ((hn = mlx5e_remove_hn(&head_uc)) != NULL) { + if (mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc, hn) == 0) + continue; + if (hn->mpfs_index == -1U) + mlx5_mpfs_add_mac(priv->mdev, &hn->mpfs_index, hn->ai.addr); + } + + /* insert L2 multicast addresses into hash list */ + + while ((hn = mlx5e_remove_hn(&head_mc)) != NULL) { + if (mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_mc, hn) == 0) + continue; + } + + success = true; + +cleanup: + while ((hn = mlx5e_remove_hn(&head_uc)) != NULL) + free(hn, M_MLX5EN); + while ((hn = mlx5e_remove_hn(&head_mc)) != NULL) + free(hn, M_MLX5EN); + while ((hn = mlx5e_remove_hn(&head_free)) != NULL) + free(hn, M_MLX5EN); + + if (success == false) + goto retry; } static void mlx5e_fill_addr_array(struct mlx5e_priv *priv, int list_type, @@ -1493,6 +1594,8 @@ err_destroy_vlan_flow_table: void mlx5e_close_flow_table(struct mlx5e_priv *priv) { + + mlx5e_handle_ifp_addr(priv); mlx5e_destroy_inner_rss_flow_table(priv); mlx5e_destroy_main_flow_table(priv); mlx5e_destroy_vlan_flow_table(priv); Added: head/sys/dev/mlx5/mpfs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mpfs.h Wed Oct 2 09:22:22 2019 (r352962) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2019, Mellanox Technologies, Ltd. 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 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 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 _MLX5_MPFS_H_ +#define _MLX5_MPFS_H_ + +struct mlx5_core_dev; +int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u32 *p_index, const u8 *mac); +int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u32 index); +int mlx5_mpfs_init(struct mlx5_core_dev *dev); +void mlx5_mpfs_destroy(struct mlx5_core_dev *dev); + +#endif /* _MLX5_MPFS_H_ */ Modified: head/sys/modules/mlx5/Makefile ============================================================================== --- head/sys/modules/mlx5/Makefile Wed Oct 2 09:16:17 2019 (r352961) +++ head/sys/modules/mlx5/Makefile Wed Oct 2 09:22:22 2019 (r352962) @@ -19,6 +19,7 @@ mlx5_health.c \ mlx5_mad.c \ mlx5_main.c \ mlx5_mcg.c \ +mlx5_mpfs.c \ mlx5_mr.c \ mlx5_pagealloc.c \ mlx5_pd.c \ From owner-svn-src-all@freebsd.org Wed Oct 2 09:23:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A5FA1288C1; Wed, 2 Oct 2019 09:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrKg0K2Hz45BK; Wed, 2 Oct 2019 09:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFFE3296F5; Wed, 2 Oct 2019 09:23:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929NYQv004310; Wed, 2 Oct 2019 09:23:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929NYCJ004306; Wed, 2 Oct 2019 09:23:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020923.x929NYCJ004306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352963 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 352963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:23:35 -0000 Author: hselasky Date: Wed Oct 2 09:23:33 2019 New Revision: 352963 URL: https://svnweb.freebsd.org/changeset/base/352963 Log: Cleanup naming of IRQ vectors in mlx5en. Remove unused IRQ naming functions and arrays. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:22:22 2019 (r352962) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:23:33 2019 (r352963) @@ -84,10 +84,6 @@ enum { }; enum { - MLX5_MAX_IRQ_NAME = 32 -}; - -enum { MLX5_ATOMIC_MODE_OFF = 16, MLX5_ATOMIC_MODE_NONE = 0 << MLX5_ATOMIC_MODE_OFF, MLX5_ATOMIC_MODE_IB_COMP = 1 << MLX5_ATOMIC_MODE_OFF, @@ -556,10 +552,6 @@ struct mlx5_mr_table { struct radix_tree_root tree; }; -struct mlx5_irq_info { - char name[MLX5_MAX_IRQ_NAME]; -}; - #ifdef RATELIMIT struct mlx5_rl_entry { u32 rate; @@ -581,7 +573,6 @@ struct mlx5_priv { char name[MLX5_MAX_NAME_LEN]; struct mlx5_eq_table eq_table; struct msix_entry *msix_arr; - struct mlx5_irq_info *irq_info; struct mlx5_uuar_info uuari; MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock); int disable_irqs; @@ -1029,7 +1020,7 @@ struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_co void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vector, enum mlx5_cmd_mode mode); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, - int nent, u64 mask, const char *name, struct mlx5_uar *uar); + int nent, u64 mask, struct mlx5_uar *uar); int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq); int mlx5_start_eqs(struct mlx5_core_dev *dev); int mlx5_stop_eqs(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:22:22 2019 (r352962) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:23:33 2019 (r352963) @@ -102,8 +102,6 @@ int mlx5_firmware_flash(struct mlx5_core_dev *dev, con void mlx5e_init(void); void mlx5e_cleanup(void); -int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name); - int mlx5_ctl_init(void); void mlx5_ctl_fini(void); void mlx5_fwdump_prep(struct mlx5_core_dev *mdev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:22:22 2019 (r352962) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:23:33 2019 (r352963) @@ -415,7 +415,7 @@ static void init_eq_buf(struct mlx5_eq *eq) } int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, - int nent, u64 mask, const char *name, struct mlx5_uar *uar) + int nent, u64 mask, struct mlx5_uar *uar) { u32 out[MLX5_ST_SZ_DW(create_eq_out)] = {0}; struct mlx5_priv *priv = &dev->priv; @@ -463,10 +463,8 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, stru eq->irqn = vecidx; eq->dev = dev; eq->doorbell = uar->map + MLX5_EQ_DOORBEL_OFFSET; - snprintf(priv->irq_info[vecidx].name, MLX5_MAX_IRQ_NAME, "%s@pci:%s", - name, pci_name(dev->pdev)); err = request_irq(priv->msix_arr[vecidx].vector, mlx5_msix_handler, 0, - priv->irq_info[vecidx].name, eq); + "mlx5_core", eq); if (err) goto err_eq; #ifdef RSS @@ -568,7 +566,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, - "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); + &dev->priv.uuari.uars[0]); if (err) { mlx5_core_warn(dev, "failed to create cmd EQ %d\n", err); return err; @@ -578,7 +576,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) err = mlx5_create_map_eq(dev, &table->async_eq, MLX5_EQ_VEC_ASYNC, MLX5_NUM_ASYNC_EQE, async_event_mask, - "mlx5_async_eq", &dev->priv.uuari.uars[0]); + &dev->priv.uuari.uars[0]); if (err) { mlx5_core_warn(dev, "failed to create async EQ %d\n", err); goto err1; @@ -587,7 +585,7 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) err = mlx5_create_map_eq(dev, &table->pages_eq, MLX5_EQ_VEC_PAGES, /* TODO: sriov max_vf + */ 1, - 1 << MLX5_EVENT_TYPE_PAGE_REQUEST, "mlx5_pages_eq", + 1 << MLX5_EVENT_TYPE_PAGE_REQUEST, &dev->priv.uuari.uars[0]); if (err) { mlx5_core_warn(dev, "failed to create pages EQ %d\n", err); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:22:22 2019 (r352962) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:23:33 2019 (r352963) @@ -285,8 +285,6 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev) priv->msix_arr = kzalloc(nvec * sizeof(*priv->msix_arr), GFP_KERNEL); - priv->irq_info = kzalloc(nvec * sizeof(*priv->irq_info), GFP_KERNEL); - for (i = 0; i < nvec; i++) priv->msix_arr[i].entry = i; @@ -296,9 +294,7 @@ static int mlx5_enable_msix(struct mlx5_core_dev *dev) return nvec; table->num_comp_vectors = nvec - MLX5_EQ_VEC_COMP_BASE; - return 0; - } static void mlx5_disable_msix(struct mlx5_core_dev *dev) @@ -306,7 +302,6 @@ static void mlx5_disable_msix(struct mlx5_core_dev *de struct mlx5_priv *priv = &dev->priv; pci_disable_msix(dev->pdev); - kfree(priv->irq_info); kfree(priv->msix_arr); } @@ -604,30 +599,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vec } EXPORT_SYMBOL(mlx5_vector2eqn); -int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name) -{ - struct mlx5_priv *priv = &dev->priv; - struct mlx5_eq_table *table = &priv->eq_table; - struct mlx5_eq *eq; - int err = -ENOENT; - - spin_lock(&table->lock); - list_for_each_entry(eq, &table->comp_eqs_list, list) { - if (eq->index == eq_ix) { - int irq_ix = eq_ix + MLX5_EQ_VEC_COMP_BASE; - - snprintf(priv->irq_info[irq_ix].name, MLX5_MAX_IRQ_NAME, - "%s-%d", name, eq_ix); - - err = 0; - break; - } - } - spin_unlock(&table->lock); - - return err; -} - static void free_comp_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = &dev->priv.eq_table; @@ -649,7 +620,6 @@ static void free_comp_eqs(struct mlx5_core_dev *dev) static int alloc_comp_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = &dev->priv.eq_table; - char name[MLX5_MAX_IRQ_NAME]; struct mlx5_eq *eq; int ncomp_vec; int nent; @@ -662,10 +632,9 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev) for (i = 0; i < ncomp_vec; i++) { eq = kzalloc(sizeof(*eq), GFP_KERNEL); - snprintf(name, MLX5_MAX_IRQ_NAME, "mlx5_comp%d", i); err = mlx5_create_map_eq(dev, eq, i + MLX5_EQ_VEC_COMP_BASE, nent, 0, - name, &dev->priv.uuari.uars[0]); + &dev->priv.uuari.uars[0]); if (err) { kfree(eq); goto clean; From owner-svn-src-all@freebsd.org Wed Oct 2 09:27:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C14C12897B; Wed, 2 Oct 2019 09:27:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrPm70n8z45M9; Wed, 2 Oct 2019 09:27:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF67F296FA; Wed, 2 Oct 2019 09:27:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929R8ea004521; Wed, 2 Oct 2019 09:27:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929R8XS004520; Wed, 2 Oct 2019 09:27:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020927.x929R8XS004520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352964 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:27:09 -0000 Author: hselasky Date: Wed Oct 2 09:27:08 2019 New Revision: 352964 URL: https://svnweb.freebsd.org/changeset/base/352964 Log: Export channel IRQ number as part of the "hw_ctx_debug" sysctl(8) in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 09:23:33 2019 (r352963) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 09:27:08 2019 (r352964) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015-2019 Mellanox Technologies. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1031,30 +1031,49 @@ mlx5e_ethtool_debug_channel_info(SYSCTL_HANDLER_ARGS) struct mlx5e_sq *sq; struct mlx5e_rq *rq; int error, i, tc; + bool opened; priv = arg1; error = sysctl_wire_old_buffer(req, 0); if (error != 0) return (error); - if (sbuf_new_for_sysctl(&sb, NULL, 128, req) == NULL) + if (sbuf_new_for_sysctl(&sb, NULL, 1024, req) == NULL) return (ENOMEM); sbuf_clear_flags(&sb, SBUF_INCLUDENUL); PRIV_LOCK(priv); - if (test_bit(MLX5E_STATE_OPENED, &priv->state) == 0) - goto out; - for (i = 0; i < priv->params.num_channels; i++) { - c = &priv->channel[i]; - rq = &c->rq; - sbuf_printf(&sb, "channel %d rq %d cq %d\n", - c->ix, rq->rqn, rq->cq.mcq.cqn); - for (tc = 0; tc < c->num_tc; tc++) { - sq = &c->sq[tc]; - sbuf_printf(&sb, "channel %d tc %d sq %d cq %d\n", - c->ix, tc, sq->sqn, sq->cq.mcq.cqn); + opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + + sbuf_printf(&sb, "pages irq %d\n", + priv->mdev->priv.msix_arr[MLX5_EQ_VEC_PAGES].vector); + sbuf_printf(&sb, "command irq %d\n", + priv->mdev->priv.msix_arr[MLX5_EQ_VEC_CMD].vector); + sbuf_printf(&sb, "async irq %d\n", + priv->mdev->priv.msix_arr[MLX5_EQ_VEC_ASYNC].vector); + + for (i = 0; i != priv->params.num_channels; i++) { + int eqn_not_used = -1; + int irqn = MLX5_EQ_VEC_COMP_BASE; + + if (mlx5_vector2eqn(priv->mdev, i, &eqn_not_used, &irqn) != 0) + continue; + + c = opened ? &priv->channel[i] : NULL; + rq = opened ? &c->rq : NULL; + sbuf_printf(&sb, "channel %d rq %d cq %d irq %d\n", i, + opened ? rq->rqn : -1, + opened ? rq->cq.mcq.cqn : -1, + priv->mdev->priv.msix_arr[irqn].vector); + + for (tc = 0; tc != priv->num_tc; tc++) { + sq = opened ? &c->sq[tc] : NULL; + sbuf_printf(&sb, "channel %d tc %d sq %d cq %d irq %d\n", + i, tc, + opened ? sq->sqn : -1, + opened ? sq->cq.mcq.cqn : -1, + priv->mdev->priv.msix_arr[irqn].vector); } } -out: PRIV_UNLOCK(priv); error = sbuf_finish(&sb); sbuf_delete(&sb); From owner-svn-src-all@freebsd.org Wed Oct 2 09:27:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F904128A2D; Wed, 2 Oct 2019 09:27:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrQh6h5hz45VH; Wed, 2 Oct 2019 09:27:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D5E296FC; Wed, 2 Oct 2019 09:27:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929RuVw004595; Wed, 2 Oct 2019 09:27:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929Ru4s004594; Wed, 2 Oct 2019 09:27:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020927.x929Ru4s004594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352965 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:27:57 -0000 Author: hselasky Date: Wed Oct 2 09:27:56 2019 New Revision: 352965 URL: https://svnweb.freebsd.org/changeset/base/352965 Log: Correct and update some counter names in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:27:08 2019 (r352964) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:27:56 2019 (r352965) @@ -256,7 +256,7 @@ struct mlx5e_vport_stats { m(+1, u64, out_broadcast_pkts, "out_broadcast_pkts", "Out broadcast packets") #define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \ - m(+1, u64, port_transmit_wait_high, "port_transmit_wait_high", "Port transmit wait high") \ + m(+1, u64, port_transmit_wait, "port_transmit_wait", "Port transmit wait") \ m(+1, u64, ecn_marked, "ecn_marked", "ECN marked") \ m(+1, u64, no_buffer_discard_mc, "no_buffer_discard_mc", "No buffer discard mc") \ m(+1, u64, rx_ebp, "rx_ebp", "RX EBP") \ @@ -340,14 +340,14 @@ struct mlx5e_vport_stats { /* Per priority statistics for PFC */ #define MLX5E_PPORT_PER_PRIO_STATS_SUB(m,n,p) \ m(n, p, +1, u64, rx_octets, "rx_octets", "Received octets") \ - m(n, p, +1, u64, reserved_0, "reserved_0", "Reserved") \ - m(n, p, +1, u64, reserved_1, "reserved_1", "Reserved") \ - m(n, p, +1, u64, reserved_2, "reserved_2", "Reserved") \ + m(n, p, +1, u64, rx_uc_frames, "rx_uc_frames", "Received unicast frames") \ + m(n, p, +1, u64, rx_mc_frames, "rx_mc_frames", "Received multicast frames") \ + m(n, p, +1, u64, rx_bc_frames, "rx_bc_frames", "Received broadcast frames") \ m(n, p, +1, u64, rx_frames, "rx_frames", "Received frames") \ m(n, p, +1, u64, tx_octets, "tx_octets", "Transmitted octets") \ - m(n, p, +1, u64, reserved_3, "reserved_3", "Reserved") \ - m(n, p, +1, u64, reserved_4, "reserved_4", "Reserved") \ - m(n, p, +1, u64, reserved_5, "reserved_5", "Reserved") \ + m(n, p, +1, u64, tx_uc_frames, "tx_uc_frames", "Transmitted unicast frames") \ + m(n, p, +1, u64, tx_mc_frames, "tx_mc_frames", "Transmitted multicast frames") \ + m(n, p, +1, u64, tx_bc_frames, "tx_bc_frames", "Transmitted broadcast frames") \ m(n, p, +1, u64, tx_frames, "tx_frames", "Transmitted frames") \ m(n, p, +1, u64, rx_pause, "rx_pause", "Received pause frames") \ m(n, p, +1, u64, rx_pause_duration, "rx_pause_duration", \ From owner-svn-src-all@freebsd.org Wed Oct 2 09:29:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CD34128ACE; Wed, 2 Oct 2019 09:29:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrT11zg6z45dl; Wed, 2 Oct 2019 09:29:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22BD5296FD; Wed, 2 Oct 2019 09:29:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929Tua7004738; Wed, 2 Oct 2019 09:29:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929Tuwe004733; Wed, 2 Oct 2019 09:29:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020929.x929Tuwe004733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352966 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 352966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:29:57 -0000 Author: hselasky Date: Wed Oct 2 09:29:55 2019 New Revision: 352966 URL: https://svnweb.freebsd.org/changeset/base/352966 Log: Add port module event software counters in mlx5core. While at it, fixup PME based on latest PRM defines. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed Oct 2 09:27:56 2019 (r352965) +++ head/sys/dev/mlx5/device.h Wed Oct 2 09:29:55 2019 (r352966) @@ -537,7 +537,7 @@ enum { MLX5_MODULE_STATUS_PLUGGED_ENABLED = 0x1, MLX5_MODULE_STATUS_UNPLUGGED = 0x2, MLX5_MODULE_STATUS_ERROR = 0x3, - MLX5_MODULE_STATUS_PLUGGED_DISABLED = 0x4, + MLX5_MODULE_STATUS_NUM , }; enum { @@ -549,7 +549,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, - MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_NUM , }; struct mlx5_eqe_port_module_event { Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:27:56 2019 (r352965) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:29:55 2019 (r352966) @@ -569,6 +569,11 @@ struct mlx5_rl_table { }; #endif +struct mlx5_pme_stats { + u64 status_counters[MLX5_MODULE_STATUS_NUM]; + u64 error_counters[MLX5_MODULE_EVENT_ERROR_NUM]; +}; + struct mlx5_priv { char name[MLX5_MAX_NAME_LEN]; struct mlx5_eq_table eq_table; @@ -624,6 +629,7 @@ struct mlx5_priv { #ifdef RATELIMIT struct mlx5_rl_table rl_table; #endif + struct mlx5_pme_stats pme_stats; }; enum mlx5_device_state { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:27:56 2019 (r352965) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:29:55 2019 (r352966) @@ -639,9 +639,9 @@ static const char *mlx5_port_module_event_error_type_t { switch (error_type) { case MLX5_MODULE_EVENT_ERROR_POWER_BUDGET_EXCEEDED: - return "Power Budget Exceeded"; + return "Power budget exceeded"; case MLX5_MODULE_EVENT_ERROR_LONG_RANGE_FOR_NON_MLNX_CABLE_MODULE: - return "Long Range for non MLNX cable/module"; + return "Long Range for non MLNX cable"; case MLX5_MODULE_EVENT_ERROR_BUS_STUCK: return "Bus stuck(I2C or data shorted)"; case MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT: @@ -649,18 +649,11 @@ static const char *mlx5_port_module_event_error_type_t case MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST: return "Enforce part number list"; case MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE: - return "Unsupported Cable"; + return "Unknown identifier"; case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE: return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: - return "Cable is shorted"; - case MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED: - return "One or more network ports have been powered " - "down due to insufficient/unadvertised power on " - "the PCIe slot. Please refer to the card's user " - "manual for power specifications or contact " - "Mellanox support."; - + return "Bad or shorted cable/module"; default: return "Unknown error type"; } @@ -686,29 +679,36 @@ static void mlx5_port_module_event(struct mlx5_core_de module_num = (unsigned int)module_event_eqe->module; module_status = (unsigned int)module_event_eqe->module_status & - PORT_MODULE_EVENT_MODULE_STATUS_MASK; + PORT_MODULE_EVENT_MODULE_STATUS_MASK; error_type = (unsigned int)module_event_eqe->error_type & - PORT_MODULE_EVENT_ERROR_TYPE_MASK; + PORT_MODULE_EVENT_ERROR_TYPE_MASK; + if (module_status < MLX5_MODULE_STATUS_NUM) + dev->priv.pme_stats.status_counters[module_status]++; switch (module_status) { case MLX5_MODULE_STATUS_PLUGGED_ENABLED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged and enabled\n", module_num); + device_printf((&pdev->dev)->bsddev, + "INFO: Module %u, status: plugged and enabled\n", + module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged\n", module_num); + device_printf((&pdev->dev)->bsddev, + "INFO: Module %u, status: unplugged\n", module_num); break; case MLX5_MODULE_STATUS_ERROR: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); + device_printf((&pdev->dev)->bsddev, + "ERROR: Module %u, status: error, %s\n", + module_num, + mlx5_port_module_event_error_type_to_string(error_type)); + if (error_type < MLX5_MODULE_EVENT_ERROR_NUM) + dev->priv.pme_stats.error_counters[error_type]++; break; - case MLX5_MODULE_STATUS_PLUGGED_DISABLED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged but disabled\n", module_num); - break; - default: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status\n", module_num); + device_printf((&pdev->dev)->bsddev, + "INFO: Module %u, unknown status\n", module_num); } /* store module status */ if (module_num < MLX5_MAX_PORTS) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:27:56 2019 (r352965) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:29:55 2019 (r352966) @@ -1244,13 +1244,31 @@ struct mlx5_core_event_handler { void *data); }; +#define MLX5_STATS_DESC(a, b, c, d, e, ...) d, e, + +#define MLX5_PORT_MODULE_ERROR_STATS(m) \ +m(+1, u64, power_budget_exceeded, "power_budget", "Module Power Budget Exceeded") \ +m(+1, u64, long_range, "long_range", "Module Long Range for non MLNX cable/module") \ +m(+1, u64, bus_stuck, "bus_stuck", "Module Bus stuck(I2C or data shorted)") \ +m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry timeout") \ +m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ +m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ +m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") + +static const char *mlx5_pme_err_desc[] = { + MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) +}; + static int init_one(struct pci_dev *pdev, const struct pci_device_id *id) { struct mlx5_core_dev *dev; struct mlx5_priv *priv; device_t bsddev = pdev->dev.bsddev; - int err; + int i,err; + struct sysctl_oid *pme_sysctl_node; + struct sysctl_oid *pme_err_sysctl_node; dev = kzalloc(sizeof(*dev), GFP_KERNEL); priv = &dev->priv; @@ -1282,6 +1300,41 @@ static int init_one(struct pci_dev *pdev, OID_AUTO, "power_value", CTLFLAG_RD, &dev->pwr_value, 0, "Current power value in Watts"); + pme_sysctl_node = SYSCTL_ADD_NODE(&dev->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), + OID_AUTO, "pme_stats", CTLFLAG_RD, NULL, + "Port module event statistics"); + if (pme_sysctl_node == NULL) { + err = -ENOMEM; + goto clean_sysctl_ctx; + } + pme_err_sysctl_node = SYSCTL_ADD_NODE(&dev->sysctl_ctx, + SYSCTL_CHILDREN(pme_sysctl_node), + OID_AUTO, "errors", CTLFLAG_RD, NULL, + "Port module event error statistics"); + if (pme_err_sysctl_node == NULL) { + err = -ENOMEM; + goto clean_sysctl_ctx; + } + SYSCTL_ADD_U64(&dev->sysctl_ctx, + SYSCTL_CHILDREN(pme_sysctl_node), OID_AUTO, + "module_plug", CTLFLAG_RD | CTLFLAG_MPSAFE, + &dev->priv.pme_stats.status_counters[MLX5_MODULE_STATUS_PLUGGED_ENABLED], + 0, "Number of time module plugged"); + SYSCTL_ADD_U64(&dev->sysctl_ctx, + SYSCTL_CHILDREN(pme_sysctl_node), OID_AUTO, + "module_unplug", CTLFLAG_RD | CTLFLAG_MPSAFE, + &dev->priv.pme_stats.status_counters[MLX5_MODULE_STATUS_UNPLUGGED], + 0, "Number of time module unplugged"); + for (i = 0 ; i < MLX5_MODULE_EVENT_ERROR_NUM; i++) { + SYSCTL_ADD_U64(&dev->sysctl_ctx, + SYSCTL_CHILDREN(pme_err_sysctl_node), OID_AUTO, + mlx5_pme_err_desc[2 * i], CTLFLAG_RD | CTLFLAG_MPSAFE, + &dev->priv.pme_stats.error_counters[i], + 0, mlx5_pme_err_desc[2 * i + 1]); + } + + INIT_LIST_HEAD(&priv->ctx_list); spin_lock_init(&priv->ctx_lock); mutex_init(&dev->pci_status_mutex); @@ -1320,8 +1373,9 @@ clean_health: close_pci: mlx5_pci_close(dev, priv); clean_dev: - sysctl_ctx_free(&dev->sysctl_ctx); mtx_destroy(&dev->dump_lock); +clean_sysctl_ctx: + sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); return err; } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:27:56 2019 (r352965) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:29:55 2019 (r352966) @@ -3389,8 +3389,7 @@ out: } /* Check if module is present before doing an access */ module_status = mlx5_query_module_status(priv->mdev, module_num); - if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED && - module_status != MLX5_MODULE_STATUS_PLUGGED_DISABLED) { + if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED) { error = EINVAL; goto err_i2c; } From owner-svn-src-all@freebsd.org Wed Oct 2 09:31:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B227128CC2; Wed, 2 Oct 2019 09:31:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrVw6Yf3z45qX; Wed, 2 Oct 2019 09:31:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C42B029856; Wed, 2 Oct 2019 09:31:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929VacF004897; Wed, 2 Oct 2019 09:31:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929VaBM004894; Wed, 2 Oct 2019 09:31:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020931.x929VaBM004894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352967 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 352967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:31:37 -0000 Author: hselasky Date: Wed Oct 2 09:31:36 2019 New Revision: 352967 URL: https://svnweb.freebsd.org/changeset/base/352967 Log: Make the mlx5_vsc_wait_on_flag(9) function global. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:29:55 2019 (r352966) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:31:36 2019 (r352967) @@ -1096,6 +1096,7 @@ int mlx5_vsc_find_cap(struct mlx5_core_dev *mdev); int mlx5_vsc_lock(struct mlx5_core_dev *mdev); void mlx5_vsc_unlock(struct mlx5_core_dev *mdev); int mlx5_vsc_set_space(struct mlx5_core_dev *mdev, u16 space); +int mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 expected); int mlx5_vsc_write(struct mlx5_core_dev *mdev, u32 addr, const u32 *data); int mlx5_vsc_read(struct mlx5_core_dev *mdev, u32 addr, u32 *data); int mlx5_vsc_lock_addr_space(struct mlx5_core_dev *mdev, u32 addr); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:29:55 2019 (r352966) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:31:36 2019 (r352967) @@ -96,7 +96,8 @@ void mlx5_vsc_unlock(struct mlx5_core_dev *mdev) pci_write_config(dev, vsc_addr + MLX5_VSC_SEMA_OFFSET, 0, 4); } -static int mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 expected) +int +mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 expected) { device_t dev = mdev->pdev->dev.bsddev; int vsc_addr = mdev->vsc_addr; From owner-svn-src-all@freebsd.org Wed Oct 2 09:32:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C91B6128DF2; Wed, 2 Oct 2019 09:32:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrXB4sKJz46Sc; Wed, 2 Oct 2019 09:32:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A1E4298B3; Wed, 2 Oct 2019 09:32:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929Wg56010351; Wed, 2 Oct 2019 09:32:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929WgR2010347; Wed, 2 Oct 2019 09:32:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020932.x929WgR2010347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352968 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 352968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:32:42 -0000 Author: hselasky Date: Wed Oct 2 09:32:41 2019 New Revision: 352968 URL: https://svnweb.freebsd.org/changeset/base/352968 Log: Move mlx5_ifc_vsc_space_bits and mlx5_ifc_vsc_addr_bits to mlx5_ifc.h. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:31:36 2019 (r352967) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:32:41 2019 (r352968) @@ -31,18 +31,6 @@ #define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA -struct mlx5_ifc_vsc_space_bits { - u8 status[0x3]; - u8 reserved0[0xd]; - u8 space[0x10]; -}; - -struct mlx5_ifc_vsc_addr_bits { - u8 flag[0x1]; - u8 reserved0[0x1]; - u8 address[0x1e]; -}; - int mlx5_vsc_lock(struct mlx5_core_dev *mdev) { device_t dev = mdev->pdev->dev.bsddev; Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:31:36 2019 (r352967) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:32:41 2019 (r352968) @@ -9749,6 +9749,18 @@ struct mlx5_ifc_vendor_specific_cap_bits { u8 data[0x20]; }; +struct mlx5_ifc_vsc_space_bits { + u8 status[0x3]; + u8 reserved0[0xd]; + u8 space[0x10]; +}; + +struct mlx5_ifc_vsc_addr_bits { + u8 flag[0x1]; + u8 reserved0[0x1]; + u8 address[0x1e]; +}; + enum { MLX5_INITIAL_SEG_NIC_INTERFACE_FULL_DRIVER = 0x0, MLX5_INITIAL_SEG_NIC_INTERFACE_DISABLED = 0x1, From owner-svn-src-all@freebsd.org Wed Oct 2 09:33:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFB54128E98; Wed, 2 Oct 2019 09:33:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrYH4BkRz46bX; Wed, 2 Oct 2019 09:33:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71F87298B4; Wed, 2 Oct 2019 09:33:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929XdGB010458; Wed, 2 Oct 2019 09:33:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929XdDQ010457; Wed, 2 Oct 2019 09:33:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020933.x929XdDQ010457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352969 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:33:39 -0000 Author: hselasky Date: Wed Oct 2 09:33:38 2019 New Revision: 352969 URL: https://svnweb.freebsd.org/changeset/base/352969 Log: Use the MLX5_VSC_DOMAIN_SEMAPHORES constant instead of hand-rolled symbol in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:32:41 2019 (r352968) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 09:33:38 2019 (r352969) @@ -29,8 +29,6 @@ #include #include -#define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA - int mlx5_vsc_lock(struct mlx5_core_dev *mdev) { device_t dev = mdev->pdev->dev.bsddev; @@ -188,7 +186,7 @@ int mlx5_vsc_lock_addr_space(struct mlx5_core_dev *mde int ret; u32 id; - ret = mlx5_vsc_set_space(mdev, MLX5_SEMAPHORE_SPACE_DOMAIN); + ret = mlx5_vsc_set_space(mdev, MLX5_VSC_DOMAIN_SEMAPHORES); if (ret) return ret; @@ -215,7 +213,7 @@ int mlx5_vsc_unlock_addr_space(struct mlx5_core_dev *m u32 data = 0; int ret; - ret = mlx5_vsc_set_space(mdev, MLX5_SEMAPHORE_SPACE_DOMAIN); + ret = mlx5_vsc_set_space(mdev, MLX5_VSC_DOMAIN_SEMAPHORES); if (ret) return ret; From owner-svn-src-all@freebsd.org Wed Oct 2 09:34:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBF15128F18; Wed, 2 Oct 2019 09:34:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrZL5T1Nz46kQ; Wed, 2 Oct 2019 09:34:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FFBE298B5; Wed, 2 Oct 2019 09:34:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929YYaB010545; Wed, 2 Oct 2019 09:34:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929YYen010544; Wed, 2 Oct 2019 09:34:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020934.x929YYen010544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352970 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 352970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:34:34 -0000 Author: hselasky Date: Wed Oct 2 09:34:34 2019 New Revision: 352970 URL: https://svnweb.freebsd.org/changeset/base/352970 Log: Define MLX5_VSC_DOMAIN_SCAN_CRSPACE. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:33:38 2019 (r352969) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:34:34 2019 (r352970) @@ -9725,6 +9725,7 @@ struct mlx5_ifc_mtt_bits { enum { MLX5_VSC_DOMAIN_ICMD = 0x1, MLX5_VSC_DOMAIN_PROTECTED_CRSPACE = 0x6, + MLX5_VSC_DOMAIN_SCAN_CRSPACE = 0x7, MLX5_VSC_DOMAIN_SEMAPHORES = 0xA, }; From owner-svn-src-all@freebsd.org Wed Oct 2 09:40:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6EC129032; Wed, 2 Oct 2019 09:40:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrj43dqsz470w; Wed, 2 Oct 2019 09:40:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CD84298BA; Wed, 2 Oct 2019 09:40:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929eO91011015; Wed, 2 Oct 2019 09:40:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929eOJq011014; Wed, 2 Oct 2019 09:40:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020940.x929eOJq011014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352971 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 352971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:40:24 -0000 Author: hselasky Date: Wed Oct 2 09:40:23 2019 New Revision: 352971 URL: https://svnweb.freebsd.org/changeset/base/352971 Log: Read rege map from crdump scan space in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:34:34 2019 (r352970) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:40:23 2019 (r352971) @@ -698,7 +698,7 @@ struct mlx5_core_dev { struct mlx5_flow_root_namespace *sniffer_rx_root_ns; struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; - const struct mlx5_crspace_regmap *dump_rege; + struct mlx5_crspace_regmap *dump_rege; uint32_t *dump_data; unsigned dump_size; bool dump_valid; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:34:34 2019 (r352970) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:40:23 2019 (r352971) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2018, 2019 Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -64,7 +64,10 @@ mlx5_fwdump_destroy_dd(struct mlx5_core_dev *mdev) void mlx5_fwdump_prep(struct mlx5_core_dev *mdev) { - int error; + device_t dev; + int error, vsc_addr; + unsigned i, sz; + u32 addr, in, out, next_addr; mdev->dump_data = NULL; error = mlx5_vsc_find_cap(mdev); @@ -74,25 +77,77 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) "mlx5_fwdump_prep failed %d\n", error); return; } - switch (pci_get_device(mdev->pdev->dev.bsddev)) { - case 0x1013: - mdev->dump_rege = mlx5_crspace_regmap_mt4115; - break; - case 0x1015: - mdev->dump_rege = mlx5_crspace_regmap_mt4117; - break; - case 0x1017: - case 0x1019: - mdev->dump_rege = mlx5_crspace_regmap_connectx5; - break; - default: - return; /* silently fail, do not prevent driver attach */ + error = mlx5_vsc_lock(mdev); + if (error != 0) + return; + error = mlx5_vsc_set_space(mdev, MLX5_VSC_DOMAIN_SCAN_CRSPACE); + if (error != 0) { + mlx5_core_warn(mdev, "VSC scan space is not supported\n"); + goto unlock_vsc; } + dev = mdev->pdev->dev.bsddev; + vsc_addr = mdev->vsc_addr; + if (vsc_addr == 0) { + mlx5_core_warn(mdev, "Cannot read vsc, no address\n"); + goto unlock_vsc; + } + + in = 0; + for (sz = 1, addr = 0;;) { + MLX5_VSC_SET(vsc_addr, &in, address, addr); + pci_write_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, in, 4); + error = mlx5_vsc_wait_on_flag(mdev, 1); + if (error != 0) { + mlx5_core_warn(mdev, + "Failed waiting for read complete flag, error %d\n", error); + goto unlock_vsc; + } + pci_read_config(dev, vsc_addr + MLX5_VSC_DATA_OFFSET, 4); + out = pci_read_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, 4); + next_addr = MLX5_VSC_GET(vsc_addr, &out, address); + if (next_addr == 0 || next_addr == addr) + break; + if (next_addr != addr + 4) + sz++; + addr = next_addr; + } + mdev->dump_rege = malloc(sz * sizeof(struct mlx5_crspace_regmap), + M_MLX5_DUMP, M_WAITOK | M_ZERO); + + for (i = 0, addr = 0;;) { + MPASS(i < sz); + mdev->dump_rege[i].cnt++; + MLX5_VSC_SET(vsc_addr, &in, address, addr); + pci_write_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, in, 4); + error = mlx5_vsc_wait_on_flag(mdev, 1); + if (error != 0) { + mlx5_core_warn(mdev, + "Failed waiting for read complete flag, error %d\n", error); + free(mdev->dump_rege, M_MLX5_DUMP); + mdev->dump_rege = NULL; + goto unlock_vsc; + } + pci_read_config(dev, vsc_addr + MLX5_VSC_DATA_OFFSET, 4); + out = pci_read_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, 4); + next_addr = MLX5_VSC_GET(vsc_addr, &out, address); + if (next_addr == 0 || next_addr == addr) + break; + if (next_addr != addr + 4) + mdev->dump_rege[++i].addr = next_addr; + addr = next_addr; + } + KASSERT(i + 1 == sz, + ("inconsistent hw crspace reads: sz %u i %u addr %#lx", + sz, i, (unsigned long)addr)); + mdev->dump_size = mlx5_fwdump_getsize(mdev->dump_rege); mdev->dump_data = malloc(mdev->dump_size * sizeof(uint32_t), M_MLX5_DUMP, M_WAITOK | M_ZERO); mdev->dump_valid = false; mdev->dump_copyout = false; + +unlock_vsc: + mlx5_vsc_unlock(mdev); } void @@ -145,6 +200,7 @@ mlx5_fwdump_clean(struct mlx5_core_dev *mdev) msleep(&mdev->dump_copyout, &mdev->dump_lock, 0, "mlx5fwc", 0); mlx5_fwdump_destroy_dd(mdev); mtx_unlock(&mdev->dump_lock); + free(mdev->dump_rege, M_MLX5_DUMP); } static int From owner-svn-src-all@freebsd.org Wed Oct 2 09:43:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 357B212920A; Wed, 2 Oct 2019 09:43:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrn10gB0z47MC; Wed, 2 Oct 2019 09:43:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB3C29A83; Wed, 2 Oct 2019 09:43:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929hmMf016662; Wed, 2 Oct 2019 09:43:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929hm8A016634; Wed, 2 Oct 2019 09:43:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020943.x929hm8A016634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352972 - in head/sys: conf dev/mlx5/mlx5_core modules/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5/mlx5_core modules/mlx5 X-SVN-Commit-Revision: 352972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:43:49 -0000 Author: hselasky Date: Wed Oct 2 09:43:48 2019 New Revision: 352972 URL: https://svnweb.freebsd.org/changeset/base/352972 Log: Remove no longer needed fwdump register tables from mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Deleted: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c Modified: head/sys/conf/files head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/modules/mlx5/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 2 09:40:23 2019 (r352971) +++ head/sys/conf/files Wed Oct 2 09:43:48 2019 (r352972) @@ -4717,8 +4717,6 @@ dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_fwdump.c optional mlx5 pci \ compile-with "${OFED_C}" -dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c optional mlx5 pci \ - compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_health.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mad.c optional mlx5 pci \ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:40:23 2019 (r352971) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:43:48 2019 (r352972) @@ -35,10 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4117[]; -extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4115[]; -extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_connectx5[]; - static MALLOC_DEFINE(M_MLX5_DUMP, "MLX5DUMP", "MLX5 Firmware dump"); static unsigned Modified: head/sys/modules/mlx5/Makefile ============================================================================== --- head/sys/modules/mlx5/Makefile Wed Oct 2 09:40:23 2019 (r352971) +++ head/sys/modules/mlx5/Makefile Wed Oct 2 09:43:48 2019 (r352972) @@ -14,7 +14,6 @@ mlx5_fs_cmd.c \ mlx5_fs_tree.c \ mlx5_fw.c \ mlx5_fwdump.c \ -mlx5_fwdump_regmaps.c \ mlx5_health.c \ mlx5_mad.c \ mlx5_main.c \ From owner-svn-src-all@freebsd.org Wed Oct 2 09:45:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 540AA1292D3; Wed, 2 Oct 2019 09:45:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrpX1XCjz47bb; Wed, 2 Oct 2019 09:45:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1774E29A89; Wed, 2 Oct 2019 09:45:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929j7KG016837; Wed, 2 Oct 2019 09:45:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929j7jL016836; Wed, 2 Oct 2019 09:45:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020945.x929j7jL016836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352973 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:45:08 -0000 Author: hselasky Date: Wed Oct 2 09:45:07 2019 New Revision: 352973 URL: https://svnweb.freebsd.org/changeset/base/352973 Log: Add missing blank line at the end of the print in mlx5core. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:43:48 2019 (r352972) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:45:07 2019 (r352973) @@ -219,7 +219,7 @@ mlx5_temp_warning_event(struct mlx5_core_dev *dev, str { mlx5_core_warn(dev, - "High temperature on sensors with bit set %#jx %#jx", + "High temperature on sensors with bit set %#jx %#jx\n", (uintmax_t)be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb), (uintmax_t)be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb)); } From owner-svn-src-all@freebsd.org Wed Oct 2 09:46:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F42051293DB; Wed, 2 Oct 2019 09:46:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrqp6B27z47kr; Wed, 2 Oct 2019 09:46:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B818829A8A; Wed, 2 Oct 2019 09:46:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929kEMl016936; Wed, 2 Oct 2019 09:46:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929kETR016935; Wed, 2 Oct 2019 09:46:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020946.x929kETR016935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352974 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:46:15 -0000 Author: hselasky Date: Wed Oct 2 09:46:14 2019 New Revision: 352974 URL: https://svnweb.freebsd.org/changeset/base/352974 Log: Add proper print in case of 0x0 health syndrome in mlx5core. In case of health counter fails to increment it indicates a bad device health. In case when the syndrome indicated by firmware is 0x0, this indicates that firmware is unable to respond to initialization segment reads. Add proper print in this case. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 09:45:07 2019 (r352973) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 09:46:14 2019 (r352974) @@ -490,17 +490,23 @@ static const char *hsynd_str(u8 synd) } } -static void print_health_info(struct mlx5_core_dev *dev) +static u8 +print_health_info(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; struct mlx5_health_buffer __iomem *h = health->health; + u8 synd = ioread8(&h->synd); char fw_str[18]; u32 fw; int i; - /* If the syndrom is 0, the device is OK and no need to print buffer */ - if (!ioread8(&h->synd)) - return; + /* + * If synd is 0x0 - this indicates that FW is unable to + * respond to initialization segment reads and health buffer + * should not be read. + */ + if (synd == 0) + return (0); for (i = 0; i < ARRAY_SIZE(h->assert_var); i++) printf("mlx5_core: INFO: ""assert_var[%d] 0x%08x\n", i, ioread32be(h->assert_var + i)); @@ -511,10 +517,12 @@ static void print_health_info(struct mlx5_core_dev *de printf("mlx5_core: INFO: ""fw_ver %s\n", fw_str); printf("mlx5_core: INFO: ""hw_id 0x%08x\n", ioread32be(&h->hw_id)); printf("mlx5_core: INFO: ""irisc_index %d\n", ioread8(&h->irisc_index)); - printf("mlx5_core: INFO: ""synd 0x%x: %s\n", ioread8(&h->synd), hsynd_str(ioread8(&h->synd))); + printf("mlx5_core: INFO: ""synd 0x%x: %s\n", synd, hsynd_str(synd)); printf("mlx5_core: INFO: ""ext_synd 0x%04x\n", ioread16be(&h->ext_synd)); fw = ioread32be(&h->fw_ver); printf("mlx5_core: INFO: ""raw fw_ver 0x%08x\n", fw); + + return synd; } static void health_watchdog(struct work_struct *work) @@ -596,7 +604,8 @@ static void poll_health(unsigned long data) health->prev = count; if (health->miss_counter == MAX_MISSES) { mlx5_core_err(dev, "device's health compromised - reached miss count\n"); - print_health_info(dev); + if (print_health_info(dev) == 0) + mlx5_core_err(dev, "FW is unable to respond to initialization segment reads\n"); } fatal_error = check_fatal_sensors(dev); From owner-svn-src-all@freebsd.org Wed Oct 2 09:48:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62419129483; Wed, 2 Oct 2019 09:48:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrsv2ftbz47td; Wed, 2 Oct 2019 09:48:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A14829A8B; Wed, 2 Oct 2019 09:48:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929m3ob017068; Wed, 2 Oct 2019 09:48:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929m1ld017058; Wed, 2 Oct 2019 09:48:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020948.x929m1ld017058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352975 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:48:03 -0000 Author: hselasky Date: Wed Oct 2 09:48:01 2019 New Revision: 352975 URL: https://svnweb.freebsd.org/changeset/base/352975 Log: Unify prints in mlx5core. All prints in mlx5core should use on of the macros: mlx5_core_err/dbg/warn Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_core/mlx5_health.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Oct 2 09:48:01 2019 (r352975) @@ -1489,7 +1489,9 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) memset(cmd, 0, sizeof(*cmd)); cmd_if_rev = cmdif_rev_get(dev); if (cmd_if_rev != CMD_IF_REV) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""Driver cmdif rev(%d) differs from firmware's(%d)\n", CMD_IF_REV, cmd_if_rev); + mlx5_core_err(dev, + "Driver cmdif rev(%d) differs from firmware's(%d)\n", + CMD_IF_REV, cmd_if_rev); return -EINVAL; } @@ -1501,13 +1503,16 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) cmd->log_sz = cmd_l >> 4 & 0xf; cmd->log_stride = cmd_l & 0xf; if (1 << cmd->log_sz > MLX5_MAX_COMMANDS) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""firmware reports too many outstanding commands %d\n", 1 << cmd->log_sz); + mlx5_core_err(dev, + "firmware reports too many outstanding commands %d\n", + 1 << cmd->log_sz); err = -EINVAL; goto err_free_page; } if (cmd->log_sz + cmd->log_stride > MLX5_ADAPTER_PAGE_SHIFT) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""command queue size overflow\n"); + mlx5_core_err(dev, + "command queue size overflow\n"); err = -EINVAL; goto err_free_page; } @@ -1518,7 +1523,9 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) cmd->cmdif_rev = ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16; if (cmd->cmdif_rev > CMD_IF_REV) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""driver does not support command interface version. driver %d, firmware %d\n", CMD_IF_REV, cmd->cmdif_rev); + mlx5_core_err(dev, + "driver does not support command interface version. driver %d, firmware %d\n", + CMD_IF_REV, cmd->cmdif_rev); err = -ENOTSUPP; goto err_free_page; } @@ -1534,7 +1541,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) cmd_h = (u32)((u64)(cmd->dma) >> 32); cmd_l = (u32)(cmd->dma); if (cmd_l & 0xfff) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""invalid command queue address\n"); + mlx5_core_err(dev, "invalid command queue address\n"); err = -ENOMEM; goto err_free_page; } @@ -1551,7 +1558,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) err = create_msg_cache(dev); if (err) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""failed to create command cache\n"); + mlx5_core_err(dev, "failed to create command cache\n"); goto err_free_page; } return 0; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 09:48:01 2019 (r352975) @@ -53,13 +53,18 @@ do { \ mlx5_core_dbg(dev, format, ##__VA_ARGS__); \ } while (0) -#define mlx5_core_err(_dev, format, ...) \ - device_printf((&(_dev)->pdev->dev)->bsddev, "ERR: ""%s:%d:(pid %d): " format, \ +#define mlx5_core_err(_dev, format, ...) \ + device_printf((_dev)->pdev->dev.bsddev, "ERR: ""%s:%d:(pid %d): " format, \ __func__, __LINE__, curthread->td_proc->p_pid, \ ##__VA_ARGS__) -#define mlx5_core_warn(_dev, format, ...) \ - device_printf((&(_dev)->pdev->dev)->bsddev, "WARN: ""%s:%d:(pid %d): " format, \ +#define mlx5_core_warn(_dev, format, ...) \ + device_printf((_dev)->pdev->dev.bsddev, "WARN: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ + ##__VA_ARGS__) + +#define mlx5_core_info(_dev, format, ...) \ + device_printf((_dev)->pdev->dev.bsddev, "INFO: ""%s:%d:(pid %d): " format, \ __func__, __LINE__, curthread->td_proc->p_pid, \ ##__VA_ARGS__) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 09:48:01 2019 (r352975) @@ -673,7 +673,6 @@ static void mlx5_port_module_event(struct mlx5_core_de unsigned int module_status; unsigned int error_type; struct mlx5_eqe_port_module_event *module_event_eqe; - struct pci_dev *pdev = dev->pdev; module_event_eqe = &eqe->data.port_module_event; @@ -687,19 +686,19 @@ static void mlx5_port_module_event(struct mlx5_core_de dev->priv.pme_stats.status_counters[module_status]++; switch (module_status) { case MLX5_MODULE_STATUS_PLUGGED_ENABLED: - device_printf((&pdev->dev)->bsddev, - "INFO: Module %u, status: plugged and enabled\n", + mlx5_core_info(dev, + "Module %u, status: plugged and enabled\n", module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: - device_printf((&pdev->dev)->bsddev, - "INFO: Module %u, status: unplugged\n", module_num); + mlx5_core_info(dev, + "Module %u, status: unplugged\n", module_num); break; case MLX5_MODULE_STATUS_ERROR: - device_printf((&pdev->dev)->bsddev, - "ERROR: Module %u, status: error, %s\n", + mlx5_core_err(dev, + "Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); if (error_type < MLX5_MODULE_EVENT_ERROR_NUM) @@ -707,8 +706,8 @@ static void mlx5_port_module_event(struct mlx5_core_de break; default: - device_printf((&pdev->dev)->bsddev, - "INFO: Module %u, unknown status\n", module_num); + mlx5_core_info(dev, + "Module %u, unknown status\n", module_num); } /* store module status */ if (module_num < MLX5_MAX_PORTS) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Wed Oct 2 09:48:01 2019 (r352975) @@ -139,7 +139,6 @@ static struct mlx5_flow_root_namespace *find_root(stru node = parent; if (node->type != FS_TYPE_NAMESPACE) { - printf("mlx5_core: WARN: ""mlx5: flow steering node %s is not in tree or garbaged\n", node->name); return NULL; } @@ -477,7 +476,7 @@ static int connect_prev_fts(struct fs_prio *locked_pri err = fs_set_star_rule(dev, iter, next_ft); if (err) { mlx5_core_warn(dev, - "mlx5: flow steering can't connect prev and next\n"); + "mlx5: flow steering can't connect prev and next\n"); goto unlock; } else { /* Assume ft's prio is locked */ @@ -605,7 +604,9 @@ static void destroy_star_rule(struct mlx5_flow_table * root = find_root(&prio->base); if (!root) - printf("mlx5_core: ERR: ""mlx5: flow steering failed to find root of priority %s", prio->base.name); + mlx5_core_err(dev, + "flow steering failed to find root of priority %s", + prio->base.name); /* In order to ensure atomic deletion, first update * prev ft to point on the next ft. @@ -765,11 +766,13 @@ static struct mlx5_flow_table *_create_ft_common(struc int log_table_sz; int ft_size; char gen_name[20]; - struct mlx5_flow_root_namespace *root = - find_root(&ns->base); + struct mlx5_flow_root_namespace *root = find_root(&ns->base); + struct mlx5_core_dev *dev = fs_get_dev(&ns->base); if (!root) { - printf("mlx5_core: ERR: ""mlx5: flow steering failed to find root of namespace %s", ns->base.name); + mlx5_core_err(dev, + "flow steering failed to find root of namespace %s", + ns->base.name); return ERR_PTR(-ENODEV); } @@ -987,12 +990,16 @@ int mlx5_destroy_flow_table(struct mlx5_flow_table *ft struct fs_prio *prio; struct mlx5_flow_root_namespace *root; bool is_shared_prio; + struct mlx5_core_dev *dev; fs_get_parent(prio, ft); root = find_root(&prio->base); + dev = fs_get_dev(&prio->base); if (!root) { - printf("mlx5_core: ERR: ""mlx5: flow steering failed to find root of priority %s", prio->base.name); + mlx5_core_err(dev, + "flow steering failed to find root of priority %s", + prio->base.name); return -ENODEV; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed Oct 2 09:48:01 2019 (r352975) @@ -324,7 +324,7 @@ int mlx5_cmd_fast_teardown_hca(struct mlx5_core_dev *d } while (!time_after(jiffies, end)); if (mlx5_get_nic_state(dev) != MLX5_NIC_IFC_DISABLED) { - dev_err(&dev->pdev->dev, "NIC IFC still %d after %ums.\n", + mlx5_core_err(dev, "NIC IFC still %d after %ums.\n", mlx5_get_nic_state(dev), delay_ms); return -EIO; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 09:48:01 2019 (r352975) @@ -69,7 +69,7 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) error = mlx5_vsc_find_cap(mdev); if (error != 0) { /* Inability to create a firmware dump is not fatal. */ - device_printf((&mdev->pdev->dev)->bsddev, "WARN: " + mlx5_core_warn(mdev, "mlx5_fwdump_prep failed %d\n", error); return; } @@ -153,13 +153,13 @@ mlx5_fwdump(struct mlx5_core_dev *mdev) uint32_t i, ri; int error; - dev_info(&mdev->pdev->dev, "Issuing FW dump\n"); + mlx5_core_info(mdev, "Issuing FW dump\n"); mtx_lock(&mdev->dump_lock); if (mdev->dump_data == NULL) goto failed; if (mdev->dump_valid) { /* only one dump */ - dev_warn(&mdev->pdev->dev, + mlx5_core_warn(mdev, "Only one FW dump can be captured aborting FW dump\n"); goto failed; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 09:48:01 2019 (r352975) @@ -78,9 +78,11 @@ static int lock_sem_sw_reset(struct mlx5_core_dev *dev ret = -mlx5_vsc_lock_addr_space(dev, MLX5_SEMAPHORE_SW_RESET); if (ret) { if (ret == -EBUSY) - mlx5_core_dbg(dev, "SW reset FW semaphore already locked, another function will handle the reset\n"); + mlx5_core_dbg(dev, + "SW reset FW semaphore already locked, another function will handle the reset\n"); else - mlx5_core_warn(dev, "SW reset semaphore lock return %d\n", ret); + mlx5_core_warn(dev, + "SW reset semaphore lock return %d\n", ret); } /* Unlock GW access */ @@ -216,11 +218,12 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d if (fatal_error == MLX5_SENSOR_PCI_COMM_ERR || fatal_error == MLX5_SENSOR_NIC_DISABLED || fatal_error == MLX5_SENSOR_NIC_SW_RESET) { - mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.\n"); + mlx5_core_warn(dev, + "Not issuing FW reset. Either it's already done or won't help.\n"); return; } - mlx5_core_warn(dev, "Issuing FW Reset\n"); + mlx5_core_info(dev, "Issuing FW Reset\n"); /* Write the NIC interface field to initiate the reset, the command * interface address also resides here, don't overwrite it. */ @@ -251,8 +254,8 @@ mlx5_health_allow_reset(struct mlx5_core_dev *dev) */ health->last_reset_req = ticks ? : -1; if (!ret) - mlx5_core_warn(dev, "Firmware reset elided due to " - "auto-reset frequency threshold.\n"); + mlx5_core_warn(dev, + "Firmware reset elided due to auto-reset frequency threshold.\n"); return (ret); } @@ -313,7 +316,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, } while (!time_after(jiffies, end)); if (!sensor_nic_disabled(dev)) { - dev_err(&dev->pdev->dev, "NIC IFC still %d after %ums.\n", + mlx5_core_err(dev, "NIC IFC still %d after %ums.\n", mlx5_get_nic_state(dev), delay_ms); } @@ -321,7 +324,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, if (!lock) unlock_sem_sw_reset(dev); - mlx5_core_err(dev, "system error event triggered\n"); + mlx5_core_info(dev, "System error event triggered\n"); err_state_done: mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 1); @@ -342,9 +345,11 @@ static void mlx5_handle_bad_state(struct mlx5_core_dev * MLX5_NIC_IFC_DISABLED. */ if (dev->priv.health.fatal_error != MLX5_SENSOR_PCI_COMM_ERR) - mlx5_core_warn(dev, "NIC SW reset is already progress\n"); + mlx5_core_warn(dev, + "NIC SW reset is already progress\n"); else - mlx5_core_warn(dev, "Communication with FW over the PCI link is down\n"); + mlx5_core_warn(dev, + "Communication with FW over the PCI link is down\n"); } else { mlx5_core_warn(dev, "NIC mode %d\n", nic_mode); } @@ -372,7 +377,8 @@ static void health_recover(struct work_struct *work) mtx_lock(&Giant); /* XXX newbus needs this */ if (sensor_pci_no_comm(dev)) { - dev_err(&dev->pdev->dev, "health recovery flow aborted, PCI reads still not working\n"); + mlx5_core_err(dev, + "health recovery flow aborted, PCI reads still not working\n"); recover = false; } @@ -384,13 +390,14 @@ static void health_recover(struct work_struct *work) } if (nic_mode != MLX5_NIC_IFC_DISABLED) { - dev_err(&dev->pdev->dev, "health recovery flow aborted, unexpected NIC IFC mode %d.\n", - nic_mode); + mlx5_core_err(dev, + "health recovery flow aborted, unexpected NIC IFC mode %d.\n", + nic_mode); recover = false; } if (recover) { - dev_err(&dev->pdev->dev, "starting health recovery flow\n"); + mlx5_core_info(dev, "Starting health recovery flow\n"); mlx5_recover_device(dev); } @@ -425,12 +432,13 @@ static void health_care(struct work_struct *work) spin_lock_irqsave(&health->wq_lock, flags); if (!test_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags)) { - mlx5_core_warn(dev, "Scheduling recovery work with %lums delay\n", - recover_delay); + mlx5_core_warn(dev, + "Scheduling recovery work with %lums delay\n", + recover_delay); schedule_delayed_work(&health->recover_work, recover_delay); } else { - dev_err(&dev->pdev->dev, - "new health works are not permitted at this stage\n"); + mlx5_core_err(dev, + "new health works are not permitted at this stage\n"); } spin_unlock_irqrestore(&health->wq_lock, flags); } @@ -455,7 +463,7 @@ void mlx5_trigger_health_work(struct mlx5_core_dev *de if (!test_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags)) queue_work(health->wq, &health->work); else - dev_err(&dev->pdev->dev, + mlx5_core_err(dev, "new health works are not permitted at this stage\n"); spin_unlock_irqrestore(&health->wq_lock, flags); } @@ -509,18 +517,23 @@ print_health_info(struct mlx5_core_dev *dev) return (0); for (i = 0; i < ARRAY_SIZE(h->assert_var); i++) - printf("mlx5_core: INFO: ""assert_var[%d] 0x%08x\n", i, ioread32be(h->assert_var + i)); + mlx5_core_info(dev, "assert_var[%d] 0x%08x\n", i, + ioread32be(h->assert_var + i)); - printf("mlx5_core: INFO: ""assert_exit_ptr 0x%08x\n", ioread32be(&h->assert_exit_ptr)); - printf("mlx5_core: INFO: ""assert_callra 0x%08x\n", ioread32be(&h->assert_callra)); - snprintf(fw_str, sizeof(fw_str), "%d.%d.%d", fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); - printf("mlx5_core: INFO: ""fw_ver %s\n", fw_str); - printf("mlx5_core: INFO: ""hw_id 0x%08x\n", ioread32be(&h->hw_id)); - printf("mlx5_core: INFO: ""irisc_index %d\n", ioread8(&h->irisc_index)); - printf("mlx5_core: INFO: ""synd 0x%x: %s\n", synd, hsynd_str(synd)); - printf("mlx5_core: INFO: ""ext_synd 0x%04x\n", ioread16be(&h->ext_synd)); + mlx5_core_info(dev, "assert_exit_ptr 0x%08x\n", + ioread32be(&h->assert_exit_ptr)); + mlx5_core_info(dev, "assert_callra 0x%08x\n", + ioread32be(&h->assert_callra)); + snprintf(fw_str, sizeof(fw_str), "%d.%d.%d", + fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); + mlx5_core_info(dev, "fw_ver %s\n", fw_str); + mlx5_core_info(dev, "hw_id 0x%08x\n", ioread32be(&h->hw_id)); + mlx5_core_info(dev, "irisc_index %d\n", ioread8(&h->irisc_index)); + mlx5_core_info(dev, "synd 0x%x: %s\n", + ioread8(&h->synd), hsynd_str(ioread8(&h->synd))); + mlx5_core_info(dev, "ext_synd 0x%04x\n", ioread16be(&h->ext_synd)); fw = ioread32be(&h->fw_ver); - printf("mlx5_core: INFO: ""raw fw_ver 0x%08x\n", fw); + mlx5_core_info(dev, "raw fw_ver 0x%08x\n", fw); return synd; } @@ -540,31 +553,38 @@ static void health_watchdog(struct work_struct *work) err = mlx5_pci_read_power_status(dev, &power, &status); if (err < 0) { - mlx5_core_warn(dev, "Failed reading power status: %d\n", err); + mlx5_core_warn(dev, "Failed reading power status: %d\n", + err); return; } dev->pwr_value = power; if (dev->pwr_status != status) { - device_t bsddev = dev->pdev->dev.bsddev; switch (status) { case 0: dev->pwr_status = status; - device_printf(bsddev, "PCI power is not published by the PCIe slot.\n"); + mlx5_core_info(dev, + "PCI power is not published by the PCIe slot.\n"); break; case 1: dev->pwr_status = status; - device_printf(bsddev, "PCIe slot advertised sufficient power (%uW).\n", power); + mlx5_core_info(dev, + "PCIe slot advertised sufficient power (%uW).\n", + power); break; case 2: dev->pwr_status = status; - device_printf(bsddev, "WARN: Detected insufficient power on the PCIe slot (%uW).\n", power); + mlx5_core_warn(dev, + "Detected insufficient power on the PCIe slot (%uW).\n", + power); break; default: dev->pwr_status = 0; - device_printf(bsddev, "WARN: Unknown power state detected(%d).\n", status); + mlx5_core_warn(dev, + "Unknown power state detected(%d).\n", + status); break; } } @@ -580,8 +600,8 @@ mlx5_trigger_health_watchdog(struct mlx5_core_dev *dev if (!test_bit(MLX5_DROP_NEW_WATCHDOG_WORK, &health->flags)) queue_work(health->wq_watchdog, &health->work_watchdog); else - dev_err(&dev->pdev->dev, - "scheduling watchdog is not permitted at this stage\n"); + mlx5_core_err(dev, + "scheduling watchdog is not permitted at this stage\n"); spin_unlock_irqrestore(&health->wq_lock, flags); } @@ -611,7 +631,8 @@ static void poll_health(unsigned long data) fatal_error = check_fatal_sensors(dev); if (fatal_error && !health->fatal_error) { - mlx5_core_err(dev, "Fatal error %u detected\n", fatal_error); + mlx5_core_err(dev, + "Fatal error %u detected\n", fatal_error); dev->priv.health.fatal_error = fatal_error; print_health_info(dev); mlx5_trigger_health_work(dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 09:48:01 2019 (r352975) @@ -172,24 +172,25 @@ static struct mlx5_profile profiles[] = { static int set_dma_caps(struct pci_dev *pdev) { + struct mlx5_core_dev *dev = pci_get_drvdata(pdev); int err; err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); if (err) { - device_printf((&pdev->dev)->bsddev, "WARN: ""Warning: couldn't set 64-bit PCI DMA mask\n"); + mlx5_core_warn(dev, "couldn't set 64-bit PCI DMA mask\n"); err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Can't set PCI DMA mask, aborting\n"); + mlx5_core_err(dev, "Can't set PCI DMA mask, aborting\n"); return err; } } err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); if (err) { - device_printf((&pdev->dev)->bsddev, "WARN: ""Warning: couldn't set 64-bit consistent PCI DMA mask\n"); + mlx5_core_warn(dev, "couldn't set 64-bit consistent PCI DMA mask\n"); err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Can't set consistent PCI DMA mask, aborting\n"); + mlx5_core_err(dev, "Can't set consistent PCI DMA mask, aborting\n"); return err; } } @@ -243,16 +244,17 @@ static void mlx5_pci_disable_device(struct mlx5_core_d static int request_bar(struct pci_dev *pdev) { + struct mlx5_core_dev *dev = pci_get_drvdata(pdev); int err = 0; if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Missing registers BAR, aborting\n"); + mlx5_core_err(dev, "Missing registers BAR, aborting\n"); return -ENODEV; } err = pci_request_regions(pdev, DRIVER_NAME); if (err) - device_printf((&pdev->dev)->bsddev, "ERR: ""Couldn't get PCI resources, aborting\n"); + mlx5_core_err(dev, "Couldn't get PCI resources, aborting\n"); return err; } @@ -319,7 +321,7 @@ enum { MLX5_DEV_CAP_FLAG_DRAIN_SIGERR, }; -static u16 to_fw_pkey_sz(u32 size) +static u16 to_fw_pkey_sz(struct mlx5_core_dev *dev, u32 size) { switch (size) { case 128: @@ -335,7 +337,7 @@ static u16 to_fw_pkey_sz(u32 size) case 4096: return 5; default: - printf("mlx5_core: WARN: ""invalid pkey table size %d\n", size); + mlx5_core_warn(dev, "invalid pkey table size %d\n", size); return 0; } } @@ -430,7 +432,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) 128); /* we limit the size of the pkey table to 128 entries for now */ MLX5_SET(cmd_hca_cap, set_hca_cap, pkey_table_size, - to_fw_pkey_sz(128)); + to_fw_pkey_sz(dev, 128)); if (prof->mask & MLX5_PROF_MASK_QP_SIZE) MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_qp, @@ -544,11 +546,11 @@ static int mlx5_core_set_issi(struct mlx5_core_dev *de mlx5_cmd_mbox_status(query_out, &status, &syndrome); if (status == MLX5_CMD_STAT_BAD_OP_ERR) { - pr_debug("Only ISSI 0 is supported\n"); + mlx5_core_dbg(dev, "Only ISSI 0 is supported\n"); return 0; } - printf("mlx5_core: ERR: ""failed to query ISSI\n"); + mlx5_core_err(dev, "failed to query ISSI\n"); return err; } @@ -563,7 +565,7 @@ static int mlx5_core_set_issi(struct mlx5_core_dev *de err = mlx5_cmd_exec(dev, set_in, sizeof(set_in), set_out, sizeof(set_out)); if (err) { - printf("mlx5_core: ERR: ""failed to set ISSI=1 err(%d)\n", err); + mlx5_core_err(dev, "failed to set ISSI=1 err(%d)\n", err); return err; } @@ -850,13 +852,13 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, st err = mlx5_pci_enable_device(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Cannot enable PCI device, aborting\n"); + mlx5_core_err(dev, "Cannot enable PCI device, aborting\n"); goto err_dbg; } err = request_bar(pdev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""error requesting BARs, aborting\n"); + mlx5_core_err(dev, "error requesting BARs, aborting\n"); goto err_disable; } @@ -864,7 +866,7 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, st err = set_dma_caps(pdev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed setting DMA capabilities mask, aborting\n"); + mlx5_core_err(dev, "Failed setting DMA capabilities mask, aborting\n"); goto err_clr_master; } @@ -872,7 +874,7 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, st dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg)); if (!dev->iseg) { err = -ENOMEM; - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed mapping initialization segment, aborting\n"); + mlx5_core_err(dev, "Failed mapping initialization segment, aborting\n"); goto err_clr_master; } @@ -895,28 +897,27 @@ static void mlx5_pci_close(struct mlx5_core_dev *dev, static int mlx5_init_once(struct mlx5_core_dev *dev, struct mlx5_priv *priv) { - struct pci_dev *pdev = dev->pdev; int err; err = mlx5_vsc_find_cap(dev); if (err) - dev_err(&pdev->dev, "Unable to find vendor specific capabilities\n"); + mlx5_core_err(dev, "Unable to find vendor specific capabilities\n"); err = mlx5_query_hca_caps(dev); if (err) { - dev_err(&pdev->dev, "query hca failed\n"); + mlx5_core_err(dev, "query hca failed\n"); goto out; } err = mlx5_query_board_id(dev); if (err) { - dev_err(&pdev->dev, "query board id failed\n"); + mlx5_core_err(dev, "query board id failed\n"); goto out; } err = mlx5_eq_init(dev); if (err) { - dev_err(&pdev->dev, "failed to initialize eq\n"); + mlx5_core_err(dev, "failed to initialize eq\n"); goto out; } @@ -924,7 +925,7 @@ static int mlx5_init_once(struct mlx5_core_dev *dev, s err = mlx5_init_cq_table(dev); if (err) { - dev_err(&pdev->dev, "failed to initialize cq table\n"); + mlx5_core_err(dev, "failed to initialize cq table\n"); goto err_eq_cleanup; } @@ -938,7 +939,7 @@ static int mlx5_init_once(struct mlx5_core_dev *dev, s #ifdef RATELIMIT err = mlx5_init_rl_table(dev); if (err) { - dev_err(&pdev->dev, "Failed to init rate limiting\n"); + mlx5_core_err(dev, "Failed to init rate limiting\n"); goto err_tables_cleanup; } #endif @@ -976,17 +977,16 @@ static void mlx5_cleanup_once(struct mlx5_core_dev *de static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, bool boot) { - struct pci_dev *pdev = dev->pdev; int err; mutex_lock(&dev->intf_state_mutex); if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { - dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n", - __func__); + mlx5_core_warn(dev, "interface is up, NOP\n"); goto out; } - device_printf((&pdev->dev)->bsddev, "INFO: ""firmware version: %d.%d.%d\n", fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); + mlx5_core_dbg(dev, "firmware version: %d.%d.%d\n", + fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); /* * On load removing any previous indication of internal error, @@ -996,103 +996,103 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st err = mlx5_cmd_init(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed initializing command interface, aborting\n"); + mlx5_core_err(dev, "Failed initializing command interface, aborting\n"); goto out_err; } err = wait_fw_init(dev, FW_INIT_TIMEOUT_MILI); if (err) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""Firmware over %d MS in initializing state, aborting\n", FW_INIT_TIMEOUT_MILI); + mlx5_core_err(dev, "Firmware over %d MS in initializing state, aborting\n", FW_INIT_TIMEOUT_MILI); goto err_cmd_cleanup; } err = mlx5_core_enable_hca(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""enable hca failed\n"); + mlx5_core_err(dev, "enable hca failed\n"); goto err_cmd_cleanup; } err = mlx5_core_set_issi(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""failed to set issi\n"); + mlx5_core_err(dev, "failed to set issi\n"); goto err_disable_hca; } err = mlx5_pagealloc_start(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""mlx5_pagealloc_start failed\n"); + mlx5_core_err(dev, "mlx5_pagealloc_start failed\n"); goto err_disable_hca; } err = mlx5_satisfy_startup_pages(dev, 1); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""failed to allocate boot pages\n"); + mlx5_core_err(dev, "failed to allocate boot pages\n"); goto err_pagealloc_stop; } err = set_hca_ctrl(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""set_hca_ctrl failed\n"); + mlx5_core_err(dev, "set_hca_ctrl failed\n"); goto reclaim_boot_pages; } err = handle_hca_cap(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap failed\n"); + mlx5_core_err(dev, "handle_hca_cap failed\n"); goto reclaim_boot_pages; } err = handle_hca_cap_atomic(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap_atomic failed\n"); + mlx5_core_err(dev, "handle_hca_cap_atomic failed\n"); goto reclaim_boot_pages; } err = mlx5_satisfy_startup_pages(dev, 0); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""failed to allocate init pages\n"); + mlx5_core_err(dev, "failed to allocate init pages\n"); goto reclaim_boot_pages; } err = mlx5_cmd_init_hca(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""init hca failed\n"); + mlx5_core_err(dev, "init hca failed\n"); goto reclaim_boot_pages; } mlx5_start_health_poll(dev); if (boot && mlx5_init_once(dev, priv)) { - dev_err(&pdev->dev, "sw objs init failed\n"); + mlx5_core_err(dev, "sw objs init failed\n"); goto err_stop_poll; } err = mlx5_enable_msix(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""enable msix failed\n"); + mlx5_core_err(dev, "enable msix failed\n"); goto err_cleanup_once; } err = mlx5_alloc_uuars(dev, &priv->uuari); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed allocating uar, aborting\n"); + mlx5_core_err(dev, "Failed allocating uar, aborting\n"); goto err_disable_msix; } err = mlx5_start_eqs(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed to start pages and async EQs\n"); + mlx5_core_err(dev, "Failed to start pages and async EQs\n"); goto err_free_uar; } err = alloc_comp_eqs(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed to alloc completion EQs\n"); + mlx5_core_err(dev, "Failed to alloc completion EQs\n"); goto err_stop_eqs; } if (map_bf_area(dev)) - device_printf((&pdev->dev)->bsddev, "ERR: ""Failed to map blue flame area\n"); + mlx5_core_err(dev, "Failed to map blue flame area\n"); err = mlx5_init_fs(dev); if (err) { @@ -1108,13 +1108,13 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st err = mlx5_fpga_device_start(dev); if (err) { - dev_err(&pdev->dev, "fpga device start failed %d\n", err); + mlx5_core_err(dev, "fpga device start failed %d\n", err); goto err_mpfs; } err = mlx5_register_device(dev); if (err) { - dev_err(&pdev->dev, "mlx5_register_device failed %d\n", err); + mlx5_core_err(dev, "mlx5_register_device failed %d\n", err); goto err_fpga; } @@ -1153,7 +1153,7 @@ err_cleanup_once: err_stop_poll: mlx5_stop_health_poll(dev, boot); if (mlx5_cmd_teardown_hca(dev)) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""tear_down_hca failed, skip cleanup\n"); + mlx5_core_err(dev, "tear_down_hca failed, skip cleanup\n"); goto out_err; } @@ -1186,7 +1186,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, mutex_lock(&dev->intf_state_mutex); if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { - dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", __func__); + mlx5_core_warn(dev, "%s: interface is down, NOP\n", __func__); if (cleanup) mlx5_cleanup_once(dev); goto out; @@ -1208,7 +1208,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, mlx5_stop_health_poll(dev, cleanup); err = mlx5_cmd_teardown_hca(dev); if (err) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""tear_down_hca failed, skip cleanup\n"); + mlx5_core_err(dev, "tear_down_hca failed, skip cleanup\n"); goto out; } mlx5_pagealloc_stop(dev); @@ -1276,7 +1276,9 @@ static int init_one(struct pci_dev *pdev, priv->pci_dev_data = id->driver_data; if (mlx5_prof_sel < 0 || mlx5_prof_sel >= ARRAY_SIZE(profiles)) { - device_printf(bsddev, "WARN: selected profile out of range, selecting default (%d)\n", MLX5_DEFAULT_PROF); + device_printf(bsddev, + "WARN: selected profile out of range, selecting default (%d)\n", + MLX5_DEFAULT_PROF); mlx5_prof_sel = MLX5_DEFAULT_PROF; } dev->profile = &profiles[mlx5_prof_sel]; @@ -1342,13 +1344,13 @@ static int init_one(struct pci_dev *pdev, mtx_init(&dev->dump_lock, "mlx5dmp", NULL, MTX_DEF | MTX_NEW); err = mlx5_pci_init(dev, priv); if (err) { - device_printf(bsddev, "ERR: mlx5_pci_init failed %d\n", err); + mlx5_core_err(dev, "mlx5_pci_init failed %d\n", err); goto clean_dev; } err = mlx5_health_init(dev); if (err) { - device_printf(bsddev, "ERR: mlx5_health_init failed %d\n", err); + mlx5_core_err(dev, "mlx5_health_init failed %d\n", err); goto close_pci; } @@ -1356,7 +1358,7 @@ static int init_one(struct pci_dev *pdev, err = mlx5_load_one(dev, priv, true); if (err) { - device_printf(bsddev, "ERR: mlx5_load_one failed %d\n", err); + mlx5_core_err(dev, "mlx5_load_one failed %d\n", err); goto clean_health; } @@ -1386,7 +1388,7 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; if (mlx5_unload_one(dev, priv, true)) { - dev_err(&dev->pdev->dev, "mlx5_unload_one failed\n"); + mlx5_core_err(dev, "mlx5_unload_one failed\n"); mlx5_health_cleanup(dev); return; } @@ -1407,7 +1409,7 @@ static pci_ers_result_t mlx5_pci_err_detected(struct p struct mlx5_core_dev *dev = pci_get_drvdata(pdev); struct mlx5_priv *priv = &dev->priv; - dev_info(&pdev->dev, "%s was called\n", __func__); + mlx5_core_info(dev, "%s was called\n", __func__); mlx5_enter_error_state(dev, false); mlx5_unload_one(dev, priv, false); @@ -1425,12 +1427,12 @@ static pci_ers_result_t mlx5_pci_slot_reset(struct pci struct mlx5_core_dev *dev = pci_get_drvdata(pdev); int err = 0; - dev_info(&pdev->dev, "%s was called\n", __func__); + mlx5_core_info(dev,"%s was called\n", __func__); err = mlx5_pci_enable_device(dev); if (err) { - dev_err(&pdev->dev, "%s: mlx5_pci_enable_device failed with error code: %d\n" - , __func__, err); + mlx5_core_err(dev, "mlx5_pci_enable_device failed with error code: %d\n" + ,err); return PCI_ERS_RESULT_DISCONNECT; } pci_set_master(pdev); @@ -1458,29 +1460,31 @@ static void wait_vital(struct pci_dev *pdev) msleep(1000); for (i = 0; i < niter; i++) { if (pci_read_config_word(pdev, 2, &did)) { - dev_warn(&pdev->dev, "failed reading config word\n"); + mlx5_core_warn(dev, "failed reading config word\n"); break; } if (did == pdev->device) { - dev_info(&pdev->dev, "device ID correctly read after %d iterations\n", i); + mlx5_core_info(dev, + "device ID correctly read after %d iterations\n", i); break; } msleep(50); } if (i == niter) - dev_warn(&pdev->dev, "%s-%d: could not read device ID\n", __func__, __LINE__); + mlx5_core_warn(dev, "could not read device ID\n"); for (i = 0; i < niter; i++) { count = ioread32be(health->health_counter); if (count && count != 0xffffffff) { - dev_info(&pdev->dev, "Counter value 0x%x after %d iterations\n", count, i); + mlx5_core_info(dev, + "Counter value 0x%x after %d iterations\n", count, i); break; } msleep(50); } if (i == niter) - dev_warn(&pdev->dev, "%s-%d: could not read device ID\n", __func__, __LINE__); + mlx5_core_warn(dev, "could not read device ID\n"); } static void mlx5_pci_resume(struct pci_dev *pdev) @@ -1489,16 +1493,16 @@ static void mlx5_pci_resume(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; int err; - dev_info(&pdev->dev, "%s was called\n", __func__); + mlx5_core_info(dev,"%s was called\n", __func__); wait_vital(pdev); err = mlx5_load_one(dev, priv, false); if (err) - dev_err(&pdev->dev, "%s: mlx5_load_one failed with error code: %d\n" - , __func__, err); + mlx5_core_err(dev, + "mlx5_load_one failed with error code: %d\n" ,err); else - dev_info(&pdev->dev, "%s: device recovered\n", __func__); + mlx5_core_info(dev,"device recovered\n"); } static const struct pci_error_handlers mlx5_err_handler = { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c Wed Oct 2 09:48:01 2019 (r352975) @@ -33,6 +33,8 @@ #include #include +#include "mlx5_core.h" + #define MPFS_LOCK(dev) spin_lock(&(dev)->mpfs.spinlock) #define MPFS_UNLOCK(dev) spin_unlock(&(dev)->mpfs.spinlock) @@ -119,7 +121,7 @@ mlx5_mpfs_destroy(struct mlx5_core_dev *dev) num = bitmap_weight(dev->mpfs.bitmap, MLX5_MPFS_TABLE_MAX); if (num != 0) - dev_err(&dev->pdev->dev, "Leaking %u MPFS MAC table entries\n", num); + mlx5_core_err(dev, "Leaking %u MPFS MAC table entries\n", num); spin_lock_destroy(&dev->mpfs.spinlock); } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Oct 2 09:46:14 2019 (r352974) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Oct 2 09:48:01 2019 (r352975) @@ -618,7 +618,7 @@ out: } EXPORT_SYMBOL_GPL(mlx5_core_access_ptys); -static int mtu_to_ib_mtu(int mtu) +static int mtu_to_ib_mtu(struct mlx5_core_dev *dev, int mtu) { switch (mtu) { case 256: return 1; @@ -627,7 +627,7 @@ static int mtu_to_ib_mtu(int mtu) case 2048: return 4; case 4096: return 5; default: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Oct 2 09:49:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DD1712951B; Wed, 2 Oct 2019 09:49:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrvt3YlXz482q; Wed, 2 Oct 2019 09:49:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A19229A8C; Wed, 2 Oct 2019 09:49:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929nkWA017192; Wed, 2 Oct 2019 09:49:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929njxv017186; Wed, 2 Oct 2019 09:49:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020949.x929njxv017186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352976 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:49:46 -0000 Author: hselasky Date: Wed Oct 2 09:49:44 2019 New Revision: 352976 URL: https://svnweb.freebsd.org/changeset/base/352976 Log: Unify prints in mlx5en(4). All prints in mlx5en(4) should use on of the macros: mlx5_en_err/dbg/warn Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:49:44 2019 (r352976) @@ -143,6 +143,21 @@ struct mlx5e_cq; typedef void (mlx5e_cq_comp_t)(struct mlx5_core_cq *); +#define mlx5_en_err(_dev, format, ...) \ + if_printf(_dev, "ERR: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ + ##__VA_ARGS__) + +#define mlx5_en_warn(_dev, format, ...) \ + if_printf(_dev, "WARN: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ + ##__VA_ARGS__) + +#define mlx5_en_info(_dev, format, ...) \ + if_printf(_dev, "INFO: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ + ##__VA_ARGS__) + #define MLX5E_STATS_COUNT(a, ...) a #define MLX5E_STATS_VAR(a, b, c, ...) b c; #define MLX5E_STATS_DESC(a, b, c, d, e, ...) d, e, Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 09:49:44 2019 (r352976) @@ -684,7 +684,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) } else { priv->params.hw_lro_en = false; - if_printf(priv->ifp, "To enable HW LRO " + mlx5_en_warn(priv->ifp, "To enable HW LRO " "please also enable LRO via ifconfig(8).\n"); } } else { @@ -824,8 +824,8 @@ mlx5e_get_eeprom_info(struct mlx5e_priv *priv, struct ret = mlx5_query_module_num(dev, &eeprom->module_num); if (ret) { - if_printf(priv->ifp, "%s:%d: Failed query module error=%d\n", - __func__, __LINE__, ret); + mlx5_en_err(priv->ifp, "Failed query module error=%d\n", + ret); return (ret); } @@ -834,8 +834,8 @@ mlx5e_get_eeprom_info(struct mlx5e_priv *priv, struct eeprom->device_addr, MLX5E_EEPROM_INFO_BYTES, eeprom->module_num, &data, &size_read); if (ret) { - if_printf(priv->ifp, "%s:%d: Failed query eeprom module error=0x%x\n", - __func__, __LINE__, ret); + mlx5_en_err(priv->ifp, + "Failed query eeprom module error=0x%x\n", ret); return (ret); } @@ -862,8 +862,9 @@ mlx5e_get_eeprom_info(struct mlx5e_priv *priv, struct eeprom->len = MLX5E_ETH_MODULE_SFF_8472_LEN; break; default: - if_printf(priv->ifp, "%s:%d: Not recognized cable type = 0x%x(%s)\n", - __func__, __LINE__, data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK, + mlx5_en_err(priv->ifp, + "Not recognized cable type = 0x%x(%s)\n", + data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK, sff_8024_id[data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK]); return (EINVAL); } @@ -887,8 +888,8 @@ mlx5e_get_eeprom(struct mlx5e_priv *priv, struct mlx5e ee->len - ee->device_addr, ee->module_num, ee->data + (ee->device_addr / 4), &size_read); if (ret) { - if_printf(priv->ifp, "%s:%d: Failed reading eeprom, " - "error = 0x%02x\n", __func__, __LINE__, ret); + mlx5_en_err(priv->ifp, + "Failed reading eeprom, error = 0x%02x\n",ret); return (ret); } ee->device_addr += size_read; @@ -906,8 +907,9 @@ mlx5e_get_eeprom(struct mlx5e_priv *priv, struct mlx5e ((ee->device_addr - MLX5E_EEPROM_HIGH_PAGE_OFFSET) / 4), &size_read); if (ret) { - if_printf(priv->ifp, "%s:%d: Failed reading eeprom, " - "error = 0x%02x\n", __func__, __LINE__, ret); + mlx5_en_err(priv->ifp, + "Failed reading eeprom, error = 0x%02x\n", + ret); return (ret); } ee->device_addr += size_read; @@ -983,8 +985,8 @@ mlx5e_read_eeprom(SYSCTL_HANDLER_ARGS) /* Read three first bytes to get important info */ error = mlx5e_get_eeprom_info(priv, &eeprom); if (error) { - if_printf(priv->ifp, "%s:%d: Failed reading eeprom's " - "initial information\n", __func__, __LINE__); + mlx5_en_err(priv->ifp, + "Failed reading eeprom's initial information\n"); error = 0; goto done; } @@ -998,8 +1000,7 @@ mlx5e_read_eeprom(SYSCTL_HANDLER_ARGS) /* Read the whole eeprom information */ error = mlx5e_get_eeprom(priv, &eeprom); if (error) { - if_printf(priv->ifp, "%s:%d: Failed reading eeprom\n", - __func__, __LINE__); + mlx5_en_err(priv->ifp, "Failed reading eeprom\n"); error = 0; /* * Continue printing partial information in case of Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed Oct 2 09:49:44 2019 (r352976) @@ -436,7 +436,7 @@ mlx5e_add_eth_addr_rule(struct mlx5e_priv *priv, match_value = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); if (!match_value || !match_criteria) { - if_printf(priv->ifp, "%s: alloc failed\n", __func__); + mlx5_en_err(priv->ifp, "alloc failed\n"); err = -ENOMEM; goto add_eth_addr_rule_out; } @@ -467,7 +467,7 @@ static int mlx5e_vport_context_update_vlans(struct mlx max_list_size = 1 << MLX5_CAP_GEN(priv->mdev, log_max_vlan_list); if (list_size > max_list_size) { - if_printf(ifp, + mlx5_en_err(ifp, "ifnet vlans list size (%d) > (%d) max vport list size, some vlans will be dropped\n", list_size, max_list_size); list_size = max_list_size; @@ -486,7 +486,7 @@ static int mlx5e_vport_context_update_vlans(struct mlx err = mlx5_modify_nic_vport_vlans(priv->mdev, vlans, list_size); if (err) - if_printf(ifp, "Failed to modify vport vlans list err(%d)\n", + mlx5_en_err(ifp, "Failed to modify vport vlans list err(%d)\n", err); kfree(vlans); @@ -549,7 +549,7 @@ mlx5e_add_vlan_rule_sub(struct mlx5e_priv *priv, if (IS_ERR(*rule_p)) { err = PTR_ERR(*rule_p); *rule_p = NULL; - if_printf(priv->ifp, "%s: add rule failed\n", __func__); + mlx5_en_err(priv->ifp, "add rule failed\n"); } return (err); @@ -566,7 +566,7 @@ mlx5e_add_vlan_rule(struct mlx5e_priv *priv, match_value = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); if (!match_value || !match_criteria) { - if_printf(priv->ifp, "%s: alloc failed\n", __func__); + mlx5_en_err(priv->ifp, "alloc failed\n"); err = -ENOMEM; goto add_vlan_rule_out; } @@ -948,7 +948,7 @@ static void mlx5e_vport_context_update_addr_list(struc size++; if (size > max_size) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "ifp %s list size (%d) > (%d) max vport list size, some addresses will be dropped\n", is_uc ? "UC" : "MC", size, max_size); size = max_size; @@ -966,7 +966,7 @@ static void mlx5e_vport_context_update_addr_list(struc err = mlx5_modify_nic_vport_mac_list(priv->mdev, list_type, addr_array, size); out: if (err) - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "Failed to modify vport %s list err(%d)\n", is_uc ? "UC" : "MC", err); kfree(addr_array); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 09:49:44 2019 (r352976) @@ -429,8 +429,8 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) if (error) { priv->media_active_last = IFM_ETHER; priv->ifp->if_baudrate = 1; - if_printf(priv->ifp, "%s: query port ptys failed: " - "0x%x\n", __func__, error); + mlx5_en_err(priv->ifp, "query port ptys failed: 0x%x\n", + error); return; } @@ -448,8 +448,8 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) } if (media_entry.subtype == 0) { - if_printf(priv->ifp, "%s: Could not find operational " - "media subtype\n", __func__); + mlx5_en_err(priv->ifp, + "Could not find operational media subtype\n"); return; } @@ -457,8 +457,8 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) case IFM_10G_ER: error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); if (error != 0) { - if_printf(priv->ifp, "%s: query port pddr failed: %d\n", - __func__, error); + mlx5_en_err(priv->ifp, + "query port pddr failed: %d\n", error); } if (error != 0 || is_er_type == 0) media_entry.subtype = IFM_10G_LR; @@ -466,8 +466,8 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) case IFM_40G_LR4: error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); if (error != 0) { - if_printf(priv->ifp, "%s: query port pddr failed: %d\n", - __func__, error); + mlx5_en_err(priv->ifp, + "query port pddr failed: %d\n", error); } if (error == 0 && is_er_type != 0) media_entry.subtype = IFM_40G_ER4; @@ -546,9 +546,8 @@ mlx5e_set_port_pfc(struct mlx5e_priv *priv) error = -ENXIO; } else if (priv->params.rx_pauseframe_control || priv->params.tx_pauseframe_control) { - if_printf(priv->ifp, - "Global pauseframes must be disabled before " - "enabling PFC.\n"); + mlx5_en_err(priv->ifp, + "Global pauseframes must be disabled before enabling PFC.\n"); error = -EINVAL; } else { error = mlx5e_set_port_pause_and_pfc(priv); @@ -581,7 +580,7 @@ mlx5e_media_change(struct ifnet *dev) error = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN, 1); if (error != 0) { - if_printf(dev, "Query port media capability failed\n"); + mlx5_en_err(dev, "Query port media capability failed\n"); goto done; } @@ -596,14 +595,14 @@ mlx5e_media_change(struct ifnet *dev) if (IFM_SUBTYPE(priv->media.ifm_media) == IFM_AUTO) { link_mode = eth_proto_cap; if (link_mode == 0) { - if_printf(dev, "Port media capability is zero\n"); + mlx5_en_err(dev, "Port media capability is zero\n"); error = EINVAL; goto done; } } else { link_mode = link_mode & eth_proto_cap; if (link_mode == 0) { - if_printf(dev, "Not supported link mode requested\n"); + mlx5_en_err(dev, "Not supported link mode requested\n"); error = EINVAL; goto done; } @@ -612,7 +611,7 @@ mlx5e_media_change(struct ifnet *dev) /* check if PFC is enabled */ if (priv->params.rx_priority_flow_control || priv->params.tx_priority_flow_control) { - if_printf(dev, "PFC must be disabled before enabling global pauseframes.\n"); + mlx5_en_err(dev, "PFC must be disabled before enabling global pauseframes.\n"); error = EINVAL; goto done; } @@ -1021,7 +1020,8 @@ free_out: priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL, priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL); if (error != 0) - if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error); + mlx5_en_err(priv->ifp, + "Failed reading diagnostics: %d\n", error); } } @@ -1173,8 +1173,8 @@ mlx5e_calibration_callout(void *arg) if (((next->clbr_hw_curr - curr->clbr_hw_curr) >> MLX5E_TSTMP_PREC) == 0) { if (priv->clbr_done != 0) { - if_printf(priv->ifp, "HW failed tstmp frozen %#jx %#jx," - "disabling\n", + mlx5_en_err(priv->ifp, + "HW failed tstmp frozen %#jx %#jx, disabling\n", next->clbr_hw_curr, curr->clbr_hw_prev); priv->clbr_done = 0; } @@ -1872,7 +1872,7 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* error out remaining requests */ error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); if (error != 0) { - if_printf(sq->ifp, + mlx5_en_err(sq->ifp, "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); } @@ -2936,16 +2936,17 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) err = mlx5_set_port_mtu(mdev, hw_mtu); if (err) { - if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", - __func__, sw_mtu, err); + mlx5_en_err(ifp, "mlx5_set_port_mtu failed setting %d, err=%d\n", + sw_mtu, err); return (err); } /* Update vport context MTU */ err = mlx5_set_vport_mtu(mdev, hw_mtu); if (err) { - if_printf(ifp, "%s: Failed updating vport context with MTU size, err=%d\n", - __func__, err); + mlx5_en_err(ifp, + "Failed updating vport context with MTU size, err=%d\n", + err); } ifp->if_mtu = sw_mtu; @@ -2956,17 +2957,19 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); } if (err) { - if_printf(ifp, "Query port MTU, after setting new " - "MTU value, failed\n"); + mlx5_en_err(ifp, + "Query port MTU, after setting new MTU value, failed\n"); return (err); } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { err = -E2BIG, - if_printf(ifp, "Port MTU %d is smaller than " - "ifp mtu %d\n", hw_mtu, sw_mtu); + mlx5_en_err(ifp, + "Port MTU %d is smaller than ifp mtu %d\n", + hw_mtu, sw_mtu); } else if (MLX5E_HW2SW_MTU(hw_mtu) > sw_mtu) { err = -EINVAL; - if_printf(ifp, "Port MTU %d is bigger than " - "ifp mtu %d\n", hw_mtu, sw_mtu); + mlx5_en_err(ifp, + "Port MTU %d is bigger than ifp mtu %d\n", + hw_mtu, sw_mtu); } priv->params_ethtool.hw_mtu = hw_mtu; @@ -2986,23 +2989,21 @@ mlx5e_open_locked(struct ifnet *ifp) #ifdef RSS if (rss_getnumbuckets() > priv->params.num_channels) { - if_printf(ifp, "NOTE: There are more RSS buckets(%u) than " - "channels(%u) available\n", rss_getnumbuckets(), - priv->params.num_channels); + mlx5_en_info(ifp, + "NOTE: There are more RSS buckets(%u) than channels(%u) available\n", + rss_getnumbuckets(), priv->params.num_channels); } #endif err = mlx5e_open_tises(priv); if (err) { - if_printf(ifp, "%s: mlx5e_open_tises failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5e_open_tises failed, %d\n", err); return (err); } err = mlx5_vport_alloc_q_counter(priv->mdev, MLX5_INTERFACE_PROTOCOL_ETH, &set_id); if (err) { - if_printf(priv->ifp, - "%s: mlx5_vport_alloc_q_counter failed: %d\n", - __func__, err); + mlx5_en_err(priv->ifp, + "mlx5_vport_alloc_q_counter failed: %d\n", err); goto err_close_tises; } /* store counter set ID */ @@ -3010,32 +3011,30 @@ mlx5e_open_locked(struct ifnet *ifp) err = mlx5e_open_channels(priv); if (err) { - if_printf(ifp, "%s: mlx5e_open_channels failed, %d\n", - __func__, err); + mlx5_en_err(ifp, + "mlx5e_open_channels failed, %d\n", err); goto err_dalloc_q_counter; } err = mlx5e_open_rqt(priv); if (err) { - if_printf(ifp, "%s: mlx5e_open_rqt failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5e_open_rqt failed, %d\n", err); goto err_close_channels; } err = mlx5e_open_tirs(priv); if (err) { - if_printf(ifp, "%s: mlx5e_open_tir failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5e_open_tir failed, %d\n", err); goto err_close_rqls; } err = mlx5e_open_flow_table(priv); if (err) { - if_printf(ifp, "%s: mlx5e_open_flow_table failed, %d\n", - __func__, err); + mlx5_en_err(ifp, + "mlx5e_open_flow_table failed, %d\n", err); goto err_close_tirs; } err = mlx5e_add_all_vlan_rules(priv); if (err) { - if_printf(ifp, "%s: mlx5e_add_all_vlan_rules failed, %d\n", - __func__, err); + mlx5_en_err(ifp, + "mlx5e_add_all_vlan_rules failed, %d\n", err); goto err_close_flow_table; } set_bit(MLX5E_STATE_OPENED, &priv->state); @@ -3074,9 +3073,8 @@ mlx5e_open(void *arg) PRIV_LOCK(priv); if (mlx5_set_port_status(priv->mdev, MLX5_PORT_UP)) - if_printf(priv->ifp, - "%s: Setting port status to up failed\n", - __func__); + mlx5_en_err(priv->ifp, + "Setting port status to up failed\n"); mlx5e_open_locked(priv->ifp); priv->ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -3213,7 +3211,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t mlx5e_open_locked(ifp); } else { error = EINVAL; - if_printf(ifp, "Invalid MTU value. Min val: %d, Max val: %d\n", + mlx5_en_err(ifp, + "Invalid MTU value. Min val: %d, Max val: %d\n", MLX5E_MTU_MIN, MIN(MLX5E_MTU_MAX, max_mtu)); } PRIV_UNLOCK(priv); @@ -3267,7 +3266,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t !(IFCAP_TXCSUM & ifp->if_capenable)) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_IP_TSO; - if_printf(ifp, + mlx5_en_err(ifp, "tso4 disabled due to -txcsum.\n"); } } @@ -3279,7 +3278,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { ifp->if_capenable &= ~IFCAP_TSO6; ifp->if_hwassist &= ~CSUM_IP6_TSO; - if_printf(ifp, + mlx5_en_err(ifp, "tso6 disabled due to -txcsum6.\n"); } } @@ -3292,7 +3291,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (mask & IFCAP_TSO4) { if (!(IFCAP_TSO4 & ifp->if_capenable) && !(IFCAP_TXCSUM & ifp->if_capenable)) { - if_printf(ifp, "enable txcsum first.\n"); + mlx5_en_err(ifp, "enable txcsum first.\n"); error = EAGAIN; goto out; } @@ -3302,7 +3301,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (mask & IFCAP_TSO6) { if (!(IFCAP_TSO6 & ifp->if_capenable) && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { - if_printf(ifp, "enable txcsum6 first.\n"); + mlx5_en_err(ifp, "enable txcsum6 first.\n"); error = EAGAIN; goto out; } @@ -3382,8 +3381,8 @@ out: /* Get module_num which is required for the query_eeprom */ error = mlx5_query_module_num(priv->mdev, &module_num); if (error) { - if_printf(ifp, "Query module num failed, eeprom " - "reading is not supported\n"); + mlx5_en_err(ifp, + "Query module num failed, eeprom reading is not supported\n"); error = EINVAL; goto err_i2c; } @@ -3402,8 +3401,9 @@ out: else if (i2c.dev_addr == 0xA2) read_addr = MLX5E_I2C_ADDR_HIGH; else { - if_printf(ifp, "Query eeprom failed, " - "Invalid Address: %X\n", i2c.dev_addr); + mlx5_en_err(ifp, + "Query eeprom failed, Invalid Address: %X\n", + i2c.dev_addr); error = EINVAL; goto err_i2c; } @@ -3412,8 +3412,8 @@ out: (uint32_t)i2c.offset, (uint32_t)i2c.len, module_num, (uint32_t *)i2c.data, &size_read); if (error) { - if_printf(ifp, "Query eeprom failed, eeprom " - "reading is not supported\n"); + mlx5_en_err(ifp, + "Query eeprom failed, eeprom reading is not supported\n"); error = EINVAL; goto err_i2c; } @@ -3426,8 +3426,8 @@ out: (uint32_t *)(i2c.data + size_read), &size_read); } if (error) { - if_printf(ifp, "Query eeprom failed, eeprom " - "reading is not supported\n"); + mlx5_en_err(ifp, + "Query eeprom failed, eeprom reading is not supported\n"); error = EINVAL; goto err_i2c; } @@ -3563,7 +3563,7 @@ mlx5e_create_mkey(struct mlx5e_priv *priv, u32 pdn, in = mlx5_vzalloc(inlen); if (in == NULL) { - if_printf(ifp, "%s: failed to allocate inbox\n", __func__); + mlx5_en_err(ifp, "failed to allocate inbox\n"); return (-ENOMEM); } @@ -3578,8 +3578,8 @@ mlx5e_create_mkey(struct mlx5e_priv *priv, u32 pdn, err = mlx5_core_create_mkey(mdev, mkey, in, inlen); if (err) - if_printf(ifp, "%s: mlx5_core_create_mkey failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5_core_create_mkey failed, %d\n", + err); kvfree(in); return (err); @@ -3660,7 +3660,7 @@ mlx5e_resume_sq(struct mlx5e_sq *sq) err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_ERR, MLX5_SQC_STATE_RST); if (err != 0) { - if_printf(sq->ifp, + mlx5_en_err(sq->ifp, "mlx5e_modify_sq() from ERR to RST failed: %d\n", err); } @@ -3673,7 +3673,7 @@ mlx5e_resume_sq(struct mlx5e_sq *sq) err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RST, MLX5_SQC_STATE_RDY); if (err != 0) { - if_printf(sq->ifp, + mlx5_en_err(sq->ifp, "mlx5e_modify_sq() from RST to RDY failed: %d\n", err); } @@ -3705,7 +3705,7 @@ mlx5e_disable_rx_dma(struct mlx5e_channel *ch) err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); if (err != 0) { - if_printf(rq->ifp, + mlx5_en_err(rq->ifp, "mlx5e_modify_rq() from RDY to RST failed: %d\n", err); } @@ -3720,7 +3720,7 @@ mlx5e_disable_rx_dma(struct mlx5e_channel *ch) */ err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_ERR, MLX5_RQC_STATE_RST); if (err != 0) { - if_printf(rq->ifp, + mlx5_en_err(rq->ifp, "mlx5e_modify_rq() from ERR to RST failed: %d\n", err); } } @@ -3735,7 +3735,7 @@ mlx5e_enable_rx_dma(struct mlx5e_channel *ch) mlx5_wq_ll_update_db_record(&rq->wq); err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_RST, MLX5_RQC_STATE_RDY); if (err != 0) { - if_printf(rq->ifp, + mlx5_en_err(rq->ifp, "mlx5e_modify_rq() from RST to RDY failed: %d\n", err); } @@ -3943,7 +3943,7 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) /* update firmware */ error = mlx5e_set_port_pause_and_pfc(priv); if (error == -EINVAL) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "Global pauseframes must be disabled before enabling PFC.\n"); priv->params.rx_priority_flow_control = 0; priv->params.tx_priority_flow_control = 0; @@ -4253,26 +4253,23 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) err = mlx5_alloc_map_uar(mdev, &priv->cq_uar); if (err) { - if_printf(ifp, "%s: mlx5_alloc_map_uar failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5_alloc_map_uar failed, %d\n", err); goto err_free_wq; } err = mlx5_core_alloc_pd(mdev, &priv->pdn); if (err) { - if_printf(ifp, "%s: mlx5_core_alloc_pd failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5_core_alloc_pd failed, %d\n", err); goto err_unmap_free_uar; } err = mlx5_alloc_transport_domain(mdev, &priv->tdn); if (err) { - if_printf(ifp, "%s: mlx5_alloc_transport_domain failed, %d\n", - __func__, err); + mlx5_en_err(ifp, + "mlx5_alloc_transport_domain failed, %d\n", err); goto err_dealloc_pd; } err = mlx5e_create_mkey(priv, priv->pdn, &priv->mr); if (err) { - if_printf(ifp, "%s: mlx5e_create_mkey failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5e_create_mkey failed, %d\n", err); goto err_dealloc_transport_domain; } mlx5_query_nic_vport_mac_address(priv->mdev, 0, dev_addr); @@ -4281,13 +4278,12 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) if (MLX5_CAP_GEN(priv->mdev, vport_group_manager) == 0 && is_zero_ether_addr(dev_addr)) { random_ether_addr(dev_addr); - if_printf(ifp, "Assigned random MAC address\n"); + mlx5_en_err(ifp, "Assigned random MAC address\n"); } #ifdef RATELIMIT err = mlx5e_rl_init(priv); if (err) { - if_printf(ifp, "%s: mlx5e_rl_init failed, %d\n", - __func__, err); + mlx5_en_err(ifp, "mlx5e_rl_init failed, %d\n", err); goto err_create_mkey; } #endif @@ -4315,8 +4311,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) connector_type); } else { eth_proto_cap = 0; - if_printf(ifp, "%s: Query port media capability failed," - " %d\n", __func__, err); + mlx5_en_err(ifp, "Query port media capability failed, %d\n", err); } ifmedia_init(&priv->media, IFM_IMASK | IFM_ETH_FMASK, @@ -4439,8 +4434,8 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp * detaching: */ while (READ_ONCE(priv->rl.stats.tx_active_connections) != 0) { - if_printf(priv->ifp, "Waiting for all ratelimit connections " - "to terminate\n"); + mlx5_en_err(priv->ifp, + "Waiting for all ratelimit connections to terminate\n"); pause("W", hz); } #endif @@ -4461,8 +4456,8 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp /* wait for all unlimited send tags to go away */ while (priv->channel_refs != 0) { - if_printf(priv->ifp, "Waiting for all unlimited connections " - "to terminate\n"); + mlx5_en_err(priv->ifp, + "Waiting for all unlimited connections to terminate\n"); pause("W", hz); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Wed Oct 2 09:49:44 2019 (r352976) @@ -518,7 +518,7 @@ mlx5e_rl_worker(void *arg) MLX5E_RL_WORKER_LOCK(rlw); if (error != 0) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "mlx5e_rl_open_channel failed: %d\n", error); break; } @@ -551,7 +551,7 @@ mlx5e_rl_worker(void *arg) MLX5E_RL_RUNLOCK(&priv->rl); if (error != 0) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "mlx5e_rl_open_channel failed: %d\n", error); } else { atomic_add_64(&rlw->priv->rl.stats.tx_open_queues, 1ULL); @@ -565,7 +565,7 @@ mlx5e_rl_worker(void *arg) error = mlx5e_rlw_channel_set_rate_locked(rlw, channel, channel->new_rate * 8ULL); if (error != 0) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "mlx5e_rlw_channel_set_rate_locked failed: %d\n", error); } @@ -574,7 +574,7 @@ mlx5e_rl_worker(void *arg) case MLX5E_RL_ST_DESTROY: error = mlx5e_rlw_channel_set_rate_locked(rlw, channel, 0); if (error != 0) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "mlx5e_rlw_channel_set_rate_locked failed: %d\n", error); } @@ -855,7 +855,7 @@ mlx5e_rl_init(struct mlx5e_priv *priv) PRIV_UNLOCK(priv); if (error != 0) { - if_printf(priv->ifp, + mlx5_en_err(priv->ifp, "mlx5e_rl_open_workers failed: %d\n", error); } @@ -893,7 +893,7 @@ mlx5e_rl_open_workers(struct mlx5e_priv *priv) error = kproc_kthread_add(mlx5e_rl_worker, rlw, &rl_proc, &rl_thread, RFHIGHPID, 0, "mlx5-ratelimit", "mlx5-rl-worker-thread-%d", (int)j); if (error != 0) { - if_printf(rl->priv->ifp, + mlx5_en_err(rl->priv->ifp, "kproc_kthread_add failed: %d\n", error); rlw->worker_done = 1; } @@ -1089,7 +1089,8 @@ mlx5e_find_available_tx_ring_index(struct mlx5e_rl_wor *pchannel = channel; #ifdef RATELIMIT_DEBUG - if_printf(rlw->priv->ifp, "Channel pointer for rate limit connection is %p\n", channel); + mlx5_en_info(rlw->priv->ifp, + "Channel pointer for rate limit connection is %p\n", channel); #endif return (retval); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Wed Oct 2 09:48:01 2019 (r352975) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Wed Oct 2 09:49:44 2019 (r352976) @@ -48,6 +48,6 @@ mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int eve { struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); - if_printf(cq->priv->ifp, "%s: cqn=0x%.6x event=0x%.2x\n", - __func__, mcq->cqn, event); + mlx5_en_err(cq->priv->ifp, "cqn=0x%.6x event=0x%.2x\n", + mcq->cqn, event); } From owner-svn-src-all@freebsd.org Wed Oct 2 09:56:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E17312981A; Wed, 2 Oct 2019 09:56:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46js3c0TJrz48Td; Wed, 2 Oct 2019 09:56:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E49A029C47; Wed, 2 Oct 2019 09:56:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929uRI5022898; Wed, 2 Oct 2019 09:56:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929uRbM022897; Wed, 2 Oct 2019 09:56:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020956.x929uRbM022897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352977 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 352977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:56:28 -0000 Author: hselasky Date: Wed Oct 2 09:56:27 2019 New Revision: 352977 URL: https://svnweb.freebsd.org/changeset/base/352977 Log: Sort the ports registers definitions numerically in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:49:44 2019 (r352976) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:56:27 2019 (r352977) @@ -126,24 +126,24 @@ enum { MLX5_REG_QCAM = 0x4019, MLX5_REG_DCBX_PARAM = 0x4020, MLX5_REG_DCBX_APP = 0x4021, - MLX5_REG_PCAP = 0x5001, MLX5_REG_FPGA_CAP = 0x4022, MLX5_REG_FPGA_CTRL = 0x4023, MLX5_REG_FPGA_ACCESS_REG = 0x4024, MLX5_REG_FPGA_SHELL_CNTR = 0x4025, + MLX5_REG_PCAP = 0x5001, + MLX5_REG_PMLP = 0x5002, MLX5_REG_PMTU = 0x5003, MLX5_REG_PTYS = 0x5004, MLX5_REG_PAOS = 0x5006, MLX5_REG_PFCC = 0x5007, MLX5_REG_PPCNT = 0x5008, - MLX5_REG_PMAOS = 0x5012, MLX5_REG_PUDE = 0x5009, MLX5_REG_PPTB = 0x500B, MLX5_REG_PBMC = 0x500C, + MLX5_REG_PELC = 0x500E, + MLX5_REG_PVLC = 0x500F, MLX5_REG_PMPE = 0x5010, - MLX5_REG_PELC = 0x500e, - MLX5_REG_PVLC = 0x500f, - MLX5_REG_PMLP = 0x5002, + MLX5_REG_PMAOS = 0x5012, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, From owner-svn-src-all@freebsd.org Wed Oct 2 09:57:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51FCC129897; Wed, 2 Oct 2019 09:57:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46js4T1TM7z48cY; Wed, 2 Oct 2019 09:57:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16CC129C48; Wed, 2 Oct 2019 09:57:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929vCnO022980; Wed, 2 Oct 2019 09:57:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929vCGi022979; Wed, 2 Oct 2019 09:57:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020957.x929vCGi022979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352978 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 352978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:57:13 -0000 Author: hselasky Date: Wed Oct 2 09:57:12 2019 New Revision: 352978 URL: https://svnweb.freebsd.org/changeset/base/352978 Log: Add definition for the Port Buffer Status Register in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 09:56:27 2019 (r352977) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 09:57:12 2019 (r352978) @@ -144,6 +144,7 @@ enum { MLX5_REG_PVLC = 0x500F, MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, + MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, From owner-svn-src-all@freebsd.org Wed Oct 2 09:58:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7EFC129939; Wed, 2 Oct 2019 09:58:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46js5N4sxfz48lV; Wed, 2 Oct 2019 09:58:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B95829C4A; Wed, 2 Oct 2019 09:58:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929w0vO023058; Wed, 2 Oct 2019 09:58:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929w08V023057; Wed, 2 Oct 2019 09:58:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020958.x929w08V023057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352979 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 352979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:58:00 -0000 Author: hselasky Date: Wed Oct 2 09:58:00 2019 New Revision: 352979 URL: https://svnweb.freebsd.org/changeset/base/352979 Log: Update definitons for PPTB and PBMC registers layouts in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:57:12 2019 (r352978) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 09:58:00 2019 (r352979) @@ -1557,26 +1557,19 @@ struct mlx5_ifc_field_select_802_1qau_rp_bits { }; struct mlx5_ifc_pptb_reg_bits { - u8 reserved_0[0x2]; + u8 reserved_at_0[0x2]; u8 mm[0x2]; - u8 reserved_1[0x4]; + u8 reserved_at_4[0x4]; u8 local_port[0x8]; - u8 reserved_2[0x6]; + u8 reserved_at_10[0x6]; u8 cm[0x1]; u8 um[0x1]; u8 pm[0x8]; - u8 prio7buff[0x4]; - u8 prio6buff[0x4]; - u8 prio5buff[0x4]; - u8 prio4buff[0x4]; - u8 prio3buff[0x4]; - u8 prio2buff[0x4]; - u8 prio1buff[0x4]; - u8 prio0buff[0x4]; + u8 prio_x_buff[0x20]; u8 pm_msb[0x8]; - u8 reserved_3[0x10]; + u8 reserved_at_48[0x10]; u8 ctrl_buff[0x4]; u8 untagged_buff[0x4]; }; @@ -8690,21 +8683,20 @@ struct mlx5_ifc_pcap_reg_bits { }; struct mlx5_ifc_pbmc_reg_bits { - u8 reserved_0[0x8]; + u8 reserved_at_0[0x8]; u8 local_port[0x8]; - u8 reserved_1[0x10]; + u8 reserved_at_10[0x10]; u8 xoff_timer_value[0x10]; u8 xoff_refresh[0x10]; - u8 reserved_2[0x10]; + u8 reserved_at_40[0x9]; + u8 fullness_threshold[0x7]; u8 port_buffer_size[0x10]; struct mlx5_ifc_bufferx_reg_bits buffer[10]; - u8 reserved_3[0x40]; - - u8 port_shared_buffer[0x40]; + u8 reserved_at_2e0[0x40]; }; struct mlx5_ifc_paos_reg_bits { From owner-svn-src-all@freebsd.org Wed Oct 2 09:59:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9D791299CC; Wed, 2 Oct 2019 09:59:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46js7L51GJz48tZ; Wed, 2 Oct 2019 09:59:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C36D29C4B; Wed, 2 Oct 2019 09:59:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929xgDw023176; Wed, 2 Oct 2019 09:59:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929xgCR023175; Wed, 2 Oct 2019 09:59:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020959.x929xgCR023175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352980 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 09:59:42 -0000 Author: hselasky Date: Wed Oct 2 09:59:42 2019 New Revision: 352980 URL: https://svnweb.freebsd.org/changeset/base/352980 Log: Add mlx5e_dbg() compatibility macro. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:58:00 2019 (r352979) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:59:42 2019 (r352980) @@ -1171,6 +1171,8 @@ mlx5e_unref_channel(struct mlx5e_priv *priv) atomic_fetchadd_int(&priv->channel_refs, -1); } +#define mlx5e_dbg(_IGN, _priv, ...) mlx5_core_dbg((_priv)->mdev, __VA_ARGS__) + extern const struct ethtool_ops mlx5e_ethtool_ops; void mlx5e_create_ethtool(struct mlx5e_priv *); void mlx5e_create_stats(struct sysctl_ctx_list *, From owner-svn-src-all@freebsd.org Wed Oct 2 10:05:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AA4A129DF0; Wed, 2 Oct 2019 10:05:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsG83BK5z49Pj; Wed, 2 Oct 2019 10:05:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51DE129E08; Wed, 2 Oct 2019 10:05:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92A5asg028631; Wed, 2 Oct 2019 10:05:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92A5Y5N028624; Wed, 2 Oct 2019 10:05:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021005.x92A5Y5N028624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352981 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5en X-SVN-Commit-Revision: 352981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:05:36 -0000 Author: hselasky Date: Wed Oct 2 10:05:34 2019 New Revision: 352981 URL: https://svnweb.freebsd.org/changeset/base/352981 Log: Import Linux code to query/set buffer state in mlx5en(4). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c (contents, props changed) head/sys/dev/mlx5/mlx5_en/port_buffer.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/port.h head/sys/modules/mlx5en/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 2 09:59:42 2019 (r352980) +++ head/sys/conf/files Wed Oct 2 10:05:34 2019 (r352981) @@ -4770,6 +4770,8 @@ dev/mlx5/mlx5_en/mlx5_en_rl.c optional mlx5en pci in compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet inet6 \ compile-with "${OFED_C}" +dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5en pci inet inet6 \ + compile-with "${OFED_C}" # crypto support opencrypto/cast.c optional crypto | ipsec | ipsec_support Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Oct 2 09:59:42 2019 (r352980) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Oct 2 10:05:34 2019 (r352981) @@ -1236,3 +1236,220 @@ mlx5_set_mfrl_reg(struct mlx5_core_dev *mdev, u8 reset return (mlx5_core_access_reg(mdev, mfrl, sz, mfrl, sz, MLX5_REG_MFRL, 0, 1)); } + +/* speed in units of 1Mb */ +static const u32 mlx5e_link_speed[/*MLX5E_LINK_MODES_NUMBER*/] = { + [MLX5E_1000BASE_CX_SGMII] = 1000, + [MLX5E_1000BASE_KX] = 1000, + [MLX5E_10GBASE_CX4] = 10000, + [MLX5E_10GBASE_KX4] = 10000, + [MLX5E_10GBASE_KR] = 10000, + [MLX5E_20GBASE_KR2] = 20000, + [MLX5E_40GBASE_CR4] = 40000, + [MLX5E_40GBASE_KR4] = 40000, + [MLX5E_56GBASE_R4] = 56000, + [MLX5E_10GBASE_CR] = 10000, + [MLX5E_10GBASE_SR] = 10000, + [MLX5E_10GBASE_ER_LR] = 10000, + [MLX5E_40GBASE_SR4] = 40000, + [MLX5E_40GBASE_LR4_ER4] = 40000, + [MLX5E_50GBASE_SR2] = 50000, + [MLX5E_100GBASE_CR4] = 100000, + [MLX5E_100GBASE_SR4] = 100000, + [MLX5E_100GBASE_KR4] = 100000, + [MLX5E_100GBASE_LR4] = 100000, + [MLX5E_100BASE_TX] = 100, + [MLX5E_1000BASE_T] = 1000, + [MLX5E_10GBASE_T] = 10000, + [MLX5E_25GBASE_CR] = 25000, + [MLX5E_25GBASE_KR] = 25000, + [MLX5E_25GBASE_SR] = 25000, + [MLX5E_50GBASE_CR2] = 50000, + [MLX5E_50GBASE_KR2] = 50000, +}; + +static const u32 mlx5e_ext_link_speed[/*MLX5E_EXT_LINK_MODES_NUMBER*/] = { + [MLX5E_SGMII_100M] = 100, + [MLX5E_1000BASE_X_SGMII] = 1000, + [MLX5E_5GBASE_R] = 5000, + [MLX5E_10GBASE_XFI_XAUI_1] = 10000, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4] = 40000, + [MLX5E_25GAUI_1_25GBASE_CR_KR] = 25000, + [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2] = 50000, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR] = 50000, + [MLX5E_CAUI_4_100GBASE_CR4_KR4] = 100000, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4] = 200000, + [MLX5E_400GAUI_8] = 400000, +}; + +static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev, + const u32 **arr, u32 *size) +{ + bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); + + *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) : + ARRAY_SIZE(mlx5e_link_speed); + *arr = ext ? mlx5e_ext_link_speed : mlx5e_link_speed; +} + +u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper) +{ + unsigned long temp = eth_proto_oper; + const u32 *table; + u32 speed = 0; + u32 max_size; + int i; + + mlx5e_port_get_speed_arr(mdev, &table, &max_size); + i = find_first_bit(&temp, max_size); + if (i < max_size) + speed = table[i]; + return speed; +} + +int mlx5_port_query_eth_proto(struct mlx5_core_dev *dev, u8 port, bool ext, + struct mlx5e_port_eth_proto *eproto) +{ + u32 out[MLX5_ST_SZ_DW(ptys_reg)]; + int err; + + if (!eproto) + return -EINVAL; + + err = mlx5_query_port_ptys(dev, out, sizeof(out), MLX5_PTYS_EN, port); + if (err) + return err; + + eproto->cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, + eth_proto_capability); + eproto->admin = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_admin); + eproto->oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper); + return 0; +} + +int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) +{ + struct mlx5e_port_eth_proto eproto; + bool ext; + int err; + + ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); + err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto); + if (err) + goto out; + + *speed = mlx5e_port_ptys2speed(mdev, eproto.oper); + if (!(*speed)) + err = -EINVAL; + +out: + return err; +} + +int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out) +{ + int sz = MLX5_ST_SZ_BYTES(pbmc_reg); + void *in; + int err; + + in = kzalloc(sz, GFP_KERNEL); + if (!in) + return -ENOMEM; + + MLX5_SET(pbmc_reg, in, local_port, 1); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PBMC, 0, 0); + + kfree(in); + return err; +} + +int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in) +{ + int sz = MLX5_ST_SZ_BYTES(pbmc_reg); + void *out; + int err; + + out = kzalloc(sz, GFP_KERNEL); + if (!out) + return -ENOMEM; + + MLX5_SET(pbmc_reg, in, local_port, 1); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PBMC, 0, 1); + + kfree(out); + return err; +} + +/* buffer[i]: buffer that priority i mapped to */ +int mlx5e_port_query_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer) +{ + int sz = MLX5_ST_SZ_BYTES(pptb_reg); + u32 prio_x_buff; + void *out; + void *in; + int prio; + int err; + + in = kzalloc(sz, GFP_KERNEL); + out = kzalloc(sz, GFP_KERNEL); + if (!in || !out) { + err = -ENOMEM; + goto out; + } + + MLX5_SET(pptb_reg, in, local_port, 1); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPTB, 0, 0); + if (err) + goto out; + + prio_x_buff = MLX5_GET(pptb_reg, out, prio_x_buff); + for (prio = 0; prio < 8; prio++) { + buffer[prio] = (u8)(prio_x_buff >> (4 * prio)) & 0xF; + mlx5_core_dbg(mdev, "prio %d, buffer %d\n", prio, buffer[prio]); + } +out: + kfree(in); + kfree(out); + return err; +} + +int mlx5e_port_set_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer) +{ + int sz = MLX5_ST_SZ_BYTES(pptb_reg); + u32 prio_x_buff; + void *out; + void *in; + int prio; + int err; + + in = kzalloc(sz, GFP_KERNEL); + out = kzalloc(sz, GFP_KERNEL); + if (!in || !out) { + err = -ENOMEM; + goto out; + } + + /* First query the pptb register */ + MLX5_SET(pptb_reg, in, local_port, 1); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPTB, 0, 0); + if (err) + goto out; + + memcpy(in, out, sz); + MLX5_SET(pptb_reg, in, local_port, 1); + + /* Update the pm and prio_x_buff */ + MLX5_SET(pptb_reg, in, pm, 0xFF); + + prio_x_buff = 0; + for (prio = 0; prio < 8; prio++) + prio_x_buff |= (buffer[prio] << (4 * prio)); + MLX5_SET(pptb_reg, in, prio_x_buff, prio_x_buff); + + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPTB, 0, 1); + +out: + kfree(in); + kfree(out); + return err; +} Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 09:59:42 2019 (r352980) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:05:34 2019 (r352981) @@ -988,6 +988,11 @@ struct mlx5e_clbr_point { u_int clbr_gen; }; +struct mlx5e_dcbx { + u32 cable_len; + u32 xoff; +}; + struct mlx5e_priv { struct mlx5_core_dev *mdev; /* must be first */ @@ -1055,6 +1060,8 @@ struct mlx5e_priv { int clbr_curr; struct mlx5e_clbr_point clbr_points[2]; u_int clbr_gen; + + struct mlx5e_dcbx dcbx; struct pfil_head *pfil; struct mlx5e_channel channel[]; Added: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Wed Oct 2 10:05:34 2019 (r352981) @@ -0,0 +1,328 @@ +/*- + * Copyright (c) 2018 Mellanox Technologies. 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 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 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 "port_buffer.h" + +#define MLX5E_MAX_PORT_MTU 9216 + +int mlx5e_port_query_buffer(struct mlx5e_priv *priv, + struct mlx5e_port_buffer *port_buffer) +{ + struct mlx5_core_dev *mdev = priv->mdev; + int sz = MLX5_ST_SZ_BYTES(pbmc_reg); + u32 total_used = 0; + void *buffer; + void *out; + int err; + int i; + + out = kzalloc(sz, GFP_KERNEL); + if (!out) + return -ENOMEM; + + err = mlx5e_port_query_pbmc(mdev, out); + if (err) + goto out; + + for (i = 0; i < MLX5E_MAX_BUFFER; i++) { + buffer = MLX5_ADDR_OF(pbmc_reg, out, buffer[i]); + port_buffer->buffer[i].lossy = + MLX5_GET(bufferx_reg, buffer, lossy); + port_buffer->buffer[i].epsb = + MLX5_GET(bufferx_reg, buffer, epsb); + port_buffer->buffer[i].size = + MLX5_GET(bufferx_reg, buffer, size) << MLX5E_BUFFER_CELL_SHIFT; + port_buffer->buffer[i].xon = + MLX5_GET(bufferx_reg, buffer, xon_threshold) << MLX5E_BUFFER_CELL_SHIFT; + port_buffer->buffer[i].xoff = + MLX5_GET(bufferx_reg, buffer, xoff_threshold) << MLX5E_BUFFER_CELL_SHIFT; + total_used += port_buffer->buffer[i].size; + + mlx5e_dbg(HW, priv, "buffer %d: size=%d, xon=%d, xoff=%d, epsb=%d, lossy=%d\n", i, + port_buffer->buffer[i].size, + port_buffer->buffer[i].xon, + port_buffer->buffer[i].xoff, + port_buffer->buffer[i].epsb, + port_buffer->buffer[i].lossy); + } + + port_buffer->port_buffer_size = + MLX5_GET(pbmc_reg, out, port_buffer_size) << MLX5E_BUFFER_CELL_SHIFT; + port_buffer->spare_buffer_size = + port_buffer->port_buffer_size - total_used; + + mlx5e_dbg(HW, priv, "total buffer size=%d, spare buffer size=%d\n", + port_buffer->port_buffer_size, + port_buffer->spare_buffer_size); +out: + kfree(out); + return err; +} + +static int port_set_buffer(struct mlx5e_priv *priv, + struct mlx5e_port_buffer *port_buffer) +{ + struct mlx5_core_dev *mdev = priv->mdev; + int sz = MLX5_ST_SZ_BYTES(pbmc_reg); + void *buffer; + void *in; + int err; + int i; + + in = kzalloc(sz, GFP_KERNEL); + if (!in) + return -ENOMEM; + + err = mlx5e_port_query_pbmc(mdev, in); + if (err) + goto out; + + for (i = 0; i < MLX5E_MAX_BUFFER; i++) { + buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]); + + MLX5_SET(bufferx_reg, buffer, size, + port_buffer->buffer[i].size >> MLX5E_BUFFER_CELL_SHIFT); + MLX5_SET(bufferx_reg, buffer, lossy, + port_buffer->buffer[i].lossy); + MLX5_SET(bufferx_reg, buffer, xoff_threshold, + port_buffer->buffer[i].xoff >> MLX5E_BUFFER_CELL_SHIFT); + MLX5_SET(bufferx_reg, buffer, xon_threshold, + port_buffer->buffer[i].xon >> MLX5E_BUFFER_CELL_SHIFT); + } + + err = mlx5e_port_set_pbmc(mdev, in); +out: + kfree(in); + return err; +} + +/* xoff = ((301+2.16 * len [m]) * speed [Gbps] + 2.72 MTU [B]) */ +static u32 calculate_xoff(struct mlx5e_priv *priv, unsigned int mtu) +{ + u32 speed; + u32 xoff; + int err; + + err = mlx5e_port_linkspeed(priv->mdev, &speed); + if (err) { + mlx5_core_warn(priv->mdev, "cannot get port speed\n"); + speed = SPEED_40000; + } + speed = max_t(u32, speed, SPEED_40000); + xoff = (301 + 216 * priv->dcbx.cable_len / 100) * speed / 1000 + 272 * mtu / 100; + + mlx5e_dbg(HW, priv, "%s: xoff=%d\n", __func__, xoff); + return xoff; +} + +static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, + u32 xoff) +{ + int i; + + for (i = 0; i < MLX5E_MAX_BUFFER; i++) { + if (port_buffer->buffer[i].lossy) { + port_buffer->buffer[i].xoff = 0; + port_buffer->buffer[i].xon = 0; + continue; + } + + if (port_buffer->buffer[i].size < + (xoff + MLX5E_MAX_PORT_MTU + (1 << MLX5E_BUFFER_CELL_SHIFT))) + return -ENOMEM; + + port_buffer->buffer[i].xoff = port_buffer->buffer[i].size - xoff; + port_buffer->buffer[i].xon = + port_buffer->buffer[i].xoff - MLX5E_MAX_PORT_MTU; + } + + return 0; +} + +/** + * update_buffer_lossy() + * mtu: device's MTU + * pfc_en: current pfc configuration + * buffer: current prio to buffer mapping + * xoff: xoff value + * port_buffer: port receive buffer configuration + * change: + * + * Update buffer configuration based on pfc configuraiton and priority + * to buffer mapping. + * Buffer's lossy bit is changed to: + * lossless if there is at least one PFC enabled priority mapped to this buffer + * lossy if all priorities mapped to this buffer are PFC disabled + * + * Return: + * Return 0 if no error. + * Set change to true if buffer configuration is modified. + */ +static int update_buffer_lossy(unsigned int mtu, + u8 pfc_en, u8 *buffer, u32 xoff, + struct mlx5e_port_buffer *port_buffer, + bool *change) +{ + bool changed = false; + u8 lossy_count; + u8 prio_count; + u8 lossy; + int prio; + int err; + int i; + + for (i = 0; i < MLX5E_MAX_BUFFER; i++) { + prio_count = 0; + lossy_count = 0; + + for (prio = 0; prio < MLX5E_MAX_PRIORITY; prio++) { + if (buffer[prio] != i) + continue; + + prio_count++; + lossy_count += !(pfc_en & (1 << prio)); + } + + if (lossy_count == prio_count) + lossy = 1; + else /* lossy_count < prio_count */ + lossy = 0; + + if (lossy != port_buffer->buffer[i].lossy) { + port_buffer->buffer[i].lossy = lossy; + changed = true; + } + } + + if (changed) { + err = update_xoff_threshold(port_buffer, xoff); + if (err) + return err; + + *change = true; + } + + return 0; +} + +int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, + u32 change, unsigned int mtu, + struct ieee_pfc *pfc, + u32 *buffer_size, + u8 *prio2buffer) +{ + struct mlx5e_port_buffer port_buffer; + u32 xoff = calculate_xoff(priv, mtu); + bool update_prio2buffer = false; + u8 buffer[MLX5E_MAX_PRIORITY]; + bool update_buffer = false; + u32 total_used = 0; + u8 curr_pfc_en; + int err; + int i; + + mlx5e_dbg(HW, priv, "%s: change=%x\n", __func__, change); + + err = mlx5e_port_query_buffer(priv, &port_buffer); + if (err) + return err; + + if (change & MLX5E_PORT_BUFFER_CABLE_LEN) { + update_buffer = true; + err = update_xoff_threshold(&port_buffer, xoff); + if (err) + return err; + } + + if (change & MLX5E_PORT_BUFFER_PFC) { + err = mlx5e_port_query_priority2buffer(priv->mdev, buffer); + if (err) + return err; + + err = update_buffer_lossy(mtu, pfc->pfc_en, buffer, xoff, + &port_buffer, &update_buffer); + if (err) + return err; + } + + if (change & MLX5E_PORT_BUFFER_PRIO2BUFFER) { + update_prio2buffer = true; + err = mlx5_query_port_pfc(priv->mdev, &curr_pfc_en, NULL); + if (err) + return err; + + err = update_buffer_lossy(mtu, curr_pfc_en, prio2buffer, xoff, + &port_buffer, &update_buffer); + if (err) + return err; + } + + if (change & MLX5E_PORT_BUFFER_SIZE) { + for (i = 0; i < MLX5E_MAX_BUFFER; i++) { + mlx5e_dbg(HW, priv, "%s: buffer[%d]=%d\n", __func__, i, buffer_size[i]); + if (!port_buffer.buffer[i].lossy && !buffer_size[i]) { + mlx5e_dbg(HW, priv, "%s: lossless buffer[%d] size cannot be zero\n", + __func__, i); + return -EINVAL; + } + + port_buffer.buffer[i].size = buffer_size[i]; + total_used += buffer_size[i]; + } + + mlx5e_dbg(HW, priv, "%s: total buffer requested=%d\n", __func__, total_used); + + if (total_used > port_buffer.port_buffer_size) + return -EINVAL; + + update_buffer = true; + err = update_xoff_threshold(&port_buffer, xoff); + if (err) + return err; + } + + /* Need to update buffer configuration if xoff value is changed */ + if (!update_buffer && xoff != priv->dcbx.xoff) { + update_buffer = true; + err = update_xoff_threshold(&port_buffer, xoff); + if (err) + return err; + } + priv->dcbx.xoff = xoff; + + /* Apply the settings */ + if (update_buffer) { + err = port_set_buffer(priv, &port_buffer); + if (err) + return err; + } + + if (update_prio2buffer) + err = mlx5e_port_set_priority2buffer(priv->mdev, prio2buffer); + + return err; +} Added: head/sys/dev/mlx5/mlx5_en/port_buffer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_en/port_buffer.h Wed Oct 2 10:05:34 2019 (r352981) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2018 Mellanox Technologies. 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 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 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 __MLX5_EN_PORT_BUFFER_H__ +#define __MLX5_EN_PORT_BUFFER_H__ + +#include "en.h" +#include + +#define MLX5E_MAX_BUFFER 8 +#define MLX5E_BUFFER_CELL_SHIFT 7 +#define MLX5E_DEFAULT_CABLE_LEN 7 /* 7 meters */ + +#define MLX5_BUFFER_SUPPORTED(mdev) (MLX5_CAP_GEN(mdev, pcam_reg) && \ + MLX5_CAP_PCAM_REG(mdev, pbmc) && \ + MLX5_CAP_PCAM_REG(mdev, pptb)) + +enum { + MLX5E_PORT_BUFFER_CABLE_LEN = BIT(0), + MLX5E_PORT_BUFFER_PFC = BIT(1), + MLX5E_PORT_BUFFER_PRIO2BUFFER = BIT(2), + MLX5E_PORT_BUFFER_SIZE = BIT(3), +}; + +struct mlx5e_bufferx_reg { + u8 lossy; + u8 epsb; + u32 size; + u32 xoff; + u32 xon; +}; + +struct mlx5e_port_buffer { + u32 port_buffer_size; + u32 spare_buffer_size; + struct mlx5e_bufferx_reg buffer[MLX5E_MAX_BUFFER]; +}; + +#define IEEE_8021QAZ_MAX_TCS 8 + +struct ieee_pfc { + __u8 pfc_cap; + __u8 pfc_en; + __u8 mbc; + __u16 delay; + __u64 requests[IEEE_8021QAZ_MAX_TCS]; + __u64 indications[IEEE_8021QAZ_MAX_TCS]; +}; + +int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, + u32 change, unsigned int mtu, + struct ieee_pfc *pfc, + u32 *buffer_size, + u8 *prio2buffer); + +int mlx5e_port_query_buffer(struct mlx5e_priv *priv, + struct mlx5e_port_buffer *port_buffer); +#endif Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Wed Oct 2 09:59:42 2019 (r352980) +++ head/sys/dev/mlx5/port.h Wed Oct 2 10:05:34 2019 (r352981) @@ -179,7 +179,16 @@ enum mlx5_qpts_trust_state { MLX5_QPTS_TRUST_DSCP = 2, MLX5_QPTS_TRUST_BOTH = 3, }; +struct mlx5e_port_eth_proto { + u32 cap; + u32 admin; + u32 oper; +}; +#ifndef SPEED_40000 +#define SPEED_40000 40000 +#endif + #define MLX5E_PROT_MASK(link_mode) (1 << (link_mode)) #define PORT_MODULE_EVENT_MODULE_STATUS_MASK 0xF @@ -251,5 +260,15 @@ int mlx5_set_dscp2prio(struct mlx5_core_dev *mdev, con int mlx5_query_dscp2prio(struct mlx5_core_dev *mdev, u8 *dscp2prio); int mlx5_query_pddr_range_info(struct mlx5_core_dev *mdev, u8 local_port, u8 *is_er_type); + +u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper); +int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed); +int mlx5_port_query_eth_proto(struct mlx5_core_dev *dev, u8 port, bool ext, + struct mlx5e_port_eth_proto *eproto); + +int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out); +int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in); +int mlx5e_port_query_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer); +int mlx5e_port_set_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer); #endif /* __MLX5_PORT_H__ */ Modified: head/sys/modules/mlx5en/Makefile ============================================================================== --- head/sys/modules/mlx5en/Makefile Wed Oct 2 09:59:42 2019 (r352980) +++ head/sys/modules/mlx5en/Makefile Wed Oct 2 10:05:34 2019 (r352981) @@ -11,6 +11,7 @@ mlx5_en_flow_table.c \ mlx5_en_rx.c \ mlx5_en_rl.c \ mlx5_en_txrx.c \ +mlx5_en_port_buffer.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ opt_inet.h opt_inet6.h opt_rss.h opt_ratelimit.h From owner-svn-src-all@freebsd.org Wed Oct 2 10:08:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FB8E129F71; Wed, 2 Oct 2019 10:08:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsK12lwhz49cc; Wed, 2 Oct 2019 10:08:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D09E29E09; Wed, 2 Oct 2019 10:08:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92A85xN028823; Wed, 2 Oct 2019 10:08:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92A84ut028821; Wed, 2 Oct 2019 10:08:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021008.x92A84ut028821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352982 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:08:05 -0000 Author: hselasky Date: Wed Oct 2 10:08:04 2019 New Revision: 352982 URL: https://svnweb.freebsd.org/changeset/base/352982 Log: Add support for buffer parameter manipulations in mlx5en(4). The following sysctls are added: dev.mce.N.conf.qos.cable_length dev.mce.N.conf.qos.buffers_size dev.mce.N.conf.qos.buffers_prio Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:05:34 2019 (r352981) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:08:04 2019 (r352982) @@ -1202,5 +1202,6 @@ void mlx5e_modify_rx_dma(struct mlx5e_priv *priv, uint void mlx5e_resume_sq(struct mlx5e_sq *sq); void mlx5e_update_sq_inline(struct mlx5e_sq *sq); void mlx5e_refresh_sq_inline(struct mlx5e_priv *priv); +int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:05:34 2019 (r352981) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:08:04 2019 (r352982) @@ -26,6 +26,7 @@ */ #include "en.h" +#include "port_buffer.h" #include void @@ -429,6 +430,99 @@ done: return (err); } +int +mlx5e_update_buf_lossy(struct mlx5e_priv *priv) +{ + struct ieee_pfc pfc; + + PRIV_ASSERT_LOCKED(priv); + bzero(&pfc, sizeof(pfc)); + pfc.pfc_en = priv->params.rx_priority_flow_control; + return (-mlx5e_port_manual_buffer_config(priv, MLX5E_PORT_BUFFER_PFC, + priv->params_ethtool.hw_mtu, &pfc, NULL, NULL)); +} + +static int +mlx5e_buf_size_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv; + u32 buf_size[MLX5E_MAX_BUFFER]; + struct mlx5e_port_buffer port_buffer; + int error, i; + + priv = arg1; + PRIV_LOCK(priv); + error = -mlx5e_port_query_buffer(priv, &port_buffer); + if (error != 0) + goto done; + for (i = 0; i < nitems(buf_size); i++) + buf_size[i] = port_buffer.buffer[i].size; + error = SYSCTL_OUT(req, buf_size, sizeof(buf_size)); + if (error != 0 || req->newptr == NULL) + goto done; + error = SYSCTL_IN(req, buf_size, sizeof(buf_size)); + if (error != 0) + goto done; + error = -mlx5e_port_manual_buffer_config(priv, MLX5E_PORT_BUFFER_SIZE, + priv->params_ethtool.hw_mtu, NULL, buf_size, NULL); +done: + PRIV_UNLOCK(priv); + return (error); +} + +static int +mlx5e_buf_prio_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv; + struct mlx5_core_dev *mdev; + u8 buffer[MLX5E_MAX_BUFFER]; + int error; + + priv = arg1; + mdev = priv->mdev; + PRIV_LOCK(priv); + error = -mlx5e_port_query_priority2buffer(mdev, buffer); + if (error != 0) + goto done; + error = SYSCTL_OUT(req, buffer, MLX5E_MAX_BUFFER); + if (error != 0 || req->newptr == NULL) + goto done; + error = SYSCTL_IN(req, buffer, MLX5E_MAX_BUFFER); + if (error != 0) + goto done; + error = -mlx5e_port_manual_buffer_config(priv, + MLX5E_PORT_BUFFER_PRIO2BUFFER, + priv->params_ethtool.hw_mtu, NULL, NULL, buffer); + if (error == 0) + error = mlx5e_update_buf_lossy(priv); +done: + PRIV_UNLOCK(priv); + return (error); +} + +static int +mlx5e_cable_length_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv; + u_int cable_len; + int error; + + priv = arg1; + PRIV_LOCK(priv); + cable_len = priv->dcbx.cable_len; + error = sysctl_handle_int(oidp, &cable_len, 0, req); + if (error == 0 && req->newptr != NULL && + cable_len != priv->dcbx.cable_len) { + error = -mlx5e_port_manual_buffer_config(priv, + MLX5E_PORT_BUFFER_CABLE_LEN, priv->params_ethtool.hw_mtu, + NULL, NULL, NULL); + if (error == 0) + priv->dcbx.cable_len = cable_len; + } + PRIV_UNLOCK(priv); + return (error); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -1163,6 +1257,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) { struct sysctl_oid *node, *qos_node; const char *pnameunit; + struct mlx5e_port_buffer port_buffer; unsigned x; int i; @@ -1312,5 +1407,23 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) A B : A); #undef B #undef A + } + + if (mlx5e_port_query_buffer(priv, &port_buffer) == 0) { + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, "buffers_size", + CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, mlx5e_buf_size_handler, "IU", + "Set buffers sizes"); + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, "buffers_prio", + CTLTYPE_U8 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, mlx5e_buf_prio_handler, "CU", + "Set prio to buffers mapping"); + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, "cable_length", + CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, mlx5e_cable_length_handler, "IU", + "Set cable length in meters for xoff threshold calculation"); } } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:05:34 2019 (r352981) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:08:04 2019 (r352982) @@ -3868,8 +3868,11 @@ mlx5e_sysctl_rx_priority_flow_control(SYSCTL_HANDLER_A } /* check if update is required */ - if (rx_pfc != priv->params.rx_priority_flow_control) + if (rx_pfc != priv->params.rx_priority_flow_control) { err = -mlx5e_set_port_pfc(priv); + if (err == 0) + err = mlx5e_update_buf_lossy(priv); + } done: if (err != 0) priv->params.rx_priority_flow_control= rx_pfc; From owner-svn-src-all@freebsd.org Wed Oct 2 10:14:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F110112A40C; Wed, 2 Oct 2019 10:14:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsSx6w9Yz4BFH; Wed, 2 Oct 2019 10:14:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC41029FCA; Wed, 2 Oct 2019 10:14:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AEvav034874; Wed, 2 Oct 2019 10:14:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AEtQG034865; Wed, 2 Oct 2019 10:14:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021014.x92AEtQG034865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352983 - in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:14:58 -0000 Author: hselasky Date: Wed Oct 2 10:14:55 2019 New Revision: 352983 URL: https://svnweb.freebsd.org/changeset/base/352983 Log: Move EEPROM information query from a sysctl in mlx5en(4) to an ioctl in mlx5core. The EEPROM information is not only a property of the mlx5en(4) driver. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/share/man/man4/mlx5io.4 head/sys/dev/mlx5/diagnostics.h head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5io.h head/sys/dev/mlx5/port.h Modified: head/share/man/man4/mlx5io.4 ============================================================================== --- head/share/man/man4/mlx5io.4 Wed Oct 2 10:08:04 2019 (r352982) +++ head/share/man/man4/mlx5io.4 Wed Oct 2 10:14:55 2019 (r352983) @@ -25,18 +25,18 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2019 +.Dd October 2, 2019 .Dt mlx5io 4 .Os .Sh NAME .Nm mlx5io -.Nd IOCTL interface to manage Connect-X 4/5 Mellanox network adapters +.Nd IOCTL interface to manage Connect-X 4/5/6 Mellanox network adapters .Sh SYNOPSIS .In dev/mlx5/mlx5io.h .Sh DESCRIPTION The .Nm -interface is provided for management of the Connect-X 4 and 5 network adapters +interface is provided for management of the Connect-X4, 5 and 6 network adapters in the aspects not covered by the generic network configuration, mostly related to the PCIe attachment and internal card working. Interface consists of the commands, which are passed by means of @@ -147,6 +147,29 @@ Requests PCIe link-level reset on the device. The address of the device is specified by the .Vt struct mlx5_tool_addr structure, which should be passed as an argument. +.It Dv MLX5_EEPROM_GET +Fetch EEPROM information. +The argument to the command should point to the input/output +.Vt struct mlx5_eeprom_get +structure where, the +.Dv devaddr +field specifies the address of the device. +.Bd -literal +struct mlx5_eeprom_get { + struct mlx5_tool_addr devaddr; + size_t eeprom_info_page_valid; + uint32_t *eeprom_info_buf; + size_t eeprom_info_out_len; +}; +.Ed +.Pp +On successfull return, the +.Dv eeprom_info_out_len +field reports the length of the EEPROM information. +.Dv eeprom_info_buf +field contains the actual EEPROM information. +.Dv eeprom_info_page_valid +field reports the third page validity. .El .Sh FILES The Modified: head/sys/dev/mlx5/diagnostics.h ============================================================================== --- head/sys/dev/mlx5/diagnostics.h Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/diagnostics.h Wed Oct 2 10:14:55 2019 (r352983) @@ -32,6 +32,8 @@ #define MLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, #define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, +static MALLOC_DEFINE(M_MLX5_EEPROM, "MLX5EEPROM", "MLX5 EEPROM information"); + struct mlx5_core_diagnostics_entry { const char *desc; u16 counter_id; @@ -127,6 +129,18 @@ union mlx5_core_general_diagnostics { extern const struct mlx5_core_diagnostics_entry mlx5_core_general_diagnostics_table[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; +struct mlx5_eeprom { + int lock_bit; + int i2c_addr; + int page_num; + int device_addr; + int module_num; + int len; + int type; + int page_valid; + u32 *data; +}; + /* function prototypes */ int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *mdev, u8 enable_pci, u8 enable_general); @@ -134,5 +148,8 @@ int mlx5_core_get_diagnostics_full(struct mlx5_core_de union mlx5_core_pci_diagnostics *ppci, union mlx5_core_general_diagnostics *pgen); int mlx5_core_supports_diagnostics(struct mlx5_core_dev *mdev, u16 counter_id); +int mlx5_read_eeprom(struct mlx5_core_dev *dev, struct mlx5_eeprom *eeprom); +int mlx5_get_eeprom_info(struct mlx5_core_dev *dev, struct mlx5_eeprom *eeprom); +int mlx5_get_eeprom(struct mlx5_core_dev *dev, struct mlx5_eeprom *ee); #endif /* MLX5_CORE_DIAGNOSTICS_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Wed Oct 2 10:14:55 2019 (r352983) @@ -26,7 +26,10 @@ */ #include +#include #include +#include +#include const struct mlx5_core_diagnostics_entry mlx5_core_pci_diagnostics_table[ @@ -284,3 +287,156 @@ int mlx5_core_supports_diagnostics(struct mlx5_core_de } return 0; /* not supported counter */ } + +/* + * Read the first three bytes of the eeprom in order to get the needed info + * for the whole reading. + * Byte 0 - Identifier byte + * Byte 1 - Revision byte + * Byte 2 - Status byte + */ +int +mlx5_get_eeprom_info(struct mlx5_core_dev *dev, struct mlx5_eeprom *eeprom) +{ + u32 data = 0; + int size_read = 0; + int ret; + + ret = mlx5_query_module_num(dev, &eeprom->module_num); + if (ret) { + mlx5_core_err(dev, "Failed query module error=%d\n", ret); + return (-ret); + } + + /* Read the first three bytes to get Identifier, Revision and Status */ + ret = mlx5_query_eeprom(dev, eeprom->i2c_addr, eeprom->page_num, + eeprom->device_addr, MLX5_EEPROM_INFO_BYTES, eeprom->module_num, &data, + &size_read); + if (ret) { + mlx5_core_err(dev, + "Failed query EEPROM module error=0x%x\n", ret); + return (-ret); + } + + switch (data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK) { + case SFF_8024_ID_QSFP: + eeprom->type = MLX5_ETH_MODULE_SFF_8436; + eeprom->len = MLX5_ETH_MODULE_SFF_8436_LEN; + break; + case SFF_8024_ID_QSFPPLUS: + case SFF_8024_ID_QSFP28: + if ((data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK) == SFF_8024_ID_QSFP28 || + ((data & MLX5_EEPROM_REVISION_ID_BYTE_MASK) >> 8) >= 0x3) { + eeprom->type = MLX5_ETH_MODULE_SFF_8636; + eeprom->len = MLX5_ETH_MODULE_SFF_8636_LEN; + } else { + eeprom->type = MLX5_ETH_MODULE_SFF_8436; + eeprom->len = MLX5_ETH_MODULE_SFF_8436_LEN; + } + if ((data & MLX5_EEPROM_PAGE_3_VALID_BIT_MASK) == 0) + eeprom->page_valid = 1; + break; + case SFF_8024_ID_SFP: + eeprom->type = MLX5_ETH_MODULE_SFF_8472; + eeprom->len = MLX5_ETH_MODULE_SFF_8472_LEN; + break; + default: + mlx5_core_err(dev, "Not recognized cable type = 0x%x(%s)\n", + data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK, + sff_8024_id[data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK]); + return (EINVAL); + } + return (0); +} + +/* Read both low and high pages of the eeprom */ +int +mlx5_get_eeprom(struct mlx5_core_dev *dev, struct mlx5_eeprom *ee) +{ + int size_read = 0; + int ret; + + if (ee->len == 0) + return (EINVAL); + + /* Read low page of the eeprom */ + while (ee->device_addr < ee->len) { + ret = mlx5_query_eeprom(dev, ee->i2c_addr, ee->page_num, ee->device_addr, + ee->len - ee->device_addr, ee->module_num, + ee->data + (ee->device_addr / 4), &size_read); + if (ret) { + mlx5_core_err(dev, + "Failed reading EEPROM, error = 0x%02x\n", ret); + return (-ret); + } + ee->device_addr += size_read; + } + + /* Read high page of the eeprom */ + if (ee->page_valid == 1) { + ee->device_addr = MLX5_EEPROM_HIGH_PAGE_OFFSET; + ee->page_num = MLX5_EEPROM_HIGH_PAGE; + size_read = 0; + while (ee->device_addr < MLX5_EEPROM_PAGE_LENGTH) { + ret = mlx5_query_eeprom(dev, ee->i2c_addr, ee->page_num, + ee->device_addr, MLX5_EEPROM_PAGE_LENGTH - ee->device_addr, + ee->module_num, ee->data + (ee->len / 4) + + ((ee->device_addr - MLX5_EEPROM_HIGH_PAGE_OFFSET) / 4), + &size_read); + if (ret) { + mlx5_core_err(dev, + "Failed reading EEPROM, error = 0x%02x\n", + ret); + return (-ret); + } + ee->device_addr += size_read; + } + } + return (0); +} + +/* + * Read cable EEPROM module information by first inspecting the first + * three bytes to get the initial information for a whole reading. + * Information will be printed to dmesg. + */ +int +mlx5_read_eeprom(struct mlx5_core_dev *dev, struct mlx5_eeprom *eeprom) +{ + int error; + + eeprom->i2c_addr = MLX5_I2C_ADDR_LOW; + eeprom->device_addr = 0; + eeprom->page_num = MLX5_EEPROM_LOW_PAGE; + eeprom->page_valid = 0; + + /* Read three first bytes to get important info */ + error = mlx5_get_eeprom_info(dev, eeprom); + if (error) { + mlx5_core_err(dev, + "Failed reading EEPROM initial information\n"); + return (error); + } + /* + * Allocate needed length buffer and additional space for + * page 0x03 + */ + eeprom->data = malloc(eeprom->len + MLX5_EEPROM_PAGE_LENGTH, + M_MLX5_EEPROM, M_WAITOK | M_ZERO); + + /* Read the whole eeprom information */ + error = mlx5_get_eeprom(dev, eeprom); + if (error) { + mlx5_core_err(dev, "Failed reading EEPROM\n"); + error = 0; + /* + * Continue printing partial information in case of + * an error + */ + } + free(eeprom->data, M_MLX5_EEPROM); + + return (error); +} + + Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 10:14:55 2019 (r352983) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include static MALLOC_DEFINE(M_MLX5_DUMP, "MLX5DUMP", "MLX5 Firmware dump"); @@ -306,6 +308,54 @@ mlx5_fw_reset(struct mlx5_core_dev *mdev) } static int +mlx5_eeprom_copyout(struct mlx5_core_dev *dev, struct mlx5_eeprom_get *eeprom_info) +{ + struct mlx5_eeprom eeprom; + int error; + + eeprom.i2c_addr = MLX5_I2C_ADDR_LOW; + eeprom.device_addr = 0; + eeprom.page_num = MLX5_EEPROM_LOW_PAGE; + eeprom.page_valid = 0; + + /* Read three first bytes to get important info */ + error = mlx5_get_eeprom_info(dev, &eeprom); + if (error != 0) { + mlx5_core_err(dev, + "Failed reading EEPROM initial information\n"); + return (error); + } + eeprom_info->eeprom_info_page_valid = eeprom.page_valid; + eeprom_info->eeprom_info_out_len = eeprom.len; + + if (eeprom_info->eeprom_info_buf == NULL) + return (0); + /* + * Allocate needed length buffer and additional space for + * page 0x03 + */ + eeprom.data = malloc(eeprom.len + MLX5_EEPROM_PAGE_LENGTH, + M_MLX5_EEPROM, M_WAITOK | M_ZERO); + + /* Read the whole eeprom information */ + error = mlx5_get_eeprom(dev, &eeprom); + if (error != 0) { + mlx5_core_err(dev, "Failed reading EEPROM error = %d\n", + error); + error = 0; + /* + * Continue printing partial information in case of + * an error + */ + } + error = copyout(eeprom.data, eeprom_info->eeprom_info_buf, + eeprom.len); + free(eeprom.data, M_MLX5_EEPROM); + + return (error); +} + +static int mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { @@ -314,6 +364,7 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d struct mlx5_tool_addr *devaddr; struct mlx5_fw_update *fu; struct firmware fake_fw; + struct mlx5_eeprom_get *eeprom_info; int error; error = 0; @@ -391,6 +442,18 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d if (error != 0) break; error = mlx5_fw_reset(mdev); + break; + case MLX5_EEPROM_GET: + if ((fflag & FREAD) == 0) { + error = EBADF; + break; + } + eeprom_info = (struct mlx5_eeprom_get *)data; + devaddr = &eeprom_info->devaddr; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + error = mlx5_eeprom_copyout(mdev, eeprom_info); break; default: error = ENOTTY; Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:14:55 2019 (r352983) @@ -714,34 +714,6 @@ struct mlx5e_params_ethtool { u8 trust_state; }; -/* EEPROM Standards for plug in modules */ -#ifndef MLX5E_ETH_MODULE_SFF_8472 -#define MLX5E_ETH_MODULE_SFF_8472 0x1 -#define MLX5E_ETH_MODULE_SFF_8472_LEN 128 -#endif - -#ifndef MLX5E_ETH_MODULE_SFF_8636 -#define MLX5E_ETH_MODULE_SFF_8636 0x2 -#define MLX5E_ETH_MODULE_SFF_8636_LEN 256 -#endif - -#ifndef MLX5E_ETH_MODULE_SFF_8436 -#define MLX5E_ETH_MODULE_SFF_8436 0x3 -#define MLX5E_ETH_MODULE_SFF_8436_LEN 256 -#endif - -/* EEPROM I2C Addresses */ -#define MLX5E_I2C_ADDR_LOW 0x50 -#define MLX5E_I2C_ADDR_HIGH 0x51 - -#define MLX5E_EEPROM_LOW_PAGE 0x0 -#define MLX5E_EEPROM_HIGH_PAGE 0x3 - -#define MLX5E_EEPROM_HIGH_PAGE_OFFSET 128 -#define MLX5E_EEPROM_PAGE_LENGTH 256 - -#define MLX5E_EEPROM_INFO_BYTES 0x3 - struct mlx5e_cq { /* data path - accessed per cqe */ struct mlx5_cqwq wq; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:14:55 2019 (r352983) @@ -901,214 +901,6 @@ done: return (error); } -/* - * Read the first three bytes of the eeprom in order to get the needed info - * for the whole reading. - * Byte 0 - Identifier byte - * Byte 1 - Revision byte - * Byte 2 - Status byte - */ -static int -mlx5e_get_eeprom_info(struct mlx5e_priv *priv, struct mlx5e_eeprom *eeprom) -{ - struct mlx5_core_dev *dev = priv->mdev; - u32 data = 0; - int size_read = 0; - int ret; - - ret = mlx5_query_module_num(dev, &eeprom->module_num); - if (ret) { - mlx5_en_err(priv->ifp, "Failed query module error=%d\n", - ret); - return (ret); - } - - /* Read the first three bytes to get Identifier, Revision and Status */ - ret = mlx5_query_eeprom(dev, eeprom->i2c_addr, eeprom->page_num, - eeprom->device_addr, MLX5E_EEPROM_INFO_BYTES, eeprom->module_num, &data, - &size_read); - if (ret) { - mlx5_en_err(priv->ifp, - "Failed query eeprom module error=0x%x\n", ret); - return (ret); - } - - switch (data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK) { - case SFF_8024_ID_QSFP: - eeprom->type = MLX5E_ETH_MODULE_SFF_8436; - eeprom->len = MLX5E_ETH_MODULE_SFF_8436_LEN; - break; - case SFF_8024_ID_QSFPPLUS: - case SFF_8024_ID_QSFP28: - if ((data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK) == SFF_8024_ID_QSFP28 || - ((data & MLX5_EEPROM_REVISION_ID_BYTE_MASK) >> 8) >= 0x3) { - eeprom->type = MLX5E_ETH_MODULE_SFF_8636; - eeprom->len = MLX5E_ETH_MODULE_SFF_8636_LEN; - } else { - eeprom->type = MLX5E_ETH_MODULE_SFF_8436; - eeprom->len = MLX5E_ETH_MODULE_SFF_8436_LEN; - } - if ((data & MLX5_EEPROM_PAGE_3_VALID_BIT_MASK) == 0) - eeprom->page_valid = 1; - break; - case SFF_8024_ID_SFP: - eeprom->type = MLX5E_ETH_MODULE_SFF_8472; - eeprom->len = MLX5E_ETH_MODULE_SFF_8472_LEN; - break; - default: - mlx5_en_err(priv->ifp, - "Not recognized cable type = 0x%x(%s)\n", - data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK, - sff_8024_id[data & MLX5_EEPROM_IDENTIFIER_BYTE_MASK]); - return (EINVAL); - } - return (0); -} - -/* Read both low and high pages of the eeprom */ -static int -mlx5e_get_eeprom(struct mlx5e_priv *priv, struct mlx5e_eeprom *ee) -{ - struct mlx5_core_dev *dev = priv->mdev; - int size_read = 0; - int ret; - - if (ee->len == 0) - return (EINVAL); - - /* Read low page of the eeprom */ - while (ee->device_addr < ee->len) { - ret = mlx5_query_eeprom(dev, ee->i2c_addr, ee->page_num, ee->device_addr, - ee->len - ee->device_addr, ee->module_num, - ee->data + (ee->device_addr / 4), &size_read); - if (ret) { - mlx5_en_err(priv->ifp, - "Failed reading eeprom, error = 0x%02x\n",ret); - return (ret); - } - ee->device_addr += size_read; - } - - /* Read high page of the eeprom */ - if (ee->page_valid) { - ee->device_addr = MLX5E_EEPROM_HIGH_PAGE_OFFSET; - ee->page_num = MLX5E_EEPROM_HIGH_PAGE; - size_read = 0; - while (ee->device_addr < MLX5E_EEPROM_PAGE_LENGTH) { - ret = mlx5_query_eeprom(dev, ee->i2c_addr, ee->page_num, - ee->device_addr, MLX5E_EEPROM_PAGE_LENGTH - ee->device_addr, - ee->module_num, ee->data + (ee->len / 4) + - ((ee->device_addr - MLX5E_EEPROM_HIGH_PAGE_OFFSET) / 4), - &size_read); - if (ret) { - mlx5_en_err(priv->ifp, - "Failed reading eeprom, error = 0x%02x\n", - ret); - return (ret); - } - ee->device_addr += size_read; - } - } - return (0); -} - -static void -mlx5e_print_eeprom(struct mlx5e_eeprom *eeprom) -{ - int row; - int index_in_row; - int byte_to_write = 0; - int line_length = 16; - - printf("\nOffset\t\tValues\n"); - printf("------\t\t------"); - while (byte_to_write < eeprom->len) { - printf("\n0x%04X\t\t", byte_to_write); - for (index_in_row = 0; index_in_row < line_length; index_in_row++) { - printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); - byte_to_write++; - } - } - - if (eeprom->page_valid) { - row = MLX5E_EEPROM_HIGH_PAGE_OFFSET; - printf("\n\nUpper Page 0x03\n"); - printf("\nOffset\t\tValues\n"); - printf("------\t\t------"); - while (row < MLX5E_EEPROM_PAGE_LENGTH) { - printf("\n0x%04X\t\t", row); - for (index_in_row = 0; index_in_row < line_length; index_in_row++) { - printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); - byte_to_write++; - row++; - } - } - } -} - -/* - * Read cable EEPROM module information by first inspecting the first - * three bytes to get the initial information for a whole reading. - * Information will be printed to dmesg. - */ -static int -mlx5e_read_eeprom(SYSCTL_HANDLER_ARGS) -{ - struct mlx5e_priv *priv = arg1; - struct mlx5e_eeprom eeprom; - int error; - int result = 0; - - PRIV_LOCK(priv); - error = sysctl_handle_int(oidp, &result, 0, req); - if (error || !req->newptr) - goto done; - - /* Check if device is gone */ - if (priv->gone) { - error = ENXIO; - goto done; - } - - if (result == 1) { - eeprom.i2c_addr = MLX5E_I2C_ADDR_LOW; - eeprom.device_addr = 0; - eeprom.page_num = MLX5E_EEPROM_LOW_PAGE; - eeprom.page_valid = 0; - - /* Read three first bytes to get important info */ - error = mlx5e_get_eeprom_info(priv, &eeprom); - if (error) { - mlx5_en_err(priv->ifp, - "Failed reading eeprom's initial information\n"); - error = 0; - goto done; - } - /* - * Allocate needed length buffer and additional space for - * page 0x03 - */ - eeprom.data = malloc(eeprom.len + MLX5E_EEPROM_PAGE_LENGTH, - M_MLX5EN, M_WAITOK | M_ZERO); - - /* Read the whole eeprom information */ - error = mlx5e_get_eeprom(priv, &eeprom); - if (error) { - mlx5_en_err(priv->ifp, "Failed reading eeprom\n"); - error = 0; - /* - * Continue printing partial information in case of - * an error - */ - } - mlx5e_print_eeprom(&eeprom); - free(eeprom.data, M_MLX5EN); - } -done: - PRIV_UNLOCK(priv); - return (error); -} - static const char *mlx5e_params_desc[] = { MLX5E_PARAMS(MLX5E_STATS_DESC) }; @@ -1346,11 +1138,6 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) OID_AUTO, "device_name", CTLFLAG_RD, __DECONST(void *, pnameunit), 0, "PCI device name"); - - /* EEPROM support */ - SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, "eeprom_info", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, - mlx5e_read_eeprom, "I", "EEPROM information"); /* Diagnostics support */ mlx5e_create_diagnostics(priv); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:14:55 2019 (r352983) @@ -3397,9 +3397,9 @@ out: * The internal conversion is as follows: */ if (i2c.dev_addr == 0xA0) - read_addr = MLX5E_I2C_ADDR_LOW; + read_addr = MLX5_I2C_ADDR_LOW; else if (i2c.dev_addr == 0xA2) - read_addr = MLX5E_I2C_ADDR_HIGH; + read_addr = MLX5_I2C_ADDR_HIGH; else { mlx5_en_err(ifp, "Query eeprom failed, Invalid Address: %X\n", @@ -3408,7 +3408,7 @@ out: goto err_i2c; } error = mlx5_query_eeprom(priv->mdev, - read_addr, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5_EEPROM_LOW_PAGE, (uint32_t)i2c.offset, (uint32_t)i2c.len, module_num, (uint32_t *)i2c.data, &size_read); if (error) { @@ -3420,7 +3420,7 @@ out: if (i2c.len > MLX5_EEPROM_MAX_BYTES) { error = mlx5_query_eeprom(priv->mdev, - read_addr, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5_EEPROM_LOW_PAGE, (uint32_t)(i2c.offset + size_read), (uint32_t)(i2c.len - size_read), module_num, (uint32_t *)(i2c.data + size_read), &size_read); Modified: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/mlx5io.h Wed Oct 2 10:14:55 2019 (r352983) @@ -55,11 +55,19 @@ struct mlx5_fw_update { size_t img_fw_data_len; }; +struct mlx5_eeprom_get { + struct mlx5_tool_addr devaddr; + uint32_t *eeprom_info_buf; + uint8_t eeprom_info_page_valid; + size_t eeprom_info_out_len; +}; + #define MLX5_FWDUMP_GET _IOWR('m', 1, struct mlx5_fwdump_get) #define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_tool_addr) #define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_tool_addr) #define MLX5_FW_UPDATE _IOW('m', 4, struct mlx5_fw_update) #define MLX5_FW_RESET _IOW('m', 5, struct mlx5_tool_addr) +#define MLX5_EEPROM_GET _IOWR('m', 6, struct mlx5_eeprom_get) #ifndef _KERNEL #define MLX5_DEV_PATH _PATH_DEV"mlx5ctl" Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Wed Oct 2 10:08:04 2019 (r352982) +++ head/sys/dev/mlx5/port.h Wed Oct 2 10:14:55 2019 (r352983) @@ -50,13 +50,34 @@ enum mlx5_an_status { MLX5_AN_LINK_DOWN = 4, }; +/* EEPROM I2C Addresses */ +#define MLX5_I2C_ADDR_LOW 0x50 +#define MLX5_I2C_ADDR_HIGH 0x51 +#define MLX5_EEPROM_PAGE_LENGTH 256 #define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff #define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 #define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 -#define MLX5_I2C_ADDR_LOW 0x50 -#define MLX5_I2C_ADDR_HIGH 0x51 -#define MLX5_EEPROM_PAGE_LENGTH 256 +#define MLX5_EEPROM_LOW_PAGE 0x0 +#define MLX5_EEPROM_HIGH_PAGE 0x3 +#define MLX5_EEPROM_HIGH_PAGE_OFFSET 128 +#define MLX5_EEPROM_INFO_BYTES 0x3 + +/* EEPROM Standards for plug in modules */ +#ifndef MLX5_ETH_MODULE_SFF_8472 +#define MLX5_ETH_MODULE_SFF_8472 0x1 +#define MLX5_ETH_MODULE_SFF_8472_LEN 128 +#endif + +#ifndef MLX5_ETH_MODULE_SFF_8636 +#define MLX5_ETH_MODULE_SFF_8636 0x2 +#define MLX5_ETH_MODULE_SFF_8636_LEN 256 +#endif + +#ifndef MLX5_ETH_MODULE_SFF_8436 +#define MLX5_ETH_MODULE_SFF_8436 0x3 +#define MLX5_ETH_MODULE_SFF_8436_LEN 256 +#endif enum mlx5e_link_speed { MLX5E_1000BASE_CX_SGMII = 0, From owner-svn-src-all@freebsd.org Wed Oct 2 10:16:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7988012A4DF; Wed, 2 Oct 2019 10:16:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 46jsVY48mCz4BP8; Wed, 2 Oct 2019 10:16:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B8B5B43E843; Wed, 2 Oct 2019 20:16:16 +1000 (AEST) Date: Wed, 2 Oct 2019 20:16:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: Brooks Davis , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352795 - head/lib/libc/sys In-Reply-To: Message-ID: <20191002194708.L1083@besplex.bde.org> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> <20190928072548.GN44691@kib.kiev.ua> <20191001162305.GM93439@spindle.one-eyed-alien.net> 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=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8TGUAoZBcfcHxPI8voQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46jsVY48mCz4BP8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.246 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-2.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(0.00)[ip: (-7.08), ipnet: 211.28.0.0/14(-3.26), asn: 4804(-2.40), country: AU(0.01)]; TO_DN_ALL(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[246.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[246.132.29.211.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 10:16:23 -0000 On Tue, 1 Oct 2019, Ed Maste wrote: > On Tue, 1 Oct 2019 at 12:23, Brooks Davis wrote: >> >> This isn't true with CHERI and as a result I've moved the variadic >> argument handling (except for syscall() and __syscall()) into libc. > > My grep found: open, openat, fcntl, semsys, msgsys, shmsys > Is that the full list? I already wrote that this is quite broken for open and fcntl in POSIX. hecking some details shows that it is more fundamentally broken than I thought: - for open(), the type of the mode argument passed by the caller is unspecified. Whatever it is, it is "taken" as type mode_t, whatevr "taking" is. Since historical mode_t has only 16 bits, it can be represented by int even on systems with 16-bit ints, so the caller can start with either mode_t or int provided mode_t is no larger than historical mode_t and ints are either larger than 16 bits or 16 bits and not too exotic (the sign bit might cause problems if not 2's complement) - for fcntl() with F_SETOWN, the type of the pid argument passed by the caller is unspecified. Whatever it is, it is "taken" as type int. Thus if pid_t is larger than int, passing all possible values of pid_t is impossible. If also PID_MAX <= INT_MAX and all values of pid_t are actually <= PID_MAX, then all possible (positive) values can be passed, but the iplementation may have to do extra work to properly break a passed __default_promotion_of(pid_t) type by "taking" it as an int. This was discussed on the POSIX list recently. IMO it is too late and not useful to change the old specification to "take" the arg as anything except int. So pid_t might as well be specified as being a signed integer type whose default promotion is int. It is currently specified as being a signed integer type (with any size or exoticness). Bruce From owner-svn-src-all@freebsd.org Wed Oct 2 10:19:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88ECC12A619; Wed, 2 Oct 2019 10:19:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsYy2x9kz4BbX; Wed, 2 Oct 2019 10:19:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4861729FD6; Wed, 2 Oct 2019 10:19:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AJIHb035124; Wed, 2 Oct 2019 10:19:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AJHQd035122; Wed, 2 Oct 2019 10:19:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021019.x92AJHQd035122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352984 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 352984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:19:18 -0000 Author: hselasky Date: Wed Oct 2 10:19:17 2019 New Revision: 352984 URL: https://svnweb.freebsd.org/changeset/base/352984 Log: Add the ability to query the EEPROM information in mlx5tool(8). Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.8 head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/usr.sbin/mlx5tool/mlx5tool.8 ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.8 Wed Oct 2 10:14:55 2019 (r352983) +++ head/usr.sbin/mlx5tool/mlx5tool.8 Wed Oct 2 10:19:17 2019 (r352984) @@ -30,28 +30,31 @@ .Os .Sh NAME .Nm mlx5tool -.Nd Utility for managing Connect-X 4/5 Mellanox network adapters +.Nd Utility for managing Connect-X 4/5/6 Mellanox network adapters .Sh SYNOPSIS .Nm .Fl d Ar domain:bus:slot:func +.Fl E +.Nm +.Fl d Ar domain:bus:slot:func .Fl e .Nm .Fl d Ar domain:bus:slot:func -.Fl rn +.Fl f Ar file.mfa2 .Nm .Fl d Ar domain:bus:slot:func .Fl o Ar file .Fl w .Nm .Fl d Ar domain:bus:slot:func -.Fl f Ar file.mfa2 +.Fl r .Nm .Fl d Ar domain:bus:slot:func .Fl z .Sh DESCRIPTION The .Nm -utility is provided for management of the Connect-X 4 and 5 network adapters +utility is provided for management of the Connect-X4, 5 and 6 network adapters in the aspects not covered by the generic .Xr ifconfig 8 command, mostly related to the PCIe attachment and internal card working. @@ -73,21 +76,13 @@ analysis of the failure by the Mellanox support team. .Pp The following commands are currently implemented: .Bl -tag -width indent +.It Fl E +Print EEPROM information .It Fl e Take the snapshot of the firmware registers state and store it in the kernel buffer. The buffer must be empty, in other words, no dumps should be written so far, or existing dump cleared with the -.Fl r -command for the specified device. -.It Fl r -Clear the stored firmware dump, preparing the kernel buffer for -the next dump. -.It Fl w -Fetches the stored firmware dump and writes it into the file specified -by the -.Fl o -option argument. .It Fl f Flashes the firmware image .Fa file.mfa2 @@ -100,6 +95,16 @@ newly flashed image, which can be performed by the sys or using the .Fl z option. +.Fl r +command for the specified device. +.It Fl r +Clear the stored firmware dump, preparing the kernel buffer for +the next dump. +.It Fl w +Fetches the stored firmware dump and writes it into the file specified +by the +.Fl o +option argument. .It Fl z Performs PCIe link-level reset on the specified device. .El Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed Oct 2 10:14:55 2019 (r352983) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed Oct 2 10:19:17 2019 (r352984) @@ -200,7 +200,86 @@ mlx5tool_fw_reset(int ctldev, const struct mlx5_tool_a return (0); } +#define MLX5_EEPROM_HIGH_PAGE_OFFSET 128 +#define MLX5_EEPROM_PAGE_LENGTH 256 + static void +mlx5tool_eeprom_print(struct mlx5_eeprom_get *eeprom_info) +{ + unsigned int byte_to_write, index_in_row, line_length, row; + + byte_to_write = 0; + line_length = 16; + + printf("\nOffset\t\tValues\n"); + printf("------\t\t------"); + while (byte_to_write < eeprom_info->eeprom_info_out_len) { + printf("\n0x%04X\t\t", byte_to_write); + for (index_in_row = 0; index_in_row < line_length; + index_in_row++) { + printf("%02X ", + ((uint8_t *)eeprom_info->eeprom_info_buf)[ + byte_to_write]); + byte_to_write++; + } + } + + if (eeprom_info->eeprom_info_page_valid) { + row = MLX5_EEPROM_HIGH_PAGE_OFFSET; + printf("\n\nUpper Page 0x03\n"); + printf("\nOffset\t\tValues\n"); + printf("------\t\t------"); + for (row = MLX5_EEPROM_HIGH_PAGE_OFFSET; + row < MLX5_EEPROM_PAGE_LENGTH;) { + printf("\n0x%04X\t\t", row); + for (index_in_row = 0; + index_in_row < line_length; + index_in_row++) { + printf("%02X ", + ((uint8_t *)eeprom_info-> + eeprom_info_buf)[byte_to_write]); + byte_to_write++; + row++; + } + } + } + printf("\n"); +} + +static int +mlx5tool_get_eeprom_info(int ctldev, const struct mlx5_tool_addr *addr) +{ + struct mlx5_eeprom_get eeprom_info; + int error; + + memset(&eeprom_info, 0, sizeof(eeprom_info)); + eeprom_info.devaddr = *addr; + + error = ioctl(ctldev, MLX5_EEPROM_GET, &eeprom_info); + if (error != 0) { + warn("MLX5_EEPROM_GET"); + return (error); + } + eeprom_info.eeprom_info_buf = + malloc(eeprom_info.eeprom_info_out_len + MLX5_EEPROM_PAGE_LENGTH); + if (eeprom_info.eeprom_info_buf == NULL) { + warn("alloc eeprom_info.eeprom_info_buf "); + return (ENOMEM); + } + error = ioctl(ctldev, MLX5_EEPROM_GET, &eeprom_info); + if (error != 0) { + warn("MLX5_EEPROM_GET"); + free(eeprom_info.eeprom_info_buf); + return (error); + } + + mlx5tool_eeprom_print(&eeprom_info); + + free(eeprom_info.eeprom_info_buf); + return (0); +} + +static void usage(void) { @@ -209,6 +288,7 @@ usage(void) " -e | -f fw.mfa2 | -z]\n"); fprintf(stderr, "\t-w - write firmware dump to the specified file\n"); fprintf(stderr, "\t-r - reset dump\n"); + fprintf(stderr, "\t-E - get eeprom info\n"); fprintf(stderr, "\t-e - force dump\n"); fprintf(stderr, "\t-f fw.img - flash firmware from fw.img\n"); fprintf(stderr, "\t-z - initiate firmware reset\n"); @@ -221,6 +301,7 @@ enum mlx5_action { ACTION_DUMP_FORCE, ACTION_FW_UPDATE, ACTION_FW_RESET, + ACTION_GET_EEPROM_INFO, ACTION_NONE, }; @@ -238,7 +319,7 @@ main(int argc, char *argv[]) addrstr = NULL; dumpname = NULL; img_fw_path = NULL; - while ((c = getopt(argc, argv, "d:ef:ho:rwz")) != -1) { + while ((c = getopt(argc, argv, "d:Eef:ho:rwz")) != -1) { switch (c) { case 'd': addrstr = optarg; @@ -248,6 +329,11 @@ main(int argc, char *argv[]) usage(); act = ACTION_DUMP_GET; break; + case 'E': + if (act != ACTION_NONE) + usage(); + act = ACTION_GET_EEPROM_INFO; + break; case 'e': if (act != ACTION_NONE) usage(); @@ -302,6 +388,9 @@ main(int argc, char *argv[]) break; case ACTION_FW_RESET: res = mlx5tool_fw_reset(ctldev, &addr); + break; + case ACTION_GET_EEPROM_INFO: + res = mlx5tool_get_eeprom_info(ctldev, &addr); break; default: res = 0; From owner-svn-src-all@freebsd.org Wed Oct 2 10:22:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FFF612A7F7; Wed, 2 Oct 2019 10:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsdP24k5z4Bx8; Wed, 2 Oct 2019 10:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B2BD2A180; Wed, 2 Oct 2019 10:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AMHHX040773; Wed, 2 Oct 2019 10:22:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AMF5j040768; Wed, 2 Oct 2019 10:22:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021022.x92AMF5j040768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352985 - in head/sys/dev/mlx5: . mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 352985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:22:17 -0000 Author: hselasky Date: Wed Oct 2 10:22:15 2019 New Revision: 352985 URL: https://svnweb.freebsd.org/changeset/base/352985 Log: Add sysctl(8) to get and set forward error correction, FEC, configuration in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/device.h Wed Oct 2 10:22:15 2019 (r352985) @@ -1053,6 +1053,9 @@ enum mlx5_mcam_feature_groups { #define MLX5_CAP_PCAM_FEATURE(mdev, fld) \ MLX5_GET(pcam_reg, (mdev)->caps.pcam, feature_cap_mask.enhanced_features.fld) +#define MLX5_CAP_PCAM_REG(mdev, reg) \ + MLX5_GET(pcam_reg, (mdev)->caps.pcam, port_access_reg_cap_mask.regs_5000_to_507f.reg) + #define MLX5_CAP_MCAM_FEATURE(mdev, fld) \ MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/driver.h Wed Oct 2 10:22:15 2019 (r352985) @@ -144,6 +144,7 @@ enum { MLX5_REG_PVLC = 0x500F, MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, + MLX5_REG_PPLM = 0x5023, MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:22:15 2019 (r352985) @@ -76,6 +76,9 @@ #define MLX5E_MAX_PRIORITY 8 +#define MLX5E_MAX_FEC_10X_25X 4 +#define MLX5E_MAX_FEC_50X 4 + /* IEEE 802.1Qaz standard supported values */ #define IEEE_8021QAZ_MAX_TCS 8 @@ -712,6 +715,11 @@ struct mlx5e_params_ethtool { u8 prio_tc[MLX5E_MAX_PRIORITY]; u8 dscp2prio[MLX5_MAX_SUPPORTED_DSCP]; u8 trust_state; + u8 fec_mask_10x_25x[MLX5E_MAX_FEC_10X_25X]; + u16 fec_mask_50x[MLX5E_MAX_FEC_50X]; + u8 fec_avail_10x_25x[MLX5E_MAX_FEC_10X_25X]; + u16 fec_avail_50x[MLX5E_MAX_FEC_50X]; + u32 fec_mode_active; }; struct mlx5e_cq { @@ -1175,5 +1183,6 @@ void mlx5e_resume_sq(struct mlx5e_sq *sq); void mlx5e_update_sq_inline(struct mlx5e_sq *sq); void mlx5e_refresh_sq_inline(struct mlx5e_priv *priv); int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); +int mlx5e_fec_update(struct mlx5e_priv *priv); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 10:22:15 2019 (r352985) @@ -346,7 +346,286 @@ done: return (err); } +int +mlx5e_fec_update(struct mlx5e_priv *priv) +{ + struct mlx5_core_dev *mdev = priv->mdev; + u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {}; + const int sz = MLX5_ST_SZ_BYTES(pplm_reg); + int err; + + if (!MLX5_CAP_GEN(mdev, pcam_reg)) + return (EOPNOTSUPP); + + if (!MLX5_CAP_PCAM_REG(mdev, pplm)) + return (EOPNOTSUPP); + + MLX5_SET(pplm_reg, in, local_port, 1); + + err = -mlx5_core_access_reg(mdev, in, sz, in, sz, MLX5_REG_PPLM, 0, 0); + if (err) + return (err); + + /* get 10x..25x mask */ + priv->params_ethtool.fec_mask_10x_25x[0] = + MLX5_GET(pplm_reg, in, fec_override_admin_10g_40g); + priv->params_ethtool.fec_mask_10x_25x[1] = + MLX5_GET(pplm_reg, in, fec_override_admin_25g) & + MLX5_GET(pplm_reg, in, fec_override_admin_50g); + priv->params_ethtool.fec_mask_10x_25x[2] = + MLX5_GET(pplm_reg, in, fec_override_admin_56g); + priv->params_ethtool.fec_mask_10x_25x[3] = + MLX5_GET(pplm_reg, in, fec_override_admin_100g); + + /* get 10x..25x available bits */ + priv->params_ethtool.fec_avail_10x_25x[0] = + MLX5_GET(pplm_reg, in, fec_override_cap_10g_40g); + priv->params_ethtool.fec_avail_10x_25x[1] = + MLX5_GET(pplm_reg, in, fec_override_cap_25g) & + MLX5_GET(pplm_reg, in, fec_override_cap_50g); + priv->params_ethtool.fec_avail_10x_25x[2] = + MLX5_GET(pplm_reg, in, fec_override_cap_56g); + priv->params_ethtool.fec_avail_10x_25x[3] = + MLX5_GET(pplm_reg, in, fec_override_cap_100g); + + /* get 50x mask */ + priv->params_ethtool.fec_mask_50x[0] = + MLX5_GET(pplm_reg, in, fec_override_admin_50g_1x); + priv->params_ethtool.fec_mask_50x[1] = + MLX5_GET(pplm_reg, in, fec_override_admin_100g_2x); + priv->params_ethtool.fec_mask_50x[2] = + MLX5_GET(pplm_reg, in, fec_override_admin_200g_4x); + priv->params_ethtool.fec_mask_50x[3] = + MLX5_GET(pplm_reg, in, fec_override_admin_400g_8x); + + /* get 50x available bits */ + priv->params_ethtool.fec_avail_50x[0] = + MLX5_GET(pplm_reg, in, fec_override_cap_50g_1x); + priv->params_ethtool.fec_avail_50x[1] = + MLX5_GET(pplm_reg, in, fec_override_cap_100g_2x); + priv->params_ethtool.fec_avail_50x[2] = + MLX5_GET(pplm_reg, in, fec_override_cap_200g_4x); + priv->params_ethtool.fec_avail_50x[3] = + MLX5_GET(pplm_reg, in, fec_override_cap_400g_8x); + + /* get current FEC mask */ + priv->params_ethtool.fec_mode_active = + MLX5_GET(pplm_reg, in, fec_mode_active); + + return (0); +} + static int +mlx5e_fec_mask_10x_25x_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + struct mlx5_core_dev *mdev = priv->mdev; + u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {}; + u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {}; + const int sz = MLX5_ST_SZ_BYTES(pplm_reg); + u8 fec_mask_10x_25x[MLX5E_MAX_FEC_10X_25X]; + u8 fec_cap_changed = 0; + u8 x; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.fec_mask_10x_25x, + sizeof(priv->params_ethtool.fec_mask_10x_25x)); + if (err || !req->newptr) + goto done; + + err = SYSCTL_IN(req, fec_mask_10x_25x, + sizeof(fec_mask_10x_25x)); + if (err) + goto done; + + if (!MLX5_CAP_GEN(mdev, pcam_reg)) { + err = EOPNOTSUPP; + goto done; + } + + if (!MLX5_CAP_PCAM_REG(mdev, pplm)) { + err = EOPNOTSUPP; + goto done; + } + + MLX5_SET(pplm_reg, in, local_port, 1); + + err = -mlx5_core_access_reg(mdev, in, sz, in, sz, MLX5_REG_PPLM, 0, 0); + if (err) + goto done; + + /* range check input value */ + for (x = 0; x != MLX5E_MAX_FEC_10X_25X; x++) { + /* check only one bit is set, if any */ + if (fec_mask_10x_25x[x] & (fec_mask_10x_25x[x] - 1)) { + err = ERANGE; + goto done; + } + /* check a supported bit is set, if any */ + if (fec_mask_10x_25x[x] & + ~priv->params_ethtool.fec_avail_10x_25x[x]) { + err = ERANGE; + goto done; + } + fec_cap_changed |= (fec_mask_10x_25x[x] ^ + priv->params_ethtool.fec_mask_10x_25x[x]); + } + + /* check for no changes */ + if (fec_cap_changed == 0) + goto done; + + memset(in, 0, sizeof(in)); + + MLX5_SET(pplm_reg, in, local_port, 1); + + /* set new values */ + MLX5_SET(pplm_reg, in, fec_override_admin_10g_40g, fec_mask_10x_25x[0]); + MLX5_SET(pplm_reg, in, fec_override_admin_25g, fec_mask_10x_25x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_50g, fec_mask_10x_25x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_56g, fec_mask_10x_25x[2]); + MLX5_SET(pplm_reg, in, fec_override_admin_100g, fec_mask_10x_25x[3]); + + /* preserve other values */ + MLX5_SET(pplm_reg, in, fec_override_admin_50g_1x, priv->params_ethtool.fec_mask_50x[0]); + MLX5_SET(pplm_reg, in, fec_override_admin_100g_2x, priv->params_ethtool.fec_mask_50x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_200g_4x, priv->params_ethtool.fec_mask_50x[2]); + MLX5_SET(pplm_reg, in, fec_override_admin_400g_8x, priv->params_ethtool.fec_mask_50x[3]); + + /* send new value to the firmware */ + err = -mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPLM, 0, 1); + if (err) + goto done; + + memcpy(priv->params_ethtool.fec_mask_10x_25x, fec_mask_10x_25x, + sizeof(priv->params_ethtool.fec_mask_10x_25x)); + + mlx5_toggle_port_link(priv->mdev); +done: + PRIV_UNLOCK(priv); + return (err); +} + +static int +mlx5e_fec_avail_10x_25x_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.fec_avail_10x_25x, + sizeof(priv->params_ethtool.fec_avail_10x_25x)); + PRIV_UNLOCK(priv); + return (err); +} + +static int +mlx5e_fec_mask_50x_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + struct mlx5_core_dev *mdev = priv->mdev; + u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {}; + u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {}; + const int sz = MLX5_ST_SZ_BYTES(pplm_reg); + u16 fec_mask_50x[MLX5E_MAX_FEC_50X]; + u16 fec_cap_changed = 0; + u8 x; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.fec_mask_50x, + sizeof(priv->params_ethtool.fec_mask_50x)); + if (err || !req->newptr) + goto done; + + err = SYSCTL_IN(req, fec_mask_50x, + sizeof(fec_mask_50x)); + if (err) + goto done; + + if (!MLX5_CAP_GEN(mdev, pcam_reg)) { + err = EOPNOTSUPP; + goto done; + } + + if (!MLX5_CAP_PCAM_REG(mdev, pplm)) { + err = EOPNOTSUPP; + goto done; + } + + MLX5_SET(pplm_reg, in, local_port, 1); + + err = -mlx5_core_access_reg(mdev, in, sz, in, sz, MLX5_REG_PPLM, 0, 0); + if (err) + goto done; + + /* range check input value */ + for (x = 0; x != MLX5E_MAX_FEC_50X; x++) { + /* check only one bit is set, if any */ + if (fec_mask_50x[x] & (fec_mask_50x[x] - 1)) { + err = ERANGE; + goto done; + } + /* check a supported bit is set, if any */ + if (fec_mask_50x[x] & + ~priv->params_ethtool.fec_avail_50x[x]) { + err = ERANGE; + goto done; + } + fec_cap_changed |= (fec_mask_50x[x] ^ + priv->params_ethtool.fec_mask_50x[x]); + } + + /* check for no changes */ + if (fec_cap_changed == 0) + goto done; + + memset(in, 0, sizeof(in)); + + MLX5_SET(pplm_reg, in, local_port, 1); + + /* set new values */ + MLX5_SET(pplm_reg, in, fec_override_admin_50g_1x, fec_mask_50x[0]); + MLX5_SET(pplm_reg, in, fec_override_admin_100g_2x, fec_mask_50x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_200g_4x, fec_mask_50x[2]); + MLX5_SET(pplm_reg, in, fec_override_admin_400g_8x, fec_mask_50x[3]); + + /* preserve other values */ + MLX5_SET(pplm_reg, in, fec_override_admin_10g_40g, priv->params_ethtool.fec_mask_10x_25x[0]); + MLX5_SET(pplm_reg, in, fec_override_admin_25g, priv->params_ethtool.fec_mask_10x_25x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_50g, priv->params_ethtool.fec_mask_10x_25x[1]); + MLX5_SET(pplm_reg, in, fec_override_admin_56g, priv->params_ethtool.fec_mask_10x_25x[2]); + MLX5_SET(pplm_reg, in, fec_override_admin_100g, priv->params_ethtool.fec_mask_10x_25x[3]); + + /* send new value to the firmware */ + err = -mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPLM, 0, 1); + if (err) + goto done; + + memcpy(priv->params_ethtool.fec_mask_50x, fec_mask_50x, + sizeof(priv->params_ethtool.fec_mask_50x)); + + mlx5_toggle_port_link(priv->mdev); +done: + PRIV_UNLOCK(priv); + return (err); +} + +static int +mlx5e_fec_avail_50x_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.fec_avail_50x, + sizeof(priv->params_ethtool.fec_avail_50x)); + PRIV_UNLOCK(priv); + return (err); +} + +static int mlx5e_trust_state_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; @@ -1047,7 +1326,9 @@ mlx5e_create_diagnostics(struct mlx5e_priv *priv) void mlx5e_create_ethtool(struct mlx5e_priv *priv) { - struct sysctl_oid *node, *qos_node; + struct sysctl_oid *fec_node; + struct sysctl_oid *qos_node; + struct sysctl_oid *node; const char *pnameunit; struct mlx5e_port_buffer port_buffer; unsigned x; @@ -1126,6 +1407,54 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) mlx5e_ethtool_handler(NULL, priv, x, NULL); #endif } + } + + /* create fec node */ + fec_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, + "fec", CTLFLAG_RW, NULL, "Forward Error Correction"); + if (fec_node == NULL) + return; + + if (mlx5e_fec_update(priv) == 0) { + SYSCTL_ADD_U32(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, + "mode_active", CTLFLAG_RD | CTLFLAG_MPSAFE, + &priv->params_ethtool.fec_mode_active, 0, + "Current FEC mode bit, if any."); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, + "mask_10x_25x", CTLTYPE_U8 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, &mlx5e_fec_mask_10x_25x_handler, "CU", + "Set FEC masks for 10G_40G, 25G_50G, 56G, 100G respectivly. " + "0:Auto " + "1:NOFEC " + "2:FIRECODE " + "4:RS"); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, + "avail_10x_25x", CTLTYPE_U8 | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, &mlx5e_fec_avail_10x_25x_handler, "CU", + "Get available FEC bits for 10G_40G, 25G_50G, 56G, 100G respectivly. " + "0:Auto " + "1:NOFEC " + "2:FIRECODE " + "4:RS"); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, + "mask_50x", CTLTYPE_U16 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, &mlx5e_fec_mask_50x_handler, "SU", + "Set FEC masks for 50G 1x, 100G 2x, 200G 4x, 400G 8x respectivly. " + "0:Auto " + "128:RS " + "512:LL RS"); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, + "avail_50x", CTLTYPE_U16 | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, &mlx5e_fec_avail_50x_handler, "SU", + "Get available FEC bits for 50G 1x, 100G 2x, 200G 4x, 400G 8x respectivly. " + "0:Auto " + "128:RS " + "512:LL RS"); } SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:22:15 2019 (r352985) @@ -860,6 +860,7 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) u64 rx_packets = 0; u64 rx_bytes = 0; u32 rx_out_of_buffer = 0; + int error; int i; int j; @@ -1016,12 +1017,19 @@ free_out: /* Update diagnostics, if any */ if (priv->params_ethtool.diag_pci_enable || priv->params_ethtool.diag_general_enable) { - int error = mlx5_core_get_diagnostics_full(mdev, + error = mlx5_core_get_diagnostics_full(mdev, priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL, priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL); if (error != 0) mlx5_en_err(priv->ifp, "Failed reading diagnostics: %d\n", error); + } + + /* Update FEC, if any */ + error = mlx5e_fec_update(priv); + if (error != 0 && error != EOPNOTSUPP) { + mlx5_en_err(priv->ifp, + "Updating FEC failed: %d\n", error); } } Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 10:19:17 2019 (r352984) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed Oct 2 10:22:15 2019 (r352985) @@ -7992,31 +7992,47 @@ struct mlx5_ifc_pplr_reg_bits { }; struct mlx5_ifc_pplm_reg_bits { - u8 reserved_0[0x8]; - u8 local_port[0x8]; - u8 reserved_1[0x10]; + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 reserved_at_10[0x10]; - u8 reserved_2[0x20]; + u8 reserved_at_20[0x20]; - u8 port_profile_mode[0x8]; - u8 static_port_profile[0x8]; - u8 active_port_profile[0x8]; - u8 reserved_3[0x8]; + u8 port_profile_mode[0x8]; + u8 static_port_profile[0x8]; + u8 active_port_profile[0x8]; + u8 reserved_at_58[0x8]; - u8 retransmission_active[0x8]; - u8 fec_mode_active[0x18]; + u8 retransmission_active[0x8]; + u8 fec_mode_active[0x18]; - u8 reserved_4[0x10]; - u8 v_100g_fec_override_cap[0x4]; - u8 v_50g_fec_override_cap[0x4]; - u8 v_25g_fec_override_cap[0x4]; - u8 v_10g_40g_fec_override_cap[0x4]; + u8 rs_fec_correction_bypass_cap[0x4]; + u8 reserved_at_84[0x8]; + u8 fec_override_cap_56g[0x4]; + u8 fec_override_cap_100g[0x4]; + u8 fec_override_cap_50g[0x4]; + u8 fec_override_cap_25g[0x4]; + u8 fec_override_cap_10g_40g[0x4]; - u8 reserved_5[0x10]; - u8 v_100g_fec_override_admin[0x4]; - u8 v_50g_fec_override_admin[0x4]; - u8 v_25g_fec_override_admin[0x4]; - u8 v_10g_40g_fec_override_admin[0x4]; + u8 rs_fec_correction_bypass_admin[0x4]; + u8 reserved_at_a4[0x8]; + u8 fec_override_admin_56g[0x4]; + u8 fec_override_admin_100g[0x4]; + u8 fec_override_admin_50g[0x4]; + u8 fec_override_admin_25g[0x4]; + u8 fec_override_admin_10g_40g[0x4]; + + u8 fec_override_cap_400g_8x[0x10]; + u8 fec_override_cap_200g_4x[0x10]; + u8 fec_override_cap_100g_2x[0x10]; + u8 fec_override_cap_50g_1x[0x10]; + + u8 fec_override_admin_400g_8x[0x10]; + u8 fec_override_admin_200g_4x[0x10]; + u8 fec_override_admin_100g_2x[0x10]; + u8 fec_override_admin_50g_1x[0x10]; + + u8 reserved_at_140[0xC0]; }; struct mlx5_ifc_ppll_reg_bits { @@ -8610,6 +8626,22 @@ struct mlx5_ifc_pcam_enhanced_features_bits { u8 ppcnt_statistical_group[0x1]; }; +struct mlx5_ifc_pcam_regs_5000_to_507f_bits { + u8 port_access_reg_cap_mask_127_to_96[0x20]; + u8 port_access_reg_cap_mask_95_to_64[0x20]; + + u8 port_access_reg_cap_mask_63_to_36[0x1c]; + u8 pplm[0x1]; + u8 port_access_reg_cap_mask_34_to_32[0x3]; + + u8 port_access_reg_cap_mask_31_to_13[0x13]; + u8 pbmc[0x1]; + u8 pptb[0x1]; + u8 port_access_reg_cap_mask_10_to_09[0x2]; + u8 ppcnt[0x1]; + u8 port_access_reg_cap_mask_07_to_00[0x8]; +}; + struct mlx5_ifc_pcam_reg_bits { u8 reserved_at_0[0x8]; u8 feature_group[0x8]; @@ -8619,6 +8651,7 @@ struct mlx5_ifc_pcam_reg_bits { u8 reserved_at_20[0x20]; union { + struct mlx5_ifc_pcam_regs_5000_to_507f_bits regs_5000_to_507f; u8 reserved_at_0[0x80]; } port_access_reg_cap_mask; From owner-svn-src-all@freebsd.org Wed Oct 2 10:24:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A418F12A8D9; Wed, 2 Oct 2019 10:24:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsgf3vlSz4C8S; Wed, 2 Oct 2019 10:24:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A60C2A1A5; Wed, 2 Oct 2019 10:24:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AOEZR040902; Wed, 2 Oct 2019 10:24:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AODgA040899; Wed, 2 Oct 2019 10:24:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021024.x92AODgA040899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352986 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:24:14 -0000 Author: hselasky Date: Wed Oct 2 10:24:13 2019 New Revision: 352986 URL: https://svnweb.freebsd.org/changeset/base/352986 Log: Return an error from ioctl(MLX5_FW_RESET) if reset was rejected in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 10:22:15 2019 (r352985) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 10:24:13 2019 (r352986) @@ -110,7 +110,7 @@ void mlx5e_cleanup(void); int mlx5_ctl_init(void); void mlx5_ctl_fini(void); void mlx5_fwdump_prep(struct mlx5_core_dev *mdev); -void mlx5_fwdump(struct mlx5_core_dev *mdev); +int mlx5_fwdump(struct mlx5_core_dev *mdev); void mlx5_fwdump_clean(struct mlx5_core_dev *mdev); struct mlx5_crspace_regmap { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 10:22:15 2019 (r352985) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 10:24:13 2019 (r352986) @@ -148,7 +148,7 @@ unlock_vsc: mlx5_vsc_unlock(mdev); } -void +int mlx5_fwdump(struct mlx5_core_dev *mdev) { const struct mlx5_crspace_regmap *r; @@ -157,12 +157,15 @@ mlx5_fwdump(struct mlx5_core_dev *mdev) mlx5_core_info(mdev, "Issuing FW dump\n"); mtx_lock(&mdev->dump_lock); - if (mdev->dump_data == NULL) + if (mdev->dump_data == NULL) { + error = EIO; goto failed; + } if (mdev->dump_valid) { /* only one dump */ mlx5_core_warn(mdev, "Only one FW dump can be captured aborting FW dump\n"); + error = EEXIST; goto failed; } @@ -187,6 +190,7 @@ unlock_vsc: mlx5_vsc_unlock(mdev); failed: mtx_unlock(&mdev->dump_lock); + return (error); } void @@ -400,7 +404,7 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d error = mlx5_dbsf_to_core(devaddr, &mdev); if (error != 0) break; - mlx5_fwdump(mdev); + error = mlx5_fwdump(mdev); break; case MLX5_FW_UPDATE: if ((fflag & FWRITE) == 0) { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 10:22:15 2019 (r352985) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed Oct 2 10:24:13 2019 (r352986) @@ -300,7 +300,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, /* Execute cr-dump and SW reset */ if (lock != -EBUSY) { - mlx5_fwdump(dev); + (void)mlx5_fwdump(dev); reset_fw_if_needed(dev); delay_ms = MLX5_FW_RESET_WAIT_MS; } From owner-svn-src-all@freebsd.org Wed Oct 2 10:25:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 582D112A9AF; Wed, 2 Oct 2019 10:25:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jsjS1fLpz4CHr; Wed, 2 Oct 2019 10:25:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CFAB2A1A6; Wed, 2 Oct 2019 10:25:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92APlif041021; Wed, 2 Oct 2019 10:25:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92APlN1041019; Wed, 2 Oct 2019 10:25:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021025.x92APlN1041019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352987 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:25:48 -0000 Author: hselasky Date: Wed Oct 2 10:25:47 2019 New Revision: 352987 URL: https://svnweb.freebsd.org/changeset/base/352987 Log: Remove mkey_be from channel structure in mlx5en(4). Use value from priv structure instead. This saves some space in the channel structure. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:24:13 2019 (r352986) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:25:47 2019 (r352987) @@ -863,7 +863,6 @@ struct mlx5e_channel { struct mlx5e_rq rq; struct mlx5e_snd_tag tag; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; - u32 mkey_be; u8 num_tc; /* control */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:24:13 2019 (r352986) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:25:47 2019 (r352987) @@ -1273,7 +1273,7 @@ mlx5e_create_rq(struct mlx5e_channel *c, /* set value for constant fields */ for (j = 0; j < rq->nsegs; j++) - wqe->data[j].lkey = c->mkey_be; + wqe->data[j].lkey = cpu_to_be32(priv->mr.key); } INIT_WORK(&rq->dim.work, mlx5e_dim_work); @@ -1629,7 +1629,7 @@ mlx5e_create_sq(struct mlx5e_channel *c, if (err) goto err_sq_wq_destroy; - sq->mkey_be = c->mkey_be; + sq->mkey_be = cpu_to_be32(priv->mr.key); sq->ifp = priv->ifp; sq->priv = priv; sq->tc = tc; @@ -2158,7 +2158,6 @@ mlx5e_open_channel(struct mlx5e_priv *priv, int ix, c->ix = ix; /* setup send tag */ c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; - c->mkey_be = cpu_to_be32(priv->mr.key); c->num_tc = priv->num_tc; /* init mutexes */ From owner-svn-src-all@freebsd.org Wed Oct 2 10:26:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40E0812AA1E; Wed, 2 Oct 2019 10:26:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jskC0xSBz4CQl; Wed, 2 Oct 2019 10:26:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03CF52A1A7; Wed, 2 Oct 2019 10:26:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AQQfe041093; Wed, 2 Oct 2019 10:26:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AQQCQ041092; Wed, 2 Oct 2019 10:26:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021026.x92AQQCQ041092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352988 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:26:27 -0000 Author: hselasky Date: Wed Oct 2 10:26:26 2019 New Revision: 352988 URL: https://svnweb.freebsd.org/changeset/base/352988 Log: Remove unused cpu field from channel structure in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:25:47 2019 (r352987) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:26:26 2019 (r352988) @@ -868,7 +868,6 @@ struct mlx5e_channel { /* control */ struct mlx5e_priv *priv; int ix; - int cpu; } __aligned(MLX5E_CACHELINE_SIZE); enum mlx5e_traffic_types { From owner-svn-src-all@freebsd.org Wed Oct 2 10:43:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B620412AE9B; Wed, 2 Oct 2019 10:43:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jt6G4MNCz4DWj; Wed, 2 Oct 2019 10:43:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 794E82A522; Wed, 2 Oct 2019 10:43:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92Ahoqj052860; Wed, 2 Oct 2019 10:43:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AhoL4052858; Wed, 2 Oct 2019 10:43:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021043.x92AhoL4052858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352989 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:43:50 -0000 Author: hselasky Date: Wed Oct 2 10:43:49 2019 New Revision: 352989 URL: https://svnweb.freebsd.org/changeset/base/352989 Log: Seal transmit path with regards to using destroyed mutex in mlx5en(4). It may happen during link down that the running state may be observed non-zero in the transmit routine, right before the running state is cleared. This may end up using a destroyed mutex. Make all channel mutexes and callouts persistant. Preserve receive and send queue statistics during link toggle. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:26:26 2019 (r352988) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:43:49 2019 (r352989) @@ -139,6 +139,10 @@ #define MLX5E_100MB (100000) #define MLX5E_1GB (1000000) +#define MLX5E_ZERO(ptr, field) \ + memset(&(ptr)->field, 0, \ + sizeof(*(ptr)) - __offsetof(__typeof(*(ptr)), field)) + MALLOC_DECLARE(M_MLX5EN); struct mlx5_core_dev; @@ -741,15 +745,18 @@ struct mlx5e_rq_mbuf { }; struct mlx5e_rq { + /* persistant fields */ + struct mtx mtx; + struct mlx5e_rq_stats stats; + /* data path */ +#define mlx5e_rq_zero_start wq struct mlx5_wq_ll wq; - struct mtx mtx; bus_dma_tag_t dma_tag; u32 wqe_sz; u32 nsegs; struct mlx5e_rq_mbuf *mbuf; struct ifnet *ifp; - struct mlx5e_rq_stats stats; struct mlx5e_cq cq; struct lro_ctrl lro; volatile int enabled; @@ -783,11 +790,15 @@ struct mlx5e_snd_tag { }; struct mlx5e_sq { - /* data path */ + /* persistant fields */ struct mtx lock; - bus_dma_tag_t dma_tag; struct mtx comp_lock; + struct mlx5e_sq_stats stats; + /* data path */ +#define mlx5e_sq_zero_start dma_tag + bus_dma_tag_t dma_tag; + /* dirtied @completion */ u16 cc; @@ -806,7 +817,6 @@ struct mlx5e_sq { u32 d32[2]; u64 d64; } doorbell; - struct mlx5e_sq_stats stats; struct mlx5e_cq cq; @@ -859,13 +869,9 @@ mlx5e_sq_queue_level(struct mlx5e_sq *sq) } struct mlx5e_channel { - /* data path */ struct mlx5e_rq rq; struct mlx5e_snd_tag tag; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; - u8 num_tc; - - /* control */ struct mlx5e_priv *priv; int ix; } __aligned(MLX5E_CACHELINE_SIZE); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:26:26 2019 (r352988) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:43:49 2019 (r352989) @@ -1481,8 +1481,6 @@ mlx5e_close_rq(struct mlx5e_rq *rq) callout_stop(&rq->watchdog); mtx_unlock(&rq->mtx); - callout_drain(&rq->watchdog); - mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); } @@ -1564,7 +1562,7 @@ mlx5e_refresh_sq_inline_sub(struct mlx5e_priv *priv, s { int i; - for (i = 0; i != c->num_tc; i++) { + for (i = 0; i != priv->num_tc; i++) { mtx_lock(&c->sq[i].lock); mlx5e_update_sq_inline(&c->sq[i]); mtx_unlock(&c->sq[i].lock); @@ -1751,6 +1749,12 @@ mlx5e_open_sq(struct mlx5e_channel *c, { int err; + sq->cev_factor = c->priv->params_ethtool.tx_completion_fact; + + /* ensure the TX completion event factor is not zero */ + if (sq->cev_factor == 0) + sq->cev_factor = 1; + err = mlx5e_create_sq(c, tc, param, sq); if (err) return (err); @@ -1862,9 +1866,6 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) mlx5e_sq_send_nops_locked(sq, 1); mtx_unlock(&sq->lock); - /* make sure it is safe to free the callout */ - callout_drain(&sq->cev_callout); - /* wait till SQ is empty or link is down */ mtx_lock(&sq->lock); while (sq->cc != sq->pc && @@ -2049,7 +2050,7 @@ mlx5e_open_tx_cqs(struct mlx5e_channel *c, int err; int tc; - for (tc = 0; tc < c->num_tc; tc++) { + for (tc = 0; tc < c->priv->num_tc; tc++) { /* open completion queue */ err = mlx5e_open_cq(c->priv, &cparam->tx_cq, &c->sq[tc].cq, &mlx5e_tx_cq_comp, c->ix); @@ -2070,7 +2071,7 @@ mlx5e_close_tx_cqs(struct mlx5e_channel *c) { int tc; - for (tc = 0; tc < c->num_tc; tc++) + for (tc = 0; tc < c->priv->num_tc; tc++) mlx5e_close_cq(&c->sq[tc].cq); } @@ -2081,7 +2082,7 @@ mlx5e_open_sqs(struct mlx5e_channel *c, int err; int tc; - for (tc = 0; tc < c->num_tc; tc++) { + for (tc = 0; tc < c->priv->num_tc; tc++) { err = mlx5e_open_sq(c, tc, &cparam->sq, &c->sq[tc]); if (err) goto err_close_sqs; @@ -2101,20 +2102,28 @@ mlx5e_close_sqs_wait(struct mlx5e_channel *c) { int tc; - for (tc = 0; tc < c->num_tc; tc++) + for (tc = 0; tc < c->priv->num_tc; tc++) mlx5e_close_sq_wait(&c->sq[tc]); } static void -mlx5e_chan_mtx_init(struct mlx5e_channel *c) +mlx5e_chan_static_init(struct mlx5e_priv *priv, struct mlx5e_channel *c, int ix) { int tc; + /* setup priv and channel number */ + c->priv = priv; + c->ix = ix; + + /* setup send tag */ + c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; + m_snd_tag_init(&c->tag.m_snd_tag, c->priv->ifp); + mtx_init(&c->rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&c->rq.watchdog, &c->rq.mtx, 0); - for (tc = 0; tc < c->num_tc; tc++) { + for (tc = 0; tc != MLX5E_MAX_TX_NUM_TC; tc++) { struct mlx5e_sq *sq = c->sq + tc; mtx_init(&sq->lock, "mlx5tx", @@ -2123,46 +2132,40 @@ mlx5e_chan_mtx_init(struct mlx5e_channel *c) MTX_NETWORK_LOCK " TX", MTX_DEF); callout_init_mtx(&sq->cev_callout, &sq->lock, 0); - - sq->cev_factor = c->priv->params_ethtool.tx_completion_fact; - - /* ensure the TX completion event factor is not zero */ - if (sq->cev_factor == 0) - sq->cev_factor = 1; } } static void -mlx5e_chan_mtx_destroy(struct mlx5e_channel *c) +mlx5e_chan_static_destroy(struct mlx5e_channel *c) { int tc; + /* drop our reference */ + m_snd_tag_rele(&c->tag.m_snd_tag); + + callout_drain(&c->rq.watchdog); + mtx_destroy(&c->rq.mtx); - for (tc = 0; tc < c->num_tc; tc++) { + for (tc = 0; tc != MLX5E_MAX_TX_NUM_TC; tc++) { + callout_drain(&c->sq[tc].cev_callout); mtx_destroy(&c->sq[tc].lock); mtx_destroy(&c->sq[tc].comp_lock); } } static int -mlx5e_open_channel(struct mlx5e_priv *priv, int ix, +mlx5e_open_channel(struct mlx5e_priv *priv, struct mlx5e_channel_param *cparam, struct mlx5e_channel *c) { - int err; + int i, err; - memset(c, 0, sizeof(*c)); + /* zero non-persistant data */ + MLX5E_ZERO(&c->rq, mlx5e_rq_zero_start); + for (i = 0; i != priv->num_tc; i++) + MLX5E_ZERO(&c->sq[i], mlx5e_sq_zero_start); - c->priv = priv; - c->ix = ix; - /* setup send tag */ - c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; - c->num_tc = priv->num_tc; - - /* init mutexes */ - mlx5e_chan_mtx_init(c); - /* open transmit completion queue */ err = mlx5e_open_tx_cqs(c, cparam); if (err) @@ -2197,8 +2200,6 @@ err_close_tx_cqs: mlx5e_close_tx_cqs(c); err_free: - /* destroy mutexes */ - mlx5e_chan_mtx_destroy(c); return (err); } @@ -2214,8 +2215,6 @@ mlx5e_close_channel_wait(struct mlx5e_channel *c) mlx5e_close_rq_wait(&c->rq); mlx5e_close_sqs_wait(c); mlx5e_close_tx_cqs(c); - /* destroy mutexes */ - mlx5e_chan_mtx_destroy(c); } static int @@ -2411,14 +2410,16 @@ mlx5e_build_channel_param(struct mlx5e_priv *priv, static int mlx5e_open_channels(struct mlx5e_priv *priv) { - struct mlx5e_channel_param cparam; + struct mlx5e_channel_param *cparam; int err; int i; int j; - mlx5e_build_channel_param(priv, &cparam); + cparam = malloc(sizeof(*cparam), M_MLX5EN, M_WAITOK); + + mlx5e_build_channel_param(priv, cparam); for (i = 0; i < priv->params.num_channels; i++) { - err = mlx5e_open_channel(priv, i, &cparam, &priv->channel[i]); + err = mlx5e_open_channel(priv, cparam, &priv->channel[i]); if (err) goto err_close_channels; } @@ -2428,6 +2429,7 @@ mlx5e_open_channels(struct mlx5e_priv *priv) if (err) goto err_close_channels; } + free(cparam, M_MLX5EN); return (0); err_close_channels: @@ -2435,6 +2437,7 @@ err_close_channels: mlx5e_close_channel(&priv->channel[i]); mlx5e_close_channel_wait(&priv->channel[i]); } + free(cparam, M_MLX5EN); return (err); } @@ -2544,7 +2547,7 @@ mlx5e_refresh_channel_params_sub(struct mlx5e_priv *pr if (err) goto done; - for (i = 0; i != c->num_tc; i++) { + for (i = 0; i != priv->num_tc; i++) { err = mlx5e_refresh_sq_params(priv, &c->sq[i]); if (err) goto done; @@ -3601,17 +3604,26 @@ static const char *mlx5e_pport_stats_desc[] = { }; static void -mlx5e_priv_mtx_init(struct mlx5e_priv *priv) +mlx5e_priv_static_init(struct mlx5e_priv *priv, const uint32_t channels) { + uint32_t x; + mtx_init(&priv->async_events_mtx, "mlx5async", MTX_NETWORK_LOCK, MTX_DEF); sx_init(&priv->state_lock, "mlx5state"); callout_init_mtx(&priv->watchdog, &priv->async_events_mtx, 0); MLX5_INIT_DOORBELL_LOCK(&priv->doorbell_lock); + for (x = 0; x != channels; x++) + mlx5e_chan_static_init(priv, &priv->channel[x], x); } static void -mlx5e_priv_mtx_destroy(struct mlx5e_priv *priv) +mlx5e_priv_static_destroy(struct mlx5e_priv *priv, const uint32_t channels) { + uint32_t x; + + for (x = 0; x != channels; x++) + mlx5e_chan_static_destroy(&priv->channel[x]); + callout_drain(&priv->watchdog); mtx_destroy(&priv->async_events_mtx); sx_destroy(&priv->state_lock); } @@ -3641,7 +3653,7 @@ mlx5e_disable_tx_dma(struct mlx5e_channel *ch) { int i; - for (i = 0; i < ch->num_tc; i++) + for (i = 0; i < ch->priv->num_tc; i++) mlx5e_drain_sq(&ch->sq[i]); } @@ -3693,7 +3705,7 @@ mlx5e_enable_tx_dma(struct mlx5e_channel *ch) { int i; - for (i = 0; i < ch->num_tc; i++) + for (i = 0; i < ch->priv->num_tc; i++) mlx5e_resume_sq(&ch->sq[i]); } @@ -3708,8 +3720,6 @@ mlx5e_disable_rx_dma(struct mlx5e_channel *ch) callout_stop(&rq->watchdog); mtx_unlock(&rq->mtx); - callout_drain(&rq->watchdog); - err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); if (err != 0) { mlx5_en_err(rq->ifp, @@ -4175,13 +4185,15 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) priv = malloc(sizeof(*priv) + (sizeof(priv->channel[0]) * mdev->priv.eq_table.num_comp_vectors), M_MLX5EN, M_WAITOK | M_ZERO); - mlx5e_priv_mtx_init(priv); ifp = priv->ifp = if_alloc_dev(IFT_ETHER, mdev->pdev->dev.bsddev); if (ifp == NULL) { mlx5_core_err(mdev, "if_alloc() failed\n"); goto err_free_priv; } + /* setup all static fields */ + mlx5e_priv_static_init(priv, mdev->priv.eq_table.num_comp_vectors); + ifp->if_softc = priv; if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev)); ifp->if_mtu = ETHERMTU; @@ -4417,10 +4429,10 @@ err_free_sysctl: sysctl_ctx_free(&priv->sysctl_ctx); if (priv->sysctl_debug) sysctl_ctx_free(&priv->stats.port_stats_debug.ctx); + mlx5e_priv_static_destroy(priv, mdev->priv.eq_table.num_comp_vectors); if_free(ifp); err_free_priv: - mlx5e_priv_mtx_destroy(priv); free(priv, M_MLX5EN); return (NULL); } @@ -4480,7 +4492,6 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp /* unregister device */ ifmedia_removeall(&priv->media); ether_ifdetach(ifp); - if_free(ifp); #ifdef RATELIMIT mlx5e_rl_cleanup(priv); @@ -4498,7 +4509,8 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar); mlx5e_disable_async_events(priv); flush_workqueue(priv->wq); - mlx5e_priv_mtx_destroy(priv); + mlx5e_priv_static_destroy(priv, mdev->priv.eq_table.num_comp_vectors); + if_free(ifp); free(priv, M_MLX5EN); } From owner-svn-src-all@freebsd.org Wed Oct 2 10:46:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09FFB12AF59; Wed, 2 Oct 2019 10:46:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jt9t6Tzjz4Dh6; Wed, 2 Oct 2019 10:46:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43FC2A52A; Wed, 2 Oct 2019 10:46:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AkwJR053114; Wed, 2 Oct 2019 10:46:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92Akw45053111; Wed, 2 Oct 2019 10:46:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021046.x92Akw45053111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352990 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:46:59 -0000 Author: hselasky Date: Wed Oct 2 10:46:57 2019 New Revision: 352990 URL: https://svnweb.freebsd.org/changeset/base/352990 Log: Fix regression issue about bad refcounting of unlimited send tags in mlx5en(4) after r348254. The unlimited send tags are shared amount multiple connections and are not allocated per send tag allocation request. Only increment the refcount. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:43:49 2019 (r352989) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 10:46:57 2019 (r352990) @@ -873,6 +873,7 @@ struct mlx5e_channel { struct mlx5e_snd_tag tag; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; struct mlx5e_priv *priv; + struct completion completion; int ix; } __aligned(MLX5E_CACHELINE_SIZE); @@ -998,7 +999,6 @@ struct mlx5e_priv { u32 pdn; u32 tdn; struct mlx5_core_mr mr; - volatile unsigned int channel_refs; u32 tisn[MLX5E_MAX_TX_NUM_TC]; u32 rqtn; @@ -1142,24 +1142,6 @@ mlx5e_cq_arm(struct mlx5e_cq *cq, spinlock_t *dblock) mcq = &cq->mcq; mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, dblock, cq->wq.cc); -} - -static inline void -mlx5e_ref_channel(struct mlx5e_priv *priv) -{ - - KASSERT(priv->channel_refs < INT_MAX, - ("Channel refs will overflow")); - atomic_fetchadd_int(&priv->channel_refs, 1); -} - -static inline void -mlx5e_unref_channel(struct mlx5e_priv *priv) -{ - - KASSERT(priv->channel_refs > 0, - ("Channel refs is not greater than zero")); - atomic_fetchadd_int(&priv->channel_refs, -1); } #define mlx5e_dbg(_IGN, _priv, ...) mlx5_core_dbg((_priv)->mdev, __VA_ARGS__) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:43:49 2019 (r352989) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 10:46:57 2019 (r352990) @@ -2119,6 +2119,8 @@ mlx5e_chan_static_init(struct mlx5e_priv *priv, struct c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; m_snd_tag_init(&c->tag.m_snd_tag, c->priv->ifp); + init_completion(&c->completion); + mtx_init(&c->rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&c->rq.watchdog, &c->rq.mtx, 0); @@ -2136,13 +2138,27 @@ mlx5e_chan_static_init(struct mlx5e_priv *priv, struct } static void -mlx5e_chan_static_destroy(struct mlx5e_channel *c) +mlx5e_chan_wait_for_completion(struct mlx5e_channel *c) { - int tc; - /* drop our reference */ m_snd_tag_rele(&c->tag.m_snd_tag); + wait_for_completion(&c->completion); +} +static void +mlx5e_priv_wait_for_completion(struct mlx5e_priv *priv, const uint32_t channels) +{ + uint32_t x; + + for (x = 0; x != channels; x++) + mlx5e_chan_wait_for_completion(&priv->channel[x]); +} + +static void +mlx5e_chan_static_destroy(struct mlx5e_channel *c) +{ + int tc; + callout_drain(&c->rq.watchdog); mtx_destroy(&c->rq.mtx); @@ -4010,9 +4026,7 @@ mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, /* check if send queue is not running */ if (unlikely(pch->sq[0].running == 0)) return (ENXIO); - mlx5e_ref_channel(priv); - MPASS(pch->tag.m_snd_tag.refcount == 0); - m_snd_tag_init(&pch->tag.m_snd_tag, ifp); + m_snd_tag_ref(&pch->tag.m_snd_tag); *ppmt = &pch->tag.m_snd_tag; return (0); } @@ -4035,7 +4049,7 @@ mlx5e_ul_snd_tag_free(struct m_snd_tag *pmt) struct mlx5e_channel *pch = container_of(pmt, struct mlx5e_channel, tag.m_snd_tag); - mlx5e_unref_channel(pch->priv); + complete(&pch->completion); } static int @@ -4461,6 +4475,9 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp pause("W", hz); } #endif + /* wait for all unlimited send tags to complete */ + mlx5e_priv_wait_for_completion(priv, mdev->priv.eq_table.num_comp_vectors); + /* stop watchdog timer */ callout_drain(&priv->watchdog); @@ -4475,13 +4492,6 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp PRIV_LOCK(priv); mlx5e_close_locked(ifp); PRIV_UNLOCK(priv); - - /* wait for all unlimited send tags to go away */ - while (priv->channel_refs != 0) { - mlx5_en_err(priv->ifp, - "Waiting for all unlimited connections to terminate\n"); - pause("W", hz); - } /* deregister pfil */ if (priv->pfil != NULL) { Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 2 10:43:49 2019 (r352989) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed Oct 2 10:46:57 2019 (r352990) @@ -97,9 +97,7 @@ mlx5e_select_queue_by_send_tag(struct ifnet *ifp, stru case IF_SND_TAG_TYPE_UNLIMITED: sq = &container_of(ptag, struct mlx5e_channel, tag)->sq[0]; - KASSERT(({ - struct mlx5e_priv *priv = ifp->if_softc; - priv->channel_refs > 0; }), + KASSERT((ptag->m_snd_tag.refcount > 0), ("mlx5e_select_queue: Channel refs are zero for unlimited tag")); break; default: From owner-svn-src-all@freebsd.org Wed Oct 2 10:53:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDB1D12B20D; Wed, 2 Oct 2019 10:53:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtKP4cWGz4FBY; Wed, 2 Oct 2019 10:53:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81B3A2A6E5; Wed, 2 Oct 2019 10:53:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92ArTRk058953; Wed, 2 Oct 2019 10:53:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92ArT3b058950; Wed, 2 Oct 2019 10:53:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021053.x92ArT3b058950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352991 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 352991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:53:29 -0000 Author: hselasky Date: Wed Oct 2 10:53:28 2019 New Revision: 352991 URL: https://svnweb.freebsd.org/changeset/base/352991 Log: Wait for FW readiness before initializing command interface in mlx5core. Before attempting to initialize the command interface we must wait till the fw_initializing bit is clear. If we fail to meet this condition the hardware will drop our configuration, specifically the descriptors page address. This scenario can happen when the firmware is still executing an FLR flow and did not finish yet so the driver needs to wait for that to finish. Linux commits: 6c780a0267b8 b8a92577f4be. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed Oct 2 10:46:57 2019 (r352990) +++ head/sys/dev/mlx5/device.h Wed Oct 2 10:53:28 2019 (r352991) @@ -32,8 +32,10 @@ #include #include -#define FW_INIT_TIMEOUT_MILI 2000 -#define FW_INIT_WAIT_MS 2 +#define FW_INIT_TIMEOUT_MILI 2000 +#define FW_INIT_WAIT_MS 2 +#define FW_PRE_INIT_TIMEOUT_MILI 120000 +#define FW_INIT_WARN_MESSAGE_INTERVAL 20000 #if defined(__LITTLE_ENDIAN) #define MLX5_SET_HOST_ENDIANNESS 0 Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 10:46:57 2019 (r352990) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 10:53:28 2019 (r352991) @@ -676,19 +676,33 @@ static inline int fw_initializing(struct mlx5_core_dev return ioread32be(&dev->iseg->initializing) >> 31; } -static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili) +static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili, + u32 warn_time_mili) { - u64 end = jiffies + msecs_to_jiffies(max_wait_mili); + int warn = jiffies + msecs_to_jiffies(warn_time_mili); + int end = jiffies + msecs_to_jiffies(max_wait_mili); int err = 0; - while (fw_initializing(dev)) { + MPASS(max_wait_mili > warn_time_mili); + + while (fw_initializing(dev) == 1) { if (time_after(jiffies, end)) { err = -EBUSY; break; } + if (warn_time_mili && time_after(jiffies, warn)) { + mlx5_core_warn(dev, + "Waiting for FW initialization, timeout abort in %lu s\n", + jiffies_to_msecs(end - warn) / 1000); + warn = jiffies + msecs_to_jiffies(warn_time_mili); + } msleep(FW_INIT_WAIT_MS); } + if (err != 0) + mlx5_core_dbg(dev, "Full initializing bit dword = 0x%x\n", + ioread32be(&dev->iseg->initializing)); + return err; } @@ -994,15 +1008,29 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st */ dev->state = MLX5_DEVICE_STATE_UP; + /* wait for firmware to accept initialization segments configurations + */ + err = wait_fw_init(dev, FW_PRE_INIT_TIMEOUT_MILI, + FW_INIT_WARN_MESSAGE_INTERVAL); + if (err) { + dev_err(&dev->pdev->dev, + "Firmware over %d MS in pre-initializing state, aborting\n", + FW_PRE_INIT_TIMEOUT_MILI); + goto out_err; + } + err = mlx5_cmd_init(dev); if (err) { - mlx5_core_err(dev, "Failed initializing command interface, aborting\n"); + mlx5_core_err(dev, + "Failed initializing command interface, aborting\n"); goto out_err; } - err = wait_fw_init(dev, FW_INIT_TIMEOUT_MILI); + err = wait_fw_init(dev, FW_INIT_TIMEOUT_MILI, 0); if (err) { - mlx5_core_err(dev, "Firmware over %d MS in initializing state, aborting\n", FW_INIT_TIMEOUT_MILI); + mlx5_core_err(dev, + "Firmware over %d MS in initializing state, aborting\n", + FW_INIT_TIMEOUT_MILI); goto err_cmd_cleanup; } From owner-svn-src-all@freebsd.org Wed Oct 2 10:58:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58EA112B2E1; Wed, 2 Oct 2019 10:58:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtR81XDBz4FLS; Wed, 2 Oct 2019 10:58:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18B572A6E7; Wed, 2 Oct 2019 10:58:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AwRF9059286; Wed, 2 Oct 2019 10:58:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AwRdv059285; Wed, 2 Oct 2019 10:58:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021058.x92AwRdv059285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352992 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 352992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:58:28 -0000 Author: hselasky Date: Wed Oct 2 10:58:27 2019 New Revision: 352992 URL: https://svnweb.freebsd.org/changeset/base/352992 Log: Use size_t for byte_to_write variable when comparing to eeprom_info_out_len which is also size_t in mlx5tool(8). Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed Oct 2 10:53:28 2019 (r352991) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed Oct 2 10:58:27 2019 (r352992) @@ -206,7 +206,8 @@ mlx5tool_fw_reset(int ctldev, const struct mlx5_tool_a static void mlx5tool_eeprom_print(struct mlx5_eeprom_get *eeprom_info) { - unsigned int byte_to_write, index_in_row, line_length, row; + int index_in_row, line_length, row; + size_t byte_to_write; byte_to_write = 0; line_length = 16; @@ -214,7 +215,7 @@ mlx5tool_eeprom_print(struct mlx5_eeprom_get *eeprom_i printf("\nOffset\t\tValues\n"); printf("------\t\t------"); while (byte_to_write < eeprom_info->eeprom_info_out_len) { - printf("\n0x%04X\t\t", byte_to_write); + printf("\n0x%04zX\t\t", byte_to_write); for (index_in_row = 0; index_in_row < line_length; index_in_row++) { printf("%02X ", From owner-svn-src-all@freebsd.org Wed Oct 2 10:59:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA34512B37E; Wed, 2 Oct 2019 10:59:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtSc4t16z4FTR; Wed, 2 Oct 2019 10:59:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A7442A6E8; Wed, 2 Oct 2019 10:59:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92AxiMw059395; Wed, 2 Oct 2019 10:59:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92AxiAf059394; Wed, 2 Oct 2019 10:59:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021059.x92AxiAf059394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 10:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352993 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 10:59:44 -0000 Author: hselasky Date: Wed Oct 2 10:59:44 2019 New Revision: 352993 URL: https://svnweb.freebsd.org/changeset/base/352993 Log: Randomize the delay when waiting for VSC flag in mlx5core. The PRM suggests random 0 - 10ms to prevent multiple waiters on the same interval in order to avoid starvation. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 10:58:27 2019 (r352992) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Wed Oct 2 10:59:44 2019 (r352993) @@ -52,7 +52,7 @@ int mlx5_vsc_lock(struct mlx5_core_dev *mdev) * The PRM suggests random 0 - 10ms to prevent multiple * waiters on the same interval in order to avoid starvation */ - DELAY((random() % 11) * 1000); + DELAY((random() % 9000) + 1000); continue; } @@ -99,7 +99,7 @@ mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 break; retries++; - DELAY(10); + DELAY((random() % 90) + 10); } return 0; From owner-svn-src-all@freebsd.org Wed Oct 2 11:01:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD17112B41B; Wed, 2 Oct 2019 11:01:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtV955RNz4FfL; Wed, 2 Oct 2019 11:01:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 924512A726; Wed, 2 Oct 2019 11:01:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92B15IN059578; Wed, 2 Oct 2019 11:01:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92B15KE059577; Wed, 2 Oct 2019 11:01:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021101.x92B15KE059577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 11:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352994 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:01:05 -0000 Author: hselasky Date: Wed Oct 2 11:01:05 2019 New Revision: 352994 URL: https://svnweb.freebsd.org/changeset/base/352994 Log: Improve mlx5_fwdump_prep logging in mlx5core. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 10:59:44 2019 (r352993) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed Oct 2 11:01:05 2019 (r352994) @@ -72,7 +72,8 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) if (error != 0) { /* Inability to create a firmware dump is not fatal. */ mlx5_core_warn(mdev, - "mlx5_fwdump_prep failed %d\n", error); + "Failed to find vendor-specific capability, error %d\n", + error); return; } error = mlx5_vsc_lock(mdev); @@ -86,7 +87,7 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) dev = mdev->pdev->dev.bsddev; vsc_addr = mdev->vsc_addr; if (vsc_addr == 0) { - mlx5_core_warn(mdev, "Cannot read vsc, no address\n"); + mlx5_core_warn(mdev, "Cannot read VSC, no address\n"); goto unlock_vsc; } @@ -97,7 +98,8 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) error = mlx5_vsc_wait_on_flag(mdev, 1); if (error != 0) { mlx5_core_warn(mdev, - "Failed waiting for read complete flag, error %d\n", error); + "Failed waiting for read complete flag, error %d addr %#x\n", + error, addr); goto unlock_vsc; } pci_read_config(dev, vsc_addr + MLX5_VSC_DATA_OFFSET, 4); @@ -120,7 +122,8 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) error = mlx5_vsc_wait_on_flag(mdev, 1); if (error != 0) { mlx5_core_warn(mdev, - "Failed waiting for read complete flag, error %d\n", error); + "Failed waiting for read complete flag, error %d addr %#x\n", + error, addr); free(mdev->dump_rege, M_MLX5_DUMP); mdev->dump_rege = NULL; goto unlock_vsc; From owner-svn-src-all@freebsd.org Wed Oct 2 11:02:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10D7F12B5CE; Wed, 2 Oct 2019 11:02:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtXH6g9bz4G05; Wed, 2 Oct 2019 11:02:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE1C72A8B8; Wed, 2 Oct 2019 11:02:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92B2t0n065114; Wed, 2 Oct 2019 11:02:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92B2tB9065110; Wed, 2 Oct 2019 11:02:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021102.x92B2tB9065110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 11:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352995 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:02:56 -0000 Author: hselasky Date: Wed Oct 2 11:02:54 2019 New Revision: 352995 URL: https://svnweb.freebsd.org/changeset/base/352995 Log: Only update lossy buffers config when manual PFC configuration was done in mlx5en(4). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 11:01:05 2019 (r352994) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Oct 2 11:02:54 2019 (r352995) @@ -1046,6 +1046,7 @@ struct mlx5e_priv { u_int clbr_gen; struct mlx5e_dcbx dcbx; + bool sw_is_port_buf_owner; struct pfil_head *pfil; struct mlx5e_channel channel[]; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 11:01:05 2019 (r352994) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 11:02:54 2019 (r352995) @@ -3903,7 +3903,7 @@ mlx5e_sysctl_rx_priority_flow_control(SYSCTL_HANDLER_A /* check if update is required */ if (rx_pfc != priv->params.rx_priority_flow_control) { err = -mlx5e_set_port_pfc(priv); - if (err == 0) + if (err == 0 && priv->sw_is_port_buf_owner) err = mlx5e_update_buf_lossy(priv); } done: Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Wed Oct 2 11:01:05 2019 (r352994) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Wed Oct 2 11:02:54 2019 (r352995) @@ -263,6 +263,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv if (err) return err; + priv->sw_is_port_buf_owner = true; err = update_buffer_lossy(mtu, pfc->pfc_en, buffer, xoff, &port_buffer, &update_buffer); if (err) @@ -316,13 +317,16 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv /* Apply the settings */ if (update_buffer) { + priv->sw_is_port_buf_owner = true; err = port_set_buffer(priv, &port_buffer); if (err) return err; } - if (update_prio2buffer) + if (update_prio2buffer) { + priv->sw_is_port_buf_owner = true; err = mlx5e_port_set_priority2buffer(priv->mdev, prio2buffer); + } return err; } From owner-svn-src-all@freebsd.org Wed Oct 2 11:05:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1083812B65D; Wed, 2 Oct 2019 11:05:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtZn6dMLz4G7V; Wed, 2 Oct 2019 11:05:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C882A8BB; Wed, 2 Oct 2019 11:05:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92B55MK065255; Wed, 2 Oct 2019 11:05:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92B55V5065254; Wed, 2 Oct 2019 11:05:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021105.x92B55V5065254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 11:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352996 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:05:06 -0000 Author: hselasky Date: Wed Oct 2 11:05:05 2019 New Revision: 352996 URL: https://svnweb.freebsd.org/changeset/base/352996 Log: Add print to show user a reason for rejecting buffer size change in mlx5en(4). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Wed Oct 2 11:02:54 2019 (r352995) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c Wed Oct 2 11:05:05 2019 (r352996) @@ -139,8 +139,8 @@ static u32 calculate_xoff(struct mlx5e_priv *priv, uns return xoff; } -static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, - u32 xoff) +static int update_xoff_threshold(struct mlx5e_priv *priv, + struct mlx5e_port_buffer *port_buffer, u32 xoff) { int i; @@ -152,8 +152,14 @@ static int update_xoff_threshold(struct mlx5e_port_buf } if (port_buffer->buffer[i].size < - (xoff + MLX5E_MAX_PORT_MTU + (1 << MLX5E_BUFFER_CELL_SHIFT))) + (xoff + MLX5E_MAX_PORT_MTU + (1 << MLX5E_BUFFER_CELL_SHIFT))) { + mlx5_en_info(priv->ifp, + "non-lossy buffer %d size %d less than xoff threshold %d\n", + i, port_buffer->buffer[i].size, + xoff + MLX5E_MAX_PORT_MTU + + (1 << MLX5E_BUFFER_CELL_SHIFT)); return -ENOMEM; + } port_buffer->buffer[i].xoff = port_buffer->buffer[i].size - xoff; port_buffer->buffer[i].xon = @@ -182,7 +188,7 @@ static int update_xoff_threshold(struct mlx5e_port_buf * Return 0 if no error. * Set change to true if buffer configuration is modified. */ -static int update_buffer_lossy(unsigned int mtu, +static int update_buffer_lossy(struct mlx5e_priv *priv, unsigned int mtu, u8 pfc_en, u8 *buffer, u32 xoff, struct mlx5e_port_buffer *port_buffer, bool *change) @@ -219,7 +225,7 @@ static int update_buffer_lossy(unsigned int mtu, } if (changed) { - err = update_xoff_threshold(port_buffer, xoff); + err = update_xoff_threshold(priv, port_buffer, xoff); if (err) return err; @@ -253,7 +259,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv if (change & MLX5E_PORT_BUFFER_CABLE_LEN) { update_buffer = true; - err = update_xoff_threshold(&port_buffer, xoff); + err = update_xoff_threshold(priv, &port_buffer, xoff); if (err) return err; } @@ -264,7 +270,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv return err; priv->sw_is_port_buf_owner = true; - err = update_buffer_lossy(mtu, pfc->pfc_en, buffer, xoff, + err = update_buffer_lossy(priv, mtu, pfc->pfc_en, buffer, xoff, &port_buffer, &update_buffer); if (err) return err; @@ -276,7 +282,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv if (err) return err; - err = update_buffer_lossy(mtu, curr_pfc_en, prio2buffer, xoff, + err = update_buffer_lossy(priv, mtu, curr_pfc_en, prio2buffer, xoff, &port_buffer, &update_buffer); if (err) return err; @@ -301,7 +307,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv return -EINVAL; update_buffer = true; - err = update_xoff_threshold(&port_buffer, xoff); + err = update_xoff_threshold(priv, &port_buffer, xoff); if (err) return err; } @@ -309,7 +315,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv /* Need to update buffer configuration if xoff value is changed */ if (!update_buffer && xoff != priv->dcbx.xoff) { update_buffer = true; - err = update_xoff_threshold(&port_buffer, xoff); + err = update_xoff_threshold(priv, &port_buffer, xoff); if (err) return err; } From owner-svn-src-all@freebsd.org Wed Oct 2 11:06:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5D7812B73D; Wed, 2 Oct 2019 11:06:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtbs5M33z4GJL; Wed, 2 Oct 2019 11:06:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BEA72A8BC; Wed, 2 Oct 2019 11:06:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92B61MZ065350; Wed, 2 Oct 2019 11:06:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92B61Vs065349; Wed, 2 Oct 2019 11:06:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021106.x92B61Vs065349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 11:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352997 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 352997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:06:01 -0000 Author: hselasky Date: Wed Oct 2 11:06:01 2019 New Revision: 352997 URL: https://svnweb.freebsd.org/changeset/base/352997 Log: Print numeric error_type and module_status in mlx5core in case the strings are not available. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 11:05:05 2019 (r352996) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Oct 2 11:06:01 2019 (r352997) @@ -698,16 +698,17 @@ static void mlx5_port_module_event(struct mlx5_core_de case MLX5_MODULE_STATUS_ERROR: mlx5_core_err(dev, - "Module %u, status: error, %s\n", + "Module %u, status: error, %s (%d)\n", module_num, - mlx5_port_module_event_error_type_to_string(error_type)); + mlx5_port_module_event_error_type_to_string(error_type), + error_type); if (error_type < MLX5_MODULE_EVENT_ERROR_NUM) dev->priv.pme_stats.error_counters[error_type]++; break; default: mlx5_core_info(dev, - "Module %u, unknown status\n", module_num); + "Module %u, unknown status %d\n", module_num, module_status); } /* store module status */ if (module_num < MLX5_MAX_PORTS) From owner-svn-src-all@freebsd.org Wed Oct 2 11:15:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A3B012BB2C; Wed, 2 Oct 2019 11:15:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jtpw0lx2z4Grj; Wed, 2 Oct 2019 11:15:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED1162AA7A; Wed, 2 Oct 2019 11:15:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92BFZcm071169; Wed, 2 Oct 2019 11:15:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92BFZwh071166; Wed, 2 Oct 2019 11:15:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021115.x92BFZwh071166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 11:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352998 - in head/sys/dev/mlx5: mlx5_core mlx5_en mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: mlx5_core mlx5_en mlx5_ib X-SVN-Commit-Revision: 352998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:15:36 -0000 Author: hselasky Date: Wed Oct 2 11:15:35 2019 New Revision: 352998 URL: https://svnweb.freebsd.org/changeset/base/352998 Log: Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 11:06:01 2019 (r352997) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed Oct 2 11:15:35 2019 (r352998) @@ -36,9 +36,9 @@ #define DRIVER_NAME "mlx5_core" #ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.5.1" +#define DRIVER_VERSION "3.5.2" #endif -#define DRIVER_RELDATE "April 2019" +#define DRIVER_RELDATE "September 2019" extern int mlx5_core_debug_mask; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 11:06:01 2019 (r352997) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Oct 2 11:15:35 2019 (r352998) @@ -32,9 +32,9 @@ #include #ifndef ETH_DRIVER_VERSION -#define ETH_DRIVER_VERSION "3.5.1" +#define ETH_DRIVER_VERSION "3.5.2" #endif -#define DRIVER_RELDATE "April 2019" +#define DRIVER_RELDATE "September 2019" static const char mlx5e_version[] = "mlx5en: Mellanox Ethernet driver " ETH_DRIVER_VERSION " (" DRIVER_RELDATE ")\n"; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Oct 2 11:06:01 2019 (r352997) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Oct 2 11:15:35 2019 (r352998) @@ -52,9 +52,9 @@ #define DRIVER_NAME "mlx5ib" #ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.5.1" +#define DRIVER_VERSION "3.5.2" #endif -#define DRIVER_RELDATE "April 2019" +#define DRIVER_RELDATE "September 2019" MODULE_DESCRIPTION("Mellanox Connect-IB HCA IB driver"); MODULE_LICENSE("Dual BSD/GPL"); From owner-svn-src-all@freebsd.org Wed Oct 2 11:40:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D64612C32B; Wed, 2 Oct 2019 11:40:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jvMs6cgdz4J6R; Wed, 2 Oct 2019 11:40:41 +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 AE74A2AE4B; Wed, 2 Oct 2019 11:40:41 +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 x92BefiN083267; Wed, 2 Oct 2019 11:40:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92BeeIl083263; Wed, 2 Oct 2019 11:40:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201910021140.x92BeeIl083263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 2 Oct 2019 11:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352999 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 352999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 11:40:42 -0000 Author: trasz Date: Wed Oct 2 11:40:40 2019 New Revision: 352999 URL: https://svnweb.freebsd.org/changeset/base/352999 Log: Rename etc/rc.d/abi to etc/rc.d/linux; after moving out the SysV IPC stuff it's entirely linux-specific. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21830 Added: head/libexec/rc/rc.d/linux - copied, changed from r352839, head/libexec/rc/rc.d/abi Deleted: head/libexec/rc/rc.d/abi Modified: head/libexec/rc/rc.d/Makefile head/libexec/rc/rc.d/SERVERS head/libexec/rc/rc.d/localpkg Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Wed Oct 2 11:15:35 2019 (r352998) +++ head/libexec/rc/rc.d/Makefile Wed Oct 2 11:40:40 2019 (r352999) @@ -11,7 +11,6 @@ CONFS= DAEMON \ LOGIN \ NETWORKING \ SERVERS \ - abi \ addswap \ adjkerntz \ archdep \ @@ -51,6 +50,7 @@ CONFS= DAEMON \ kldxref \ ${_kpasswdd} \ ldconfig \ + linux \ local \ localpkg \ lockd \ Modified: head/libexec/rc/rc.d/SERVERS ============================================================================== --- head/libexec/rc/rc.d/SERVERS Wed Oct 2 11:15:35 2019 (r352998) +++ head/libexec/rc/rc.d/SERVERS Wed Oct 2 11:40:40 2019 (r352999) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote sysvipc abi ldconfig savecore watchdogd +# REQUIRE: mountcritremote sysvipc linux ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Copied and modified: head/libexec/rc/rc.d/linux (from r352839, head/libexec/rc/rc.d/abi) ============================================================================== --- head/libexec/rc/rc.d/abi Sat Sep 28 09:50:01 2019 (r352839, copy source) +++ head/libexec/rc/rc.d/linux Wed Oct 2 11:40:40 2019 (r352999) @@ -3,14 +3,14 @@ # $FreeBSD$ # -# PROVIDE: abi +# PROVIDE: linux # REQUIRE: archdep # KEYWORD: nojail . /etc/rc.subr -name="abi" -desc="Enable foreign ABIs" +name="linux" +desc="Enable Linux ABI" start_cmd="${name}_start" stop_cmd=":" @@ -18,7 +18,6 @@ linux_start() { local _tmpdir - echo -n ' linux' load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in amd64) @@ -33,21 +32,6 @@ linux_start() fi rm -rf ${_tmpdir} fi -} - -abi_start() -{ - local _echostop - - _echostop= - if checkyesno linux_enable; then - echo -n 'Additional ABI support:' - _echostop=yes - fi - - checkyesno linux_enable && linux_start - - [ -n "${_echostop}" ] && echo '.' } load_rc_config $name Modified: head/libexec/rc/rc.d/localpkg ============================================================================== --- head/libexec/rc/rc.d/localpkg Wed Oct 2 11:15:35 2019 (r352998) +++ head/libexec/rc/rc.d/localpkg Wed Oct 2 11:40:40 2019 (r352999) @@ -4,7 +4,7 @@ # # PROVIDE: localpkg -# REQUIRE: sysvipc abi +# REQUIRE: sysvipc linux # BEFORE: securelevel # KEYWORD: shutdown From owner-svn-src-all@freebsd.org Wed Oct 2 12:00:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DB1212CB92; Wed, 2 Oct 2019 12:00:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jvpL0gkWz4Jpy; Wed, 2 Oct 2019 12:00:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DFD10A74B; Wed, 2 Oct 2019 12:00:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f173.google.com with SMTP id w14so25894313qto.9; Wed, 02 Oct 2019 05:00:09 -0700 (PDT) X-Gm-Message-State: APjAAAVMo+A/Eer5vtGDhFgEZLGRTYh0rsOQ30Rk1rLNZu47oI/rvg2A I92GGP3iQvF505EFuwpj+IYDNRUD55likVVipd4= X-Google-Smtp-Source: APXvYqxyWg9NWIxnjpqSVXCB7J9VSHRlkRhf/McVJxkzYZFvvlAzJQYSpL/llbtHeqw9WM5TzZUXz4Z5RgKKtzSKG0I= X-Received: by 2002:a0c:9276:: with SMTP id 51mr2484973qvz.35.1570017609280; Wed, 02 Oct 2019 05:00:09 -0700 (PDT) MIME-Version: 1.0 References: <201910020615.x926FUJj091147@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 2 Oct 2019 06:59:57 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352953 - in head/usr.bin: killall split To: Conrad Meyer Cc: Alexander Kabaev , src-committers , svn-src-all , svn-src-head , Kubilay Kocak Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 12:00:10 -0000 Sorry for the crap formatting, mobile. We can perhaps also fix this class with a proper modelling file. koobs was going to send out an email about it, but I haven't seen anything. On Wed, Oct 2, 2019, 02:03 Conrad Meyer wrote: > Hi Alexander, > > Coverity has millions of spurious warnings of this class and they're > basically all false positives. I think we should instead try to > figure out how to disable this class of warning on our codebase, since > it is largely incorrect. > > I would encourage reverting this change, because it uglies up the code > for no functional benefit. The code was correct before the change; > only Coverity was wrong. > > Best, > Conrad > > On Tue, Oct 1, 2019 at 11:15 PM Alexander Kabaev wrote: > > > > Author: kan > > Date: Wed Oct 2 06:15:30 2019 > > New Revision: 352953 > > URL: https://svnweb.freebsd.org/changeset/base/352953 > > > > Log: > > Convert pnmatch to single element array in regexec calls > > > > The regexec function is declared as taking an array of regmatch_t > > elements, and passing in the pointer to singleton element, while > > correct, triggers a Coverity warning. Convert the singleton into > > an array of one to silence the warning. > > > > Reported by: Coverity > > Coverity CID: 1009732, 1009733 > > MFC after: 2 weeks > > > > Modified: > > head/usr.bin/killall/killall.c > > head/usr.bin/split/split.c > > > > Modified: head/usr.bin/killall/killall.c > > > ============================================================================== > > --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 > (r352952) > > +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 > (r352953) > > @@ -98,7 +98,7 @@ main(int ac, char **av) > > struct stat sb; > > struct passwd *pw; > > regex_t rgx; > > - regmatch_t pmatch; > > + regmatch_t pmatch[1]; > > int i, j, ch; > > char buf[256]; > > char first; > > @@ -361,9 +361,9 @@ main(int ac, char **av) > > } > > } > > if (mflag) { > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = strlen(thiscmd); > > - if (regexec(&rgx, thiscmd, 0, &pmatch, > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = strlen(thiscmd); > > + if (regexec(&rgx, thiscmd, 0, pmatch, > > REG_STARTEND) != 0) > > matched = 0; > > regfree(&rgx); > > @@ -387,9 +387,9 @@ main(int ac, char **av) > > } > > } > > if (mflag) { > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = strlen(thiscmd); > > - if (regexec(&rgx, thiscmd, 0, &pmatch, > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = strlen(thiscmd); > > + if (regexec(&rgx, thiscmd, 0, pmatch, > > REG_STARTEND) == 0) > > matched = 1; > > regfree(&rgx); > > > > Modified: head/usr.bin/split/split.c > > > ============================================================================== > > --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) > > +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) > > @@ -281,11 +281,11 @@ split2(void) > > > > /* Check if we need to start a new file */ > > if (pflag) { > > - regmatch_t pmatch; > > + regmatch_t pmatch[1]; > > > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = len - 1; > > - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) > == 0) > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = len - 1; > > + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) > == 0) > > newfile(); > > } else if (lcnt++ == numlines) { > > newfile(); > From owner-svn-src-all@freebsd.org Wed Oct 2 12:02:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B857412D2F7; Wed, 2 Oct 2019 12:02:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jvrk4JCrz4KSt; Wed, 2 Oct 2019 12:02:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778FE2B352; Wed, 2 Oct 2019 12:02:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92C2Eln098050; Wed, 2 Oct 2019 12:02:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92C2Edw098049; Wed, 2 Oct 2019 12:02:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021202.x92C2Edw098049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 12:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353000 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 353000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 12:02:14 -0000 Author: hselasky Date: Wed Oct 2 12:02:14 2019 New Revision: 353000 URL: https://svnweb.freebsd.org/changeset/base/353000 Log: Fix build failure for 32-bit platforms after r352991, due to incorrect printf() formatter string. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 11:40:40 2019 (r352999) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 2 12:02:14 2019 (r353000) @@ -692,8 +692,8 @@ static int wait_fw_init(struct mlx5_core_dev *dev, u32 } if (warn_time_mili && time_after(jiffies, warn)) { mlx5_core_warn(dev, - "Waiting for FW initialization, timeout abort in %lu s\n", - jiffies_to_msecs(end - warn) / 1000); + "Waiting for FW initialization, timeout abort in %u s\n", + (unsigned int)(jiffies_to_msecs(end - warn) / 1000)); warn = jiffies + msecs_to_jiffies(warn_time_mili); } msleep(FW_INIT_WAIT_MS); From owner-svn-src-all@freebsd.org Wed Oct 2 12:45:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35D3A12E193; Wed, 2 Oct 2019 12:45:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jwpr0VqSz4MT8; Wed, 2 Oct 2019 12:45:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5BD02BA9B; Wed, 2 Oct 2019 12:45:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92CjdN4024614; Wed, 2 Oct 2019 12:45:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92CjdIh024613; Wed, 2 Oct 2019 12:45:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910021245.x92CjdIh024613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 12:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353001 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 353001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 12:45:40 -0000 Author: hselasky Date: Wed Oct 2 12:45:39 2019 New Revision: 353001 URL: https://svnweb.freebsd.org/changeset/base/353001 Log: Fix build failure for gcc after r352983, due to not using static variable declared by net/sff8472.h . MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 12:02:14 2019 (r353000) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Oct 2 12:45:39 2019 (r353001) @@ -27,7 +27,6 @@ #include "en.h" #include "port_buffer.h" -#include void mlx5e_create_stats(struct sysctl_ctx_list *ctx, From owner-svn-src-all@freebsd.org Wed Oct 2 12:46:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3ED1E12E24C; Wed, 2 Oct 2019 12:46: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jwqn0xLMz4Mhm; Wed, 2 Oct 2019 12:46: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 038132BA9E; Wed, 2 Oct 2019 12:46: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 x92CkSag024866; Wed, 2 Oct 2019 12:46:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92CkSkV024863; Wed, 2 Oct 2019 12:46:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021246.x92CkSkV024863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353002 - in head/usr.sbin: etcupdate mergemaster X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin: etcupdate mergemaster X-SVN-Commit-Revision: 353002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 12:46:29 -0000 Author: kevans Date: Wed Oct 2 12:46:28 2019 New Revision: 353002 URL: https://svnweb.freebsd.org/changeset/base/353002 Log: Unbreak etcupdate(8) and mergemaster(8) after r352950 r352950 introduced improper case fall-through for shell scripts. Fix it with a pipe. Reported by: lwhsu, David Wolfskill Modified: head/usr.sbin/etcupdate/etcupdate.sh head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Wed Oct 2 12:45:39 2019 (r353001) +++ head/usr.sbin/etcupdate/etcupdate.sh Wed Oct 2 12:46:28 2019 (r353002) @@ -595,8 +595,7 @@ post_install_file() NEWALIAS_WARN=yes fi ;; - /usr/share/certs/trusted/*) - /usr/share/certs/blacklisted/*) + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) log "certctl rehash" if [ -z "$dryrun" ]; then env DESTDIR=${DESTDIR} certctl rehash >&3 2>&1 Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed Oct 2 12:45:39 2019 (r353001) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Oct 2 12:46:28 2019 (r353002) @@ -883,8 +883,7 @@ mm_install () { /etc/mail/aliases) NEED_NEWALIASES=yes ;; - /usr/share/certs/trusted/*) - /usr/share/certs/blacklisted/*) + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) NEED_CERTCTL=yes ;; /etc/login.conf) From owner-svn-src-all@freebsd.org Wed Oct 2 12:55:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28E5C12E4E6; Wed, 2 Oct 2019 12:55:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jx2k0Dlcz4N8G; Wed, 2 Oct 2019 12:55:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D4681AE0E; Wed, 2 Oct 2019 12:55:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id q203so14859622qke.1; Wed, 02 Oct 2019 05:55:57 -0700 (PDT) X-Gm-Message-State: APjAAAU0KHlg1PrGmJqqudRMoWYl7Tg/8xy1c70yheC+OwGrZTFJ+8fm /FpGvh4HRgC6Da3Ha/Ho8VxGqE+mIpByr5OtE98= X-Google-Smtp-Source: APXvYqwqBKamfKaKnkDO/pkDoi7gCmhVX5qCbt8icrVC8gBsUHqD/3S9AYVy/gh1a9PkU2bOwRBHc2qzsmIG2HogkJU= X-Received: by 2002:ae9:e88a:: with SMTP id a132mr3656603qkg.120.1570020957436; Wed, 02 Oct 2019 05:55:57 -0700 (PDT) MIME-Version: 1.0 References: <201809141341.w8EDfbtO070815@repo.freebsd.org> In-Reply-To: <201809141341.w8EDfbtO070815@repo.freebsd.org> From: Kyle Evans Date: Wed, 2 Oct 2019 07:55:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338679 - head/lib/libusb To: Hans Petter Selasky Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 12:55:58 -0000 On Fri, Sep 14, 2018 at 8:41 AM Hans Petter Selasky wrote: > > Author: hselasky > Date: Fri Sep 14 13:41:37 2018 > New Revision: 338679 > URL: https://svnweb.freebsd.org/changeset/base/338679 > > Log: > Improve LibUSB debugging by simultaneously allowing both function > and transfer prints. Make sure the debug level comes from the > correct USB context. > > Found by: Ludovic Rousseau > PR: 231264 > MFC after: 1 week > Approved by: re (kib) > Sponsored by: Mellanox Technologies > > Modified: > head/lib/libusb/libusb10.h > head/lib/libusb/libusb10_io.c > > Modified: head/lib/libusb/libusb10.h > ============================================================================== > --- head/lib/libusb/libusb10.h Fri Sep 14 01:52:34 2018 (r338678) > +++ head/lib/libusb/libusb10.h Fri Sep 14 13:41:37 2018 (r338679) > @@ -41,22 +41,24 @@ > #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) > #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) > > -#define DPRINTF(ctx, dbg, format, args...) do { \ > - if ((ctx)->debug == dbg) { \ > - switch (dbg) { \ > - case LIBUSB_DEBUG_FUNCTION: \ > - printf("LIBUSB_FUNCTION: " \ > - format "\n", ## args); \ > - break; \ > - case LIBUSB_DEBUG_TRANSFER: \ > - printf("LIBUSB_TRANSFER: " \ > - format "\n", ## args); \ > - break; \ > - default: \ > - break; \ > - } \ > - } \ > -} while(0) > +#define DPRINTF(ctx, dbg, format, ...) do { \ > + switch (dbg) { \ > + case LIBUSB_DEBUG_FUNCTION: \ > + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ > + printf("LIBUSB_FUNCTION: " \ > + format "\n", ## __VA_ARGS__); \ > + } \ > + break; \ > + case LIBUSB_DEBUG_TRANSFER: \ > + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ > + printf("LIBUSB_TRANSFER: " \ > + format "\n", ## __VA_ARGS__); \ > + } \ > + break; \ > + default: \ > + break; \ > + } \ > +} while (0) > > /* internal structures */ > Hi, How are people/users of libusb supposed to disable these messages after this? The only thing stopping them was the debug level in the context, I guess, because DPRINTF is always compiled to this and the users of DPRINTF are just invoking it all willy-nilly. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Oct 2 12:59:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63A0012E58D for ; Wed, 2 Oct 2019 12:59:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jx6P25vrz4NHv for ; Wed, 2 Oct 2019 12:59:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1BAA8AE11 for ; Wed, 2 Oct 2019 12:59:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id l3so26175621qtr.4 for ; Wed, 02 Oct 2019 05:59:09 -0700 (PDT) X-Gm-Message-State: APjAAAVXz11NxC4fKr+izeu2e0hDLRLV48zlplHm8pYWWWGZI4Nytj2H ycVfnnUQ1cxspkPtlDW+mmaUw7y29kExynH8Yjg= X-Received: by 2002:a0c:e20c:: with SMTP id q12mt2499416qvl.214.1570021148476; Wed, 02 Oct 2019 05:59:08 -0700 (PDT) MIME-Version: 1.0 References: <201809141341.w8EDfbtO070815@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 2 Oct 2019 07:58:57 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338679 - head/lib/libusb Cc: Hans Petter Selasky , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 12:59:09 -0000 On Wed, Oct 2, 2019 at 7:55 AM Kyle Evans wrote: > > On Fri, Sep 14, 2018 at 8:41 AM Hans Petter Selasky > wrote: > > > > Author: hselasky > > Date: Fri Sep 14 13:41:37 2018 > > New Revision: 338679 > > URL: https://svnweb.freebsd.org/changeset/base/338679 > > > > Log: > > Improve LibUSB debugging by simultaneously allowing both function > > and transfer prints. Make sure the debug level comes from the > > correct USB context. > > > > Found by: Ludovic Rousseau > > PR: 231264 > > MFC after: 1 week > > Approved by: re (kib) > > Sponsored by: Mellanox Technologies > > > > Modified: > > head/lib/libusb/libusb10.h > > head/lib/libusb/libusb10_io.c > > > > Modified: head/lib/libusb/libusb10.h > > ============================================================================== > > --- head/lib/libusb/libusb10.h Fri Sep 14 01:52:34 2018 (r338678) > > +++ head/lib/libusb/libusb10.h Fri Sep 14 13:41:37 2018 (r338679) > > @@ -41,22 +41,24 @@ > > #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) > > #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) > > > > -#define DPRINTF(ctx, dbg, format, args...) do { \ > > - if ((ctx)->debug == dbg) { \ > > - switch (dbg) { \ > > - case LIBUSB_DEBUG_FUNCTION: \ > > - printf("LIBUSB_FUNCTION: " \ > > - format "\n", ## args); \ > > - break; \ > > - case LIBUSB_DEBUG_TRANSFER: \ > > - printf("LIBUSB_TRANSFER: " \ > > - format "\n", ## args); \ > > - break; \ > > - default: \ > > - break; \ > > - } \ > > - } \ > > -} while(0) > > +#define DPRINTF(ctx, dbg, format, ...) do { \ > > + switch (dbg) { \ > > + case LIBUSB_DEBUG_FUNCTION: \ > > + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ > > + printf("LIBUSB_FUNCTION: " \ > > + format "\n", ## __VA_ARGS__); \ > > + } \ > > + break; \ > > + case LIBUSB_DEBUG_TRANSFER: \ > > + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ > > + printf("LIBUSB_TRANSFER: " \ > > + format "\n", ## __VA_ARGS__); \ > > + } \ > > + break; \ > > + default: \ > > + break; \ > > + } \ > > +} while (0) > > > > /* internal structures */ > > > > Hi, > > How are people/users of libusb supposed to disable these messages > after this? The only thing stopping them was the debug level in the > context, I guess, because DPRINTF is always compiled to this and the > users of DPRINTF are just invoking it all willy-nilly. > Sorry, I missed that the (ctx)->debug checks just moved a little further in... debugging a little better, because LIBUSB_DEBUG=0 doesn't seem to do the trick for this person. From owner-svn-src-all@freebsd.org Wed Oct 2 12:59:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8EAD12E5E5; Wed, 2 Oct 2019 12:59:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jx6d4PXjz4NR7; Wed, 2 Oct 2019 12:59:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 765C4260341; Wed, 2 Oct 2019 14:59:06 +0200 (CEST) Subject: Re: svn commit: r338679 - head/lib/libusb To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <201809141341.w8EDfbtO070815@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <176b6c74-947c-0e0e-6568-effcfac9cd8f@selasky.org> Date: Wed, 2 Oct 2019 14:58:17 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jx6d4PXjz4NR7 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 12:59:21 -0000 On 2019-10-02 14:55, Kyle Evans wrote: > On Fri, Sep 14, 2018 at 8:41 AM Hans Petter Selasky > wrote: >> >> Author: hselasky >> Date: Fri Sep 14 13:41:37 2018 >> New Revision: 338679 >> URL: https://svnweb.freebsd.org/changeset/base/338679 >> >> Log: >> Improve LibUSB debugging by simultaneously allowing both function >> and transfer prints. Make sure the debug level comes from the >> correct USB context. >> >> Found by: Ludovic Rousseau >> PR: 231264 >> MFC after: 1 week >> Approved by: re (kib) >> Sponsored by: Mellanox Technologies >> >> Modified: >> head/lib/libusb/libusb10.h >> head/lib/libusb/libusb10_io.c >> >> Modified: head/lib/libusb/libusb10.h >> ============================================================================== >> --- head/lib/libusb/libusb10.h Fri Sep 14 01:52:34 2018 (r338678) >> +++ head/lib/libusb/libusb10.h Fri Sep 14 13:41:37 2018 (r338679) >> @@ -41,22 +41,24 @@ >> #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) >> #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) >> >> -#define DPRINTF(ctx, dbg, format, args...) do { \ >> - if ((ctx)->debug == dbg) { \ >> - switch (dbg) { \ >> - case LIBUSB_DEBUG_FUNCTION: \ >> - printf("LIBUSB_FUNCTION: " \ >> - format "\n", ## args); \ >> - break; \ >> - case LIBUSB_DEBUG_TRANSFER: \ >> - printf("LIBUSB_TRANSFER: " \ >> - format "\n", ## args); \ >> - break; \ >> - default: \ >> - break; \ >> - } \ >> - } \ >> -} while(0) >> +#define DPRINTF(ctx, dbg, format, ...) do { \ >> + switch (dbg) { \ >> + case LIBUSB_DEBUG_FUNCTION: \ >> + if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ >> + printf("LIBUSB_FUNCTION: " \ >> + format "\n", ## __VA_ARGS__); \ >> + } \ >> + break; \ >> + case LIBUSB_DEBUG_TRANSFER: \ >> + if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ >> + printf("LIBUSB_TRANSFER: " \ >> + format "\n", ## __VA_ARGS__); \ >> + } \ >> + break; \ >> + default: \ >> + break; \ >> + } \ >> +} while (0) >> >> /* internal structures */ >> > > Hi, > > How are people/users of libusb supposed to disable these messages > after this? The only thing stopping them was the debug level in the > context, I guess, because DPRINTF is always compiled to this and the > users of DPRINTF are just invoking it all willy-nilly. > Feel free to submit a patch. Maybe you need to make a new option for user-space like WITH_USB_DEBUG .... --HPS From owner-svn-src-all@freebsd.org Wed Oct 2 13:02:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B23A12E8E8; Wed, 2 Oct 2019 13:02:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jx9n0Q8Mz4Ns8; Wed, 2 Oct 2019 13:02:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 06AD3260341; Wed, 2 Oct 2019 15:02:02 +0200 (CEST) Subject: Re: svn commit: r338679 - head/lib/libusb To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <201809141341.w8EDfbtO070815@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <68a9bd0d-c773-8ce2-08f5-4c96ef5a1d68@selasky.org> Date: Wed, 2 Oct 2019 15:01:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jx9n0Q8Mz4Ns8 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 13:02:05 -0000 On 2019-10-02 14:58, Kyle Evans wrote: > Sorry, I missed that the (ctx)->debug checks just moved a little > further in... debugging a little better, because LIBUSB_DEBUG=0 > doesn't seem to do the trick for this person. I believe the prints are off by default, unless you call libusb_set_debug() in your application. If you want them compile-time removed, you'll need to do something. --HPS From owner-svn-src-all@freebsd.org Wed Oct 2 13:25:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E295C12ED5B; Wed, 2 Oct 2019 13:25:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jxhm5QBMz4Pq4; Wed, 2 Oct 2019 13:25:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3AD2C1D6; Wed, 2 Oct 2019 13:25:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92DPSDF048545; Wed, 2 Oct 2019 13:25:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92DPS6t048544; Wed, 2 Oct 2019 13:25:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910021325.x92DPS6t048544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 2 Oct 2019 13:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353003 - releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: releng X-SVN-Commit-Author: avg X-SVN-Commit-Paths: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 353003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 13:25:28 -0000 Author: avg Date: Wed Oct 2 13:25:28 2019 New Revision: 353003 URL: https://svnweb.freebsd.org/changeset/base/353003 Log: MFS12 r352721: print summary line for space estimate of zfs send from bookmark This should have been merged as a part of r352901 but I missed it. Approved by: re (gjb) Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Oct 2 12:46:28 2019 (r353002) +++ releng/12.1/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Oct 2 13:25:28 2019 (r353003) @@ -2054,6 +2054,15 @@ zfs_send_one(zfs_handle_t *zhp, const char *from, int if (err == 0) { send_print_verbose(fout, zhp->zfs_name, from, size, flags.parsable); + if (flags.parsable) { + (void) fprintf(fout, "size\t%llu\n", + (longlong_t)size); + } else { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } } else { (void) fprintf(stderr, "Cannot estimate send size: " "%s\n", strerror(errno)); From owner-svn-src-all@freebsd.org Wed Oct 2 13:30:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B718E12EF7D; Wed, 2 Oct 2019 13:30:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jxpK4V8sz4Q8y; Wed, 2 Oct 2019 13:30:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DA2A2C1E3; Wed, 2 Oct 2019 13:30:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92DUHPT049008; Wed, 2 Oct 2019 13:30:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92DUHWu049007; Wed, 2 Oct 2019 13:30:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910021330.x92DUHWu049007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Oct 2019 13:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353004 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 13:30:17 -0000 Author: gjb Date: Wed Oct 2 13:30:17 2019 New Revision: 353004 URL: https://svnweb.freebsd.org/changeset/base/353004 Log: Explicitly add opensolaris_load="YES" to loader.conf through the installer when installing the system on a ZFS root filesystem. For arm64, zfs_load="YES" does not add opensolaris.ko as a kld dependency, so add it explicitly to prevent boot-time failures out-of-box. PR: 240478 MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 13:25:28 2019 (r353003) +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 13:30:17 2019 (r353004) @@ -44,6 +44,7 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot From owner-svn-src-all@freebsd.org Wed Oct 2 13:36:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D89212F4A5; Wed, 2 Oct 2019 13:36:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jxxy6hrTz4QsW; Wed, 2 Oct 2019 13:36:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA7042C3C7; Wed, 2 Oct 2019 13:36:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92DasWu054477; Wed, 2 Oct 2019 13:36:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92DasXj054476; Wed, 2 Oct 2019 13:36:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910021336.x92DasXj054476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 2 Oct 2019 13:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353005 - releng/12.1/sys/dev/vt X-SVN-Group: releng X-SVN-Commit-Author: avg X-SVN-Commit-Paths: releng/12.1/sys/dev/vt X-SVN-Commit-Revision: 353005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 13:36:55 -0000 Author: avg Date: Wed Oct 2 13:36:54 2019 New Revision: 353005 URL: https://svnweb.freebsd.org/changeset/base/353005 Log: MFS12 r352896: vt: fix problems with trying to switch to a closed VT Approved by: re (gjb) Modified: releng/12.1/sys/dev/vt/vt_core.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/vt/vt_core.c ============================================================================== --- releng/12.1/sys/dev/vt/vt_core.c Wed Oct 2 13:30:17 2019 (r353004) +++ releng/12.1/sys/dev/vt/vt_core.c Wed Oct 2 13:36:54 2019 (r353005) @@ -335,7 +335,7 @@ static void vt_switch_timer(void *arg) { - vt_late_window_switch((struct vt_window *)arg); + (void)vt_late_window_switch((struct vt_window *)arg); } static int @@ -457,13 +457,22 @@ vt_window_postswitch(struct vt_window *vw) static int vt_late_window_switch(struct vt_window *vw) { + struct vt_window *curvw; int ret; callout_stop(&vw->vw_proc_dead_timer); ret = vt_window_switch(vw); - if (ret) + if (ret != 0) { + /* + * If the switch hasn't happened, then return the VT + * to the current owner, if any. + */ + curvw = vw->vw_device->vd_curwindow; + if (curvw->vw_smode.mode == VT_PROCESS) + (void)vt_window_postswitch(curvw); return (ret); + } /* Notify owner process about terminal availability. */ if (vw->vw_smode.mode == VT_PROCESS) { @@ -509,6 +518,19 @@ vt_proc_window_switch(struct vt_window *vw) return (0); /* success */ } + /* + * Early check for an attempt to switch to a non-functional VT. + * The same check is done in vt_window_switch(), but it's better + * to fail as early as possible to avoid needless pre-switch + * actions. + */ + VT_LOCK(vd); + if ((vw->vw_flags & (VWF_OPENED|VWF_CONSOLE)) == 0) { + VT_UNLOCK(vd); + return (EINVAL); + } + VT_UNLOCK(vd); + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -1792,7 +1814,7 @@ finish_vt_rel(struct vt_window *vw, int release, int * vw->vw_flags &= ~VWF_SWWAIT_REL; if (release) { callout_drain(&vw->vw_proc_dead_timer); - vt_late_window_switch(vw->vw_switch_to); + (void)vt_late_window_switch(vw->vw_switch_to); } return (0); } From owner-svn-src-all@freebsd.org Wed Oct 2 13:43:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B977212F7F5; Wed, 2 Oct 2019 13:43:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jy5S4Cb5z4RLg; Wed, 2 Oct 2019 13:43:24 +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 750692C591; Wed, 2 Oct 2019 13:43:24 +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 x92DhOUr060320; Wed, 2 Oct 2019 13:43:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92DhODD060319; Wed, 2 Oct 2019 13:43:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910021343.x92DhODD060319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Oct 2019 13:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353006 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 353006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 13:43:24 -0000 Author: kib Date: Wed Oct 2 13:43:24 2019 New Revision: 353006 URL: https://svnweb.freebsd.org/changeset/base/353006 Log: MFC r352684: x86: Fall back to leaf 0x16 if TSC frequency is obtained by CPUID and leaf 0x15 is not functional. Modified: stable/12/sys/x86/x86/tsc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/tsc.c ============================================================================== --- stable/12/sys/x86/x86/tsc.c Wed Oct 2 13:36:54 2019 (r353005) +++ stable/12/sys/x86/x86/tsc.c Wed Oct 2 13:43:24 2019 (r353006) @@ -133,7 +133,11 @@ tsc_freq_vmware(void) /* * Calculate TSC frequency using information from the CPUID leaf 0x15 - * 'Time Stamp Counter and Nominal Core Crystal Clock'. It should be + * 'Time Stamp Counter and Nominal Core Crystal Clock'. If leaf 0x15 + * is not functional, as it is on Skylake/Kabylake, try 0x16 'Processor + * Frequency Information'. Leaf 0x16 is described in the SDM as + * informational only, but if 0x15 did not work, and TSC calibration + * is disabled, it is the best we can get at all. It should still be * an improvement over the parsing of the CPU model name in * tsc_freq_intel(), when available. */ @@ -145,10 +149,20 @@ tsc_freq_cpuid(void) if (cpu_high < 0x15) return (false); do_cpuid(0x15, regs); - if (regs[0] == 0 || regs[1] == 0 || regs[2] == 0) + if (regs[0] != 0 && regs[1] != 0 && regs[2] != 0) { + tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; + return (true); + } + + if (cpu_high < 0x16) return (false); - tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; - return (true); + do_cpuid(0x16, regs); + if (regs[0] != 0) { + tsc_freq = (uint64_t)regs[0] * 1000000; + return (true); + } + + return (false); } static void From owner-svn-src-all@freebsd.org Wed Oct 2 13:46:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FBCB12F8C8; Wed, 2 Oct 2019 13:46:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jy9F1pp4z4RWX; Wed, 2 Oct 2019 13:46:41 +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 1CFBF2C596; Wed, 2 Oct 2019 13:46:41 +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 x92Dke3B060564; Wed, 2 Oct 2019 13:46:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92Dkehg060563; Wed, 2 Oct 2019 13:46:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910021346.x92Dkehg060563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Oct 2019 13:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r353007 - 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: 353007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 13:46:41 -0000 Author: kib Date: Wed Oct 2 13:46:40 2019 New Revision: 353007 URL: https://svnweb.freebsd.org/changeset/base/353007 Log: MFC r352684: x86: Fall back to leaf 0x16 if TSC frequency is obtained by CPUID and leaf 0x15 is not functional. Modified: stable/11/sys/x86/x86/tsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/tsc.c ============================================================================== --- stable/11/sys/x86/x86/tsc.c Wed Oct 2 13:43:24 2019 (r353006) +++ stable/11/sys/x86/x86/tsc.c Wed Oct 2 13:46:40 2019 (r353007) @@ -130,7 +130,11 @@ tsc_freq_vmware(void) /* * Calculate TSC frequency using information from the CPUID leaf 0x15 - * 'Time Stamp Counter and Nominal Core Crystal Clock'. It should be + * 'Time Stamp Counter and Nominal Core Crystal Clock'. If leaf 0x15 + * is not functional, as it is on Skylake/Kabylake, try 0x16 'Processor + * Frequency Information'. Leaf 0x16 is described in the SDM as + * informational only, but if 0x15 did not work, and TSC calibration + * is disabled, it is the best we can get at all. It should still be * an improvement over the parsing of the CPU model name in * tsc_freq_intel(), when available. */ @@ -142,10 +146,20 @@ tsc_freq_cpuid(void) if (cpu_high < 0x15) return (false); do_cpuid(0x15, regs); - if (regs[0] == 0 || regs[1] == 0 || regs[2] == 0) + if (regs[0] != 0 && regs[1] != 0 && regs[2] != 0) { + tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; + return (true); + } + + if (cpu_high < 0x16) return (false); - tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; - return (true); + do_cpuid(0x16, regs); + if (regs[0] != 0) { + tsc_freq = (uint64_t)regs[0] * 1000000; + return (true); + } + + return (false); } static void From owner-svn-src-all@freebsd.org Wed Oct 2 14:12:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B47130224; Wed, 2 Oct 2019 14:12:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jykg1xbMz4TGQ; Wed, 2 Oct 2019 14:12:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id k25so17700269oiw.13; Wed, 02 Oct 2019 07:12:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LInN2EeMNRaWbQ7PtQgLRQFVHHSGsYYRDbf8CR0UPGQ=; b=qbaoqfBr3Ft/S6Tkq/pmnfRWc3lhXmuLNu3Rwun5DsgkeiOOA8Y47zHh14m54o9mYX 1TTFSxmPtFkrutkm6Gppv9xQ4uOfRa+550oB/v6mIqf/Qj5uDGotfNbUylUM0DKyrOMa Nwy7WrhdbI8BPKmkh6irHPo0RNWKqPHyN/zESfokJCsBY7ZZ2FoGI6nNA+ZMIqDkCzpj OACWYvd6AUl9LtzyVgmUTG01j8Kb0Z6YJkueTh8bUU/9ldTwoq22J2cfdS/sNla6yMQd t+eAOl3eLEc7U9Wn/0VkqBHuZFesyg7k/L7sTvIn26zplKBnmKOY4752NYDR6I7cSh3s 4SPA== X-Gm-Message-State: APjAAAWWVA2pyWCm7Hd7f67FTFZz7Ce6k6CNllieVLn4EDSVRRlxxDSY AWaSXA3oCjJC0Gk/Dk9lbEf3TkTYrOOcYNEsILRKoNL6 X-Google-Smtp-Source: APXvYqzrdmXdKsQbg7J2HU1/wGm3DRtg+fsiyD4685Fid65picFViQkyIxwCXZy4tXkHIKqDF0CN4X3aycCWG5VEMzI= X-Received: by 2002:aca:f48e:: with SMTP id s136mr3104902oih.57.1570025529122; Wed, 02 Oct 2019 07:12:09 -0700 (PDT) MIME-Version: 1.0 References: <201909132303.x8DN3uw3026373@repo.freebsd.org> In-Reply-To: <201909132303.x8DN3uw3026373@repo.freebsd.org> From: Alan Somers Date: Wed, 2 Oct 2019 08:11:57 -0600 Message-ID: Subject: Re: svn commit: r352312 - in head: lib/geom/nop sys/geom/nop To: Chuck Silvers Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46jykg1xbMz4TGQ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.169 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.18)[ip: (-0.44), ipnet: 209.85.128.0/17(-3.27), asn: 15169(-2.16), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[169.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[169.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 14:12:12 -0000 On Fri, Sep 13, 2019 at 5:04 PM Chuck Silvers wrote: > Author: chs > Date: Fri Sep 13 23:03:56 2019 > New Revision: 352312 > URL: https://svnweb.freebsd.org/changeset/base/352312 > > Log: > Add a "count_until_fail" option to gnop, which says to start failing > I/O requests after the given number have been allowed though. > > Approved by: imp (mentor) > Reviewed by: rpokala kib 0mp mckusick > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D21593 > > Modified: > head/lib/geom/nop/geom_nop.c > head/lib/geom/nop/gnop.8 > head/sys/geom/nop/g_nop.c > head/sys/geom/nop/g_nop.h > This patch introduces a backwards-compatibility bug. On a system with a post-352312 kernel but a pre-352312 userland, the gnop command will always fail with the error "gnop: Missing count_until_fail argument". -Alan From owner-svn-src-all@freebsd.org Wed Oct 2 15:03:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BC8213153B; Wed, 2 Oct 2019 15:03:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jzss4w5Tz4X9T; Wed, 2 Oct 2019 15:03:29 +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 x92F3F3M050767 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 2 Oct 2019 18:03:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x92F3F3M050767 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x92F3Fdx050766; Wed, 2 Oct 2019 18:03:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Oct 2019 18:03:15 +0300 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352938 - head/sys/arm/include Message-ID: <20191002150315.GC44691@kib.kiev.ua> References: <201910011939.x91Jd0tK010821@repo.freebsd.org> <20191001194932.GZ44691@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46jzss4w5Tz4X9T X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 15:03:30 -0000 On Tue, Oct 01, 2019 at 01:53:05PM -0600, Ian Lepore wrote: > On Tue, 2019-10-01 at 22:49 +0300, Konstantin Belousov wrote: > > On Tue, Oct 01, 2019 at 07:39:00PM +0000, Ian Lepore wrote: > > > Author: ian > > > Date: Tue Oct 1 19:39:00 2019 > > > New Revision: 352938 > > > URL: https://svnweb.freebsd.org/changeset/base/352938 > > > > > > Log: > > > Add 8 and 16 bit versions of atomic_cmpset and atomic_fcmpset for arm. > > > > > > This adds 8 and 16 bit versions of the cmpset and fcmpset functions. Macros > > > are used to generate all the flavors from the same set of instructions; the > > > macro expansion handles the couple minor differences between each size > > > variation (generating ldrexb/ldrexh/ldrex for 8/16/32, etc). > > > > > > In addition to handling new sizes, the instruction sequences used for cmpset > > > and fcmpset are rewritten to be a bit shorter/faster, and the new sequence > > > will not return false when *dst==*old but the store-exclusive fails because > > > of concurrent writers. Instead, it just loops like ldrex/strex sequences > > > normally do until it gets a non-conflicted store. The manpage allows LL/SC > > > architectures to bogusly return false, but there's no reason to actually do > > > so, at least on arm. > > > > The reason is to avoid nested loops. The outer control for retry was the > > initial design decision for fcmpset() comparing to cmpset(). casueword() > > also started following this approach after the fixes for ll/sc looping > > after the external control. > > If the implementation is forbidden from looping, then the manpage > should say so. What I commited meets the requirements currently stated > in the manpage. Until somebody explains to me why it is somehow > harmful to return the RIGHT information at a cost of either 0 or 1 > extra cpu cycle, it's staying the way it is. Implementation is not forbidden from looping, but looping definitely deteriorates the quality of the implementation. Problem with the loop is that the outer caller does not have control over the inner loop, while it is the outer caller who knows more about terminating conditions. I can only point out casueword(9) where inner looping is causing CVE-level issues. I do not believe that any of atomic(9) primitives on ll/sc machines cause the CVE for us right now (but casueword did). Note that even x86 does not use the comparision with dest, but rely on the CPU flag to provide the result (this is the closest analog of not looping for CAS). From owner-svn-src-all@freebsd.org Wed Oct 2 15:13:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A360C1317A8; Wed, 2 Oct 2019 15:13:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k05d3s6Mz4Xyw; Wed, 2 Oct 2019 15:13:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508D72D5E9; Wed, 2 Oct 2019 15:13: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 x92FDfrg013966; Wed, 2 Oct 2019 15:13:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92FDf93013965; Wed, 2 Oct 2019 15:13:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021513.x92FDf93013965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 15:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353008 - head/sys/mips/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/mips/include X-SVN-Commit-Revision: 353008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 15:13:41 -0000 Author: kevans Date: Wed Oct 2 15:13:40 2019 New Revision: 353008 URL: https://svnweb.freebsd.org/changeset/base/353008 Log: mips: fcmpset: do not spin on sc failure For ll/sc architectures, atomic(9) allows failure modes where *old == val due to write failure and callers should compensate for this. Do not retry on failure, just leave 0 in ret and fail the operation if we couldn't sc it. This lets the caller determine if it should retry or not. Reviewed by: kib Looks ok: imp Differential Revision: https://reviews.freebsd.org/D21836 Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Wed Oct 2 13:46:40 2019 (r353007) +++ head/sys/mips/include/atomic.h Wed Oct 2 15:13:40 2019 (r353008) @@ -397,18 +397,25 @@ atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cm { int ret; + /* + * The following sequence (similar to that in atomic_fcmpset_64) will + * attempt to update the value of *p with newval if the comparison + * succeeds. Note that they'll exit regardless of whether the store + * actually succeeded, leaving *cmpval untouched. This is in line with + * the documentation of atomic_fcmpset_() in atomic(9) for ll/sc + * architectures. + */ __asm __volatile ( - "1:\n\t" "ll %0, %1\n\t" /* load old value */ - "bne %0, %4, 2f\n\t" /* compare */ + "bne %0, %4, 1f\n\t" /* compare */ "move %0, %3\n\t" /* value to store */ "sc %0, %1\n\t" /* attempt to store */ - "beqz %0, 1b\n\t" /* if it failed, spin */ - "j 3f\n\t" - "2:\n\t" + "j 2f\n\t" /* exit regardless of success */ + "nop\n\t" /* avoid delay slot accident */ + "1:\n\t" "sw %0, %2\n\t" /* save old value */ "li %0, 0\n\t" - "3:\n" + "2:\n" : "=&r" (ret), "+m" (*p), "=m" (*cmpval) : "r" (newval), "r" (*cmpval) : "memory"); @@ -508,17 +515,16 @@ atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cm int ret; __asm __volatile ( - "1:\n\t" "lld %0, %1\n\t" /* load old value */ - "bne %0, %4, 2f\n\t" /* compare */ + "bne %0, %4, 1f\n\t" /* compare */ "move %0, %3\n\t" /* value to store */ "scd %0, %1\n\t" /* attempt to store */ - "beqz %0, 1b\n\t" /* if it failed, spin */ - "j 3f\n\t" - "2:\n\t" + "j 2f\n\t" /* exit regardless of success */ + "nop\n\t" /* avoid delay slot accident */ + "1:\n\t" "sd %0, %2\n\t" /* save old value */ "li %0, 0\n\t" - "3:\n" + "2:\n" : "=&r" (ret), "+m" (*p), "=m" (*cmpval) : "r" (newval), "r" (*cmpval) : "memory"); From owner-svn-src-all@freebsd.org Wed Oct 2 15:19:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9952131852; Wed, 2 Oct 2019 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k0DX4GnXz4YJw; Wed, 2 Oct 2019 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71DEB2D5EE; Wed, 2 Oct 2019 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92FJeM2014294; Wed, 2 Oct 2019 15:19:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92FJemg014293; Wed, 2 Oct 2019 15:19:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021519.x92FJemg014293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 15:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353009 - head/lib/libusb X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libusb X-SVN-Commit-Revision: 353009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 15:19:40 -0000 Author: kevans Date: Wed Oct 2 15:19:39 2019 New Revision: 353009 URL: https://svnweb.freebsd.org/changeset/base/353009 Log: libusb: LIBUSB_DEBUG environment variable override of libusb_set_debug The debug level generally just controls verbosity of libusb for debugging libusb devices/usage. We allow the environment to set the debug level independent of the application, but the application will always override this if it explicitly sets the debug level. Changing the environment is easy, but patching the software to change the debug level isn't necessarily easy or possible. Further, there's this write-only debug_fixed variable that would seem to imply that the debug level should be fixed, but it isn't currently used. Change the logic to use strtol() so we can detect real 0 vs. conversion failure, then honor debug_fixed in libusb_set_debug. Reviewed by: hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21877 Modified: head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Wed Oct 2 15:13:40 2019 (r353008) +++ head/lib/libusb/libusb10.c Wed Oct 2 15:19:39 2019 (r353009) @@ -91,7 +91,8 @@ void libusb_set_debug(libusb_context *ctx, int level) { ctx = GET_CONTEXT(ctx); - if (ctx) + /* debug_fixed is set when the environment overrides libusb_set_debug */ + if (ctx && ctx->debug_fixed == 0) ctx->debug = level; } @@ -132,7 +133,7 @@ libusb_init(libusb_context **context) { struct libusb_context *ctx; pthread_condattr_t attr; - char *debug; + char *debug, *ep; int ret; ctx = malloc(sizeof(*ctx)); @@ -143,9 +144,23 @@ libusb_init(libusb_context **context) debug = getenv("LIBUSB_DEBUG"); if (debug != NULL) { - ctx->debug = atoi(debug); - if (ctx->debug != 0) + /* + * If LIBUSB_DEBUG is set, we'll honor that and use it to + * override libusb_set_debug calls. + */ + errno = 0; + ctx->debug = strtol(debug, &ep, 10); + if (errno == 0 && *ep == '\0') { ctx->debug_fixed = 1; + } else { + /* + * LIBUSB_DEBUG conversion failed for some reason, but + * we don't care about the specifics all that much. We + * can't use it either way. Force it to the default, + * 0, in case we had a partial number. + */ + ctx->debug = 0; + } } TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); From owner-svn-src-all@freebsd.org Wed Oct 2 15:41:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0404A131F68; Wed, 2 Oct 2019 15:41:34 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46k0jn5tqZz4ZgP; Wed, 2 Oct 2019 15:41:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x92FfUnQ049030; Wed, 2 Oct 2019 08:41:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x92FfUwY049029; Wed, 2 Oct 2019 08:41:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201910021541.x92FfUwY049029@gndrsh.dnsmgr.net> Subject: Re: svn commit: r352953 - in head/usr.bin: killall split In-Reply-To: To: cem@freebsd.org Date: Wed, 2 Oct 2019 08:41:30 -0700 (PDT) CC: Alexander Kabaev , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46k0jn5tqZz4ZgP X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 15:41:34 -0000 > Hi Alexander, > > Coverity has millions of spurious warnings of this class and they're > basically all false positives. I think we should instead try to > figure out how to disable this class of warning on our codebase, since > it is largely incorrect. > > I would encourage reverting this change, because it uglies up the code > for no functional benefit. The code was correct before the change; > only Coverity was wrong. Again, I would like to suggest that a "working group", or team be formed that would be responsible for reviewing all Coverty/static analysis type fixes before they are committed to the tree? Simply a group of people that are willing to look at a code review in phabricator before a change is committed, to prevent exactly this type of issue. The team should consist of experts in static analysis or language contruction so that we catch these types of false positive fixes before they are committed to the tree. I also fully support Conrad in his assertion that we should start to find ways to silence Coverity on these false positives. Regards, Rod > > Best, > Conrad > > On Tue, Oct 1, 2019 at 11:15 PM Alexander Kabaev wrote: > > > > Author: kan > > Date: Wed Oct 2 06:15:30 2019 > > New Revision: 352953 > > URL: https://svnweb.freebsd.org/changeset/base/352953 > > > > Log: > > Convert pnmatch to single element array in regexec calls > > > > The regexec function is declared as taking an array of regmatch_t > > elements, and passing in the pointer to singleton element, while > > correct, triggers a Coverity warning. Convert the singleton into > > an array of one to silence the warning. > > > > Reported by: Coverity > > Coverity CID: 1009732, 1009733 > > MFC after: 2 weeks > > > > Modified: > > head/usr.bin/killall/killall.c > > head/usr.bin/split/split.c > > > > Modified: head/usr.bin/killall/killall.c > > ============================================================================== > > --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 (r352952) > > +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 (r352953) > > @@ -98,7 +98,7 @@ main(int ac, char **av) > > struct stat sb; > > struct passwd *pw; > > regex_t rgx; > > - regmatch_t pmatch; > > + regmatch_t pmatch[1]; > > int i, j, ch; > > char buf[256]; > > char first; > > @@ -361,9 +361,9 @@ main(int ac, char **av) > > } > > } > > if (mflag) { > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = strlen(thiscmd); > > - if (regexec(&rgx, thiscmd, 0, &pmatch, > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = strlen(thiscmd); > > + if (regexec(&rgx, thiscmd, 0, pmatch, > > REG_STARTEND) != 0) > > matched = 0; > > regfree(&rgx); > > @@ -387,9 +387,9 @@ main(int ac, char **av) > > } > > } > > if (mflag) { > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = strlen(thiscmd); > > - if (regexec(&rgx, thiscmd, 0, &pmatch, > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = strlen(thiscmd); > > + if (regexec(&rgx, thiscmd, 0, pmatch, > > REG_STARTEND) == 0) > > matched = 1; > > regfree(&rgx); > > > > Modified: head/usr.bin/split/split.c > > ============================================================================== > > --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) > > +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) > > @@ -281,11 +281,11 @@ split2(void) > > > > /* Check if we need to start a new file */ > > if (pflag) { > > - regmatch_t pmatch; > > + regmatch_t pmatch[1]; > > > > - pmatch.rm_so = 0; > > - pmatch.rm_eo = len - 1; > > - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) == 0) > > + pmatch[0].rm_so = 0; > > + pmatch[0].rm_eo = len - 1; > > + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) == 0) > > newfile(); > > } else if (lcnt++ == numlines) { > > newfile(); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Oct 2 15:45:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB5E1132089; Wed, 2 Oct 2019 15:45:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k0pj4XlKz4b0f; Wed, 2 Oct 2019 15:45:49 +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 7FCF52DB5C; Wed, 2 Oct 2019 15:45: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 x92FjnBs031995; Wed, 2 Oct 2019 15:45:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92Fjntm031994; Wed, 2 Oct 2019 15:45:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910021545.x92Fjntm031994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Oct 2019 15:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353010 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 353010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 15:45:49 -0000 Author: markj Date: Wed Oct 2 15:45:49 2019 New Revision: 353010 URL: https://svnweb.freebsd.org/changeset/base/353010 Log: Disallow fcntl(F_READAHEAD) when the vnode is not a regular file. The mountpoint may not have defined an iosize parameter, so an attempt to configure readahead on a device file can lead to a divide-by-zero crash. The sequential heuristic is not applied to I/O to or from device files, and posix_fadvise(2) returns an error when v_type != VREG, so perform the same check here. Reported by: syzbot+e4b682208761aa5bc53a@syzkaller.appspotmail.com Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21864 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Oct 2 15:19:39 2019 (r353009) +++ head/sys/kern/kern_descrip.c Wed Oct 2 15:45:49 2019 (r353010) @@ -788,6 +788,12 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; } vp = fp->f_vnode; + if (vp->v_type != VREG) { + fdrop(fp, td); + error = ENOTTY; + break; + } + /* * Exclusive lock synchronizes against f_seqcount reads and * writes in sequential_heuristic(). From owner-svn-src-all@freebsd.org Wed Oct 2 16:08:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 148501328EF; Wed, 2 Oct 2019 16:08:02 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1JK6tC9z4cK2; Wed, 2 Oct 2019 16:08:01 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF6E02DEFC; Wed, 2 Oct 2019 16:08:01 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92G81ng044055; Wed, 2 Oct 2019 16:08:01 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92G81d0044053; Wed, 2 Oct 2019 16:08:01 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201910021608.x92G81d0044053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Wed, 2 Oct 2019 16:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353011 - in head/usr.bin: killall split X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: in head/usr.bin: killall split X-SVN-Commit-Revision: 353011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 16:08:02 -0000 Author: kan Date: Wed Oct 2 16:08:01 2019 New Revision: 353011 URL: https://svnweb.freebsd.org/changeset/base/353011 Log: Revert r352953: Convert pnmatch to single element array in regexec calls Requested by: cem Modified: head/usr.bin/killall/killall.c head/usr.bin/split/split.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Wed Oct 2 15:45:49 2019 (r353010) +++ head/usr.bin/killall/killall.c Wed Oct 2 16:08:01 2019 (r353011) @@ -98,7 +98,7 @@ main(int ac, char **av) struct stat sb; struct passwd *pw; regex_t rgx; - regmatch_t pmatch[1]; + regmatch_t pmatch; int i, j, ch; char buf[256]; char first; @@ -361,9 +361,9 @@ main(int ac, char **av) } } if (mflag) { - pmatch[0].rm_so = 0; - pmatch[0].rm_eo = strlen(thiscmd); - if (regexec(&rgx, thiscmd, 0, pmatch, + pmatch.rm_so = 0; + pmatch.rm_eo = strlen(thiscmd); + if (regexec(&rgx, thiscmd, 0, &pmatch, REG_STARTEND) != 0) matched = 0; regfree(&rgx); @@ -387,9 +387,9 @@ main(int ac, char **av) } } if (mflag) { - pmatch[0].rm_so = 0; - pmatch[0].rm_eo = strlen(thiscmd); - if (regexec(&rgx, thiscmd, 0, pmatch, + pmatch.rm_so = 0; + pmatch.rm_eo = strlen(thiscmd); + if (regexec(&rgx, thiscmd, 0, &pmatch, REG_STARTEND) == 0) matched = 1; regfree(&rgx); Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Wed Oct 2 15:45:49 2019 (r353010) +++ head/usr.bin/split/split.c Wed Oct 2 16:08:01 2019 (r353011) @@ -281,11 +281,11 @@ split2(void) /* Check if we need to start a new file */ if (pflag) { - regmatch_t pmatch[1]; + regmatch_t pmatch; - pmatch[0].rm_so = 0; - pmatch[0].rm_eo = len - 1; - if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) == 0) + pmatch.rm_so = 0; + pmatch.rm_eo = len - 1; + if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) == 0) newfile(); } else if (lcnt++ == numlines) { newfile(); From owner-svn-src-all@freebsd.org Wed Oct 2 16:09:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A264132989; Wed, 2 Oct 2019 16:09:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1L06zp4z4cSV; Wed, 2 Oct 2019 16:09:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D28F02DF04; Wed, 2 Oct 2019 16:09:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92G9SwN044159; Wed, 2 Oct 2019 16:09:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92G9STB044158; Wed, 2 Oct 2019 16:09:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910021609.x92G9STB044158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Oct 2019 16:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353012 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 16:09:29 -0000 Author: gjb Date: Wed Oct 2 16:09:28 2019 New Revision: 353012 URL: https://svnweb.freebsd.org/changeset/base/353012 Log: Add a comment explaining why the opensolaris_load line in loader.conf is explicitly added. Requested by: rgrimes MFC after: 3 days MFC with: r353004 Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:08:01 2019 (r353011) +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:09:28 2019 (r353012) @@ -44,6 +44,8 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +# The 'opensolaris_load' line is a workaround for arm64, which does not +# automatically load opensolaris.ko with zfs.ko. df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf From owner-svn-src-all@freebsd.org Wed Oct 2 16:13:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A9CC132B8C for ; Wed, 2 Oct 2019 16:13:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1Q956w6z4cqn for ; Wed, 2 Oct 2019 16:13:05 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1570032784; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Zt2AEr8I3yhJj3EcS3ibjOHl8SxbhKYz1QazLRHnkrxvZqkSu1g0eXESaI5rOluMv3XN3YmIuY4Cy HyacNE2CmOEiXJeNGZLaSmM23TtLf/PwaWvCKcz9Ol1ncO9BcFasBg8+SKDX1cAqdMqHTVxDc4ODW3 hjzu+FtyOWavGtmqdK6h/RF2a4JAqaPeLnX2aohuF/i3G5Fkw2pvzAkc2h+oA63MwZXokY/p6Gpakr jWf1vWjL7QYvO427C/VDfJYV6BMs5FWBRZT4XXUnECcC4ZSGRDbBRTYIKqBYv52YHvQgc0yx5V1fFZ VOdCHNdTd4mDE8/H/IhyzplJxFY2AZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=EIBFGfII8kQsWKJtZwldnhlSV54TZ2kizPITqUQENMs=; b=ZkLf4wt6d6XqN6HYRoCVn40HTEVeSUKyHgnoOsK8iTH3JMjGWvJxnmnAfcXqIcCYtnkCJObCCTm0D /gIrtaRCZSljGileN3XsIJ+m15YEOL2wFVB4Po0Q8D/IZcycVNW8TvrnOEbsbtvF+pbwQ1p2QYDfVK ae1td937jmtOyNv36ShYmOFrTcTn92EBNh7f6FdxzoAHho9m+R/QVTpXbapBjtxUSlEuxceEU5Hd/R paNtNWlZifKzLblDrx0DGP+lFMBkfQMyG2S+yo+6dBfoiCBsis3gDUQdjDgJOJXMqCQzay4eVGI1Bp z3QfuRbY2czpvojWiaS/YHZuTE5TiZg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=EIBFGfII8kQsWKJtZwldnhlSV54TZ2kizPITqUQENMs=; b=AWxsF6r0Qkj6ZjxzCUbeYJBSXc0zJ5/eKyl7waNMTSUTBcdr2jZVaAsXAteX+fPTQlazJAdKrKfip /0nvX2NbjhoEZxTZVDzE1vvGbPvi+rzcxSdPGPgOrsqvX+p1dr3Lj/jduO7Wyk/shu7L4cOl+b1O9p wp/UykZMlLMi3r3Zwc1i9xz+DMMjD4GSnuK0se/Tcjcnl7utY8tV5qwoAgcyhwAkaf9iABzOWODuhr /pUUR+dA0J8A+y5jteUk5QNs5Gf3zmg68ux4USjawNAC4MwGHx9kJ5qtCZYQ49dYMnzhBljVsKlHEC gRF5Ddxex4Eb5S4pJH/GaZLcF/zhLjg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 81bc4cb6-e52f-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 81bc4cb6-e52f-11e9-85ed-13b9aae3a1d2; Wed, 02 Oct 2019 16:13:02 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x92GD1gA060257; Wed, 2 Oct 2019 10:13:01 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r353012 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 02 Oct 2019 10:13:01 -0600 In-Reply-To: <201910021609.x92G9STB044158@repo.freebsd.org> References: <201910021609.x92G9STB044158@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46k1Q956w6z4cqn X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.952,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 16:13:06 -0000 On Wed, 2019-10-02 at 16:09 +0000, Glen Barber wrote: > Author: gjb > Date: Wed Oct 2 16:09:28 2019 > New Revision: 353012 > URL: https://svnweb.freebsd.org/changeset/base/353012 > > Log: > Add a comment explaining why the opensolaris_load line in loader.conf > is explicitly added. > > Requested by: rgrimes > MFC after: 3 days > MFC with: r353004 > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/usr.sbin/bsdinstall/scripts/config > > Modified: head/usr.sbin/bsdinstall/scripts/config > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:08:01 2019 (r353011) > +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:09:28 2019 (r353012) > @@ -44,6 +44,8 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc > > cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf > rm $BSDINSTALL_TMPBOOT/loader.conf.* > +# The 'opensolaris_load' line is a workaround for arm64, which does not > +# automatically load opensolaris.ko with zfs.ko. > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > Is this our long-existing problem of not being able to run kldxref as part of a cross build and install? Or is this some other arm64- specific problem? -- Ian From owner-svn-src-all@freebsd.org Wed Oct 2 16:15:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 969C7132CB2; Wed, 2 Oct 2019 16:15:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1T32rshz4d7d; Wed, 2 Oct 2019 16:15:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x92GFXpQ049379; Wed, 2 Oct 2019 09:15:33 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x92GFXKk049378; Wed, 2 Oct 2019 09:15:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201910021615.x92GFXKk049378@gndrsh.dnsmgr.net> Subject: Re: svn commit: r353012 - head/usr.sbin/bsdinstall/scripts In-Reply-To: <201910021609.x92G9STB044158@repo.freebsd.org> To: Glen Barber Date: Wed, 2 Oct 2019 09:15:33 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46k1T32rshz4d7d X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 16:15:35 -0000 > Author: gjb > Date: Wed Oct 2 16:09:28 2019 > New Revision: 353012 > URL: https://svnweb.freebsd.org/changeset/base/353012 > > Log: > Add a comment explaining why the opensolaris_load line in loader.conf > is explicitly added. Thank you, Rod > > Requested by: rgrimes > MFC after: 3 days > MFC with: r353004 > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/usr.sbin/bsdinstall/scripts/config > > Modified: head/usr.sbin/bsdinstall/scripts/config > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:08:01 2019 (r353011) > +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:09:28 2019 (r353012) > @@ -44,6 +44,8 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc > > cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf > rm $BSDINSTALL_TMPBOOT/loader.conf.* > +# The 'opensolaris_load' line is a workaround for arm64, which does not > +# automatically load opensolaris.ko with zfs.ko. > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Oct 2 16:17:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A05EA132D66; Wed, 2 Oct 2019 16:17:12 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1Vw2l04z4dMF; Wed, 2 Oct 2019 16:17:11 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x92GHASf049393; Wed, 2 Oct 2019 09:17:10 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x92GHAad049392; Wed, 2 Oct 2019 09:17:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201910021617.x92GHAad049392@gndrsh.dnsmgr.net> Subject: Re: svn commit: r353012 - head/usr.sbin/bsdinstall/scripts In-Reply-To: To: Ian Lepore Date: Wed, 2 Oct 2019 09:17:10 -0700 (PDT) CC: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46k1Vw2l04z4dMF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 16:17:12 -0000 > On Wed, 2019-10-02 at 16:09 +0000, Glen Barber wrote: > > Author: gjb > > Date: Wed Oct 2 16:09:28 2019 > > New Revision: 353012 > > URL: https://svnweb.freebsd.org/changeset/base/353012 > > > > Log: > > Add a comment explaining why the opensolaris_load line in loader.conf > > is explicitly added. > > > > Requested by: rgrimes > > MFC after: 3 days > > MFC with: r353004 > > Sponsored by: Rubicon Communications, LLC (Netgate) > > > > Modified: > > head/usr.sbin/bsdinstall/scripts/config > > > > Modified: head/usr.sbin/bsdinstall/scripts/config > > ============================================================================== > > --- head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:08:01 2019 (r353011) > > +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:09:28 2019 (r353012) > > @@ -44,6 +44,8 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc > > > > cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf > > rm $BSDINSTALL_TMPBOOT/loader.conf.* > > +# The 'opensolaris_load' line is a workaround for arm64, which does not > > +# automatically load opensolaris.ko with zfs.ko. > > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > > > > Is this our long-existing problem of not being able to run kldxref as > part of a cross build and install? Or is this some other arm64- > specific problem? I think it boils down to that, though I have not re-investigated the issue since kldxref was fixed to run on arm64 (which was the orignal problem). -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Oct 2 16:18:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 534A5132E08; Wed, 2 Oct 2019 16:18:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1Xq0YMSz4dVg; Wed, 2 Oct 2019 16:18:51 +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 E6B842E0E6; Wed, 2 Oct 2019 16:18:50 +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 x92GIoZE050037; Wed, 2 Oct 2019 16:18:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92GIodT050036; Wed, 2 Oct 2019 16:18:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910021618.x92GIodT050036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Oct 2019 16:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353013 - head/sys/modules/hptmv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/modules/hptmv X-SVN-Commit-Revision: 353013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 16:18:51 -0000 Author: markj Date: Wed Oct 2 16:18:50 2019 New Revision: 353013 URL: https://svnweb.freebsd.org/changeset/base/353013 Log: Harmonize the hptmv blob's build rule with that of other hpt* drivers. No functional change intended. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21866 Modified: head/sys/modules/hptmv/Makefile Modified: head/sys/modules/hptmv/Makefile ============================================================================== --- head/sys/modules/hptmv/Makefile Wed Oct 2 16:09:28 2019 (r353012) +++ head/sys/modules/hptmv/Makefile Wed Oct 2 16:18:50 2019 (r353013) @@ -13,14 +13,8 @@ SRCS+= bus_if.h device_if.h pci_if.h SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c OBJS+= hptmvraid.o -.if $(MACHINE_CPUARCH) == "amd64" -HPTMV_RAID_O = amd64-elf.raid.o.uu -.else -HPTMV_RAID_O = i386-elf.raid.o.uu -.endif - -hptmvraid.o: ${HPTMV}/$(HPTMV_RAID_O) - uudecode -p < ${HPTMV}/$(HPTMV_RAID_O) > ${.TARGET} +hptmvraid.o: + uudecode -p < ${HPTMV}/${MACHINE_CPUARCH}-elf.raid.o.uu > ${.TARGET} # # Debug Options: From owner-svn-src-all@freebsd.org Wed Oct 2 16:27:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C73D2133122; Wed, 2 Oct 2019 16:27:06 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1kL4ydLz4f4h; Wed, 2 Oct 2019 16:27:06 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 46B91101C; Wed, 2 Oct 2019 16:27:06 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Wed, 2 Oct 2019 16:27:04 +0000 From: Glen Barber To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r353012 - head/usr.sbin/bsdinstall/scripts Message-ID: <20191002162704.GG27491@FreeBSD.org> References: <201910021609.x92G9STB044158@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sTC4Ri5uc2u6z9Yo" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 16:27:06 -0000 --sTC4Ri5uc2u6z9Yo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 02, 2019 at 10:13:01AM -0600, Ian Lepore wrote: > On Wed, 2019-10-02 at 16:09 +0000, Glen Barber wrote: > > Author: gjb > > Date: Wed Oct 2 16:09:28 2019 > > New Revision: 353012 > > URL: https://svnweb.freebsd.org/changeset/base/353012 > >=20 > > Log: > > Add a comment explaining why the opensolaris_load line in loader.conf > > is explicitly added. > > =20 > > Requested by: rgrimes > > MFC after: 3 days > > MFC with: r353004 > > Sponsored by: Rubicon Communications, LLC (Netgate) > >=20 > > Modified: > > head/usr.sbin/bsdinstall/scripts/config > >=20 > > Modified: head/usr.sbin/bsdinstall/scripts/config > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:08:01 2019 (r= 353011) > > +++ head/usr.sbin/bsdinstall/scripts/config Wed Oct 2 16:09:28 2019 (r= 353012) > > @@ -44,6 +44,8 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc > > =20 > > cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.co= nf > > rm $BSDINSTALL_TMPBOOT/loader.conf.* > > +# The 'opensolaris_load' line is a workaround for arm64, which does not > > +# automatically load opensolaris.ko with zfs.ko. > > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=3D\= "YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf > > df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=3D\"YES\"" = >> $BSDINSTALL_TMPBOOT/loader.conf > > =20 >=20 > Is this our long-existing problem of not being able to run kldxref as > part of a cross build and install? Or is this some other arm64- > specific problem? >=20 This is a good question. I do not see an error in the log when kldxref is invoked, but I am not certain if that necessarily means anything. Glen --sTC4Ri5uc2u6z9Yo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl2Uz9MACgkQAxRYpUeP 4pP5fRAAizU6LIdTPyibWMl/XOlBFQm1DLwolwiKLMIPEMRG9oA9Eu5pfIxYaE17 nUdDfpGf6nRyFhI41LqGK/JGYuHpi7sBMZco3Xt0ZWv4hrTu4vYpixpUxR/oV9ix AMdETq3ID6fv3vr7olVcuVPD2wh2Nu0E332SJu/TxXsxY82tVu/QVIs4xpBgqPRf rCy+VjsfOTaLngEt9WBq//CYUPHb4k0839eSmlU7PaVOZx2JqreVVQuyGbn/sIMo SQUE5Ha2nhsUr4Ucf/c0Ne67cx0vXPpZkviJI8C9mbLXkIPyAL7ABvGCnBF9tGmO NRT+po3x4IzhKLEo+vQK973BUx00sCT+wRJ+UYOmuh1QsFp1Y6XTdBSt5dk5WUh1 t+80rZhOf+1F/an0dFktRwcl5tENB/0/BkgDivFkfTum851M6GDAEQ14+zpqTjUy 67H/UQhqMZAbROUEpDh4exiNnpwLF3cUHe529zuf/jef0VX7QucXamZDXG5E0qS9 c5Fbp8se0w/YwfQS8F/XDhWn9KZ1a6Ks6dWWGHimJAaXpPrHkhrijTr9UNlkSBAr 9mbpzraPBabHjlVpIEUWMVuBBPGUYQzv+Eb4iFwe97s21U/BxVy4rCgEGyvbtdbZ pF02y3GFHUmPVuZV41q7iFkZL3j9OukFEj1Cl9nlOgHm8olOX6Y= =klA3 -----END PGP SIGNATURE----- --sTC4Ri5uc2u6z9Yo-- From owner-svn-src-all@freebsd.org Wed Oct 2 16:34:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1395E133509; Wed, 2 Oct 2019 16:34: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k1v66jNGz4fWg; Wed, 2 Oct 2019 16:34: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 C68712E475; Wed, 2 Oct 2019 16:34: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 x92GYgGQ061816; Wed, 2 Oct 2019 16:34:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92GYgjE061814; Wed, 2 Oct 2019 16:34:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910021634.x92GYgjE061814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Oct 2019 16:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353014 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 353014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 16:34:43 -0000 Author: markj Date: Wed Oct 2 16:34:42 2019 New Revision: 353014 URL: https://svnweb.freebsd.org/changeset/base/353014 Log: Use OBJT_PHYS VM objects for kernel modules. OBJT_DEFAULT incurs some unnecessary overhead given that kernel module pages cannot be paged out. Reviewed by: alc, kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21862 Modified: head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Wed Oct 2 16:18:50 2019 (r353013) +++ head/sys/kern/link_elf.c Wed Oct 2 16:34:42 2019 (r353014) @@ -991,7 +991,7 @@ link_elf_load_file(linker_class_t cls, const char* fil ef = (elf_file_t) lf; #ifdef SPARSE_MAPPING - ef->object = vm_object_allocate(OBJT_DEFAULT, mapsize >> PAGE_SHIFT); + ef->object = vm_object_allocate(OBJT_PHYS, atop(mapsize)); if (ef->object == NULL) { error = ENOMEM; goto out; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Wed Oct 2 16:18:50 2019 (r353013) +++ head/sys/kern/link_elf_obj.c Wed Oct 2 16:34:42 2019 (r353014) @@ -774,8 +774,7 @@ link_elf_load_file(linker_class_t cls, const char *fil * This stuff needs to be in a single chunk so that profiling etc * can get the bounds and gdb can associate offsets with modules */ - ef->object = vm_object_allocate(OBJT_DEFAULT, - round_page(mapsize) >> PAGE_SHIFT); + ef->object = vm_object_allocate(OBJT_PHYS, atop(round_page(mapsize))); if (ef->object == NULL) { error = ENOMEM; goto out; From owner-svn-src-all@freebsd.org Wed Oct 2 17:06:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 084DA134342; Wed, 2 Oct 2019 17:06: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k2bm6VB7z3DNc; Wed, 2 Oct 2019 17:06: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 C24EA2E9E5; Wed, 2 Oct 2019 17:06: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 x92H6SxJ079631; Wed, 2 Oct 2019 17:06:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92H6Sf5079630; Wed, 2 Oct 2019 17:06:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021706.x92H6Sf5079630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 17:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353015 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 353015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:06:29 -0000 Author: kevans Date: Wed Oct 2 17:06:28 2019 New Revision: 353015 URL: https://svnweb.freebsd.org/changeset/base/353015 Log: Provide generic sub-word atomic *cmpset Provide *cmpset_{8,16} as wrappers around atomic_fcmpset_32. Initial users will be mips and sparc64, and perhaps parts of powerpc. This are not for general consumption; machine/atomic.h should include this header as needed to provide atomic_{,f}cmpset_{8,16} and machine/atomic.h should provide acq_ and rel_ variants. Reviewed by: jhibbits, kib Differential Revision: https://reviews.freebsd.org/D21822 Added: head/sys/sys/_atomic_subword.h (contents, props changed) Added: head/sys/sys/_atomic_subword.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_atomic_subword.h Wed Oct 2 17:06:28 2019 (r353015) @@ -0,0 +1,168 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Kyle Evans + * + * 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 _SYS__ATOMIC_SUBWORD_H_ +#define _SYS__ATOMIC_SUBWORD_H_ + +/* + * This header is specifically for platforms that either do not have ways to or + * simply do not do sub-word atomic operations. These are not ideal as they + * require a little more effort to make sure our atomic operations are failing + * because of the bits of the word we're trying to write rather than the rest + * of the word. + */ +#ifndef _MACHINE_ATOMIC_H_ +#error do not include this header, use machine/atomic.h +#endif + +#include + +#ifndef NBBY +#define NBBY 8 +#endif + +#define _ATOMIC_WORD_ALIGNED(p) \ + (uint32_t *)((__uintptr_t)(p) - ((__uintptr_t)(p) % 4)) + +#if _BYTE_ORDER == _BIG_ENDIAN +#define _ATOMIC_BYTE_SHIFT(p) \ + ((3 - ((__uintptr_t)(p) % 4)) * NBBY) + +#define _ATOMIC_HWORD_SHIFT(p) \ + ((2 - ((__uintptr_t)(p) % 4)) * NBBY) +#else +#define _ATOMIC_BYTE_SHIFT(p) \ + ((((__uintptr_t)(p) % 4)) * NBBY) + +#define _ATOMIC_HWORD_SHIFT(p) \ + ((((__uintptr_t)(p) % 4)) * NBBY) +#endif + +/* + * Pass these bad boys a couple words and a mask of the bits you care about, + * they'll loop until we either succeed or fail because of those bits rather + * than the ones we're not masking. old and val should already be preshifted to + * the proper position. + */ +static __inline int +_atomic_cmpset_masked_word(uint32_t *addr, uint32_t old, uint32_t val, + uint32_t mask) +{ + int ret; + uint32_t wcomp; + + wcomp = old; + + /* + * We'll attempt the cmpset on the entire word. Loop here in case the + * operation fails due to the other half-word resident in that word, + * rather than the half-word we're trying to operate on. Ideally we + * only take one trip through here. We'll have to recalculate the old + * value since it's the other part of the word changing. + */ + do { + old = (*addr & ~mask) | wcomp; + ret = atomic_fcmpset_32(addr, &old, (old & ~mask) | val); + } while (ret == 0 && (old & mask) == wcomp); + + return (ret); +} + +static __inline int +_atomic_fcmpset_masked_word(uint32_t *addr, uint32_t *old, uint32_t val, + uint32_t mask) +{ + + /* + * fcmpset_* is documented in atomic(9) to allow spurious failures where + * *old == val on ll/sc architectures because the sc may fail due to + * parallel writes or other reasons. We take advantage of that here + * and only attempt once, because the caller should be compensating for + * that possibility. + */ + *old = (*addr & ~mask) | *old; + return (atomic_fcmpset_32(addr, old, (*old & ~mask) | val)); +} + +static __inline int +atomic_cmpset_8(__volatile uint8_t *addr, uint8_t old, uint8_t val) +{ + int shift; + + shift = _ATOMIC_BYTE_SHIFT(addr); + + return (_atomic_cmpset_masked_word(_ATOMIC_WORD_ALIGNED(addr), + old << shift, val << shift, 0xff << shift)); +} + +static __inline int +atomic_fcmpset_8(__volatile uint8_t *addr, uint8_t *old, uint8_t val) +{ + int ret, shift; + uint32_t wold; + + shift = _ATOMIC_BYTE_SHIFT(addr); + wold = *old << shift; + ret = _atomic_fcmpset_masked_word(_ATOMIC_WORD_ALIGNED(addr), + &wold, val << shift, 0xff << shift); + if (ret == 0) + *old = (wold >> shift) & 0xff; + return (ret); +} + +static __inline int +atomic_cmpset_16(__volatile uint16_t *addr, uint16_t old, uint16_t val) +{ + int shift; + + shift = _ATOMIC_HWORD_SHIFT(addr); + + return (_atomic_cmpset_masked_word(_ATOMIC_WORD_ALIGNED(addr), + old << shift, val << shift, 0xffff << shift)); +} + +static __inline int +atomic_fcmpset_16(__volatile uint16_t *addr, uint16_t *old, uint16_t val) +{ + int ret, shift; + uint32_t wold; + + shift = _ATOMIC_HWORD_SHIFT(addr); + wold = *old << shift; + ret = _atomic_fcmpset_masked_word(_ATOMIC_WORD_ALIGNED(addr), + &wold, val << shift, 0xffff << shift); + if (ret == 0) + *old = (wold >> shift) & 0xffff; + return (ret); +} + +#undef _ATOMIC_WORD_ALIGNED +#undef _ATOMIC_BYTE_SHIFT +#undef _ATOMIC_HWORD_SHIFT + +#endif /* _SYS__ATOMIC_SUBWORD_H_ */ From owner-svn-src-all@freebsd.org Wed Oct 2 17:07:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4157134409; Wed, 2 Oct 2019 17:07:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k2dW4LqFz3DXW; Wed, 2 Oct 2019 17:07:59 +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 7A00E2E9EB; Wed, 2 Oct 2019 17:07:59 +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 x92H7x72079752; Wed, 2 Oct 2019 17:07:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92H7xsk079751; Wed, 2 Oct 2019 17:07:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021707.x92H7xsk079751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 17:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353016 - head/sys/mips/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/mips/include X-SVN-Commit-Revision: 353016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:07:59 -0000 Author: kevans Date: Wed Oct 2 17:07:59 2019 New Revision: 353016 URL: https://svnweb.freebsd.org/changeset/base/353016 Log: mips: use generic sub-word atomic *cmpset Most of this diff is refactoring to reduce duplication between the different acq_ and rel_ variants. Differential Revision: https://reviews.freebsd.org/D21822 Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Wed Oct 2 17:06:28 2019 (r353015) +++ head/sys/mips/include/atomic.h Wed Oct 2 17:07:59 2019 (r353016) @@ -81,6 +81,11 @@ void atomic_clear_16(__volatile uint16_t *, uint16_t); void atomic_add_16(__volatile uint16_t *, uint16_t); void atomic_subtract_16(__volatile uint16_t *, uint16_t); +static __inline int atomic_cmpset_8(__volatile uint8_t *, uint8_t, uint8_t); +static __inline int atomic_fcmpset_8(__volatile uint8_t *, uint8_t *, uint8_t); +static __inline int atomic_cmpset_16(__volatile uint16_t *, uint16_t, uint16_t); +static __inline int atomic_fcmpset_16(__volatile uint16_t *, uint16_t *, uint16_t); + static __inline void atomic_set_32(__volatile uint32_t *p, uint32_t v) { @@ -376,23 +381,6 @@ atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpv * zero if the compare failed, nonzero otherwise. */ static __inline int -atomic_cmpset_acq_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval) -{ - int retval; - - retval = atomic_cmpset_32(p, cmpval, newval); - mips_sync(); - return (retval); -} - -static __inline int -atomic_cmpset_rel_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval) -{ - mips_sync(); - return (atomic_cmpset_32(p, cmpval, newval)); -} - -static __inline int atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) { int ret; @@ -422,24 +410,59 @@ atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cm return ret; } -static __inline int -atomic_fcmpset_acq_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) -{ - int retval; - - retval = atomic_fcmpset_32(p, cmpval, newval); - mips_sync(); - return (retval); +#define ATOMIC_CMPSET_ACQ_REL(WIDTH) \ +static __inline int \ +atomic_cmpset_acq_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t cmpval, uint##WIDTH##_t newval) \ +{ \ + int retval; \ + \ + retval = atomic_cmpset_##WIDTH(p, cmpval, newval); \ + mips_sync(); \ + return (retval); \ +} \ + \ +static __inline int \ +atomic_cmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t cmpval, uint##WIDTH##_t newval) \ +{ \ + mips_sync(); \ + return (atomic_cmpset_##WIDTH(p, cmpval, newval)); \ } -static __inline int -atomic_fcmpset_rel_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) -{ - mips_sync(); - return (atomic_fcmpset_32(p, cmpval, newval)); +#define ATOMIC_FCMPSET_ACQ_REL(WIDTH) \ +static __inline int \ +atomic_fcmpset_acq_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t *cmpval, uint##WIDTH##_t newval) \ +{ \ + int retval; \ + \ + retval = atomic_fcmpset_##WIDTH(p, cmpval, newval); \ + mips_sync(); \ + return (retval); \ +} \ + \ +static __inline int \ +atomic_fcmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t *cmpval, uint##WIDTH##_t newval) \ +{ \ + mips_sync(); \ + return (atomic_fcmpset_##WIDTH(p, cmpval, newval)); \ } /* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +ATOMIC_CMPSET_ACQ_REL(8); +ATOMIC_CMPSET_ACQ_REL(16); +ATOMIC_CMPSET_ACQ_REL(32); +ATOMIC_FCMPSET_ACQ_REL(8); +ATOMIC_FCMPSET_ACQ_REL(16); +ATOMIC_FCMPSET_ACQ_REL(32); + +/* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. */ @@ -487,29 +510,7 @@ atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpv return ret; } -/* - * Atomically compare the value stored at *p with cmpval and if the - * two values are equal, update the value of *p with newval. Returns - * zero if the compare failed, nonzero otherwise. - */ static __inline int -atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) -{ - int retval; - - retval = atomic_cmpset_64(p, cmpval, newval); - mips_sync(); - return (retval); -} - -static __inline int -atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) -{ - mips_sync(); - return (atomic_cmpset_64(p, cmpval, newval)); -} - -static __inline int atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { int ret; @@ -532,23 +533,14 @@ atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cm return ret; } -static __inline int -atomic_fcmpset_acq_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) -{ - int retval; +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +ATOMIC_CMPSET_ACQ_REL(64); +ATOMIC_FCMPSET_ACQ_REL(64); - retval = atomic_fcmpset_64(p, cmpval, newval); - mips_sync(); - return (retval); -} - -static __inline int -atomic_fcmpset_rel_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) -{ - mips_sync(); - return (atomic_fcmpset_64(p, cmpval, newval)); -} - /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -611,6 +603,12 @@ atomic_thread_fence_seq_cst(void) #define atomic_subtract_char atomic_subtract_8 #define atomic_subtract_acq_char atomic_subtract_acq_8 #define atomic_subtract_rel_char atomic_subtract_rel_8 +#define atomic_cmpset_char atomic_cmpset_8 +#define atomic_cmpset_acq_char atomic_cmpset_acq_8 +#define atomic_cmpset_rel_char atomic_cmpset_rel_8 +#define atomic_fcmpset_char atomic_fcmpset_8 +#define atomic_fcmpset_acq_char atomic_fcmpset_acq_8 +#define atomic_fcmpset_rel_char atomic_fcmpset_rel_8 /* Operations on shorts. */ #define atomic_set_short atomic_set_16 @@ -625,6 +623,12 @@ atomic_thread_fence_seq_cst(void) #define atomic_subtract_short atomic_subtract_16 #define atomic_subtract_acq_short atomic_subtract_acq_16 #define atomic_subtract_rel_short atomic_subtract_rel_16 +#define atomic_cmpset_short atomic_cmpset_16 +#define atomic_cmpset_acq_short atomic_cmpset_acq_16 +#define atomic_cmpset_rel_short atomic_cmpset_rel_16 +#define atomic_fcmpset_short atomic_fcmpset_16 +#define atomic_fcmpset_acq_short atomic_fcmpset_acq_16 +#define atomic_fcmpset_rel_short atomic_fcmpset_rel_16 /* Operations on ints. */ #define atomic_set_int atomic_set_32 @@ -827,5 +831,7 @@ atomic_swap_long(volatile unsigned long *ptr, const un } #endif #define atomic_swap_ptr(ptr, value) atomic_swap_long((unsigned long *)(ptr), value) + +#include #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-all@freebsd.org Wed Oct 2 17:08:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F27D13445E; Wed, 2 Oct 2019 17:08:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k2dx13bNz3DgH; Wed, 2 Oct 2019 17:08:21 +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 07BD92E9EC; Wed, 2 Oct 2019 17:08:21 +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 x92H8K2v079821; Wed, 2 Oct 2019 17:08:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92H8KAX079820; Wed, 2 Oct 2019 17:08:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021708.x92H8KAX079820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 17:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353017 - head/sys/sparc64/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sparc64/include X-SVN-Commit-Revision: 353017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:08:21 -0000 Author: kevans Date: Wed Oct 2 17:08:20 2019 New Revision: 353017 URL: https://svnweb.freebsd.org/changeset/base/353017 Log: sparc64: use generic sub-word atomic *cmpset Most of this diff is refactoring to reduce duplication between the different acq_ and rel_ variants. Differential Revision: https://reviews.freebsd.org/D21822 Modified: head/sys/sparc64/include/atomic.h Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Wed Oct 2 17:07:59 2019 (r353016) +++ head/sys/sparc64/include/atomic.h Wed Oct 2 17:08:20 2019 (r353017) @@ -48,6 +48,11 @@ #define __ASI_ATOMIC ASI_P #endif +static __inline int atomic_cmpset_8(__volatile uint8_t *, uint8_t, uint8_t); +static __inline int atomic_fcmpset_8(__volatile uint8_t *, uint8_t *, uint8_t); +static __inline int atomic_cmpset_16(__volatile uint16_t *, uint16_t, uint16_t); +static __inline int atomic_fcmpset_16(__volatile uint16_t *, uint16_t *, uint16_t); + /* * Various simple arithmetic on memory which is atomic in the presence * of interrupts and multiple processors. See atomic(9) for details. @@ -356,6 +361,68 @@ ATOMIC_GEN(64, uint64_t *, uint64_t, uint64_t, 64); ATOMIC_GEN(ptr, uintptr_t *, uintptr_t, uintptr_t, 64); +#define ATOMIC_CMPSET_ACQ_REL(WIDTH) \ +static __inline int \ +atomic_cmpset_acq_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t cmpval, uint##WIDTH##_t newval) \ +{ \ + int retval; \ + \ + retval = atomic_cmpset_##WIDTH(p, cmpval, newval); \ + mb(); \ + return (retval); \ +} \ + \ +static __inline int \ +atomic_cmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t cmpval, uint##WIDTH##_t newval) \ +{ \ + mb(); \ + return (atomic_cmpset_##WIDTH(p, cmpval, newval)); \ +} + +#define ATOMIC_FCMPSET_ACQ_REL(WIDTH) \ +static __inline int \ +atomic_fcmpset_acq_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t *cmpval, uint##WIDTH##_t newval) \ +{ \ + int retval; \ + \ + retval = atomic_fcmpset_##WIDTH(p, cmpval, newval); \ + mb(); \ + return (retval); \ +} \ + \ +static __inline int \ +atomic_fcmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ + uint##WIDTH##_t *cmpval, uint##WIDTH##_t newval) \ +{ \ + mb(); \ + return (atomic_fcmpset_##WIDTH(p, cmpval, newval)); \ +} + +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +ATOMIC_CMPSET_ACQ_REL(8); +ATOMIC_CMPSET_ACQ_REL(16); +ATOMIC_FCMPSET_ACQ_REL(8); +ATOMIC_FCMPSET_ACQ_REL(16); + +#define atomic_cmpset_char atomic_cmpset_8 +#define atomic_cmpset_acq_char atomic_cmpset_acq_8 +#define atomic_cmpset_rel_char atomic_cmpset_rel_8 +#define atomic_fcmpset_acq_char atomic_fcmpset_acq_8 +#define atomic_fcmpset_rel_char atomic_fcmpset_rel_8 + +#define atomic_cmpset_short atomic_cmpset_16 +#define atomic_cmpset_acq_short atomic_cmpset_acq_16 +#define atomic_cmpset_rel_short atomic_cmpset_rel_16 +#define atomic_fcmpset_acq_short atomic_fcmpset_acq_16 +#define atomic_fcmpset_rel_short atomic_fcmpset_rel_16 + #define atomic_fetchadd_int atomic_add_int #define atomic_fetchadd_32 atomic_add_32 #define atomic_fetchadd_long atomic_add_long @@ -373,5 +440,7 @@ ATOMIC_GEN(ptr, uintptr_t *, uintptr_t, uintptr_t, 64) #undef atomic_st #undef atomic_st_acq #undef atomic_st_rel + +#include #endif /* !_MACHINE_ATOMIC_H_ */ From owner-svn-src-all@freebsd.org Wed Oct 2 17:15:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2DE313476C; Wed, 2 Oct 2019 17:15: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k2pM3sFHz3F6W; Wed, 2 Oct 2019 17:15: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 638D82EBC1; Wed, 2 Oct 2019 17:15:39 +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 x92HFdjP085551; Wed, 2 Oct 2019 17:15:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92HFdMH085550; Wed, 2 Oct 2019 17:15:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021715.x92HFdMH085550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 17:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353018 - head/usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/clang X-SVN-Commit-Revision: 353018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:15:39 -0000 Author: kevans Date: Wed Oct 2 17:15:38 2019 New Revision: 353018 URL: https://svnweb.freebsd.org/changeset/base/353018 Log: clang: use -mxgot for 32-bit mips Various bits in usr.bin/clang/* will fail to compile without -mxgot due to truncated relocations. -mxgot entails a speed penalty, but I suspect we don't care as much about compiler performance in 32-bit mips land. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D21698 Modified: head/usr.bin/clang/Makefile.inc Modified: head/usr.bin/clang/Makefile.inc ============================================================================== --- head/usr.bin/clang/Makefile.inc Wed Oct 2 17:08:20 2019 (r353017) +++ head/usr.bin/clang/Makefile.inc Wed Oct 2 17:15:38 2019 (r353018) @@ -12,4 +12,9 @@ DEBUG_FILES_CFLAGS= -gline-tables-only DEBUG_FILES_CFLAGS= -g1 .endif +.if ${MACHINE_ARCH:Mmips*} && ${MACHINE_ARCH:Mmips64*} == "" +CFLAGS+= -mxgot +CXXFLAGS+= -mxgot +.endif + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Wed Oct 2 17:18:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C32E21349D8; Wed, 2 Oct 2019 17:18: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k2sR4vSfz3FWg; Wed, 2 Oct 2019 17:18: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 8C7DB2EBD6; Wed, 2 Oct 2019 17:18:19 +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 x92HIJFv085721; Wed, 2 Oct 2019 17:18:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92HIJ8o085719; Wed, 2 Oct 2019 17:18:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910021718.x92HIJ8o085719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 2 Oct 2019 17:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353019 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 353019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:18:19 -0000 Author: kevans Date: Wed Oct 2 17:18:18 2019 New Revision: 353019 URL: https://svnweb.freebsd.org/changeset/base/353019 Log: Override the TLS model when building mips64 binaries and static libraries GCC uses "dynamic" TLS models when -fpic or -fPIC is explicitly specified on the command line (which is only true for shared libraries). It uses "static" (or "exec") TLS models otherwise. In particular, GCC does _not_ use dynamic TLS models when PIC is implicitly enabled (which it is on MIPS), only if a PIC flag is explicitly provided. llvm uses "dynamic" TLS models if PIC is enabled either via a PIC flag or if it is implicily enabled (as on MIPS64). This means that llvm on MIPS64 always uses "dynamic" TLS models. However, dynamic TLS models do not work for static binaries and libraries as the __tls_get_addr function they invoke is only defined in rtld. Written by: jhb Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D21699 Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Oct 2 17:15:38 2019 (r353018) +++ head/share/mk/bsd.lib.mk Wed Oct 2 17:18:18 2019 (r353019) @@ -92,6 +92,12 @@ CXXFLAGS+= ${DEBUG_FILES_CFLAGS} CTFFLAGS+= -g .endif +# clang currently defaults to dynamic TLS for mips64 object files without -fPIC +.if ${MACHINE_ARCH:Mmips64*} && ${COMPILER_TYPE} == "clang" +STATIC_CFLAGS+= -ftls-model=initial-exec +STATIC_CXXFLAGS+= -ftls-model=initial-exec +.endif + .include # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Oct 2 17:15:38 2019 (r353018) +++ head/share/mk/bsd.prog.mk Wed Oct 2 17:18:18 2019 (r353019) @@ -82,6 +82,11 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} LDFLAGS+= -static .endif +# clang currently defaults to dynamic TLS for mips64 binaries +.if ${MACHINE_ARCH:Mmips64*} && ${COMPILER_TYPE} == "clang" +CFLAGS+= -ftls-model=initial-exec +.endif + .if ${MK_DEBUG_FILES} != "no" PROG_FULL=${PROG}.full # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory From owner-svn-src-all@freebsd.org Wed Oct 2 17:44:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE29213528F; Wed, 2 Oct 2019 17:44:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k3RN4BBrz3H1J; Wed, 2 Oct 2019 17:44:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DE093CEFC; Wed, 2 Oct 2019 17:44:15 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1d.0.190908 Date: Wed, 02 Oct 2019 10:44:12 -0700 Subject: Re: svn commit: r352925 - head/sys/dev/xen/control From: Ravi Pokala To: Roger Pau =?UTF-8?B?TW9ubsOp?= , Ravi Pokala CC: , , Message-ID: Thread-Topic: svn commit: r352925 - head/sys/dev/xen/control References: <201910010821.x918LfOg005983@repo.freebsd.org> <5E0C7E54-2657-4E70-8A18-84C4EE29D4FA@panasas.com> <20191002075302.caak27hnk5vlpqgr@Air-de-Roger> In-Reply-To: <20191002075302.caak27hnk5vlpqgr@Air-de-Roger> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 17:44:16 -0000 =EF=BB=BF-----Original Message----- From: Roger Pau Monn=C3=A9 Date: 2019-10-02, Wednesday at 00:53 To: Ravi Pokala Cc: , , Subject: Re: svn commit: r352925 - head/sys/dev/xen/control On Tue, Oct 01, 2019 at 06:42:14PM -0700, Ravi Pokala wrote: > Hi Roger, >=20 > If I'm understanding this diff correctly, all of (poweroff, reboot, s= uspend) will use the common string "shutdown", rather than an event-specific= string. Is that what we want? =20 I think there's some misunderstanding here. All power control events use the same xenstore node (~/control/shutdown), but the command read from it is different depending on the requested action (poweroff, reboot, halt...). Ah! Yes indeed, that was a misunderstanding on my part. I thought "shutdown= " was the command text, rather than a component of the path containing the c= ommand. See [0] for a slightly more detailed description of the xenstore node. =20 Note that this commit doesn't change any of this logic, it just clears the contents of ~/control/shutdown (by writing "") so the toolstack knows FreeBSD has acknowledged the request and it's processing it. Yes, that all makes sense. Thanks for clarifying! -Ravi (rpokala@) Roger. =20 [0] http://xenbits.xen.org/docs/4.12-testing/misc/xenstore-paths.html#p= latform-feature-and-control-paths =20 From owner-svn-src-all@freebsd.org Wed Oct 2 19:05:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C75C136E62; Wed, 2 Oct 2019 19:05:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k5Df4JV4z3Mrh; Wed, 2 Oct 2019 19:05:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f65.google.com with SMTP id q1so59549592ion.1; Wed, 02 Oct 2019 12:05:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LP1A0oWnAiRFWn3X3z2r6lgfILzYQ/G3TCAXwX1UwL8=; b=HPT5n25cNDNv2pfT0+6dSEIvMKUkDCHLexuioJ534arNDMJN6VOAyPkF5+Anuq17Ms Ipn4c3r+889dPMVx9H/VY7B3lc+2gRq/nuySuEBCj61xyF7f8wRhsLoSt88bcFnb/6e/ 7dogLZhv1HkB5CRK+wQwxxLOeXRGXiR56Eq61y7xk3Kvi/oq6q8cHn4Z/YzELBm386zz mT1VJwRixWFaHdStEBVsOF/OP1tEhtF4jnBePLPuA5UnXZRDLEYyRb/ASlqgLf84c5v9 Bs4/cZ2xm3RJkmRljAe3Ik+AHQsNGMQY5TOC2KfF454MJtoFaf7tgYS41TpyZrQeNdbY KrDg== X-Gm-Message-State: APjAAAX24TDz1U+2FHSNkrDNnj4K/3sW9mp90A7UaWUfTl8Xay8CcDLk IH9+t8nb3JQLIPRlymHL1zcPFyTMGELhUS5NB77+YQ== X-Google-Smtp-Source: APXvYqxMwB265nq1rlR8uawjZAKFvnyZ8vxzOBnuKZwW7fsJVe4WKPsgxCrXU76PblQepBoTv2IU7nmjqvK9CuJ2IG0= X-Received: by 2002:a6b:3806:: with SMTP id f6mr4550252ioa.120.1570043104142; Wed, 02 Oct 2019 12:05:04 -0700 (PDT) MIME-Version: 1.0 References: <201909161407.x8GE7U4M010319@repo.freebsd.org> In-Reply-To: <201909161407.x8GE7U4M010319@repo.freebsd.org> From: Ed Maste Date: Wed, 2 Oct 2019 15:04:51 -0400 Message-ID: Subject: Re: svn commit: r352396 - stable/12/sys/arm64/arm64 To: Andrew Turner Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46k5Df4JV4z3Mrh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.65 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.16)[ip: (-0.33), ipnet: 209.85.128.0/17(-3.27), asn: 15169(-2.16), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[65.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[65.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 19:05:07 -0000 On Mon, 16 Sep 2019 at 10:07, Andrew Turner wrote: > > Author: andrew > Date: Mon Sep 16 14:07:30 2019 > New Revision: 352396 > URL: https://svnweb.freebsd.org/changeset/base/352396 > > Log: > MFC r343876: > > Add missing data barriers after storeing a new valid pagetable entry. Will you merge this to releng/12.0? From owner-svn-src-all@freebsd.org Wed Oct 2 19:06:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1DA8136EEF; Wed, 2 Oct 2019 19:06:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k5Gg4P1vz3N0L; Wed, 2 Oct 2019 19:06:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f43.google.com with SMTP id u8so59485375iom.5; Wed, 02 Oct 2019 12:06:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+C1FLwRIQhzR0hjCKzf/EwO1L0JfrNwtVsWPB+AY9qw=; b=S6XIhDTs1A6lZyURkAy7LHleS9mXEL7FwQV3/evrzf24OEWeHF63j7KkNt8JI0WdqZ /HbN97jZXQpJRw3oPum0TN30BMh+IeHaYcORGh3KiClwInnDMqJYVoXZ7TJpqwKNnAEb XqYzgN52WjhdctkvjhKjBSRrWCNd1BWdUnXIK5VHZuk8K5EKrYB1EvUI3YCAaEFr7Jfu 6zLTxS5PXTojcxZCu4bDwU08+XlmXmZVEaHhPtoiroqwYCNEzfrIkYzusLpiOdDAgpYP zKY/BU4sb7wS+r/iMzMPVplJLKVj5TXnfpdMlyMSACaYPsUgHtYGW9f6z5YHXBjfwG7r zyww== X-Gm-Message-State: APjAAAWJhLYmFD6qtMQ1mlAfiXjWPiHCRL+45IH4NVYtgxiZEadRH6/X gzfGO1SzH9+O9NYUmLukWHCLl7wdWfc+1oTfFugbvw== X-Google-Smtp-Source: APXvYqyKJ4KQDedZ2PdCmM80Yat1sjHphR4ksAySTfMc9zO63EwTiNQGla2JfUXYWCJb594fMwvWH/EYGZQrekTrt/A= X-Received: by 2002:a6b:254:: with SMTP id 81mr4590099ioc.17.1570043210154; Wed, 02 Oct 2019 12:06:50 -0700 (PDT) MIME-Version: 1.0 References: <201909161407.x8GE7U4M010319@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Wed, 2 Oct 2019 15:06:38 -0400 Message-ID: Subject: Re: svn commit: r352396 - stable/12/sys/arm64/arm64 To: Andrew Turner Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46k5Gg4P1vz3N0L X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-1.96)[ip: (-4.32), ipnet: 209.85.128.0/17(-3.27), asn: 15169(-2.16), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[43.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[43.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 19:06:52 -0000 On Wed, 2 Oct 2019 at 15:04, Ed Maste wrote: > > Will you merge this to releng/12.0? Oops, I meant 12.1, and it's already there. From owner-svn-src-all@freebsd.org Wed Oct 2 19:13:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 822161371D8; Wed, 2 Oct 2019 19:13:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k5QS2wfqz3NWl; Wed, 2 Oct 2019 19:13:36 +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 4856F20B; Wed, 2 Oct 2019 19:13:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92JDaMV057651; Wed, 2 Oct 2019 19:13:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92JDaa8057650; Wed, 2 Oct 2019 19:13:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910021913.x92JDaa8057650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 2 Oct 2019 19:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353020 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 353020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 19:13:36 -0000 Author: cem Date: Wed Oct 2 19:13:35 2019 New Revision: 353020 URL: https://svnweb.freebsd.org/changeset/base/353020 Log: nvdimm: Fix error path mis-free Regression introduced in r343629 when malloc result was renamed from spa to spa_mapping and the 'spa' name was instead used to iterate a table, but the free() target was not updated. Reviewed by: kib, scottph Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21871 Modified: head/sys/dev/nvdimm/nvdimm_acpi.c Modified: head/sys/dev/nvdimm/nvdimm_acpi.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_acpi.c Wed Oct 2 17:18:18 2019 (r353019) +++ head/sys/dev/nvdimm/nvdimm_acpi.c Wed Oct 2 19:13:35 2019 (r353020) @@ -141,7 +141,7 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, A error = nvdimm_spa_init(spa_mapping, *spa, spa_type); if (error != 0) { nvdimm_spa_fini(spa_mapping); - free(spa, M_NVDIMM_ACPI); + free(spa_mapping, M_NVDIMM_ACPI); break; } nvdimm_create_namespaces(spa_mapping, nfitbl); From owner-svn-src-all@freebsd.org Wed Oct 2 21:01:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80A631391BB; Wed, 2 Oct 2019 21:01:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k7pr2rGyz4103; Wed, 2 Oct 2019 21:01:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4516515A9; Wed, 2 Oct 2019 21:01: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 x92L1O4Q020821; Wed, 2 Oct 2019 21:01:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92L1OSM020820; Wed, 2 Oct 2019 21:01:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910022101.x92L1OSM020820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 2 Oct 2019 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353021 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 353021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 21:01:24 -0000 Author: emaste Date: Wed Oct 2 21:01:23 2019 New Revision: 353021 URL: https://svnweb.freebsd.org/changeset/base/353021 Log: simplify path handling in sysctl_try_reclaim_vnode MAXPATHLEN / PATH_MAX includes space for the terminating NUL, and namei verifies the presence of the NUL. Thus there is no need to increase the buffer size here. The sysctl passes the string excluding the NUL, so req->newlen equal to PATH_MAX is too long. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21876 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Oct 2 19:13:35 2019 (r353020) +++ head/sys/kern/vfs_subr.c Wed Oct 2 21:01:23 2019 (r353021) @@ -351,10 +351,10 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) if (req->newptr == NULL) return (EINVAL); - if (req->newlen > PATH_MAX) + if (req->newlen >= PATH_MAX) return (E2BIG); - buf = malloc(PATH_MAX + 1, M_TEMP, M_WAITOK); + buf = malloc(PATH_MAX, M_TEMP, M_WAITOK); error = SYSCTL_IN(req, buf, req->newlen); if (error != 0) goto out; From owner-svn-src-all@freebsd.org Wed Oct 2 21:35:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC3F4139D5F; Wed, 2 Oct 2019 21:35:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k8ZM4JKGz42lP; Wed, 2 Oct 2019 21:35:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77B441B7E; Wed, 2 Oct 2019 21:35:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92LZd8d043427; Wed, 2 Oct 2019 21:35:39 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92LZdXr043426; Wed, 2 Oct 2019 21:35:39 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201910022135.x92LZdXr043426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 2 Oct 2019 21:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353022 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 353022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 21:35:39 -0000 Author: cperciva Date: Wed Oct 2 21:35:39 2019 New Revision: 353022 URL: https://svnweb.freebsd.org/changeset/base/353022 Log: Switch EC2 AMIs from using the dual-dhclient script to using the new dual-dhclient-daemon daemon. This makes it possible to stop/restart the dhclients. MFC after: 1 month Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Wed Oct 2 21:01:23 2019 (r353021) +++ head/release/tools/ec2.conf Wed Oct 2 21:35:39 2019 (r353022) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. From owner-svn-src-all@freebsd.org Wed Oct 2 21:49:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CACD013A337; Wed, 2 Oct 2019 21:49:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k8tW51b7z43SP; Wed, 2 Oct 2019 21:49:39 +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 8B62D1D3D; Wed, 2 Oct 2019 21:49:39 +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 x92LndfV049722; Wed, 2 Oct 2019 21:49:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92LndAv049721; Wed, 2 Oct 2019 21:49:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201910022149.x92LndAv049721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Oct 2019 21:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353023 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 353023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 21:49:39 -0000 Author: jhb Date: Wed Oct 2 21:49:39 2019 New Revision: 353023 URL: https://svnweb.freebsd.org/changeset/base/353023 Log: Fix the EMBEDFS_FORMAT helper variable for riscv64. It was defined with the wrong MACHINE_ARCH previously. This permits using an MFS image without defining MD_ROOT_SIZE which has various benefits (one being that the build is able to treat the MFS image as a dependency and properly re-link the kernel with the new image when building with NO_CLEAN). MFC after: 2 weeks Sponsored by: DARPA Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Oct 2 21:35:39 2019 (r353022) +++ head/sys/conf/kern.pre.mk Wed Oct 2 21:49:39 2019 (r353023) @@ -322,7 +322,7 @@ EMBEDFS_FORMAT.mips?= elf32-tradbigmips EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips EMBEDFS_FORMAT.mips64?= elf64-tradbigmips EMBEDFS_FORMAT.mips64el?= elf64-tradlittlemips -EMBEDFS_FORMAT.riscv?= elf64-littleriscv +EMBEDFS_FORMAT.riscv64?= elf64-littleriscv .endif .endif From owner-svn-src-all@freebsd.org Wed Oct 2 22:08:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1183513A8E3; Wed, 2 Oct 2019 22:08:15 +0000 (UTC) (envelope-from chuq@chuq.com) Received: from vc.chuq.com (vc.chuq.com [166.84.7.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Chuck Silvers", Issuer "Chuck Silvers" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46k9Hy6d88z44Jx; Wed, 2 Oct 2019 22:08:14 +0000 (UTC) (envelope-from chuq@chuq.com) Received: from spathi.chuq.com (unknown [24.4.24.36]) by vc169.vc.panix.com (Postfix) with ESMTPS id 176933B5D6B; Wed, 2 Oct 2019 15:08:08 -0700 (PDT) (envelope-from chuq@chuq.com) Received: by spathi.chuq.com (Postfix, from userid 1022) id 4EF2D18ABA1A; Wed, 2 Oct 2019 15:08:07 -0700 (PDT) Date: Wed, 2 Oct 2019 15:08:07 -0700 From: Chuck Silvers To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352312 - in head: lib/geom/nop sys/geom/nop Message-ID: <20191002220807.GA3971@spathi.chuq.com> References: <201909132303.x8DN3uw3026373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 46k9Hy6d88z44Jx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 22:08:15 -0000 On Wed, Oct 02, 2019 at 08:11:57AM -0600, Alan Somers wrote: > On Fri, Sep 13, 2019 at 5:04 PM Chuck Silvers wrote: > > > Author: chs > > Date: Fri Sep 13 23:03:56 2019 > > New Revision: 352312 > > URL: https://svnweb.freebsd.org/changeset/base/352312 > > > > Log: > > Add a "count_until_fail" option to gnop, which says to start failing > > I/O requests after the given number have been allowed though. > > > > Approved by: imp (mentor) > > Reviewed by: rpokala kib 0mp mckusick > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D21593 > > > > Modified: > > head/lib/geom/nop/geom_nop.c > > head/lib/geom/nop/gnop.8 > > head/sys/geom/nop/g_nop.c > > head/sys/geom/nop/g_nop.h > > > > This patch introduces a backwards-compatibility bug. On a system with a > post-352312 kernel but a pre-352312 userland, the gnop command will always > fail with the error "gnop: Missing count_until_fail argument". > -Alan Thanks for pointing this out, I'll see about fixing it right away. -Chuck From owner-svn-src-all@freebsd.org Wed Oct 2 23:06:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F8FA13B872; Wed, 2 Oct 2019 23:06:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kBZx6hZWz46gv; Wed, 2 Oct 2019 23:06:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C60F52B35; Wed, 2 Oct 2019 23:06:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x92N6HEK096243; Wed, 2 Oct 2019 23:06:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92N6HhF096242; Wed, 2 Oct 2019 23:06:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201910022306.x92N6HhF096242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 2 Oct 2019 23:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353024 - head/usr.sbin/daemon X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/daemon X-SVN-Commit-Revision: 353024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 23:06:18 -0000 Author: ian Date: Wed Oct 2 23:06:17 2019 New Revision: 353024 URL: https://svnweb.freebsd.org/changeset/base/353024 Log: Clarify how the -f option for daemon(8) interacts with other options related to redirecting stdout and stderr. Modified: head/usr.sbin/daemon/daemon.8 Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Wed Oct 2 21:49:39 2019 (r353023) +++ head/usr.sbin/daemon/daemon.8 Wed Oct 2 23:06:17 2019 (r353024) @@ -63,6 +63,11 @@ Change the current working directory to the root .It Fl f Redirect standard input, standard output and standard error to .Pa /dev/null . +When this option is used together with any of the options related to file +or syslog output, the standard file descriptors are first redirected to +.Pa /dev/null , +then stdout and/or stderr is redirected to a file or to syslog as +specified by the other options. .It Fl S Enable syslog output. This is implicitly applied if other syslog parameters are provided. From owner-svn-src-all@freebsd.org Wed Oct 2 23:19:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D75713BB96; Wed, 2 Oct 2019 23:19:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kBtH2mT6z47D1; Wed, 2 Oct 2019 23:19:35 +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 43A0A2D01; Wed, 2 Oct 2019 23:19:35 +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 x92NJZ8V002133; Wed, 2 Oct 2019 23:19:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x92NJZ73002132; Wed, 2 Oct 2019 23:19:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201910022319.x92NJZ73002132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 2 Oct 2019 23:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353025 - head/usr.sbin/daemon X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/daemon X-SVN-Commit-Revision: 353025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Oct 2019 23:19:35 -0000 Author: ian Date: Wed Oct 2 23:19:34 2019 New Revision: 353025 URL: https://svnweb.freebsd.org/changeset/base/353025 Log: Bump .Dd for earlier update (should have been part of r353024). Modified: head/usr.sbin/daemon/daemon.8 Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Wed Oct 2 23:06:17 2019 (r353024) +++ head/usr.sbin/daemon/daemon.8 Wed Oct 2 23:19:34 2019 (r353025) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2019 +.Dd October 2, 2019 .Dt DAEMON 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu Oct 3 02:32:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E361BFC161; Thu, 3 Oct 2019 02:32:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kH9N6JtXz4KvD; Thu, 3 Oct 2019 02:32:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD3D35586; Thu, 3 Oct 2019 02:32:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x932Wuwj020175; Thu, 3 Oct 2019 02:32:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x932WusU020172; Thu, 3 Oct 2019 02:32:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910030232.x932WusU020172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 3 Oct 2019 02:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353026 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 353026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 02:32:56 -0000 Author: glebius Date: Thu Oct 3 02:32:55 2019 New Revision: 353026 URL: https://svnweb.freebsd.org/changeset/base/353026 Log: - Remove the compile time limit for number of links a ng_bridge node can handle. Instead using an array on node private data, use per-hook private data. - Use NG_NODE_FOREACH_HOOK() to traverse through hooks instead of array. PR: 240787 Submitted by: Lutz Donnerhacke Differential Revision: https://reviews.freebsd.org/D21803 Modified: head/share/man/man4/ng_bridge.4 head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_bridge.h Modified: head/share/man/man4/ng_bridge.4 ============================================================================== --- head/share/man/man4/ng_bridge.4 Wed Oct 2 23:19:34 2019 (r353025) +++ head/share/man/man4/ng_bridge.4 Thu Oct 3 02:32:55 2019 (r353026) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2010 +.Dd October 2, 2019 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -76,9 +76,7 @@ Processing of IP packets via the .Xr ipfirewall 4 mechanism on a per-link basis is not yet implemented. .Sh HOOKS -This node type supports up to -.Dv NG_BRIDGE_MAX_LINKS -hooks. +This node type supports an unlimited number of hooks. Each connected hook represents a bridged link. The hooks are named .Dv link0 , @@ -106,7 +104,6 @@ as an argument: .Bd -literal -offset 0n /* Node configuration structure */ struct ng_bridge_config { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ uint32_t loopTimeout; /* link loopback mute time */ uint32_t maxStaleness; /* max host age before nuking */ @@ -114,11 +111,6 @@ struct ng_bridge_config { }; .Ed .Pp -The -.Dv ipfw -array enables -.Xr ipfirewall 4 -processing of IP packets received on the corresponding links. The .Dv debugLevel field sets the debug level on the node. Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Wed Oct 2 23:19:34 2019 (r353025) +++ head/sys/netgraph/ng_bridge.c Thu Oct 3 02:32:55 2019 (r353026) @@ -1,7 +1,3 @@ -/* - * ng_bridge.c - */ - /*- * Copyright (c) 2000 Whistle Communications, Inc. * All rights reserved. @@ -101,7 +97,6 @@ struct ng_bridge_link { /* Per-node private data */ struct ng_bridge_private { struct ng_bridge_bucket *tab; /* hash table bucket array */ - struct ng_bridge_link *links[NG_BRIDGE_MAX_LINKS]; struct ng_bridge_config conf; /* node configuration */ node_p node; /* netgraph node */ u_int numHosts; /* num entries in table */ @@ -132,9 +127,9 @@ static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); -static int ng_bridge_put(priv_p priv, const u_char *addr, int linkNum); +static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); -static void ng_bridge_remove_hosts(priv_p priv, int linkNum); +static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); static const char *ng_bridge_nodename(node_p node); @@ -142,9 +137,6 @@ static const char *ng_bridge_nodename(node_p node); static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -/* Store each hook's link number in the private field */ -#define LINK_NUM(hook) (*(u_int16_t *)(&(hook)->private)) - /* Compare Ethernet addresses using 32 and 16 bit words instead of bytewise */ #define ETHER_EQUAL(a,b) (((const u_int32_t *)(a))[0] \ == ((const u_int32_t *)(b))[0] \ @@ -200,16 +192,8 @@ static const struct ng_parse_type ng_bridge_host_ary_t }; /* Parse type for struct ng_bridge_config */ -static const struct ng_parse_fixedarray_info ng_bridge_ipfwary_type_info = { - &ng_parse_uint8_type, - NG_BRIDGE_MAX_LINKS -}; -static const struct ng_parse_type ng_bridge_ipfwary_type = { - &ng_parse_fixedarray_type, - &ng_bridge_ipfwary_type_info -}; static const struct ng_parse_struct_field ng_bridge_config_type_fields[] - = NG_BRIDGE_CONFIG_TYPE_INFO(&ng_bridge_ipfwary_type); + = NG_BRIDGE_CONFIG_TYPE_INFO; static const struct ng_parse_type ng_bridge_config_type = { &ng_parse_struct_type, &ng_bridge_config_type_fields @@ -352,26 +336,30 @@ ng_bridge_newhook(node_p node, hook_p hook, const char const priv_p priv = NG_NODE_PRIVATE(node); /* Check for a link hook */ - if (strncmp(name, NG_BRIDGE_HOOK_LINK_PREFIX, - strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) == 0) { - const char *cp; - char *eptr; - u_long linkNum; + if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; - cp = name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX); - if (!isdigit(*cp) || (cp[0] == '0' && cp[1] != '\0')) + /* primitive parsing */ + linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), + NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, + linkNum); + if (strcmp(linkName, name) != 0) return (EINVAL); - linkNum = strtoul(cp, &eptr, 10); - if (*eptr != '\0' || linkNum >= NG_BRIDGE_MAX_LINKS) - return (EINVAL); - if (priv->links[linkNum] != NULL) - return (EISCONN); - priv->links[linkNum] = malloc(sizeof(*priv->links[linkNum]), - M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO); - if (priv->links[linkNum] == NULL) + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, + M_WAITOK|M_ZERO); + if (link == NULL) return (ENOMEM); - priv->links[linkNum]->hook = hook; - NG_HOOK_SET_PRIVATE(hook, (void *)linkNum); + link->hook = hook; + NG_HOOK_SET_PRIVATE(hook, link); priv->numLinks++; return (0); } @@ -384,6 +372,17 @@ ng_bridge_newhook(node_p node, hook_p hook, const char * Receive a control message */ static int +ng_bridge_reset_link(hook_p hook, int ret) +{ + link_p priv = NG_HOOK_PRIVATE(hook); + + priv->loopCount = 0; + bzero(&priv->stats, sizeof(priv->stats)); + return (ret); +} + + +static int ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) { const priv_p priv = NG_NODE_PRIVATE(node); @@ -412,7 +411,6 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last case NGM_BRIDGE_SET_CONFIG: { struct ng_bridge_config *conf; - int i; if (msg->header.arglen != sizeof(struct ng_bridge_config)) { @@ -421,48 +419,41 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last } conf = (struct ng_bridge_config *)msg->data; priv->conf = *conf; - for (i = 0; i < NG_BRIDGE_MAX_LINKS; i++) - priv->conf.ipfw[i] = !!priv->conf.ipfw[i]; break; } case NGM_BRIDGE_RESET: { - int i; + hook_p rethook; /* Flush all entries in the hash table */ - ng_bridge_remove_hosts(priv, -1); + ng_bridge_remove_hosts(priv, NULL); /* Reset all loop detection counters and stats */ - for (i = 0; i < NG_BRIDGE_MAX_LINKS; i++) { - if (priv->links[i] == NULL) - continue; - priv->links[i]->loopCount = 0; - bzero(&priv->links[i]->stats, - sizeof(priv->links[i]->stats)); - } + NG_NODE_FOREACH_HOOK(node, ng_bridge_reset_link, 1, rethook); break; } case NGM_BRIDGE_GET_STATS: case NGM_BRIDGE_CLR_STATS: case NGM_BRIDGE_GETCLR_STATS: { - struct ng_bridge_link *link; - int linkNum; - + hook_p hook; + link_p link; + char linkName[NG_HOOKSIZ]; + /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - linkNum = *((u_int32_t *)msg->data); - if (linkNum < 0 || linkNum >= NG_BRIDGE_MAX_LINKS) { - error = EINVAL; - break; - } - if ((link = priv->links[linkNum]) == NULL) { + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, + *((u_int32_t *)msg->data)); + + if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; break; } + link = NG_HOOK_PRIVATE(hook); /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { @@ -494,8 +485,17 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last ary = (struct ng_bridge_host_ary *)resp->data; ary->numHosts = priv->numHosts; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) - ary->hosts[i++] = hent->host; + SLIST_FOREACH(hent, &priv->tab[bucket], next) { + memcpy(ary->hosts[i].addr, + hent->host.addr, + sizeof(ary->hosts[i].addr)); + ary->hosts[i].age = hent->host.age; + ary->hosts[i].staleness = hent->host.staleness; + strncpy(ary->hosts[i].hook, + NG_HOOK_NAME(hent->host.link->hook), + sizeof(ary->hosts[i].hook)); + i++; + } } break; } @@ -523,64 +523,117 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last /* * Receive data on a hook */ +struct ng_bridge_send_ctx { + link_p foundFirst, incoming; + struct mbuf * m; + int manycast, error; +}; + static int +ng_bridge_send_ctx(hook_p dst, struct ng_bridge_send_ctx * ctx) +{ + link_p destLink = NG_HOOK_PRIVATE(dst); + struct mbuf *m2 = NULL; + int error = 0; + + /* Skip incoming link */ + if (destLink == ctx->incoming) { + return (1); + } + + if (ctx->foundFirst == NULL) { + /* + * This is the first usable link we have found. + * Reserve it for the originals. + * If we never find another we save a copy. + */ + ctx->foundFirst = destLink; + return (1); + } + + /* + * It's usable link but not the reserved (first) one. + * Copy mbuf info for sending. + */ + m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ + if (m2 == NULL) { + ctx->incoming->stats.memoryFailures++; + ctx->error = ENOBUFS; + return (0); /* abort loop */ + } + + + /* Update stats */ + destLink->stats.xmitPackets++; + destLink->stats.xmitOctets += m2->m_pkthdr.len; + switch (ctx->manycast) { + default: /* unknown unicast */ + break; + case 1: /* multicast */ + destLink->stats.xmitMulticasts++; + break; + case 2: /* broadcast */ + destLink->stats.xmitBroadcasts++; + break; + } + + /* Send packet */ + NG_SEND_DATA_ONLY(error, destLink->hook, m2); + if(error) + ctx->error = error; + return (1); +} + +static int ng_bridge_rcvdata(hook_p hook, item_p item) { const node_p node = NG_HOOK_NODE(hook); const priv_p priv = NG_NODE_PRIVATE(node); struct ng_bridge_host *host; - struct ng_bridge_link *link; struct ether_header *eh; - int error = 0, linkNum, linksSeen; - int manycast; - struct mbuf *m; - struct ng_bridge_link *firstLink; + struct ng_bridge_send_ctx ctx = { 0 }; + hook_p ret; - NGI_GET_M(item, m); - /* Get link number */ - linkNum = (intptr_t)NG_HOOK_PRIVATE(hook); - KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __func__, linkNum)); - link = priv->links[linkNum]; - KASSERT(link != NULL, ("%s: link%d null", __func__, linkNum)); + NGI_GET_M(item, ctx.m); + ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ - if (m->m_pkthdr.len < ETHER_HDR_LEN) { - link->stats.recvRunts++; + if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { + ctx.incoming->stats.recvRunts++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (EINVAL); } - if (m->m_len < ETHER_HDR_LEN && !(m = m_pullup(m, ETHER_HDR_LEN))) { - link->stats.memoryFailures++; + if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { + ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); return (ENOBUFS); } - eh = mtod(m, struct ether_header *); + eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - link->stats.recvInvalid++; + ctx.incoming->stats.recvInvalid++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (EINVAL); } /* Is link disabled due to a loopback condition? */ - if (link->loopCount != 0) { - link->stats.loopDrops++; + if (ctx.incoming->loopCount != 0) { + ctx.incoming->stats.loopDrops++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - link->stats.recvPackets++; - link->stats.recvOctets += m->m_pkthdr.len; - if ((manycast = (eh->ether_dhost[0] & 1)) != 0) { + ctx.incoming->stats.recvPackets++; + ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - link->stats.recvBroadcasts++; - manycast = 2; + ctx.incoming->stats.recvBroadcasts++; + ctx.manycast = 2; } else - link->stats.recvMulticasts++; + ctx.incoming->stats.recvMulticasts++; } /* Look up packet's source Ethernet address in hashtable */ @@ -590,7 +643,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->staleness = 0; /* Did host jump to a different link? */ - if (host->linkNum != linkNum) { + if (host->link != ctx.incoming) { /* * If the host's old link was recently established @@ -601,7 +654,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Log the problem */ if (priv->conf.debugLevel >= 2) { - struct ifnet *ifp = m->m_pkthdr.rcvif; + struct ifnet *ifp = ctx.m->m_pkthdr.rcvif; char suffix[32]; if (ifp != NULL) @@ -616,28 +669,28 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Mark link as linka non grata */ - link->loopCount = priv->conf.loopTimeout; - link->stats.loopDetects++; + ctx.incoming->loopCount = priv->conf.loopTimeout; + ctx.incoming->stats.loopDetects++; /* Forget all hosts on this link */ - ng_bridge_remove_hosts(priv, linkNum); + ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - link->stats.loopDrops++; + ctx.incoming->stats.loopDrops++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ } /* Move host over to new link */ - host->linkNum = linkNum; + host->link = ctx.incoming; host->age = 0; } } else { - if (!ng_bridge_put(priv, eh->ether_shost, linkNum)) { - link->stats.memoryFailures++; + if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { + ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ENOMEM); } } @@ -653,109 +706,46 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * If unicast and destination host known, deliver to host's link, * unless it is the same link as the packet came in on. */ - if (!manycast) { + if (!ctx.manycast) { /* Determine packet destination link */ if ((host = ng_bridge_get(priv, eh->ether_dhost)) != NULL) { - struct ng_bridge_link *const destLink - = priv->links[host->linkNum]; + link_p destLink = host->link; /* If destination same as incoming link, do nothing */ - KASSERT(destLink != NULL, - ("%s: link%d null", __func__, host->linkNum)); - if (destLink == link) { + if (destLink == ctx.incoming) { NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (0); } /* Deliver packet out the destination link */ destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m->m_pkthdr.len; - NG_FWD_NEW_DATA(error, item, destLink->hook, m); - return (error); + destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); + return (ctx.error); } /* Destination host is not known */ - link->stats.recvUnknown++; + ctx.incoming->stats.recvUnknown++; } /* Distribute unknown, multicast, broadcast pkts to all other links */ - firstLink = NULL; - for (linkNum = linksSeen = 0; linksSeen <= priv->numLinks; linkNum++) { - struct ng_bridge_link *destLink; - struct mbuf *m2 = NULL; + NG_NODE_FOREACH_HOOK(node, ng_bridge_send_ctx, &ctx, ret); - /* - * If we have checked all the links then now - * send the original on its reserved link - */ - if (linksSeen == priv->numLinks) { - /* If we never saw a good link, leave. */ - if (firstLink == NULL) { - NG_FREE_ITEM(item); - NG_FREE_M(m); - return (0); - } - destLink = firstLink; - } else { - destLink = priv->links[linkNum]; - if (destLink != NULL) - linksSeen++; - /* Skip incoming link and disconnected links */ - if (destLink == NULL || destLink == link) { - continue; - } - if (firstLink == NULL) { - /* - * This is the first usable link we have found. - * Reserve it for the originals. - * If we never find another we save a copy. - */ - firstLink = destLink; - continue; - } - - /* - * It's usable link but not the reserved (first) one. - * Copy mbuf info for sending. - */ - m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ - if (m2 == NULL) { - link->stats.memoryFailures++; - NG_FREE_ITEM(item); - NG_FREE_M(m); - return (ENOBUFS); - } - } - - /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m->m_pkthdr.len; - switch (manycast) { - case 0: /* unicast */ - break; - case 1: /* multicast */ - destLink->stats.xmitMulticasts++; - break; - case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; - break; - } - - /* Send packet */ - if (destLink == firstLink) { - /* - * If we've sent all the others, send the original - * on the first link we found. - */ - NG_FWD_NEW_DATA(error, item, destLink->hook, m); - break; /* always done last - not really needed. */ - } else { - NG_SEND_DATA_ONLY(error, destLink->hook, m2); - } + /* If we never saw a good link, leave. */ + if (ctx.foundFirst == NULL || ctx.error != 0) { + NG_FREE_ITEM(item); + NG_FREE_M(ctx.m); + return (ctx.error); } - return (error); + + /* + * If we've sent all the others, send the original + * on the first link we found. + */ + NG_FWD_NEW_DATA(ctx.error, item, ctx.foundFirst->hook, ctx.m); + return (ctx.error); } /* @@ -791,20 +781,13 @@ static int ng_bridge_disconnect(hook_p hook) { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); - int linkNum; + link_p link = NG_HOOK_PRIVATE(hook); - /* Get link number */ - linkNum = (intptr_t)NG_HOOK_PRIVATE(hook); - KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __func__, linkNum)); - /* Remove all hosts associated with this link */ - ng_bridge_remove_hosts(priv, linkNum); + ng_bridge_remove_hosts(priv, link); /* Free associated link information */ - KASSERT(priv->links[linkNum] != NULL, ("%s: no link", __func__)); - free(priv->links[linkNum], M_NETGRAPH_BRIDGE); - priv->links[linkNum] = NULL; + free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; /* If no more hooks, go away */ @@ -849,7 +832,7 @@ ng_bridge_get(priv_p priv, const u_char *addr) * was a memory allocation failure. */ static int -ng_bridge_put(priv_p priv, const u_char *addr, int linkNum) +ng_bridge_put(priv_p priv, const u_char *addr, link_p link) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -867,7 +850,7 @@ ng_bridge_put(priv_p priv, const u_char *addr, int lin if (hent == NULL) return (0); bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); - hent->host.linkNum = linkNum; + hent->host.link = link; hent->host.staleness = 0; hent->host.age = 0; @@ -943,12 +926,13 @@ ng_bridge_rehash(priv_p priv) MISC FUNCTIONS ******************************************************************/ + /* * Remove all hosts associated with a specific link from the hashtable. * If linkNum == -1, then remove all hosts in the table. */ static void -ng_bridge_remove_hosts(priv_p priv, int linkNum) +ng_bridge_remove_hosts(priv_p priv, link_p link) { int bucket; @@ -958,7 +942,7 @@ ng_bridge_remove_hosts(priv_p priv, int linkNum) while (*hptr != NULL) { struct ng_bridge_hent *const hent = *hptr; - if (linkNum == -1 || hent->host.linkNum == linkNum) { + if (link == NULL || hent->host.link == link) { *hptr = SLIST_NEXT(hent, next); free(hent, M_NETGRAPH_BRIDGE); priv->numHosts--; @@ -974,13 +958,32 @@ ng_bridge_remove_hosts(priv_p priv, int linkNum) * a detected loopback condition, and we remove any hosts from * the hashtable whom we haven't heard from in a long while. */ +static int +ng_bridge_unmute(hook_p hook, int *counter) +{ + link_p link = NG_HOOK_PRIVATE(hook); + node_p node = NG_HOOK_NODE(hook); + priv_p priv = NG_NODE_PRIVATE(node); + + if (link->loopCount != 0) { + link->loopCount--; + if (link->loopCount == 0 && priv->conf.debugLevel >= 2) { + log(LOG_INFO, "ng_bridge: %s:" + " restoring looped back %s\n", + ng_bridge_nodename(node), NG_HOOK_NAME(hook)); + } + } + counter++; + return (1); +} + static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) { const priv_p priv = NG_NODE_PRIVATE(node); int bucket; int counter = 0; - int linkNum; + hook_p ret; /* Update host time counters and remove stale entries */ for (bucket = 0; bucket < priv->numBuckets; bucket++) { @@ -989,12 +992,6 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1 while (*hptr != NULL) { struct ng_bridge_hent *const hent = *hptr; - /* Make sure host's link really exists */ - KASSERT(priv->links[hent->host.linkNum] != NULL, - ("%s: host %6D on nonexistent link %d\n", - __func__, hent->host.addr, ":", - hent->host.linkNum)); - /* Remove hosts we haven't heard from in a while */ if (++hent->host.staleness >= priv->conf.maxStaleness) { *hptr = SLIST_NEXT(hent, next); @@ -1015,22 +1012,8 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1 ng_bridge_rehash(priv); /* Decrease loop counter on muted looped back links */ - for (counter = linkNum = 0; linkNum < NG_BRIDGE_MAX_LINKS; linkNum++) { - struct ng_bridge_link *const link = priv->links[linkNum]; - - if (link != NULL) { - if (link->loopCount != 0) { - link->loopCount--; - if (link->loopCount == 0 - && priv->conf.debugLevel >= 2) { - log(LOG_INFO, "ng_bridge: %s:" - " restoring looped back link%d\n", - ng_bridge_nodename(node), linkNum); - } - } - counter++; - } - } + counter = 0; + NG_NODE_FOREACH_HOOK(node, ng_bridge_unmute, &counter, ret); KASSERT(priv->numLinks == counter, ("%s: links: %d != %d", __func__, priv->numLinks, counter)); Modified: head/sys/netgraph/ng_bridge.h ============================================================================== --- head/sys/netgraph/ng_bridge.h Wed Oct 2 23:19:34 2019 (r353025) +++ head/sys/netgraph/ng_bridge.h Thu Oct 3 02:32:55 2019 (r353026) @@ -45,18 +45,14 @@ /* Node type name and magic cookie */ #define NG_BRIDGE_NODE_TYPE "bridge" -#define NGM_BRIDGE_COOKIE 967239368 +#define NGM_BRIDGE_COOKIE 1569321993 /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ -/* Maximum number of supported links */ -#define NG_BRIDGE_MAX_LINKS 32 - /* Node configuration structure */ struct ng_bridge_config { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ u_int32_t loopTimeout; /* link loopback mute time */ u_int32_t maxStaleness; /* max host age before nuking */ @@ -64,8 +60,7 @@ struct ng_bridge_config { }; /* Keep this in sync with the above structure definition */ -#define NG_BRIDGE_CONFIG_TYPE_INFO(ainfo) { \ - { "ipfw", (ainfo) }, \ +#define NG_BRIDGE_CONFIG_TYPE_INFO { \ { "debugLevel", &ng_parse_uint8_type }, \ { "loopTimeout", &ng_parse_uint32_type }, \ { "maxStaleness", &ng_parse_uint32_type }, \ @@ -110,18 +105,28 @@ struct ng_bridge_link_stats { { NULL } \ } +struct ng_bridge_link; +typedef struct ng_bridge_link *link_p; /* Structure describing a single host */ struct ng_bridge_host { u_char addr[6]; /* ethernet address */ - u_int16_t linkNum; /* link where addr can be found */ + link_p link; /* link where addr can be found */ u_int16_t age; /* seconds ago entry was created */ u_int16_t staleness; /* seconds ago host last heard from */ }; +/* external representation of the host */ +struct ng_bridge_hostent { + u_char addr[6]; /* ethernet address */ + char hook[NG_HOOKSIZ]; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ +}; + /* Keep this in sync with the above structure definition */ #define NG_BRIDGE_HOST_TYPE_INFO(entype) { \ { "addr", (entype) }, \ - { "linkNum", &ng_parse_uint16_type }, \ + { "hook", &ng_parse_hookbuf_type }, \ { "age", &ng_parse_uint16_type }, \ { "staleness", &ng_parse_uint16_type }, \ { NULL } \ @@ -129,8 +134,8 @@ struct ng_bridge_host { /* Structure returned by NGM_BRIDGE_GET_TABLE */ struct ng_bridge_host_ary { - u_int32_t numHosts; - struct ng_bridge_host hosts[]; + u_int32_t numHosts; + struct ng_bridge_hostent hosts[]; }; /* Keep this in sync with the above structure definition */ From owner-svn-src-all@freebsd.org Thu Oct 3 02:34:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65BAEFC37C; Thu, 3 Oct 2019 02:34:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kHCc23JHz4LBD; Thu, 3 Oct 2019 02:34:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B7C55C2; Thu, 3 Oct 2019 02:34:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x932YqAn020347; Thu, 3 Oct 2019 02:34:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x932YqND020346; Thu, 3 Oct 2019 02:34:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910030234.x932YqND020346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 3 Oct 2019 02:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353027 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 353027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 02:34:52 -0000 Author: glebius Date: Thu Oct 3 02:34:51 2019 New Revision: 353027 URL: https://svnweb.freebsd.org/changeset/base/353027 Log: Protect access to seq->xwin[] with the seq mutex. MFC after: 5 weeks Modified: head/sys/netgraph/ng_l2tp.c Modified: head/sys/netgraph/ng_l2tp.c ============================================================================== --- head/sys/netgraph/ng_l2tp.c Thu Oct 3 02:32:55 2019 (r353026) +++ head/sys/netgraph/ng_l2tp.c Thu Oct 3 02:34:51 2019 (r353027) @@ -1462,6 +1462,7 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi /* Sanity check */ L2TP_SEQ_CHECK(seq); + mtx_lock(&seq->mtx); priv->stats.xmitRetransmits++; /* Have we reached the retransmit limit? If so, notify owner. */ @@ -1482,7 +1483,9 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, voi seq->acks = 0; /* Retransmit oldest unack'd packet */ - if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT)) == NULL) + m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT); + mtx_unlock(&seq->mtx); + if (m == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, seq->ns++); From owner-svn-src-all@freebsd.org Thu Oct 3 02:51:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D963FC9D8; Thu, 3 Oct 2019 02:51:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kHb90KRfz4LrV; Thu, 3 Oct 2019 02:51:49 +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 E35355904; Thu, 3 Oct 2019 02:51:48 +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 x932pmUD029748; Thu, 3 Oct 2019 02:51:48 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x932pmJ4029747; Thu, 3 Oct 2019 02:51:48 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201910030251.x932pmJ4029747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Thu, 3 Oct 2019 02:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353028 - releng/12.1/lib/libkvm X-SVN-Group: releng X-SVN-Commit-Author: karels X-SVN-Commit-Paths: releng/12.1/lib/libkvm X-SVN-Commit-Revision: 353028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 02:51:49 -0000 Author: karels Date: Thu Oct 3 02:51:48 2019 New Revision: 353028 URL: https://svnweb.freebsd.org/changeset/base/353028 Log: MFC r352867: Add support for ps -H on corefiles in libkvm Add support for kernel threads in kvm_getprocs() and the underlying kvm_proclist() in libkvm when fetching from a kernel core file. This has been missing/needed for several releases, when kernel threads became normal threads. The loop over the processes now contains a sub-loop for threads, which iterates beyond the first thread only when threads are requested. Also set some fields such as tid that were previously uninitialized. Approved by: re (gjb) Sponsored by: Forcepoint LLC Modified: releng/12.1/lib/libkvm/kvm_proc.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/lib/libkvm/kvm_proc.c ============================================================================== --- releng/12.1/lib/libkvm/kvm_proc.c Thu Oct 3 02:34:51 2019 (r353027) +++ releng/12.1/lib/libkvm/kvm_proc.c Thu Oct 3 02:51:48 2019 (r353028) @@ -67,6 +67,7 @@ __SCCSID("@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"); #include #include #include +#include #include #include #include @@ -130,13 +131,16 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc struct proc pproc; struct sysentvec sysent; char svname[KI_EMULNAMELEN]; + struct thread *td = NULL; + bool first_thread; kp = &kinfo_proc; kp->ki_structsize = sizeof(kinfo_proc); /* - * Loop on the processes. this is completely broken because we need to be - * able to loop on the threads and merge the ones that are the same process some how. + * Loop on the processes, then threads within the process if requested. */ + if (what == KERN_PROC_ALL) + what |= KERN_PROC_INC_THREAD; for (; cnt < maxcnt && p != NULL; p = LIST_NEXT(&proc, p_list)) { memset(kp, 0, sizeof *kp); if (KREAD(kd, (u_long)p, &proc)) { @@ -145,15 +149,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc } if (proc.p_state == PRS_NEW) continue; - if (proc.p_state != PRS_ZOMBIE) { - if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), - &mtd)) { - _kvm_err(kd, kd->program, - "can't read thread at %p", - TAILQ_FIRST(&proc.p_threads)); - return (-1); - } - } if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { kp->ki_ruid = ucred.cr_ruid; kp->ki_svuid = ucred.cr_svuid; @@ -222,6 +217,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_addr = 0; /* XXX uarea */ /* kp->ki_kstack = proc.p_thread.td_kstack; XXXKSE */ kp->ki_args = proc.p_args; + kp->ki_numthreads = proc.p_numthreads; kp->ki_tracep = proc.p_tracevp; kp->ki_textvp = proc.p_textvp; kp->ki_fd = proc.p_fd; @@ -285,9 +281,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_sid = sess.s_sid; (void)memcpy(kp->ki_login, sess.s_login, sizeof(kp->ki_login)); - kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; - if (sess.s_leader == p) - kp->ki_kiflag |= KI_SLEADER; if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) { if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) { _kvm_err(kd, kd->program, @@ -330,9 +323,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc nopgrp: kp->ki_tdev = NODEV; } - if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) - (void)kvm_read(kd, (u_long)mtd.td_wmesg, - kp->ki_wmesg, WMESGLEN); (void)kvm_read(kd, (u_long)proc.p_vmspace, (char *)&vmspace, sizeof(vmspace)); @@ -374,85 +364,127 @@ nopgrp: sizeof(svname)); if (svname[0] != 0) strlcpy(kp->ki_emul, svname, KI_EMULNAMELEN); - if ((proc.p_state != PRS_ZOMBIE) && - (mtd.td_blocked != 0)) { - kp->ki_kiflag |= KI_LOCKBLOCK; - if (mtd.td_lockname) - (void)kvm_read(kd, - (u_long)mtd.td_lockname, - kp->ki_lockname, LOCKNAMELEN); - kp->ki_lockname[LOCKNAMELEN] = 0; - } kp->ki_runtime = cputick2usec(proc.p_rux.rux_runtime); kp->ki_pid = proc.p_pid; - kp->ki_siglist = proc.p_siglist; - SIGSETOR(kp->ki_siglist, mtd.td_siglist); - kp->ki_sigmask = mtd.td_sigmask; kp->ki_xstat = KW_EXITCODE(proc.p_xexit, proc.p_xsig); kp->ki_acflag = proc.p_acflag; kp->ki_lock = proc.p_lock; - if (proc.p_state != PRS_ZOMBIE) { - kp->ki_swtime = (ticks - proc.p_swtick) / hz; - kp->ki_flag = proc.p_flag; - kp->ki_sflag = 0; - kp->ki_nice = proc.p_nice; - kp->ki_traceflag = proc.p_traceflag; - if (proc.p_state == PRS_NORMAL) { - if (TD_ON_RUNQ(&mtd) || - TD_CAN_RUN(&mtd) || - TD_IS_RUNNING(&mtd)) { - kp->ki_stat = SRUN; - } else if (mtd.td_state == - TDS_INHIBITED) { - if (P_SHOULDSTOP(&proc)) { - kp->ki_stat = SSTOP; - } else if ( - TD_IS_SLEEPING(&mtd)) { - kp->ki_stat = SSLEEP; - } else if (TD_ON_LOCK(&mtd)) { - kp->ki_stat = SLOCK; - } else { - kp->ki_stat = SWAIT; - } + kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ + + /* Per-thread items; iterate as appropriate. */ + td = TAILQ_FIRST(&proc.p_threads); + for (first_thread = true; cnt < maxcnt && td != NULL && + (first_thread || (what & KERN_PROC_INC_THREAD)); + first_thread = false) { + if (proc.p_state != PRS_ZOMBIE) { + if (KREAD(kd, (u_long)td, &mtd)) { + _kvm_err(kd, kd->program, + "can't read thread at %p", td); + return (-1); } + if (what & KERN_PROC_INC_THREAD) + td = TAILQ_NEXT(&mtd, td_plist); + } else + td = NULL; + if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) + (void)kvm_read(kd, (u_long)mtd.td_wmesg, + kp->ki_wmesg, WMESGLEN); + else + memset(kp->ki_wmesg, 0, WMESGLEN); + if (proc.p_pgrp == NULL) { + kp->ki_kiflag = 0; } else { - kp->ki_stat = SIDL; + kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; + if (sess.s_leader == p) + kp->ki_kiflag |= KI_SLEADER; } - /* Stuff from the thread */ - kp->ki_pri.pri_level = mtd.td_priority; - kp->ki_pri.pri_native = mtd.td_base_pri; - kp->ki_lastcpu = mtd.td_lastcpu; - kp->ki_wchan = mtd.td_wchan; - kp->ki_oncpu = mtd.td_oncpu; - if (mtd.td_name[0] != '\0') - strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); - kp->ki_pctcpu = 0; - kp->ki_rqindex = 0; + if ((proc.p_state != PRS_ZOMBIE) && + (mtd.td_blocked != 0)) { + kp->ki_kiflag |= KI_LOCKBLOCK; + if (mtd.td_lockname) + (void)kvm_read(kd, + (u_long)mtd.td_lockname, + kp->ki_lockname, LOCKNAMELEN); + else + memset(kp->ki_lockname, 0, + LOCKNAMELEN); + kp->ki_lockname[LOCKNAMELEN] = 0; + } else + kp->ki_kiflag &= ~KI_LOCKBLOCK; + kp->ki_siglist = proc.p_siglist; + if (proc.p_state != PRS_ZOMBIE) { + SIGSETOR(kp->ki_siglist, mtd.td_siglist); + kp->ki_sigmask = mtd.td_sigmask; + kp->ki_swtime = (ticks - proc.p_swtick) / hz; + kp->ki_flag = proc.p_flag; + kp->ki_sflag = 0; + kp->ki_nice = proc.p_nice; + kp->ki_traceflag = proc.p_traceflag; + if (proc.p_state == PRS_NORMAL) { + if (TD_ON_RUNQ(&mtd) || + TD_CAN_RUN(&mtd) || + TD_IS_RUNNING(&mtd)) { + kp->ki_stat = SRUN; + } else if (mtd.td_state == + TDS_INHIBITED) { + if (P_SHOULDSTOP(&proc)) { + kp->ki_stat = SSTOP; + } else if ( + TD_IS_SLEEPING(&mtd)) { + kp->ki_stat = SSLEEP; + } else if (TD_ON_LOCK(&mtd)) { + kp->ki_stat = SLOCK; + } else { + kp->ki_stat = SWAIT; + } + } + } else { + kp->ki_stat = SIDL; + } + /* Stuff from the thread */ + kp->ki_pri.pri_level = mtd.td_priority; + kp->ki_pri.pri_native = mtd.td_base_pri; + kp->ki_lastcpu = mtd.td_lastcpu; + kp->ki_wchan = mtd.td_wchan; + kp->ki_oncpu = mtd.td_oncpu; + if (mtd.td_name[0] != '\0') + strlcpy(kp->ki_tdname, mtd.td_name, + sizeof(kp->ki_tdname)); + else + memset(kp->ki_tdname, 0, + sizeof(kp->ki_tdname)); + kp->ki_pctcpu = 0; + kp->ki_rqindex = 0; - /* - * Note: legacy fields; wraps at NO_CPU_OLD or the - * old max CPU value as appropriate - */ - if (mtd.td_lastcpu == NOCPU) - kp->ki_lastcpu_old = NOCPU_OLD; - else if (mtd.td_lastcpu > MAXCPU_OLD) - kp->ki_lastcpu_old = MAXCPU_OLD; - else - kp->ki_lastcpu_old = mtd.td_lastcpu; + /* + * Note: legacy fields; wraps at NO_CPU_OLD + * or the old max CPU value as appropriate + */ + if (mtd.td_lastcpu == NOCPU) + kp->ki_lastcpu_old = NOCPU_OLD; + else if (mtd.td_lastcpu > MAXCPU_OLD) + kp->ki_lastcpu_old = MAXCPU_OLD; + else + kp->ki_lastcpu_old = mtd.td_lastcpu; - if (mtd.td_oncpu == NOCPU) - kp->ki_oncpu_old = NOCPU_OLD; - else if (mtd.td_oncpu > MAXCPU_OLD) - kp->ki_oncpu_old = MAXCPU_OLD; - else - kp->ki_oncpu_old = mtd.td_oncpu; - } else { - kp->ki_stat = SZOMB; + if (mtd.td_oncpu == NOCPU) + kp->ki_oncpu_old = NOCPU_OLD; + else if (mtd.td_oncpu > MAXCPU_OLD) + kp->ki_oncpu_old = MAXCPU_OLD; + else + kp->ki_oncpu_old = mtd.td_oncpu; + kp->ki_tid = mtd.td_tid; + } else { + memset(&kp->ki_sigmask, 0, + sizeof(kp->ki_sigmask)); + kp->ki_stat = SZOMB; + kp->ki_tid = 0; + } + + bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); + ++bp; + ++cnt; } - kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ - bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); - ++bp; - ++cnt; } return (cnt); } @@ -466,7 +498,7 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a u_long a_zombproc, int maxcnt) { struct kinfo_proc *bp = kd->procbase; - int acnt, zcnt; + int acnt, zcnt = 0; struct proc *p; if (KREAD(kd, a_allproc, &p)) { @@ -477,13 +509,15 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a if (acnt < 0) return (acnt); - if (KREAD(kd, a_zombproc, &p)) { - _kvm_err(kd, kd->program, "cannot read zombproc"); - return (-1); + if (a_zombproc != 0) { + if (KREAD(kd, a_zombproc, &p)) { + _kvm_err(kd, kd->program, "cannot read zombproc"); + return (-1); + } + zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); + if (zcnt < 0) + zcnt = 0; } - zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); - if (zcnt < 0) - zcnt = 0; return (acnt + zcnt); } @@ -568,16 +602,19 @@ kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt) liveout: nprocs = size == 0 ? 0 : size / kd->procbase->ki_structsize; } else { - struct nlist nl[7], *p; + struct nlist nl[6], *p; + struct nlist nlz[2]; nl[0].n_name = "_nprocs"; nl[1].n_name = "_allproc"; - nl[2].n_name = "_zombproc"; - nl[3].n_name = "_ticks"; - nl[4].n_name = "_hz"; - nl[5].n_name = "_cpu_tick_frequency"; - nl[6].n_name = 0; + nl[2].n_name = "_ticks"; + nl[3].n_name = "_hz"; + nl[4].n_name = "_cpu_tick_frequency"; + nl[5].n_name = 0; + nlz[0].n_name = "_zombproc"; + nlz[1].n_name = 0; + if (!kd->arch->ka_native(kd)) { _kvm_err(kd, kd->program, "cannot read procs from non-native core"); @@ -591,19 +628,27 @@ liveout: "%s: no such symbol", p->n_name); return (0); } + (void) kvm_nlist(kd, nlz); /* attempt to get zombproc */ if (KREAD(kd, nl[0].n_value, &nprocs)) { _kvm_err(kd, kd->program, "can't read nprocs"); return (0); } - if (KREAD(kd, nl[3].n_value, &ticks)) { + /* + * If returning all threads, we don't know how many that + * might be. Presume that there are, on average, no more + * than 10 threads per process. + */ + if (op == KERN_PROC_ALL || (op & KERN_PROC_INC_THREAD)) + nprocs *= 10; /* XXX */ + if (KREAD(kd, nl[2].n_value, &ticks)) { _kvm_err(kd, kd->program, "can't read ticks"); return (0); } - if (KREAD(kd, nl[4].n_value, &hz)) { + if (KREAD(kd, nl[3].n_value, &hz)) { _kvm_err(kd, kd->program, "can't read hz"); return (0); } - if (KREAD(kd, nl[5].n_value, &cpu_tick_frequency)) { + if (KREAD(kd, nl[4].n_value, &cpu_tick_frequency)) { _kvm_err(kd, kd->program, "can't read cpu_tick_frequency"); return (0); @@ -614,7 +659,7 @@ liveout: return (0); nprocs = kvm_deadprocs(kd, op, arg, nl[1].n_value, - nl[2].n_value, nprocs); + nlz[0].n_value, nprocs); if (nprocs <= 0) { _kvm_freeprocs(kd); nprocs = 0; From owner-svn-src-all@freebsd.org Thu Oct 3 04:41:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9271FFF237; Thu, 3 Oct 2019 04:41:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kL2G3QD0z4Trv; Thu, 3 Oct 2019 04:41:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58F0D6C63; Thu, 3 Oct 2019 04:41:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x934fwIA097377; Thu, 3 Oct 2019 04:41:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x934fwUV097376; Thu, 3 Oct 2019 04:41:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910030441.x934fwUV097376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 3 Oct 2019 04:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353030 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 353030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 04:41:58 -0000 Author: glebius Date: Thu Oct 3 04:41:57 2019 New Revision: 353030 URL: https://svnweb.freebsd.org/changeset/base/353030 Log: Fix build failure from r353026. Somehow module build allowed this. Pointy hat to: glebius Modified: head/sys/netgraph/ng_bridge.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Thu Oct 3 02:59:30 2019 (r353029) +++ head/sys/netgraph/ng_bridge.c Thu Oct 3 04:41:57 2019 (r353030) @@ -372,13 +372,14 @@ ng_bridge_newhook(node_p node, hook_p hook, const char * Receive a control message */ static int -ng_bridge_reset_link(hook_p hook, int ret) +ng_bridge_reset_link(hook_p hook, void *arg __unused) { link_p priv = NG_HOOK_PRIVATE(hook); priv->loopCount = 0; bzero(&priv->stats, sizeof(priv->stats)); - return (ret); + + return (1); } @@ -429,7 +430,8 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last ng_bridge_remove_hosts(priv, NULL); /* Reset all loop detection counters and stats */ - NG_NODE_FOREACH_HOOK(node, ng_bridge_reset_link, 1, rethook); + NG_NODE_FOREACH_HOOK(node, ng_bridge_reset_link, NULL, + rethook); break; } case NGM_BRIDGE_GET_STATS: @@ -530,8 +532,9 @@ struct ng_bridge_send_ctx { }; static int -ng_bridge_send_ctx(hook_p dst, struct ng_bridge_send_ctx * ctx) +ng_bridge_send_ctx(hook_p dst, void *arg) { + struct ng_bridge_send_ctx *ctx = arg; link_p destLink = NG_HOOK_PRIVATE(dst); struct mbuf *m2 = NULL; int error = 0; @@ -959,11 +962,12 @@ ng_bridge_remove_hosts(priv_p priv, link_p link) * the hashtable whom we haven't heard from in a long while. */ static int -ng_bridge_unmute(hook_p hook, int *counter) +ng_bridge_unmute(hook_p hook, void *arg) { link_p link = NG_HOOK_PRIVATE(hook); node_p node = NG_HOOK_NODE(hook); priv_p priv = NG_NODE_PRIVATE(node); + int *counter = arg; if (link->loopCount != 0) { link->loopCount--; From owner-svn-src-all@freebsd.org Thu Oct 3 06:08:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A791C12919B; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kMxd3yj0z4dQk; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5127A7C00; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93685Ko045081; Thu, 3 Oct 2019 06:08:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93685Bn045080; Thu, 3 Oct 2019 06:08:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910030608.x93685Bn045080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 3 Oct 2019 06:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353031 - in stable: 11/contrib/llvm/lib/Target/X86 12/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/Target/X86 12/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 353031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 06:08:05 -0000 Author: dim Date: Thu Oct 3 06:08:04 2019 New Revision: 353031 URL: https://svnweb.freebsd.org/changeset/base/353031 Log: MFC r352915: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. PR: 240928 Modified: stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 04:41:57 2019 (r353030) +++ stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 06:08:04 2019 (r353031) @@ -154,6 +154,15 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter MFI->insert(MBBI, NewMI); // Insert the new inst return NewMI; } + } + + if (!MI.isConvertibleTo3Addr()) + return nullptr; + + switch (MI.getOpcode()) { + default: + // Only convert instructions that we've verified are safe. + return nullptr; case X86::ADD64ri32: case X86::ADD64ri8: case X86::ADD64ri32_DB: @@ -162,24 +171,24 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter case X86::ADD32ri8: case X86::ADD32ri_DB: case X86::ADD32ri8_DB: - case X86::ADD16ri: - case X86::ADD16ri8: - case X86::ADD16ri_DB: - case X86::ADD16ri8_DB: if (!MI.getOperand(2).isImm()) { // convertToThreeAddress will call getImm() // which requires isImm() to be true return nullptr; } break; - case X86::ADD16rr: - case X86::ADD16rr_DB: - if (MI.getOperand(1).getReg() != MI.getOperand(2).getReg()) { - // if src1 != src2, then convertToThreeAddress will - // need to create a Virtual register, which we cannot do - // after register allocation. - return nullptr; - } + case X86::SHL64ri: + case X86::SHL32ri: + case X86::INC64r: + case X86::INC32r: + case X86::DEC64r: + case X86::DEC32r: + case X86::ADD64rr: + case X86::ADD64rr_DB: + case X86::ADD32rr: + case X86::ADD32rr_DB: + // These instructions are all fine to convert. + break; } return TII->convertToThreeAddress(MFI, MI, nullptr); } From owner-svn-src-all@freebsd.org Thu Oct 3 06:08:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E204612919F; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kMxd5jtJz4dQl; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2C0B7C01; Thu, 3 Oct 2019 06:08:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93685uD045087; Thu, 3 Oct 2019 06:08:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x936855W045086; Thu, 3 Oct 2019 06:08:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910030608.x936855W045086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 3 Oct 2019 06:08: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: r353031 - in stable: 11/contrib/llvm/lib/Target/X86 12/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/Target/X86 12/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 353031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 06:08:05 -0000 Author: dim Date: Thu Oct 3 06:08:04 2019 New Revision: 353031 URL: https://svnweb.freebsd.org/changeset/base/353031 Log: MFC r352915: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. PR: 240928 Modified: stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 04:41:57 2019 (r353030) +++ stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 06:08:04 2019 (r353031) @@ -154,6 +154,15 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter MFI->insert(MBBI, NewMI); // Insert the new inst return NewMI; } + } + + if (!MI.isConvertibleTo3Addr()) + return nullptr; + + switch (MI.getOpcode()) { + default: + // Only convert instructions that we've verified are safe. + return nullptr; case X86::ADD64ri32: case X86::ADD64ri8: case X86::ADD64ri32_DB: @@ -162,24 +171,24 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter case X86::ADD32ri8: case X86::ADD32ri_DB: case X86::ADD32ri8_DB: - case X86::ADD16ri: - case X86::ADD16ri8: - case X86::ADD16ri_DB: - case X86::ADD16ri8_DB: if (!MI.getOperand(2).isImm()) { // convertToThreeAddress will call getImm() // which requires isImm() to be true return nullptr; } break; - case X86::ADD16rr: - case X86::ADD16rr_DB: - if (MI.getOperand(1).getReg() != MI.getOperand(2).getReg()) { - // if src1 != src2, then convertToThreeAddress will - // need to create a Virtual register, which we cannot do - // after register allocation. - return nullptr; - } + case X86::SHL64ri: + case X86::SHL32ri: + case X86::INC64r: + case X86::INC32r: + case X86::DEC64r: + case X86::DEC32r: + case X86::ADD64rr: + case X86::ADD64rr_DB: + case X86::ADD32rr: + case X86::ADD32rr_DB: + // These instructions are all fine to convert. + break; } return TII->convertToThreeAddress(MFI, MI, nullptr); } From owner-svn-src-all@freebsd.org Thu Oct 3 07:17:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F152A12AA5B; Thu, 3 Oct 2019 07:17: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kPTf5rF4z3DHx; Thu, 3 Oct 2019 07:17:26 +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 A761B8884; Thu, 3 Oct 2019 07:17:26 +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 x937HQFb086113; Thu, 3 Oct 2019 07:17:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x937HQXe086112; Thu, 3 Oct 2019 07:17:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910030717.x937HQXe086112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 3 Oct 2019 07:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353032 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 353032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 07:17:27 -0000 Author: andrew Date: Thu Oct 3 07:17:26 2019 New Revision: 353032 URL: https://svnweb.freebsd.org/changeset/base/353032 Log: MFC r352796: Check the vfs option length is valid before accessing through When a VFS option passed to nmount is present but NULL the kernel will place an empty option in its internal list. This will have a NULL pointer and a length of 0. When we come to read one of these the kernel will try to load from the last address of virtual memory. This is normally invalid so will fault resulting in a kernel panic. Fix this by checking if the length is valid before dereferencing. Sponsored by: DARPA, AFRL Modified: stable/12/sys/kern/vfs_mount.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_mount.c ============================================================================== --- stable/12/sys/kern/vfs_mount.c Thu Oct 3 06:08:04 2019 (r353031) +++ stable/12/sys/kern/vfs_mount.c Thu Oct 3 07:17:26 2019 (r353032) @@ -603,7 +603,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -611,7 +611,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); From owner-svn-src-all@freebsd.org Thu Oct 3 08:25:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 556BE12DB8A; Thu, 3 Oct 2019 08:25:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kQzp1XWbz3JZ9; Thu, 3 Oct 2019 08:25:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 180FE94CF; Thu, 3 Oct 2019 08:25:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x938P99K027517; Thu, 3 Oct 2019 08:25:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x938P9jh027516; Thu, 3 Oct 2019 08:25:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910030825.x938P9jh027516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Oct 2019 08:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353033 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 353033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 08:25:10 -0000 Author: kib Date: Thu Oct 3 08:25:09 2019 New Revision: 353033 URL: https://svnweb.freebsd.org/changeset/base/353033 Log: Remove unnecessary vm/vm_page.h and vm/vm_pager.h includes from tmpfs/tmpfs_vnodes.c. Submitted by: ota@j.email.ne.jp MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21881 Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Oct 3 07:17:26 2019 (r353032) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Oct 3 08:25:09 2019 (r353033) @@ -59,8 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include From owner-svn-src-all@freebsd.org Thu Oct 3 10:37:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C46B130B78; Thu, 3 Oct 2019 10:37:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kTwx6J8Pz3QvV; Thu, 3 Oct 2019 10:37:53 +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 BCAC5ABF7; Thu, 3 Oct 2019 10:37:53 +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 x93AbrDc004412; Thu, 3 Oct 2019 10:37:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93AbrUg004411; Thu, 3 Oct 2019 10:37:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031037.x93AbrUg004411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 10:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353034 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 353034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 10:37:54 -0000 Author: tuexen Date: Thu Oct 3 10:37:53 2019 New Revision: 353034 URL: https://svnweb.freebsd.org/changeset/base/353034 Log: MFC r352652: Plumb a memory leak. Thnanks to Felix Weinrank for finding this issue using fuzz testing and reporting it for the userland stack: https://github.com/sctplab/usrsctp/issues/378 Modified: stable/12/sys/netinet/sctp_indata.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Thu Oct 3 08:25:09 2019 (r353033) +++ stable/12/sys/netinet/sctp_indata.c Thu Oct 3 10:37:53 2019 (r353034) @@ -472,6 +472,11 @@ sctp_clean_up_control(struct sctp_tcb *stcb, struct sc chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } sctp_free_a_readq(stcb, control); } From owner-svn-src-all@freebsd.org Thu Oct 3 10:44:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F6DF130DFC; Thu, 3 Oct 2019 10:44:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kV4B2Hm4z3RJd; Thu, 3 Oct 2019 10:44:10 +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 32072ADC3; Thu, 3 Oct 2019 10:44:10 +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 x93AiATk010525; Thu, 3 Oct 2019 10:44:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Ai98N010524; Thu, 3 Oct 2019 10:44:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031044.x93Ai98N010524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 10:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353035 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 353035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 10:44:10 -0000 Author: tuexen Date: Thu Oct 3 10:44:09 2019 New Revision: 353035 URL: https://svnweb.freebsd.org/changeset/base/353035 Log: MFC r352868: RFC 7112 requires a host to put the complete IP header chain including the TCP header in the first IP packet. Enforce this in tcp_output(). In addition make sure that at least one byte payload fits in the TCP segement to allow making progress. Without this check, a kernel with INVARIANTS will panic. This issue was found by running an instance of syzkaller. Manually resolved a conflict, since we don't have BBR in stable/12. Reviewed by: jtl@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21665 Modified: stable/12/sys/netinet/tcp_output.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Thu Oct 3 10:37:53 2019 (r353034) +++ stable/12/sys/netinet/tcp_output.c Thu Oct 3 10:44:09 2019 (r353035) @@ -931,6 +931,20 @@ send: if (tp->t_flags & TF_NEEDFIN) sendalot = 1; } else { + if (optlen + ipoptlen >= tp->t_maxseg) { + /* + * Since we don't have enough space to put + * the IP header chain and the TCP header in + * one packet as required by RFC 7112, don't + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. + */ + SOCKBUF_UNLOCK(&so->so_snd); + error = EMSGSIZE; + sack_rxmit = 0; + goto out; + } len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; if (dont_sendalot) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Oct 3 10:37:53 2019 (r353034) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Oct 3 10:44:09 2019 (r353035) @@ -7954,12 +7954,14 @@ send: sendalot = 1; } else { - if (optlen + ipoptlen > tp->t_maxseg) { + if (optlen + ipoptlen >= tp->t_maxseg) { /* * Since we don't have enough space to put * the IP header chain and the TCP header in * one packet as required by RFC 7112, don't - * send it. + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. */ SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; From owner-svn-src-all@freebsd.org Thu Oct 3 10:46:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A49A5130E8C; Thu, 3 Oct 2019 10:46:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kV6T3tBNz3wdv; Thu, 3 Oct 2019 10:46:09 +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 69578ADDA; Thu, 3 Oct 2019 10:46:09 +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 x93Ak9X9010685; Thu, 3 Oct 2019 10:46:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Ak9m4010684; Thu, 3 Oct 2019 10:46:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031046.x93Ak9m4010684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 10:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353036 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 353036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 10:46:09 -0000 Author: tuexen Date: Thu Oct 3 10:46:09 2019 New Revision: 353036 URL: https://svnweb.freebsd.org/changeset/base/353036 Log: MFC r352894: Don't use stack memory which is not initialized. Thanks to Mark Wodrich for reporting this issue for the userland stack in https://github.com/sctplab/usrsctp/issues/380 This issue was also found for usrsctp by OSS-fuzz in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17778 Modified: stable/12/sys/netinet/sctp_asconf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_asconf.c ============================================================================== --- stable/12/sys/netinet/sctp_asconf.c Thu Oct 3 10:44:09 2019 (r353035) +++ stable/12/sys/netinet/sctp_asconf.c Thu Oct 3 10:46:09 2019 (r353036) @@ -236,6 +236,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc "process_asconf_add_ip: using source addr "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } + net = NULL; /* add the address */ if (bad_address) { m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -250,17 +251,19 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph, aparam_length); } else { - /* notify upper layer */ - sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); - if (send_hb) { - sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + if (net != NULL) { + /* notify upper layer */ + sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } } return (m_reply); From owner-svn-src-all@freebsd.org Thu Oct 3 11:08:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD150131610; Thu, 3 Oct 2019 11:08:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kVcb4DPjz3xd1; Thu, 3 Oct 2019 11:08:47 +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 74443B155; Thu, 3 Oct 2019 11:08:47 +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 x93B8lls022032; Thu, 3 Oct 2019 11:08:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93B8kbw022026; Thu, 3 Oct 2019 11:08:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910031108.x93B8kbw022026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 3 Oct 2019 11:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353037 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 353037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 11:08:47 -0000 Author: avg Date: Thu Oct 3 11:08:45 2019 New Revision: 353037 URL: https://svnweb.freebsd.org/changeset/base/353037 Log: ZFS: add bookmark renaming The feature is implemented as an extension of the existing ZFS_IOC_RENAME ioctl. Both the userland and the DSL interfaces support renaming only a single bookmark at a time. As of now, there is no ZCP interface to the new functionality. I am going to add it once the DSL interface passes a test of time. This change picks up support for zfs_ioc_namecheck_t::ENTITY_NAME that was added to ZoL as part of Redacted Send/Receive feature by Paul Dagnelie . This is needed to allow a bookmark name in zc_name. Discussed with: mahrens Reviewed by: bcr (man page) Sponsored by: CyberSecure Differential Revision: https://reviews.freebsd.org/D21795 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Oct 3 10:46:09 2019 (r353036) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Oct 3 11:08:45 2019 (r353037) @@ -105,6 +105,9 @@ .Ar snapshot snapshot .Nm .Cm rename +.Ar bookmark bookmark +.Nm +.Cm rename .Fl u .Op Fl p .Ar filesystem filesystem @@ -2092,6 +2095,16 @@ flag. .Pp Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively. +.It Xo +.Nm +.Cm rename +.Ar bookmark bookmark +.Xc +.Pp +Renames the given bookmark. +Bookmarks can only be renamed within the parent file system or volume. +When renaming a bookmark, the parent file system or volume of the bookmark +does not need to be specified as part of the second argument. .It Xo .Nm .Cm list Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Oct 3 10:46:09 2019 (r353036) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Oct 3 11:08:45 2019 (r353037) @@ -284,6 +284,7 @@ get_usage(zfs_help_t idx) "\n" "\trename [-f] -p \n" "\trename -r \n" + "\trename \n" "\trename -u [-p] ")); case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); @@ -3254,6 +3255,7 @@ zfs_do_list(int argc, char **argv) * zfs rename [-f] * zfs rename [-f] -p * zfs rename -r + * zfs rename * zfs rename -u [-p] * * Renames the given dataset to another of the same type. @@ -3270,6 +3272,7 @@ zfs_do_rename(int argc, char **argv) int ret = 0; int types; boolean_t parents = B_FALSE; + boolean_t bookmarks = B_FALSE; char *snapshot = NULL; /* check options */ @@ -3320,7 +3323,7 @@ zfs_do_rename(int argc, char **argv) usage(B_FALSE); } - if (flags.recurse && strchr(argv[0], '@') == 0) { + if (flags.recurse && strchr(argv[0], '@') == NULL) { (void) fprintf(stderr, gettext("source dataset for recursive " "rename must be a snapshot\n")); usage(B_FALSE); @@ -3332,10 +3335,22 @@ zfs_do_rename(int argc, char **argv) usage(B_FALSE); } + if (strchr(argv[0], '#') != NULL) + bookmarks = B_TRUE; + + if (bookmarks && (flags.nounmount || flags.recurse || + flags.forceunmount || parents)) { + (void) fprintf(stderr, gettext("options are not supported " + "for renaming bookmarks\n")); + usage(B_FALSE); + } + if (flags.nounmount) types = ZFS_TYPE_FILESYSTEM; else if (parents) types = ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME; + else if (bookmarks) + types = ZFS_TYPE_BOOKMARK; else types = ZFS_TYPE_DATASET; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 3 10:46:09 2019 (r353036) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 3 11:08:45 2019 (r353037) @@ -4291,17 +4291,18 @@ zfs_rename(zfs_handle_t *zhp, const char *source, cons /* * Make sure the target name is valid */ - if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) { - if ((strchr(target, '@') == NULL) || - *target == '@') { + if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT || + zhp->zfs_type == ZFS_TYPE_BOOKMARK) { + const char sep = zhp->zfs_type == ZFS_TYPE_SNAPSHOT ? '@' : '#'; + + if ((strchr(target, sep) == NULL) || *target == sep) { /* * Snapshot target name is abbreviated, * reconstruct full dataset name */ - (void) strlcpy(parent, zhp->zfs_name, - sizeof (parent)); - delim = strchr(parent, '@'); - if (strchr(target, '@') == NULL) + (void) strlcpy(parent, zhp->zfs_name, sizeof (parent)); + delim = strchr(parent, sep); + if (strchr(target, sep) == NULL) *(++delim) = '\0'; else *delim = '\0'; @@ -4311,12 +4312,13 @@ zfs_rename(zfs_handle_t *zhp, const char *source, cons /* * Make sure we're renaming within the same dataset. */ - delim = strchr(target, '@'); + delim = strchr(target, sep); if (strncmp(zhp->zfs_name, target, delim - target) - != 0 || zhp->zfs_name[delim - target] != '@') { + != 0 || zhp->zfs_name[delim - target] != sep) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "snapshots must be part of same " - "dataset")); + "%s must be part of same dataset"), + zhp->zfs_type == ZFS_TYPE_SNAPSHOT ? + "snapshots" : "bookmarks"); return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf)); } @@ -4379,7 +4381,6 @@ zfs_rename(zfs_handle_t *zhp, const char *source, cons flags.nounmount = B_TRUE; } if (flags.recurse) { - parentname = zfs_strdup(zhp->zfs_hdl, zhp->zfs_name); if (parentname == NULL) { ret = -1; @@ -4392,7 +4393,8 @@ zfs_rename(zfs_handle_t *zhp, const char *source, cons ret = -1; goto error; } - } else if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT) { + } else if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT && + zhp->zfs_type != ZFS_TYPE_BOOKMARK) { if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, flags.nounmount ? CL_GATHER_DONT_UNMOUNT : 0, flags.forceunmount ? MS_FORCE : 0)) == NULL) { @@ -4437,6 +4439,8 @@ zfs_rename(zfs_handle_t *zhp, const char *source, cons "a child dataset already has a snapshot " "with the new name")); (void) zfs_error(hdl, EZFS_EXISTS, errbuf); + } else if (errno == EINVAL) { + (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf); } else { (void) zfs_standard_error(zhp->zfs_hdl, errno, errbuf); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c Thu Oct 3 10:46:09 2019 (r353036) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c Thu Oct 3 11:08:45 2019 (r353037) @@ -459,3 +459,108 @@ dsl_bookmark_destroy(nvlist_t *bmarks, nvlist_t *error fnvlist_free(dbda.dbda_success); return (rv); } + +typedef struct dsl_bookmark_rename_arg { + const char *dbra_fsname; + const char *dbra_oldname; + const char *dbra_newname; +} dsl_bookmark_rename_arg_t; + +static int +dsl_bookmark_rename_check(void *arg, dmu_tx_t *tx) +{ + dsl_bookmark_rename_arg_t *dbra = arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_dataset_t *ds; + zfs_bookmark_phys_t bmark_phys; + int error; + + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_BOOKMARKS)) + return (SET_ERROR(ENOTSUP)); + + /* Check validity and the full length of the new bookmark name. */ + if (zfs_component_namecheck(dbra->dbra_newname, NULL, NULL)) + return (SET_ERROR(EINVAL)); + if (strlen(dbra->dbra_fsname) + strlen(dbra->dbra_newname) + 1 >= + ZFS_MAX_DATASET_NAME_LEN) + return (SET_ERROR(ENAMETOOLONG)); + + error = dsl_dataset_hold(dp, dbra->dbra_fsname, FTAG, &ds); + if (error != 0) + return (error); + if (ds->ds_is_snapshot) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(EINVAL)); + } + error = dsl_dataset_bmark_lookup(ds, dbra->dbra_oldname, &bmark_phys); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + return (error); + } + + error = dsl_dataset_bmark_lookup(ds, dbra->dbra_newname, &bmark_phys); + dsl_dataset_rele(ds, FTAG); + if (error == 0) + return (SET_ERROR(EEXIST)); + if (error != ESRCH) + return (error); + return (0); +} + +static void +dsl_bookmark_rename_sync(void *arg, dmu_tx_t *tx) +{ + zfs_bookmark_phys_t bmark_phys; + dsl_bookmark_rename_arg_t *dbra = arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + objset_t *mos; + dsl_dataset_t *ds; + uint64_t bmark_zapobj; + uint64_t int_size, num_ints; + matchtype_t mt = 0; + int error; + + ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_BOOKMARKS)); + VERIFY0(dsl_dataset_hold(dp, dbra->dbra_fsname, FTAG, &ds)); + + mos = ds->ds_dir->dd_pool->dp_meta_objset; + bmark_zapobj = ds->ds_bookmarks; + + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) + mt = MT_NORMALIZE; + + VERIFY0(zap_length(mos, bmark_zapobj, dbra->dbra_oldname, + &int_size, &num_ints)); + ASSERT3U(int_size, ==, sizeof (uint64_t)); + VERIFY0(zap_lookup_norm(mos, bmark_zapobj, dbra->dbra_oldname, int_size, + num_ints, &bmark_phys, mt, NULL, 0, NULL)); + VERIFY0(zap_remove_norm(mos, bmark_zapobj, dbra->dbra_oldname, mt, tx)); + + VERIFY0(zap_add(mos, bmark_zapobj, dbra->dbra_newname, int_size, + num_ints, &bmark_phys, tx)); + + spa_history_log_internal_ds(ds, "rename bookmark", tx, + "#%s -> #%s creation_txg=%llu", + dbra->dbra_oldname, dbra->dbra_newname, + (longlong_t)bmark_phys.zbm_creation_txg); + + dsl_dataset_rele(ds, FTAG); +} + +/* + * The bookmarks must all be in the same pool. + */ +int +dsl_bookmark_rename(const char *fsname, const char *oldbmark, + const char *newbmark) +{ + dsl_bookmark_rename_arg_t dbra; + + dbra.dbra_fsname = fsname; + dbra.dbra_oldname = oldbmark; + dbra.dbra_newname = newbmark; + + return (dsl_sync_task(fsname, dsl_bookmark_rename_check, + dsl_bookmark_rename_sync, &dbra, 1, ZFS_SPACE_CHECK_NORMAL)); +} + Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h Thu Oct 3 10:46:09 2019 (r353036) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h Thu Oct 3 11:08:45 2019 (r353037) @@ -41,6 +41,7 @@ int dsl_bookmark_create(nvlist_t *, nvlist_t *); int dsl_get_bookmarks(const char *, nvlist_t *, nvlist_t *); int dsl_get_bookmarks_impl(dsl_dataset_t *, nvlist_t *, nvlist_t *); int dsl_bookmark_destroy(nvlist_t *, nvlist_t *); +int dsl_bookmark_rename(const char *fs, const char *from, const char *to); int dsl_bookmark_lookup(struct dsl_pool *, const char *, struct dsl_dataset *, zfs_bookmark_phys_t *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Oct 3 10:46:09 2019 (r353036) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Oct 3 11:08:45 2019 (r353037) @@ -224,7 +224,8 @@ typedef int zfs_secpolicy_func_t(zfs_cmd_t *, nvlist_t typedef enum { NO_NAME, POOL_NAME, - DATASET_NAME + DATASET_NAME, + ENTITY_NAME } zfs_ioc_namecheck_t; typedef enum { @@ -922,8 +923,21 @@ static int zfs_secpolicy_rename(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { char *at = NULL; + char *pound; int error; + if ((pound = strchr(zc->zc_name, '#')) != NULL) { + *pound = '\0'; + error = zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_RENAME, cr); + if (error == 0) { + error = zfs_secpolicy_write_perms(zc->zc_name, + ZFS_DELEG_PERM_BOOKMARK, cr); + } + *pound = '#'; + return (error); + } + if ((zc->zc_cookie & 1) != 0) { /* * This is recursive rename, so the starting snapshot might @@ -4020,8 +4034,8 @@ recursive_unmount(const char *fsname, void *arg) /* * inputs: - * zc_name old name of dataset - * zc_value new name of dataset + * zc_name old name of dataset or bookmark + * zc_value new name of dataset or bookmark * zc_cookie recursive flag (only valid for snapshots) * * outputs: none @@ -4032,7 +4046,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) objset_t *os; dmu_objset_type_t ost; boolean_t recursive = zc->zc_cookie & 1; - char *at; + char *pos, *pos2; boolean_t allow_mounted = B_TRUE; int err; @@ -4040,9 +4054,34 @@ zfs_ioc_rename(zfs_cmd_t *zc) allow_mounted = (zc->zc_cookie & 2) != 0; #endif - /* "zfs rename" from and to ...%recv datasets should both fail */ zc->zc_name[sizeof (zc->zc_name) - 1] = '\0'; zc->zc_value[sizeof (zc->zc_value) - 1] = '\0'; + + pos = strchr(zc->zc_name, '#'); + if (pos != NULL) { + /* Bookmarks must be in same fs. */ + pos2 = strchr(zc->zc_value, '#'); + if (pos2 == NULL) + return (SET_ERROR(EINVAL)); + + /* Recursive flag is not supported yet. */ + if (recursive) + return (SET_ERROR(ENOTSUP)); + + *pos = '\0'; + *pos2 = '\0'; + if (strcmp(zc->zc_name, zc->zc_value) == 0) { + err = dsl_bookmark_rename(zc->zc_name, + pos + 1, pos2 + 1); + } else { + err = SET_ERROR(EXDEV); + } + *pos = '#'; + *pos2 = '#'; + return (err); + } + + /* "zfs rename" from and to ...%recv datasets should both fail */ if (dataset_namecheck(zc->zc_name, NULL, NULL) != 0 || dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || strchr(zc->zc_name, '%') || strchr(zc->zc_value, '%')) @@ -4054,28 +4093,30 @@ zfs_ioc_rename(zfs_cmd_t *zc) ost = dmu_objset_type(os); dmu_objset_rele(os, FTAG); - at = strchr(zc->zc_name, '@'); - if (at != NULL) { - /* snaps must be in same fs */ - int error; - - if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) - return (SET_ERROR(EXDEV)); - *at = '\0'; - if (ost == DMU_OST_ZFS && !allow_mounted) { - error = dmu_objset_find(zc->zc_name, - recursive_unmount, at + 1, - recursive ? DS_FIND_CHILDREN : 0); - if (error != 0) { - *at = '@'; - return (error); + pos = strchr(zc->zc_name, '@'); + if (pos != NULL) { + /* Snapshots must be in same fs. */ + pos2 = strchr(zc->zc_value, '@'); + if (pos2 == NULL) + return (SET_ERROR(EINVAL)); + *pos = '\0'; + *pos2 = '\0'; + if (strcmp(zc->zc_name, zc->zc_value) != 0) { + err = SET_ERROR(EXDEV); + } else { + if (ost == DMU_OST_ZFS && !allow_mounted) { + err = dmu_objset_find(zc->zc_name, + recursive_unmount, pos + 1, + recursive ? DS_FIND_CHILDREN : 0); } + if (err == 0) { + err = dsl_dataset_rename_snapshot(zc->zc_name, + pos + 1, pos2 + 1, recursive); + } } - error = dsl_dataset_rename_snapshot(zc->zc_name, - at + 1, strchr(zc->zc_value, '@') + 1, recursive); - *at = '@'; - - return (error); + *pos = '@'; + *pos2 = '@'; + return (err); } else { #ifdef illumos if (ost == DMU_OST_ZVOL) @@ -6352,8 +6393,6 @@ zfs_ioctl_init(void) zfs_secpolicy_none); zfs_ioctl_register_dataset_modify(ZFS_IOC_DESTROY, zfs_ioc_destroy, zfs_secpolicy_destroy); - zfs_ioctl_register_dataset_modify(ZFS_IOC_RENAME, zfs_ioc_rename, - zfs_secpolicy_rename); zfs_ioctl_register_dataset_modify(ZFS_IOC_RECV, zfs_ioc_recv, zfs_secpolicy_recv); zfs_ioctl_register_dataset_modify(ZFS_IOC_PROMOTE, zfs_ioc_promote, @@ -6363,6 +6402,14 @@ zfs_ioctl_init(void) zfs_ioctl_register_dataset_modify(ZFS_IOC_SET_FSACL, zfs_ioc_set_fsacl, zfs_secpolicy_set_fsacl); + /* + * Not using zfs_ioctl_register_dataset_modify as DATASET_NAME check + * won't allow a bookmark name. + */ + zfs_ioctl_register_legacy(ZFS_IOC_RENAME, zfs_ioc_rename, + zfs_secpolicy_rename, ENTITY_NAME, B_TRUE, + POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); + zfs_ioctl_register_dataset_nolog(ZFS_IOC_SHARE, zfs_ioc_share, zfs_secpolicy_share, POOL_CHECK_NONE); zfs_ioctl_register_dataset_nolog(ZFS_IOC_SMB_ACL, zfs_ioc_smb_acl, @@ -6392,7 +6439,8 @@ pool_status_check(const char *name, zfs_ioc_namecheck_ spa_t *spa; int error; - ASSERT(type == POOL_NAME || type == DATASET_NAME); + ASSERT(type == POOL_NAME || type == DATASET_NAME || + type == ENTITY_NAME); if (check & POOL_CHECK_NONE) return (0); @@ -6723,6 +6771,15 @@ zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t ar else error = pool_status_check(zc->zc_name, vec->zvec_namecheck, vec->zvec_pool_check); + break; + + case ENTITY_NAME: + if (entity_namecheck(zc->zc_name, NULL, NULL) != 0) { + error = SET_ERROR(EINVAL); + } else { + error = pool_status_check(zc->zc_name, + vec->zvec_namecheck, vec->zvec_pool_check); + } break; case NO_NAME: From owner-svn-src-all@freebsd.org Thu Oct 3 11:16:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D555F1319B0; Thu, 3 Oct 2019 11:16:15 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kVnC0XSlz3y73; Thu, 3 Oct 2019 11:16:14 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id l21so2273135lje.4; Thu, 03 Oct 2019 04:16:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=dje5Oz0KBWPyHBSWFbNSq1nvAcdQs+Ua6lMrgTQbemA=; b=ZyFe8/0B5eA9pQzras4bykGoEbak8qEjuHGCjLY7hWSF7T+871OPsc9GMGeaRJGEW+ IKa4yiJ4ggQKB62bFzGdNGWztPtS/g9QFYwm5KaKSkJHc/iqfJWRdbN1UCM4MHevZ7vO S8dgwb43f06zuPeti5ssYcvXfEiRd3y9Q73j4aZ0Vnk3Qq6a1etV1P9MYfg3W2cZct8h EaLTPsNZzJSTPUeTwjzpgX6tPv8tkpFU98N/ho08LW2Nvef9UDOwvJCBSea7L7wwQgbM VffyF4A5lSwRXdf2pAv1ryaZfb7btyEtNw4t12HuRY83f7lN6m/WG0jGMilu2RRWk2R4 3qUA== X-Gm-Message-State: APjAAAXN3dcWVaO2XIkzz4RGCnhAP5oh0+Se63DXq/cbRP0gbx9Hs084 ZAD4CQZwkuRoCPWFGZ4tq/zcbXdaxpg= X-Google-Smtp-Source: APXvYqwxlPFFPLGrwIKRqT9cHCRj6gWz/XHxNsF8O/aVWpoj2CZvJDg/ZXRccGycFeJph/biK5S2kA== X-Received: by 2002:a05:651c:110f:: with SMTP id d15mr5792575ljo.43.1570101373082; Thu, 03 Oct 2019 04:16:13 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a8sm470318ljf.47.2019.10.03.04.16.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Oct 2019 04:16:11 -0700 (PDT) Subject: Re: svn commit: r353037 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/... To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201910031108.x93B8kbw022026@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Thu, 3 Oct 2019 14:16:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201910031108.x93B8kbw022026@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kVnC0XSlz3y73 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.170 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.20 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.20)[ip: (-0.50), ipnet: 209.85.128.0/17(-3.27), asn: 15169(-2.16), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[170.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[170.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 11:16:15 -0000 On 03/10/2019 14:08, Andriy Gapon wrote: > Author: avg > Date: Thu Oct 3 11:08:45 2019 > New Revision: 353037 > URL: https://svnweb.freebsd.org/changeset/base/353037 > > Log: > ZFS: add bookmark renaming > > The feature is implemented as an extension of the existing > ZFS_IOC_RENAME ioctl. Both the userland and the DSL interfaces support > renaming only a single bookmark at a time. As of now, there is no ZCP > interface to the new functionality. I am going to add it once the DSL > interface passes a test of time. > > This change picks up support for zfs_ioc_namecheck_t::ENTITY_NAME that > was added to ZoL as part of Redacted Send/Receive feature by Paul > Dagnelie . This is needed to allow a bookmark name in > zc_name. MFC after: 2 weeks -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Oct 3 11:20:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71BE9131AFA; Thu, 3 Oct 2019 11:20:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kVtd1ZfSz3yPf; Thu, 3 Oct 2019 11:20:57 +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 1AC65B352; Thu, 3 Oct 2019 11:20:57 +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 x93BKux5029042; Thu, 3 Oct 2019 11:20:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93BKuDn029041; Thu, 3 Oct 2019 11:20:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031120.x93BKuDn029041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 11:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353038 - releng/12.1/sys/netinet6 X-SVN-Group: releng X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: releng/12.1/sys/netinet6 X-SVN-Commit-Revision: 353038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 11:20:57 -0000 Author: tuexen Date: Thu Oct 3 11:20:56 2019 New Revision: 353038 URL: https://svnweb.freebsd.org/changeset/base/353038 Log: MFS r352672: When processing an incoming IPv6 packet over the loopback interface which contains Hop-by-Hop options, the mbuf chain is potentially changed in ip6_hopopts_input(), called by ip6_input_hbh(). This can happen, because of the the use of IP6_EXTHDR_CHECK, which might call m_pullup(). So provide the updated pointer back to the called of ip6_input_hbh() to avoid using a freed mbuf chain inip6_input(). Approved by: re (kib@) Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21664 Modified: releng/12.1/sys/netinet6/ip6_input.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/netinet6/ip6_input.c ============================================================================== --- releng/12.1/sys/netinet6/ip6_input.c Thu Oct 3 11:08:45 2019 (r353037) +++ releng/12.1/sys/netinet6/ip6_input.c Thu Oct 3 11:20:56 2019 (r353038) @@ -404,20 +404,22 @@ VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_TH #endif static int -ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, +ip6_input_hbh(struct mbuf **mp, uint32_t *plen, uint32_t *rtalert, int *off, int *nxt, int *ours) { + struct mbuf *m; struct ip6_hdr *ip6; struct ip6_hbh *hbh; - if (ip6_hopopts_input(plen, rtalert, &m, off)) { + if (ip6_hopopts_input(plen, rtalert, mp, off)) { #if 0 /*touches NULL pointer*/ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); + in6_ifstat_inc((*mp)->m_pkthdr.rcvif, ifs6_in_discard); #endif goto out; /* m have already been freed */ } /* adjust pointer */ + m = *mp; ip6 = mtod(m, struct ip6_hdr *); /* @@ -857,7 +859,7 @@ passin: */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - if (ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours) != 0) + if (ip6_input_hbh(&m, &plen, &rtalert, &off, &nxt, &ours) != 0) return; } else nxt = ip6->ip6_nxt; From owner-svn-src-all@freebsd.org Thu Oct 3 11:23:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31DF4131CE6; Thu, 3 Oct 2019 11:23:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kVxF0V7Tz3ylR; Thu, 3 Oct 2019 11:23:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8409B4FC; Thu, 3 Oct 2019 11:23:12 +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 x93BNCrx033972; Thu, 3 Oct 2019 11:23:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93BNAYb033960; Thu, 3 Oct 2019 11:23:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910031123.x93BNAYb033960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 3 Oct 2019 11:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353039 - in head: libexec/rc libexec/rc/rc.d sbin/init share/examples/jails share/man/man5 share/man/man8 usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: libexec/rc libexec/rc/rc.d sbin/init share/examples/jails share/man/man5 share/man/man8 usr.sbin/jail X-SVN-Commit-Revision: 353039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 11:23:13 -0000 Author: avg Date: Thu Oct 3 11:23:10 2019 New Revision: 353039 URL: https://svnweb.freebsd.org/changeset/base/353039 Log: add ability to set watchdog timeout for a shutdown This change allows to specify a watchdog(9) timeout for a system shutdown. The timeout is activated when the watchdogd daemon is stopped. The idea is to a prevent any indefinite hang during late stages of the shutdown. The feature is implemented in rc.d/watchdogd, it builds upon watchdogd -x option. Note that the shutdown timeout is not actiavted when the watchdogd service is individually stopped by an operator. It is also not activated for the 'shutdown' to the single-user mode. In those cases it is assumed that the operator knows what they are doing and they have means to recover the system should it hang. Significant subchanges and implementation details: - the argument to rc.shutdown, completely unused before, is assigned to rc_shutdown variable that can be inspected by rc scripts - init(8) passes "single" or "reboot" as the argument, this is not changed - the argument is not mandatory and if it is not set then rc_shutdown is set to "unspecified" - however, the default jail management scripts and jail configuration examples have been updated to pass "jail" to rc.shutdown, just in case - the new timeout can be set via watchdogd_shutdown_timeout rc option - for consistency, the regular timeout can now be set via watchdogd_timeout rc option - watchdogd_shutdown_timeout and watchdogd_timeout override timeout specifications in watchdogd_flags - existing configurations, where the new rc options are not set, should keep working as before I am not particularly wed to any of the implementation specifics. I am open to changing or removing any of them as long as the provided functionality is the same (or very close) to the proposed one. For example, I think it can be implemented without using watchdogd -x, by means of watchdog(1) alone. In that case there would be a small window between stopping watchdogd and running watchdog, but I think that that is acceptable. Reviewed by: bcr (man page changes) MFC after: 5 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D21221 Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.d/jail head/libexec/rc/rc.d/watchdogd head/libexec/rc/rc.shutdown head/sbin/init/init.8 head/share/examples/jails/jail.xxx.conf head/share/examples/jails/jib head/share/examples/jails/jng head/share/man/man5/rc.conf.5 head/share/man/man8/rc.8 head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.conf.5 Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Thu Oct 3 11:20:56 2019 (r353038) +++ head/libexec/rc/rc.conf Thu Oct 3 11:23:10 2019 (r353039) @@ -679,6 +679,10 @@ harvest_mask="511" # Entropy device harvests all but t dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) +watchdogd_timeout="" # watchdogd timeout, overrides -t in watchdogd_flags +watchdogd_shutdown_timeout="" # Timeout to use after watchdogd is stopped. + # Has effect only for system shutdown. + # Overrides -x in watchdogd_flags. devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing # devfs(8) rules. devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev Modified: head/libexec/rc/rc.d/jail ============================================================================== --- head/libexec/rc/rc.d/jail Thu Oct 3 11:20:56 2019 (r353038) +++ head/libexec/rc/rc.d/jail Thu Oct 3 11:23:10 2019 (r353039) @@ -168,7 +168,7 @@ parse_options() if [ -z "${_exec_start}" ]; then _exec_start="/bin/sh /etc/rc" if [ -z "${_exec_stop}" ]; then - _exec_stop="/bin/sh /etc/rc.shutdown" + _exec_stop="/bin/sh /etc/rc.shutdown jail" fi fi fi Modified: head/libexec/rc/rc.d/watchdogd ============================================================================== --- head/libexec/rc/rc.d/watchdogd Thu Oct 3 11:20:56 2019 (r353038) +++ head/libexec/rc/rc.d/watchdogd Thu Oct 3 11:23:10 2019 (r353039) @@ -38,9 +38,55 @@ desc="Watchdog daemon" rcvar="watchdogd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" +start_precmd="watchdogd_prestart" +stop_precmd="watchdogd_prestop" +stop_postcmd="watchdogd_poststop" +watchdog_command="/usr/sbin/watchdog" -load_rc_config $name +watchdogd_prestart() +{ + if [ -n "${watchdogd_timeout}" ] ; then + rc_flags="${rc_flags} -t ${watchdogd_timeout}" + fi + if [ -n "$watchdogd_shutdown_timeout" ] ; then + rc_flags="${rc_flags} -x ${watchdogd_shutdown_timeout}" + fi + return 0 +} -sig_stop="${watchdogd_sig_stop:-TERM}" +watchdogd_prestop() +{ + sig_stop="${watchdogd_sig_stop:-TERM}" +} +watchdogd_poststop() +{ + if [ ${watchdogd_shutdown_timeout:-0} -gt 0 ] ; then + case "${rc_shutdown}" in + "reboot") + info "watchdog timer is set to" \ + ${watchdogd_shutdown_timeout} "before shutdown" + return 0 + ;; + "single") + info "watchdog timer is disabled before going to" \ + "single user mode" + ${watchdog_command} -t 0 + ;; + "") + info "watchdog timer is disabled after administrative" \ + "${name} stop" + ${watchdog_command} -t 0 + ;; + *) + warn "unknown shutdown mode '${rc_shutdown}'" + warn "watchdog timer is set to ${watchdogd_shutdown_timeout}" + return 0 + ;; + esac + fi + return 0 +} + +load_rc_config $name run_rc_command "$1" Modified: head/libexec/rc/rc.shutdown ============================================================================== --- head/libexec/rc/rc.shutdown Thu Oct 3 11:20:56 2019 (r353038) +++ head/libexec/rc/rc.shutdown Thu Oct 3 11:23:10 2019 (r353039) @@ -43,6 +43,8 @@ HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin export HOME PATH +rc_shutdown=${1:-"unspecified"} + . /etc/rc.subr load_rc_config Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Thu Oct 3 11:20:56 2019 (r353038) +++ head/sbin/init/init.8 Thu Oct 3 11:23:10 2019 (r353039) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 15, 2018 +.Dd August 6, 2019 .Dt INIT 8 .Os .Sh NAME @@ -269,6 +269,15 @@ The timeout can be configured via the .Xr sysctl 8 variable .Va kern.init_shutdown_timeout . +.Pp +.Nm init +passes +.Dq Li single +as the argument to the shutdown script if return to single-user mode +is requested. +Otherwise, +.Dq Li reboot +argument is used. .Pp The role of .Nm Modified: head/share/examples/jails/jail.xxx.conf ============================================================================== --- head/share/examples/jails/jail.xxx.conf Thu Oct 3 11:20:56 2019 (r353038) +++ head/share/examples/jails/jail.xxx.conf Thu Oct 3 11:23:10 2019 (r353039) @@ -23,7 +23,7 @@ xxx { # Standard recipe exec.start += "/bin/sh /etc/rc"; - exec.stop = "/bin/sh /etc/rc.shutdown"; + exec.stop = "/bin/sh /etc/rc.shutdown jail"; exec.consolelog = "/var/log/jail_xxx_console.log"; mount.devfs; # mount devfs Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Thu Oct 3 11:20:56 2019 (r353038) +++ head/share/examples/jails/jib Thu Oct 3 11:23:10 2019 (r353039) @@ -67,7 +67,7 @@ # # # Standard recipe # exec.start += "/bin/sh /etc/rc"; -# exec.stop = "/bin/sh /etc/rc.shutdown"; +# exec.stop = "/bin/sh /etc/rc.shutdown jail"; # exec.consolelog = "/var/log/jail_xxx_console.log"; # mount.devfs; # Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Thu Oct 3 11:20:56 2019 (r353038) +++ head/share/examples/jails/jng Thu Oct 3 11:23:10 2019 (r353039) @@ -67,7 +67,7 @@ # # # Standard recipe # exec.start += "/bin/sh /etc/rc"; -# exec.stop = "/bin/sh /etc/rc.shutdown"; +# exec.stop = "/bin/sh /etc/rc.shutdown jail"; # exec.consolelog = "/var/log/jail_xxx_console.log"; # mount.devfs; # Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Oct 3 11:20:56 2019 (r353038) +++ head/share/man/man5/rc.conf.5 Thu Oct 3 11:23:10 2019 (r353039) @@ -3738,6 +3738,41 @@ is set to these are the flags passed to the .Xr watchdogd 8 daemon. +.It Va watchdogd_timeout +.Pq Vt int +If +.Va watchdogd_enable +is set to +.Dq Li YES , +this is a timeout that will be used by the +.Xr watchdogd 8 +daemon. +If this option is set, it overrides +.Fl t +in +.Va watchdogd_flags . +.It Va watchdogd_shutdown_timeout +.Pq Vt int +If +.Va watchdogd_enable +is set to +.Dq Li YES , +this is a timeout that will be set by the +.Xr watchdogd 8 +daemon when it exits during the system shutdown. +This timeout will not be set when returning to the single-user mode +or when the watchdogd service is stopped individually using the +.Xr service 8 +command or the rc.d script. +Note that the timeout will be applied if +.Xr watchdogd 8 +is stopped outside of +.Xr rc 8 +framework. +If this option is set, it overrides +.Fl x +in +.Va watchdogd_flags . .It Va devfs_rulesets .Pq Vt str List of files containing sets of rules for Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Thu Oct 3 11:20:56 2019 (r353038) +++ head/share/man/man8/rc.8 Thu Oct 3 11:23:10 2019 (r353039) @@ -189,6 +189,14 @@ also exists (because it was created by a script), then .Ss Operation of Nm rc.shutdown .Bl -enum .It +Set +.Va rc_shutdown +to the value of the first argument passed to +.Nm rc.shutdown +or to +.Dq Li unspecified +if no argument was passed. +.It Source .Pa /etc/rc.subr to load various Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Oct 3 11:20:56 2019 (r353038) +++ head/usr.sbin/jail/jail.8 Thu Oct 3 11:23:10 2019 (r353039) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2019 +.Dd August 6, 2019 .Dt JAIL 8 .Os .Sh NAME @@ -681,7 +681,7 @@ A value of .Dq inherit will keep the same environment, and .Dq new -will give the jail it's own environment (still originally inherited when +will give the jail its own environment (still originally inherited when the jail is created). .It Va linux.osname , linux.osrelease , linux.oss_version The Linux OS name, OS release, and OSS version associated with this jail. @@ -754,7 +754,7 @@ and after any .Va exec.prestop commands have completed. A typical command to run is -.Dq sh /etc/rc.shutdown . +.Dq sh /etc/rc.shutdown jail . .It Va exec.poststop Command(s) to run in the system environment after a jail is removed. .It Va exec.clean @@ -1103,7 +1103,7 @@ testjail { ip4.addr = 192.0.2.100; interface = em0; exec.start = "/bin/sh /etc/rc"; - exec.stop = "/bin/sh /etc/rc.shutdown"; + exec.stop = "/bin/sh /etc/rc.shutdown jail"; } .Ed .Pp Modified: head/usr.sbin/jail/jail.conf.5 ============================================================================== --- head/usr.sbin/jail/jail.conf.5 Thu Oct 3 11:20:56 2019 (r353038) +++ head/usr.sbin/jail/jail.conf.5 Thu Oct 3 11:23:10 2019 (r353039) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd August 6, 2019 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -182,7 +182,7 @@ in the middle of a string or a token. # Typical static defaults: # Use the rc scripts to start and stop jails. Mount jail's /dev. exec.start = "/bin/sh /etc/rc"; -exec.stop = "/bin/sh /etc/rc.shutdown"; +exec.stop = "/bin/sh /etc/rc.shutdown jail"; exec.clean; mount.devfs; From owner-svn-src-all@freebsd.org Thu Oct 3 11:55:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C036A13269C; Thu, 3 Oct 2019 11:55:29 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kWfT17zSz419p; Thu, 3 Oct 2019 11:55:28 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x441.google.com with SMTP id a2so1598632pfo.10; Thu, 03 Oct 2019 04:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mx9dwPf1nnqQqthjgnzg6azHfQt034za+zDeFjQ0WHo=; b=C9HqeUi/1xQ+T1U+eX4k8V02+VaNHlgXXSUvaw7BqUTg+UvCbReSGk59PzuE/PM1Hd 0Tpb/TOTIRA5aDcKYfqelA4dRuGUwkvNuVtBktTVfex9eCT0crSlG7lkQjSR+k2i7DOt iHPid/0EoYTBq/zhPZcYOyMtHsy9EVWDXOIHLMhz5RNLbqKQw60HfLc1iQXCIYYfYTf5 atmcbhTSvR+WMJ+vVMWUNOelnamF/GZ5/zW8cQtezfj3NakUVWPFRUYPpzYYBNLG7RVt igz4TP7PoBeLxHyH18PStPapx5YFJHkcOKFxFDvMSg0XSePnG8Zz//LAd5J/F7o58INP mS5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mx9dwPf1nnqQqthjgnzg6azHfQt034za+zDeFjQ0WHo=; b=NROHP3xJr7Afx6Mg8qWUOBngpgj/elturccadAXzCldzfZYDSFqlrYbcuEYdyYY2iF qZMSEgC+tVWBqn62YdpzEpJTAShsCUOZIP8F7guJCr5/jGxwo8YYEY6cV43HSFtEEJ0x EnpZ8NySIKSrdOlz+hnZxjrv5T037HXsl7fMrntqw7Gc01R+z0NDBKuLdELVlDNzlZFF qljS64EeQ4na5nzRE6Ms7h9j6cBqvxyFFzLeiu8teaa3i3Bw0g6u6E/IxA1PHrUibRNY 3RxV3Ks9oixZMyHUvM894yRSkw6sIGvPVUeyMY/XnPXICi6j/V0U0XNdoOaUs5iDDFe3 rjbw== X-Gm-Message-State: APjAAAWuiAYfujRm5MDCRfHbR1j8YI0fEDz6wVn2cOnN/uhvum26T0k7 qHRt9gh4RYFfrlMZx+//+jnDJRH8 X-Google-Smtp-Source: APXvYqwMXrAoCSbLPOoy4VnbaBQVaMQkNGTg0L+4OKZu4H4+NYr6Zce4gSq+2rgV8G2fqR8QO2EEKg== X-Received: by 2002:a63:8c52:: with SMTP id q18mr9109451pgn.284.1570103727404; Thu, 03 Oct 2019 04:55:27 -0700 (PDT) Received: from [192.168.1.105] (180-150-68-130.b49644.syd.nbn.aussiebb.net. [180.150.68.130]) by smtp.gmail.com with ESMTPSA id h68sm3118223pfb.149.2019.10.03.04.55.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Oct 2019 04:55:26 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r352953 - in head/usr.bin: killall split To: Kyle Evans , Conrad Meyer Cc: Alexander Kabaev , src-committers , svn-src-all , svn-src-head References: <201910020615.x926FUJj091147@repo.freebsd.org> From: Kubilay Kocak Message-ID: <0faf5475-b409-5d4c-da0a-4ec9b9c66e1d@FreeBSD.org> Date: Thu, 3 Oct 2019 21:55:20 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kWfT17zSz419p X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=C9HqeUi/; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::441 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-3.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; IP_SCORE(-1.06)[ip: (-0.51), ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-2.16), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 11:55:29 -0000 On 2/10/2019 9:59 pm, Kyle Evans wrote: > Sorry for the crap formatting, mobile. > > We can perhaps also fix this class with a proper modelling file. koobs was > going to send out an email about it, but I haven't seen anything. Thanks for the public reminder Kyle :] I'll flick it out soon > On Wed, Oct 2, 2019, 02:03 Conrad Meyer wrote: > >> Hi Alexander, >> >> Coverity has millions of spurious warnings of this class and they're >> basically all false positives. I think we should instead try to >> figure out how to disable this class of warning on our codebase, since >> it is largely incorrect. >> >> I would encourage reverting this change, because it uglies up the code >> for no functional benefit. The code was correct before the change; >> only Coverity was wrong. >> >> Best, >> Conrad >> >> On Tue, Oct 1, 2019 at 11:15 PM Alexander Kabaev wrote: >>> >>> Author: kan >>> Date: Wed Oct 2 06:15:30 2019 >>> New Revision: 352953 >>> URL: https://svnweb.freebsd.org/changeset/base/352953 >>> >>> Log: >>> Convert pnmatch to single element array in regexec calls >>> >>> The regexec function is declared as taking an array of regmatch_t >>> elements, and passing in the pointer to singleton element, while >>> correct, triggers a Coverity warning. Convert the singleton into >>> an array of one to silence the warning. >>> >>> Reported by: Coverity >>> Coverity CID: 1009732, 1009733 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/usr.bin/killall/killall.c >>> head/usr.bin/split/split.c >>> >>> Modified: head/usr.bin/killall/killall.c >>> >> ============================================================================== >>> --- head/usr.bin/killall/killall.c Wed Oct 2 02:37:34 2019 >> (r352952) >>> +++ head/usr.bin/killall/killall.c Wed Oct 2 06:15:30 2019 >> (r352953) >>> @@ -98,7 +98,7 @@ main(int ac, char **av) >>> struct stat sb; >>> struct passwd *pw; >>> regex_t rgx; >>> - regmatch_t pmatch; >>> + regmatch_t pmatch[1]; >>> int i, j, ch; >>> char buf[256]; >>> char first; >>> @@ -361,9 +361,9 @@ main(int ac, char **av) >>> } >>> } >>> if (mflag) { >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = strlen(thiscmd); >>> - if (regexec(&rgx, thiscmd, 0, &pmatch, >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = strlen(thiscmd); >>> + if (regexec(&rgx, thiscmd, 0, pmatch, >>> REG_STARTEND) != 0) >>> matched = 0; >>> regfree(&rgx); >>> @@ -387,9 +387,9 @@ main(int ac, char **av) >>> } >>> } >>> if (mflag) { >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = strlen(thiscmd); >>> - if (regexec(&rgx, thiscmd, 0, &pmatch, >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = strlen(thiscmd); >>> + if (regexec(&rgx, thiscmd, 0, pmatch, >>> REG_STARTEND) == 0) >>> matched = 1; >>> regfree(&rgx); >>> >>> Modified: head/usr.bin/split/split.c >>> >> ============================================================================== >>> --- head/usr.bin/split/split.c Wed Oct 2 02:37:34 2019 (r352952) >>> +++ head/usr.bin/split/split.c Wed Oct 2 06:15:30 2019 (r352953) >>> @@ -281,11 +281,11 @@ split2(void) >>> >>> /* Check if we need to start a new file */ >>> if (pflag) { >>> - regmatch_t pmatch; >>> + regmatch_t pmatch[1]; >>> >>> - pmatch.rm_so = 0; >>> - pmatch.rm_eo = len - 1; >>> - if (regexec(&rgx, bfr, 0, &pmatch, REG_STARTEND) >> == 0) >>> + pmatch[0].rm_so = 0; >>> + pmatch[0].rm_eo = len - 1; >>> + if (regexec(&rgx, bfr, 0, pmatch, REG_STARTEND) >> == 0) >>> newfile(); >>> } else if (lcnt++ == numlines) { >>> newfile(); >> > From owner-svn-src-all@freebsd.org Thu Oct 3 12:26:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90A171344CF; Thu, 3 Oct 2019 12:26:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kXLm3PLsz43HS; Thu, 3 Oct 2019 12:26:56 +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 596F2C180; Thu, 3 Oct 2019 12:26:56 +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 x93CQukr069166; Thu, 3 Oct 2019 12:26:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93CQu9N069164; Thu, 3 Oct 2019 12:26:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031226.x93CQu9N069164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 12:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353040 - in releng/12.1/sys/netinet: . tcp_stacks X-SVN-Group: releng X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in releng/12.1/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 353040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 12:26:56 -0000 Author: tuexen Date: Thu Oct 3 12:26:55 2019 New Revision: 353040 URL: https://svnweb.freebsd.org/changeset/base/353040 Log: MFS r352673: When the RACK stack computes the space for user data in a TCP segment, it wasn't taking the IP level options into account. This patch fixes this. In addition, it also corrects a KASSERT and adds protection code to assure that the IP header chain and the TCP head fit in the first fragment as required by RFC 7112. MFS: r353035: RFC 7112 requires a host to put the complete IP header chain including the TCP header in the first IP packet. Enforce this in tcp_output(). In addition make sure that at least one byte payload fits in the TCP segement to allow making progress. Without this check, a kernel with INVARIANTS will panic. This issue was found by running an instance of syzkaller. Approved by: re (kib@) Reviewed by: rrs@ (r352673), jtl@ (r353035) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21665 Differential Revision: https://reviews.freebsd.org/D21666 Modified: releng/12.1/sys/netinet/tcp_output.c releng/12.1/sys/netinet/tcp_stacks/rack.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/netinet/tcp_output.c ============================================================================== --- releng/12.1/sys/netinet/tcp_output.c Thu Oct 3 11:23:10 2019 (r353039) +++ releng/12.1/sys/netinet/tcp_output.c Thu Oct 3 12:26:55 2019 (r353040) @@ -931,6 +931,20 @@ send: if (tp->t_flags & TF_NEEDFIN) sendalot = 1; } else { + if (optlen + ipoptlen >= tp->t_maxseg) { + /* + * Since we don't have enough space to put + * the IP header chain and the TCP header in + * one packet as required by RFC 7112, don't + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. + */ + SOCKBUF_UNLOCK(&so->so_snd); + error = EMSGSIZE; + sack_rxmit = 0; + goto out; + } len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; if (dont_sendalot) Modified: releng/12.1/sys/netinet/tcp_stacks/rack.c ============================================================================== --- releng/12.1/sys/netinet/tcp_stacks/rack.c Thu Oct 3 11:23:10 2019 (r353039) +++ releng/12.1/sys/netinet/tcp_stacks/rack.c Thu Oct 3 12:26:55 2019 (r353040) @@ -7872,7 +7872,16 @@ send: hdrlen += sizeof(struct udphdr); } #endif - ipoptlen = 0; +#ifdef INET6 + if (isipv6) + ipoptlen = ip6_optlen(tp->t_inpcb); + else +#endif + if (tp->t_inpcb->inp_options) + ipoptlen = tp->t_inpcb->inp_options->m_len - + offsetof(struct ipoption, ipopt_list); + else + ipoptlen = 0; #if defined(IPSEC) || defined(IPSEC_SUPPORT) ipoptlen += ipsec_optlen; #endif @@ -7945,6 +7954,20 @@ send: sendalot = 1; } else { + if (optlen + ipoptlen >= tp->t_maxseg) { + /* + * Since we don't have enough space to put + * the IP header chain and the TCP header in + * one packet as required by RFC 7112, don't + * send it. Also ensure that at least one + * byte of the payload can be put into the + * TCP segment. + */ + SOCKBUF_UNLOCK(&so->so_snd); + error = EMSGSIZE; + sack_rxmit = 0; + goto out; + } len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; } @@ -8438,15 +8461,9 @@ send: m->m_pkthdr.csum_flags |= CSUM_TSO; m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen; } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", - __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); -#else - KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", - __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); -#endif + KASSERT(len + hdrlen == m_length(m, NULL), + ("%s: mbuf chain different than expected: %d + %u != %u", + __func__, len, hdrlen, m_length(m, NULL))); #ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ From owner-svn-src-all@freebsd.org Thu Oct 3 12:47:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E53C5134C13; Thu, 3 Oct 2019 12:47:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kXp15gPjz44Dr; Thu, 3 Oct 2019 12:47:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6819C51F; Thu, 3 Oct 2019 12:47: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 x93Cl5TT080659; Thu, 3 Oct 2019 12:47:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Cl5eb080658; Thu, 3 Oct 2019 12:47:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910031247.x93Cl5eb080658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 12:47: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: r353041 - in stable: 11/sys/dev/fdt 12/sys/dev/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/fdt 12/sys/dev/fdt X-SVN-Commit-Revision: 353041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 12:47:06 -0000 Author: kevans Date: Thu Oct 3 12:47:05 2019 New Revision: 353041 URL: https://svnweb.freebsd.org/changeset/base/353041 Log: MFC r352863: fdt_slicer: bump to SI_ORDER_THIRD following r347183 r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between them and the initialization of devsoftc.mtx in devinit, but missed this dependency on g_flashmap that may now lose the race against GEOM classes/g_init. There's a great comment that describes the situation that has also been updated with the new ordering of GEOM classes. Modified: stable/11/sys/dev/fdt/fdt_slicer.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/fdt/fdt_slicer.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/fdt/fdt_slicer.c ============================================================================== --- stable/11/sys/dev/fdt/fdt_slicer.c Thu Oct 3 12:26:55 2019 (r353040) +++ stable/11/sys/dev/fdt/fdt_slicer.c Thu Oct 3 12:47:05 2019 (r353041) @@ -159,12 +159,12 @@ fdt_slicer_cleanup(void) } /* - * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), + * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); -SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL); static int mod_handler(module_t mod, int type, void *data) @@ -181,5 +181,5 @@ static moduledata_t fdt_slicer_mod = { "fdt_slicer", mod_handler, NULL }; -DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); MODULE_VERSION(fdt_slicer, 1); From owner-svn-src-all@freebsd.org Thu Oct 3 12:47:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F32E134C1A; Thu, 3 Oct 2019 12:47:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kXp20xqYz44Ds; Thu, 3 Oct 2019 12:47: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 03D27C520; Thu, 3 Oct 2019 12:47:06 +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 x93Cl5sL080665; Thu, 3 Oct 2019 12:47:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Cl5gm080664; Thu, 3 Oct 2019 12:47:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910031247.x93Cl5gm080664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 12:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353041 - in stable: 11/sys/dev/fdt 12/sys/dev/fdt X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/fdt 12/sys/dev/fdt X-SVN-Commit-Revision: 353041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 12:47:06 -0000 Author: kevans Date: Thu Oct 3 12:47:05 2019 New Revision: 353041 URL: https://svnweb.freebsd.org/changeset/base/353041 Log: MFC r352863: fdt_slicer: bump to SI_ORDER_THIRD following r347183 r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between them and the initialization of devsoftc.mtx in devinit, but missed this dependency on g_flashmap that may now lose the race against GEOM classes/g_init. There's a great comment that describes the situation that has also been updated with the new ordering of GEOM classes. Modified: stable/12/sys/dev/fdt/fdt_slicer.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/fdt/fdt_slicer.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/fdt/fdt_slicer.c ============================================================================== --- stable/12/sys/dev/fdt/fdt_slicer.c Thu Oct 3 12:26:55 2019 (r353040) +++ stable/12/sys/dev/fdt/fdt_slicer.c Thu Oct 3 12:47:05 2019 (r353041) @@ -159,12 +159,12 @@ fdt_slicer_cleanup(void) } /* - * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), + * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); -SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL); static int mod_handler(module_t mod, int type, void *data) @@ -181,5 +181,5 @@ static moduledata_t fdt_slicer_mod = { "fdt_slicer", mod_handler, NULL }; -DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); MODULE_VERSION(fdt_slicer, 1); From owner-svn-src-all@freebsd.org Thu Oct 3 12:51:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E9D3134F22; Thu, 3 Oct 2019 12:51: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kXvf3mn2z44jc; Thu, 3 Oct 2019 12:51: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 4ABEEC6A9; Thu, 3 Oct 2019 12:51:58 +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 x93CpwBq085760; Thu, 3 Oct 2019 12:51:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Cpv8h085757; Thu, 3 Oct 2019 12:51:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910031251.x93Cpv8h085757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 3 Oct 2019 12:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353042 - in head: . sys/amd64/conf sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . sys/amd64/conf sys/i386/conf X-SVN-Commit-Revision: 353042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 12:51:58 -0000 Author: emaste Date: Thu Oct 3 12:51:57 2019 New Revision: 353042 URL: https://svnweb.freebsd.org/changeset/base/353042 Log: Remove host binary object drivers from GENERIC Four drivers (hpt27xx, hptmv, hptnr, hptrr, hpt27xx) include precompiled binary objects; have users load them as modules if they are needed. Additional work (i.e., integrating devmatch) required before MFC. Reviewed by: markj Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21865 Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 3 12:47:05 2019 (r353041) +++ head/UPDATING Thu Oct 3 12:51:57 2019 (r353042) @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20191003: + The hpt27xx, hptmv, hptnr, and hptrr drivers have been removed from + GENERIC. They are available as modules and can be loaded by adding + to /boot/loader.conf hpt27xx_load="YES", hptmv_load="YES", + hptnr_load="YES", or hptrr_load="YES", respectively. + 20190913: ntpd no longer by default locks its pages in memory, allowing them to be paged out by the kernel. Use rlimit memlock to restore Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Oct 3 12:47:05 2019 (r353041) +++ head/sys/amd64/conf/GENERIC Thu Oct 3 12:51:57 2019 (r353042) @@ -165,10 +165,6 @@ device ses # Enclosure Services (SES and SAF-TE) device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Oct 3 12:47:05 2019 (r353041) +++ head/sys/i386/conf/GENERIC Thu Oct 3 12:51:57 2019 (r353042) @@ -151,10 +151,6 @@ device ses # Enclosure Services (SES and SAF-TE) device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID From owner-svn-src-all@freebsd.org Thu Oct 3 13:02:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C18A13548A; Thu, 3 Oct 2019 13:02:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kY7K068sz45bM; Thu, 3 Oct 2019 13:02:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB455C87E; Thu, 3 Oct 2019 13:02:04 +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 x93D24lT092552; Thu, 3 Oct 2019 13:02:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93D245I092551; Thu, 3 Oct 2019 13:02:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910031302.x93D245I092551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 3 Oct 2019 13:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353043 - stable/12/usr.bin/bsdiff/bspatch X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/bsdiff/bspatch X-SVN-Commit-Revision: 353043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 13:02:05 -0000 Author: emaste Date: Thu Oct 3 13:02:04 2019 New Revision: 353043 URL: https://svnweb.freebsd.org/changeset/base/353043 Log: MFC r352742: bspatch: add integer overflow checks Introduce a new add_off_t static function that exits with an error message if there's an overflow, otherwise returns their sum. Use this when adding values obtained from the input patch. Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/bsdiff/bspatch/bspatch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/12/usr.bin/bsdiff/bspatch/bspatch.c Thu Oct 3 12:51:57 2019 (r353042) +++ stable/12/usr.bin/bsdiff/bspatch/bspatch.c Thu Oct 3 13:02:04 2019 (r353043) @@ -62,6 +62,23 @@ exit_cleanup(void) warn("unlinkat"); } +static inline off_t +add_off_t(off_t a, off_t b) +{ + off_t result; + +#if __GNUC__ >= 5 || \ + (defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) + if (__builtin_add_overflow(a, b, &result)) + errx(1, "Corrupt patch"); +#else + if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) + errx(1, "Corrupt patch"); + result = a + b; +#endif + return result; +} + static off_t offtin(u_char *buf) { off_t y; @@ -204,12 +221,12 @@ int main(int argc, char *argv[]) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - offset += bzctrllen; + offset = add_off_t(offset, bzctrllen); if (fseeko(dpf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - offset += bzdatalen; + offset = add_off_t(offset, bzdatalen); if (fseeko(epf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) @@ -243,7 +260,7 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Sanity-check */ - if (newpos + ctrl[0] > newsize) + if (add_off_t(newpos, ctrl[0]) > newsize) errx(1, "Corrupt patch"); /* Read diff string */ @@ -254,15 +271,15 @@ int main(int argc, char *argv[]) /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) - if ((oldpos + i >= 0) && (oldpos + i < oldsize)) + if (add_off_t(oldpos, i) < oldsize) new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos += ctrl[0]; - oldpos += ctrl[0]; + newpos = add_off_t(newpos, ctrl[0]); + oldpos = add_off_t(oldpos, ctrl[0]); /* Sanity-check */ - if (newpos + ctrl[1] > newsize) + if (add_off_t(newpos, ctrl[1]) > newsize) errx(1, "Corrupt patch"); /* Read extra string */ @@ -272,8 +289,8 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Adjust pointers */ - newpos+=ctrl[1]; - oldpos+=ctrl[2]; + newpos = add_off_t(newpos, ctrl[1]); + oldpos = add_off_t(oldpos, ctrl[2]); } /* Clean up the bzip2 reads */ From owner-svn-src-all@freebsd.org Thu Oct 3 13:03:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76DBF135539; Thu, 3 Oct 2019 13:03:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kY9K2X50z45lT; Thu, 3 Oct 2019 13:03:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B85AC8A7; Thu, 3 Oct 2019 13:03:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93D3n0U092780; Thu, 3 Oct 2019 13:03:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93D3ncI092779; Thu, 3 Oct 2019 13:03:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910031303.x93D3ncI092779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 3 Oct 2019 13:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r353044 - stable/11/usr.bin/bsdiff/bspatch X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/bsdiff/bspatch X-SVN-Commit-Revision: 353044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 13:03:49 -0000 Author: emaste Date: Thu Oct 3 13:03:48 2019 New Revision: 353044 URL: https://svnweb.freebsd.org/changeset/base/353044 Log: MFC r352742: bspatch: add integer overflow checks Introduce a new add_off_t static function that exits with an error message if there's an overflow, otherwise returns their sum. Use this when adding values obtained from the input patch. Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/11/usr.bin/bsdiff/bspatch/bspatch.c Thu Oct 3 13:02:04 2019 (r353043) +++ stable/11/usr.bin/bsdiff/bspatch/bspatch.c Thu Oct 3 13:03:48 2019 (r353044) @@ -62,6 +62,23 @@ exit_cleanup(void) warn("unlinkat"); } +static inline off_t +add_off_t(off_t a, off_t b) +{ + off_t result; + +#if __GNUC__ >= 5 || \ + (defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) + if (__builtin_add_overflow(a, b, &result)) + errx(1, "Corrupt patch"); +#else + if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) + errx(1, "Corrupt patch"); + result = a + b; +#endif + return result; +} + static off_t offtin(u_char *buf) { off_t y; @@ -204,12 +221,12 @@ int main(int argc, char *argv[]) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - offset += bzctrllen; + offset = add_off_t(offset, bzctrllen); if (fseeko(dpf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - offset += bzdatalen; + offset = add_off_t(offset, bzdatalen); if (fseeko(epf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) @@ -243,7 +260,7 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Sanity-check */ - if (newpos + ctrl[0] > newsize) + if (add_off_t(newpos, ctrl[0]) > newsize) errx(1, "Corrupt patch"); /* Read diff string */ @@ -254,15 +271,15 @@ int main(int argc, char *argv[]) /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) - if ((oldpos + i >= 0) && (oldpos + i < oldsize)) + if (add_off_t(oldpos, i) < oldsize) new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos += ctrl[0]; - oldpos += ctrl[0]; + newpos = add_off_t(newpos, ctrl[0]); + oldpos = add_off_t(oldpos, ctrl[0]); /* Sanity-check */ - if (newpos + ctrl[1] > newsize) + if (add_off_t(newpos, ctrl[1]) > newsize) errx(1, "Corrupt patch"); /* Read extra string */ @@ -272,8 +289,8 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Adjust pointers */ - newpos+=ctrl[1]; - oldpos+=ctrl[2]; + newpos = add_off_t(newpos, ctrl[1]); + oldpos = add_off_t(oldpos, ctrl[2]); } /* Clean up the bzip2 reads */ From owner-svn-src-all@freebsd.org Thu Oct 3 13:30:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA28A13603D; Thu, 3 Oct 2019 13:30:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kYmV50Q7z47TG; Thu, 3 Oct 2019 13:30:50 +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 8F19CCC75; Thu, 3 Oct 2019 13:30:50 +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 x93DUoGY006848; Thu, 3 Oct 2019 13:30:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93DUns6006842; Thu, 3 Oct 2019 13:30:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031330.x93DUns6006842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 13:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353045 - releng/12.1/sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: releng/12.1/sys/netinet X-SVN-Commit-Revision: 353045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 13:30:50 -0000 Author: tuexen Date: Thu Oct 3 13:30:48 2019 New Revision: 353045 URL: https://svnweb.freebsd.org/changeset/base/353045 Log: MFS r352509: Only allow a SCTP-AUTH shared key to be updated by the application if it is not deactivated and not used. This avoids a use-after-free problem. MFS r352674: Fix the handling of invalid parameters in ASCONF chunks. Thanks to Mark Wodrich from Google for reproting the issue in https://github.com/sctplab/usrsctp/issues/376 for the userland stack. MFS r352675: Cleanup the RTO calculation and perform some consistency checks before computing the RTO. This should fix an overflow issue reported by Felix Weinrank in https://github.com/sctplab/usrsctp/issues/375 for the userland stack and found by running a fuzz tester. MFS r352676: Don't hold the info lock when calling sctp_select_a_tag(). This avoids a double lock bug in the NAT colliding state processing of SCTP. Thanks to Felix Weinrank for finding and reporting this issue in https://github.com/sctplab/usrsctp/issues/374 He found this bug using fuzz testing. MFS r353034: Plumb a memory leak. Thanks to Felix Weinrank for finding this issue using fuzz testing and reporting it for the userland stack: https://github.com/sctplab/usrsctp/issues/378 MFS r353036: Don't use stack memory which is not initialized. Thanks to Mark Wodrich for reporting this issue for the userland stack in https://github.com/sctplab/usrsctp/issues/380 This issue was also found for usrsctp by OSS-fuzz in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17778 Approved by: re (kib@) Modified: releng/12.1/sys/netinet/sctp_asconf.c releng/12.1/sys/netinet/sctp_auth.c releng/12.1/sys/netinet/sctp_indata.c releng/12.1/sys/netinet/sctp_input.c releng/12.1/sys/netinet/sctputil.c releng/12.1/sys/netinet/sctputil.h Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/netinet/sctp_asconf.c ============================================================================== --- releng/12.1/sys/netinet/sctp_asconf.c Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctp_asconf.c Thu Oct 3 13:30:48 2019 (r353045) @@ -236,6 +236,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc "process_asconf_add_ip: using source addr "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } + net = NULL; /* add the address */ if (bad_address) { m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -250,17 +251,19 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph, aparam_length); } else { - /* notify upper layer */ - sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); - if (send_hb) { - sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + if (net != NULL) { + /* notify upper layer */ + sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } } return (m_reply); @@ -703,6 +706,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset if (param_length <= sizeof(struct sctp_paramhdr)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: param length (%u) too short\n", param_length); sctp_m_freem(m_ack); + return; } /* get the entire parameter */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, param_length, aparam_buf); Modified: releng/12.1/sys/netinet/sctp_auth.c ============================================================================== --- releng/12.1/sys/netinet/sctp_auth.c Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctp_auth.c Thu Oct 3 13:30:48 2019 (r353045) @@ -523,7 +523,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys } else if (new_skey->keyid == skey->keyid) { /* replace the existing key */ /* verify this key *can* be replaced */ - if ((skey->deactivated) && (skey->refcount > 1)) { + if ((skey->deactivated) || (skey->refcount > 1)) { SCTPDBG(SCTP_DEBUG_AUTH1, "can't replace shared key id %u\n", new_skey->keyid); Modified: releng/12.1/sys/netinet/sctp_indata.c ============================================================================== --- releng/12.1/sys/netinet/sctp_indata.c Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctp_indata.c Thu Oct 3 13:30:48 2019 (r353045) @@ -472,6 +472,11 @@ sctp_clean_up_control(struct sctp_tcb *stcb, struct sc chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } sctp_free_a_readq(stcb, control); } @@ -3108,13 +3113,12 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru * update RTO too ? */ if (tp1->do_rtt) { - if (*rto_ok) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - &stcb->asoc, - tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (*rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { *rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { @@ -4086,16 +4090,12 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 /* update RTO too? */ if (tp1->do_rtt) { - if (rto_ok) { - tp1->whoTo->RTO = - /* - * sa_ignore - * NO_NULL_CHK - */ - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { @@ -4704,12 +4704,12 @@ hopeless_peer: /* update RTO too? */ if (tp1->do_rtt) { - if (rto_ok) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { Modified: releng/12.1/sys/netinet/sctp_input.c ============================================================================== --- releng/12.1/sys/netinet/sctp_input.c Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctp_input.c Thu Oct 3 13:30:48 2019 (r353045) @@ -548,7 +548,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, initack_limit, stcb, net); return (retval); @@ -648,7 +648,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk tv.tv_sec = cp->heartbeat.hb_info.time_value_1; tv.tv_usec = cp->heartbeat.hb_info.time_value_2; /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, + sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, SCTP_RTT_FROM_NON_DATA); if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; @@ -703,34 +703,37 @@ static int sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) { /* - * return 0 means we want you to proceed with the abort non-zero - * means no abort processing + * Return 0 means we want you to proceed with the abort non-zero + * means no abort processing. */ + uint32_t new_vtag; struct sctpasochead *head; if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { + new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); + } else { + return (0); } if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); + stcb->asoc.my_vtag = new_vtag; head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* * put it in the bucket in the vtag hash of assoc's for the * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); SCTP_INP_INFO_WUNLOCK(); + sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); - } - if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { + } else { /* * treat like a case where the cookie expired i.e.: - dump * current cookie. - generate a new vtag. - resend init. @@ -740,15 +743,15 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); - stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); + stcb->asoc.my_vtag = new_vtag; head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* * put it in the bucket in the vtag hash of assoc's for the * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); SCTP_INP_INFO_WUNLOCK(); + sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); } return (0); @@ -1674,8 +1677,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; - net->RTO = sctp_calculate_rto(stcb, asoc, net, - &old, + sctp_calculate_rto(stcb, asoc, net, &old, SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && @@ -2399,8 +2401,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* calculate the RTT and set the encaps port */ old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; - (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &old, SCTP_RTT_FROM_NON_DATA); + sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2976,8 +2977,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c SCTP_STAT_INCR_COUNTER32(sctps_activeestab); SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { - net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); Modified: releng/12.1/sys/netinet/sctputil.c ============================================================================== --- releng/12.1/sys/netinet/sctputil.c Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctputil.c Thu Oct 3 13:30:48 2019 (r353045) @@ -2469,25 +2469,24 @@ sctp_mtu_size_reset(struct sctp_inpcb *inp, /* - * given an association and starting time of the current RTT period return - * RTO in number of msecs net should point to the current network + * Given an association and starting time of the current RTT period, update + * RTO in number of msecs. net should point to the current network. + * Return 1, if an RTO update was performed, return 0 if no update was + * performed due to invalid starting point. */ -uint32_t +int sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *old, int rtt_from_sack) { - /*- - * given an association and the starting time of the current RTT - * period (in value1/value2) return RTO in number of msecs. - */ + struct timeval now; + uint64_t rtt_us; /* RTT in us */ int32_t rtt; /* RTT in ms */ uint32_t new_rto; int first_measure = 0; - struct timeval now; /************************/ /* 1. calculate new RTT */ @@ -2498,10 +2497,19 @@ sctp_calculate_rto(struct sctp_tcb *stcb, } else { (void)SCTP_GETTIME_TIMEVAL(&now); } + if ((old->tv_sec > now.tv_sec) || + ((old->tv_sec == now.tv_sec) && (old->tv_sec > now.tv_sec))) { + /* The starting point is in the future. */ + return (0); + } timevalsub(&now, old); + rtt_us = (uint64_t)1000000 * (uint64_t)now.tv_sec + (uint64_t)now.tv_usec; + if (rtt_us > SCTP_RTO_UPPER_BOUND * 1000) { + /* The RTT is larger than a sane value. */ + return (0); + } /* store the current RTT in us */ - net->rtt = (uint64_t)1000000 * (uint64_t)now.tv_sec + - (uint64_t)now.tv_usec; + net->rtt = rtt_us; /* compute rtt in ms */ rtt = (int32_t)(net->rtt / 1000); if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) { @@ -2533,7 +2541,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb, * Paper "Congestion Avoidance and Control", Annex A. * * (net->lastsa >> SCTP_RTT_SHIFT) is the srtt - * (net->lastsa >> SCTP_RTT_VAR_SHIFT) is the rttvar + * (net->lastsv >> SCTP_RTT_VAR_SHIFT) is the rttvar */ if (net->RTO_measured) { rtt -= (net->lastsa >> SCTP_RTT_SHIFT); @@ -2574,8 +2582,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb, if (new_rto > stcb->asoc.maxrto) { new_rto = stcb->asoc.maxrto; } - /* we are now returning the RTO */ - return (new_rto); + net->RTO = new_rto; + return (1); } /* Modified: releng/12.1/sys/netinet/sctputil.h ============================================================================== --- releng/12.1/sys/netinet/sctputil.h Thu Oct 3 13:03:48 2019 (r353044) +++ releng/12.1/sys/netinet/sctputil.h Thu Oct 3 13:30:48 2019 (r353045) @@ -133,7 +133,7 @@ uint32_t sctp_get_next_mtu(uint32_t); void sctp_timeout_handler(void *); -uint32_t +int sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, struct sctp_nets *, struct timeval *, int); From owner-svn-src-all@freebsd.org Thu Oct 3 14:27:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE03C137691; Thu, 3 Oct 2019 14:27:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kb1N4hR3z4BkC; Thu, 3 Oct 2019 14:27:04 +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 8442CD708; Thu, 3 Oct 2019 14:27:04 +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 x93ER4hQ039967; Thu, 3 Oct 2019 14:27:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93ER4e4039966; Thu, 3 Oct 2019 14:27:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910031427.x93ER4e4039966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 14:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353046 - releng/12.1/sys/dev/fdt X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: releng/12.1/sys/dev/fdt X-SVN-Commit-Revision: 353046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:27:04 -0000 Author: kevans Date: Thu Oct 3 14:27:04 2019 New Revision: 353046 URL: https://svnweb.freebsd.org/changeset/base/353046 Log: MFS r353041: fdt_slicer: bump to SI_ORDER_THIRD following r347183 r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between them and the initialization of devsoftc.mtx in devinit, but missed this dependency on g_flashmap that may now lose the race against GEOM classes/g_init. There's a great comment that describes the situation that has also been updated with the new ordering of GEOM classes. Approved by: re (kib) Modified: releng/12.1/sys/dev/fdt/fdt_slicer.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/fdt/fdt_slicer.c ============================================================================== --- releng/12.1/sys/dev/fdt/fdt_slicer.c Thu Oct 3 13:30:48 2019 (r353045) +++ releng/12.1/sys/dev/fdt/fdt_slicer.c Thu Oct 3 14:27:04 2019 (r353046) @@ -159,12 +159,12 @@ fdt_slicer_cleanup(void) } /* - * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), + * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); -SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL); static int mod_handler(module_t mod, int type, void *data) @@ -181,5 +181,5 @@ static moduledata_t fdt_slicer_mod = { "fdt_slicer", mod_handler, NULL }; -DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); MODULE_VERSION(fdt_slicer, 1); From owner-svn-src-all@freebsd.org Thu Oct 3 14:39:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 555F41379ED; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbHS1ZQpz4CMQ; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 193DDD8CD; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93EdFxi045792; Thu, 3 Oct 2019 14:39:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93EdF25045791; Thu, 3 Oct 2019 14:39:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910031439.x93EdF25045791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 3 Oct 2019 14:39: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: r353047 - in stable: 11/usr.sbin/bsdinstall/scripts 12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bsdinstall/scripts 12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:39:16 -0000 Author: gjb Date: Thu Oct 3 14:39:15 2019 New Revision: 353047 URL: https://svnweb.freebsd.org/changeset/base/353047 Log: MFC r353004, r353012: r353004: Explicitly add opensolaris_load="YES" to loader.conf through the installer when installing the system on a ZFS root filesystem. For arm64, zfs_load="YES" does not add opensolaris.ko as a kld dependency, so add it explicitly to prevent boot-time failures out-of-box. r353012: Add a comment explaining why the opensolaris_load line in loader.conf is explicitly added. PR: 240478 Approved by: re (kib, early MFC) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:27:04 2019 (r353046) +++ stable/11/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:39:15 2019 (r353047) @@ -39,6 +39,9 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +# The 'opensolaris_load' line is a workaround for arm64, which does not +# automatically load opensolaris.ko with zfs.ko. +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot From owner-svn-src-all@freebsd.org Thu Oct 3 14:39:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7ED1379F2; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbHS3CfSz4CMR; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D40AD8CE; Thu, 3 Oct 2019 14:39:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93EdGfx045798; Thu, 3 Oct 2019 14:39:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93EdGJO045797; Thu, 3 Oct 2019 14:39:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910031439.x93EdGJO045797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 3 Oct 2019 14:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353047 - in stable: 11/usr.sbin/bsdinstall/scripts 12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bsdinstall/scripts 12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:39:16 -0000 Author: gjb Date: Thu Oct 3 14:39:15 2019 New Revision: 353047 URL: https://svnweb.freebsd.org/changeset/base/353047 Log: MFC r353004, r353012: r353004: Explicitly add opensolaris_load="YES" to loader.conf through the installer when installing the system on a ZFS root filesystem. For arm64, zfs_load="YES" does not add opensolaris.ko as a kld dependency, so add it explicitly to prevent boot-time failures out-of-box. r353012: Add a comment explaining why the opensolaris_load line in loader.conf is explicitly added. PR: 240478 Approved by: re (kib, early MFC) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/12/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:27:04 2019 (r353046) +++ stable/12/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:39:15 2019 (r353047) @@ -44,6 +44,9 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +# The 'opensolaris_load' line is a workaround for arm64, which does not +# automatically load opensolaris.ko with zfs.ko. +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot From owner-svn-src-all@freebsd.org Thu Oct 3 14:41:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7832A137B34; Thu, 3 Oct 2019 14:41:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbKs2W1Sz4Cgk; Thu, 3 Oct 2019 14:41:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39F3BD923; Thu, 3 Oct 2019 14:41:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93EfL7Z047396; Thu, 3 Oct 2019 14:41:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93EfLNp047395; Thu, 3 Oct 2019 14:41:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910031441.x93EfLNp047395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 3 Oct 2019 14:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353048 - releng/12.1/usr.sbin/bsdinstall/scripts X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.1/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:41:21 -0000 Author: gjb Date: Thu Oct 3 14:41:20 2019 New Revision: 353048 URL: https://svnweb.freebsd.org/changeset/base/353048 Log: MFS12 r353047: MFC r353004, r353012: r353004: Explicitly add opensolaris_load="YES" to loader.conf through the installer when installing the system on a ZFS root filesystem. For arm64, zfs_load="YES" does not add opensolaris.ko as a kld dependency, so add it explicitly to prevent boot-time failures out-of-box. r353012: Add a comment explaining why the opensolaris_load line in loader.conf is explicitly added. PR: 240478 Approved by: re (kib) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/12.1/usr.sbin/bsdinstall/scripts/config Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/usr.sbin/bsdinstall/scripts/config ============================================================================== --- releng/12.1/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:39:15 2019 (r353047) +++ releng/12.1/usr.sbin/bsdinstall/scripts/config Thu Oct 3 14:41:20 2019 (r353048) @@ -44,6 +44,9 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* +# The 'opensolaris_load' line is a workaround for arm64, which does not +# automatically load opensolaris.ko with zfs.ko. +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot From owner-svn-src-all@freebsd.org Thu Oct 3 14:52:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A30DD13837E; Thu, 3 Oct 2019 14:52:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbZd3wQ4z4Dhx; Thu, 3 Oct 2019 14:52:25 +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 69AE6DC57; Thu, 3 Oct 2019 14:52:25 +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 x93EqP8W057771; Thu, 3 Oct 2019 14:52:25 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93EqPj4057770; Thu, 3 Oct 2019 14:52:25 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201910031452.x93EqPj4057770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Thu, 3 Oct 2019 14:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353049 - head X-SVN-Group: head X-SVN-Commit-Author: schweikh X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 353049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:52:25 -0000 Author: schweikh Date: Thu Oct 3 14:52:25 2019 New Revision: 353049 URL: https://svnweb.freebsd.org/changeset/base/353049 Log: Remove white-space at EOL. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 3 14:41:20 2019 (r353048) +++ head/UPDATING Thu Oct 3 14:52:25 2019 (r353049) @@ -56,13 +56,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: a non-default value, please tell asomers@FreeBSD.org why. 20190713: - Default permissions on the /var/account/acct file (and copies of it - rotated by periodic daily scripts) are changed from 0644 to 0640 - because the file contains sensitive information that should not be - world-readable. If the /var/account directory must be created by - rc.d/accounting, the mode used is now 0750. Admins who use the - accounting feature are encouraged to change the mode of an existing - /var/account directory to 0750 or 0700. + Default permissions on the /var/account/acct file (and copies of it + rotated by periodic daily scripts) are changed from 0644 to 0640 + because the file contains sensitive information that should not be + world-readable. If the /var/account directory must be created by + rc.d/accounting, the mode used is now 0750. Admins who use the + accounting feature are encouraged to change the mode of an existing + /var/account directory to 0750 or 0700. 20190620: Entropy collection and the /dev/random device are no longer optional @@ -586,7 +586,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 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 + WITHOUT_LLD_BOOTSTRAP=yes 20180110: On i386, pmtimer has been removed. Its functionality has been folded From owner-svn-src-all@freebsd.org Thu Oct 3 14:54:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63EC4138454; Thu, 3 Oct 2019 14:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbcz226sz4DtQ; Thu, 3 Oct 2019 14:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28C12DC5F; Thu, 3 Oct 2019 14:54:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93EsRjH057942; Thu, 3 Oct 2019 14:54:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93EsRt2057941; Thu, 3 Oct 2019 14:54:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910031454.x93EsRt2057941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Oct 2019 14:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353050 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 353050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:54:27 -0000 Author: markj Date: Thu Oct 3 14:54:26 2019 New Revision: 353050 URL: https://svnweb.freebsd.org/changeset/base/353050 Log: MFC r352748: Fix handling of invalid pages in exec_map_first_page(). Modified: stable/12/sys/kern/kern_exec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Thu Oct 3 14:52:25 2019 (r353049) +++ stable/12/sys/kern/kern_exec.c Thu Oct 3 14:54:26 2019 (r353050) @@ -996,7 +996,10 @@ exec_map_first_page(struct image_params *imgp) vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { vm_page_lock(ma[0]); - vm_page_free(ma[0]); + if (!vm_page_wired(ma[0])) + vm_page_free(ma[0]); + else + vm_page_xunbusy_maybelocked(ma[0]); vm_page_unlock(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); @@ -1023,7 +1026,10 @@ exec_map_first_page(struct image_params *imgp) if (rv != VM_PAGER_OK) { for (i = 0; i < initial_pagein; i++) { vm_page_lock(ma[i]); - vm_page_free(ma[i]); + if (!vm_page_wired(ma[i])) + vm_page_free(ma[i]); + else + vm_page_xunbusy_maybelocked(ma[i]); vm_page_unlock(ma[i]); } VM_OBJECT_WUNLOCK(object); From owner-svn-src-all@freebsd.org Thu Oct 3 14:55:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 780301384C9; Thu, 3 Oct 2019 14:55:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kbdm2YYNz4F1c; Thu, 3 Oct 2019 14:55:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20CD9DC60; Thu, 3 Oct 2019 14: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 x93Et893058068; Thu, 3 Oct 2019 14:55:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Et7T4058065; Thu, 3 Oct 2019 14:55:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910031455.x93Et7T4058065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Oct 2019 14:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353051 - in stable/12/sys: dev/vmware/vmxnet3 net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 353051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 14:55:08 -0000 Author: markj Date: Thu Oct 3 14:55:07 2019 New Revision: 353051 URL: https://svnweb.freebsd.org/changeset/base/353051 Log: MFC r352906: Add IFLIB_SINGLE_IRQ_RX_ONLY. PR: 239118 Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct 3 14:54:26 2019 (r353050) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct 3 14:55:07 2019 (r353051) @@ -287,7 +287,7 @@ static struct if_shared_ctx vmxnet3_sctx_init = { .isc_vendor_info = vmxnet3_vendor_info_array, .isc_driver_version = "2", .isc_driver = &vmxnet3_iflib_driver, - .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_SINGLE_IRQ_RX_ONLY, /* * Number of receive queues per receive queue set, with associated Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Thu Oct 3 14:54:26 2019 (r353050) +++ stable/12/sys/net/iflib.c Thu Oct 3 14:55:07 2019 (r353051) @@ -6000,6 +6000,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte int tqrid; void *q; int err; + bool rx_only; q = &ctx->ifc_rxqs[0]; info = &rxq[0].ifr_filter_info; @@ -6007,16 +6008,18 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte tqg = qgroup_if_io_tqg; tqrid = irq->ii_rid = *rid; fn = _task_fn_rx; + rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0; ctx->ifc_flags |= IFC_LEGACY; info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = q; + info->ifi_ctx = rx_only ? ctx : q; /* We allocate a single interrupt resource */ - if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx, - NULL, info, name)) != 0) + err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx : + iflib_fast_intr_rxtx, NULL, info, name); + if (err != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Thu Oct 3 14:54:26 2019 (r353050) +++ stable/12/sys/net/iflib.h Thu Oct 3 14:55:07 2019 (r353051) @@ -361,6 +361,11 @@ typedef enum { * Interface needs admin task to ignore interface up/down status */ #define IFLIB_ADMIN_ALWAYS_RUN 0x10000 +/* + * When using a single hardware interrupt for the interface, only process RX + * interrupts instead of doing combined RX/TX processing. + */ +#define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000 /* From owner-svn-src-all@freebsd.org Thu Oct 3 15:23:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89DD5138F2D; Thu, 3 Oct 2019 15:23:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kcGg35vgz4GXb; Thu, 3 Oct 2019 15:23:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33E54E1B8; Thu, 3 Oct 2019 15:23:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93FNdOA075441; Thu, 3 Oct 2019 15:23:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93FNcfs075438; Thu, 3 Oct 2019 15:23:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910031523.x93FNcfs075438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Oct 2019 15:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353052 - in releng/12.1/sys: dev/vmware/vmxnet3 net X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in releng/12.1/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 353052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 15:23:39 -0000 Author: markj Date: Thu Oct 3 15:23:38 2019 New Revision: 353052 URL: https://svnweb.freebsd.org/changeset/base/353052 Log: MFS r353051: Add IFLIB_SINGLE_IRQ_RX_ONLY. PR: 239118 Approved by: re (gjb) Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c releng/12.1/sys/net/iflib.c releng/12.1/sys/net/iflib.h Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct 3 14:55:07 2019 (r353051) +++ releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct 3 15:23:38 2019 (r353052) @@ -287,7 +287,7 @@ static struct if_shared_ctx vmxnet3_sctx_init = { .isc_vendor_info = vmxnet3_vendor_info_array, .isc_driver_version = "2", .isc_driver = &vmxnet3_iflib_driver, - .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_SINGLE_IRQ_RX_ONLY, /* * Number of receive queues per receive queue set, with associated Modified: releng/12.1/sys/net/iflib.c ============================================================================== --- releng/12.1/sys/net/iflib.c Thu Oct 3 14:55:07 2019 (r353051) +++ releng/12.1/sys/net/iflib.c Thu Oct 3 15:23:38 2019 (r353052) @@ -6000,6 +6000,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte int tqrid; void *q; int err; + bool rx_only; q = &ctx->ifc_rxqs[0]; info = &rxq[0].ifr_filter_info; @@ -6007,16 +6008,18 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte tqg = qgroup_if_io_tqg; tqrid = irq->ii_rid = *rid; fn = _task_fn_rx; + rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0; ctx->ifc_flags |= IFC_LEGACY; info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = q; + info->ifi_ctx = rx_only ? ctx : q; /* We allocate a single interrupt resource */ - if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx, - NULL, info, name)) != 0) + err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx : + iflib_fast_intr_rxtx, NULL, info, name); + if (err != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); Modified: releng/12.1/sys/net/iflib.h ============================================================================== --- releng/12.1/sys/net/iflib.h Thu Oct 3 14:55:07 2019 (r353051) +++ releng/12.1/sys/net/iflib.h Thu Oct 3 15:23:38 2019 (r353052) @@ -361,6 +361,11 @@ typedef enum { * Interface needs admin task to ignore interface up/down status */ #define IFLIB_ADMIN_ALWAYS_RUN 0x10000 +/* + * When using a single hardware interrupt for the interface, only process RX + * interrupts instead of doing combined RX/TX processing. + */ +#define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000 /* From owner-svn-src-all@freebsd.org Thu Oct 3 16:22:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C19EC13A8F1; Thu, 3 Oct 2019 16:22:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kdb44fqgz4LZn; Thu, 3 Oct 2019 16:22:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8440BECD8; Thu, 3 Oct 2019 16:22:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93GMuTP011066; Thu, 3 Oct 2019 16:22:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93GMuAt011065; Thu, 3 Oct 2019 16:22:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910031622.x93GMuAt011065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 3 Oct 2019 16:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353053 - releng/12.1/contrib/llvm/lib/Target/X86 X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: releng/12.1/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 353053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 16:22:56 -0000 Author: dim Date: Thu Oct 3 16:22:56 2019 New Revision: 353053 URL: https://svnweb.freebsd.org/changeset/base/353053 Log: Merge r353031 from stable/12: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. Approved by: re (kib) PR: 240928 Modified: releng/12.1/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- releng/12.1/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 15:23:38 2019 (r353052) +++ releng/12.1/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thu Oct 3 16:22:56 2019 (r353053) @@ -154,6 +154,15 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter MFI->insert(MBBI, NewMI); // Insert the new inst return NewMI; } + } + + if (!MI.isConvertibleTo3Addr()) + return nullptr; + + switch (MI.getOpcode()) { + default: + // Only convert instructions that we've verified are safe. + return nullptr; case X86::ADD64ri32: case X86::ADD64ri8: case X86::ADD64ri32_DB: @@ -162,24 +171,24 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iter case X86::ADD32ri8: case X86::ADD32ri_DB: case X86::ADD32ri8_DB: - case X86::ADD16ri: - case X86::ADD16ri8: - case X86::ADD16ri_DB: - case X86::ADD16ri8_DB: if (!MI.getOperand(2).isImm()) { // convertToThreeAddress will call getImm() // which requires isImm() to be true return nullptr; } break; - case X86::ADD16rr: - case X86::ADD16rr_DB: - if (MI.getOperand(1).getReg() != MI.getOperand(2).getReg()) { - // if src1 != src2, then convertToThreeAddress will - // need to create a Virtual register, which we cannot do - // after register allocation. - return nullptr; - } + case X86::SHL64ri: + case X86::SHL32ri: + case X86::INC64r: + case X86::INC32r: + case X86::DEC64r: + case X86::DEC32r: + case X86::ADD64rr: + case X86::ADD64rr_DB: + case X86::ADD32rr: + case X86::ADD32rr_DB: + // These instructions are all fine to convert. + break; } return TII->convertToThreeAddress(MFI, MI, nullptr); } From owner-svn-src-all@freebsd.org Thu Oct 3 16:38:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D767513AD28; Thu, 3 Oct 2019 16:38:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kdxJ51gSz4MZc; Thu, 3 Oct 2019 16:38:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B781EEBA; Thu, 3 Oct 2019 16:38:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93GciFG017490; Thu, 3 Oct 2019 16:38:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Gci8j017489; Thu, 3 Oct 2019 16:38:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201910031638.x93Gci8j017489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 3 Oct 2019 16:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353054 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 353054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 16:38:44 -0000 Author: trasz Date: Thu Oct 3 16:38:44 2019 New Revision: 353054 URL: https://svnweb.freebsd.org/changeset/base/353054 Log: Add rcvar back to the linux rc script. Without it it was enabled unconditionally. Reported by: Michael Butler MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/rc/rc.d/linux Modified: head/libexec/rc/rc.d/linux ============================================================================== --- head/libexec/rc/rc.d/linux Thu Oct 3 16:22:56 2019 (r353053) +++ head/libexec/rc/rc.d/linux Thu Oct 3 16:38:44 2019 (r353054) @@ -11,6 +11,7 @@ name="linux" desc="Enable Linux ABI" +rcvar="linux_enable" start_cmd="${name}_start" stop_cmd=":" From owner-svn-src-all@freebsd.org Thu Oct 3 17:41:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7765C13BF25; Thu, 3 Oct 2019 17:41:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kgKY2bcYz4R3t; Thu, 3 Oct 2019 17:41:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C3D0F9B2; Thu, 3 Oct 2019 17:41:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93HfLuo053969; Thu, 3 Oct 2019 17:41:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93HfLBA053968; Thu, 3 Oct 2019 17:41:21 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910031741.x93HfLBA053968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 3 Oct 2019 17:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353055 - stable/12/lib/libbsnmp/libbsnmp X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libbsnmp/libbsnmp X-SVN-Commit-Revision: 353055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 17:41:21 -0000 Author: brooks Date: Thu Oct 3 17:41:20 2019 New Revision: 353055 URL: https://svnweb.freebsd.org/changeset/base/353055 Log: MFC r352220: Avoid the use of the non-portable -D argument to ls. This was used to store the mtime of the source file in a commment in a generated header file. This is of little-to-no diagnostic value and the result doesn't even end up in the source tree. Reported by: arichardson Reviewed by: arichardson Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21605 Modified: stable/12/lib/libbsnmp/libbsnmp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- stable/12/lib/libbsnmp/libbsnmp/Makefile Thu Oct 3 16:38:44 2019 (r353054) +++ stable/12/lib/libbsnmp/libbsnmp/Makefile Thu Oct 3 17:41:20 2019 (r353055) @@ -26,9 +26,7 @@ MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 snmptc.h : tc.def (\ - echo -n "/* autogenerated from tc.def; ";\ - ls -l -D "%F %T" ${.ALLSRC} | awk '{printf("%s %s", $$6, $$7)}';\ - echo "*/";\ + echo "/* autogenerated from tc.def */";\ echo "#ifndef snmptc_h_1529923773";\ echo "#define snmptc_h_1529923773";\ gensnmptree -E -f <${.ALLSRC};\ From owner-svn-src-all@freebsd.org Thu Oct 3 17:46:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DAC413C165; Thu, 3 Oct 2019 17:46:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kgRS3fcFz4RWC; Thu, 3 Oct 2019 17:46: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 609AAFB28; Thu, 3 Oct 2019 17:46: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 x93HkSAJ059219; Thu, 3 Oct 2019 17:46:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93HkSRO059218; Thu, 3 Oct 2019 17:46:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910031746.x93HkSRO059218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 17:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353056 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 353056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 17:46:28 -0000 Author: kevans Date: Thu Oct 3 17:46:27 2019 New Revision: 353056 URL: https://svnweb.freebsd.org/changeset/base/353056 Log: if_tuntap: add a busy/unbusy mechanism, replace destroy OPEN check A future commit will create device aliases when a tuntap device is renamed so that it's still easily found in /dev after the rename. Said mechanism will want to keep the tun alive long enough to either realize that it's about to go away or complete the alias creation, even if the alias is about to get destroyed. While we're introducing it, using it to prevent open devices from going away makes plenty of sense and keeps the logic on waking up tun_destroy clean, so we don't have multiple places trying to cv_broadcast unless it's still in use elsewhere. Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu Oct 3 17:41:20 2019 (r353055) +++ head/sys/net/if_tuntap.c Thu Oct 3 17:46:27 2019 (r353056) @@ -131,13 +131,15 @@ struct tuntap_softc { struct mtx tun_mtx; /* softc field mutex */ struct cv tun_cv; /* for ref'd dev destroy */ struct ether_addr tun_ether; /* remote address */ + int tun_busy; /* busy count */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) #define TUNDEBUG if (tundebug) if_printf -#define TUN_LOCK(tp) mtx_lock(&(tp)->tun_mtx) -#define TUN_UNLOCK(tp) mtx_unlock(&(tp)->tun_mtx) +#define TUN_LOCK(tp) mtx_lock(&(tp)->tun_mtx) +#define TUN_UNLOCK(tp) mtx_unlock(&(tp)->tun_mtx) +#define TUN_LOCK_ASSERT(tp) mtx_assert(&(tp)->tun_mtx, MA_OWNED); #define TUN_VMIO_FLAG_MASK 0x0fff @@ -182,6 +184,11 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL "Enable legacy devfs interface creation"); SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tundebug, 0, ""); +static int tun_busy_locked(struct tuntap_softc *tp); +static void tun_unbusy_locked(struct tuntap_softc *tp); +static int tun_busy(struct tuntap_softc *tp); +static void tun_unbusy(struct tuntap_softc *tp); + static int tuntap_name2info(const char *name, int *unit, int *flags); static void tunclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev); @@ -304,6 +311,65 @@ VNET_DEFINE_STATIC(SLIST_HEAD(, tuntap_driver_cloner), #define V_tuntap_driver_cloners VNET(tuntap_driver_cloners) /* + * Mechanism for marking a tunnel device as busy so that we can safely do some + * orthogonal operations (such as operations on devices) without racing against + * tun_destroy. tun_destroy will wait on the condvar if we're at all busy or + * open, to be woken up when the condition is alleviated. + */ +static int +tun_busy_locked(struct tuntap_softc *tp) +{ + + TUN_LOCK_ASSERT(tp); + if ((tp->tun_flags & TUN_DYING) != 0) { + /* + * Perhaps unintuitive, but the device is busy going away. + * Other interpretations of EBUSY from tun_busy make little + * sense, since making a busy device even more busy doesn't + * sound like a problem. + */ + return (EBUSY); + } + + ++tp->tun_busy; + return (0); +} + +static void +tun_unbusy_locked(struct tuntap_softc *tp) +{ + + TUN_LOCK_ASSERT(tp); + KASSERT(tp->tun_busy != 0, ("tun_unbusy: called for non-busy tunnel")); + + --tp->tun_busy; + /* Wake up anything that may be waiting on our busy tunnel. */ + if (tp->tun_busy == 0) + cv_broadcast(&tp->tun_cv); +} + +static int +tun_busy(struct tuntap_softc *tp) +{ + int ret; + + TUN_LOCK(tp); + ret = tun_busy_locked(tp); + TUN_UNLOCK(tp); + return (ret); +} + + +static void +tun_unbusy(struct tuntap_softc *tp) +{ + + TUN_LOCK(tp); + tun_unbusy_locked(tp); + TUN_UNLOCK(tp); +} + +/* * Sets unit and/or flags given the device name. Must be called with correct * vnet context. */ @@ -531,7 +597,7 @@ tun_destroy(struct tuntap_softc *tp) TUN_LOCK(tp); tp->tun_flags |= TUN_DYING; - if ((tp->tun_flags & TUN_OPEN) != 0) + if (tp->tun_busy != 0) cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); else TUN_UNLOCK(tp); @@ -885,6 +951,8 @@ tunopen(struct cdev *dev, int flag, int mode, struct t return (EBUSY); } + error = tun_busy_locked(tp); + KASSERT(error == 0, ("Must be able to busy an unopen tunnel")); ifp = TUN2IFP(tp); if ((tp->tun_flags & TUN_L2) != 0) { @@ -988,7 +1056,7 @@ out: tp->tun_flags &= ~TUN_OPEN; tp->tun_pid = 0; - cv_broadcast(&tp->tun_cv); + tun_unbusy_locked(tp); TUN_UNLOCK(tp); return (0); } From owner-svn-src-all@freebsd.org Thu Oct 3 17:54:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 204AD13C382; Thu, 3 Oct 2019 17:54:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kgc86xBsz4S30; Thu, 3 Oct 2019 17:54:00 +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 D2824FCF9; Thu, 3 Oct 2019 17:54:00 +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 x93Hs0DG065044; Thu, 3 Oct 2019 17:54:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Hs0HD065043; Thu, 3 Oct 2019 17:54:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910031754.x93Hs0HD065043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 17:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353057 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 353057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 17:54:01 -0000 Author: kevans Date: Thu Oct 3 17:54:00 2019 New Revision: 353057 URL: https://svnweb.freebsd.org/changeset/base/353057 Log: if_tuntap: create /dev aliases when a tuntap device gets renamed Currently, if you do: $ ifconfig tun0 create $ ifconfig tun0 name wg0 $ ls -l /dev | egrep 'wg|tun' You will see tun0, but no wg0. In fact, it's slightly more annoying to make the association between the new name and the old name in order to open the device (if it hadn't been opened during the rename). Register an eventhandler for ifnet_arrival_events and catch interface renames. We can determine if the ifnet is a tun easily enough from the if_dname, which matches the cevsw.d_name from the associated tuntap_driver. Some locking dance is required because renames don't require the device to be opened, so it could go away in the middle of handling the ioctl, but as soon as we've verified this isn't the case we can attempt to busy the tun and either bail out if the tun device is dying, or we can proceed with the rename. We only create these aliases on a best-effort basis. Renaming a tun device to "usbctl", which doesn't exist as an ifnet but does as a /dev, is clearly not that disastrous, but we can't and won't create a /dev for that. Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu Oct 3 17:46:27 2019 (r353056) +++ head/sys/net/if_tuntap.c Thu Oct 3 17:54:00 2019 (r353057) @@ -106,6 +106,7 @@ struct tuntap_driver; */ struct tuntap_softc { TAILQ_ENTRY(tuntap_softc) tun_list; + struct cdev *tun_alias; struct cdev *tun_dev; u_short tun_flags; /* misc flags */ #define TUN_OPEN 0x0001 @@ -149,7 +150,8 @@ struct tuntap_softc { * which are static after setup. */ static struct mtx tunmtx; -static eventhandler_tag tag; +static eventhandler_tag arrival_tag; +static eventhandler_tag clone_tag; static const char tunname[] = "tun"; static const char tapname[] = "tap"; static const char vmnetname[] = "vmnet"; @@ -193,6 +195,7 @@ static int tuntap_name2info(const char *name, int *uni static void tunclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev); static void tuncreate(struct cdev *dev, struct tuntap_driver *); +static void tunrename(void *arg, struct ifnet *ifp); static int tunifioctl(struct ifnet *, u_long, caddr_t); static void tuninit(struct ifnet *); static void tunifinit(void *xtp); @@ -604,6 +607,7 @@ tun_destroy(struct tuntap_softc *tp) CURVNET_SET(TUN2IFP(tp)->if_vnet); + /* destroy_dev will take care of any alias. */ destroy_dev(tp->tun_dev); seldrain(&tp->tun_rsel); knlist_clear(&tp->tun_rsel.si_note, 0); @@ -682,7 +686,8 @@ tun_uninit(const void *unused __unused) struct tuntap_softc *tp; int i; - EVENTHANDLER_DEREGISTER(dev_clone, tag); + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, arrival_tag); + EVENTHANDLER_DEREGISTER(dev_clone, clone_tag); drain_dev_clone_events(); mtx_lock(&tunmtx); @@ -702,6 +707,24 @@ tun_uninit(const void *unused __unused) } SYSUNINIT(tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, tun_uninit, NULL); +static struct tuntap_driver * +tuntap_driver_from_ifnet(const struct ifnet *ifp) +{ + struct tuntap_driver *drv; + int i; + + if (ifp == NULL) + return (NULL); + + for (i = 0; i < nitems(tuntap_drivers); ++i) { + drv = &tuntap_drivers[i]; + if (strcmp(ifp->if_dname, drv->cdevsw.d_name) == 0) + return (drv); + } + + return (NULL); +} + static int tuntapmodevent(module_t mod, int type, void *data) { @@ -716,9 +739,13 @@ tuntapmodevent(module_t mod, int type, void *data) clone_setup(&drv->clones); drv->unrhdr = new_unrhdr(0, IF_MAXUNIT, &tunmtx); } - tag = EVENTHANDLER_REGISTER(dev_clone, tunclone, 0, 1000); - if (tag == NULL) + arrival_tag = EVENTHANDLER_REGISTER(ifnet_arrival_event, + tunrename, 0, 1000); + if (arrival_tag == NULL) return (ENOMEM); + clone_tag = EVENTHANDLER_REGISTER(dev_clone, tunclone, 0, 1000); + if (clone_tag == NULL) + return (ENOMEM); break; case MOD_UNLOAD: /* See tun_uninit, so it's done after the vnet_sysuninit() */ @@ -900,6 +927,57 @@ tuncreate(struct cdev *dev, struct tuntap_driver *drv) TUNDEBUG(ifp, "interface %s is created, minor = %#x\n", ifp->if_xname, dev2unit(dev)); +} + +static void +tunrename(void *arg __unused, struct ifnet *ifp) +{ + struct tuntap_softc *tp; + int error; + + if ((ifp->if_flags & IFF_RENAMING) == 0) + return; + + if (tuntap_driver_from_ifnet(ifp) == NULL) + return; + + /* + * We need to grab the ioctl sx long enough to make sure the softc is + * still there. If it is, we can safely try to busy the tun device. + * The busy may fail if the device is currently dying, in which case + * we do nothing. If it doesn't fail, the busy count stops the device + * from dying until we've created the alias (that will then be + * subsequently destroyed). + */ + sx_xlock(&tun_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + sx_xunlock(&tun_ioctl_sx); + return; + } + error = tun_busy(tp); + sx_xunlock(&tun_ioctl_sx); + if (error != 0) + return; + if (tp->tun_alias != NULL) { + destroy_dev(tp->tun_alias); + tp->tun_alias = NULL; + } + + if (strcmp(ifp->if_xname, tp->tun_dev->si_name) == 0) + goto out; + + /* + * Failure's ok, aliases are created on a best effort basis. If a + * tun user/consumer decides to rename the interface to conflict with + * another device (non-ifnet) on the system, we will assume they know + * what they are doing. make_dev_alias_p won't touch tun_alias on + * failure, so we use it but ignore the return value. + */ + make_dev_alias_p(MAKEDEV_CHECKNAME, &tp->tun_alias, tp->tun_dev, "%s", + ifp->if_xname); +out: + tun_unbusy(tp); } static int From owner-svn-src-all@freebsd.org Thu Oct 3 18:12:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CE8E13C9D9; Thu, 3 Oct 2019 18:12:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kh1Z6k62z4T5k; Thu, 3 Oct 2019 18:12:34 +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 CA8CF18073; Thu, 3 Oct 2019 18:12:34 +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 x93ICYPw076587; Thu, 3 Oct 2019 18:12:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93ICY9A076586; Thu, 3 Oct 2019 18:12:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201910031812.x93ICY9A076586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Oct 2019 18:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353058 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 353058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:12:35 -0000 Author: jhb Date: Thu Oct 3 18:12:34 2019 New Revision: 353058 URL: https://svnweb.freebsd.org/changeset/base/353058 Log: Fix a typo in a comment. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Oct 3 17:54:00 2019 (r353057) +++ head/usr.bin/truss/syscalls.c Thu Oct 3 18:12:34 2019 (r353058) @@ -905,7 +905,7 @@ print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uin #ifndef __LP64__ /* - * Add argument padding to subsequent system calls afater a Quad + * Add argument padding to subsequent system calls after Quad * syscall arguments as needed. This used to be done by hand in the * decoded_syscalls table which was ugly and error prone. It is * simpler to do the fixup of offsets at initalization time than when From owner-svn-src-all@freebsd.org Thu Oct 3 18:24:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F93F13CFCD; Thu, 3 Oct 2019 18:24:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46khHY6XGXz4Vjn; Thu, 3 Oct 2019 18:24:41 +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 C365218269; Thu, 3 Oct 2019 18:24:41 +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 x93IOfhE084423; Thu, 3 Oct 2019 18:24:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93IOfRM084422; Thu, 3 Oct 2019 18:24:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201910031824.x93IOfRM084422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Oct 2019 18:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353059 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 353059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:24:42 -0000 Author: jhb Date: Thu Oct 3 18:24:41 2019 New Revision: 353059 URL: https://svnweb.freebsd.org/changeset/base/353059 Log: Restore description of packets dropped due to full reassembly queue. r265408 renamed tcps_rcvmemdrop to tcps_rcvreassfull and gave it a more specific description. r279122 (libxo-ification) reverted that change. This commit brings it back, but with a small tweak to the description. MFC after: 2 weeks Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Thu Oct 3 18:12:34 2019 (r353058) +++ head/usr.bin/netstat/inet.c Thu Oct 3 18:24:41 2019 (r353059) @@ -640,8 +640,8 @@ tcp_stats(u_long off, const char *name, int af1 __unus "{N:/discarded for bad header offset field%s}\n"); p1a(tcps_rcvshort, "\t\t{:discard-too-short/%ju} " "{N:discarded because packet too short}\n"); - p1a(tcps_rcvmemdrop, "\t\t{:discard-memory-problems/%ju} " - "{N:discarded due to memory problems}\n"); + p1a(tcps_rcvreassfull, "\t\t{:discard-reassembly-queue-full/%ju} " + "{N:discarded due to full reassembly queue}\n"); p(tcps_connattempt, "\t{:connection-requests/%ju} " "{N:/connection request%s}\n"); p(tcps_accepts, "\t{:connections-accepts/%ju} " From owner-svn-src-all@freebsd.org Thu Oct 3 18:36:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B15213D624; Thu, 3 Oct 2019 18:36:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46khYg2Fnhz4XlH; Thu, 3 Oct 2019 18:36:55 +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 315FA1844B; Thu, 3 Oct 2019 18:36:55 +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 x93Iat59092565; Thu, 3 Oct 2019 18:36:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93IatiY092564; Thu, 3 Oct 2019 18:36:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910031836.x93IatiY092564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 18:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353060 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:36:55 -0000 Author: tuexen Date: Thu Oct 3 18:36:54 2019 New Revision: 353060 URL: https://svnweb.freebsd.org/changeset/base/353060 Log: Add missing input validation. This could result in reading from uninitialized memory. The issue was found by OSS-Fuzz for usrsctp and reported in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17780 MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Oct 3 18:24:41 2019 (r353059) +++ head/sys/netinet/sctp_asconf.c Thu Oct 3 18:36:54 2019 (r353060) @@ -169,10 +169,16 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc #endif aparam_length = ntohs(aph->ph.param_length); + if (aparam_length < sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_paramhdr)) { + return (NULL); + } ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); + if (param_length + sizeof(struct sctp_asconf_paramhdr) != aparam_length) { + return (NULL); + } #endif sa = &store.sa; switch (param_type) { @@ -325,8 +331,14 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); + if (aparam_length < sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_paramhdr)) { + return (NULL); + } #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); + if (param_length + sizeof(struct sctp_asconf_paramhdr) != aparam_length) { + return (NULL); + } #endif sa = &store.sa; switch (param_type) { @@ -454,10 +466,16 @@ sctp_process_asconf_set_primary(struct sockaddr *src, #endif aparam_length = ntohs(aph->ph.param_length); + if (aparam_length < sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_paramhdr)) { + return (NULL); + } ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); + if (param_length + sizeof(struct sctp_asconf_paramhdr) != aparam_length) { + return (NULL); + } #endif sa = &store.sa; switch (param_type) { From owner-svn-src-all@freebsd.org Thu Oct 3 18:50:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15C6013D8AA; Thu, 3 Oct 2019 18:50:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46khss6sKBz4YFW; Thu, 3 Oct 2019 18:50:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D01771862D; Thu, 3 Oct 2019 18:50:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93Iovgg099481; Thu, 3 Oct 2019 18:50:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Iovkp099480; Thu, 3 Oct 2019 18:50:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910031850.x93Iovkp099480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 3 Oct 2019 18:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353061 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 353061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:50:58 -0000 Author: brooks Date: Thu Oct 3 18:50:57 2019 New Revision: 353061 URL: https://svnweb.freebsd.org/changeset/base/353061 Log: MFC r352917: Restore the ability to set capenabled directly in syscalls.conf. This fixes generation of cloudabi syscall tables broken in r340424. Reviewed by: kevans, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21821 Modified: stable/12/sys/kern/makesyscalls.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/makesyscalls.sh ============================================================================== --- stable/12/sys/kern/makesyscalls.sh Thu Oct 3 18:36:54 2019 (r353060) +++ stable/12/sys/kern/makesyscalls.sh Thu Oct 3 18:50:57 2019 (r353061) @@ -61,7 +61,9 @@ if [ -n "$2" ]; then . "$2" fi -if [ -r $capabilities_conf ]; then +if [ -n "$capenabled" ]; then + # do nothing +elif [ -r $capabilities_conf ]; then capenabled=`egrep -v '^#|^$' $capabilities_conf` capenabled=`echo $capenabled | sed 's/ /,/g'` else From owner-svn-src-all@freebsd.org Thu Oct 3 18:53:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BABE13DA56; Thu, 3 Oct 2019 18:53:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46khwJ3P67z4Yb1; Thu, 3 Oct 2019 18:53:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DC84187BE; Thu, 3 Oct 2019 18:53:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93Ir46I004436; Thu, 3 Oct 2019 18:53:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Ir3Co004432; Thu, 3 Oct 2019 18:53:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910031853.x93Ir3Co004432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 3 Oct 2019 18:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353062 - in head/sys: conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/usb/controller X-SVN-Commit-Revision: 353062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:53:04 -0000 Author: manu Date: Thu Oct 3 18:53:03 2019 New Revision: 353062 URL: https://svnweb.freebsd.org/changeset/base/353062 Log: Split out the attachment from the generic-ehci driver Create an attachment file for the existing ACPI attachment, and create a new FDT attachment for the generic-ehci driver. Submitted by: andrew (Original version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19389 Added: head/sys/dev/usb/controller/generic_ehci.h (contents, props changed) head/sys/dev/usb/controller/generic_ehci_acpi.c (contents, props changed) head/sys/dev/usb/controller/generic_ehci_fdt.c (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/dev/usb/controller/generic_ehci.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Oct 3 18:50:57 2019 (r353061) +++ head/sys/conf/files.arm64 Thu Oct 3 18:53:03 2019 (r353062) @@ -245,7 +245,9 @@ dev/uart/uart_dev_mu.c optional uart uart_mu dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 dev/usb/controller/ehci_mv.c optional ehci_mv fdt -dev/usb/controller/generic_ehci.c optional ehci acpi +dev/usb/controller/generic_ehci.c optional ehci +dev/usb/controller/generic_ehci_acpi.c optional ehci acpi +dev/usb/controller/generic_ehci_fdt.c optional ehci fdt dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources Modified: head/sys/dev/usb/controller/generic_ehci.c ============================================================================== --- head/sys/dev/usb/controller/generic_ehci.c Thu Oct 3 18:50:57 2019 (r353061) +++ head/sys/dev/usb/controller/generic_ehci.c Thu Oct 3 18:53:03 2019 (r353062) @@ -60,27 +60,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include "generic_ehci.h" -static device_attach_t generic_ehci_attach; -static device_detach_t generic_ehci_detach; - -static int -generic_ehci_probe(device_t self) -{ - ACPI_HANDLE h; - - if ((h = acpi_get_handle(self)) == NULL || - !acpi_MatchHid(h, "PNP0D20")) - return (ENXIO); - - device_set_desc(self, "Generic EHCI Controller"); - return (BUS_PROBE_DEFAULT); -} - -static int +int generic_ehci_attach(device_t self) { ehci_softc_t *sc = device_get_softc(self); @@ -152,7 +134,7 @@ error: return (ENXIO); } -static int +int generic_ehci_detach(device_t self) { ehci_softc_t *sc = device_get_softc(self); @@ -192,7 +174,6 @@ generic_ehci_detach(device_t self) static device_method_t ehci_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, generic_ehci_probe), DEVMETHOD(device_attach, generic_ehci_attach), DEVMETHOD(device_detach, generic_ehci_detach), DEVMETHOD(device_suspend, bus_generic_suspend), @@ -202,13 +183,8 @@ static device_method_t ehci_methods[] = { DEVMETHOD_END }; -static driver_t ehci_driver = { +driver_t generic_ehci_driver = { .name = "ehci", .methods = ehci_methods, .size = sizeof(ehci_softc_t), }; - -static devclass_t ehci_devclass; - -DRIVER_MODULE(ehci, acpi, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); Added: head/sys/dev/usb/controller/generic_ehci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_ehci.h Thu Oct 3 18:53:03 2019 (r353062) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2019 Andrew Turner + * 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$ + */ + +#ifndef _GENERIC_EHCI_H_ +#define _GENERIC_EHCI_H_ + +extern driver_t generic_ehci_driver; + +device_attach_t generic_ehci_attach; +device_detach_t generic_ehci_detach; + +#endif /* !_GENERIC_EHCI_H_ */ Added: head/sys/dev/usb/controller/generic_ehci_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_ehci_acpi.c Thu Oct 3 18:53:03 2019 (r353062) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "generic_ehci.h" + +static int +generic_ehci_acpi_probe(device_t self) +{ + ACPI_HANDLE h; + + if ((h = acpi_get_handle(self)) == NULL || + !acpi_MatchHid(h, "PNP0D20")) + return (ENXIO); + + device_set_desc(self, "Generic EHCI Controller"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t ehci_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_ehci_acpi_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ehci, ehci_acpi_driver, ehci_acpi_methods, + sizeof(ehci_softc_t), generic_ehci_driver); + +static devclass_t ehci_acpi_devclass; + +DRIVER_MODULE(ehci, acpi, ehci_acpi_driver, ehci_acpi_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); Added: head/sys/dev/usb/controller/generic_ehci_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_ehci_fdt.c Thu Oct 3 18:53:03 2019 (r353062) @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef EXT_RESOURCES +#include +#include +#include +#include +#endif + +#include "generic_ehci.h" + +#ifdef EXT_RESOURCES +struct clk_list { + TAILQ_ENTRY(clk_list) next; + clk_t clk; +}; + + +struct hwrst_list { + TAILQ_ENTRY(hwrst_list) next; + hwreset_t rst; +}; + +struct phy_list { + TAILQ_ENTRY(phy_list) next; + phy_t phy; +}; +#endif + +struct generic_ehci_fdt_softc { + ehci_softc_t ehci_sc; + +#ifdef EXT_RESOURCES + TAILQ_HEAD(, clk_list) clk_list; + TAILQ_HEAD(, hwrst_list) rst_list; + TAILQ_HEAD(, phy_list) phy_list; +#endif +}; + +static device_probe_t generic_ehci_fdt_probe; +static device_attach_t generic_ehci_fdt_attach; +static device_detach_t generic_ehci_fdt_detach; + +static int +generic_ehci_fdt_probe(device_t self) +{ + + if (!ofw_bus_status_okay(self)) + return (ENXIO); + + if (!ofw_bus_is_compatible(self, "generic-ehci")) + return (ENXIO); + + device_set_desc(self, "Generic EHCI Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +generic_ehci_fdt_attach(device_t dev) +{ +#ifdef EXT_RESOURCES + struct generic_ehci_fdt_softc *sc; + struct clk_list *clkp; + clk_t clk; + struct hwrst_list *rstp; + hwreset_t rst; + struct phy_list *phyp; + phy_t phy; + int err, off; + + sc = device_get_softc(dev); + + TAILQ_INIT(&sc->clk_list); + /* Enable clock */ + for (off = 0; clk_get_by_ofw_index(dev, 0, off, &clk) == 0; off++) { + err = clk_enable(clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(clk)); + goto error; + } + clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); + clkp->clk = clk; + TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next); + } + + /* De-assert reset */ + TAILQ_INIT(&sc->rst_list); + for (off = 0; hwreset_get_by_ofw_idx(dev, 0, off, &rst) == 0; off++) { + err = hwreset_deassert(rst); + if (err != 0) { + device_printf(dev, "Could not de-assert reset\n"); + goto error; + } + rstp = malloc(sizeof(*rstp), M_DEVBUF, M_WAITOK | M_ZERO); + rstp->rst = rst; + TAILQ_INSERT_TAIL(&sc->rst_list, rstp, next); + } + + /* Enable USB PHY */ + TAILQ_INIT(&sc->phy_list); + for (off = 0; phy_get_by_ofw_idx(dev, 0, off, &phy) == 0; off++) { + err = phy_usb_set_mode(phy, PHY_USB_MODE_HOST); + if (err != 0) { + device_printf(dev, "Could not set phy to host mode\n"); + goto error; + } + err = phy_enable(phy); + if (err != 0) { + device_printf(dev, "Could not enable phy\n"); + goto error; + } + phyp = malloc(sizeof(*phyp), M_DEVBUF, M_WAITOK | M_ZERO); + phyp->phy = phy; + TAILQ_INSERT_TAIL(&sc->phy_list, phyp, next); + } +#endif + + err = generic_ehci_attach(dev); + if (err != 0) + goto error; + + return (0); + +error: + generic_ehci_fdt_detach(dev); + return (err); +} + +static int +generic_ehci_fdt_detach(device_t dev) +{ +#ifdef EXT_RESOURCES + struct generic_ehci_fdt_softc *sc; + struct clk_list *clk, *clk_tmp; + struct hwrst_list *rst, *rst_tmp; + struct phy_list *phy, *phy_tmp; +#endif + int err; + + err = generic_ehci_detach(dev); + if (err != 0) + return (err); + +#ifdef EXT_RESOURCES + sc = device_get_softc(dev); + + /* Disable clock */ + TAILQ_FOREACH_SAFE(clk, &sc->clk_list, next, clk_tmp) { + err = clk_disable(clk->clk); + if (err != 0) + device_printf(dev, "Could not disable clock %s\n", + clk_get_name(clk->clk)); + err = clk_release(clk->clk); + if (err != 0) + device_printf(dev, "Could not release clock %s\n", + clk_get_name(clk->clk)); + TAILQ_REMOVE(&sc->clk_list, clk, next); + free(clk, M_DEVBUF); + } + + /* Assert reset */ + TAILQ_FOREACH_SAFE(rst, &sc->rst_list, next, rst_tmp) { + hwreset_assert(rst->rst); + hwreset_release(rst->rst); + TAILQ_REMOVE(&sc->rst_list, rst, next); + free(rst, M_DEVBUF); + } + + /* Disable phys */ + TAILQ_FOREACH_SAFE(phy, &sc->phy_list, next, phy_tmp) { + err = phy_disable(phy->phy); + if (err != 0) + device_printf(dev, "Could not disable phy\n"); + phy_release(phy->phy); + TAILQ_REMOVE(&sc->phy_list, phy, next); + free(phy, M_DEVBUF); + } +#endif + + return (0); +} + +static device_method_t ehci_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_ehci_fdt_probe), + DEVMETHOD(device_attach, generic_ehci_fdt_attach), + DEVMETHOD(device_detach, generic_ehci_fdt_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ehci, ehci_fdt_driver, ehci_fdt_methods, + sizeof(ehci_softc_t), generic_ehci_driver); + +static devclass_t ehci_fdt_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_fdt_driver, ehci_fdt_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); From owner-svn-src-all@freebsd.org Thu Oct 3 18:58:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0663413DB07; Thu, 3 Oct 2019 18:58:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kj2J61SXz4YmL; Thu, 3 Oct 2019 18:58:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADA12187C7; Thu, 3 Oct 2019 18:58:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93IwGS4004781; Thu, 3 Oct 2019 18:58:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93IwFds004778; Thu, 3 Oct 2019 18:58:15 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910031858.x93IwFds004778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 3 Oct 2019 18:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353063 - in head/sys: arm/allwinner arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm64/conf conf X-SVN-Commit-Revision: 353063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 18:58:17 -0000 Author: manu Date: Thu Oct 3 18:58:15 2019 New Revision: 353063 URL: https://svnweb.freebsd.org/changeset/base/353063 Log: allwinner: Remove a10_ehci driver We have generic-ehci since r353062 so use it. MFC after: 1 month X-MFC-With: r353062 Deleted: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu Oct 3 18:53:03 2019 (r353062) +++ head/sys/arm/allwinner/files.allwinner Thu Oct 3 18:58:15 2019 (r353063) @@ -4,7 +4,6 @@ arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound arm/allwinner/a10_dmac.c optional a10_dmac arm/allwinner/a31_dmac.c optional a31_dmac -arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_sramc.c optional SOC_ALLWINNER_A10 arm/allwinner/aw_gpio.c optional gpio arm/allwinner/aw_if_dwc.c optional dwc @@ -26,6 +25,8 @@ arm/allwinner/sunxi_dma_if.m optional a10_dmac | a31_ dev/iicbus/twsi/a10_twsi.c optional twsi dev/usb/controller/generic_ohci.c optional ohci dev/usb/controller/generic_usb_if.m optional ohci +dev/usb/controller/generic_ehci.c optional ehci +dev/usb/controller/generic_ehci_fdt.c optional ehci arm/allwinner/aw_sid.c optional aw_sid arm/allwinner/aw_thermal.c optional aw_thermal arm/allwinner/aw_cir.c optional aw_cir evdev Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Oct 3 18:53:03 2019 (r353062) +++ head/sys/arm64/conf/GENERIC Thu Oct 3 18:58:15 2019 (r353063) @@ -203,7 +203,6 @@ device uart_snps device pl011 # USB support -device aw_ehci # Allwinner EHCI USB interface (USB 2.0) device aw_usbphy # Allwinner USB PHY device rk_usb2phy # Rockchip USB2PHY device dwcotg # DWC OTG controller Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Oct 3 18:53:03 2019 (r353062) +++ head/sys/conf/files.arm64 Thu Oct 3 18:58:15 2019 (r353063) @@ -25,7 +25,6 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ # # Allwinner common files -arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt arm/allwinner/a10_timer.c optional a10_timer fdt arm/allwinner/a10_codec.c optional sound a10_codec arm/allwinner/a31_dmac.c optional a31_dmac From owner-svn-src-all@freebsd.org Thu Oct 3 19:51:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D50E13ECDE; Thu, 3 Oct 2019 19:51:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kkDF1GL0z4ddK; Thu, 3 Oct 2019 19:51:57 +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 0F78719170; Thu, 3 Oct 2019 19:51:57 +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 x93JpuN2042247; Thu, 3 Oct 2019 19:51:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Jpu81042246; Thu, 3 Oct 2019 19:51:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910031951.x93Jpu81042246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Oct 2019 19:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353064 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 353064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 19:51:57 -0000 Author: kib Date: Thu Oct 3 19:51:56 2019 New Revision: 353064 URL: https://svnweb.freebsd.org/changeset/base/353064 Log: tmpfs_rename: style. Reformat multi-line comments to follow style. Also fix some typos. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Oct 3 18:58:15 2019 (r353063) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Oct 3 19:51:56 2019 (r353064) @@ -793,23 +793,24 @@ tmpfs_rename(struct vop_rename_args *v) struct vnode *tvp = v->a_tvp; struct componentname *tcnp = v->a_tcnp; struct mount *mp = NULL; - char *newname; - int error; struct tmpfs_dirent *de; struct tmpfs_mount *tmp; struct tmpfs_node *fdnode; struct tmpfs_node *fnode; struct tmpfs_node *tnode; struct tmpfs_node *tdnode; + int error; MPASS(VOP_ISLOCKED(tdvp)); MPASS(IMPLIES(tvp != NULL, VOP_ISLOCKED(tvp))); MPASS(fcnp->cn_flags & HASBUF); MPASS(tcnp->cn_flags & HASBUF); - /* Disallow cross-device renames. - * XXX Why isn't this done by the caller? */ + /* + * Disallow cross-device renames. + * XXX Why isn't this done by the caller? + */ if (fvp->v_mount != tdvp->v_mount || (tvp != NULL && fvp->v_mount != tvp->v_mount)) { error = EXDEV; @@ -822,8 +823,10 @@ tmpfs_rename(struct vop_rename_args *v) goto out; } - /* If we need to move the directory between entries, lock the - * source so that we can safely operate on it. */ + /* + * If we need to move the directory between entries, lock the + * source so that we can safely operate on it. + */ if (fdvp != tdvp && fdvp != tvp) { if (vn_lock(fdvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { mp = tdvp->v_mount; @@ -859,8 +862,10 @@ tmpfs_rename(struct vop_rename_args *v) fnode = VP_TO_TMPFS_NODE(fvp); de = tmpfs_dir_lookup(fdnode, fnode, fcnp); - /* Entry can disappear before we lock fdvp, - * also avoid manipulating '.' and '..' entries. */ + /* + * Entry can disappear before we lock fdvp, + * also avoid manipulating '.' and '..' entries. + */ if (de == NULL) { if ((fcnp->cn_flags & ISDOTDOT) != 0 || (fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.')) @@ -871,11 +876,13 @@ tmpfs_rename(struct vop_rename_args *v) } MPASS(de->td_node == fnode); - /* If re-naming a directory to another preexisting directory + /* + * If re-naming a directory to another preexisting directory * ensure that the target directory is empty so that its * removal causes no side effects. * Kern_rename guarantees the destination to be a directory - * if the source is one. */ + * if the source is one. + */ if (tvp != NULL) { MPASS(tnode != NULL); @@ -908,29 +915,39 @@ tmpfs_rename(struct vop_rename_args *v) goto out_locked; } - /* Ensure that we have enough memory to hold the new name, if it - * has to be changed. */ + /* + * Ensure that we have enough memory to hold the new name, if it + * has to be changed. + */ if (fcnp->cn_namelen != tcnp->cn_namelen || bcmp(fcnp->cn_nameptr, tcnp->cn_nameptr, fcnp->cn_namelen) != 0) { newname = malloc(tcnp->cn_namelen, M_TMPFSNAME, M_WAITOK); } else newname = NULL; - /* If the node is being moved to another directory, we have to do - * the move. */ + /* + * If the node is being moved to another directory, we have to do + * the move. + */ if (fdnode != tdnode) { - /* In case we are moving a directory, we have to adjust its - * parent to point to the new parent. */ + /* + * In case we are moving a directory, we have to adjust its + * parent to point to the new parent. + */ if (de->td_node->tn_type == VDIR) { struct tmpfs_node *n; - /* Ensure the target directory is not a child of the + /* + * Ensure the target directory is not a child of the * directory being moved. Otherwise, we'd end up - * with stale nodes. */ + * with stale nodes. + */ n = tdnode; - /* TMPFS_LOCK garanties that no nodes are freed while + /* + * TMPFS_LOCK guaranties that no nodes are freed while * traversing the list. Nodes can only be marked as - * removed: tn_parent == NULL. */ + * removed: tn_parent == NULL. + */ TMPFS_LOCK(tmp); TMPFS_NODE_LOCK(n); while (n != n->tn_dir.tn_parent) { @@ -973,9 +990,11 @@ tmpfs_rename(struct vop_rename_args *v) de->td_node->tn_dir.tn_parent = tdnode; TMPFS_NODE_UNLOCK(de->td_node); - /* As a result of changing the target of the '..' + /* + * As a result of changing the target of the '..' * entry, the link count of the source and target - * directories has to be adjusted. */ + * directories has to be adjusted. + */ TMPFS_NODE_LOCK(tdnode); TMPFS_ASSERT_LOCKED(tdnode); tdnode->tn_links++; @@ -988,8 +1007,10 @@ tmpfs_rename(struct vop_rename_args *v) } } - /* Do the move: just remove the entry from the source directory - * and insert it into the target one. */ + /* + * Do the move: just remove the entry from the source directory + * and insert it into the target one. + */ tmpfs_dir_detach(fdvp, de); if (fcnp->cn_flags & DOWHITEOUT) @@ -997,8 +1018,10 @@ tmpfs_rename(struct vop_rename_args *v) if (tcnp->cn_flags & ISWHITEOUT) tmpfs_dir_whiteout_remove(tdvp, tcnp); - /* If the name has changed, we need to make it effective by changing - * it in the directory entry. */ + /* + * If the name has changed, we need to make it effective by changing + * it in the directory entry. + */ if (newname != NULL) { MPASS(tcnp->cn_namelen <= MAXNAMLEN); @@ -1010,8 +1033,10 @@ tmpfs_rename(struct vop_rename_args *v) tdnode->tn_status |= TMPFS_NODE_MODIFIED; } - /* If we are overwriting an entry, we have to remove the old one - * from the target directory. */ + /* + * If we are overwriting an entry, we have to remove the old one + * from the target directory. + */ if (tvp != NULL) { struct tmpfs_dirent *tde; @@ -1019,9 +1044,11 @@ tmpfs_rename(struct vop_rename_args *v) tde = tmpfs_dir_lookup(tdnode, tnode, tcnp); tmpfs_dir_detach(tdvp, tde); - /* Free the directory entry we just deleted. Note that the + /* + * Free the directory entry we just deleted. Note that the * node referred by it will not be removed until the vnode is - * really reclaimed. */ + * really reclaimed. + */ tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), tde); } @@ -1041,9 +1068,11 @@ out_locked: VOP_UNLOCK(fdvp, 0); out: - /* Release target nodes. */ - /* XXX: I don't understand when tdvp can be the same as tvp, but - * other code takes care of this... */ + /* + * Release target nodes. + * XXX: I don't understand when tdvp can be the same as tvp, but + * other code takes care of this... + */ if (tdvp == tvp) vrele(tdvp); else @@ -1058,7 +1087,7 @@ out: if (mp != NULL) vfs_unbusy(mp); - return error; + return (error); } static int From owner-svn-src-all@freebsd.org Thu Oct 3 19:55:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60E9013EDC8; Thu, 3 Oct 2019 19:55:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kkHt1ypTz4dqs; Thu, 3 Oct 2019 19:55:06 +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 27C96192A2; Thu, 3 Oct 2019 19:55:06 +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 x93Jt6qI042484; Thu, 3 Oct 2019 19:55:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Jt6CY042483; Thu, 3 Oct 2019 19:55:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910031955.x93Jt6CY042483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Oct 2019 19:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353065 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 353065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 19:55:06 -0000 Author: kib Date: Thu Oct 3 19:55:05 2019 New Revision: 353065 URL: https://svnweb.freebsd.org/changeset/base/353065 Log: tmpfs_readdir(): unlock the locked node. During readdir() we guarantee that the tn_dir.tn_parent does not go away, but it might be replaced by a parallel rename. Read tn_parent only once, then use the cached value. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Oct 3 19:51:56 2019 (r353064) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Oct 3 19:55:05 2019 (r353065) @@ -1147,8 +1147,9 @@ static int tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct tmpfs_node *node, struct uio *uio) { - int error; + struct tmpfs_node *parent; struct dirent dent; + int error; TMPFS_VALIDATE_DIR(node); MPASS(uio->uio_offset == TMPFS_DIRCOOKIE_DOTDOT); @@ -1157,12 +1158,13 @@ tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct * Return ENOENT if the current node is already removed. */ TMPFS_ASSERT_LOCKED(node); - if (node->tn_dir.tn_parent == NULL) + parent = node->tn_dir.tn_parent; + if (parent == NULL) return (ENOENT); - TMPFS_NODE_LOCK(node->tn_dir.tn_parent); - dent.d_fileno = node->tn_dir.tn_parent->tn_id; - TMPFS_NODE_UNLOCK(node->tn_dir.tn_parent); + TMPFS_NODE_LOCK(parent); + dent.d_fileno = parent->tn_id; + TMPFS_NODE_UNLOCK(parent); dent.d_type = DT_DIR; dent.d_namlen = 2; From owner-svn-src-all@freebsd.org Thu Oct 3 20:05:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C50113F0A1; Thu, 3 Oct 2019 20:05:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kkXC1LNcz4fJW; Thu, 3 Oct 2019 20:05:47 +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 0E5981946C; Thu, 3 Oct 2019 20:05:47 +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 x93K5k5g048675; Thu, 3 Oct 2019 20:05:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93K5k9B048674; Thu, 3 Oct 2019 20:05:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910032005.x93K5k9B048674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 20:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353066 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 353066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:05:47 -0000 Author: kevans Date: Thu Oct 3 20:05:46 2019 New Revision: 353066 URL: https://svnweb.freebsd.org/changeset/base/353066 Log: certctl(8): realpath the file before creating the symlink Otherwise we end up creating broken relative symlinks in /etc/ssl/blacklisted. Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu Oct 3 19:55:05 2019 (r353065) +++ head/usr.sbin/certctl/certctl.sh Thu Oct 3 20:05:46 2019 (r353066) @@ -69,7 +69,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs "$1" "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -78,7 +78,7 @@ create_blacklisted() hash=$( do_hash "$1" ) || return [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$1" "$BLACKLISTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$BLACKLISTDESTDIR/$hash.0" } do_scan() From owner-svn-src-all@freebsd.org Thu Oct 3 20:09:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DCF813F214; Thu, 3 Oct 2019 20:09:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kkcw6cxMz4fWt; Thu, 3 Oct 2019 20:09:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66DD19475; Thu, 3 Oct 2019 20:09:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x93K9qbt048930; Thu, 3 Oct 2019 20:09:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93K9okt048917; Thu, 3 Oct 2019 20:09:50 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910032009.x93K9okt048917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 3 Oct 2019 20:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353067 - in stable/12/sys/compat: cloudabi32 cloudabi64 X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys/compat: cloudabi32 cloudabi64 X-SVN-Commit-Revision: 353067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:09:53 -0000 Author: brooks Date: Thu Oct 3 20:09:50 2019 New Revision: 353067 URL: https://svnweb.freebsd.org/changeset/base/353067 Log: MFC r352918: Regen after r347228 and r352693. No functional change. Modified: stable/12/sys/compat/cloudabi32/cloudabi32_proto.h stable/12/sys/compat/cloudabi32/cloudabi32_syscall.h stable/12/sys/compat/cloudabi32/cloudabi32_syscalls.c stable/12/sys/compat/cloudabi32/cloudabi32_sysent.c stable/12/sys/compat/cloudabi32/cloudabi32_systrace_args.c stable/12/sys/compat/cloudabi64/cloudabi64_proto.h stable/12/sys/compat/cloudabi64/cloudabi64_syscall.h stable/12/sys/compat/cloudabi64/cloudabi64_syscalls.c stable/12/sys/compat/cloudabi64/cloudabi64_sysent.c stable/12/sys/compat/cloudabi64/cloudabi64_systrace_args.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- stable/12/sys/compat/cloudabi32/cloudabi32_proto.h Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi32/cloudabi32_proto.h Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- stable/12/sys/compat/cloudabi32/cloudabi32_syscall.h Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi32/cloudabi32_syscall.h Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- stable/12/sys/compat/cloudabi32/cloudabi32_syscalls.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi32/cloudabi32_syscalls.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- stable/12/sys/compat/cloudabi32/cloudabi32_sysent.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi32/cloudabi32_sysent.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- stable/12/sys/compat/cloudabi32/cloudabi32_systrace_args.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi32/cloudabi32_systrace_args.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: stable/12/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- stable/12/sys/compat/cloudabi64/cloudabi64_proto.h Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi64/cloudabi64_proto.h Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- stable/12/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi64/cloudabi64_syscall.h Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- stable/12/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi64/cloudabi64_syscalls.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- stable/12/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi64/cloudabi64_sysent.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: stable/12/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- stable/12/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Oct 3 20:05:46 2019 (r353066) +++ stable/12/sys/compat/cloudabi64/cloudabi64_systrace_args.c Thu Oct 3 20:09:50 2019 (r353067) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ From owner-svn-src-all@freebsd.org Thu Oct 3 20:22:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A0A713F72F; Thu, 3 Oct 2019 20:22:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kkvQ2DpXz4gKq; Thu, 3 Oct 2019 20:22:26 +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 30DFB19802; Thu, 3 Oct 2019 20:22:26 +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 x93KMQZv060179; Thu, 3 Oct 2019 20:22:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93KMQ6H060178; Thu, 3 Oct 2019 20:22:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910032022.x93KMQ6H060178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 3 Oct 2019 20:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353068 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 353068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:22:26 -0000 Author: asomers Date: Thu Oct 3 20:22:25 2019 New Revision: 353068 URL: https://svnweb.freebsd.org/changeset/base/353068 Log: tftp: fix two minor Coverity CIDs Reported by: Coverity CID 1394842: file descriptor leak in an error path CID 1007603: single byte array overflow MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21695 Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Thu Oct 3 20:09:50 2019 (r353067) +++ head/usr.bin/tftp/main.c Thu Oct 3 20:22:25 2019 (r353068) @@ -491,6 +491,7 @@ put(int argc, char *argv[]) if (fstat(fd, &sb) < 0) { warn("%s", cp); + close(fd); return; } asprintf(&options[OPT_TSIZE].o_request, "%ju", sb.st_size); @@ -746,7 +747,7 @@ command(bool interactive, EditLine *el, History *hist, exit(0); len = MIN(MAXLINE, num); memcpy(line, bp, len); - line[len] = '\0'; + line[len - 1] = '\0'; history(hist, hep, H_ENTER, bp); } else { line[0] = 0; From owner-svn-src-all@freebsd.org Thu Oct 3 20:39:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45F101401BB; Thu, 3 Oct 2019 20:39:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46klGt0xnDz4hjL; Thu, 3 Oct 2019 20:39:18 +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 0442F199D2; Thu, 3 Oct 2019 20:39: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 x93KdH1K070023; Thu, 3 Oct 2019 20:39:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93KdHGU070022; Thu, 3 Oct 2019 20:39:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910032039.x93KdHGU070022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 20:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353069 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:39:18 -0000 Author: tuexen Date: Thu Oct 3 20:39:17 2019 New Revision: 353069 URL: https://svnweb.freebsd.org/changeset/base/353069 Log: Cleanup sctp_asconf_error_response() and ensure that the parameter is padded as required. This fixes the followig bug reported by OSS-Fuzz for the usersctp stack: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17790 MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Oct 3 20:22:25 2019 (r353068) +++ head/sys/netinet/sctp_asconf.c Thu Oct 3 20:39:17 2019 (r353069) @@ -105,42 +105,47 @@ sctp_asconf_error_response(uint32_t id, uint16_t cause struct mbuf *m_reply = NULL; struct sctp_asconf_paramhdr *aph; struct sctp_error_cause *error; + size_t buf_len; + uint16_t i, param_length, cause_length, padding_length; uint8_t *tlv; - m_reply = sctp_get_mbuf_for_msg((sizeof(struct sctp_asconf_paramhdr) + - tlv_length + - sizeof(struct sctp_error_cause)), - 0, M_NOWAIT, 1, MT_DATA); + if (error_tlv == NULL) { + tlv_length = 0; + } + cause_length = sizeof(struct sctp_error_cause) + tlv_length; + param_length = sizeof(struct sctp_asconf_paramhdr) + cause_length; + padding_length = tlv_length % 4; + if (padding_length != 0) { + padding_length = 4 - padding_length; + } + buf_len = param_length + padding_length; + if (buf_len > MLEN) { + SCTPDBG(SCTP_DEBUG_ASCONF1, + "asconf_error_response: tlv_length (%xh) too big\n", + tlv_length); + return (NULL); + } + m_reply = sctp_get_mbuf_for_msg(buf_len, 0, M_NOWAIT, 1, MT_DATA); if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); - error = (struct sctp_error_cause *)(aph + 1); - - aph->correlation_id = id; aph->ph.param_type = htons(SCTP_ERROR_CAUSE_IND); + aph->ph.param_length = htons(param_length); + aph->correlation_id = id; + error = (struct sctp_error_cause *)(aph + 1); error->code = htons(cause); - error->length = tlv_length + sizeof(struct sctp_error_cause); - aph->ph.param_length = error->length + - sizeof(struct sctp_asconf_paramhdr); - - if (aph->ph.param_length > MLEN) { - SCTPDBG(SCTP_DEBUG_ASCONF1, - "asconf_error_response: tlv_length (%xh) too big\n", - tlv_length); - sctp_m_freem(m_reply); /* discard */ - return (NULL); - } + error->length = htons(cause_length); if (error_tlv != NULL) { tlv = (uint8_t *)(error + 1); memcpy(tlv, error_tlv, tlv_length); + for (i = 0; i < padding_length; i++) { + tlv[tlv_length + i] = 0; + } } - SCTP_BUF_LEN(m_reply) = aph->ph.param_length; - error->length = htons(error->length); - aph->ph.param_length = htons(aph->ph.param_length); - + SCTP_BUF_LEN(m_reply) = buf_len; return (m_reply); } @@ -780,8 +785,6 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset if (m_result != NULL) { SCTP_BUF_NEXT(m_tail) = m_result; m_tail = m_result; - /* update lengths, make sure it's aligned too */ - SCTP_BUF_LEN(m_result) = SCTP_SIZE32(SCTP_BUF_LEN(m_result)); ack_cp->ch.chunk_length += SCTP_BUF_LEN(m_result); /* set flag to force success reports */ error = 1; From owner-svn-src-all@freebsd.org Thu Oct 3 20:45:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B9B91403A5; Thu, 3 Oct 2019 20:45:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46klQT2gchz4j6S; Thu, 3 Oct 2019 20:45:53 +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 3BEB419B9E; Thu, 3 Oct 2019 20:45:53 +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 x93KjrYq075740; Thu, 3 Oct 2019 20:45:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Kjrbr075739; Thu, 3 Oct 2019 20:45:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910032045.x93Kjrbr075739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Oct 2019 20:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353070 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 353070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:45:53 -0000 Author: kevans Date: Thu Oct 3 20:45:52 2019 New Revision: 353070 URL: https://svnweb.freebsd.org/changeset/base/353070 Log: certctl(8): let one blacklist based on hashed filenames It seems reasonable to allow, for instance: $ certctl list # reviews output -- ah, yeah, I don't trust that one $ certctl blacklist ce5e74ef.0 $ certctl rehash We can unambiguously determine what cert "ce5e74ef.0" refers to, and we've described it to them in `certctl list` output -- I see little sense in forcing another level of filesystem inspection to determien what cert file this physically corresponds to. Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu Oct 3 20:39:17 2019 (r353069) +++ head/usr.sbin/certctl/certctl.sh Thu Oct 3 20:45:52 2019 (r353070) @@ -74,11 +74,21 @@ create_trusted_link() create_blacklisted() { - local hash + local hash srcfile filename - hash=$( do_hash "$1" ) || return - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to blacklist" - [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$BLACKLISTDESTDIR/$hash.0" + # If it exists as a file, we'll try that; otherwise, we'll scan + if [ -e "$1" ]; then + hash=$( do_hash "$1" ) || return + srcfile=$(realpath "$1") + filename="$hash.0" + elif [ -e "${CERTDESTDIR}/$1" ]; then + srcfile=$(realpath "${CERTDESTDIR}/$1") + filename="$1" + else + return + fi + [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" + [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() From owner-svn-src-all@freebsd.org Thu Oct 3 20:47:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4588A14042E; Thu, 3 Oct 2019 20:47:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46klSt13pfz4jG2; Thu, 3 Oct 2019 20:47:58 +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 07E6519BA5; Thu, 3 Oct 2019 20:47:58 +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 x93KlvCa075883; Thu, 3 Oct 2019 20:47:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93KlvZR075882; Thu, 3 Oct 2019 20:47:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910032047.x93KlvZR075882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 3 Oct 2019 20:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353071 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 20:47:58 -0000 Author: tuexen Date: Thu Oct 3 20:47:57 2019 New Revision: 353071 URL: https://svnweb.freebsd.org/changeset/base/353071 Log: When skipping the address parameter, take the padding into account. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Oct 3 20:45:52 2019 (r353070) +++ head/sys/netinet/sctp_asconf.c Thu Oct 3 20:47:57 2019 (r353071) @@ -699,8 +699,8 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset sctp_m_freem(m_ack); return; } - /* param_length is already validated in process_control... */ - offset += ntohs(p_addr->ph.param_length); /* skip lookup addr */ + /* skip lookup addr */ + offset += SCTP_SIZE32(ntohs(p_addr->ph.param_length)); /* get pointer to first asconf param in ASCONF */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *)&aparam_buf); if (aph == NULL) { From owner-svn-src-all@freebsd.org Thu Oct 3 21:37:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABD49141819; Thu, 3 Oct 2019 21:37:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kmYT45TGz4m0C; Thu, 3 Oct 2019 21:37:01 +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 6FC071A4CC; Thu, 3 Oct 2019 21:37:01 +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 x93Lb18Q005337; Thu, 3 Oct 2019 21:37:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x93Lb1H0005336; Thu, 3 Oct 2019 21:37:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201910032137.x93Lb1H0005336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Oct 2019 21:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353072 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 353072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Oct 2019 21:37:01 -0000 Author: jhb Date: Thu Oct 3 21:37:01 2019 New Revision: 353072 URL: https://svnweb.freebsd.org/changeset/base/353072 Log: Remove aw_ehci from NOTES to fix LINT kernel builds after r353063. Reported by: Jenkins Modified: head/sys/arm64/conf/NOTES Modified: head/sys/arm64/conf/NOTES ============================================================================== --- head/sys/arm64/conf/NOTES Thu Oct 3 20:47:57 2019 (r353071) +++ head/sys/arm64/conf/NOTES Thu Oct 3 21:37:01 2019 (r353072) @@ -107,7 +107,6 @@ device uart_snps device pl011 # USB support -device aw_ehci # Allwinner EHCI USB interface (USB 2.0) device aw_usbphy # Allwinner USB PHY device dwcotg # DWC OTG controller device ehci_mv # Marvell EHCI USB interface From owner-svn-src-all@freebsd.org Fri Oct 4 00:04:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 608471445B5; Fri, 4 Oct 2019 00:04:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kqqV1xwfz4tpd; Fri, 4 Oct 2019 00:04:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209CB1BF49; Fri, 4 Oct 2019 00:04:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9404Lpt093993; Fri, 4 Oct 2019 00:04:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9404LxE093992; Fri, 4 Oct 2019 00:04:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201910040004.x9404LxE093992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 4 Oct 2019 00:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353073 - releng/12.1/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.1/sys/conf X-SVN-Commit-Revision: 353073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 00:04:22 -0000 Author: gjb Date: Fri Oct 4 00:04:21 2019 New Revision: 353073 URL: https://svnweb.freebsd.org/changeset/base/353073 Log: Update releng/12.1 to BETA3 as part of the 12.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/12.1/sys/conf/newvers.sh Modified: releng/12.1/sys/conf/newvers.sh ============================================================================== --- releng/12.1/sys/conf/newvers.sh Thu Oct 3 21:37:01 2019 (r353072) +++ releng/12.1/sys/conf/newvers.sh Fri Oct 4 00:04:21 2019 (r353073) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Oct 4 01:38:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C95B145C59; Fri, 4 Oct 2019 01:38:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kswd1Fy7z3Dst; Fri, 4 Oct 2019 01:38:57 +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 0A4E41CF1B; Fri, 4 Oct 2019 01:38: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 x941curQ046864; Fri, 4 Oct 2019 01:38:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941cubJ046863; Fri, 4 Oct 2019 01:38:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040138.x941cubJ046863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:38: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: r353074 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:38:57 -0000 Author: cy Date: Fri Oct 4 01:38:56 2019 New Revision: 353074 URL: https://svnweb.freebsd.org/changeset/base/353074 Log: MFC r319273: Remove NORESOLVE (-R) option from poollist() (ippool -l). It is not used in poollist(). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 00:04:21 2019 (r353073) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:38:56 2019 (r353074) @@ -657,7 +657,7 @@ poollist(argc, argv) poolname = NULL; role = IPL_LOGALL; - while ((c = getopt(argc, argv, "dm:M:N:o:Rt:v")) != -1) + while ((c = getopt(argc, argv, "dm:M:N:o:t:v")) != -1) switch (c) { case 'd' : @@ -683,9 +683,6 @@ poollist(argc, argv) break; case 'O' : pool_fields = parsefields(poolfields, optarg); - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 't' : type = gettype(optarg, NULL); From owner-svn-src-all@freebsd.org Fri Oct 4 01:40:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE595145CD9; Fri, 4 Oct 2019 01:40:05 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ksxx3b61z3F1M; Fri, 4 Oct 2019 01:40:05 +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 5E7361CF1F; Fri, 4 Oct 2019 01:40:05 +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 x941e58k046997; Fri, 4 Oct 2019 01:40:05 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941e5ZZ046996; Fri, 4 Oct 2019 01:40:05 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040140.x941e5ZZ046996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:40: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: r353075 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:40:05 -0000 Author: cy Date: Fri Oct 4 01:40:04 2019 New Revision: 353075 URL: https://svnweb.freebsd.org/changeset/base/353075 Log: MFC r319794: Flag poollist() (ippool -l) command line syntax errors. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:38:56 2019 (r353074) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:40:04 2019 (r353075) @@ -694,7 +694,13 @@ poollist(argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poollist: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Fri Oct 4 01:41:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A7B7145F2B; Fri, 4 Oct 2019 01:41:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kszZ1kzNz3FL1; Fri, 4 Oct 2019 01:41:30 +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 2038C1D06F; Fri, 4 Oct 2019 01:41:30 +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 x941fULi049984; Fri, 4 Oct 2019 01:41:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941fUeD049983; Fri, 4 Oct 2019 01:41:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040141.x941fUeD049983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:41:30 +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: r353076 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:41:30 -0000 Author: cy Date: Fri Oct 4 01:41:29 2019 New Revision: 353076 URL: https://svnweb.freebsd.org/changeset/base/353076 Log: MFC r319795: Disable the -O (output fields) option in poollist() (ippool -l) for now. The option does not presently work. However, similar functions in ipfstat (for state) and ipnat (for nat) do work and provide outputs that can be easily parsed by shell scripts or subsequently loaded into CSV files. The intention here is to return to this option to make it work. I suspect the problem is in printpoolfields.c. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:40:04 2019 (r353075) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:41:29 2019 (r353076) @@ -73,7 +73,7 @@ usage(prog) fprintf(stderr, "\t-A [-dnv] [-m ] [-o ] [-S ] [-t ]\n"); fprintf(stderr, "\t-f [-dnuv]\n"); fprintf(stderr, "\t-F [-dv] [-o ] [-t ]\n"); - fprintf(stderr, "\t-l [-dv] [-m ] [-t ] [-O ]\n"); + fprintf(stderr, "\t-l [-dv] [-m ] [-t ]\n"); fprintf(stderr, "\t-r [-dnv] [-m ] [-o ] [-t type] -i [/netmask]\n"); fprintf(stderr, "\t-R [-dnv] [-m ] [-o ] [-t ]\n"); fprintf(stderr, "\t-s [-dtv] [-M ] [-N ]\n"); @@ -681,9 +681,16 @@ poollist(argc, argv) return -1; } break; +#if 0 case 'O' : + /* XXX This option does not work. This function as */ + /* XXX used by state and nat can be used to format */ + /* XXX output especially useful for scripting. It */ + /* XXX is left here with the intention of making */ + /* XXX it work for the same purpose at some point. */ pool_fields = parsefields(poolfields, optarg); break; +#endif case 't' : type = gettype(optarg, NULL); if (type == IPLT_NONE) { From owner-svn-src-all@freebsd.org Fri Oct 4 01:43:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B22F145FEA; Fri, 4 Oct 2019 01:43:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kt2B2w4Zz3FXH; Fri, 4 Oct 2019 01:43:46 +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 48B3B1D0D5; Fri, 4 Oct 2019 01:43: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 x941hkDh052325; Fri, 4 Oct 2019 01:43:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941hkn2052324; Fri, 4 Oct 2019 01:43:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040143.x941hkn2052324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:43: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: r353077 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:43:46 -0000 Author: cy Date: Fri Oct 4 01:43:45 2019 New Revision: 353077 URL: https://svnweb.freebsd.org/changeset/base/353077 Log: MFC r319810: Remove redundant assignment of infile from optarg in loadpoolfile() which was previously assigned from optarg in the argument list from main(). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:41:29 2019 (r353076) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:43:45 2019 (r353077) @@ -355,8 +355,6 @@ loadpoolfile(argc, argv, infile) { int c; - infile = optarg; - while ((c = getopt(argc, argv, "dnRuv")) != -1) switch (c) { From owner-svn-src-all@freebsd.org Fri Oct 4 01:44:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D76714605D; Fri, 4 Oct 2019 01:44:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kt3Y2gwNz3Fhy; Fri, 4 Oct 2019 01:44:57 +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 3F8D41D0D6; Fri, 4 Oct 2019 01:44: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 x941ivNa052453; Fri, 4 Oct 2019 01:44:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941ivNH052452; Fri, 4 Oct 2019 01:44:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040144.x941ivNH052452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:44: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: r353078 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:44:57 -0000 Author: cy Date: Fri Oct 4 01:44:56 2019 New Revision: 353078 URL: https://svnweb.freebsd.org/changeset/base/353078 Log: MFC r319820: Identify command line syntax errors in poolflush() (ippool -F). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:43:45 2019 (r353077) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:44:56 2019 (r353078) @@ -551,7 +551,13 @@ poolflush(argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poolflush: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Fri Oct 4 01:45:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FF3D1460F2; Fri, 4 Oct 2019 01:45: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kt4l2FlZz3Fqb; Fri, 4 Oct 2019 01:45: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 31A631D0D7; Fri, 4 Oct 2019 01:45: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 x941jx9q052562; Fri, 4 Oct 2019 01:45:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941jx4Y052561; Fri, 4 Oct 2019 01:45:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040145.x941jx4Y052561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:45:59 +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: r353079 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:45:59 -0000 Author: cy Date: Fri Oct 4 01:45:58 2019 New Revision: 353079 URL: https://svnweb.freebsd.org/changeset/base/353079 Log: MFC r319821: Identify poolstats() (ippool -s) command line syntax errors. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:44:56 2019 (r353078) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:45:58 2019 (r353079) @@ -445,7 +445,13 @@ poolstats(argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poolstats: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Fri Oct 4 01:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 678DD14616C; Fri, 4 Oct 2019 01:47:01 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kt5x24rSz3Fy6; Fri, 4 Oct 2019 01:47:01 +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 2C0C71D0D8; Fri, 4 Oct 2019 01:47:01 +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 x941l1ua052665; Fri, 4 Oct 2019 01:47:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941l1Ao052664; Fri, 4 Oct 2019 01:47:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040147.x941l1Ao052664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:47: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: r353080 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:47:01 -0000 Author: cy Date: Fri Oct 4 01:47:00 2019 New Revision: 353080 URL: https://svnweb.freebsd.org/changeset/base/353080 Log: MFC r319822: Flag loadpoolfile() (ippool -f) command line syntax errors. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:45:58 2019 (r353079) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:47:00 2019 (r353080) @@ -374,7 +374,13 @@ loadpoolfile(argc, argv, infile) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "loadpoolfile: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Fri Oct 4 01:55:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 657071463D8; Fri, 4 Oct 2019 01:55:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktHD1qnGz3GRW; Fri, 4 Oct 2019 01:55:04 +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 236F61D299; Fri, 4 Oct 2019 01:55:04 +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 x941t4FS058496; Fri, 4 Oct 2019 01:55:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941t41f058495; Fri, 4 Oct 2019 01:55:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040155.x941t41f058495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:55:04 +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: r353081 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:55:04 -0000 Author: cy Date: Fri Oct 4 01:55:03 2019 New Revision: 353081 URL: https://svnweb.freebsd.org/changeset/base/353081 Log: MFC r319848: -v (verbose) is not a command option. (See ippool.1 for a definition of command options). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:47:00 2019 (r353080) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:55:03 2019 (r353081) @@ -122,9 +122,6 @@ main(argc, argv) case 's' : err = poolstats(argc, argv); break; - case 'v' : - opts |= OPT_VERBOSE; - break; default : exit(1); } From owner-svn-src-all@freebsd.org Fri Oct 4 01:56:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED9281464DA; Fri, 4 Oct 2019 01:56:21 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktJj5krkz3GZq; Fri, 4 Oct 2019 01:56:21 +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 A7FBC1D29A; Fri, 4 Oct 2019 01:56:21 +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 x941uL1J058604; Fri, 4 Oct 2019 01:56:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941uLUD058603; Fri, 4 Oct 2019 01:56:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040156.x941uLUD058603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:56: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: r353082 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:56:22 -0000 Author: cy Date: Fri Oct 4 01:56:21 2019 New Revision: 353082 URL: https://svnweb.freebsd.org/changeset/base/353082 Log: MFC r319929: -n (do nothing) is not a commmand option. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:55:03 2019 (r353081) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:56:21 2019 (r353082) @@ -93,7 +93,7 @@ main(argc, argv) assigndefined(getenv("IPPOOL_PREDEFINED")); - switch (getopt(argc, argv, "aAf:FlnrRsv")) + switch (getopt(argc, argv, "aAf:FlrRsv")) { case 'a' : err = poolnodecommand(0, argc, argv); @@ -109,9 +109,6 @@ main(argc, argv) break; case 'l' : err = poollist(argc, argv); - break; - case 'n' : - opts |= OPT_DONOTHING|OPT_DONTOPEN; break; case 'r' : err = poolnodecommand(1, argc, argv); From owner-svn-src-all@freebsd.org Fri Oct 4 01:58:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0551D1465AD; Fri, 4 Oct 2019 01:58:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktLs6Jbhz3Gk8; Fri, 4 Oct 2019 01:58:13 +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 B75ED1D29B; Fri, 4 Oct 2019 01:58:13 +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 x941wDT8058733; Fri, 4 Oct 2019 01:58:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941wDWs058732; Fri, 4 Oct 2019 01:58:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040158.x941wDWs058732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:58: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: r353083 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:58:14 -0000 Author: cy Date: Fri Oct 4 01:58:13 2019 New Revision: 353083 URL: https://svnweb.freebsd.org/changeset/base/353083 Log: MFC r319930: Chase r319848: remove -v option from getopt() call. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:56:21 2019 (r353082) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:58:13 2019 (r353083) @@ -93,7 +93,7 @@ main(argc, argv) assigndefined(getenv("IPPOOL_PREDEFINED")); - switch (getopt(argc, argv, "aAf:FlrRsv")) + switch (getopt(argc, argv, "aAf:FlrRs")) { case 'a' : err = poolnodecommand(0, argc, argv); From owner-svn-src-all@freebsd.org Fri Oct 4 01:59:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 078E614662C; Fri, 4 Oct 2019 01:59:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktNF6SLCz3GsQ; Fri, 4 Oct 2019 01:59:25 +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 C12C21D2B6; Fri, 4 Oct 2019 01:59:25 +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 x941xPmY058833; Fri, 4 Oct 2019 01:59:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x941xPU2058832; Fri, 4 Oct 2019 01:59:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040159.x941xPU2058832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 01:59:25 +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: r353084 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 01:59:26 -0000 Author: cy Date: Fri Oct 4 01:59:25 2019 New Revision: 353084 URL: https://svnweb.freebsd.org/changeset/base/353084 Log: MFC r320095: Flag poolcommand() (ippool -A and ippool -R) command line syntax errors. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:58:13 2019 (r353083) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:59:25 2019 (r353084) @@ -291,7 +291,13 @@ poolcommand(remove, argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (opts & OPT_DEBUG) fprintf(stderr, "poolcommand: opts = %#x\n", opts); From owner-svn-src-all@freebsd.org Fri Oct 4 02:00:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89A321466F4; Fri, 4 Oct 2019 02:00:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktPD339dz3H1Q; Fri, 4 Oct 2019 02:00:16 +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 4D2411D2BF; Fri, 4 Oct 2019 02:00:16 +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 x9420GhK058990; Fri, 4 Oct 2019 02:00:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9420Gn4058989; Fri, 4 Oct 2019 02:00:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040200.x9420Gn4058989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:00: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: r353085 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:00:16 -0000 Author: cy Date: Fri Oct 4 02:00:15 2019 New Revision: 353085 URL: https://svnweb.freebsd.org/changeset/base/353085 Log: MFC r320120: poolcommand() (ippool -A and ippool -R) seed takes an argument. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 01:59:25 2019 (r353084) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:00:15 2019 (r353085) @@ -262,7 +262,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:RSv")) != -1) + while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1) switch (c) { case 'd' : From owner-svn-src-all@freebsd.org Fri Oct 4 02:01:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70EB01467BE; Fri, 4 Oct 2019 02:01:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktQX2Gsnz3HJb; Fri, 4 Oct 2019 02:01:24 +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 32BFB1D416; Fri, 4 Oct 2019 02:01:24 +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 x9421O2K061645; Fri, 4 Oct 2019 02:01:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9421O4N061644; Fri, 4 Oct 2019 02:01:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040201.x9421O4N061644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:01:24 +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: r353086 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:01:24 -0000 Author: cy Date: Fri Oct 4 02:01:23 2019 New Revision: 353086 URL: https://svnweb.freebsd.org/changeset/base/353086 Log: MFC r320143: Flag poolnodecommand() (ippool -a and ippool -r) command line syntax errors. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:00:15 2019 (r353085) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:01:23 2019 (r353086) @@ -204,7 +204,13 @@ poolnodecommand(remove, argc, argv) case 'v' : opts |= OPT_VERBOSE; break; + default : + usage(argv[0]); + break; /* keep compiler happy */ } + + if (argc - 1 - optind > 0) + usage(argv[0]); if (argv[optind] != NULL && ipset == 0) { if (setnodeaddr(type, role, ptr, argv[optind]) == 0) From owner-svn-src-all@freebsd.org Fri Oct 4 02:02:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04135146939; Fri, 4 Oct 2019 02:02:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktRS6JNmz3HSn; Fri, 4 Oct 2019 02:02:12 +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 BC18A1D45A; Fri, 4 Oct 2019 02:02:12 +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 x9422CFP061729; Fri, 4 Oct 2019 02:02:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9422C0C061728; Fri, 4 Oct 2019 02:02:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040202.x9422C0C061728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:02: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: r353087 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:02:13 -0000 Author: cy Date: Fri Oct 4 02:02:12 2019 New Revision: 353087 URL: https://svnweb.freebsd.org/changeset/base/353087 Log: MFC r320187: Fix -S handling within poolcommand(). Specifying a seed (-S) is only valid when adding a pool (ippool -A), not when removing a pool (ippool -R). It is a command line syntax error if specifying a seed (-S) is specified when emoving a pool (-R). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:01:23 2019 (r353086) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:02:12 2019 (r353087) @@ -292,7 +292,10 @@ poolcommand(remove, argc, argv) opts |= OPT_NORESOLVE; break; case 'S' : - iph.iph_seed = atoi(optarg); + if (remove == 0) + iph.iph_seed = atoi(optarg); + else + usage(argv[0]); break; case 'v' : opts |= OPT_VERBOSE; From owner-svn-src-all@freebsd.org Fri Oct 4 02:02:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4DED1469CD; Fri, 4 Oct 2019 02:02: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktSM5pf2z3HcB; Fri, 4 Oct 2019 02:02: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 AA9701D47B; Fri, 4 Oct 2019 02:02: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 x9422xm9064674; Fri, 4 Oct 2019 02:02:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9422xUk064673; Fri, 4 Oct 2019 02:02:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040202.x9422xUk064673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:02:59 +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: r353088 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:03:00 -0000 Author: cy Date: Fri Oct 4 02:02:59 2019 New Revision: 353088 URL: https://svnweb.freebsd.org/changeset/base/353088 Log: MFC r320221: poolflush() has no positional arguments. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:02:12 2019 (r353087) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:02:59 2019 (r353088) @@ -577,7 +577,7 @@ poolflush(argc, argv) break; /* keep compiler happy */ } - if (argc - 1 - optind > 0) + if (argc - optind > 0) usage(argv[0]); if (opts & OPT_DEBUG) From owner-svn-src-all@freebsd.org Fri Oct 4 02:04:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4420146A4F; Fri, 4 Oct 2019 02:04: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktTv3XsVz3Hkn; Fri, 4 Oct 2019 02:04: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 5CFA71D47C; Fri, 4 Oct 2019 02:04:19 +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 x9424JBA064779; Fri, 4 Oct 2019 02:04:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9424Jd1064778; Fri, 4 Oct 2019 02:04:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040204.x9424Jd1064778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:04: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: r353089 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:04:19 -0000 Author: cy Date: Fri Oct 4 02:04:18 2019 New Revision: 353089 URL: https://svnweb.freebsd.org/changeset/base/353089 Log: MFC r320428: In poolnodecommand() (ippool -a and ippool -r) -m (pool name) is not optional. Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:02:59 2019 (r353088) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:04:18 2019 (r353089) @@ -69,7 +69,7 @@ usage(prog) char *prog; { fprintf(stderr, "Usage:\t%s\n", prog); - fprintf(stderr, "\t-a [-dnv] [-m ] [-o ] [-t type] [-T ttl] -i [/netmask]\n"); + fprintf(stderr, "\t-a [-dnv] -m [-o ] [-t type] [-T ttl] -i [/netmask]\n"); fprintf(stderr, "\t-A [-dnv] [-m ] [-o ] [-S ] [-t ]\n"); fprintf(stderr, "\t-f [-dnuv]\n"); fprintf(stderr, "\t-F [-dv] [-o ] [-t ]\n"); From owner-svn-src-all@freebsd.org Fri Oct 4 02:05:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 987C9146AE3; Fri, 4 Oct 2019 02:05:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktWC3Vd5z3Hxx; Fri, 4 Oct 2019 02:05:27 +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 5AC9C1D482; Fri, 4 Oct 2019 02:05:27 +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 x9425RPu064936; Fri, 4 Oct 2019 02:05:27 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9425QTS064933; Fri, 4 Oct 2019 02:05:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040205.x9425QTS064933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:05: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: r353091 - in stable/11/contrib/ipfilter: man tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11/contrib/ipfilter: man tools X-SVN-Commit-Revision: 353091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:05:27 -0000 Author: cy Date: Fri Oct 4 02:05:26 2019 New Revision: 353091 URL: https://svnweb.freebsd.org/changeset/base/353091 Log: MFC r320664: Document supported poollist() (ippool -l) options in usage() and in ippool.8 man page. Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:04:32 2019 (r353090) +++ stable/11/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:05:26 2019 (r353091) @@ -18,7 +18,7 @@ ippool \- user interface to the IPFilter pools -F [-dv] [-o ] [-t ] .br .B ippool --l [-dv] [-m ] [-t ] +-l [-dv] [-m ] [-t ] [-o ] [-M ] [-N ] .br .B ippool -r [-dnv] [-m ] [-o ] [-t ] -i [/] Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:04:32 2019 (r353090) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:05:26 2019 (r353091) @@ -73,7 +73,7 @@ usage(prog) fprintf(stderr, "\t-A [-dnv] [-m ] [-o ] [-S ] [-t ]\n"); fprintf(stderr, "\t-f [-dnuv]\n"); fprintf(stderr, "\t-F [-dv] [-o ] [-t ]\n"); - fprintf(stderr, "\t-l [-dv] [-m ] [-t ]\n"); + fprintf(stderr, "\t-l [-dv] [-m ] [-t ] [-o ] [-M ] [-N ]\n"); fprintf(stderr, "\t-r [-dnv] [-m ] [-o ] [-t type] -i [/netmask]\n"); fprintf(stderr, "\t-R [-dnv] [-m ] [-o ] [-t ]\n"); fprintf(stderr, "\t-s [-dtv] [-M ] [-N ]\n"); From owner-svn-src-all@freebsd.org Fri Oct 4 02:06:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B37A146B82; Fri, 4 Oct 2019 02:06:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktXJ3XbKz3J5v; Fri, 4 Oct 2019 02:06:24 +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 5DB471D48B; Fri, 4 Oct 2019 02:06:24 +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 x9426OJ3065024; Fri, 4 Oct 2019 02:06:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9426ODc065023; Fri, 4 Oct 2019 02:06:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040206.x9426ODc065023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:06:24 +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: r353092 - stable/11/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/contrib/ipfilter/tools X-SVN-Commit-Revision: 353092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:06:24 -0000 Author: cy Date: Fri Oct 4 02:06:23 2019 New Revision: 353092 URL: https://svnweb.freebsd.org/changeset/base/353092 Log: MFC r322075: loadpoolfile() implements a -R (NORESOLVE) option which is not listed in usage(). This commit trues up usage() with loadpoolfile(). Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:05:26 2019 (r353091) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:06:23 2019 (r353092) @@ -71,7 +71,7 @@ usage(prog) fprintf(stderr, "Usage:\t%s\n", prog); fprintf(stderr, "\t-a [-dnv] -m [-o ] [-t type] [-T ttl] -i [/netmask]\n"); fprintf(stderr, "\t-A [-dnv] [-m ] [-o ] [-S ] [-t ]\n"); - fprintf(stderr, "\t-f [-dnuv]\n"); + fprintf(stderr, "\t-f [-dnuvR]\n"); fprintf(stderr, "\t-F [-dv] [-o ] [-t ]\n"); fprintf(stderr, "\t-l [-dv] [-m ] [-t ] [-o ] [-M ] [-N ]\n"); fprintf(stderr, "\t-r [-dnv] [-m ] [-o ] [-t type] -i [/netmask]\n"); From owner-svn-src-all@freebsd.org Fri Oct 4 02:09:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A06BD146C14; Fri, 4 Oct 2019 02:09: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktcJ3m30z3JDS; Fri, 4 Oct 2019 02:09: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 602A31D48C; Fri, 4 Oct 2019 02:09: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 x9429qiA065243; Fri, 4 Oct 2019 02:09:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9429qqx065242; Fri, 4 Oct 2019 02:09:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040209.x9429qqx065242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:09:52 +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: r353093 - in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 353093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:09:52 -0000 Author: cy Date: Fri Oct 4 02:09:51 2019 New Revision: 353093 URL: https://svnweb.freebsd.org/changeset/base/353093 Log: MFC r352785: The no resolve (OPT_NORESOLVE) does nothing. Additionally, it (-R) conflicts with the command option of the same name (also -R). Remove the superfluous and confusing non-global non-command -R option. PR: 218433 Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:06:23 2019 (r353092) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:09:51 2019 (r353093) @@ -145,7 +145,7 @@ poolnodecommand(remove, argc, argv) bzero((char *)&pnode, sizeof(pnode)); bzero((char *)&hnode, sizeof(hnode)); - while ((c = getopt(argc, argv, "di:m:no:Rt:T:v")) != -1) + while ((c = getopt(argc, argv, "di:m:no:t:T:v")) != -1) switch (c) { case 'd' : @@ -172,9 +172,6 @@ poolnodecommand(remove, argc, argv) if (role == IPL_LOGNONE) return -1; break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 't' : if (ipset == 1) { fprintf(stderr, @@ -268,7 +265,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) switch (c) { case 'd' : @@ -288,9 +285,6 @@ poolcommand(remove, argc, argv) return -1; } break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 'S' : if (remove == 0) iph.iph_seed = atoi(optarg); @@ -364,7 +358,7 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnRuv")) != -1) + while ((c = getopt(argc, argv, "dnuv")) != -1) switch (c) { case 'd' : @@ -373,9 +367,6 @@ loadpoolfile(argc, argv, infile) break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 'u' : opts |= OPT_REMOVE; From owner-svn-src-all@freebsd.org Fri Oct 4 02:09:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BC5E146C25; Fri, 4 Oct 2019 02:09: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktcJ6XJCz3JDV; Fri, 4 Oct 2019 02:09: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 C3AA31D48D; Fri, 4 Oct 2019 02:09: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 x9429qc8065249; Fri, 4 Oct 2019 02:09:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9429qh6065248; Fri, 4 Oct 2019 02:09:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040209.x9429qh6065248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353093 - in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 353093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:09:53 -0000 Author: cy Date: Fri Oct 4 02:09:51 2019 New Revision: 353093 URL: https://svnweb.freebsd.org/changeset/base/353093 Log: MFC r352785: The no resolve (OPT_NORESOLVE) does nothing. Additionally, it (-R) conflicts with the command option of the same name (also -R). Remove the superfluous and confusing non-global non-command -R option. PR: 218433 Modified: stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/12/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:06:23 2019 (r353092) +++ stable/12/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:09:51 2019 (r353093) @@ -145,7 +145,7 @@ poolnodecommand(remove, argc, argv) bzero((char *)&pnode, sizeof(pnode)); bzero((char *)&hnode, sizeof(hnode)); - while ((c = getopt(argc, argv, "di:m:no:Rt:T:v")) != -1) + while ((c = getopt(argc, argv, "di:m:no:t:T:v")) != -1) switch (c) { case 'd' : @@ -172,9 +172,6 @@ poolnodecommand(remove, argc, argv) if (role == IPL_LOGNONE) return -1; break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 't' : if (ipset == 1) { fprintf(stderr, @@ -272,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) switch (c) { case 'd' : @@ -292,9 +289,6 @@ poolcommand(remove, argc, argv) return -1; } break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 'S' : if (remove == 0) iph.iph_seed = atoi(optarg); @@ -368,7 +362,7 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnRuv")) != -1) + while ((c = getopt(argc, argv, "dnuv")) != -1) switch (c) { case 'd' : @@ -377,9 +371,6 @@ loadpoolfile(argc, argv, infile) break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 'u' : opts |= OPT_REMOVE; From owner-svn-src-all@freebsd.org Fri Oct 4 02:11:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33E38146EDB; Fri, 4 Oct 2019 02:11:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktfV0Z99z3Jkr; Fri, 4 Oct 2019 02:11:46 +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 EAE051D622; Fri, 4 Oct 2019 02:11:45 +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 x942BjeZ068331; Fri, 4 Oct 2019 02:11:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x942BjN1068329; Fri, 4 Oct 2019 02:11:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040211.x942BjN1068329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:11: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: r353094 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 353094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:11:46 -0000 Author: cy Date: Fri Oct 4 02:11:45 2019 New Revision: 353094 URL: https://svnweb.freebsd.org/changeset/base/353094 Log: MFC r352786: Implement the dynamic add (-A) and removal (-R) of ippool pools from the command line. Prior to this the functionality was mostly there however since the pool type (-t) was not recognized by the -A and -R command options -- not recognized by getopt(). Additionally the code to implement the dynamic add and removal of pools didn't work. When dynamically adding (-A) a pool a type (-t) to specify if the pool is a tree or hash pool must be specified. When dynamically removing (-R) a pool, omitting -t will cause a search-and-destroy which will remove both types of pools matching the name given (-m). PR: 218433 Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:09:51 2019 (r353093) +++ stable/11/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:11:45 2019 (r353094) @@ -9,7 +9,7 @@ ippool \- user interface to the IPFilter pools -a [-dnv] [-m ] [-o ] [-t ] [-T ttl] -i [/] .br .B ippool --A [-dnv] [-m ] [-o ] [-S ] [-t ] +-A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool -f [-dnuv] Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:09:51 2019 (r353093) +++ stable/11/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:11:45 2019 (r353094) @@ -253,7 +253,7 @@ poolcommand(remove, argc, argv) char *argv[]; { int type, role, c, err; - char *poolname; + char *poolname, *typearg = NULL; iphtable_t iph; ip_pool_t pool; @@ -265,7 +265,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:vt:")) != -1) switch (c) { case 'd' : @@ -291,6 +291,10 @@ poolcommand(remove, argc, argv) else usage(argv[0]); break; + case 't' : + type = gettype(optarg, &iph.iph_type); + typearg = optarg; + break; case 'v' : opts |= OPT_VERBOSE; break; @@ -310,17 +314,22 @@ poolcommand(remove, argc, argv) return -1; } - type = gettype(argv[optind], &iph.iph_type); - if (type == IPLT_NONE) { - fprintf(stderr, "unknown type '%s'\n", argv[optind]); + if (type == IPLT_NONE && remove == 0) { + if (typearg == NULL) { + fprintf(stderr, "type must be specified\n"); + usage(argv[0]); + } else { + fprintf(stderr, "unknown type '%s'\n", typearg); + } return -1; } - if (type == IPLT_HASH) { + if (type == IPLT_HASH || (type == IPLT_NONE && remove == 1)) { strncpy(iph.iph_name, poolname, sizeof(iph.iph_name)); iph.iph_name[sizeof(iph.iph_name) - 1] = '\0'; iph.iph_unit = role; - } else if (type == IPLT_POOL) { + } + if (type == IPLT_POOL || (type == IPLT_NONE && remove == 1)) { strncpy(pool.ipo_name, poolname, sizeof(pool.ipo_name)); pool.ipo_name[sizeof(pool.ipo_name) - 1] = '\0'; pool.ipo_unit = role; @@ -344,6 +353,16 @@ poolcommand(remove, argc, argv) break; case IPLT_POOL : err = remove_pool(&pool, ioctl); + break; + case IPLT_NONE : + err = 1; + { + int err_h, err_p; + err_h = remove_hash(&iph, ioctl); + err_p = remove_pool(&pool, ioctl); + if (err_h == 0 || err_p == 0) + err = 0; + } break; } } From owner-svn-src-all@freebsd.org Fri Oct 4 02:11:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA933146EDF; Fri, 4 Oct 2019 02:11:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ktfV4bGBz3Jkx; Fri, 4 Oct 2019 02:11:46 +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 80F191D625; Fri, 4 Oct 2019 02:11: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 x942Bkca068341; Fri, 4 Oct 2019 02:11:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x942BkHN068337; Fri, 4 Oct 2019 02:11:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910040211.x942BkHN068337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 02:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353094 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 353094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:11:46 -0000 Author: cy Date: Fri Oct 4 02:11:45 2019 New Revision: 353094 URL: https://svnweb.freebsd.org/changeset/base/353094 Log: MFC r352786: Implement the dynamic add (-A) and removal (-R) of ippool pools from the command line. Prior to this the functionality was mostly there however since the pool type (-t) was not recognized by the -A and -R command options -- not recognized by getopt(). Additionally the code to implement the dynamic add and removal of pools didn't work. When dynamically adding (-A) a pool a type (-t) to specify if the pool is a tree or hash pool must be specified. When dynamically removing (-R) a pool, omitting -t will cause a search-and-destroy which will remove both types of pools matching the name given (-m). PR: 218433 Modified: stable/12/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:09:51 2019 (r353093) +++ stable/12/contrib/ipfilter/man/ippool.8 Fri Oct 4 02:11:45 2019 (r353094) @@ -9,7 +9,7 @@ ippool \- user interface to the IPFilter pools -a [-dnv] [-m ] [-o ] [-t ] [-T ttl] -i [/] .br .B ippool --A [-dnv] [-m ] [-o ] [-S ] [-t ] +-A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool -f [-dnuv] Modified: stable/12/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/12/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:09:51 2019 (r353093) +++ stable/12/contrib/ipfilter/tools/ippool.c Fri Oct 4 02:11:45 2019 (r353094) @@ -257,7 +257,7 @@ poolcommand(remove, argc, argv) char *argv[]; { int type, role, c, err; - char *poolname; + char *poolname, *typearg = NULL; iphtable_t iph; ip_pool_t pool; @@ -269,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:vt:")) != -1) switch (c) { case 'd' : @@ -295,6 +295,10 @@ poolcommand(remove, argc, argv) else usage(argv[0]); break; + case 't' : + type = gettype(optarg, &iph.iph_type); + typearg = optarg; + break; case 'v' : opts |= OPT_VERBOSE; break; @@ -314,17 +318,22 @@ poolcommand(remove, argc, argv) return -1; } - type = gettype(argv[optind], &iph.iph_type); - if (type == IPLT_NONE) { - fprintf(stderr, "unknown type '%s'\n", argv[optind]); + if (type == IPLT_NONE && remove == 0) { + if (typearg == NULL) { + fprintf(stderr, "type must be specified\n"); + usage(argv[0]); + } else { + fprintf(stderr, "unknown type '%s'\n", typearg); + } return -1; } - if (type == IPLT_HASH) { + if (type == IPLT_HASH || (type == IPLT_NONE && remove == 1)) { strncpy(iph.iph_name, poolname, sizeof(iph.iph_name)); iph.iph_name[sizeof(iph.iph_name) - 1] = '\0'; iph.iph_unit = role; - } else if (type == IPLT_POOL) { + } + if (type == IPLT_POOL || (type == IPLT_NONE && remove == 1)) { strncpy(pool.ipo_name, poolname, sizeof(pool.ipo_name)); pool.ipo_name[sizeof(pool.ipo_name) - 1] = '\0'; pool.ipo_unit = role; @@ -348,6 +357,16 @@ poolcommand(remove, argc, argv) break; case IPLT_POOL : err = remove_pool(&pool, ioctl); + break; + case IPLT_NONE : + err = 1; + { + int err_h, err_p; + err_h = remove_hash(&iph, ioctl); + err_p = remove_pool(&pool, ioctl); + if (err_h == 0 || err_p == 0) + err = 0; + } break; } } From owner-svn-src-all@freebsd.org Fri Oct 4 02:34:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D383F80E0; Fri, 4 Oct 2019 02:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kv8Z0qg9z3LmW; Fri, 4 Oct 2019 02:34:22 +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 F3B2C1DA18; Fri, 4 Oct 2019 02:34:21 +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 x942YL79082822; Fri, 4 Oct 2019 02:34:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x942YK9R082811; Fri, 4 Oct 2019 02:34:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910040234.x942YK9R082811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 4 Oct 2019 02:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353095 - head/secure/caroot/trusted X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/secure/caroot/trusted X-SVN-Commit-Revision: 353095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 02:34:22 -0000 Author: kevans Date: Fri Oct 4 02:34:20 2019 New Revision: 353095 URL: https://svnweb.freebsd.org/changeset/base/353095 Log: caroot: commit initial bundle Interested users can blacklist any/all of these with certctl(8), examples: - mv /usr/share/certs/trusted/... /usr/share/certs/blacklisted/...; \ certctl rehash - certctl blacklist /usr/share/certs/trusted/*; \ certctl rehash Certs can be easily examined after installation with `certctl list`, and certctl blacklist will accept the hashed filename as output by list or as seen in /etc/ssl/certs No objection from: secteam Relnotes: Definite maybe Added: head/secure/caroot/trusted/ACCVRAIZ1.pem (contents, props changed) head/secure/caroot/trusted/AC_RAIZ_FNMT-RCM.pem (contents, props changed) head/secure/caroot/trusted/Actalis_Authentication_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/AddTrust_External_Root.pem (contents, props changed) head/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem (contents, props changed) head/secure/caroot/trusted/AffirmTrust_Commercial.pem (contents, props changed) head/secure/caroot/trusted/AffirmTrust_Networking.pem (contents, props changed) head/secure/caroot/trusted/AffirmTrust_Premium.pem (contents, props changed) head/secure/caroot/trusted/AffirmTrust_Premium_ECC.pem (contents, props changed) head/secure/caroot/trusted/Amazon_Root_CA_1.pem (contents, props changed) head/secure/caroot/trusted/Amazon_Root_CA_2.pem (contents, props changed) head/secure/caroot/trusted/Amazon_Root_CA_3.pem (contents, props changed) head/secure/caroot/trusted/Amazon_Root_CA_4.pem (contents, props changed) head/secure/caroot/trusted/Atos_TrustedRoot_2011.pem (contents, props changed) head/secure/caroot/trusted/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem (contents, props changed) head/secure/caroot/trusted/Baltimore_CyberTrust_Root.pem (contents, props changed) head/secure/caroot/trusted/Buypass_Class_2_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Buypass_Class_3_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/CA_Disig_Root_R2.pem (contents, props changed) head/secure/caroot/trusted/CFCA_EV_ROOT.pem (contents, props changed) head/secure/caroot/trusted/COMODO_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/COMODO_ECC_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/COMODO_RSA_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Camerfirma_Chambers_of_Commerce_Root.pem (contents, props changed) head/secure/caroot/trusted/Camerfirma_Global_Chambersign_Root.pem (contents, props changed) head/secure/caroot/trusted/Certigna.pem (contents, props changed) head/secure/caroot/trusted/Certigna_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Certum_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Certum_Trusted_Network_CA.pem (contents, props changed) head/secure/caroot/trusted/Certum_Trusted_Network_CA_2.pem (contents, props changed) head/secure/caroot/trusted/Chambers_of_Commerce_Root_-_2008.pem (contents, props changed) head/secure/caroot/trusted/Comodo_AAA_Services_root.pem (contents, props changed) head/secure/caroot/trusted/Cybertrust_Global_Root.pem (contents, props changed) head/secure/caroot/trusted/D-TRUST_Root_CA_3_2013.pem (contents, props changed) head/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_2009.pem (contents, props changed) head/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_EV_2009.pem (contents, props changed) head/secure/caroot/trusted/DST_Root_CA_X3.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Assured_ID_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Assured_ID_Root_G2.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Assured_ID_Root_G3.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Global_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Global_Root_G2.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Global_Root_G3.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_High_Assurance_EV_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/DigiCert_Trusted_Root_G4.pem (contents, props changed) head/secure/caroot/trusted/E-Tugra_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/EC-ACC.pem (contents, props changed) head/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Entrust_Root_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_EC1.pem (contents, props changed) head/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G2.pem (contents, props changed) head/secure/caroot/trusted/Entrust_net_Premium_2048_Secure_Server_CA.pem (contents, props changed) head/secure/caroot/trusted/GDCA_TrustAUTH_R5_ROOT.pem (contents, props changed) head/secure/caroot/trusted/GTS_Root_R1.pem (contents, props changed) head/secure/caroot/trusted/GTS_Root_R2.pem (contents, props changed) head/secure/caroot/trusted/GTS_Root_R3.pem (contents, props changed) head/secure/caroot/trusted/GTS_Root_R4.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Global_CA.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G2.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Universal_CA.pem (contents, props changed) head/secure/caroot/trusted/GeoTrust_Universal_CA_2.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_ECC_Root_CA_-_R4.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_ECC_Root_CA_-_R5.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_Root_CA_-_R2.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_Root_CA_-_R3.pem (contents, props changed) head/secure/caroot/trusted/GlobalSign_Root_CA_-_R6.pem (contents, props changed) head/secure/caroot/trusted/Global_Chambersign_Root_-_2008.pem (contents, props changed) head/secure/caroot/trusted/Go_Daddy_Class_2_CA.pem (contents, props changed) head/secure/caroot/trusted/Go_Daddy_Root_Certificate_Authority_-_G2.pem (contents, props changed) head/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem (contents, props changed) head/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem (contents, props changed) head/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem (contents, props changed) head/secure/caroot/trusted/Hongkong_Post_Root_CA_1.pem (contents, props changed) head/secure/caroot/trusted/Hongkong_Post_Root_CA_3.pem (contents, props changed) head/secure/caroot/trusted/ISRG_Root_X1.pem (contents, props changed) head/secure/caroot/trusted/IdenTrust_Commercial_Root_CA_1.pem (contents, props changed) head/secure/caroot/trusted/IdenTrust_Public_Sector_Root_CA_1.pem (contents, props changed) head/secure/caroot/trusted/Izenpe_com.pem (contents, props changed) head/secure/caroot/trusted/LuxTrust_Global_Root_2.pem (contents, props changed) head/secure/caroot/trusted/Microsec_e-Szigno_Root_CA_2009.pem (contents, props changed) head/secure/caroot/trusted/NetLock_Arany__Class_Gold__F__tan__s__tv__ny.pem (contents, props changed) head/secure/caroot/trusted/Network_Solutions_Certificate_Authority.pem (contents, props changed) head/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GA_CA.pem (contents, props changed) head/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GB_CA.pem (contents, props changed) head/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GC_CA.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA_1_G3.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA_2.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA_2_G3.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA_3.pem (contents, props changed) head/secure/caroot/trusted/QuoVadis_Root_CA_3_G3.pem (contents, props changed) head/secure/caroot/trusted/SSL_com_EV_Root_Certification_Authority_ECC.pem (contents, props changed) head/secure/caroot/trusted/SSL_com_EV_Root_Certification_Authority_RSA_R2.pem (contents, props changed) head/secure/caroot/trusted/SSL_com_Root_Certification_Authority_ECC.pem (contents, props changed) head/secure/caroot/trusted/SSL_com_Root_Certification_Authority_RSA.pem (contents, props changed) head/secure/caroot/trusted/SZAFIR_ROOT_CA2.pem (contents, props changed) head/secure/caroot/trusted/SecureSign_RootCA11.pem (contents, props changed) head/secure/caroot/trusted/SecureTrust_CA.pem (contents, props changed) head/secure/caroot/trusted/Secure_Global_CA.pem (contents, props changed) head/secure/caroot/trusted/Security_Communication_RootCA2.pem (contents, props changed) head/secure/caroot/trusted/Security_Communication_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Sonera_Class_2_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Staat_der_Nederlanden_EV_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G2.pem (contents, props changed) head/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G3.pem (contents, props changed) head/secure/caroot/trusted/Starfield_Class_2_CA.pem (contents, props changed) head/secure/caroot/trusted/Starfield_Root_Certificate_Authority_-_G2.pem (contents, props changed) head/secure/caroot/trusted/Starfield_Services_Root_Certificate_Authority_-_G2.pem (contents, props changed) head/secure/caroot/trusted/SwissSign_Gold_CA_-_G2.pem (contents, props changed) head/secure/caroot/trusted/SwissSign_Platinum_CA_-_G2.pem (contents, props changed) head/secure/caroot/trusted/SwissSign_Silver_CA_-_G2.pem (contents, props changed) head/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem (contents, props changed) head/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem (contents, props changed) head/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem (contents, props changed) head/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem (contents, props changed) head/secure/caroot/trusted/T-TeleSec_GlobalRoot_Class_2.pem (contents, props changed) head/secure/caroot/trusted/T-TeleSec_GlobalRoot_Class_3.pem (contents, props changed) head/secure/caroot/trusted/TUBITAK_Kamu_SM_SSL_Kok_Sertifikasi_-_Surum_1.pem (contents, props changed) head/secure/caroot/trusted/TWCA_Global_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/TWCA_Root_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Taiwan_GRCA.pem (contents, props changed) head/secure/caroot/trusted/TeliaSonera_Root_CA_v1.pem (contents, props changed) head/secure/caroot/trusted/TrustCor_ECA-1.pem (contents, props changed) head/secure/caroot/trusted/TrustCor_RootCert_CA-1.pem (contents, props changed) head/secure/caroot/trusted/TrustCor_RootCert_CA-2.pem (contents, props changed) head/secure/caroot/trusted/Trustis_FPS_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/UCA_Extended_Validation_Root.pem (contents, props changed) head/secure/caroot/trusted/UCA_Global_G2_Root.pem (contents, props changed) head/secure/caroot/trusted/USERTrust_ECC_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/USERTrust_RSA_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem (contents, props changed) head/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem (contents, props changed) head/secure/caroot/trusted/VeriSign_Universal_Root_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.pem (contents, props changed) head/secure/caroot/trusted/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.pem (contents, props changed) head/secure/caroot/trusted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem (contents, props changed) head/secure/caroot/trusted/XRamp_Global_CA_Root.pem (contents, props changed) head/secure/caroot/trusted/certSIGN_ROOT_CA.pem (contents, props changed) head/secure/caroot/trusted/ePKI_Root_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/emSign_ECC_Root_CA_-_C3.pem (contents, props changed) head/secure/caroot/trusted/emSign_ECC_Root_CA_-_G3.pem (contents, props changed) head/secure/caroot/trusted/emSign_Root_CA_-_C1.pem (contents, props changed) head/secure/caroot/trusted/emSign_Root_CA_-_G1.pem (contents, props changed) head/secure/caroot/trusted/thawte_Primary_Root_CA.pem (contents, props changed) head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem (contents, props changed) head/secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem (contents, props changed) Added: head/secure/caroot/trusted/ACCVRAIZ1.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/ACCVRAIZ1.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,164 @@ +## +## ACCVRAIZ1 +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6828503384748696800 (0x5ec3b7a6437fa4e0) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN = ACCVRAIZ1, OU = PKIACCV, O = ACCV, C = ES + Validity + Not Before: May 5 09:37:37 2011 GMT + Not After : Dec 31 09:37:37 2030 GMT + Subject: CN = ACCVRAIZ1, OU = PKIACCV, O = ACCV, C = ES + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:9b:a9:ab:bf:61:4a:97:af:2f:97:66:9a:74:5f: + d0:d9:96:fd:cf:e2:e4:66:ef:1f:1f:47:33:c2:44: + a3:df:9a:de:1f:b5:54:dd:15:7c:69:35:11:6f:bb: + c8:0c:8e:6a:18:1e:d8:8f:d9:16:bc:10:48:36:5c: + f0:63:b3:90:5a:5c:24:37:d7:a3:d6:cb:09:71:b9: + f1:01:72:84:b0:7d:db:4d:80:cd:fc:d3:6f:c9:f8: + da:b6:0e:82:d2:45:85:a8:1b:68:a8:3d:e8:f4:44: + 6c:bd:a1:c2:cb:03:be:8c:3e:13:00:84:df:4a:48: + c0:e3:22:0a:e8:e9:37:a7:18:4c:b1:09:0d:23:56: + 7f:04:4d:d9:17:84:18:a5:c8:da:40:94:73:eb:ce: + 0e:57:3c:03:81:3a:9d:0a:a1:57:43:69:ac:57:6d: + 79:90:78:e5:b5:b4:3b:d8:bc:4c:8d:28:a1:a7:a3: + a7:ba:02:4e:25:d1:2a:ae:ed:ae:03:22:b8:6b:20: + 0f:30:28:54:95:7f:e0:ee:ce:0a:66:9d:d1:40:2d: + 6e:22:af:9d:1a:c1:05:19:d2:6f:c0:f2:9f:f8:7b: + b3:02:42:fb:50:a9:1d:2d:93:0f:23:ab:c6:c1:0f: + 92:ff:d0:a2:15:f5:53:09:71:1c:ff:45:13:84:e6: + 26:5e:f8:e0:88:1c:0a:fc:16:b6:a8:73:06:b8:f0: + 63:84:02:a0:c6:5a:ec:e7:74:df:70:ae:a3:83:25: + ea:d6:c7:97:87:93:a7:c6:8a:8a:33:97:60:37:10: + 3e:97:3e:6e:29:15:d6:a1:0f:d1:88:2c:12:9f:6f: + aa:a4:c6:42:eb:41:a2:e3:95:43:d3:01:85:6d:8e: + bb:3b:f3:23:36:c7:fe:3b:e0:a1:25:07:48:ab:c9: + 89:74:ff:08:8f:80:bf:c0:96:65:f3:ee:ec:4b:68: + bd:9d:88:c3:31:b3:40:f1:e8:cf:f6:38:bb:9c:e4: + d1:7f:d4:e5:58:9b:7c:fa:d4:f3:0e:9b:75:91:e4: + ba:52:2e:19:7e:d1:f5:cd:5a:19:fc:ba:06:f6:fb: + 52:a8:4b:99:04:dd:f8:f9:b4:8b:50:a3:4e:62:89: + f0:87:24:fa:83:42:c1:87:fa:d5:2d:29:2a:5a:71: + 7a:64:6a:d7:27:60:63:0d:db:ce:49:f5:8d:1f:90: + 89:32:17:f8:73:43:b8:d2:5a:93:86:61:d6:e1:75: + 0a:ea:79:66:76:88:4f:71:eb:04:25:d6:0a:5a:7a: + 93:e5:b9:4b:17:40:0f:b1:b6:b9:f5:de:4f:dc:e0: + b3:ac:3b:11:70:60:84:4a:43:6e:99:20:c0:29:71: + 0a:c0:65 + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + CA Issuers - URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1.crt + OCSP - URI:http://ocsp.accv.es + + X509v3 Subject Key Identifier: + D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD + + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + User Notice: + Explicit Text: + CPS: http://www.accv.es/legislacion_c.htm + + X509v3 CRL Distribution Points: + + Full Name: + URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1_der.crl + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Alternative Name: + email:accv@accv.es + Signature Algorithm: sha1WithRSAEncryption + 97:31:02:9f:e7:fd:43:67:48:44:14:e4:29:87:ed:4c:28:66: + d0:8f:35:da:4d:61:b7:4a:97:4d:b5:db:90:e0:05:2e:0e:c6: + 79:d0:f2:97:69:0f:bd:04:47:d9:be:db:b5:29:da:9b:d9:ae: + a9:99:d5:d3:3c:30:93:f5:8d:a1:a8:fc:06:8d:44:f4:ca:16: + 95:7c:33:dc:62:8b:a8:37:f8:27:d8:09:2d:1b:ef:c8:14:27: + 20:a9:64:44:ff:2e:d6:75:aa:6c:4d:60:40:19:49:43:54:63: + da:e2:cc:ba:66:e5:4f:44:7a:5b:d9:6a:81:2b:40:d5:7f:f9: + 01:27:58:2c:c8:ed:48:91:7c:3f:a6:00:cf:c4:29:73:11:36: + de:86:19:3e:9d:ee:19:8a:1b:d5:b0:ed:8e:3d:9c:2a:c0:0d: + d8:3d:66:e3:3c:0d:bd:d5:94:5c:e2:e2:a7:35:1b:04:00:f6: + 3f:5a:8d:ea:43:bd:5f:89:1d:a9:c1:b0:cc:99:e2:4d:00:0a: + da:c9:27:5b:e7:13:90:5c:e4:f5:33:a2:55:6d:dc:e0:09:4d: + 2f:b1:26:5b:27:75:00:09:c4:62:77:29:08:5f:9e:59:ac:b6: + 7e:ad:9f:54:30:22:03:c1:1e:71:64:fe:f9:38:0a:96:18:dd: + 02:14:ac:23:cb:06:1c:1e:a4:7d:8d:0d:de:27:41:e8:ad:da: + 15:b7:b0:23:dd:2b:a8:d3:da:25:87:ed:e8:55:44:4d:88:f4: + 36:7e:84:9a:78:ac:f7:0e:56:49:0e:d6:33:25:d6:84:50:42: + 6c:20:12:1d:2a:d5:be:bc:f2:70:81:a4:70:60:be:05:b5:9b: + 9e:04:44:be:61:23:ac:e9:a5:24:8c:11:80:94:5a:a2:a2:b9: + 49:d2:c1:dc:d1:a7:ed:31:11:2c:9e:19:a6:ee:e1:55:e1:c0: + ea:cf:0d:84:e4:17:b7:a2:7c:a5:de:55:25:06:ee:cc:c0:87: + 5c:40:da:cc:95:3f:55:e0:35:c7:b8:84:be:b4:5d:cd:7a:83: + 01:72:ee:87:e6:5f:1d:ae:b5:85:c6:26:df:e6:c1:9a:e9:1e: + 02:47:9f:2a:a8:6d:a9:5b:cf:ec:45:77:7f:98:27:9a:32:5d: + 2a:e3:84:ee:c5:98:66:2f:96:20:1d:dd:d8:c3:27:d7:b0:f9: + fe:d9:7d:cd:d0:9f:8f:0b:14:58:51:9f:2f:8b:c3:38:2d:de: + e8:8f:d6:8d:87:a4:f5:56:43:16:99:2c:f4:a4:56:b4:34:b8: + 61:37:c9:c2:58:80:1b:a0:97:a1:fc:59:8d:e9:11:f6:d1:0f: + 4b:55:34:46:2a:8b:86:3b +SHA1 Fingerprint=93:05:7A:88:15:C6:4F:CE:88:2F:FA:91:16:52:28:78:BC:53:64:17 +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE +AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw +CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ +BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND +VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb +qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY +HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo +G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA +lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr +IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ +0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH +k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 +4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO +m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa +cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl +uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI +KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls +ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG +AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT +VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG +CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA +cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA +QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA +7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA +cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA +QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA +czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu +aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt +aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud +DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF +BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp +D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU +JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m +AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD +vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms +tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH +7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA +h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF +d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H +pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AC_RAIZ_FNMT-RCM.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AC_RAIZ_FNMT-RCM.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,137 @@ +## +## AC RAIZ FNMT-RCM +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 5d:93:8d:30:67:36:c8:06:1d:1a:c7:54:84:69:07 + Signature Algorithm: sha256WithRSAEncryption + Issuer: C = ES, O = FNMT-RCM, OU = AC RAIZ FNMT-RCM + Validity + Not Before: Oct 29 15:59:56 2008 GMT + Not After : Jan 1 00:00:00 2030 GMT + Subject: C = ES, O = FNMT-RCM, OU = AC RAIZ FNMT-RCM + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:ba:71:80:7a:4c:86:6e:7f:c8:13:6d:c0:c6:7d: + 1c:00:97:8f:2c:0c:23:bb:10:9a:40:a9:1a:b7:87: + 88:f8:9b:56:6a:fb:e6:7b:8e:8b:92:8e:a7:25:5d: + 59:11:db:36:2e:b7:51:17:1f:a9:08:1f:04:17:24: + 58:aa:37:4a:18:df:e5:39:d4:57:fd:d7:c1:2c:91: + 01:91:e2:22:d4:03:c0:58:fc:77:47:ec:8f:3e:74: + 43:ba:ac:34:8d:4d:38:76:67:8e:b0:c8:6f:30:33: + 58:71:5c:b4:f5:6b:6e:d4:01:50:b8:13:7e:6c:4a: + a3:49:d1:20:19:ee:bc:c0:29:18:65:a7:de:fe:ef: + dd:0a:90:21:e7:1a:67:92:42:10:98:5f:4f:30:bc: + 3e:1c:45:b4:10:d7:68:40:14:c0:40:fa:e7:77:17: + 7a:e6:0b:8f:65:5b:3c:d9:9a:52:db:b5:bd:9e:46: + cf:3d:eb:91:05:02:c0:96:b2:76:4c:4d:10:96:3b: + 92:fa:9c:7f:0f:99:df:be:23:35:45:1e:02:5c:fe: + b5:a8:9b:99:25:da:5e:f3:22:c3:39:f5:e4:2a:2e: + d3:c6:1f:c4:6c:aa:c5:1c:6a:01:05:4a:2f:d2:c5: + c1:a8:34:26:5d:66:a5:d2:02:21:f9:18:b7:06:f5: + 4e:99:6f:a8:ab:4c:51:e8:cf:50:18:c5:77:c8:39: + 09:2c:49:92:32:99:a8:bb:17:17:79:b0:5a:c5:e6: + a3:c4:59:65:47:35:83:5e:a9:e8:35:0b:99:bb:e4: + cd:20:c6:9b:4a:06:39:b5:68:fc:22:ba:ee:55:8c: + 2b:4e:ea:f3:b1:e3:fc:b6:99:9a:d5:42:fa:71:4d: + 08:cf:87:1e:6a:71:7d:f9:d3:b4:e9:a5:71:81:7b: + c2:4e:47:96:a5:f6:76:85:a3:28:8f:e9:80:6e:81: + 53:a5:6d:5f:b8:48:f9:c2:f9:36:a6:2e:49:ff:b8: + 96:c2:8c:07:b3:9b:88:58:fc:eb:1b:1c:de:2d:70: + e2:97:92:30:a1:89:e3:bc:55:a8:27:d6:4b:ed:90: + ad:8b:fa:63:25:59:2d:a8:35:dd:ca:97:33:bc:e5: + cd:c7:9d:d1:ec:ef:5e:0e:4a:90:06:26:63:ad:b9: + d9:35:2d:07:ba:76:65:2c:ac:57:8f:7d:f4:07:94: + d7:81:02:96:5d:a3:07:49:d5:7a:d0:57:f9:1b:e7: + 53:46:75:aa:b0:79:42:cb:68:71:08:e9:60:bd:39: + 69:ce:f4:af:c3:56:40:c7:ad:52:a2:09:e4:6f:86: + 47:8a:1f:eb:28:27:5d:83:20:af:04:c9:6c:56:9a: + 8b:46:f5 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + F7:7D:C5:FD:C4:E8:9A:1B:77:64:A7:F5:1D:A0:CC:BF:87:60:9A:6D + X509v3 Certificate Policies: + Policy: X509v3 Any Policy + CPS: http://www.cert.fnmt.es/dpcs/ + + Signature Algorithm: sha256WithRSAEncryption + 07:90:4a:df:f3:23:4e:f0:c3:9c:51:65:9b:9c:22:a2:8a:0c: + 85:f3:73:29:6b:4d:fe:01:e2:a9:0c:63:01:bf:04:67:a5:9d: + 98:5f:fd:01:13:fa:ec:9a:62:e9:86:fe:b6:62:d2:6e:4c:94: + fb:c0:75:45:7c:65:0c:f8:b2:37:cf:ac:0f:cf:8d:6f:f9:19: + f7:8f:ec:1e:f2:70:9e:f0:ca:b8:ef:b7:ff:76:37:76:5b:f6: + 6e:88:f3:af:62:32:22:93:0d:3a:6a:8e:14:66:0c:2d:53:74: + 57:65:1e:d5:b2:dd:23:81:3b:a5:66:23:27:67:09:8f:e1:77: + aa:43:cd:65:51:08:ed:51:58:fe:e6:39:f9:cb:47:84:a4:15: + f1:76:bb:a4:ee:a4:3b:c4:5f:ef:b2:33:96:11:18:b7:c9:65: + be:18:e1:a3:a4:dc:fa:18:f9:d3:bc:13:9b:39:7a:34:ba:d3: + 41:fb:fa:32:8a:2a:b7:2b:86:0b:69:83:38:be:cd:8a:2e:0b: + 70:ad:8d:26:92:ee:1e:f5:01:2b:0a:d9:d6:97:9b:6e:e0:a8: + 19:1c:3a:21:8b:0c:1e:40:ad:03:e7:dd:66:7e:f5:b9:20:0d: + 03:e8:96:f9:82:45:d4:39:e0:a0:00:5d:d7:98:e6:7d:9e:67: + 73:c3:9a:2a:f7:ab:8b:a1:3a:14:ef:34:bc:52:0e:89:98:9a: + 04:40:84:1d:7e:45:69:93:57:ce:eb:ce:f8:50:7c:4f:1c:6e: + 04:43:9b:f9:d6:3b:23:18:e9:ea:8e:d1:4d:46:8d:f1:3b:e4: + 6a:ca:ba:fb:23:b7:9b:fa:99:01:29:5a:58:5a:2d:e3:f9:d4: + 6d:0e:26:ad:c1:6e:34:bc:32:f8:0c:05:fa:65:a3:db:3b:37: + 83:22:e9:d6:dc:72:33:fd:5d:f2:20:bd:76:3c:23:da:28:f7: + f9:1b:eb:59:64:d5:dc:5f:72:7e:20:fc:cd:89:b5:90:67:4d: + 62:7a:3f:4e:ad:1d:c3:39:fe:7a:f4:28:16:df:41:f6:48:80: + 05:d7:0f:51:79:ac:10:ab:d4:ec:03:66:e6:6a:b0:ba:31:92: + 42:40:6a:be:3a:d3:72:e1:6a:37:55:bc:ac:1d:95:b7:69:61: + f2:43:91:74:e6:a0:d3:0a:24:46:a1:08:af:d6:da:45:19:96: + d4:53:1d:5b:84:79:f0:c0:f7:47:ef:8b:8f:c5:06:ae:9d:4c: + 62:9d:ff:46:04:f8:d3:c9:b6:10:25:40:75:fe:16:aa:c9:4a: + 60:86:2f:ba:ef:30:77:e4:54:e2:b8:84:99:58:80:aa:13:8b: + 51:3a:4f:48:f6:8b:b6:b3 +SHA1 Fingerprint=EC:50:35:07:B2:15:C4:95:62:19:E2:A8:9A:5B:42:99:2C:4C:2C:20 +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx +CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ +WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ +BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG +Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/ +yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf +BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz +WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF +tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z +374jNUUeAlz+taibmSXaXvMiwzn15Cou08YfxGyqxRxqAQVKL9LFwag0Jl1mpdIC +IfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mwWsXmo8RZZUc1g16p6DUL +mbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnTtOmlcYF7 +wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peS +MKGJ47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2 +ZSysV4999AeU14ECll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMet +UqIJ5G+GR4of6ygnXYMgrwTJbFaai0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPd9xf3E6Jobd2Sn9R2gzL+H +YJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3 +LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD +nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1 +RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM +LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf +77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N +JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm +fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp +6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp +1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B +9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok +RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv +uu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/Actalis_Authentication_Root_CA.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Actalis_Authentication_Root_CA.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,136 @@ +## +## Actalis Authentication Root CA +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 6271844772424770508 (0x570a119742c4e3cc) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C = IT, L = Milan, O = Actalis S.p.A./03358520967, CN = Actalis Authentication Root CA + Validity + Not Before: Sep 22 11:22:02 2011 GMT + Not After : Sep 22 11:22:02 2030 GMT + Subject: C = IT, L = Milan, O = Actalis S.p.A./03358520967, CN = Actalis Authentication Root CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:a7:c6:c4:a5:29:a4:2c:ef:e5:18:c5:b0:50:a3: + 6f:51:3b:9f:0a:5a:c9:c2:48:38:0a:c2:1c:a0:18: + 7f:91:b5:87:b9:40:3f:dd:1d:68:1f:08:83:d5:2d: + 1e:88:a0:f8:8f:56:8f:6d:99:02:92:90:16:d5:5f: + 08:6c:89:d7:e1:ac:bc:20:c2:b1:e0:83:51:8a:69: + 4d:00:96:5a:6f:2f:c0:44:7e:a3:0e:e4:91:cd:58: + ee:dc:fb:c7:1e:45:47:dd:27:b9:08:01:9f:a6:21: + 1d:f5:41:2d:2f:4c:fd:28:ad:e0:8a:ad:22:b4:56: + 65:8e:86:54:8f:93:43:29:de:39:46:78:a3:30:23: + ba:cd:f0:7d:13:57:c0:5d:d2:83:6b:48:4c:c4:ab: + 9f:80:5a:5b:3a:bd:c9:a7:22:3f:80:27:33:5b:0e: + b7:8a:0c:5d:07:37:08:cb:6c:d2:7a:47:22:44:35: + c5:cc:cc:2e:8e:dd:2a:ed:b7:7d:66:0d:5f:61:51: + 22:55:1b:e3:46:e3:e3:3d:d0:35:62:9a:db:af:14: + c8:5b:a1:cc:89:1b:e1:30:26:fc:a0:9b:1f:81:a7: + 47:1f:04:eb:a3:39:92:06:9f:99:d3:bf:d3:ea:4f: + 50:9c:19:fe:96:87:1e:3c:65:f6:a3:18:24:83:86: + 10:e7:54:3e:a8:3a:76:24:4f:81:21:c5:e3:0f:02: + f8:93:94:47:20:bb:fe:d4:0e:d3:68:b9:dd:c4:7a: + 84:82:e3:53:54:79:dd:db:9c:d2:f2:07:9b:2e:b6: + bc:3e:ed:85:6d:ef:25:11:f2:97:1a:42:61:f7:4a: + 97:e8:8b:b1:10:07:fa:65:81:b2:a2:39:cf:f7:3c: + ff:18:fb:c6:f1:5a:8b:59:e2:02:ac:7b:92:d0:4e: + 14:4f:59:45:f6:0c:5e:28:5f:b0:e8:3f:45:cf:cf: + af:9b:6f:fb:84:d3:77:5a:95:6f:ac:94:84:9e:ee: + bc:c0:4a:8f:4a:93:f8:44:21:e2:31:45:61:50:4e: + 10:d8:e3:35:7c:4c:19:b4:de:05:bf:a3:06:9f:c8: + b5:cd:e4:1f:d7:17:06:0d:7a:95:74:55:0d:68:1a: + fc:10:1b:62:64:9d:6d:e0:95:a0:c3:94:07:57:0d: + 14:e6:bd:05:fb:b8:9f:e6:df:8b:e2:c6:e7:7e:96: + f6:53:c5:80:34:50:28:58:f0:12:50:71:17:30:ba: + e6:78:63:bc:f4:b2:ad:9b:2b:b2:fe:e1:39:8c:5e: + ba:0b:20:94:de:7b:83:b8:ff:e3:56:8d:b7:11:e9: + 3b:8c:f2:b1:c1:5d:9d:a4:0b:4c:2b:d9:b2:18:f5: + b5:9f:4b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 + + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Signature Algorithm: sha256WithRSAEncryption + 0b:7b:72:87:c0:60:a6:49:4c:88:58:e6:1d:88:f7:14:64:48: + a6:d8:58:0a:0e:4f:13:35:df:35:1d:d4:ed:06:31:c8:81:3e: + 6a:d5:dd:3b:1a:32:ee:90:3d:11:d2:2e:f4:8e:c3:63:2e:23: + 66:b0:67:be:6f:b6:c0:13:39:60:aa:a2:34:25:93:75:52:de: + a7:9d:ad:0e:87:89:52:71:6a:16:3c:19:1d:83:f8:9a:29:65: + be:f4:3f:9a:d9:f0:f3:5a:87:21:71:80:4d:cb:e0:38:9b:3f: + bb:fa:e0:30:4d:cf:86:d3:65:10:19:18:d1:97:02:b1:2b:72: + 42:68:ac:a0:bd:4e:5a:da:18:bf:6b:98:81:d0:fd:9a:be:5e: + 15:48:cd:11:15:b9:c0:29:5c:b4:e8:88:f7:3e:36:ae:b7:62: + fd:1e:62:de:70:78:10:1c:48:5b:da:bc:a4:38:ba:67:ed:55: + 3e:5e:57:df:d4:03:40:4c:81:a4:d2:4f:63:a7:09:42:09:14: + fc:00:a9:c2:80:73:4f:2e:c0:40:d9:11:7b:48:ea:7a:02:c0: + d3:eb:28:01:26:58:74:c1:c0:73:22:6d:93:95:fd:39:7d:bb: + 2a:e3:f6:82:e3:2c:97:5f:4e:1f:91:94:fa:fe:2c:a3:d8:76: + 1a:b8:4d:b2:38:4f:9b:fa:1d:48:60:79:26:e2:f3:fd:a9:d0: + 9a:e8:70:8f:49:7a:d6:e5:bd:0a:0e:db:2d:f3:8d:bf:eb:e3: + a4:7d:cb:c7:95:71:e8:da:a3:7c:c5:c2:f8:74:92:04:1b:86: + ac:a4:22:53:40:b6:ac:fe:4c:76:cf:fb:94:32:c0:35:9f:76: + 3f:6e:e5:90:6e:a0:a6:26:a2:b8:2c:be:d1:2b:85:fd:a7:68: + c8:ba:01:2b:b1:6c:74:1d:b8:73:95:e7:ee:b7:c7:25:f0:00: + 4c:00:b2:7e:b6:0b:8b:1c:f3:c0:50:9e:25:b9:e0:08:de:36: + 66:ff:37:a5:d1:bb:54:64:2c:c9:27:b5:4b:92:7e:65:ff:d3: + 2d:e1:b9:4e:bc:7f:a4:41:21:90:41:77:a6:39:1f:ea:9e:e3: + 9f:d0:66:6f:05:ec:aa:76:7e:bf:6b:16:a0:eb:b5:c7:fc:92: + 54:2f:2b:11:27:25:37:78:4c:51:6a:b0:f3:cc:58:5d:14:f1: + 6a:48:15:ff:c2:07:b6:b1:8d:0f:8e:5c:50:46:b3:3d:bf:01: + 98:4f:b2:59:54:47:3e:34:7b:78:6d:56:93:2e:73:ea:66:28: + 78:cd:1d:14:bf:a0:8f:2f:2e:b8:2e:8e:f2:14:8a:cc:e9:b5: + 7c:fb:6c:9d:0c:a5:e1:96 +SHA1 Fingerprint=F3:73:B3:87:06:5A:28:84:8A:F2:F3:4A:CE:19:2B:DD:C7:8E:9C:AC +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AddTrust_External_Root.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AddTrust_External_Root.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,99 @@ +## +## AddTrust External Root +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root + Validity + Not Before: May 30 10:48:38 2000 GMT + Not After : May 30 10:48:38 2020 GMT + Subject: C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (2048 bit) + Modulus: + 00:b7:f7:1a:33:e6:f2:00:04:2d:39:e0:4e:5b:ed: + 1f:bc:6c:0f:cd:b5:fa:23:b6:ce:de:9b:11:33:97: + a4:29:4c:7d:93:9f:bd:4a:bc:93:ed:03:1a:e3:8f: + cf:e5:6d:50:5a:d6:97:29:94:5a:80:b0:49:7a:db: + 2e:95:fd:b8:ca:bf:37:38:2d:1e:3e:91:41:ad:70: + 56:c7:f0:4f:3f:e8:32:9e:74:ca:c8:90:54:e9:c6: + 5f:0f:78:9d:9a:40:3c:0e:ac:61:aa:5e:14:8f:9e: + 87:a1:6a:50:dc:d7:9a:4e:af:05:b3:a6:71:94:9c: + 71:b3:50:60:0a:c7:13:9d:38:07:86:02:a8:e9:a8: + 69:26:18:90:ab:4c:b0:4f:23:ab:3a:4f:84:d8:df: + ce:9f:e1:69:6f:bb:d7:42:d7:6b:44:e4:c7:ad:ee: + 6d:41:5f:72:5a:71:08:37:b3:79:65:a4:59:a0:94: + 37:f7:00:2f:0d:c2:92:72:da:d0:38:72:db:14:a8: + 45:c4:5d:2a:7d:b7:b4:d6:c4:ee:ac:cd:13:44:b7: + c9:2b:dd:43:00:25:fa:61:b9:69:6a:58:23:11:b7: + a7:33:8f:56:75:59:f5:cd:29:d7:46:b7:0a:2b:65: + b6:d3:42:6f:15:b2:b8:7b:fb:ef:e9:5d:53:d5:34: + 5a:27 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A + X509v3 Key Usage: + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A + DirName:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root + serial:01 + + Signature Algorithm: sha1WithRSAEncryption + b0:9b:e0:85:25:c2:d6:23:e2:0f:96:06:92:9d:41:98:9c:d9: + 84:79:81:d9:1e:5b:14:07:23:36:65:8f:b0:d8:77:bb:ac:41: + 6c:47:60:83:51:b0:f9:32:3d:e7:fc:f6:26:13:c7:80:16:a5: + bf:5a:fc:87:cf:78:79:89:21:9a:e2:4c:07:0a:86:35:bc:f2: + de:51:c4:d2:96:b7:dc:7e:4e:ee:70:fd:1c:39:eb:0c:02:51: + 14:2d:8e:bd:16:e0:c1:df:46:75:e7:24:ad:ec:f4:42:b4:85: + 93:70:10:67:ba:9d:06:35:4a:18:d3:2b:7a:cc:51:42:a1:7a: + 63:d1:e6:bb:a1:c5:2b:c2:36:be:13:0d:e6:bd:63:7e:79:7b: + a7:09:0d:40:ab:6a:dd:8f:8a:c3:f6:f6:8c:1a:42:05:51:d4: + 45:f5:9f:a7:62:21:68:15:20:43:3c:99:e7:7c:bd:24:d8:a9: + 91:17:73:88:3f:56:1b:31:38:18:b4:71:0f:9a:cd:c8:0e:9e: + 8e:2e:1b:e1:8c:98:83:cb:1f:31:f1:44:4c:c6:04:73:49:76: + 60:0f:c7:f8:bd:17:80:6b:2e:e9:cc:4c:0e:5a:9a:79:0f:20: + 0a:2e:d5:9e:63:26:1e:55:92:94:d8:82:17:5a:7b:d0:bc:c7: + 8f:4e:86:04 +SHA1 Fingerprint=02:FA:F3:E2:91:43:54:68:60:78:57:69:4D:F5:E4:5B:68:85:18:68 +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,98 @@ +## +## AddTrust Low-Value Services Root +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C = SE, O = AddTrust AB, OU = AddTrust TTP Network, CN = AddTrust Class 1 CA Root + Validity + Not Before: May 30 10:38:31 2000 GMT + Not After : May 30 10:38:31 2020 GMT + Subject: C = SE, O = AddTrust AB, OU = AddTrust TTP Network, CN = AddTrust Class 1 CA Root + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (2048 bit) + Modulus: + 00:96:96:d4:21:49:60:e2:6b:e8:41:07:0c:de:c4: + e0:dc:13:23:cd:c1:35:c7:fb:d6:4e:11:0a:67:5e: + f5:06:5b:6b:a5:08:3b:5b:29:16:3a:e7:87:b2:34: + 06:c5:bc:05:a5:03:7c:82:cb:29:10:ae:e1:88:81: + bd:d6:9e:d3:fe:2d:56:c1:15:ce:e3:26:9d:15:2e: + 10:fb:06:8f:30:04:de:a7:b4:63:b4:ff:b1:9c:ae: + 3c:af:77:b6:56:c5:b5:ab:a2:e9:69:3a:3d:0e:33: + 79:32:3f:70:82:92:99:61:6d:8d:30:08:8f:71:3f: + a6:48:57:19:f8:25:dc:4b:66:5c:a5:74:8f:98:ae: + c8:f9:c0:06:22:e7:ac:73:df:a5:2e:fb:52:dc:b1: + 15:65:20:fa:35:66:69:de:df:2c:f1:6e:bc:30:db: + 2c:24:12:db:eb:35:35:68:90:cb:00:b0:97:21:3d: + 74:21:23:65:34:2b:bb:78:59:a3:d6:e1:76:39:9a: + a4:49:8e:8c:74:af:6e:a4:9a:a3:d9:9b:d2:38:5c: + 9b:a2:18:cc:75:23:84:be:eb:e2:4d:33:71:8e:1a: + f0:c2:f8:c7:1d:a2:ad:03:97:2c:f8:cf:25:c6:f6: + b8:24:31:b1:63:5d:92:7f:63:f0:25:c9:53:2e:1f: + bf:4d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 95:B1:B4:F0:94:B6:BD:C7:DA:D1:11:09:21:BE:C1:AF:49:FD:10:7B + X509v3 Key Usage: + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + keyid:95:B1:B4:F0:94:B6:BD:C7:DA:D1:11:09:21:BE:C1:AF:49:FD:10:7B + DirName:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root + serial:01 + + Signature Algorithm: sha1WithRSAEncryption + 2c:6d:64:1b:1f:cd:0d:dd:b9:01:fa:96:63:34:32:48:47:99: + ae:97:ed:fd:72:16:a6:73:47:5a:f4:eb:dd:e9:f5:d6:fb:45: + cc:29:89:44:5d:bf:46:39:3d:e8:ee:bc:4d:54:86:1e:1d:6c: + e3:17:27:43:e1:89:56:2b:a9:6f:72:4e:49:33:e3:72:7c:2a: + 23:9a:bc:3e:ff:28:2a:ed:a3:ff:1c:23:ba:43:57:09:67:4d: + 4b:62:06:2d:f8:ff:6c:9d:60:1e:d8:1c:4b:7d:b5:31:2f:d9: + d0:7c:5d:f8:de:6b:83:18:78:37:57:2f:e8:33:07:67:df:1e: + c7:6b:2a:95:76:ae:8f:57:a3:f0:f4:52:b4:a9:53:08:cf:e0: + 4f:d3:7a:53:8b:fd:bb:1c:56:36:f2:fe:b2:b6:e5:76:bb:d5: + 22:65:a7:3f:fe:d1:66:ad:0b:bc:6b:99:86:ef:3f:7d:f3:18: + 32:ca:7b:c6:e3:ab:64:46:95:f8:26:69:d9:55:83:7b:2c:96: + 07:ff:59:2c:44:a3:c6:e5:e9:a9:dc:a1:63:80:5a:21:5e:21: + cf:53:54:f0:ba:6f:89:db:a8:aa:95:cf:8b:e3:71:cc:1e:1b: + 20:44:08:c0:7a:b6:40:fd:c4:e4:35:e1:1d:16:1c:d0:bc:2b: + 8e:d6:71:d9 +SHA1 Fingerprint=CC:AB:0E:A0:4C:23:01:D6:69:7B:DD:37:9F:CD:12:EB:24:E3:94:9D +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw +MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD +VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul +CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n +tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl +dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch +PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC ++Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O +BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl +MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk +ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X +7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz +43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl +pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA +WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AffirmTrust_Commercial.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AffirmTrust_Commercial.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,89 @@ +## +## AffirmTrust Commercial +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8608355977964138876 (0x7777062726a9b17c) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C = US, O = AffirmTrust, CN = AffirmTrust Commercial + Validity + Not Before: Jan 29 14:06:06 2010 GMT + Not After : Dec 31 14:06:06 2030 GMT + Subject: C = US, O = AffirmTrust, CN = AffirmTrust Commercial + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (2048 bit) + Modulus: + 00:f6:1b:4f:67:07:2b:a1:15:f5:06:22:cb:1f:01: + b2:e3:73:45:06:44:49:2c:bb:49:25:14:d6:ce:c3: + b7:ab:2c:4f:c6:41:32:94:57:fa:12:a7:5b:0e:e2: + 8f:1f:1e:86:19:a7:aa:b5:2d:b9:5f:0d:8a:c2:af: + 85:35:79:32:2d:bb:1c:62:37:f2:b1:5b:4a:3d:ca: + cd:71:5f:e9:42:be:94:e8:c8:de:f9:22:48:64:c6: + e5:ab:c6:2b:6d:ad:05:f0:fa:d5:0b:cf:9a:e5:f0: + 50:a4:8b:3b:47:a5:23:5b:7a:7a:f8:33:3f:b8:ef: + 99:97:e3:20:c1:d6:28:89:cf:94:fb:b9:45:ed:e3: + 40:17:11:d4:74:f0:0b:31:e2:2b:26:6a:9b:4c:57: + ae:ac:20:3e:ba:45:7a:05:f3:bd:9b:69:15:ae:7d: + 4e:20:63:c4:35:76:3a:07:02:c9:37:fd:c7:47:ee: + e8:f1:76:1d:73:15:f2:97:a4:b5:c8:7a:79:d9:42: + aa:2b:7f:5c:fe:ce:26:4f:a3:66:81:35:af:44:ba: + 54:1e:1c:30:32:65:9d:e6:3c:93:5e:50:4e:7a:e3: + 3a:d4:6e:cc:1a:fb:f9:d2:37:ae:24:2a:ab:57:03: + 22:28:0d:49:75:7f:b7:28:da:75:bf:8e:e3:dc:0e: + 79:31 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 9D:93:C6:53:8B:5E:CA:AF:3F:9F:1E:0F:E5:99:95:BC:24:F6:94:8F + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Signature Algorithm: sha256WithRSAEncryption + 58:ac:f4:04:0e:cd:c0:0d:ff:0a:fd:d4:ba:16:5f:29:bd:7b: + 68:99:58:49:d2:b4:1d:37:4d:7f:27:7d:46:06:5d:43:c6:86: + 2e:3e:73:b2:26:7d:4f:93:a9:b6:c4:2a:9a:ab:21:97:14:b1: + de:8c:d3:ab:89:15:d8:6b:24:d4:f1:16:ae:d8:a4:5c:d4:7f: + 51:8e:ed:18:01:b1:93:63:bd:bc:f8:61:80:9a:9e:b1:ce:42: + 70:e2:a9:7d:06:25:7d:27:a1:fe:6f:ec:b3:1e:24:da:e3:4b: + 55:1a:00:3b:35:b4:3b:d9:d7:5d:30:fd:81:13:89:f2:c2:06: + 2b:ed:67:c4:8e:c9:43:b2:5c:6b:15:89:02:bc:62:fc:4e:f2: + b5:33:aa:b2:6f:d3:0a:a2:50:e3:f6:3b:e8:2e:44:c2:db:66: + 38:a9:33:56:48:f1:6d:1b:33:8d:0d:8c:3f:60:37:9d:d3:ca: + 6d:7e:34:7e:0d:9f:72:76:8b:1b:9f:72:fd:52:35:41:45:02: + 96:2f:1c:b2:9a:73:49:21:b1:49:47:45:47:b4:ef:6a:34:11: + c9:4d:9a:cc:59:b7:d6:02:9e:5a:4e:65:b5:94:ae:1b:df:29: + b0:16:f1:bf:00:9e:07:3a:17:64:b5:04:b5:23:21:99:0a:95: + 3b:97:7c:ef +SHA1 Fingerprint=F9:B5:B6:32:45:5F:9C:BE:EC:57:5F:80:DC:E9:6E:2C:C7:B2:78:B7 +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AffirmTrust_Networking.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AffirmTrust_Networking.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,89 @@ +## +## AffirmTrust Networking +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8957382827206547757 (0x7c4f04391cd4992d) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C = US, O = AffirmTrust, CN = AffirmTrust Networking + Validity + Not Before: Jan 29 14:08:24 2010 GMT + Not After : Dec 31 14:08:24 2030 GMT + Subject: C = US, O = AffirmTrust, CN = AffirmTrust Networking + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (2048 bit) + Modulus: + 00:b4:84:cc:33:17:2e:6b:94:6c:6b:61:52:a0:eb: + a3:cf:79:94:4c:e5:94:80:99:cb:55:64:44:65:8f: + 67:64:e2:06:e3:5c:37:49:f6:2f:9b:84:84:1e:2d: + f2:60:9d:30:4e:cc:84:85:e2:2c:cf:1e:9e:fe:36: + ab:33:77:35:44:d8:35:96:1a:3d:36:e8:7a:0e:d8: + d5:47:a1:6a:69:8b:d9:fc:bb:3a:ae:79:5a:d5:f4: + d6:71:bb:9a:90:23:6b:9a:b7:88:74:87:0c:1e:5f: + b9:9e:2d:fa:ab:53:2b:dc:bb:76:3e:93:4c:08:08: + 8c:1e:a2:23:1c:d4:6a:ad:22:ba:99:01:2e:6d:65: + cb:be:24:66:55:24:4b:40:44:b1:1b:d7:e1:c2:85: + c0:de:10:3f:3d:ed:b8:fc:f1:f1:23:53:dc:bf:65: + 97:6f:d9:f9:40:71:8d:7d:bd:95:d4:ce:be:a0:5e: + 27:23:de:fd:a6:d0:26:0e:00:29:eb:3c:46:f0:3d: + 60:bf:3f:50:d2:dc:26:41:51:9e:14:37:42:04:a3: + 70:57:a8:1b:87:ed:2d:fa:7b:ee:8c:0a:e3:a9:66: + 89:19:cb:41:f9:dd:44:36:61:cf:e2:77:46:c8:7d: + f6:f4:92:81:36:fd:db:34:f1:72:7e:f3:0c:16:bd: + b4:15 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 07:1F:D2:E7:9C:DA:C2:6E:A2:40:B4:B0:7A:50:10:50:74:C4:C8:BD + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Signature Algorithm: sha1WithRSAEncryption + 89:57:b2:16:7a:a8:c2:fd:d6:d9:9b:9b:34:c2:9c:b4:32:14: + 4d:a7:a4:df:ec:be:a7:be:f8:43:db:91:37:ce:b4:32:2e:50: + 55:1a:35:4e:76:43:71:20:ef:93:77:4e:15:70:2e:87:c3:c1: + 1d:6d:dc:cb:b5:27:d4:2c:56:d1:52:53:3a:44:d2:73:c8:c4: + 1b:05:65:5a:62:92:9c:ee:41:8d:31:db:e7:34:ea:59:21:d5: + 01:7a:d7:64:b8:64:39:cd:c9:ed:af:ed:4b:03:48:a7:a0:99: + 01:80:dc:65:a3:36:ae:65:59:48:4f:82:4b:c8:65:f1:57:1d: + e5:59:2e:0a:3f:6c:d8:d1:f5:e5:09:b4:6c:54:00:0a:e0:15: + 4d:87:75:6d:b7:58:96:5a:dd:6d:d2:00:a0:f4:9b:48:be:c3: + 37:a4:ba:36:e0:7c:87:85:97:1a:15:a2:de:2e:a2:5b:bd:af: + 18:f9:90:50:cd:70:59:f8:27:67:47:cb:c7:a0:07:3a:7d:d1: + 2c:5d:6c:19:3a:66:b5:7d:fd:91:6f:82:b1:be:08:93:db:14: + 47:f1:a2:37:c7:45:9e:3c:c7:77:af:64:a8:93:df:f6:69:83: + 82:60:f2:49:42:34:ed:5a:00:54:85:1c:16:36:92:0c:5c:fa: + a6:ad:bf:db +SHA1 Fingerprint=29:36:21:02:8B:20:ED:02:F5:66:C5:32:D1:D6:ED:90:9F:45:00:2F +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AffirmTrust_Premium.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AffirmTrust_Premium.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,131 @@ +## +## AffirmTrust Premium +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 7893706540734352110 (0x6d8c1446b1a60aee) + Signature Algorithm: sha384WithRSAEncryption + Issuer: C = US, O = AffirmTrust, CN = AffirmTrust Premium + Validity + Not Before: Jan 29 14:10:36 2010 GMT + Not After : Dec 31 14:10:36 2040 GMT + Subject: C = US, O = AffirmTrust, CN = AffirmTrust Premium + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:c4:12:df:a9:5f:fe:41:dd:dd:f5:9f:8a:e3:f6: + ac:e1:3c:78:9a:bc:d8:f0:7f:7a:a0:33:2a:dc:8d: + 20:5b:ae:2d:6f:e7:93:d9:36:70:6a:68:cf:8e:51: + a3:85:5b:67:04:a0:10:24:6f:5d:28:82:c1:97:57: + d8:48:29:13:b6:e1:be:91:4d:df:85:0c:53:18:9a: + 1e:24:a2:4f:8f:f0:a2:85:0b:cb:f4:29:7f:d2:a4: + 58:ee:26:4d:c9:aa:a8:7b:9a:d9:fa:38:de:44:57: + 15:e5:f8:8c:c8:d9:48:e2:0d:16:27:1d:1e:c8:83: + 85:25:b7:ba:aa:55:41:cc:03:22:4b:2d:91:8d:8b: + e6:89:af:66:c7:e9:ff:2b:e9:3c:ac:da:d2:b3:c3: + e1:68:9c:89:f8:7a:00:56:de:f4:55:95:6c:fb:ba: + 64:dd:62:8b:df:0b:77:32:eb:62:cc:26:9a:9b:bb: + aa:62:83:4c:b4:06:7a:30:c8:29:bf:ed:06:4d:97: + b9:1c:c4:31:2b:d5:5f:bc:53:12:17:9c:99:57:29: + 66:77:61:21:31:07:2e:25:49:9d:18:f2:ee:f3:2b: + 71:8c:b5:ba:39:07:49:77:fc:ef:2e:92:90:05:8d: + 2d:2f:77:7b:ef:43:bf:35:bb:9a:d8:f9:73:a7:2c: + f2:d0:57:ee:28:4e:26:5f:8f:90:68:09:2f:b8:f8: + dc:06:e9:2e:9a:3e:51:a7:d1:22:c4:0a:a7:38:48: + 6c:b3:f9:ff:7d:ab:86:57:e3:ba:d6:85:78:77:ba: + 43:ea:48:7f:f6:d8:be:23:6d:1e:bf:d1:36:6c:58: + 5c:f1:ee:a4:19:54:1a:f5:03:d2:76:e6:e1:8c:bd: + 3c:b3:d3:48:4b:e2:c8:f8:7f:92:a8:76:46:9c:42: + 65:3e:a4:1e:c1:07:03:5a:46:2d:b8:97:f3:b7:d5: + b2:55:21:ef:ba:dc:4c:00:97:fb:14:95:27:33:bf: + e8:43:47:46:d2:08:99:16:60:3b:9a:7e:d2:e6:ed: + 38:ea:ec:01:1e:3c:48:56:49:09:c7:4c:37:00:9e: + 88:0e:c0:73:e1:6f:66:e9:72:47:30:3e:10:e5:0b: + 03:c9:9a:42:00:6c:c5:94:7e:61:c4:8a:df:7f:82: + 1a:0b:59:c4:59:32:77:b3:bc:60:69:56:39:fd:b4: + 06:7b:2c:d6:64:36:d9:bd:48:ed:84:1f:7e:a5:22: + 8f:2a:b8:42:f4:82:b7:d4:53:90:78:4e:2d:1a:fd: + 81:6f:44:d7:3b:01:74:96:42:e0:00:e2:2e:6b:ea: + c5:ee:72:ac:bb:bf:fe:ea:aa:a8:f8:dc:f6:b2:79: + 8a:b6:67 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 9D:C0:67:A6:0C:22:D9:26:F5:45:AB:A6:65:52:11:27:D8:45:AC:63 + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Signature Algorithm: sha384WithRSAEncryption + b3:57:4d:10:62:4e:3a:e4:ac:ea:b8:1c:af:32:23:c8:b3:49: + 5a:51:9c:76:28:8d:79:aa:57:46:17:d5:f5:52:f6:b7:44:e8: + 08:44:bf:18:84:d2:0b:80:cd:c5:12:fd:00:55:05:61:87:41: + dc:b5:24:9e:3c:c4:d8:c8:fb:70:9e:2f:78:96:83:20:36:de: + 7c:0f:69:13:88:a5:75:36:98:08:a6:c6:df:ac:ce:e3:58:d6: + b7:3e:de:ba:f3:eb:34:40:d8:a2:81:f5:78:3f:2f:d5:a5:fc: + d9:a2:d4:5e:04:0e:17:ad:fe:41:f0:e5:b2:72:fa:44:82:33: + 42:e8:2d:58:f7:56:8c:62:3f:ba:42:b0:9c:0c:5c:7e:2e:65: + 26:5c:53:4f:00:b2:78:7e:a1:0d:99:2d:8d:b8:1d:8e:a2:c4: + b0:fd:60:d0:30:a4:8e:c8:04:62:a9:c4:ed:35:de:7a:97:ed: + 0e:38:5e:92:2f:93:70:a5:a9:9c:6f:a7:7d:13:1d:7e:c6:08: + 48:b1:5e:67:eb:51:08:25:e9:e6:25:6b:52:29:91:9c:d2:39: + 73:08:57:de:99:06:b4:5b:9d:10:06:e1:c2:00:a8:b8:1c:4a: + 02:0a:14:d0:c1:41:ca:fb:8c:35:21:7d:82:38:f2:a9:54:91: + 19:35:93:94:6d:6a:3a:c5:b2:d0:bb:89:86:93:e8:9b:c9:0f: + 3a:a7:7a:b8:a1:f0:78:46:fa:fc:37:2f:e5:8a:84:f3:df:fe: + 04:d9:a1:68:a0:2f:24:e2:09:95:06:d5:95:ca:e1:24:96:eb: + 7c:f6:93:05:bb:ed:73:e9:2d:d1:75:39:d7:e7:24:db:d8:4e: + 5f:43:8f:9e:d0:14:39:bf:55:70:48:99:57:31:b4:9c:ee:4a: + 98:03:96:30:1f:60:06:ee:1b:23:fe:81:60:23:1a:47:62:85: + a5:cc:19:34:80:6f:b3:ac:1a:e3:9f:f0:7b:48:ad:d5:01:d9: + 67:b6:a9:72:93:ea:2d:66:b5:b2:b8:e4:3d:3c:b2:ef:4c:8c: + ea:eb:07:bf:ab:35:9a:55:86:bc:18:a6:b5:a8:5e:b4:83:6c: + 6b:69:40:d3:9f:dc:f1:c3:69:6b:b9:e1:6d:09:f4:f1:aa:50: + 76:0a:7a:7d:7a:17:a1:55:96:42:99:31:09:dd:60:11:8d:05: + 30:7e:e6:8e:46:d1:9d:14:da:c7:17:e4:05:96:8c:c4:24:b5: + 1b:cf:14:07:b2:40:f8:a3:9e:41:86:bc:04:d0:6b:96:c8:2a: + 80:34:fd:bf:ef:06:a3:dd:58:c5:85:3d:3e:8f:fe:9e:29:e0: + b6:b8:09:68:19:1c:18:43 +SHA1 Fingerprint=D8:A6:33:2C:E0:03:6F:B1:85:F6:63:4F:7D:6A:06:65:26:32:28:27 +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/AffirmTrust_Premium_ECC.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/AffirmTrust_Premium_ECC.pem Fri Oct 4 02:34:20 2019 (r353095) @@ -0,0 +1,63 @@ +## +## AffirmTrust Premium ECC +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 8401224907861490260 (0x7497258ac73f7a54) + Signature Algorithm: ecdsa-with-SHA384 + Issuer: C = US, O = AffirmTrust, CN = AffirmTrust Premium ECC + Validity + Not Before: Jan 29 14:20:24 2010 GMT + Not After : Dec 31 14:20:24 2040 GMT + Subject: C = US, O = AffirmTrust, CN = AffirmTrust Premium ECC + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (384 bit) + pub: + 04:0d:30:5e:1b:15:9d:03:d0:a1:79:35:b7:3a:3c: + 92:7a:ca:15:1c:cd:62:f3:9c:26:5c:07:3d:e5:54: + fa:a3:d6:cc:12:ea:f4:14:5f:e8:8e:19:ab:2f:2e: + 48:e6:ac:18:43:78:ac:d0:37:c3:bd:b2:cd:2c:e6: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Oct 4 03:55:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9589CFA48A; Fri, 4 Oct 2019 03:55:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kwyf3TVMz3QbK; Fri, 4 Oct 2019 03:55:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 574151E8E6; Fri, 4 Oct 2019 03:55:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x943tsEW031034; Fri, 4 Oct 2019 03:55:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x943tsao031033; Fri, 4 Oct 2019 03:55:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201910040355.x943tsao031033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 4 Oct 2019 03:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353096 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 353096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 03:55:54 -0000 Author: alc Date: Fri Oct 4 03:55:53 2019 New Revision: 353096 URL: https://svnweb.freebsd.org/changeset/base/353096 Log: The implementation of arm64_tlb_flushID_SE() was removed from cpufunc_asm.S in r313347. Eliminate its declaration from this file. MFC after: 1 week Modified: head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri Oct 4 02:34:20 2019 (r353095) +++ head/sys/arm64/include/cpufunc.h Fri Oct 4 03:55:53 2019 (r353096) @@ -200,7 +200,6 @@ extern int64_t dczva_line_size; void arm64_nullop(void); void arm64_setttb(vm_offset_t); void arm64_tlb_flushID(void); -void arm64_tlb_flushID_SE(vm_offset_t); void arm64_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t); From owner-svn-src-all@freebsd.org Fri Oct 4 05:28:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DDF2FBD52; Fri, 4 Oct 2019 05:28:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kz1f2QXWz3yxH; Fri, 4 Oct 2019 05:28:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31ECC1F8FF; Fri, 4 Oct 2019 05:28:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x945SbIV083584; Fri, 4 Oct 2019 05:28:37 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x945SbaL083579; Fri, 4 Oct 2019 05:28:37 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910040528.x945SbaL083579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 4 Oct 2019 05:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353099 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 353099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 05:28:38 -0000 Author: mckusick Date: Fri Oct 4 05:28:36 2019 New Revision: 353099 URL: https://svnweb.freebsd.org/changeset/base/353099 Log: Update ffs_getcg() function to accept a flags parameter to be passed to breadn_flags() in preparation for later need when doing forcible unmount when disk dies or is removed. No functional change. Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_gjournal.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Oct 4 05:02:39 2019 (r353098) +++ head/sys/ufs/ffs/ffs_alloc.c Fri Oct 4 05:28:36 2019 (r353099) @@ -1689,7 +1689,7 @@ ffs_fragextend(ip, cg, bprev, osize, nsize) return (0); } UFS_UNLOCK(ump); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) goto fail; bno = dtogd(fs, bprev); blksfree = cg_blksfree(cgp); @@ -1760,7 +1760,7 @@ ffs_alloccg(ip, cg, bpref, size, rsize) if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize) return (0); UFS_UNLOCK(ump); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0 || + if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0 || (cgp->cg_cs.cs_nbfree == 0 && size == fs->fs_bsize)) goto fail; if (size == fs->fs_bsize) { @@ -1940,7 +1940,7 @@ ffs_clusteralloc(ip, cg, bpref, len) if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) { + if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) { UFS_LOCK(ump); return (0); } @@ -2082,7 +2082,7 @@ check_nifree: if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); UFS_UNLOCK(ump); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) { + if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) { UFS_LOCK(ump); return (0); } @@ -2179,7 +2179,7 @@ gotit: * to it, then leave it unchanged as the other thread * has already set it correctly. */ - error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp); + error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp); UFS_LOCK(ump); ACTIVECLEAR(fs, cg); UFS_UNLOCK(ump); @@ -2261,7 +2261,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) ffs_fserr(fs, inum, "bad block"); return; } - if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0) return; cgbno = dtogd(fs, bno); blksfree = cg_blksfree(cgp); @@ -2728,7 +2728,7 @@ ffs_checkblk(ip, bno, size) } if ((u_int)bno >= fs->fs_size) panic("ffs_checkblk: bad block %jd", (intmax_t)bno); - error = ffs_getcg(fs, ITODEVVP(ip), dtog(fs, bno), &bp, &cgp); + error = ffs_getcg(fs, ITODEVVP(ip), dtog(fs, bno), 0, &bp, &cgp); if (error) panic("ffs_checkblk: cylinder group read failed"); blksfree = cg_blksfree(cgp); @@ -2802,7 +2802,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) if (ino >= fs->fs_ipg * fs->fs_ncg) panic("ffs_freefile: range: dev = %s, ino = %ju, fs = %s", devtoname(dev), (uintmax_t)ino, fs->fs_fsmnt); - if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0) return (error); inosused = cg_inosused(cgp); ino %= fs->fs_ipg; @@ -2855,7 +2855,7 @@ ffs_checkfreefile(fs, devvp, ino) return (1); if (ino >= fs->fs_ipg * fs->fs_ncg) return (1); - if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0) return (1); inosused = cg_inosused(cgp); ino %= fs->fs_ipg; @@ -2944,21 +2944,21 @@ ffs_getmntstat(struct vnode *devvp) * Fetch and verify a cylinder group. */ int -ffs_getcg(fs, devvp, cg, bpp, cgpp) +ffs_getcg(fs, devvp, cg, flags, bpp, cgpp) struct fs *fs; struct vnode *devvp; u_int cg; + int flags; struct buf **bpp; struct cg **cgpp; { struct buf *bp; struct cg *cgp; const struct statfs *sfs; - int flags, error; + int error; *bpp = NULL; *cgpp = NULL; - flags = 0; if ((fs->fs_metackhash & CK_CYLGRP) != 0) flags |= GB_CKHASH; error = breadn_flags(devvp, devvp->v_type == VREG ? Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Fri Oct 4 05:02:39 2019 (r353098) +++ head/sys/ufs/ffs/ffs_extern.h Fri Oct 4 05:28:36 2019 (r353099) @@ -80,7 +80,7 @@ void ffs_fragacct(struct fs *, int, int32_t [], int); int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t, int, struct workhead *); void ffs_fserr(struct fs *, ino_t, char *); -int ffs_getcg(struct fs *, struct vnode *, u_int, struct buf **, +int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **, struct cg **); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Oct 4 05:02:39 2019 (r353098) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Oct 4 05:28:36 2019 (r353099) @@ -899,7 +899,7 @@ cgaccount(cg, vp, nbp, passno) ip = VTOI(vp); fs = ITOFS(ip); - if ((error = ffs_getcg(fs, ITODEVVP(ip), cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, ITODEVVP(ip), cg, 0, &bp, &cgp)) != 0) return (error); UFS_LOCK(ITOUMP(ip)); ACTIVESET(fs, cg); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Oct 4 05:02:39 2019 (r353098) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Oct 4 05:28:36 2019 (r353099) @@ -1880,7 +1880,7 @@ ffs_fhtovp(mp, fhp, flags, vpp) if (fs->fs_magic != FS_UFS2_MAGIC) return (ufs_fhtovp(mp, ufhp, flags, vpp)); cg = ino_to_cg(fs, ino); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) return (error); if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { brelse(bp); Modified: head/sys/ufs/ufs/ufs_gjournal.c ============================================================================== --- head/sys/ufs/ufs/ufs_gjournal.c Fri Oct 4 05:02:39 2019 (r353098) +++ head/sys/ufs/ufs/ufs_gjournal.c Fri Oct 4 05:28:36 2019 (r353099) @@ -85,7 +85,7 @@ ufs_gjournal_modref(struct vnode *vp, int count) if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) panic("ufs_gjournal_modref: range: dev = %s, ino = %lu, fs = %s", devtoname(dev), (u_long)ino, fs->fs_fsmnt); - if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0) + if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0) return (error); cgp->cg_unrefs += count; UFS_LOCK(ump); From owner-svn-src-all@freebsd.org Fri Oct 4 10:24:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43A7C12A2D1; Fri, 4 Oct 2019 10:24:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46l5Zg0vjpz4Ctp; Fri, 4 Oct 2019 10:24:11 +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 0240D22E07; Fri, 4 Oct 2019 10:24:11 +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 x94AOAC3060707; Fri, 4 Oct 2019 10:24:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94AOAhN060706; Fri, 4 Oct 2019 10:24:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201910041024.x94AOAhN060706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 4 Oct 2019 10:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353100 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 353100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 10:24:11 -0000 Author: bapt Date: Fri Oct 4 10:24:10 2019 New Revision: 353100 URL: https://svnweb.freebsd.org/changeset/base/353100 Log: Do not remove the locale directory when building a system without locales This directory is actually needed during make installworld and will prevent to reinstall a system after make delete-old is done. PR: 226137 Reported by: rakuco MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 4 05:28:36 2019 (r353099) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 4 10:24:10 2019 (r353100) @@ -4796,7 +4796,6 @@ OLD_FILES+=usr/share/man/man1/lldb.1.gz .endif .if ${MK_LOCALES} == no -OLD_DIRS+=usr/share/locale OLD_DIRS+=usr/share/locale/af_ZA.ISO8859-15 OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_CTYPE From owner-svn-src-all@freebsd.org Fri Oct 4 12:18:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECE1A12D464; Fri, 4 Oct 2019 12:18:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46l8666kkLz4K5G; Fri, 4 Oct 2019 12:18:06 +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 C6DA1241E1; Fri, 4 Oct 2019 12:18:06 +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 x94CI6JW025856; Fri, 4 Oct 2019 12:18:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94CI4Un025841; Fri, 4 Oct 2019 12:18:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910041218.x94CI4Un025841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Oct 2019 12:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353102 - in stable/12/sys: amd64/amd64 amd64/vmm arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/vmm arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Commit-Revision: 353102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 12:18:07 -0000 Author: kib Date: Fri Oct 4 12:18:03 2019 New Revision: 353102 URL: https://svnweb.freebsd.org/changeset/base/353102 Log: MFC r352807: Improve MD page fault handlers. PR: 211924 Modified: stable/12/sys/amd64/amd64/trap.c stable/12/sys/amd64/vmm/vmm.c stable/12/sys/arm/arm/trap-v4.c stable/12/sys/arm/arm/trap-v6.c stable/12/sys/arm64/arm64/trap.c stable/12/sys/i386/i386/trap.c stable/12/sys/kern/sys_process.c stable/12/sys/mips/mips/trap.c stable/12/sys/powerpc/powerpc/trap.c stable/12/sys/riscv/riscv/trap.c stable/12/sys/sparc64/sparc64/trap.c stable/12/sys/sys/signal.h stable/12/sys/vm/vm_extern.h stable/12/sys/vm/vm_fault.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/amd64/amd64/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -111,7 +111,7 @@ void __noinline trap(struct trapframe *frame); void trap_check(struct trapframe *frame); void dblfault_handler(struct trapframe *frame); -static int trap_pfault(struct trapframe *, int); +static int trap_pfault(struct trapframe *, bool, int *, int *); static void trap_fatal(struct trapframe *, vm_offset_t); #ifdef KDTRACE_HOOKS static bool trap_user_dtrace(struct trapframe *, @@ -155,10 +155,6 @@ static const char *const trap_msg[] = { [T_DTRACE_RET] = "DTrace pid return trap", }; -static int prot_fault_translation; -SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN, - &prot_fault_translation, 0, - "Select signal to deliver on protection fault"); static int uprintf_signal; SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, &uprintf_signal, 0, @@ -192,14 +188,11 @@ trap(struct trapframe *frame) struct thread *td; struct proc *p; register_t addr, dr6; - int signo, ucode; + int pf, signo, ucode; u_int type; td = curthread; p = td->td_proc; - signo = 0; - ucode = 0; - addr = 0; dr6 = 0; VM_CNT_INC(v_trap); @@ -345,47 +338,18 @@ trap(struct trapframe *frame) case T_PAGEFLT: /* page fault */ /* - * Emulator can take care about this trap? + * Can emulator handle this trap? */ if (*p->p_sysent->sv_trap != NULL && (*p->p_sysent->sv_trap)(td) == 0) return; - addr = frame->tf_addr; - signo = trap_pfault(frame, TRUE); - if (signo == -1) + pf = trap_pfault(frame, true, &signo, &ucode); + if (pf == -1) return; - if (signo == 0) + if (pf == 0) goto userret; - if (signo == SIGSEGV) { - ucode = SEGV_MAPERR; - } else if (prot_fault_translation == 0) { - /* - * Autodetect. This check also covers - * the images without the ABI-tag ELF - * note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && - p->p_osrel >= P_OSREL_SIGSEGV) { - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - signo = SIGBUS; - ucode = T_PAGEFLT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - signo = SIGBUS; - ucode = T_PAGEFLT; - } else { - /* - * Always SIGSEGV mode. - */ - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } + addr = frame->tf_addr; break; case T_DIVIDE: /* integer divide fault */ @@ -440,7 +404,7 @@ trap(struct trapframe *frame) ("kernel trap doesn't have ucred")); switch (type) { case T_PAGEFLT: /* page fault */ - (void) trap_pfault(frame, FALSE); + (void)trap_pfault(frame, false, NULL, NULL); return; case T_DNA: @@ -712,17 +676,29 @@ trap_is_pti(struct trapframe *frame) (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK)); } +/* + * Handle all details of a page fault. + * Returns: + * -1 if this fault was fatal, typically from kernel mode + * (cannot happen, but we need to return something). + * 0 if this fault was handled by updating either the user or kernel + * page table, execution can continue. + * 1 if this fault was from usermode and it was not handled, a synchronous + * signal should be delivered to the thread. *signo returns the signal + * number, *ucode gives si_code. + */ static int -trap_pfault(struct trapframe *frame, int usermode) +trap_pfault(struct trapframe *frame, bool usermode, int *signo, int *ucode) { struct thread *td; struct proc *p; vm_map_t map; - vm_offset_t va; + vm_offset_t eva; int rv; vm_prot_t ftype; - vm_offset_t eva; + MPASS(!usermode || (signo != NULL && ucode != NULL)); + td = curthread; p = td->td_proc; eva = frame->tf_addr; @@ -771,13 +747,15 @@ trap_pfault(struct trapframe *frame, int usermode) return (-1); } } - va = trunc_page(eva); - if (va >= VM_MIN_KERNEL_ADDRESS) { + if (eva >= VM_MIN_KERNEL_ADDRESS) { /* * Don't allow user-mode faults in kernel address space. */ - if (usermode) - return (SIGSEGV); + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + return (1); + } map = kernel_map; } else { @@ -819,7 +797,11 @@ trap_pfault(struct trapframe *frame, int usermode) trap_fatal(frame, eva); return (-1); } - rv = KERN_PROTECTION_FAILURE; + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_PKUERR; + return (1); + } goto after_vmfault; } @@ -843,7 +825,7 @@ trap_pfault(struct trapframe *frame, int usermode) ftype = VM_PROT_READ; /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); if (rv == KERN_SUCCESS) { #ifdef HWPMC_HOOKS if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { @@ -858,17 +840,17 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } + + if (usermode) + return (1); after_vmfault: - if (!usermode) { - if (td->td_intr_nesting_level == 0 && - curpcb->pcb_onfault != NULL) { - frame->tf_rip = (long)curpcb->pcb_onfault; - return (0); - } - trap_fatal(frame, eva); - return (-1); + if (td->td_intr_nesting_level == 0 && + curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; + return (0); } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + trap_fatal(frame, eva); + return (-1); } static void Modified: stable/12/sys/amd64/vmm/vmm.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/amd64/vmm/vmm.c Fri Oct 4 12:18:03 2019 (r353102) @@ -1412,7 +1412,7 @@ vm_handle_paging(struct vm *vm, int vcpuid, bool *retu } map = &vm->vmspace->vm_map; - rv = vm_fault(map, vme->u.paging.gpa, ftype, VM_FAULT_NORMAL); + rv = vm_fault(map, vme->u.paging.gpa, ftype, VM_FAULT_NORMAL, NULL); VCPU_CTR3(vm, vcpuid, "vm_handle_paging rv = %d, gpa = %#lx, " "ftype = %d", rv, vme->u.paging.gpa, ftype); Modified: stable/12/sys/arm/arm/trap-v4.c ============================================================================== --- stable/12/sys/arm/arm/trap-v4.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/arm/arm/trap-v4.c Fri Oct 4 12:18:03 2019 (r353102) @@ -94,12 +94,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #ifdef KDB #include @@ -181,7 +181,7 @@ abort_handler(struct trapframe *tf, int type) vm_prot_t ftype; void *onfault; vm_offset_t va; - int error = 0; + int error = 0, signo, ucode; struct ksig ksig; struct proc *p; @@ -230,6 +230,8 @@ abort_handler(struct trapframe *tf, int type) if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) { if ((data_aborts[fsr & FAULT_TYPE_MASK].func)(tf, fsr, far, td, &ksig)) { + signo = ksig.signb; + ucode = ksig.code; goto do_trapsignal; } goto out; @@ -262,8 +264,8 @@ abort_handler(struct trapframe *tf, int type) * Give the user an illegal instruction signal. */ /* Deliver a SIGILL to the process */ - ksig.signb = SIGILL; - ksig.code = 0; + signo = SIGILL; + ucode = 0; goto do_trapsignal; } @@ -299,8 +301,8 @@ abort_handler(struct trapframe *tf, int type) * but uses USR mode permissions for its accesses. */ user = 1; - ksig.signb = SIGSEGV; - ksig.code = 0; + signo = SIGSEGV; + ucode = 0; goto do_trapsignal; } } else { @@ -350,9 +352,9 @@ abort_handler(struct trapframe *tf, int type) onfault = pcb->pcb_onfault; pcb->pcb_onfault = NULL; - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &signo, &ucode); pcb->pcb_onfault = onfault; - if (__predict_true(error == 0)) + if (__predict_true(error == KERN_SUCCESS)) goto out; fatal_pagefault: if (user == 0) { @@ -368,18 +370,8 @@ fatal_pagefault: } - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); + call_trapsignal(td, signo, ucode); out: /* If returning to user mode, make sure to invoke userret() */ if (user) @@ -613,10 +605,9 @@ prefetch_abort_handler(struct trapframe *tf) struct proc * p; struct vm_map *map; vm_offset_t fault_pc, va; - int error = 0; + int error = 0, signo, ucode; struct ksig ksig; - #if 0 /* Update vmmeter statistics */ uvmexp.traps++; @@ -652,8 +643,8 @@ prefetch_abort_handler(struct trapframe *tf) /* Ok validate the address, can only execute in USER space */ if (__predict_false(fault_pc >= VM_MAXUSER_ADDRESS || (fault_pc < VM_MIN_ADDRESS && vector_page == ARM_VECTORS_LOW))) { - ksig.signb = SIGSEGV; - ksig.code = 0; + signo = SIGSEGV; + ucode = 0; goto do_trapsignal; } @@ -669,24 +660,13 @@ prefetch_abort_handler(struct trapframe *tf) if (pmap_fault_fixup(map->pmap, va, VM_PROT_READ, 1)) goto out; - error = vm_fault(map, va, VM_PROT_READ | VM_PROT_EXECUTE, - VM_FAULT_NORMAL); - if (__predict_true(error == 0)) + error = vm_fault_trap(map, va, VM_PROT_READ | VM_PROT_EXECUTE, + VM_FAULT_NORMAL, &signo, &ucode); + if (__predict_true(error == KERN_SUCCESS)) goto out; - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; - do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); + call_trapsignal(td, signo, ucode); out: userret(td, tf); Modified: stable/12/sys/arm/arm/trap-v6.c ============================================================================== --- stable/12/sys/arm/arm/trap-v6.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/arm/arm/trap-v6.c Fri Oct 4 12:18:03 2019 (r353102) @@ -287,7 +287,7 @@ abort_handler(struct trapframe *tf, int prefetch) struct vmspace *vm; vm_prot_t ftype; bool usermode; - int bp_harden; + int bp_harden, ucode; #ifdef INVARIANTS void *onfault; #endif @@ -497,7 +497,9 @@ abort_handler(struct trapframe *tf, int prefetch) #endif /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &ksig.sig, + &ucode); + ksig.code = ucode; #ifdef INVARIANTS pcb->pcb_onfault = onfault; @@ -518,8 +520,6 @@ nogo: return; } - ksig.sig = SIGSEGV; - ksig.code = (rv == KERN_PROTECTION_FAILURE) ? SEGV_ACCERR : SEGV_MAPERR; ksig.addr = far; do_trapsignal: Modified: stable/12/sys/arm64/arm64/trap.c ============================================================================== --- stable/12/sys/arm64/arm64/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/arm64/arm64/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -157,7 +157,6 @@ data_abort(struct thread *td, struct trapframe *frame, struct proc *p; struct pcb *pcb; vm_prot_t ftype; - vm_offset_t va; int error, sig, ucode; #ifdef KDB bool handled; @@ -213,7 +212,6 @@ data_abort(struct thread *td, struct trapframe *frame, panic("data abort in critical section or under mutex"); } - va = trunc_page(far); if (exec) ftype = VM_PROT_EXECUTE; else @@ -221,14 +219,9 @@ data_abort(struct thread *td, struct trapframe *frame, VM_PROT_READ | VM_PROT_WRITE; /* Fault in the page. */ - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, far, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (lower) { - sig = SIGSEGV; - if (error == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; call_trapsignal(td, sig, ucode, (void *)far); } else { if (td->td_intr_nesting_level == 0 && Modified: stable/12/sys/i386/i386/trap.c ============================================================================== --- stable/12/sys/i386/i386/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/i386/i386/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -114,7 +114,7 @@ PMC_SOFT_DEFINE( , , page_fault, write); void trap(struct trapframe *frame); void syscall(struct trapframe *frame); -static int trap_pfault(struct trapframe *, int, vm_offset_t); +static int trap_pfault(struct trapframe *, bool, vm_offset_t, int *, int *); static void trap_fatal(struct trapframe *, vm_offset_t); #ifdef KDTRACE_HOOKS static bool trap_user_dtrace(struct trapframe *, @@ -180,9 +180,6 @@ trap_msg(int trapno) int has_f00f_bug = 0; /* Initialized so that it can be patched. */ #endif -static int prot_fault_translation = 0; -SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, - &prot_fault_translation, 0, "Select signal to deliver on protection fault"); static int uprintf_signal; SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, &uprintf_signal, 0, @@ -201,7 +198,7 @@ trap(struct trapframe *frame) ksiginfo_t ksi; struct thread *td; struct proc *p; - int signo, ucode; + int pf, signo, ucode; u_int type; register_t addr, dr6; vm_offset_t eva; @@ -211,9 +208,6 @@ trap(struct trapframe *frame) td = curthread; p = td->td_proc; - signo = 0; - ucode = 0; - addr = 0; dr6 = 0; VM_CNT_INC(v_trap); @@ -364,6 +358,7 @@ user_trctrap_out: case T_STKFLT: /* stack fault */ if (frame->tf_eflags & PSL_VM) { signo = vm86_emulate((struct vm86frame *)frame); + ucode = 0; /* XXXKIB: better code ? */ if (signo == SIGTRAP) { load_dr6(rdr6() | 0x4000); goto user_trctrap_out; @@ -394,57 +389,23 @@ user_trctrap_out: break; case T_PAGEFLT: /* page fault */ - signo = trap_pfault(frame, TRUE, eva); + addr = eva; + pf = trap_pfault(frame, true, eva, &signo, &ucode); #if defined(I586_CPU) && !defined(NO_F00F_HACK) - if (signo == -2) { + if (pf == -2) { /* * The f00f hack workaround has triggered, so * treat the fault as an illegal instruction * (T_PRIVINFLT) instead of a page fault. */ type = frame->tf_trapno = T_PRIVINFLT; - - /* Proceed as in that case. */ - ucode = ILL_PRVOPC; - signo = SIGILL; break; } #endif - if (signo == -1) + if (pf == -1) return; - if (signo == 0) + if (pf == 0) goto user; - - if (signo == SIGSEGV) - ucode = SEGV_MAPERR; - else if (prot_fault_translation == 0) { - /* - * Autodetect. This check also covers - * the images without the ABI-tag ELF - * note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && - p->p_osrel >= P_OSREL_SIGSEGV) { - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - signo = SIGBUS; - ucode = T_PAGEFLT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - signo = SIGBUS; - ucode = T_PAGEFLT; - } else { - /* - * Always SIGSEGV mode. - */ - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } - addr = eva; break; case T_DIVIDE: /* integer divide fault */ @@ -516,7 +477,7 @@ user_trctrap_out: ("kernel trap doesn't have ucred")); switch (type) { case T_PAGEFLT: /* page fault */ - (void) trap_pfault(frame, FALSE, eva); + (void)trap_pfault(frame, false, eva, NULL, NULL); return; case T_DNA: @@ -768,16 +729,31 @@ user: ("Return from trap with kernel FPU ctx leaked")); } +/* + * Handle all details of a page fault. + * Returns: + * -2 if the fault was caused by triggered workaround for Intel Pentium + * 0xf00f bug. + * -1 if this fault was fatal, typically from kernel mode + * (cannot happen, but we need to return something). + * 0 if this fault was handled by updating either the user or kernel + * page table, execution can continue. + * 1 if this fault was from usermode and it was not handled, a synchronous + * signal should be delivered to the thread. *signo returns the signal + * number, *ucode gives si_code. + */ static int -trap_pfault(struct trapframe *frame, int usermode, vm_offset_t eva) +trap_pfault(struct trapframe *frame, bool usermode, vm_offset_t eva, + int *signo, int *ucode) { struct thread *td; struct proc *p; - vm_offset_t va; vm_map_t map; int rv; vm_prot_t ftype; + MPASS(!usermode || (signo != NULL && ucode != NULL)); + td = curthread; p = td->td_proc; @@ -825,8 +801,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ return (-1); } } - va = trunc_page(eva); - if (va >= PMAP_TRM_MIN_ADDRESS) { + if (eva >= PMAP_TRM_MIN_ADDRESS) { /* * Don't allow user-mode faults in kernel address space. * An exception: if the faulting address is the invalid @@ -836,11 +811,17 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ * fault. */ #if defined(I586_CPU) && !defined(NO_F00F_HACK) - if ((eva == (unsigned int)&idt[6]) && has_f00f_bug) + if ((eva == (unsigned int)&idt[6]) && has_f00f_bug) { + *ucode = ILL_PRVOPC; + *signo = SIGILL; return (-2); + } #endif - if (usermode) - return (SIGSEGV); + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + return (1); + } trap_fatal(frame, eva); return (-1); } else { @@ -879,7 +860,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ ftype = VM_PROT_READ; /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); if (rv == KERN_SUCCESS) { #ifdef HWPMC_HOOKS if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { @@ -894,16 +875,15 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ #endif return (0); } - if (!usermode) { - if (td->td_intr_nesting_level == 0 && - curpcb->pcb_onfault != NULL) { - frame->tf_eip = (int)curpcb->pcb_onfault; - return (0); - } - trap_fatal(frame, eva); - return (-1); + if (usermode) + return (1); + if (td->td_intr_nesting_level == 0 && + curpcb->pcb_onfault != NULL) { + frame->tf_eip = (int)curpcb->pcb_onfault; + return (0); } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + trap_fatal(frame, eva); + return (-1); } static void Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/kern/sys_process.c Fri Oct 4 12:18:03 2019 (r353102) @@ -280,7 +280,7 @@ proc_rwmem(struct proc *p, struct uio *uio) /* * Fault and hold the page on behalf of the process. */ - error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m); + error = vm_fault(map, pageno, reqprot, fault_flags, &m); if (error != KERN_SUCCESS) { if (error == KERN_RESOURCE_SHORTAGE) error = ENOMEM; Modified: stable/12/sys/mips/mips/trap.c ============================================================================== --- stable/12/sys/mips/mips/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/mips/mips/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -670,8 +670,9 @@ trap(struct trapframe *trapframe) int rv; kernel_fault: - va = trunc_page((vm_offset_t)trapframe->badvaddr); - rv = vm_fault(kernel_map, va, ftype, VM_FAULT_NORMAL); + va = (vm_offset_t)trapframe->badvaddr; + rv = vm_fault_trap(kernel_map, va, ftype, + VM_FAULT_NORMAL, NULL, NULL); if (rv == KERN_SUCCESS) return (trapframe->pc); if (td->td_pcb->pcb_onfault != NULL) { @@ -706,7 +707,7 @@ dofault: vm = p->p_vmspace; map = &vm->vm_map; - va = trunc_page((vm_offset_t)trapframe->badvaddr); + va = (vm_offset_t)trapframe->badvaddr; if (KERNLAND(trapframe->badvaddr)) { /* * Don't allow user-mode faults in kernel @@ -715,7 +716,8 @@ dofault: goto nogo; } - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, + &i, &ucode); /* * XXXDTRACE: add dtrace_doubletrap_func here? */ @@ -740,11 +742,6 @@ dofault: } goto err; } - i = SIGSEGV; - if (rv == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; addr = trapframe->pc; msg = "BAD_PAGE_FAULT"; Modified: stable/12/sys/powerpc/powerpc/trap.c ============================================================================== --- stable/12/sys/powerpc/powerpc/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/powerpc/powerpc/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -86,7 +86,8 @@ __FBSDID("$FreeBSD$"); static void trap_fatal(struct trapframe *frame); static void printtrap(u_int vector, struct trapframe *frame, int isfatal, int user); -static int trap_pfault(struct trapframe *frame, int user); +static bool trap_pfault(struct trapframe *frame, bool user, int *signo, + int *ucode); static int fix_unaligned(struct thread *td, struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -269,9 +270,8 @@ trap(struct trapframe *frame) #endif case EXC_DSI: case EXC_ISI: - sig = trap_pfault(frame, 1); - if (sig == SIGSEGV) - ucode = SEGV_MAPERR; + if (trap_pfault(frame, true, &sig, &ucode)) + sig = 0; break; case EXC_SC: @@ -419,7 +419,7 @@ trap(struct trapframe *frame) break; #endif case EXC_DSI: - if (trap_pfault(frame, 0) == 0) + if (trap_pfault(frame, false, NULL, NULL)) return; break; case EXC_MCHK: @@ -763,10 +763,10 @@ handle_user_slb_spill(pmap_t pm, vm_offset_t addr) } #endif -static int -trap_pfault(struct trapframe *frame, int user) +static bool +trap_pfault(struct trapframe *frame, bool user, int *signo, int *ucode) { - vm_offset_t eva, va; + vm_offset_t eva; struct thread *td; struct proc *p; vm_map_t map; @@ -798,28 +798,27 @@ trap_pfault(struct trapframe *frame, int user) } else { rv = pmap_decode_kernel_ptr(eva, &is_user, &eva); if (rv != 0) - return (SIGSEGV); + return (false); if (is_user) map = &p->p_vmspace->vm_map; else map = kernel_map; } - va = trunc_page(eva); /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); /* * XXXDTRACE: add dtrace_doubletrap_func here? */ if (rv == KERN_SUCCESS) - return (0); + return (true); if (!user && handle_onfault(frame)) - return (0); + return (true); - return (SIGSEGV); + return (false); } /* Modified: stable/12/sys/riscv/riscv/trap.c ============================================================================== --- stable/12/sys/riscv/riscv/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/riscv/riscv/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -219,14 +219,9 @@ data_abort(struct trapframe *frame, int usermode) if (pmap_fault_fixup(map->pmap, va, ftype)) goto done; - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (usermode) { - sig = SIGSEGV; - if (error == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { Modified: stable/12/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/12/sys/sparc64/sparc64/trap.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/sparc64/sparc64/trap.c Fri Oct 4 12:18:03 2019 (r353102) @@ -91,7 +91,8 @@ void trap(struct trapframe *tf); void syscall(struct trapframe *tf); static int trap_cecc(void); -static int trap_pfault(struct thread *td, struct trapframe *tf); +static bool trap_pfault(struct thread *td, struct trapframe *tf, int *signo, + int *ucode); extern char copy_fault[]; extern char copy_nofault_begin[]; @@ -287,7 +288,8 @@ trap(struct trapframe *tf) addr = tf->tf_sfar; /* FALLTHROUGH */ case T_INSTRUCTION_MISS: - sig = trap_pfault(td, tf); + if (trap_pfault(td, tf, &sig, &ucode)) + sig = 0; break; case T_FILL: sig = rwindow_load(td, tf, 2); @@ -358,7 +360,7 @@ trap(struct trapframe *tf) case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: - error = trap_pfault(td, tf); + error = !trap_pfault(td, tf, &sig, &ucode); break; case T_DATA_EXCEPTION: case T_MEM_ADDRESS_NOT_ALIGNED: @@ -443,8 +445,8 @@ trap_cecc(void) return (0); } -static int -trap_pfault(struct thread *td, struct trapframe *tf) +static bool +trap_pfault(struct thread *td, struct trapframe *tf, int *signo, int *ucode) { vm_map_t map; struct proc *p; @@ -508,27 +510,27 @@ trap_pfault(struct thread *td, struct trapframe *tf) } /* Fault in the page. */ - rv = vm_fault(map, va, prot, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, prot, VM_FAULT_NORMAL, signo, ucode); CTR3(KTR_TRAP, "trap_pfault: return td=%p va=%#lx rv=%d", td, va, rv); if (rv == KERN_SUCCESS) - return (0); + return (true); if (ctx != TLB_CTX_KERNEL && (tf->tf_tstate & TSTATE_PRIV) != 0) { if (tf->tf_tpc >= (u_long)fs_nofault_begin && tf->tf_tpc <= (u_long)fs_nofault_end) { tf->tf_tpc = (u_long)fs_fault; tf->tf_tnpc = tf->tf_tpc + 4; - return (0); + return (true); } if (tf->tf_tpc >= (u_long)copy_nofault_begin && tf->tf_tpc <= (u_long)copy_nofault_end) { tf->tf_tpc = (u_long)copy_fault; tf->tf_tnpc = tf->tf_tpc + 4; - return (0); + return (true); } } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + return (false); } /* Maximum number of arguments that can be passed via the out registers. */ Modified: stable/12/sys/sys/signal.h ============================================================================== --- stable/12/sys/sys/signal.h Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/sys/signal.h Fri Oct 4 12:18:03 2019 (r353102) @@ -315,11 +315,13 @@ struct siginfo32 { #define BUS_ADRALN 1 /* Invalid address alignment. */ #define BUS_ADRERR 2 /* Nonexistent physical address. */ #define BUS_OBJERR 3 /* Object-specific hardware error. */ +#define BUS_OOMERR 100 /* Non-standard: No memory. */ /* codes for SIGSEGV */ #define SEGV_MAPERR 1 /* Address not mapped to object. */ #define SEGV_ACCERR 2 /* Invalid permissions for mapped */ /* object. */ +#define SEGV_PKUERR 100 /* x86: PKU violation */ /* codes for SIGFPE */ #define FPE_INTOVF 1 /* Integer overflow. */ Modified: stable/12/sys/vm/vm_extern.h ============================================================================== --- stable/12/sys/vm/vm_extern.h Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/vm/vm_extern.h Fri Oct 4 12:18:03 2019 (r353102) @@ -85,15 +85,16 @@ void kmeminit(void); int kernacc(void *, int, int); int useracc(void *, int, int); -int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); +int vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, vm_page_t *m_hold); void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t, vm_ooffset_t *); int vm_fault_disable_pagefaults(void); void vm_fault_enable_pagefaults(int save); -int vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, - int fault_flags, vm_page_t *m_hold); int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len, vm_prot_t prot, vm_page_t *ma, int max_count); +int vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, int *signo, int *ucode); int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); void vm_waitproc(struct proc *); Modified: stable/12/sys/vm/vm_fault.c ============================================================================== --- stable/12/sys/vm/vm_fault.c Fri Oct 4 10:45:10 2019 (r353101) +++ stable/12/sys/vm/vm_fault.c Fri Oct 4 12:18:03 2019 (r353102) @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #ifdef KTRACE @@ -528,8 +530,19 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro return (KERN_SUCCESS); } +static int prot_fault_translation; +SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN, + &prot_fault_translation, 0, + "Control signal to deliver on protection fault"); + +/* compat definition to keep common code for signal translation */ +#define UCODE_PAGEFLT 12 +#ifdef T_PAGEFLT +_Static_assert(UCODE_PAGEFLT == T_PAGEFLT, "T_PAGEFLT"); +#endif + /* - * vm_fault: + * vm_fault_trap: * * Handle a page fault occurring at the given address, * requiring the given permissions, in the map specified. @@ -546,12 +559,13 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro * Caller may hold no locks. */ int -vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, - int fault_flags) +vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, int *signo, int *ucode) { struct thread *td; int result; + MPASS(signo == NULL || ucode != NULL); td = curthread; if ((td->td_pflags & TDP_NOFAULTING) != 0) return (KERN_PROTECTION_FAILURE); @@ -559,17 +573,69 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa if (map != kernel_map && KTRPOINT(td, KTR_FAULT)) ktrfault(vaddr, fault_type); #endif - result = vm_fault_hold(map, trunc_page(vaddr), fault_type, fault_flags, + result = vm_fault(map, trunc_page(vaddr), fault_type, fault_flags, NULL); + KASSERT(result == KERN_SUCCESS || result == KERN_FAILURE || + result == KERN_INVALID_ADDRESS || + result == KERN_RESOURCE_SHORTAGE || + result == KERN_PROTECTION_FAILURE || + result == KERN_OUT_OF_BOUNDS, + ("Unexpected Mach error %d from vm_fault()", result)); #ifdef KTRACE if (map != kernel_map && KTRPOINT(td, KTR_FAULTEND)) ktrfaultend(result); #endif + if (result != KERN_SUCCESS && signo != NULL) { + switch (result) { + case KERN_FAILURE: + case KERN_INVALID_ADDRESS: + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + break; + case KERN_RESOURCE_SHORTAGE: + *signo = SIGBUS; + *ucode = BUS_OOMERR; + break; + case KERN_OUT_OF_BOUNDS: + *signo = SIGBUS; + *ucode = BUS_OBJERR; + break; + case KERN_PROTECTION_FAILURE: + if (prot_fault_translation == 0) { + /* + * Autodetect. This check also covers + * the images without the ABI-tag ELF + * note. + */ + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && + curproc->p_osrel >= P_OSREL_SIGSEGV) { + *signo = SIGSEGV; + *ucode = SEGV_ACCERR; + } else { + *signo = SIGBUS; + *ucode = UCODE_PAGEFLT; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Oct 4 12:57:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 444A712DF78 for ; Fri, 4 Oct 2019 12:57:19 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46l8zM15nJz4LlF for ; Fri, 4 Oct 2019 12:57:19 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id EF9C71FB76 for ; Fri, 4 Oct 2019 12:57:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id u186so5673106qkc.5 for ; Fri, 04 Oct 2019 05:57:18 -0700 (PDT) X-Gm-Message-State: APjAAAV8fL9fgMVl+z37IvDEregszKamAhB/OnW9UcxHfXk4vK6mHH2K A54/4kFVmkBnAznMFTH/JO9+EmmtyEFpdSweIX8= X-Received: by 2002:ae9:dd81:: with SMTP id r123mt8650360qkf.103.1570193838295; Fri, 04 Oct 2019 05:57:18 -0700 (PDT) MIME-Version: 1.0 References: <201910031754.x93Hs0HD065043@repo.freebsd.org> In-Reply-To: <201910031754.x93Hs0HD065043@repo.freebsd.org> From: Kyle Evans Date: Fri, 4 Oct 2019 07:57:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r353057 - head/sys/net Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 12:57:19 -0000 On Thu, Oct 3, 2019 at 12:54 PM Kyle Evans wrote: > > Author: kevans > Date: Thu Oct 3 17:54:00 2019 > New Revision: 353057 > URL: https://svnweb.freebsd.org/changeset/base/353057 > > Log: > if_tuntap: create /dev aliases when a tuntap device gets renamed > > Currently, if you do: > > $ ifconfig tun0 create > $ ifconfig tun0 name wg0 > $ ls -l /dev | egrep 'wg|tun' > > You will see tun0, but no wg0. In fact, it's slightly more annoying to make > the association between the new name and the old name in order to open the > device (if it hadn't been opened during the rename). > > Register an eventhandler for ifnet_arrival_events and catch interface > renames. We can determine if the ifnet is a tun easily enough from the > if_dname, which matches the cevsw.d_name from the associated tuntap_driver. > > Some locking dance is required because renames don't require the device to > be opened, so it could go away in the middle of handling the ioctl, but as > soon as we've verified this isn't the case we can attempt to busy the tun > and either bail out if the tun device is dying, or we can proceed with the > rename. > > We only create these aliases on a best-effort basis. Renaming a tun device > to "usbctl", which doesn't exist as an ifnet but does as a /dev, is clearly > not that disastrous, but we can't and won't create a /dev for that. > It's been brought to my attention that I actually had a PR that I took six months ago that this should've belonged to. PR: 219746 From owner-svn-src-all@freebsd.org Fri Oct 4 13:43:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E111D12EBA7; Fri, 4 Oct 2019 13:43:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lB0C5fryz4NWP; Fri, 4 Oct 2019 13:43:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5810251EF; Fri, 4 Oct 2019 13:43:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94Dh7bu078271; Fri, 4 Oct 2019 13:43:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94Dh7Zo078270; Fri, 4 Oct 2019 13:43:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910041343.x94Dh7Zo078270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 4 Oct 2019 13:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353103 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 353103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 13:43:07 -0000 Author: kevans Date: Fri Oct 4 13:43:07 2019 New Revision: 353103 URL: https://svnweb.freebsd.org/changeset/base/353103 Log: tuntap(4): loosen up tunclose restrictions Realistically, this cannot work. We don't allow the tun to be opened twice, so it must be done via fd passing, fork, dup, some mechanism like these. Applications demonstrably do not enforce strict ordering when they're handing off tun devices, so the parent closing before the child will easily leave the tun/tap device in a bad state where it can't be destroyed and a confused user because they did nothing wrong. Concede that we can't leave the tun/tap device in this kind of state because of software not playing the TUNSIFPID game, but it is still good to find and fix this kind of thing to keep ifconfig(8) up-to-date and help ensure good discipline in tun handling. MFC after: 3 days Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Fri Oct 4 12:18:03 2019 (r353102) +++ head/sys/net/if_tuntap.c Fri Oct 4 13:43:07 2019 (r353103) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -1061,23 +1062,29 @@ tunopen(struct cdev *dev, int flag, int mode, struct t static int tunclose(struct cdev *dev, int foo, int bar, struct thread *td) { + struct proc *p; struct tuntap_softc *tp; struct ifnet *ifp; bool l2tun; + p = td->td_proc; tp = dev->si_drv1; ifp = TUN2IFP(tp); TUN_LOCK(tp); + /* - * Simply close the device if this isn't the controlling process. This - * may happen if, for instance, the tunnel has been handed off to - * another process. The original controller should be able to close it - * without putting us into an inconsistent state. + * Realistically, we can't be obstinate here. This only means that the + * tuntap device was closed out of order, and the last closer wasn't the + * controller. These are still good to know about, though, as software + * should avoid multiple processes with a tuntap device open and + * ill-defined transfer of control (e.g., handoff, TUNSIFPID, close in + * parent). */ - if (td->td_proc->p_pid != tp->tun_pid) { - TUN_UNLOCK(tp); - return (0); + if (p->p_pid != tp->tun_pid) { + log(LOG_INFO, + "pid %d (%s), %s: tun/tap protocol violation, non-controlling process closed last.\n", + p->p_pid, p->p_comm, dev->si_name); } /* From owner-svn-src-all@freebsd.org Fri Oct 4 14:10:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0D9B12F85F; Fri, 4 Oct 2019 14:10:56 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lBcJ5NHTz4Q24; Fri, 4 Oct 2019 14:10:56 +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 9AF562558D; Fri, 4 Oct 2019 14:10:56 +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 x94EAu62091840; Fri, 4 Oct 2019 14:10:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94EAuJj091839; Fri, 4 Oct 2019 14:10:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910041410.x94EAuJj091839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 4 Oct 2019 14:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353104 - releng/12.1/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: releng/12.1/sys/kern X-SVN-Commit-Revision: 353104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 14:10:57 -0000 Author: andrew Date: Fri Oct 4 14:10:56 2019 New Revision: 353104 URL: https://svnweb.freebsd.org/changeset/base/353104 Log: MFS r353032: Check the vfs option length is valid before accessing through When a VFS option passed to nmount is present but NULL the kernel will place an empty option in its internal list. This will have a NULL pointer and a length of 0. When we come to read one of these the kernel will try to load from the last address of virtual memory. This is normally invalid so will fault resulting in a kernel panic. Fix this by checking if the length is valid before dereferencing. Approved by: re (kib) Sponsored by: DARPA, AFRL Modified: releng/12.1/sys/kern/vfs_mount.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/kern/vfs_mount.c ============================================================================== --- releng/12.1/sys/kern/vfs_mount.c Fri Oct 4 13:43:07 2019 (r353103) +++ releng/12.1/sys/kern/vfs_mount.c Fri Oct 4 14:10:56 2019 (r353104) @@ -603,7 +603,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -611,7 +611,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); From owner-svn-src-all@freebsd.org Fri Oct 4 15:24:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 520A7131150; Fri, 4 Oct 2019 15:24:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lDDx1Mnlz4TKj; Fri, 4 Oct 2019 15:24:17 +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 11BBD2636E; Fri, 4 Oct 2019 15:24:17 +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 x94FOGIa036668; Fri, 4 Oct 2019 15:24:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94FOG2l036665; Fri, 4 Oct 2019 15:24:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910041524.x94FOG2l036665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Oct 2019 15:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353105 - in stable/12/sys: amd64/vmm/amd amd64/vmm/intel dev/qlnx/qlnxe X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/vmm/amd amd64/vmm/intel dev/qlnx/qlnxe X-SVN-Commit-Revision: 353105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 15:24:17 -0000 Author: markj Date: Fri Oct 4 15:24:16 2019 New Revision: 353105 URL: https://svnweb.freebsd.org/changeset/base/353105 Log: MFC r352823: Correct the scope of several global variables. Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/dev/qlnx/qlnxe/qlnx_os.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- stable/12/sys/amd64/vmm/amd/amdvi_hw.c Fri Oct 4 14:10:56 2019 (r353104) +++ stable/12/sys/amd64/vmm/amd/amdvi_hw.c Fri Oct 4 15:24:16 2019 (r353105) @@ -96,7 +96,7 @@ SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, host_ptp, CTLFLAG_ TUNABLE_INT("hw.vmm.amdvi.host_ptp", &amdvi_host_ptp); /* Page table level used <= supported by h/w[v1=7]. */ -static int amdvi_ptp_level = 4; +int amdvi_ptp_level = 4; SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, ptp_level, CTLFLAG_RDTUN, &amdvi_ptp_level, 0, NULL); TUNABLE_INT("hw.vmm.amdvi.ptp_level", &amdvi_ptp_level); Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Fri Oct 4 14:10:56 2019 (r353104) +++ stable/12/sys/amd64/vmm/intel/vmx.c Fri Oct 4 15:24:16 2019 (r353105) @@ -189,10 +189,10 @@ static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); -static int guest_l1d_flush; +int guest_l1d_flush; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, &guest_l1d_flush, 0, NULL); -static int guest_l1d_flush_sw; +int guest_l1d_flush_sw; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush_sw, CTLFLAG_RD, &guest_l1d_flush_sw, 0, NULL); Modified: stable/12/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- stable/12/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Oct 4 14:10:56 2019 (r353104) +++ stable/12/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Oct 4 15:24:16 2019 (r353105) @@ -232,10 +232,9 @@ MODULE_DEPEND(if_qlnxev, ether, 1, 1, 1); MALLOC_DEFINE(M_QLNXBUF, "qlnxbuf", "Buffers for qlnx driver"); - -static char qlnx_dev_str[128]; -static char qlnx_ver_str[VER_SIZE]; -static char qlnx_name_str[NAME_SIZE]; +char qlnx_dev_str[128]; +char qlnx_ver_str[VER_SIZE]; +char qlnx_name_str[NAME_SIZE]; /* * Some PCI Configuration Space Related Defines From owner-svn-src-all@freebsd.org Fri Oct 4 15:27:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 397F6131267; Fri, 4 Oct 2019 15:27: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lDJJ0n4vz4TVr; Fri, 4 Oct 2019 15:27: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 F21C226371; Fri, 4 Oct 2019 15:27: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 x94FRBfi036860; Fri, 4 Oct 2019 15:27:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94FRBbA036857; Fri, 4 Oct 2019 15:27:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910041527.x94FRBbA036857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Oct 2019 15:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353106 - in stable/12/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Commit-Revision: 353106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 15:27:12 -0000 Author: markj Date: Fri Oct 4 15:27:10 2019 New Revision: 353106 URL: https://svnweb.freebsd.org/changeset/base/353106 Log: MFC r352826: Implement pmap_page_is_mapped() correctly on arm64 and riscv. Modified: stable/12/sys/arm64/arm64/pmap.c stable/12/sys/arm64/include/pmap.h stable/12/sys/riscv/include/pmap.h stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/pmap.c ============================================================================== --- stable/12/sys/arm64/arm64/pmap.c Fri Oct 4 15:24:16 2019 (r353105) +++ stable/12/sys/arm64/arm64/pmap.c Fri Oct 4 15:27:10 2019 (r353106) @@ -4250,6 +4250,27 @@ restart: } /* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + +/* * Destroy all managed, non-wired mappings in the given user-space * pmap. This pmap cannot be active on any processor besides the * caller. Modified: stable/12/sys/arm64/include/pmap.h ============================================================================== --- stable/12/sys/arm64/include/pmap.h Fri Oct 4 15:24:16 2019 (r353105) +++ stable/12/sys/arm64/include/pmap.h Fri Oct 4 15:27:10 2019 (r353106) @@ -152,6 +152,7 @@ vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t pmap); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -168,8 +169,6 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_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)) static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: stable/12/sys/riscv/include/pmap.h ============================================================================== --- stable/12/sys/riscv/include/pmap.h Fri Oct 4 15:24:16 2019 (r353105) +++ stable/12/sys/riscv/include/pmap.h Fri Oct 4 15:27:10 2019 (r353106) @@ -149,6 +149,7 @@ void pmap_kenter_device(vm_offset_t, vm_size_t, vm_pad vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -161,8 +162,6 @@ void pmap_unmap_io_transient(vm_page_t *, vm_offset_t bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, pt_entry_t **); - -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Fri Oct 4 15:24:16 2019 (r353105) +++ stable/12/sys/riscv/riscv/pmap.c Fri Oct 4 15:27:10 2019 (r353106) @@ -3545,6 +3545,27 @@ restart: return (count); } +/* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + static void pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entry_t pv, struct spglist *free, bool superpage) From owner-svn-src-all@freebsd.org Fri Oct 4 16:17:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B0781322DA; Fri, 4 Oct 2019 16:17:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lFPn0Gz0z4WsV; Fri, 4 Oct 2019 16:17:01 +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 E243726C84; Fri, 4 Oct 2019 16:17:00 +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 x94GH062066674; Fri, 4 Oct 2019 16:17:00 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94GH0Fi066673; Fri, 4 Oct 2019 16:17:00 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201910041617.x94GH0Fi066673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 4 Oct 2019 16:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353107 - head/sys/cddl/dev/dtrace/amd64 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 353107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 16:17:01 -0000 Author: oshogbo Date: Fri Oct 4 16:17:00 2019 New Revision: 353107 URL: https://svnweb.freebsd.org/changeset/base/353107 Log: dtrace: 64-bits registers support The registers in ilumos and FreeBSD have a different number. In the illumos, last 32-bits register defined is SS an in FreeBSD is GS. While translating register we should comper it to the highest one. PR: 240358 Reported by: lwhsu@ MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Fri Oct 4 15:27:10 2019 (r353106) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Fri Oct 4 16:17:00 2019 (r353107) @@ -505,7 +505,11 @@ dtrace_getreg(struct trapframe *rp, uint_t reg) REG_SS /* 18 SS */ }; +#ifdef illumos if (reg <= SS) { +#else /* !illumos */ + if (reg <= GS) { +#endif if (reg >= sizeof (regmap) / sizeof (int)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); From owner-svn-src-all@freebsd.org Fri Oct 4 16:36:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5AA4132B27; Fri, 4 Oct 2019 16:36:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lFqt5FVbz4XxZ; Fri, 4 Oct 2019 16:36:10 +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 7D53427019; Fri, 4 Oct 2019 16:36:10 +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 x94GaAm7078375; Fri, 4 Oct 2019 16:36:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94Ga9K8078372; Fri, 4 Oct 2019 16:36:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910041636.x94Ga9K8078372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Oct 2019 16:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353108 - in releng/12.1/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in releng/12.1/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Commit-Revision: 353108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 16:36:10 -0000 Author: markj Date: Fri Oct 4 16:36:09 2019 New Revision: 353108 URL: https://svnweb.freebsd.org/changeset/base/353108 Log: MFS r353106: Implement pmap_page_is_mapped() correctly on arm64 and riscv. Approved by: re (kib) Modified: releng/12.1/sys/arm64/arm64/pmap.c releng/12.1/sys/arm64/include/pmap.h releng/12.1/sys/riscv/include/pmap.h releng/12.1/sys/riscv/riscv/pmap.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/arm64/arm64/pmap.c ============================================================================== --- releng/12.1/sys/arm64/arm64/pmap.c Fri Oct 4 16:17:00 2019 (r353107) +++ releng/12.1/sys/arm64/arm64/pmap.c Fri Oct 4 16:36:09 2019 (r353108) @@ -4237,6 +4237,27 @@ restart: } /* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + +/* * Destroy all managed, non-wired mappings in the given user-space * pmap. This pmap cannot be active on any processor besides the * caller. Modified: releng/12.1/sys/arm64/include/pmap.h ============================================================================== --- releng/12.1/sys/arm64/include/pmap.h Fri Oct 4 16:17:00 2019 (r353107) +++ releng/12.1/sys/arm64/include/pmap.h Fri Oct 4 16:36:09 2019 (r353108) @@ -152,6 +152,7 @@ vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t pmap); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -168,8 +169,6 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_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)) static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: releng/12.1/sys/riscv/include/pmap.h ============================================================================== --- releng/12.1/sys/riscv/include/pmap.h Fri Oct 4 16:17:00 2019 (r353107) +++ releng/12.1/sys/riscv/include/pmap.h Fri Oct 4 16:36:09 2019 (r353108) @@ -149,6 +149,7 @@ void pmap_kenter_device(vm_offset_t, vm_size_t, vm_pad vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -161,8 +162,6 @@ void pmap_unmap_io_transient(vm_page_t *, vm_offset_t bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, pt_entry_t **); - -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); Modified: releng/12.1/sys/riscv/riscv/pmap.c ============================================================================== --- releng/12.1/sys/riscv/riscv/pmap.c Fri Oct 4 16:17:00 2019 (r353107) +++ releng/12.1/sys/riscv/riscv/pmap.c Fri Oct 4 16:36:09 2019 (r353108) @@ -3545,6 +3545,27 @@ restart: return (count); } +/* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + static void pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entry_t pv, struct spglist *free, bool superpage) From owner-svn-src-all@freebsd.org Fri Oct 4 17:27:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B91A1341C3; Fri, 4 Oct 2019 17:27:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lGzV28DYz4btx; Fri, 4 Oct 2019 17:27:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CEAE27964; Fri, 4 Oct 2019 17:27:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94HRoJI008432; Fri, 4 Oct 2019 17:27:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94HRod9008431; Fri, 4 Oct 2019 17:27:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910041727.x94HRod9008431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Oct 2019 17:27: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: r353109 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 353109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 17:27:50 -0000 Author: emaste Date: Fri Oct 4 17:27:49 2019 New Revision: 353109 URL: https://svnweb.freebsd.org/changeset/base/353109 Log: MFC r352796: Check the vfs option length is valid before accessing through When a VFS option passed to nmount is present but NULL the kernel will place an empty option in its internal list. This will have a NULL pointer and a length of 0. When we come to read one of these the kernel will try to load from the last address of virtual memory. This is normally invalid so will fault resulting in a kernel panic. Fix this by checking if the length is valid before dereferencing. Modified: stable/11/sys/kern/vfs_mount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Fri Oct 4 16:36:09 2019 (r353108) +++ stable/11/sys/kern/vfs_mount.c Fri Oct 4 17:27:49 2019 (r353109) @@ -591,7 +591,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -599,7 +599,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); From owner-svn-src-all@freebsd.org Fri Oct 4 18:38:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A32CC135755; Fri, 4 Oct 2019 18:38:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lJYN4P7gz4g2R; Fri, 4 Oct 2019 18:38:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 759F66B3; Fri, 4 Oct 2019 18:38:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94IcmTA049790; Fri, 4 Oct 2019 18:38:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94Icl9v049786; Fri, 4 Oct 2019 18:38:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910041838.x94Icl9v049786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Oct 2019 18:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353110 - in head/sys: dev/nvdimm modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules/nvdimm X-SVN-Commit-Revision: 353110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 18:38:48 -0000 Author: cem Date: Fri Oct 4 18:38:47 2019 New Revision: 353110 URL: https://svnweb.freebsd.org/changeset/base/353110 Log: nvdimm(4): Add nvdimm_e820 pseudo-bus nvdimm_e820 is a newbus pseudo driver that looks for "legacy" e820 PRAM spans and creates ordinary-looking SPA devfs nodes for them (/dev/nvdimm_spaN). As these legacy regions lack real NFIT SPA regions and namespace definitions, they must be administratively sliced up externally using device.hints. This is similar in purpose to the Linux memmap= mechanism. It is assumed that systems with working NFIT tables will not have any use for this driver, and that that will be the prevailing style going forward, so if there are no explicit hints provided, this driver does not automatically create any devices. Reviewed by: kib (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21885 Added: head/sys/dev/nvdimm/nvdimm_e820.c (contents, props changed) Modified: head/sys/dev/nvdimm/nvdimm_spa.c head/sys/dev/nvdimm/nvdimm_var.h head/sys/modules/nvdimm/Makefile Added: head/sys/dev/nvdimm/nvdimm_e820.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm_e820.c Fri Oct 4 18:38:47 2019 (r353110) @@ -0,0 +1,394 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Dell EMC Isilon + * + * 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 + +struct nvdimm_e820_bus { + SLIST_HEAD(, SPA_mapping) spas; +}; + +#define NVDIMM_E820 "nvdimm_e820" + +static MALLOC_DEFINE(M_NVDIMM_E820, NVDIMM_E820, "NVDIMM e820 bus memory"); + +static const struct bios_smap *smapbase; +static struct { + vm_paddr_t start; + vm_paddr_t size; +} pram_segments[VM_PHYSSEG_MAX]; +static unsigned pram_nreg; + +static void +nvdimm_e820_dump_prams(device_t dev, const char *func, int hintunit) +{ + char buffer[256]; + struct sbuf sb; + bool printed = false; + unsigned i; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + + sbuf_printf(&sb, "%s: %s: ", device_get_nameunit(dev), func); + if (hintunit < 0) + sbuf_cat(&sb, "Found BIOS PRAM regions: "); + else + sbuf_printf(&sb, "Remaining unallocated PRAM regions after " + "hint %d: ", hintunit); + + for (i = 0; i < pram_nreg; i++) { + if (pram_segments[i].size == 0) + continue; + if (printed) + sbuf_putc(&sb, ','); + else + printed = true; + sbuf_printf(&sb, "0x%jx-0x%jx", + (uintmax_t)pram_segments[i].start, + (uintmax_t)pram_segments[i].start + pram_segments[i].size + - 1); + } + + if (!printed) + sbuf_cat(&sb, ""); + sbuf_putc(&sb, '\n'); + sbuf_finish(&sb); + sbuf_delete(&sb); +} + +static int +nvdimm_e820_create_spas(device_t dev) +{ + static const vm_size_t HINT_ALL = (vm_size_t)-1; + + ACPI_NFIT_SYSTEM_ADDRESS nfit_sa; + struct SPA_mapping *spa_mapping; + enum SPA_mapping_type spa_type; + struct nvdimm_e820_bus *sc; + const char *hinttype; + long hintaddrl, hintsizel; + vm_paddr_t hintaddr; + vm_size_t hintsize; + unsigned i, j; + int error; + + sc = device_get_softc(dev); + error = 0; + nfit_sa = (ACPI_NFIT_SYSTEM_ADDRESS) { 0 }; + + if (bootverbose) + nvdimm_e820_dump_prams(dev, __func__, -1); + + for (i = 0; + resource_long_value("nvdimm_spa", i, "maddr", &hintaddrl) == 0; + i++) { + if (resource_long_value("nvdimm_spa", i, "msize", &hintsizel) + != 0) { + device_printf(dev, "hint.nvdimm_spa.%u missing msize\n", + i); + continue; + } + + hintaddr = (vm_paddr_t)hintaddrl; + hintsize = (vm_size_t)hintsizel; + if ((hintaddr & PAGE_MASK) != 0 || (hintsize & PAGE_MASK) != 0) + { + device_printf(dev, "hint.nvdimm_spa.%u addr or size " + "not page aligned\n", i); + continue; + } + + if (resource_string_value("nvdimm_spa", i, "type", &hinttype) + != 0) { + device_printf(dev, "hint.nvdimm_spa.%u missing type\n", + i); + continue; + } + spa_type = nvdimm_spa_type_from_name(hinttype); + if (spa_type == SPA_TYPE_UNKNOWN) { + device_printf(dev, "hint.nvdimm_spa%u.type does not " + "match any known SPA types\n", i); + continue; + } + + for (j = 0; j < pram_nreg; j++) { + if (pram_segments[j].start <= hintaddr && + (hintsize == HINT_ALL || + (pram_segments[j].start + pram_segments[j].size) >= + (hintaddr + hintsize))) + break; + } + + if (j == pram_nreg) { + device_printf(dev, "hint.nvdimm_spa%u hint does not " + "match any region\n", i); + continue; + } + + /* Carve off "SPA" from available regions. */ + if (pram_segments[j].start == hintaddr) { + /* Easy case first: beginning of segment. */ + if (hintsize == HINT_ALL) + hintsize = pram_segments[j].size; + pram_segments[j].start += hintsize; + pram_segments[j].size -= hintsize; + /* We might leave an empty segment; who cares. */ + } else if (hintsize == HINT_ALL || + (pram_segments[j].start + pram_segments[j].size) == + (hintaddr + hintsize)) { + /* 2nd easy case: end of segment. */ + if (hintsize == HINT_ALL) + hintsize = pram_segments[j].size - + (hintaddr - pram_segments[j].start); + pram_segments[j].size -= hintsize; + } else { + /* Hard case: mid segment. */ + if (pram_nreg == nitems(pram_segments)) { + /* Improbable, but handle gracefully. */ + device_printf(dev, "Ran out of %zu segments\n", + nitems(pram_segments)); + error = ENOBUFS; + break; + } + + if (j != pram_nreg - 1) { + memmove(&pram_segments[j + 2], + &pram_segments[j + 1], + (pram_nreg - 1 - j) * + sizeof(pram_segments[0])); + } + pram_nreg++; + + pram_segments[j + 1].start = hintaddr + hintsize; + pram_segments[j + 1].size = + (pram_segments[j].start + pram_segments[j].size) - + (hintaddr + hintsize); + pram_segments[j].size = hintaddr - + pram_segments[j].start; + } + + if (bootverbose) + nvdimm_e820_dump_prams(dev, __func__, (int)i); + + spa_mapping = malloc(sizeof(*spa_mapping), M_NVDIMM_E820, + M_WAITOK | M_ZERO); + + /* Mock up a super primitive table for nvdimm_spa_init(). */ + nfit_sa.RangeIndex = i; + nfit_sa.Flags = 0; + nfit_sa.Address = hintaddr; + nfit_sa.Length = hintsize; + nfit_sa.MemoryMapping = EFI_MD_ATTR_WB | EFI_MD_ATTR_WT | + EFI_MD_ATTR_UC; + + error = nvdimm_spa_init(spa_mapping, &nfit_sa, spa_type); + if (error != 0) { + nvdimm_spa_fini(spa_mapping); + free(spa_mapping, M_NVDIMM_E820); + break; + } + + SLIST_INSERT_HEAD(&sc->spas, spa_mapping, link); + } + return (error); +} + +static int +nvdimm_e820_remove_spas(device_t dev) +{ + struct nvdimm_e820_bus *sc; + struct SPA_mapping *spa, *next; + + sc = device_get_softc(dev); + + SLIST_FOREACH_SAFE(spa, &sc->spas, link, next) { + nvdimm_spa_fini(spa); + SLIST_REMOVE_HEAD(&sc->spas, link); + free(spa, M_NVDIMM_E820); + } + return (0); +} + +static void +nvdimm_e820_identify(driver_t *driver __unused, device_t parent) +{ + device_t child; + caddr_t kmdp; + + if (resource_disabled(NVDIMM_E820, 0)) + return; + /* Just create a single instance of the fake bus. */ + if (device_find_child(parent, NVDIMM_E820, -1) != NULL) + return; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + smapbase = (const void *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_SMAP); + + /* Only supports BIOS SMAP for now. */ + if (smapbase == NULL) + return; + + child = BUS_ADD_CHILD(parent, 0, NVDIMM_E820, -1); + if (child == NULL) + device_printf(parent, "add %s child failed\n", NVDIMM_E820); +} + +static int +nvdimm_e820_probe(device_t dev) +{ + /* + * nexus panics if a child doesn't have ivars. BUS_ADD_CHILD uses + * nexus_add_child, which creates fuckin ivars. but sometimes if you + * unload and reload nvdimm_e820, the device node stays but the ivars + * are deleted??? avoid trivial panic but this is a kludge. + */ + if (device_get_ivars(dev) == NULL) + return (ENXIO); + + device_quiet(dev); + device_set_desc(dev, "Legacy e820 NVDIMM root device"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +nvdimm_e820_attach(device_t dev) +{ + const struct bios_smap *smapend, *smap; + uint32_t smapsize; + unsigned nregions; + int error; + + smapsize = *((const uint32_t *)smapbase - 1); + smapend = (const void *)((const char *)smapbase + smapsize); + + for (nregions = 0, smap = smapbase; smap < smapend; smap++) { + if (smap->type != SMAP_TYPE_PRAM || smap->length == 0) + continue; + pram_segments[nregions].start = smap->base; + pram_segments[nregions].size = smap->length; + + device_printf(dev, "Found PRAM 0x%jx +0x%jx\n", + (uintmax_t)smap->base, (uintmax_t)smap->length); + + nregions++; + } + + if (nregions == 0) { + device_printf(dev, "No e820 PRAM regions detected\n"); + return (ENXIO); + } + pram_nreg = nregions; + + error = nvdimm_e820_create_spas(dev); + return (error); +} + +static int +nvdimm_e820_detach(device_t dev) +{ + int error; + + error = nvdimm_e820_remove_spas(dev); + return (error); +} + +static device_method_t nvdimm_e820_methods[] = { + DEVMETHOD(device_identify, nvdimm_e820_identify), + DEVMETHOD(device_probe, nvdimm_e820_probe), + DEVMETHOD(device_attach, nvdimm_e820_attach), + DEVMETHOD(device_detach, nvdimm_e820_detach), + DEVMETHOD_END +}; + +static driver_t nvdimm_e820_driver = { + NVDIMM_E820, + nvdimm_e820_methods, + sizeof(struct nvdimm_e820_bus), +}; + +static devclass_t nvdimm_e820_devclass; + +static int +nvdimm_e820_chainevh(struct module *m, int e, void *arg __unused) +{ + devclass_t dc; + device_t dev, parent; + int i, error, maxunit; + + switch (e) { + case MOD_UNLOAD: + dc = nvdimm_e820_devclass; + maxunit = devclass_get_maxunit(dc); + for (i = 0; i < maxunit; i++) { + dev = devclass_get_device(dc, i); + if (dev == NULL) + continue; + parent = device_get_parent(dev); + if (parent == NULL) { + /* Not sure how this would happen. */ + continue; + } + error = device_delete_child(parent, dev); + if (error != 0) + return (error); + } + break; + default: + /* Prevent compiler warning about unhandled cases. */ + break; + } + return (0); +} + +DRIVER_MODULE(nvdimm_e820, nexus, nvdimm_e820_driver, nvdimm_e820_devclass, + nvdimm_e820_chainevh, NULL); Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Fri Oct 4 17:27:49 2019 (r353109) +++ head/sys/dev/nvdimm/nvdimm_spa.c Fri Oct 4 18:38:47 2019 (r353110) @@ -130,6 +130,19 @@ static struct nvdimm_SPA_uuid_list_elm { }; enum SPA_mapping_type +nvdimm_spa_type_from_name(const char *name) +{ + int j; + + for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { + if (strcmp(name, nvdimm_SPA_uuid_list[j].u_name) != 0) + continue; + return (j); + } + return (SPA_TYPE_UNKNOWN); +} + +enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *uuid) { int j; Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Oct 4 17:27:49 2019 (r353109) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Oct 4 18:38:47 2019 (r353110) @@ -163,6 +163,7 @@ void acpi_nfit_get_control_region(ACPI_TABLE_NFIT *nfi uint16_t control_region_index, ACPI_NFIT_CONTROL_REGION **out); void acpi_nfit_get_flush_addrs(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t dimm, uint64_t ***listp, int *countp); +enum SPA_mapping_type nvdimm_spa_type_from_name(const char *); enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *); struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t nv_handle); int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Fri Oct 4 17:27:49 2019 (r353109) +++ head/sys/modules/nvdimm/Makefile Fri Oct 4 18:38:47 2019 (r353110) @@ -5,6 +5,7 @@ KMOD= nvdimm SRCS= nvdimm.c \ nvdimm_acpi.c \ + nvdimm_e820.c \ nvdimm_nfit.c \ nvdimm_ns.c \ nvdimm_spa.c From owner-svn-src-all@freebsd.org Fri Oct 4 19:12:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ADE713667A; Fri, 4 Oct 2019 19:12:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lKHl6WmXz3DbV; Fri, 4 Oct 2019 19:12:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4DDFF2A5F; Fri, 4 Oct 2019 19:12:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r353103 - head/sys/net To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201910041343.x94Dh7Zo078270@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 4 Oct 2019 12:11:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <201910041343.x94Dh7Zo078270@repo.freebsd.org> 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.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 19:12:04 -0000 On 10/4/19 6:43 AM, Kyle Evans wrote: > Author: kevans > Date: Fri Oct 4 13:43:07 2019 > New Revision: 353103 > URL: https://svnweb.freebsd.org/changeset/base/353103 > > Log: > tuntap(4): loosen up tunclose restrictions > > Realistically, this cannot work. We don't allow the tun to be opened twice, > so it must be done via fd passing, fork, dup, some mechanism like these. > Applications demonstrably do not enforce strict ordering when they're > handing off tun devices, so the parent closing before the child will easily > leave the tun/tap device in a bad state where it can't be destroyed and a > confused user because they did nothing wrong. > > Concede that we can't leave the tun/tap device in this kind of state because > of software not playing the TUNSIFPID game, but it is still good to find and > fix this kind of thing to keep ifconfig(8) up-to-date and help ensure good > discipline in tun handling. Why are you using d_close for last close anyway? It's not really reliable compared to using cdevpriv and a cdevpriv dtor. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Oct 4 21:06:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E48B1394F7; Fri, 4 Oct 2019 21:06:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 46lMqJ4BSkz3MMm; Fri, 4 Oct 2019 21:06:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 85C8343DCC5; Sat, 5 Oct 2019 07:06:01 +1000 (AEST) Date: Sat, 5 Oct 2019 07:05:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r353103 - head/sys/net In-Reply-To: Message-ID: <20191005055823.S2708@besplex.bde.org> References: <201910041343.x94Dh7Zo078270@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=D+Q3ErZj c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=I_U1-saAbeUWtFeOe10A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46lMqJ4BSkz3MMm X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2019 21:06:05 -0000 On Fri, 4 Oct 2019, John Baldwin wrote: > On 10/4/19 6:43 AM, Kyle Evans wrote: >> Author: kevans >> Date: Fri Oct 4 13:43:07 2019 >> New Revision: 353103 >> URL: https://svnweb.freebsd.org/changeset/base/353103 >> >> Log: >> tuntap(4): loosen up tunclose restrictions >> >> Realistically, this cannot work. We don't allow the tun to be opened twice, >> so it must be done via fd passing, fork, dup, some mechanism like these. >> Applications demonstrably do not enforce strict ordering when they're >> handing off tun devices, so the parent closing before the child will easily >> leave the tun/tap device in a bad state where it can't be destroyed and a >> confused user because they did nothing wrong. >> >> Concede that we can't leave the tun/tap device in this kind of state because >> of software not playing the TUNSIFPID game, but it is still good to find and >> fix this kind of thing to keep ifconfig(8) up-to-date and help ensure good >> discipline in tun handling. > > Why are you using d_close for last close anyway? It's not really reliable compared > to using cdevpriv and a cdevpriv dtor. Correct last-close close is necessarily very complicated. Here is the ttydev_close() part of mine for the tty driver. It uses cdevpriv to a fault. One fault from this is that since tracking closes actually works, it breaks mmap() since cdevpriv is associated with open files, but mmap() is supposed to work on closed files and even for open files cdevpriv is not available in vm_fault(). So my fixes make vm_fault() on ttys always fail, since tty_mmap() always fails on entry since cdevpriv is invalid. XX Index: tty.c XX =================================================================== XX --- tty.c (revision 332488) XX +++ tty.c (working copy) I only have this patch for an old version of FreeBSD. XX @@ -368,37 +693,157 @@ XX struct thread *td __unused) XX { XX struct tty *tp = dev->si_drv1; XX + int *ocountp; XX + int error; XX XX tty_lock(tp); XX + tty_trace(T_C_START, "start", dev, fflag, NO_E); XX + if (tp->t_dev == NULL) { XX + tty_trace(T_C_DONE | 0x2000 | T_V, "done (no t_dev)", dev, XX + fflag, ENXIO); XX + tty_unlock(tp); XX + return (ENXIO); XX + } XX + tp->t_acount++; XX + ocountp = ttydev_ocountp(dev); XX + if (*ocountp <= 0) { XX + tty_trace(0x4000 | T_C_DONE, "done (already closed)", dev, XX + fflag, 0); XX + if (fflag & FREVOKE) { XX + (*ttydev_devgenp(dev))++; XX + tty_wakeupall(tp); XX + } XX + ttydev_exit(tp); XX + return (0); XX + } XX + if ((fflag & FREVOKE) == 0) { XX + if (tty_devgen() != tty_filegen()) { This is the main use of cdevpriv. A file generation is stored in cdevpriv and returned by tty_filegen() (return -1 if cdevpriv is invalid). A device generation is one of 4 generation counts stored in the tty struct and is returned by tty_devgen(). When these are not equal, it means a revoke in the past or an even more complicated condition. XX + tty_trace(T_C_DONE | 0x8000 | T_I, XX + "done (revoked before starting)", dev, fflag, 0); XX + ttydev_exit(tp); XX + return (0); XX + } XX + if (*ocountp > 1) { XX + (*ocountp)--; XX + tty_trace(0x10000 | T_C_DONE, "done (non-last)", XX + dev, fflag, 0); XX + ttydev_exit(tp); XX + return (0); XX + } XX + if (!tty_gone(tp)) { XX + tty_trace(0x20000, "tty_drain", dev, fflag, NO_E); XX + /* XX + * This used to be broken by forcibly clearing XX + * TF_STOPPED earlier, and even asserted that. XX + * Expect more "correct" hangs now. The special XX + * timeout amelioriates this. Only software flow XX + * control was cleared anyway. XX + */ XX + error = tty_drain(tp, 1); XX + tty_trace(0x40000, "tty_drain done", dev, fflag, error); XX + /* XX + * Do exactly the same as before draining. XX + * Revoking must be checked for explicitly, XX + * since tty_drain() returns ENXIO if both XX + * revoked and gone, and ERESTART can mean XX + * EINTR. XX + * XX + * Ignore errors in draining, since they are XX + * nonstandard except for EINTR and even EINTR XX + * is too hard for callers to handle. XX + */ XX + if (tty_devgen() != tty_filegen()) { XX + tty_trace(0x80000 | T_C_DONE | T_I, XX + "done (revoked during draining)", dev, XX + fflag, 0); XX + ttydev_exit(tp); XX + return (0); XX + } XX + if (*ocountp <= 0) { XX + tty_trace(0x100000 | T_C_DONE | T_A, XX + "done (closed during draining)", dev, XX + fflag, 0); XX + ttydev_exit(tp); XX + return (0); XX + } XX + if (*ocountp > 1) { XX + (*ocountp)--; XX + tty_trace(0x200000 | T_C_DONE | T_I, XX + "done (non-last after draining)", XX + dev, fflag, 0); XX + ttydev_exit(tp); XX + return (0); XX + } XX + } XX + } Draining in a non-broken tty driver is very complicated. open() must be able to pass last-close(), with one thread blocked draining in last-close(); while it is blocked, any number of new O_NONBLOCK opens and ioctls must be allowed to control the blockage. close() can pass last-close(). closes for the new opens must work, perhaps by treating them as non-last. Revokes are like forced last-close() on all open fd's for the device. The physical device can also go away while draining it. This looks much like a revoke. All these things can happen during draining because the tty lock is released during draining and no other tty-related locks are held. -current breaks draining in last-close() and many things in open() using the big fat lock (state flag) TF_OPENCLOSE. Any device driver that supports revokes and blocking in last-close() must have complications like the above. This is too much to replicate in even 2 drivers. Perhaps it can be done at a higher level. Start with revoke(). revoke() and devices going should work for all cdevs and are relatively simple -- just force everything closed. But first you have to know where everything is, so as to wait or defer the full close until no threads are in the driver. In the above, ttydev_exit() usually only unlocks and counts things, while ttydev_leave() usually completes a last-close() but it defers freeing all resources if some thread is in the driver. XX XX /* XX - * Don't actually close the device if it is being used as the XX - * console. XX + * We now have a completing last close or a completing revoke XX + * on an open device (but see below about sharing the tty XX + * between cdevs -- the close or revoke may still be partial). XX */ XX MPASS((tp->t_flags & (TF_OPENED_CONS | TF_OPENED_IN)) == 0 || XX (tp->t_flags & TF_OPENED_OUT) == 0); XX if (dev == dev_console) XX tp->t_flags &= ~TF_OPENED_CONS; XX + else if (TTY_CALLOUT(tp, dev)) XX + tp->t_flags &= ~TF_OPENED_OUT; XX else XX - tp->t_flags &= ~(TF_OPENED_IN|TF_OPENED_OUT); XX + tp->t_flags &= ~TF_OPENED_IN; XX + *ocountp = 0; XX XX - if (tp->t_flags & TF_OPENED) { XX - tty_unlock(tp); XX + /* XX + * If revoking, increment the device generation. It is critical XX + * that the this is per-device and not per-tty. Threads in the XX + * driver using or trying to open the revoked dev will wake up XX + * and restart the syscall a few times before their fd is moved XX + * to deadfs, and threads in the driver using or trying to open XX + * the non-revoked devs will wake up but only restart their loop XX + * in the driver. XX + * XX + * If revoking, flush the shared i/o queues for security. XX + * XX + * Always wake up everything for simplicity. XX + */ XX + if (fflag & FREVOKE) { XX + tty_flush(tp, FREAD | FWRITE); XX + (*ttydev_devgenp(dev))++; XX + } XX + tty_wakeupall(tp); XX + XX + /* XX + * Increment the general purpose generation. This is used to XX + * distinguish the wakeup events of new-open and last-close from XX + * DTR rises. The device generation is used to distinguish the XX + * wakeup event of a revoke. XX + */ XX + tp->t_gpgen++; XX + XX + /* XX + * The tty struct is shared between CONS and IN at the same XX + * time and between these and OUT at different times. So when XX + * CONS or IN was closed, the other one may be left open. Don't XX + * do a complete close if it is. XX + * XX + * In the partial close case, the unclosed part is unaffected XX + * except for a revoke its i/o was flushed. The closure XX + * operation for the closed part did very little except for a XX + * revoke it flushed i/o. Otherwise, it mainly waited for XX + * (shared) output to drain and then adjusted the open flags and XX + * counts for the closed part. The wait for output to drain was XX + * more unbounded than usual since it doesn't take new open XX + * passing a last close to give another writer. XX + */ XX + if (tty_opened(tp)) { XX + tty_trace(0x800000 | T_C_DONE, "done (shared dev open)", dev, XX + fflag, 0); XX + ttydev_exit(tp); XX return (0); XX } XX XX - /* If revoking, flush output now to avoid draining it later. */ XX - if (fflag & FREVOKE) XX - tty_flush(tp, FWRITE); XX - XX tp->t_flags &= ~TF_EXCLUDE; XX XX - /* Properly wake up threads that are stuck - revoke(). */ XX - tp->t_revokecnt++; XX - tty_wakeup(tp, FREAD|FWRITE); XX - cv_broadcast(&tp->t_bgwait); XX - cv_broadcast(&tp->t_dcdwait); XX - XX + tty_trace(T_C_DONE, "done (really)", dev, fflag, 0); XX ttydev_leave(tp); XX XX return (0); Bruce From owner-svn-src-all@freebsd.org Fri Oct 4 21:39:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A214313A12B; Fri, 4 Oct 2019 21:39:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lNYX3mvRz3Nt7; Fri, 4 Oct 2019 21:39:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4748F2763; Fri, 4 Oct 2019 21:39:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94LdCD1057580; Fri, 4 Oct 2019 21:39:12 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94LdCQ2057579; Fri, 4 Oct 2019 21:39:12 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201910042139.x94LdCQ2057579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 4 Oct 2019 21:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353111 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 353111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 21:39:12 -0000 Author: vangyzen Date: Fri Oct 4 21:39:11 2019 New Revision: 353111 URL: https://svnweb.freebsd.org/changeset/base/353111 Log: Add CTLFLAG_STATS to all COUNTER_U64* sysctl OIDs CTLFLAG_STATS identifies a sysctl OID as statistical or informational, as opposed to a configurable/tunable OID that changes behavior. This can be used, for example, to verfiy that the kyua tests do not modify configurable OIDs when allow_sysctl_side_effects is true. Add CTLFLAG_STATS to all COUNTER_U64* OIDs. I will add the flag to more OIDs in a few subsequent commits, to facilitate MFC. The flag should be added to many more OIDs. I plan to add it those that my test found and some nearby that looked obvious. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Oct 4 18:38:47 2019 (r353110) +++ head/sys/sys/sysctl.h Fri Oct 4 21:39:11 2019 (r353111) @@ -699,7 +699,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */ #define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \ SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \ (ptr), 0, sysctl_handle_counter_u64, "QU", descr); \ CTASSERT((((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \ @@ -712,7 +712,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \ __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr), \ NULL); \ }) @@ -720,7 +720,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* Oid for an array of counter(9)s. The pointer and length must be non zero. */ #define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \ SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \ (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ CTASSERT((((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ @@ -734,7 +734,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ sysctl_add_oid(ctx, parent, nbr, name, \ - CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \ __ptr, len, sysctl_handle_counter_u64_array, "S", \ __DESCR(descr), NULL); \ }) From owner-svn-src-all@freebsd.org Fri Oct 4 21:43:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CAF413A3BB; Fri, 4 Oct 2019 21:43:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lNfm1mFBz3PKx; Fri, 4 Oct 2019 21:43:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FBB7291C; Fri, 4 Oct 2019 21:43:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94Lhhl6063138; Fri, 4 Oct 2019 21:43:43 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94Lhh1M063136; Fri, 4 Oct 2019 21:43:43 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201910042143.x94Lhh1M063136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 4 Oct 2019 21:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353112 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 353112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 21:43:44 -0000 Author: vangyzen Date: Fri Oct 4 21:43:43 2019 New Revision: 353112 URL: https://svnweb.freebsd.org/changeset/base/353112 Log: Add CTLFLAG_STATS to some vfs sysctl OIDs Add CTLFLAG_STATS to the following OIDs: vfs.altbufferflushes vfs.recursiveflushes vfs.barrierwrites vfs.flushwithdeps vfs.reassignbufcalls Refer to r353111. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Oct 4 21:39:11 2019 (r353111) +++ head/sys/kern/vfs_bio.c Fri Oct 4 21:43:43 2019 (r353112) @@ -250,11 +250,11 @@ int bdwriteskip; SYSCTL_INT(_vfs, OID_AUTO, bdwriteskip, CTLFLAG_RW, &bdwriteskip, 0, "Number of buffers supplied to bdwrite with snapshot deadlock risk"); int altbufferflushes; -SYSCTL_INT(_vfs, OID_AUTO, altbufferflushes, CTLFLAG_RW, &altbufferflushes, - 0, "Number of fsync flushes to limit dirty buffers"); +SYSCTL_INT(_vfs, OID_AUTO, altbufferflushes, CTLFLAG_RW | CTLFLAG_STATS, + &altbufferflushes, 0, "Number of fsync flushes to limit dirty buffers"); static int recursiveflushes; -SYSCTL_INT(_vfs, OID_AUTO, recursiveflushes, CTLFLAG_RW, &recursiveflushes, - 0, "Number of flushes skipped due to being recursive"); +SYSCTL_INT(_vfs, OID_AUTO, recursiveflushes, CTLFLAG_RW | CTLFLAG_STATS, + &recursiveflushes, 0, "Number of flushes skipped due to being recursive"); static int sysctl_numdirtybuffers(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_vfs, OID_AUTO, numdirtybuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RD, NULL, 0, sysctl_numdirtybuffers, "I", @@ -309,8 +309,8 @@ static counter_u64_t notbufdflushes; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, "Number of dirty buffer flushes done by the bufdaemon helpers"); static long barrierwrites; -SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, &barrierwrites, 0, - "Number of barrier writes"); +SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW | CTLFLAG_STATS, + &barrierwrites, 0, "Number of barrier writes"); SYSCTL_INT(_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o"); @@ -3423,8 +3423,9 @@ buf_daemon() * particularly sensitive to. */ static int flushwithdeps = 0; -SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps, CTLFLAG_RW, &flushwithdeps, - 0, "Number of buffers flushed with dependecies that require rollbacks"); +SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps, CTLFLAG_RW | CTLFLAG_STATS, + &flushwithdeps, 0, + "Number of buffers flushed with dependecies that require rollbacks"); static int flushbufqueues(struct vnode *lvp, struct bufdomain *bd, int target, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Oct 4 21:39:11 2019 (r353111) +++ head/sys/kern/vfs_subr.c Fri Oct 4 21:43:43 2019 (r353112) @@ -210,8 +210,8 @@ SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_R * XXX these are probably of (very) limited utility now. */ static int reassignbufcalls; -SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW, &reassignbufcalls, 0, - "Number of calls to reassignbuf"); +SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW | CTLFLAG_STATS, + &reassignbufcalls, 0, "Number of calls to reassignbuf"); static counter_u64_t free_owe_inact; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact, From owner-svn-src-all@freebsd.org Fri Oct 4 21:44:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 955AF13A45C; Fri, 4 Oct 2019 21:44:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lNh53SZQz3PTp; Fri, 4 Oct 2019 21:44:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A137291F; Fri, 4 Oct 2019 21:44:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94Lirf3063252; Fri, 4 Oct 2019 21:44:53 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94Lir9s063251; Fri, 4 Oct 2019 21:44:53 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201910042144.x94Lir9s063251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 4 Oct 2019 21:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353113 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 353113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 21:44:53 -0000 Author: vangyzen Date: Fri Oct 4 21:44:52 2019 New Revision: 353113 URL: https://svnweb.freebsd.org/changeset/base/353113 Log: Add CTLFLAG_STATS to several debug.softdep sysctl OIDs Refer to r353111. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Oct 4 21:43:43 2019 (r353112) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Oct 4 21:44:52 2019 (r353113) @@ -1311,54 +1311,55 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, tickdelay, CTLFLA &tickdelay, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, &stat_flush_threads, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW, - &stat_worklist_push, 0,""); -SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW, - &stat_blk_limit_push, 0,""); -SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_push, CTLFLAG_RW, - &stat_ino_limit_push, 0,""); -SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_hit, CTLFLAG_RW, - &stat_blk_limit_hit, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_hit, CTLFLAG_RW, - &stat_ino_limit_hit, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, sync_limit_hit, CTLFLAG_RW, - &stat_sync_limit_hit, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, indir_blk_ptrs, CTLFLAG_RW, - &stat_indir_blk_ptrs, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, inode_bitmap, CTLFLAG_RW, - &stat_inode_bitmap, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, direct_blk_ptrs, CTLFLAG_RW, - &stat_direct_blk_ptrs, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, dir_entry, CTLFLAG_RW, - &stat_dir_entry, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jaddref_rollback, CTLFLAG_RW, - &stat_jaddref, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jnewblk_rollback, CTLFLAG_RW, - &stat_jnewblk, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, journal_low, CTLFLAG_RW, - &stat_journal_low, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, journal_min, CTLFLAG_RW, - &stat_journal_min, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, journal_wait, CTLFLAG_RW, - &stat_journal_wait, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_filepage, CTLFLAG_RW, - &stat_jwait_filepage, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_freeblks, CTLFLAG_RW, - &stat_jwait_freeblks, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_inode, CTLFLAG_RW, - &stat_jwait_inode, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_newblk, CTLFLAG_RW, - &stat_jwait_newblk, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_blkrequests, CTLFLAG_RW, - &stat_cleanup_blkrequests, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_inorequests, CTLFLAG_RW, - &stat_cleanup_inorequests, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_high_delay, CTLFLAG_RW, - &stat_cleanup_high_delay, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_retries, CTLFLAG_RW, - &stat_cleanup_retries, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_failures, CTLFLAG_RW, - &stat_cleanup_failures, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, + CTLFLAG_RW | CTLFLAG_STATS, &stat_worklist_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, + CTLFLAG_RW | CTLFLAG_STATS, &stat_blk_limit_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_push, + CTLFLAG_RW | CTLFLAG_STATS, &stat_ino_limit_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_hit, + CTLFLAG_RW | CTLFLAG_STATS, &stat_blk_limit_hit, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_hit, + CTLFLAG_RW | CTLFLAG_STATS, &stat_ino_limit_hit, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, sync_limit_hit, + CTLFLAG_RW | CTLFLAG_STATS, &stat_sync_limit_hit, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, indir_blk_ptrs, + CTLFLAG_RW | CTLFLAG_STATS, &stat_indir_blk_ptrs, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, inode_bitmap, + CTLFLAG_RW | CTLFLAG_STATS, &stat_inode_bitmap, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, direct_blk_ptrs, + CTLFLAG_RW | CTLFLAG_STATS, &stat_direct_blk_ptrs, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, dir_entry, + CTLFLAG_RW | CTLFLAG_STATS, &stat_dir_entry, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jaddref_rollback, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jaddref, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jnewblk_rollback, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jnewblk, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, journal_low, + CTLFLAG_RW | CTLFLAG_STATS, &stat_journal_low, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, journal_min, + CTLFLAG_RW | CTLFLAG_STATS, &stat_journal_min, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, journal_wait, + CTLFLAG_RW | CTLFLAG_STATS, &stat_journal_wait, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_filepage, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jwait_filepage, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_freeblks, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jwait_freeblks, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_inode, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jwait_inode, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, jwait_newblk, + CTLFLAG_RW | CTLFLAG_STATS, &stat_jwait_newblk, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_blkrequests, + CTLFLAG_RW | CTLFLAG_STATS, &stat_cleanup_blkrequests, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_inorequests, + CTLFLAG_RW | CTLFLAG_STATS, &stat_cleanup_inorequests, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_high_delay, + CTLFLAG_RW | CTLFLAG_STATS, &stat_cleanup_high_delay, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_retries, + CTLFLAG_RW | CTLFLAG_STATS, &stat_cleanup_retries, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_failures, + CTLFLAG_RW | CTLFLAG_STATS, &stat_cleanup_failures, 0, ""); + SYSCTL_INT(_debug_softdep, OID_AUTO, flushcache, CTLFLAG_RW, &softdep_flushcache, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, emptyjblocks, CTLFLAG_RD, From owner-svn-src-all@freebsd.org Fri Oct 4 21:46:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3730013A4F8; Fri, 4 Oct 2019 21:46:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lNjc0glBz3PdF; Fri, 4 Oct 2019 21:46:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9192922; Fri, 4 Oct 2019 21:46:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94LkBRd063385; Fri, 4 Oct 2019 21:46:11 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94LkBWK063384; Fri, 4 Oct 2019 21:46:11 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201910042146.x94LkBWK063384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 4 Oct 2019 21:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353114 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 353114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 21:46:12 -0000 Author: vangyzen Date: Fri Oct 4 21:46:11 2019 New Revision: 353114 URL: https://svnweb.freebsd.org/changeset/base/353114 Log: Make the hw.intrs sysctl OID read-only The handler ignores the new value, so make the OID read-only. I found this while working on r353111. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/x86/x86/intr_machdep.c Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Fri Oct 4 21:44:52 2019 (r353113) +++ head/sys/x86/x86/intr_machdep.c Fri Oct 4 21:46:11 2019 (r353114) @@ -750,7 +750,7 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS) sbuf_delete(&sbuf); return (error); } -SYSCTL_PROC(_hw, OID_AUTO, intrs, CTLTYPE_STRING | CTLFLAG_RW, +SYSCTL_PROC(_hw, OID_AUTO, intrs, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_hw_intrs, "A", "interrupt:number @cpu: count"); /* From owner-svn-src-all@freebsd.org Fri Oct 4 21:47:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AA5A13A574; Fri, 4 Oct 2019 21:47:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lNkk2B7Kz3PmY; Fri, 4 Oct 2019 21:47:10 +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 2F8622925; Fri, 4 Oct 2019 21:47:10 +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 x94LlAxG063475; Fri, 4 Oct 2019 21:47:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94LlAhn063474; Fri, 4 Oct 2019 21:47:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910042147.x94LlAhn063474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Oct 2019 21:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353115 - head/sys/modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/modules/nvdimm X-SVN-Commit-Revision: 353115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 21:47:10 -0000 Author: cem Date: Fri Oct 4 21:47:09 2019 New Revision: 353115 URL: https://svnweb.freebsd.org/changeset/base/353115 Log: nvdimm(4): Fix Clang build after r353110 Clang spuriously warns about some well-defined C99 static initializers. Mute it. X-MFC-With: r353110 Modified: head/sys/modules/nvdimm/Makefile Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Fri Oct 4 21:46:11 2019 (r353114) +++ head/sys/modules/nvdimm/Makefile Fri Oct 4 21:47:09 2019 (r353115) @@ -14,3 +14,8 @@ SRCS+= acpi_if.h bus_if.h device_if.h SRCS+= opt_acpi.h opt_ddb.h .include + +# Mute spurious Clang warning. +.if ${COMPILER_TYPE} == "clang" +CWARNFLAGS.nvdimm_e820.c+= -Wno-missing-braces +.endif From owner-svn-src-all@freebsd.org Fri Oct 4 22:10:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29A7313AB71; Fri, 4 Oct 2019 22:10:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lPFp6smsz3QhN; Fri, 4 Oct 2019 22:10:38 +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 CFF882CDB; Fri, 4 Oct 2019 22:10:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x94MAc6b075290; Fri, 4 Oct 2019 22:10:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x94MAcJq075289; Fri, 4 Oct 2019 22:10:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910042210.x94MAcJq075289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 4 Oct 2019 22:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353116 - 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: 353116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2019 22:10:39 -0000 Author: cy Date: Fri Oct 4 22:10:38 2019 New Revision: 353116 URL: https://svnweb.freebsd.org/changeset/base/353116 Log: Add missing definition in DEBUG code. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Oct 4 21:47:09 2019 (r353115) +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Oct 4 22:10:38 2019 (r353116) @@ -1323,7 +1323,7 @@ dumptree(rnh) void test_addr(rnh, pref, addr, limit) ipf_rdx_head_t *rnh; - int pref; + int pref, limit; addrfamily_t *addr; { static int extras[14] = { 0, -1, 1, 3, 5, 8, 9, From owner-svn-src-all@freebsd.org Sat Oct 5 01:34:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FC59F8858; Sat, 5 Oct 2019 01:34:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lTn76NQFz47wj; Sat, 5 Oct 2019 01:34:35 +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 BDB3357E5; Sat, 5 Oct 2019 01:34:35 +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 x951YZAm001003; Sat, 5 Oct 2019 01:34:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x951YZCr001002; Sat, 5 Oct 2019 01:34:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910050134.x951YZCr001002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 5 Oct 2019 01:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353117 - head/tests/sys/cddl/zfs/tests/hotspare X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/hotspare X-SVN-Commit-Revision: 353117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 01:34:36 -0000 Author: asomers Date: Sat Oct 5 01:34:35 2019 New Revision: 353117 URL: https://svnweb.freebsd.org/changeset/base/353117 Log: ZFS: the hotspare_add_004_neg test needs at least two disks MFC after: 2 weeks Sponsored by: Axcient Modified: head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Modified: head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh ============================================================================== --- head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Fri Oct 4 22:10:38 2019 (r353116) +++ head/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh Sat Oct 5 01:34:35 2019 (r353117) @@ -115,7 +115,7 @@ hotspare_add_004_neg_body() . $(atf_get_srcdir)/hotspare.kshlib . $(atf_get_srcdir)/hotspare.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/hotspare_add_004_neg.ksh || atf_fail "Testcase failed" } From owner-svn-src-all@freebsd.org Sat Oct 5 03:19:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAE8DFD637; Sat, 5 Oct 2019 03:19:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lX6g5Ghtz4F7g; Sat, 5 Oct 2019 03:19:55 +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 982E36A3F; Sat, 5 Oct 2019 03:19: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 x953Jt5p061099; Sat, 5 Oct 2019 03:19:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x953Jrb4061089; Sat, 5 Oct 2019 03:19:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910050319.x953Jrb4061089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 5 Oct 2019 03:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353118 - in head: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zpool_create X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zpool_create X-SVN-Commit-Revision: 353118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 03:19:55 -0000 Author: asomers Date: Sat Oct 5 03:19:53 2019 New Revision: 353118 URL: https://svnweb.freebsd.org/changeset/base/353118 Log: ZFS: fix several of the "zpool create" tests * Remove zpool_create_013_neg. FreeBSD doesn't have an equivalent of Solaris's metadevices. GEOM would be the equivalent, but since all geoms are the same from ZFS's perspective, this test would be redundant with zpool_create_012_neg * Remove zpool_create_014_neg. FreeBSD does not support swapping to regular files. * Remove zpool_create_016_pos. This test is redundant with literally every other test that creates a disk-backed pool. * s:/etc/vfstab:/etc/fstab in zpool_create_011_neg * Delete the VTOC-related portion of zpool_create_008_pos. FreeBSD doesn't use VTOC. * Replace dumpadm with dumpon and swap with swapon in multiple tests. * In zpool_create_015_neg, don't require "zpool create -n" to fail. It's reasonable for that variant to succeed, because it doesn't actually open the zvol. * Greatly simplify zpool_create_012_neg. Make it safer, too, but not interfering with the system's regular swap devices. * Expect zpool_create_011_neg to fail (PR 241070) * Delete some redundant cleanup steps in various tests * Remove some unneeeded ATF timeout specifications. The default is fine. PR: 241070 MFC after: 2 weeks Sponsored by: Axcient Deleted: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh Modified: head/ObsoleteFiles.inc head/tests/sys/cddl/zfs/include/commands.txt head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Oct 5 01:34:35 2019 (r353117) +++ head/ObsoleteFiles.inc Sat Oct 5 03:19:53 2019 (r353118) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20191003: Remove useless ZFS tests +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh # 20190910: mklocale(1) and colldef(1) removed OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz Modified: head/tests/sys/cddl/zfs/include/commands.txt ============================================================================== --- head/tests/sys/cddl/zfs/include/commands.txt Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/include/commands.txt Sat Oct 5 03:19:53 2019 (r353118) @@ -65,6 +65,7 @@ /usr/bin/dirname /usr/bin/du #%%STFSUITEDIR%%/bin/dumpadm +/sbin/dumpon /bin/echo /usr/bin/egrep /usr/bin/env Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Sat Oct 5 03:19:53 2019 (r353118) @@ -13,8 +13,6 @@ TEST_METADATA+= is_exclusive=true ${PACKAGE}FILES+= zpool_create_003_pos.ksh ${PACKAGE}FILES+= zpool_create_020_pos.ksh ${PACKAGE}FILES+= zpool_create_017_neg.ksh -${PACKAGE}FILES+= zpool_create_013_neg.ksh -${PACKAGE}FILES+= zpool_create_016_pos.ksh ${PACKAGE}FILES+= zpool_create_012_neg.ksh ${PACKAGE}FILES+= zpool_create_006_pos.ksh ${PACKAGE}FILES+= zpool_create_002_pos.ksh @@ -22,7 +20,6 @@ ${PACKAGE}FILES+= zpool_create_021_pos.ksh ${PACKAGE}FILES+= zpool_create_007_neg.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= zpool_create_014_neg.ksh ${PACKAGE}FILES+= zpool_create_010_neg.ksh ${PACKAGE}FILES+= zpool_create_019_pos.ksh ${PACKAGE}FILES+= zpool_create_008_pos.ksh Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Sat Oct 5 03:19:53 2019 (r353118) @@ -96,36 +96,22 @@ function clean_blockfile # # Find the storage device in /etc/vfstab # -function find_vfstab_dev +function find_fstab_dev { - typeset vfstab="/etc/vfstab" - typeset tmpfile="$TMPDIR/vfstab.tmp" - typeset vfstabdev - typeset vfstabdevs="" + typeset fstab="/etc/fstab" + typeset tmpfile="$TMPDIR/fstab.tmp" + typeset fstabdev + typeset fstabdevs="" typeset line - $CAT $vfstab | $GREP "^/dev" >$tmpfile + $CAT $fstab | $GREP "^/dev" >$tmpfile while read -r line do - vfstabdev=`$ECHO "$line" | $AWK '{print $1}'` - vfstabdev=${vfstabdev%%:} - vfstabdevs="$vfstabdev $vfstabdevs" + fstabdev=`$ECHO "$line" | $AWK '{print $1}'` + fstabdev=${fstabdev%%:} + fstabdevs="$fstabdev $fstabdevs" done <$tmpfile $RM -f $tmpfile - $ECHO $vfstabdevs + $ECHO $fstabdevs } - -# -# Save the systme current dump device configuration -# -function save_dump_dev -{ - - typeset dumpdev - typeset fnd="Dump device" - - dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \ - $AWK '{print $1}'` - $ECHO $dumpdev -} Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Sat Oct 5 03:19:53 2019 (r353118) @@ -57,102 +57,24 @@ verify_runnable "global" -function cleanup -{ - if [[ $exported_pool == true ]]; then - if [[ $force_pool == true ]]; then - log_must $ZPOOL create -f $TESTPOOL ${disk}p1 - else - log_must $ZPOOL import $TESTPOOL - fi - fi - - if poolexists $TESTPOOL ; then - destroy_pool $TESTPOOL - fi - - if poolexists $TESTPOOL1 ; then - destroy_pool $TESTPOOL1 - fi - - # - # recover it back to EFI label - # - wipe_partition_table $disk -} - -# -# create overlap slice 0 and 1 on $disk -# -function create_overlap_slice -{ - typeset format_file=$TMPDIR/format_overlap.${TESTCASE_ID} - typeset disk=$1 - - $ECHO "partition" >$format_file - $ECHO "0" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "200m" >> $format_file - $ECHO "1" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "400m" >> $format_file - $ECHO "label" >> $format_file - $ECHO "" >> $format_file - $ECHO "q" >> $format_file - $ECHO "q" >> $format_file - - $FORMAT -e -s -d $disk -f $format_file - typeset -i ret=$? - $RM -fr $format_file - - if (( ret != 0 )); then - log_fail "unable to create overlap slice." - fi - - return 0 -} - log_assert "'zpool create' have to use '-f' scenarios" -log_onexit cleanup -typeset exported_pool=false -typeset force_pool=false - if [[ -n $DISK ]]; then disk=$DISK else disk=$DISK0 fi -# overlapped slices as vdev need -f to create pool - # Make the disk is EFI labeled first via pool creation create_pool $TESTPOOL $disk destroy_pool $TESTPOOL -# Make the disk is VTOC labeled since only VTOC label supports overlap -log_must labelvtoc $disk -log_must create_overlap_slice $disk - -log_mustnot $ZPOOL create $TESTPOOL ${disk}p1 -log_must $ZPOOL create -f $TESTPOOL ${disk}p1 -destroy_pool $TESTPOOL - # exported device to be as spare vdev need -f to create pool - -log_must $ZPOOL create -f $TESTPOOL $disk -destroy_pool $TESTPOOL log_must partition_disk $SIZE $disk 6 create_pool $TESTPOOL ${disk}p1 ${disk}p2 log_must $ZPOOL export $TESTPOOL -exported_pool=true log_mustnot $ZPOOL create $TESTPOOL1 ${disk}p3 spare ${disk}p2 create_pool $TESTPOOL1 ${disk}p3 spare ${disk}p2 -force_pool=true destroy_pool $TESTPOOL1 log_pass "'zpool create' have to use '-f' scenarios" Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Sat Oct 5 03:19:53 2019 (r353118) @@ -41,7 +41,7 @@ # 'zpool create' will fail in the following cases: # existent pool; device is part of an active pool; nested virtual devices; # differently sized devices without -f option; device being currently -# mounted; devices in /etc/vfstab; specified as the dedicated dump device. +# mounted; devices in /etc/fstab; specified as the dedicated dump device. # # STRATEGY: # 1. Create case scenarios @@ -67,8 +67,8 @@ function cleanup destroy_pool $pool done - if [[ -n $saved_dump_dev ]]; then - log_must $DUMPADM -u -d $saved_dump_dev + if [[ -n $specified_dump_dev ]]; then + $DUMPON -r $specified_dump_dev fi } @@ -87,11 +87,11 @@ mirror2="${disk}p4 ${disk}p5" raidz1=$mirror1 raidz2=$mirror2 diff_size_dev="${disk}p6 ${disk}p7" -vfstab_dev=$(find_vfstab_dev) -specified_dump_dev=${disk}p1 -saved_dump_dev=$(save_dump_dev) +fstab_dev=$(find_fstab_dev) +specified_dump_dev=${disk} lba=$(get_partition_end $disk 6) +$GPART delete -i 7 $disk set_partition 7 "$lba" $SIZE1 $disk create_pool "$TESTPOOL" "$pooldev1" @@ -112,7 +112,7 @@ set -A arg "$TESTPOOL $pooldev2" \ "$TESTPOOL1 raidz $diff_size_dev" \ "$TESTPOOL1 raidz1 $diff_size_dev" \ "$TESTPOOL1 mirror $mirror1 spare $mirror2 spare $diff_size_dev" \ - "$TESTPOOL1 $vfstab_dev" \ + "$TESTPOOL1 $fstab_dev" \ "$TESTPOOL1 ${disk}s10" \ "$TESTPOOL1 spare $pooldev2" @@ -130,7 +130,7 @@ log_must $ZPOOL destroy -f $TESTPOOL log_must $ZPOOL create -f $TESTPOOL3 $disk log_must $ZPOOL destroy -f $TESTPOOL3 -log_must $DUMPADM -d /dev/$specified_dump_dev +log_must dumpon $specified_dump_dev log_mustnot $ZPOOL create -f $TESTPOOL1 "$specified_dump_dev" # Also check to see that in-use checking prevents us from creating Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Sat Oct 5 03:19:53 2019 (r353118) @@ -38,13 +38,12 @@ # # # DESCRIPTION: -# 'zpool create' will fail with formal disk slice in swap +# 'zpool create' will fail with disk in swap # # # STRATEGY: -# 1. Get all the disk devices in swap -# 2. For each device, try to create a new pool with this device -# 3. Verify the creation is failed. +# 1. Add a disk to swap +# 2. Try to create a pool on that disk. It should fail. # # TESTABILITY: explicit # @@ -60,21 +59,14 @@ verify_runnable "global" function cleanup { - if poolexists $TESTPOOL; then - destroy_pool $TESTPOOL - fi + $SWAPOFF $DISK0 } -typeset swap_disks=`$SWAP -l | $GREP "c[0-9].*d[0-9].*s[0-9]" | \ - $AWK '{print $1}'` -log_assert "'zpool create' should fail with disk slice in swap." +log_assert "'zpool create' should fail with disk in swap." log_onexit cleanup -for sdisk in $swap_disks; do - for opt in "-n" "" "-f"; do - log_mustnot $ZPOOL create $opt $TESTPOOL $sdisk - done -done +log_must $SWAPON $DISK0 +log_mustnot $ZPOOL create $TESTPOOL $DISK0 -log_pass "'zpool create' passed as expected with inapplicable scenario." +log_pass "'zpool create' cannot use a swap disk" Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Sat Oct 5 03:19:53 2019 (r353118) @@ -62,16 +62,7 @@ verify_runnable "global" function cleanup { - # cleanup zfs pool and dataset - if datasetexists $vol_name; then - $SWAP -l | $GREP /dev/zvol/$vol_name > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - $SWAP -d /dev/zvol/${vol_name} - fi - fi - - destroy_pool $TESTPOOL1 - destroy_pool $TESTPOOL + $SWAPOFF /dev/zvol/${vol_name} } if [[ -n $DISK ]]; then @@ -80,7 +71,7 @@ else disk=$DISK0 fi -typeset pool_dev=${disk}p1 +typeset pool_dev=${disk} typeset vol_name=$TESTPOOL/$TESTVOL log_assert "'zpool create' should fail with zfs vol device in swap." @@ -91,13 +82,9 @@ log_onexit cleanup # create_pool $TESTPOOL $pool_dev log_must $ZFS create -V 100m $vol_name -log_must $SWAP -a /dev/zvol/$vol_name -for opt in "-n" "" "-f"; do +log_must $SWAPON /dev/zvol/$vol_name +for opt in "" "-f"; do log_mustnot $ZPOOL create $opt $TESTPOOL1 /dev/zvol/${vol_name} done - -# cleanup -log_must $SWAP -d /dev/zvol/${vol_name} -log_must $ZFS destroy $vol_name log_pass "'zpool create' passed as expected with inapplicable scenario." Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Sat Oct 5 01:34:35 2019 (r353117) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Sat Oct 5 03:19:53 2019 (r353118) @@ -219,7 +219,7 @@ atf_test_case zpool_create_008_pos cleanup zpool_create_008_pos_head() { atf_set "descr" "'zpool create' have to use '-f' scenarios" - atf_set "require.progs" zpool format + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_008_pos_body() @@ -300,7 +300,7 @@ atf_test_case zpool_create_011_neg cleanup zpool_create_011_neg_head() { atf_set "descr" "'zpool create' should be failed with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_011_neg_body() @@ -310,6 +310,7 @@ zpool_create_011_neg_body() . $(atf_get_srcdir)/zpool_create.cfg verify_disk_count "$DISKS" 1 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_011_neg.ksh || atf_fail "Testcase failed" } @@ -323,12 +324,11 @@ zpool_create_011_neg_cleanup() } -atf_test_case zpool_create_012_neg cleanup +atf_test_case zpool_create_012_neg zpool_create_012_neg_head() { atf_set "descr" "'zpool create' should fail with disk slice in swap." - atf_set "require.progs" zpool swap - atf_set "timeout" 2400 + atf_set "require.progs" zpool } zpool_create_012_neg_body() { @@ -336,78 +336,16 @@ zpool_create_012_neg_body() . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/zpool_create_012_neg.ksh || atf_fail "Testcase failed" } -zpool_create_012_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - -atf_test_case zpool_create_013_neg cleanup -zpool_create_013_neg_head() -{ - atf_set "descr" "'zpool create' should fail with metadevice in swap." - atf_set "require.progs" metadb metaclear metastat zpool metainit swap - atf_set "timeout" 2400 -} -zpool_create_013_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zpool_create_013_neg.ksh || atf_fail "Testcase failed" -} -zpool_create_013_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - -atf_test_case zpool_create_014_neg cleanup -zpool_create_014_neg_head() -{ - atf_set "descr" "'zpool create' should fail with regular file in swap." - atf_set "require.progs" zfs swap zpool - atf_set "timeout" 2400 -} -zpool_create_014_neg_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - verify_disk_count "$DISKS" 1 - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zpool_create_014_neg.ksh || atf_fail "Testcase failed" -} -zpool_create_014_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - atf_test_case zpool_create_015_neg cleanup zpool_create_015_neg_head() { atf_set "descr" "'zpool create' should fail with zfs vol device in swap." - atf_set "require.progs" zfs zpool swap - atf_set "timeout" 2400 + atf_set "require.progs" zfs zpool } zpool_create_015_neg_body() { @@ -429,33 +367,6 @@ zpool_create_015_neg_cleanup() } -atf_test_case zpool_create_016_pos cleanup -zpool_create_016_pos_head() -{ - atf_set "descr" "'zpool create' should success with no device in swap." - atf_set "require.progs" dumpadm swapadd zpool swap - atf_set "timeout" 2400 -} -zpool_create_016_pos_body() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - verify_disk_count "$DISKS" 1 - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" - ksh93 $(atf_get_srcdir)/zpool_create_016_pos.ksh || atf_fail "Testcase failed" -} -zpool_create_016_pos_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - - atf_test_case zpool_create_017_neg cleanup zpool_create_017_neg_head() { @@ -663,10 +574,7 @@ atf_init_test_cases() atf_add_test_case zpool_create_010_neg atf_add_test_case zpool_create_011_neg atf_add_test_case zpool_create_012_neg - atf_add_test_case zpool_create_013_neg - atf_add_test_case zpool_create_014_neg atf_add_test_case zpool_create_015_neg - atf_add_test_case zpool_create_016_pos atf_add_test_case zpool_create_017_neg atf_add_test_case zpool_create_018_pos atf_add_test_case zpool_create_019_pos From owner-svn-src-all@freebsd.org Sat Oct 5 09:46:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FE7012DFB3; Sat, 5 Oct 2019 09:46:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lhhM6jX0z4XPJ; Sat, 5 Oct 2019 09:46:11 +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 C9CB7AFD5; Sat, 5 Oct 2019 09:46:11 +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 x959kBF5091200; Sat, 5 Oct 2019 09:46:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x959kBQP091199; Sat, 5 Oct 2019 09:46:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910050946.x959kBQP091199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 5 Oct 2019 09:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353119 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 09:46:12 -0000 Author: tuexen Date: Sat Oct 5 09:46:11 2019 New Revision: 353119 URL: https://svnweb.freebsd.org/changeset/base/353119 Log: Fix the adding of padding to COOKIE-ECHO chunks. Thanks to Mark Wodrich who found this issue while fuzz testing the usrsctp stack and reported the issue in https://github.com/sctplab/usrsctp/issues/382 MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Oct 5 03:19:53 2019 (r353118) +++ head/sys/netinet/sctp_output.c Sat Oct 5 09:46:11 2019 (r353119) @@ -9059,8 +9059,7 @@ sctp_send_cookie_echo(struct mbuf *m, pad = 4 - pad; } if (pad > 0) { - cookie = sctp_pad_lastmbuf(cookie, pad, NULL); - if (cookie == NULL) { + if (sctp_pad_lastmbuf(cookie, pad, NULL) == NULL) { return (-8); } } From owner-svn-src-all@freebsd.org Sat Oct 5 09:59:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39DA312E46A; Sat, 5 Oct 2019 09:59:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lhz90lJlz4Y88; Sat, 5 Oct 2019 09:59:01 +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 F0BBCB1C2; Sat, 5 Oct 2019 09:59:00 +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 x959x0XF097766; Sat, 5 Oct 2019 09:59:00 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x959x0Q3097765; Sat, 5 Oct 2019 09:59:00 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201910050959.x959x0Q3097765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Sat, 5 Oct 2019 09:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353120 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: schweikh X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 353120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 09:59:01 -0000 Author: schweikh Date: Sat Oct 5 09:59:00 2019 New Revision: 353120 URL: https://svnweb.freebsd.org/changeset/base/353120 Log: Correct grammos and typos. Modified: head/share/man/man4/bridge.4 Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Sat Oct 5 09:46:11 2019 (r353119) +++ head/share/man/man4/bridge.4 Sat Oct 5 09:59:00 2019 (r353120) @@ -87,7 +87,7 @@ This address is guaranteed to be unique across all .Nm interfaces on the local machine. -Thus you can theoretically have two bridges on the different machines with +Thus you can theoretically have two bridges on different machines with the same link addresses. The address can be changed by assigning the desired link address using .Xr ifconfig 8 . @@ -96,17 +96,17 @@ If .Xr sysctl 8 node .Va net.link.bridge.inherit_mac -has non-zero value, newly created bridge will inherit MAC address -from its first member instead of choosing random link-level address. -This will provide more predictable bridge MAC without any +has non-zero value, a newly created bridge will inherit its MAC address +from its first member instead of choosing a random link-level address. +This provides a more predictable bridge MAC without any additional configuration, but currently this feature is known to break some L2 protocols, for example PPPoE that is provided by .Xr ng_pppoe 4 and .Xr ppp 8 . -Now this feature is considered as experimental and is turned off -by-default. +Currently this feature is considered experimental and is turned off +by default. .Pp A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. @@ -127,13 +127,13 @@ in .Xr rc.conf 5 . .Pp The MTU of the first member interface to be added is used as the bridge MTU. -All additional members are required to have exactly the same value. +All additional members are required to have exactly the same MTU value. .Pp The TOE, TSO, TXCSUM and TXCSUM6 capabilities on all interfaces added to the bridge are disabled if any of the interfaces doesn't support/enable them. The LRO capability is always disabled. -All the capabilities are restored when the interface is removed from bridge. -Changing capabilities in run time may cause NIC reinit and the link flap. +All the capabilities are restored when the interface is removed from the bridge. +Changing capabilities at run-time may cause NIC reinit and a link flap. .Pp The bridge supports .Dq monitor mode , @@ -167,7 +167,7 @@ ifconfig_bridge0_ipv6="inet6 auto_linklocal" However, the .Li AF_INET6 address family has a concept of scope zone. -Bridging multiple interfaces change the zone configuration because +Bridging multiple interfaces changes the zone configuration because multiple links are merged to each other and form a new single link while the member interfaces still work individually. This means each member interface still has a separate link-local scope @@ -180,10 +180,10 @@ This situation is clearly against the description in Section 5, RFC 4007. Although it works in most cases, -it can cause some conterintuitive or undesirable behavior in some -edge cases when both of the +it can cause some counterintuitive or undesirable behavior in some +edge cases when both, the .Nm -interface and one of the member interface have an IPv6 address +interface and one of the member interfaces, have an IPv6 address and applications use both of them. .Pp To prevent this situation, @@ -209,9 +209,9 @@ Note that .Li ACCEPT_RTADV and .Li AUTO_LINKLOCAL -interface flag are not enabled by default on +interface flags are not enabled by default on .Nm -interface even when +interfaces even when .Va net.inet6.ip6.accept_rtadv and/or .Va net.inet6.ip6.auto_linklocal @@ -238,9 +238,9 @@ command in .Pp The bridge can log STP port changes to .Xr syslog 3 -by enabling the +by setting the .Va net.link.bridge.log_stp -variable using +node using .Xr sysctl 8 . .Sh PACKET FILTERING Packet filtering can be used with any firewall package that hooks in via the @@ -348,7 +348,7 @@ actual implementation of .Nm . It is not recommended to rely on the order chosen by the current .Nm -implementation: it can be changed in the future. +implementation since it may change in the future. .Pp The previous paragraph is best illustrated with the following pictures. @@ -377,17 +377,17 @@ we will call them etc. .El .Pp -Then if the MAC address +If the MAC address .Nm nn:nn:nn:nn:nn:nn -is equal to the +is equal to .Nm xx:xx:xx:xx:xx:xx -then the filter will see the packet on the interface +the filter will see the packet on interface .Nm ifX no matter if there are any other bridge members carrying the same MAC address. But if the MAC address .Nm nn:nn:nn:nn:nn:nn -is equal to the +is equal to .Nm yy:yy:yy:yy:yy:yy then the interface that will be seen by the filter is one of the .Nm vlanYn . @@ -399,8 +399,8 @@ implementation details. This problem arises for any bridge members that are sharing the same MAC address, not only to the .Xr vlan 4 -ones: they we taken just as the example of such situation. -So if one wants the filter the locally destined packets based on +ones: they were taken just as an example of such a situation. +So if one wants to filter the locally destined packets based on their interface name, one should be aware of this implication. The described situation will appear at least on the filtering bridges that are doing IP-forwarding; in some of such cases it is better @@ -484,7 +484,7 @@ ifconfig bridge0 addm fxp0 addm gif0 up Note that .Fx 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 have a bug in the EtherIP protocol. -For more details and workaround, see +For more details and workaround, see the .Xr gif 4 manual page. .Sh SEE ALSO From owner-svn-src-all@freebsd.org Sat Oct 5 10:59:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 470DB12F9FF; Sat, 5 Oct 2019 10:59:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lkKC0wRlz4bhV; Sat, 5 Oct 2019 10:59:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F255BBDFF; Sat, 5 Oct 2019 10:59:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x95AxgRV033432; Sat, 5 Oct 2019 10:59:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95AxgFn033429; Sat, 5 Oct 2019 10:59:42 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910051059.x95AxgFn033429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 5 Oct 2019 10:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353121 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 353121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 10:59:43 -0000 Author: vmaffione Date: Sat Oct 5 10:59:41 2019 New Revision: 353121 URL: https://svnweb.freebsd.org/changeset/base/353121 Log: MFC r352841 bhyve: support for enabling/disabling the net backend Extend the net backend interface with two functions, namely netbe_rx_disable() and netbe_rx_enable(), which can be used by the net device emulators to stop the backend from invoking the receive callback. This is useful for device emulators, i.e., on hardware resets or to implement receive backpressure. The mevent module has been extendede to support the addition of a disabled event. To prevent race conditions, the net backends will start with receive operation disabled. A follow-up patch will use the new functionalities in the virtio-net device. Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D20973 Modified: stable/12/usr.sbin/bhyve/mevent.c stable/12/usr.sbin/bhyve/net_backends.c stable/12/usr.sbin/bhyve/net_backends.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/mevent.c ============================================================================== --- stable/12/usr.sbin/bhyve/mevent.c Sat Oct 5 09:59:00 2019 (r353120) +++ stable/12/usr.sbin/bhyve/mevent.c Sat Oct 5 10:59:41 2019 (r353121) @@ -62,10 +62,11 @@ __FBSDID("$FreeBSD$"); #define MEVENT_MAX 64 -#define MEV_ADD 1 -#define MEV_ENABLE 2 -#define MEV_DISABLE 3 -#define MEV_DEL_PENDING 4 +#define MEV_ADD 1 +#define MEV_ENABLE 2 +#define MEV_DISABLE 3 +#define MEV_DEL_PENDING 4 +#define MEV_ADD_DISABLED 5 extern char *vmname; @@ -161,6 +162,9 @@ mevent_kq_flags(struct mevent *mevp) case MEV_ADD: ret = EV_ADD; /* implicitly enabled */ break; + case MEV_ADD_DISABLED: + ret = EV_ADD | EV_DISABLE; + break; case MEV_ENABLE: ret = EV_ENABLE; break; @@ -249,9 +253,10 @@ mevent_handle(struct kevent *kev, int numev) } } -struct mevent * -mevent_add(int tfd, enum ev_type type, - void (*func)(int, enum ev_type, void *), void *param) +static struct mevent * +mevent_add_state(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param, + int state) { struct mevent *lp, *mevp; @@ -299,13 +304,21 @@ mevent_add(int tfd, enum ev_type type, LIST_INSERT_HEAD(&change_head, mevp, me_list); mevp->me_cq = 1; - mevp->me_state = MEV_ADD; + mevp->me_state = state; mevent_notify(); exit: mevent_qunlock(); return (mevp); +} + +struct mevent * +mevent_add(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param) +{ + + return mevent_add_state(tfd, type, func, param, MEV_ADD); } static int Modified: stable/12/usr.sbin/bhyve/net_backends.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.c Sat Oct 5 09:59:00 2019 (r353120) +++ stable/12/usr.sbin/bhyve/net_backends.c Sat Oct 5 10:59:41 2019 (r353121) @@ -110,6 +110,17 @@ struct net_backend { ssize_t (*recv)(struct net_backend *be, struct iovec *iov, int iovcnt); /* + * Ask the backend to enable or disable receive operation in the + * backend. On return from a disable operation, it is guaranteed + * that the receive callback won't be called until receive is + * enabled again. Note however that it is up to the caller to make + * sure that netbe_recv() is not currently being executed by another + * thread. + */ + void (*recv_enable)(struct net_backend *be); + void (*recv_disable)(struct net_backend *be); + + /* * Ask the backend for the virtio-net features it is able to * support. Possible features are TSO, UFO and checksum offloading * in both rx and tx direction and for both IPv4 and IPv6. @@ -248,6 +259,22 @@ tap_recv(struct net_backend *be, struct iovec *iov, in return (ret); } +static void +tap_recv_enable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_enable(priv->mevp); +} + +static void +tap_recv_disable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_disable(priv->mevp); +} + static uint64_t tap_get_cap(struct net_backend *be) { @@ -270,6 +297,8 @@ static struct net_backend tap_backend = { .cleanup = tap_cleanup, .send = tap_send, .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, .get_cap = tap_get_cap, .set_cap = tap_set_cap, }; @@ -282,6 +311,8 @@ static struct net_backend vmnet_backend = { .cleanup = tap_cleanup, .send = tap_send, .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, .get_cap = tap_get_cap, .set_cap = tap_set_cap, }; @@ -571,6 +602,22 @@ netmap_recv(struct net_backend *be, struct iovec *iov, return (totlen); } +static void +netmap_recv_enable(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + mevent_enable(priv->mevp); +} + +static void +netmap_recv_disable(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + mevent_disable(priv->mevp); +} + static struct net_backend netmap_backend = { .prefix = "netmap", .priv_size = sizeof(struct netmap_priv), @@ -578,6 +625,8 @@ static struct net_backend netmap_backend = { .cleanup = netmap_cleanup, .send = netmap_send, .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, .get_cap = netmap_get_cap, .set_cap = netmap_set_cap, }; @@ -590,6 +639,8 @@ static struct net_backend vale_backend = { .cleanup = netmap_cleanup, .send = netmap_send, .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, .get_cap = netmap_get_cap, .set_cap = netmap_set_cap, }; @@ -805,3 +856,16 @@ netbe_rx_discard(struct net_backend *be) return netbe_recv(be, &iov, 1); } +void +netbe_rx_disable(struct net_backend *be) +{ + + return be->recv_enable(be); +} + +void +netbe_rx_enable(struct net_backend *be) +{ + + return be->recv_disable(be); +} Modified: stable/12/usr.sbin/bhyve/net_backends.h ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.h Sat Oct 5 09:59:00 2019 (r353120) +++ stable/12/usr.sbin/bhyve/net_backends.h Sat Oct 5 10:59:41 2019 (r353121) @@ -46,6 +46,8 @@ int netbe_set_cap(net_backend_t *be, uint64_t cap, ssize_t netbe_send(net_backend_t *be, struct iovec *iov, int iovcnt); ssize_t netbe_recv(net_backend_t *be, struct iovec *iov, int iovcnt); ssize_t netbe_rx_discard(net_backend_t *be); +void netbe_rx_disable(net_backend_t *be); +void netbe_rx_enable(net_backend_t *be); /* From owner-svn-src-all@freebsd.org Sat Oct 5 12:34:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66037132164; Sat, 5 Oct 2019 12:34:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lmQz23Jqz3CDB; Sat, 5 Oct 2019 12:34:51 +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 2B43CCF8F; Sat, 5 Oct 2019 12:34:51 +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 x95CYp9G091274; Sat, 5 Oct 2019 12:34:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95CYpA9091273; Sat, 5 Oct 2019 12:34:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910051234.x95CYpA9091273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 5 Oct 2019 12:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353122 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 12:34:51 -0000 Author: tuexen Date: Sat Oct 5 12:34:50 2019 New Revision: 353122 URL: https://svnweb.freebsd.org/changeset/base/353122 Log: Plumb an mbuf leak found by Mark Wodrich from Google by fuzz testing the userland stack and reporting it in: https://github.com/sctplab/usrsctp/issues/396 MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Oct 5 10:59:41 2019 (r353121) +++ head/sys/netinet/sctp_input.c Sat Oct 5 12:34:50 2019 (r353122) @@ -465,6 +465,10 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int if (!cookie_found) { uint16_t len; + /* Only report the missing cookie parameter */ + if (op_err != NULL) { + sctp_m_freem(op_err); + } len = (uint16_t)(sizeof(struct sctp_error_missing_param) + sizeof(uint16_t)); /* We abort with an error of missing mandatory param */ op_err = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); From owner-svn-src-all@freebsd.org Sat Oct 5 13:28:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C72DC13353F; Sat, 5 Oct 2019 13:28:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lncK4hRWz3FTF; Sat, 5 Oct 2019 13:28:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CF8AD8AB; Sat, 5 Oct 2019 13:28:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x95DS1bb020651; Sat, 5 Oct 2019 13:28:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95DS12R020650; Sat, 5 Oct 2019 13:28:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201910051328.x95DS12R020650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 5 Oct 2019 13:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353123 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 353123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 13:28:01 -0000 Author: tuexen Date: Sat Oct 5 13:28:01 2019 New Revision: 353123 URL: https://svnweb.freebsd.org/changeset/base/353123 Log: Fix a use after free bug when removing remote addresses. This bug was found by OSS-Fuzz and reported in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18004 MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sat Oct 5 12:34:50 2019 (r353122) +++ head/sys/netinet/sctp_asconf.c Sat Oct 5 13:28:01 2019 (r353123) @@ -283,7 +283,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc static int sctp_asconf_del_remote_addrs_except(struct sctp_tcb *stcb, struct sockaddr *src) { - struct sctp_nets *src_net, *net; + struct sctp_nets *src_net, *net, *nnet; /* make sure the source address exists as a destination net */ src_net = sctp_findnet(stcb, src); @@ -293,10 +293,9 @@ sctp_asconf_del_remote_addrs_except(struct sctp_tcb *s } /* delete all destination addresses except the source */ - TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + TAILQ_FOREACH_SAFE(net, &stcb->asoc.nets, sctp_next, nnet) { if (net != src_net) { /* delete this address */ - sctp_remove_net(stcb, net); SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_del_remote_addrs_except: deleting "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, @@ -304,6 +303,7 @@ sctp_asconf_del_remote_addrs_except(struct sctp_tcb *s /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED); + sctp_remove_net(stcb, net); } } return (0); From owner-svn-src-all@freebsd.org Sat Oct 5 14:56:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C16EC1353CD; Sat, 5 Oct 2019 14:56:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lqZN3zvbz3K8d; Sat, 5 Oct 2019 14:56:28 +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 6C15CE877; Sat, 5 Oct 2019 14:56: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 x95EuSsN073020; Sat, 5 Oct 2019 14:56:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95EuSZr073019; Sat, 5 Oct 2019 14:56:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910051456.x95EuSZr073019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Oct 2019 14:56:28 +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: r353124 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 353124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 14:56:28 -0000 Author: markj Date: Sat Oct 5 14:56:27 2019 New Revision: 353124 URL: https://svnweb.freebsd.org/changeset/base/353124 Log: MFC r353010: Disallow fcntl(F_READAHEAD) when the vnode is not a regular file. Modified: stable/11/sys/kern/kern_descrip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Sat Oct 5 13:28:01 2019 (r353123) +++ stable/11/sys/kern/kern_descrip.c Sat Oct 5 14:56:27 2019 (r353124) @@ -765,6 +765,12 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ break; } vp = fp->f_vnode; + if (vp->v_type != VREG) { + fdrop(fp, td); + error = ENOTTY; + break; + } + /* * Exclusive lock synchronizes against f_seqcount reads and * writes in sequential_heuristic(). From owner-svn-src-all@freebsd.org Sat Oct 5 17:36:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32FC0138B5A; Sat, 5 Oct 2019 17:36:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lv760XBxz3xsX; Sat, 5 Oct 2019 17:36:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E63851852C; Sat, 5 Oct 2019 17:36:33 +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 x95HaXEV068481; Sat, 5 Oct 2019 17:36:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95HaXgr068480; Sat, 5 Oct 2019 17:36:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910051736.x95HaXgr068480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 5 Oct 2019 17:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353125 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 353125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 17:36:34 -0000 Author: manu Date: Sat Oct 5 17:36:33 2019 New Revision: 353125 URL: https://svnweb.freebsd.org/changeset/base/353125 Log: arm64: rockchip: usb2phy: Add set/get mode We only support host mode so those functions are just added so we won't panic when generic-{e,o}hci will set the phy to host mode. MFC after: 1 month X-MFC-With: r353062 Modified: head/sys/arm64/rockchip/rk_usb2phy.c Modified: head/sys/arm64/rockchip/rk_usb2phy.c ============================================================================== --- head/sys/arm64/rockchip/rk_usb2phy.c Sat Oct 5 14:56:27 2019 (r353124) +++ head/sys/arm64/rockchip/rk_usb2phy.c Sat Oct 5 17:36:33 2019 (r353125) @@ -87,12 +87,17 @@ struct rk_usb2phy_softc { struct syscon *grf; regulator_t phy_supply; clk_t clk; + int mode; }; /* Phy class and methods. */ static int rk_usb2phy_enable(struct phynode *phynode, bool enable); +static int rk_usb2phy_get_mode(struct phynode *phy, int *mode); +static int rk_usb2phy_set_mode(struct phynode *phy, int mode); static phynode_method_t rk_usb2phy_phynode_methods[] = { - PHYNODEMETHOD(phynode_enable, rk_usb2phy_enable), + PHYNODEMETHOD(phynode_enable, rk_usb2phy_enable), + PHYNODEMETHOD(phynode_usb_get_mode, rk_usb2phy_get_mode), + PHYNODEMETHOD(phynode_usb_set_mode, rk_usb2phy_set_mode), PHYNODEMETHOD_END }; @@ -136,6 +141,44 @@ rk_usb2phy_enable(struct phynode *phynode, bool enable return (0); fail: return (ENXIO); +} + +static int +rk_usb2phy_get_mode(struct phynode *phynode, int *mode) +{ + struct rk_usb2phy_softc *sc; + intptr_t phy; + device_t dev; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != RK3399_USBPHY_HOST) + return (ERANGE); + + *mode = sc->mode; + + return (0); +} + +static int +rk_usb2phy_set_mode(struct phynode *phynode, int mode) +{ + struct rk_usb2phy_softc *sc; + intptr_t phy; + device_t dev; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != RK3399_USBPHY_HOST) + return (ERANGE); + + sc->mode = mode; + + return (0); } /* Clock class and method */ From owner-svn-src-all@freebsd.org Sat Oct 5 17:44:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A5FC138E5D; Sat, 5 Oct 2019 17:44:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lvJL27ycz3yLy; Sat, 5 Oct 2019 17:44:34 +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 2C4CE186F8; Sat, 5 Oct 2019 17:44:34 +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 x95HiYXL074512; Sat, 5 Oct 2019 17:44:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95HiXWY074508; Sat, 5 Oct 2019 17:44:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201910051744.x95HiXWY074508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 5 Oct 2019 17:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353126 - in head/sys: fs/devfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/devfs kern sys X-SVN-Commit-Revision: 353126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 17:44:34 -0000 Author: mjg Date: Sat Oct 5 17:44:33 2019 New Revision: 353126 URL: https://svnweb.freebsd.org/changeset/base/353126 Log: devfs: plug redundant bwillwrite avoidance vn_write already checks for vnode type to see if bwillwrite should be called. This effectively reverts r244643. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21905 Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/sys_generic.c head/sys/sys/file.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Oct 5 17:36:33 2019 (r353125) +++ head/sys/fs/devfs/devfs_vnops.c Sat Oct 5 17:44:33 2019 (r353126) @@ -1137,7 +1137,6 @@ devfs_open(struct vop_open_args *ap) int error, ref, vlocked; struct cdevsw *dsw; struct file *fpop; - struct mtx *mtxp; if (vp->v_type == VBLK) return (ENXIO); @@ -1191,16 +1190,6 @@ devfs_open(struct vop_open_args *ap) #endif if (fp->f_ops == &badfileops) finit(fp, fp->f_flag, DTYPE_VNODE, dev, &devfs_ops_f); - mtxp = mtx_pool_find(mtxpool_sleep, fp); - - /* - * Hint to the dofilewrite() to not force the buffer draining - * on the writer to the file. Most likely, the write would - * not need normal buffers. - */ - mtx_lock(mtxp); - fp->f_vnread_flags |= FDEVFS_VNODE; - mtx_unlock(mtxp); return (error); } Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sat Oct 5 17:36:33 2019 (r353125) +++ head/sys/kern/sys_generic.c Sat Oct 5 17:44:33 2019 (r353126) @@ -561,9 +561,6 @@ dofilewrite(struct thread *td, int fd, struct file *fp ktruio = cloneuio(auio); #endif cnt = auio->uio_resid; - if (fp->f_type == DTYPE_VNODE && - (fp->f_vnread_flags & FDEVFS_VNODE) == 0) - bwillwrite(); if ((error = fo_write(fp, auio, td->td_ucred, flags, td))) { if (auio->uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Sat Oct 5 17:36:33 2019 (r353125) +++ head/sys/sys/file.h Sat Oct 5 17:44:33 2019 (r353126) @@ -208,7 +208,6 @@ struct file { #define FOFFSET_LOCKED 0x1 #define FOFFSET_LOCK_WAITING 0x2 -#define FDEVFS_VNODE 0x4 #endif /* _KERNEL || _WANT_FILE */ From owner-svn-src-all@freebsd.org Sat Oct 5 21:28:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CAFF13D319; Sat, 5 Oct 2019 21:28:46 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46m0H248TJz4846; Sat, 5 Oct 2019 21:28:46 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D91D1AE32; Sat, 5 Oct 2019 21:28:46 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x95LSkbJ003909; Sat, 5 Oct 2019 21:28:46 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95LSkdF003907; Sat, 5 Oct 2019 21:28:46 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201910052128.x95LSkdF003907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 5 Oct 2019 21:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353127 - in head/tools/tools/locale: etc/final-maps tools X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/tools/tools/locale: etc/final-maps tools X-SVN-Commit-Revision: 353127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 21:28:46 -0000 Author: yuripv Date: Sat Oct 5 21:28:46 2019 New Revision: 353127 URL: https://svnweb.freebsd.org/changeset/base/353127 Log: Pre-generate Big5 charmap from CLDR data. The one used previously was missing the characters in 0-127 range, making various tools try to escape them in output. PR: 235100 Reviewed by: bapt Tested by: Ting-Wei Lan Differential Revision: https://reviews.freebsd.org/D21794 Modified: head/tools/tools/locale/etc/final-maps/map.Big5 (contents, props changed) head/tools/tools/locale/tools/finalize Modified: head/tools/tools/locale/etc/final-maps/map.Big5 ============================================================================== --- head/tools/tools/locale/etc/final-maps/map.Big5 Sat Oct 5 17:44:33 2019 (r353126) +++ head/tools/tools/locale/etc/final-maps/map.Big5 Sat Oct 5 21:28:46 2019 (r353127) @@ -1,13708 +1,13968 @@ +###################### +# POSIX charmap +# Generated automatically from the Unicode Character Database and Common Locale Data Repository +# see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html +# charset: Big5 +###################### +################################################################################################# +# Copyright 1991-2011 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in # +# http://www.unicode.org/copyright.html. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode # +# data files and any associated documentation (the "Data Files") or Unicode software and any # +# associated documentation (the "Software") to deal in the Data Files or Software without # +# restriction, including without limitation the rights to use, copy, modify, merge, publish, # +# distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom # +# the Data Files or Software are furnished to do so, provided that (a) the above copyright # +# notice(s) and this permission notice appear with all copies of the Data Files or Software, # +# (b) both the above copyright notice(s) and this permission notice appear in associated # +# documentation, and (c) there is clear notice in each modified Data File or in the Software as # +# well as in the documentation associated with the Data File(s) or Software that the data or # +# software has been modified. # +# # +# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # +# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT # +# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR # +# CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # +# CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. # +################################################################################################# + "Big5" - 1 - 2 + 1 + 2 + CHARMAP - \xa1\x40 - \xa1\x41 - \xa1\x42 - \xa1\x43 - \xa1\x44 - \xa1\x45 - \xa1\x46 - \xa1\x47 - \xa1\x48 - \xa1\x49 - \xa1\x4a - \xa1\x4b - \xa1\x4c - \xa1\x4d - \xa1\x4e - \xa1\x4f - \xa1\x50 - \xa1\x51 - \xa1\x52 - \xa1\x53 - \xa1\x54 - \xa1\x55 - \xa1\x56 - \xa1\x57 - \xa1\x58 - \xa1\x59 - \xa1\x5b - \xa1\x5c - \xa1\x5d - \xa1\x5e - \xa1\x5f - \xa1\x60 - \xa1\x61 - \xa1\x62 - \xa1\x63 - \xa1\x64 - \xa1\x65 - \xa1\x66 - \xa1\x67 - \xa1\x68 - \xa1\x69 - \xa1\x6a - \xa1\x6b - \xa1\x6c - \xa1\x6d - \xa1\x6e - \xa1\x6f - \xa1\x70 - \xa1\x71 - \xa1\x72 - \xa1\x73 - \xa1\x74 - \xa1\x75 - \xa1\x76 - \xa1\x77 - \xa1\x78 - \xa1\x79 - \xa1\x7a - \xa1\x7b - \xa1\x7c - \xa1\x7d - \xa1\x7e - \xa1\xa1 - \xa1\xa2 - \xa1\xa3 - \xa1\xa4 - \xa1\xa5 - \xa1\xa6 - \xa1\xa7 - \xa1\xa8 - \xa1\xa9 - \xa1\xaa - \xa1\xab - \xa1\xac - \xa1\xad - \xa1\xae - \xa1\xaf - \xa1\xb0 - \xa1\xb1 - \xa1\xb2 - \xa1\xb3 - \xa1\xb4 - \xa1\xb5 - \xa1\xb6 - \xa1\xb7 - \xa1\xb8 - \xa1\xb9 - \xa1\xba - \xa1\xbb - \xa1\xbc - \xa1\xbd - \xa1\xbe - \xa1\xbf - \xa1\xc0 - \xa1\xc1 - \xa1\xc2 - \xa1\xc4 - \xa1\xc6 - \xa1\xc7 - \xa1\xc8 - \xa1\xc9 - \xa1\xca - \xa1\xcb - \xa1\xcc - \xa1\xcd - \xa1\xce - \xa1\xcf - \xa1\xd0 - \xa1\xd1 - \xa1\xd2 - \xa1\xd3 - \xa1\xd4 - \xa1\xd5 - \xa1\xd6 - \xa1\xd7 - \xa1\xd8 - \xa1\xd9 - \xa1\xda - \xa1\xdb - \xa1\xdc - \xa1\xdd - \xa1\xde - \xa1\xdf - \xa1\xe0 - \xa1\xe1 - \xa1\xe2 - \xa1\xe3 - \xa1\xe4 - \xa1\xe5 - \xa1\xe6 - \xa1\xe7 - \xa1\xe8 - \xa1\xe9 - \xa1\xea - \xa1\xeb - \xa1\xec - \xa1\xed - \xa1\xee - \xa1\xef - \xa1\xf0 - \xa1\xf1 - \xa1\xf2 - \xa1\xf3 - \xa1\xf4 - \xa1\xf5 - \xa1\xf6 - \xa1\xf7 - \xa1\xf8 - \xa1\xf9 - \xa1\xfa - \xa1\xfb - \xa1\xfc - \xa1\xfd - \xa2\x41 - \xa2\x42 - \xa2\x43 - \xa2\x44 - \xa2\x45 - \xa2\x46 - \xa2\x47 - \xa2\x48 - \xa2\x49 - \xa2\x4a - \xa2\x4b - \xa2\x4c - \xa2\x4d - \xa2\x4e - \xa2\x4f - \xa2\x50 - \xa2\x51 - \xa2\x52 - \xa2\x53 - \xa2\x54 - \xa2\x55 - \xa2\x56 - \xa2\x57 - \xa2\x58 - \xa2\x59 - \xa2\x5a - \xa2\x5b - \xa2\x5c - \xa2\x5d - \xa2\x5e - \xa2\x5f - \xa2\x60 - \xa2\x61 - \xa2\x62 - \xa2\x63 - \xa2\x64 - \xa2\x65 - \xa2\x66 - \xa2\x67 - \xa2\x68 - \xa2\x69 - \xa2\x6a - \xa2\x6b - \xa2\x6c - \xa2\x6d - \xa2\x6e - \xa2\x6f - \xa2\x70 - \xa2\x71 - \xa2\x72 - \xa2\x73 - \xa2\x74 - \xa2\x75 - \xa2\x76 - \xa2\x77 - \xa2\x78 - \xa2\x79 - \xa2\x7a - \xa2\x7b - \xa2\x7c - \xa2\x7d - \xa2\x7e - \xa2\xa1 - \xa2\xa2 - \xa2\xa3 - \xa2\xa4 - \xa2\xa5 - \xa2\xa6 - \xa2\xa7 - \xa2\xa8 - \xa2\xa9 - \xa2\xaa - \xa2\xab - \xa2\xac - \xa2\xad - \xa2\xae - \xa2\xaf - \xa2\xb0 - \xa2\xb1 - \xa2\xb2 - \xa2\xb3 - \xa2\xb4 - \xa2\xb5 - \xa2\xb6 - \xa2\xb7 - \xa2\xb8 - \xa2\xb9 - \xa2\xba - \xa2\xbb - \xa2\xbc - \xa2\xbd - \xa2\xbe - \xa2\xbf - \xa2\xc0 - \xa2\xc1 - \xa2\xc2 - \xa2\xc3 - \xa2\xc4 - \xa2\xc5 - \xa2\xc6 - \xa2\xc7 - \xa2\xc8 - \xa2\xc9 - \xa2\xca - \xa2\xcb - \xa2\xcd - \xa2\xcf - \xa2\xd0 - \xa2\xd1 - \xa2\xd2 - \xa2\xd3 - \xa2\xd4 - \xa2\xd5 - \xa2\xd6 - \xa2\xd7 - \xa2\xd8 - \xa2\xd9 - \xa2\xda - \xa2\xdb - \xa2\xdc - \xa2\xdd - \xa2\xde - \xa2\xdf - \xa2\xe0 - \xa2\xe1 - \xa2\xe2 - \xa2\xe3 - \xa2\xe4 - \xa2\xe5 - \xa2\xe6 - \xa2\xe7 - \xa2\xe8 - \xa2\xe9 - \xa2\xea - \xa2\xeb - \xa2\xec - \xa2\xed - \xa2\xee - \xa2\xef - \xa2\xf0 - \xa2\xf1 - \xa2\xf2 - \xa2\xf3 - \xa2\xf4 - \xa2\xf5 - \xa2\xf6 - \xa2\xf7 - \xa2\xf8 - \xa2\xf9 - \xa2\xfa - \xa2\xfb - \xa2\xfc - \xa2\xfd - \xa2\xfe - \xa3\x40 - \xa3\x41 - \xa3\x42 - \xa3\x43 - \xa3\x44 - \xa3\x45 - \xa3\x46 - \xa3\x47 - \xa3\x48 - \xa3\x49 - \xa3\x4a - \xa3\x4b - \xa3\x4c - \xa3\x4d - \xa3\x4e - \xa3\x4f - \xa3\x50 - \xa3\x51 - \xa3\x52 - \xa3\x53 - \xa3\x54 - \xa3\x55 - \xa3\x56 - \xa3\x57 - \xa3\x58 - \xa3\x59 - \xa3\x5a - \xa3\x5b - \xa3\x5c - \xa3\x5d - \xa3\x5e - \xa3\x5f - \xa3\x60 - \xa3\x61 - \xa3\x62 - \xa3\x63 - \xa3\x64 - \xa3\x65 - \xa3\x66 - \xa3\x67 - \xa3\x68 - \xa3\x69 - \xa3\x6a - \xa3\x6b - \xa3\x6c - \xa3\x6d - \xa3\x6e - \xa3\x6f - \xa3\x70 - \xa3\x71 - \xa3\x72 - \xa3\x73 - \xa3\x74 - \xa3\x75 - \xa3\x76 - \xa3\x77 - \xa3\x78 - \xa3\x79 - \xa3\x7a - \xa3\x7b - \xa3\x7c - \xa3\x7d - \xa3\x7e - \xa3\xa1 - \xa3\xa2 - \xa3\xa3 - \xa3\xa4 - \xa3\xa5 - \xa3\xa6 - \xa3\xa7 - \xa3\xa8 - \xa3\xa9 - \xa3\xaa - \xa3\xab - \xa3\xac - \xa3\xad - \xa3\xae - \xa3\xaf - \xa3\xb0 - \xa3\xb1 - \xa3\xb2 - \xa3\xb3 - \xa3\xb4 - \xa3\xb5 - \xa3\xb6 - \xa3\xb7 - \xa3\xb8 - \xa3\xb9 - \xa3\xba - \xa3\xbb - \xa3\xbc - \xa3\xbd - \xa3\xbe - \xa3\xbf - \xa4\x40 - \xa4\x41 - \xa4\x42 - \xa4\x43 - \xa4\x44 - \xa4\x45 - \xa4\x46 - \xa4\x47 - \xa4\x48 - \xa4\x49 - \xa4\x4a - \xa4\x4b - \xa4\x4c - \xa4\x4d - \xa4\x4e - \xa4\x4f - \xa4\x50 - \xa4\x51 - \xa4\x52 - \xa4\x53 - \xa4\x54 - \xa4\x55 - \xa4\x56 - \xa4\x57 - \xa4\x58 - \xa4\x59 - \xa4\x5a - \xa4\x5b - \xa4\x5c - \xa4\x5d - \xa4\x5e - \xa4\x5f - \xa4\x60 - \xa4\x61 - \xa4\x62 - \xa4\x63 - \xa4\x64 - \xa4\x65 - \xa4\x66 - \xa4\x67 - \xa4\x68 - \xa4\x69 - \xa4\x6a - \xa4\x6b - \xa4\x6c - \xa4\x6d - \xa4\x6e - \xa4\x6f - \xa4\x70 - \xa4\x71 - \xa4\x72 - \xa4\x73 - \xa4\x74 - \xa4\x75 - \xa4\x76 - \xa4\x77 - \xa4\x78 - \xa4\x79 - \xa4\x7a - \xa4\x7b - \xa4\x7c - \xa4\x7d - \xa4\x7e - \xa4\xa1 - \xa4\xa2 - \xa4\xa3 - \xa4\xa4 - \xa4\xa5 - \xa4\xa6 - \xa4\xa7 - \xa4\xa8 - \xa4\xa9 - \xa4\xaa - \xa4\xab - \xa4\xac - \xa4\xad - \xa4\xae - \xa4\xaf - \xa4\xb0 - \xa4\xb1 - \xa4\xb2 - \xa4\xb3 - \xa4\xb4 - \xa4\xb5 - \xa4\xb6 - \xa4\xb7 - \xa4\xb8 - \xa4\xb9 - \xa4\xba - \xa4\xbb - \xa4\xbc - \xa4\xbd - \xa4\xbe - \xa4\xbf - \xa4\xc0 - \xa4\xc1 - \xa4\xc2 - \xa4\xc3 - \xa4\xc4 - \xa4\xc5 - \xa4\xc6 - \xa4\xc7 - \xa4\xc8 - \xa4\xc9 - \xa4\xca - \xa4\xcb - \xa4\xcc - \xa4\xcd - \xa4\xce - \xa4\xcf - \xa4\xd0 - \xa4\xd1 - \xa4\xd2 - \xa4\xd3 - \xa4\xd4 - \xa4\xd5 - \xa4\xd6 - \xa4\xd7 - \xa4\xd8 - \xa4\xd9 - \xa4\xda - \xa4\xdb - \xa4\xdc - \xa4\xdd - \xa4\xde - \xa4\xdf - \xa4\xe0 - \xa4\xe1 - \xa4\xe2 - \xa4\xe3 - \xa4\xe4 - \xa4\xe5 - \xa4\xe6 - \xa4\xe7 - \xa4\xe8 - \xa4\xe9 - \xa4\xea - \xa4\xeb - \xa4\xec - \xa4\xed - \xa4\xee - \xa4\xef - \xa4\xf0 - \xa4\xf1 - \xa4\xf2 - \xa4\xf3 - \xa4\xf4 - \xa4\xf5 - \xa4\xf6 - \xa4\xf7 - \xa4\xf8 - \xa4\xf9 - \xa4\xfa - \xa4\xfb - \xa4\xfc - \xa4\xfd - \xa4\xfe - \xa5\x40 - \xa5\x41 - \xa5\x42 - \xa5\x43 - \xa5\x44 - \xa5\x45 - \xa5\x46 - \xa5\x47 - \xa5\x48 - \xa5\x49 - \xa5\x4a - \xa5\x4b - \xa5\x4c - \xa5\x4d - \xa5\x4e - \xa5\x4f - \xa5\x50 - \xa5\x51 - \xa5\x52 - \xa5\x53 - \xa5\x54 - \xa5\x55 - \xa5\x56 - \xa5\x57 - \xa5\x58 - \xa5\x59 - \xa5\x5a - \xa5\x5b - \xa5\x5c - \xa5\x5d - \xa5\x5e - \xa5\x5f - \xa5\x60 - \xa5\x61 - \xa5\x62 - \xa5\x63 - \xa5\x64 - \xa5\x65 - \xa5\x66 - \xa5\x67 - \xa5\x68 - \xa5\x69 - \xa5\x6a - \xa5\x6b - \xa5\x6c - \xa5\x6d - \xa5\x6e - \xa5\x6f - \xa5\x70 - \xa5\x71 - \xa5\x72 - \xa5\x73 - \xa5\x74 - \xa5\x75 - \xa5\x76 - \xa5\x77 - \xa5\x78 - \xa5\x79 - \xa5\x7a - \xa5\x7b - \xa5\x7c - \xa5\x7d - \xa5\x7e - \xa5\xa1 - \xa5\xa2 - \xa5\xa3 - \xa5\xa4 - \xa5\xa5 - \xa5\xa6 - \xa5\xa7 - \xa5\xa8 - \xa5\xa9 - \xa5\xaa - \xa5\xab - \xa5\xac - \xa5\xad - \xa5\xae - \xa5\xaf - \xa5\xb0 - \xa5\xb1 - \xa5\xb2 - \xa5\xb3 - \xa5\xb4 - \xa5\xb5 - \xa5\xb6 - \xa5\xb7 - \xa5\xb8 - \xa5\xb9 - \xa5\xba - \xa5\xbb - \xa5\xbc - \xa5\xbd - \xa5\xbe - \xa5\xbf - \xa5\xc0 - \xa5\xc1 - \xa5\xc2 - \xa5\xc3 - \xa5\xc4 - \xa5\xc5 - \xa5\xc6 - \xa5\xc7 - \xa5\xc8 - \xa5\xc9 - \xa5\xca - \xa5\xcb - \xa5\xcc - \xa5\xcd - \xa5\xce - \xa5\xcf - \xa5\xd0 - \xa5\xd1 - \xa5\xd2 - \xa5\xd3 - \xa5\xd4 - \xa5\xd5 - \xa5\xd6 - \xa5\xd7 - \xa5\xd8 - \xa5\xd9 - \xa5\xda - \xa5\xdb - \xa5\xdc - \xa5\xdd - \xa5\xde - \xa5\xdf - \xa5\xe0 - \xa5\xe1 - \xa5\xe2 - \xa5\xe3 - \xa5\xe4 - \xa5\xe5 - \xa5\xe6 - \xa5\xe7 - \xa5\xe8 - \xa5\xe9 - \xa5\xea - \xa5\xeb - \xa5\xec - \xa5\xed - \xa5\xee - \xa5\xef - \xa5\xf0 - \xa5\xf1 - \xa5\xf2 - \xa5\xf3 - \xa5\xf4 - \xa5\xf5 - \xa5\xf6 - \xa5\xf7 - \xa5\xf8 - \xa5\xf9 - \xa5\xfa - \xa5\xfb - \xa5\xfc - \xa5\xfd - \xa5\xfe - \xa6\x40 - \xa6\x41 - \xa6\x42 - \xa6\x43 - \xa6\x44 - \xa6\x45 - \xa6\x46 - \xa6\x47 - \xa6\x48 - \xa6\x49 - \xa6\x4a - \xa6\x4b - \xa6\x4c - \xa6\x4d - \xa6\x4e - \xa6\x4f - \xa6\x50 - \xa6\x51 - \xa6\x52 - \xa6\x53 - \xa6\x54 - \xa6\x55 - \xa6\x56 - \xa6\x57 - \xa6\x58 - \xa6\x59 - \xa6\x5a - \xa6\x5b - \xa6\x5c - \xa6\x5d - \xa6\x5e - \xa6\x5f - \xa6\x60 - \xa6\x61 - \xa6\x62 - \xa6\x63 - \xa6\x64 - \xa6\x65 - \xa6\x66 - \xa6\x67 - \xa6\x68 - \xa6\x69 - \xa6\x6a - \xa6\x6b - \xa6\x6c - \xa6\x6d - \xa6\x6e - \xa6\x6f - \xa6\x70 - \xa6\x71 - \xa6\x72 - \xa6\x73 - \xa6\x74 - \xa6\x75 - \xa6\x76 - \xa6\x77 - \xa6\x78 - \xa6\x79 - \xa6\x7a - \xa6\x7b - \xa6\x7c - \xa6\x7d - \xa6\x7e - \xa6\xa1 - \xa6\xa2 - \xa6\xa3 - \xa6\xa4 - \xa6\xa5 - \xa6\xa6 - \xa6\xa7 - \xa6\xa8 - \xa6\xa9 - \xa6\xaa - \xa6\xab - \xa6\xac - \xa6\xad - \xa6\xae - \xa6\xaf - \xa6\xb0 - \xa6\xb1 - \xa6\xb2 - \xa6\xb3 - \xa6\xb4 - \xa6\xb5 - \xa6\xb6 - \xa6\xb7 - \xa6\xb8 - \xa6\xb9 - \xa6\xba - \xa6\xbb - \xa6\xbc - \xa6\xbd - \xa6\xbe - \xa6\xbf - \xa6\xc0 - \xa6\xc1 - \xa6\xc2 - \xa6\xc3 - \xa6\xc4 - \xa6\xc5 - \xa6\xc6 - \xa6\xc7 - \xa6\xc8 - \xa6\xc9 - \xa6\xca - \xa6\xcb - \xa6\xcc - \xa6\xcd - \xa6\xce - \xa6\xcf - \xa6\xd0 - \xa6\xd1 - \xa6\xd2 - \xa6\xd3 - \xa6\xd4 - \xa6\xd5 - \xa6\xd6 - \xa6\xd7 - \xa6\xd8 - \xa6\xd9 - \xa6\xda - \xa6\xdb - \xa6\xdc - \xa6\xdd - \xa6\xde - \xa6\xdf - \xa6\xe0 - \xa6\xe1 - \xa6\xe2 - \xa6\xe3 - \xa6\xe4 - \xa6\xe5 - \xa6\xe6 - \xa6\xe7 - \xa6\xe8 - \xa6\xe9 - \xa6\xea - \xa6\xeb - \xa6\xec - \xa6\xed - \xa6\xee - \xa6\xef - \xa6\xf0 - \xa6\xf1 - \xa6\xf2 - \xa6\xf3 - \xa6\xf4 - \xa6\xf5 - \xa6\xf6 - \xa6\xf7 - \xa6\xf8 - \xa6\xf9 - \xa6\xfa - \xa6\xfb - \xa6\xfc - \xa6\xfd - \xa6\xfe - \xa7\x40 - \xa7\x41 - \xa7\x42 - \xa7\x43 - \xa7\x44 - \xa7\x45 - \xa7\x46 - \xa7\x47 - \xa7\x48 - \xa7\x49 - \xa7\x4a - \xa7\x4b - \xa7\x4c - \xa7\x4d - \xa7\x4e - \xa7\x4f - \xa7\x50 - \xa7\x51 - \xa7\x52 - \xa7\x53 - \xa7\x54 - \xa7\x55 - \xa7\x56 - \xa7\x57 - \xa7\x58 - \xa7\x59 - \xa7\x5a - \xa7\x5b - \xa7\x5c - \xa7\x5d - \xa7\x5e - \xa7\x5f - \xa7\x60 - \xa7\x61 - \xa7\x62 - \xa7\x63 - \xa7\x64 - \xa7\x65 - \xa7\x66 - \xa7\x67 - \xa7\x68 - \xa7\x69 - \xa7\x6a - \xa7\x6b - \xa7\x6c - \xa7\x6d - \xa7\x6e - \xa7\x6f - \xa7\x70 - \xa7\x71 - \xa7\x72 - \xa7\x73 - \xa7\x74 - \xa7\x75 - \xa7\x76 - \xa7\x77 - \xa7\x78 - \xa7\x79 - \xa7\x7a - \xa7\x7b - \xa7\x7c - \xa7\x7d - \xa7\x7e - \xa7\xa1 - \xa7\xa2 - \xa7\xa3 - \xa7\xa4 - \xa7\xa5 - \xa7\xa6 - \xa7\xa7 - \xa7\xa8 - \xa7\xa9 - \xa7\xaa - \xa7\xab - \xa7\xac - \xa7\xad - \xa7\xae - \xa7\xaf - \xa7\xb0 - \xa7\xb1 - \xa7\xb2 - \xa7\xb3 - \xa7\xb4 - \xa7\xb5 - \xa7\xb6 - \xa7\xb7 - \xa7\xb8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Oct 5 21:44:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB17013D79F; Sat, 5 Oct 2019 21:44: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46m0cz3pkZz48vZ; Sat, 5 Oct 2019 21:44: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 48D171B1D0; Sat, 5 Oct 2019 21:44:19 +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 x95LiJ6H015973; Sat, 5 Oct 2019 21:44:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95LiJLC015972; Sat, 5 Oct 2019 21:44:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910052144.x95LiJLC015972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 5 Oct 2019 21:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353128 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 353128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 21:44:19 -0000 Author: kevans Date: Sat Oct 5 21:44:18 2019 New Revision: 353128 URL: https://svnweb.freebsd.org/changeset/base/353128 Log: kern_conf: fully initialize cloned devices with make_dev_args, too Attempting to initialize si_drv{1,2} with mda_si_drv{1,2} does not work if you are operating on cloned devices. clone_create must be called prior to the make_dev* family to create/return the device on the clonelist as needed. This device is later returned early in newdev(), prior to si_drv{0,1,2} initialization. This patch simply breaks out of the loop if we've found a device and finishes init. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21904 Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Oct 5 21:28:46 2019 (r353127) +++ head/sys/kern/kern_conf.c Sat Oct 5 21:44:18 2019 (r353128) @@ -576,20 +576,41 @@ newdev(struct make_dev_args *args, struct cdev *si) mtx_assert(&devmtx, MA_OWNED); csw = args->mda_devsw; + si2 = NULL; if (csw->d_flags & D_NEEDMINOR) { /* We may want to return an existing device */ LIST_FOREACH(si2, &csw->d_devs, si_list) { if (dev2unit(si2) == args->mda_unit) { dev_free_devlocked(si); - return (si2); + si = si2; + break; } } + + /* + * If we're returning an existing device, we should make sure + * it isn't already initialized. This would have been caught + * in consumers anyways, but it's good to catch such a case + * early. We still need to complete initialization of the + * device, and we'll use whatever make_dev_args were passed in + * to do so. + */ + KASSERT(si2 == NULL || (si2->si_flags & SI_NAMED) == 0, + ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", + args->mda_devsw->d_name, dev2unit(si2), devtoname(si2))); } si->si_drv0 = args->mda_unit; - si->si_devsw = csw; si->si_drv1 = args->mda_si_drv1; si->si_drv2 = args->mda_si_drv2; - LIST_INSERT_HEAD(&csw->d_devs, si, si_list); + /* Only push to csw->d_devs if it's not a cloned device. */ + if (si2 == NULL) { + si->si_devsw = csw; + LIST_INSERT_HEAD(&csw->d_devs, si, si_list); + } else { + KASSERT(si->si_devsw == csw, + ("%s: inconsistent devsw between clone_create() and make_dev()", + __func__)); + } return (si); } From owner-svn-src-all@freebsd.org Sat Oct 5 21:52:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3893213DAC1; Sat, 5 Oct 2019 21:52:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46m0nz0q4fz49CB; Sat, 5 Oct 2019 21:52:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D94391B273; Sat, 5 Oct 2019 21:52:06 +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 x95Lq63p021483; Sat, 5 Oct 2019 21:52:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95Lq6IP021482; Sat, 5 Oct 2019 21:52:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910052152.x95Lq6IP021482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 5 Oct 2019 21:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353129 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 353129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 21:52:07 -0000 Author: kevans Date: Sat Oct 5 21:52:06 2019 New Revision: 353129 URL: https://svnweb.freebsd.org/changeset/base/353129 Log: Remove the remnants of SI_CHEAPCLONE SI_CHEAPCLONE was introduced in r66067 for use with cloned bpfs. It was later also used in tty, tun, tap at points. The rough timeline for being removed in each of these is as follows: - r181690: bpf switched to use cdevpriv API by ed@ - r181905: ed@ rewrote the TTY later to be mpsafe - r204464: kib@ removes it from tun/tap, declaring it unused I've not yet been able to dig up any other consumers in the intervening 9 years. It is no longer set on any devices in the tree and leaves an interesting situation in make_dev_sv where we're ok with the device already being set SI_NAMED. Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Oct 5 21:44:18 2019 (r353128) +++ head/sys/kern/kern_conf.c Sat Oct 5 21:52:06 2019 (r353129) @@ -166,12 +166,6 @@ dev_rel(struct cdev *dev) dev->si_refcount--; KASSERT(dev->si_refcount >= 0, ("dev_rel(%s) gave negative count", devtoname(dev))); -#if 0 - if (dev->si_usecount == 0 && - (dev->si_flags & SI_CHEAPCLONE) && (dev->si_flags & SI_NAMED)) - ; - else -#endif if (dev->si_devsw == NULL && dev->si_refcount == 0) { LIST_REMOVE(dev, si_list); flag = 1; @@ -820,17 +814,6 @@ make_dev_sv(struct make_dev_args *args1, struct cdev * dev_refl(dev); if ((args.mda_flags & MAKEDEV_ETERNAL) != 0) dev->si_flags |= SI_ETERNAL; - if (dev->si_flags & SI_CHEAPCLONE && - dev->si_flags & SI_NAMED) { - /* - * This is allowed as it removes races and generally - * simplifies cloning devices. - * XXX: still ?? - */ - dev_unlock_and_free(); - *dres = dev; - return (0); - } KASSERT(!(dev->si_flags & SI_NAMED), ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", args.mda_devsw->d_name, dev2unit(dev), devtoname(dev))); @@ -1565,7 +1548,6 @@ DB_SHOW_COMMAND(cdev, db_show_cdev) SI_FLAG(SI_ETERNAL); SI_FLAG(SI_ALIAS); SI_FLAG(SI_NAMED); - SI_FLAG(SI_CHEAPCLONE); SI_FLAG(SI_CHILD); SI_FLAG(SI_DUMPDEV); SI_FLAG(SI_CLONELIST); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sat Oct 5 21:44:18 2019 (r353128) +++ head/sys/sys/conf.h Sat Oct 5 21:52:06 2019 (r353129) @@ -59,7 +59,7 @@ struct cdev { #define SI_ETERNAL 0x0001 /* never destroyed */ #define SI_ALIAS 0x0002 /* carrier of alias name */ #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ -#define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ +#define SI_UNUSED1 0x0008 /* unused */ #define SI_CHILD 0x0010 /* child of another struct cdev **/ #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ #define SI_CLONELIST 0x0200 /* on a clone list */ From owner-svn-src-all@freebsd.org Sat Oct 5 22:17:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C489E13E174; Sat, 5 Oct 2019 22:17:55 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46m1Ml4j3Xz4BpX; Sat, 5 Oct 2019 22:17:55 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 683261B73E; Sat, 5 Oct 2019 22:17:55 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x95MHtcZ034455; Sat, 5 Oct 2019 22:17:55 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x95MHtEG034452; Sat, 5 Oct 2019 22:17:55 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201910052217.x95MHtEG034452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 5 Oct 2019 22:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353130 - in head: share/ctypedef tools/tools/locale/tools X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: share/ctypedef tools/tools/locale/tools X-SVN-Commit-Revision: 353130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2019 22:17:55 -0000 Author: yuripv Date: Sat Oct 5 22:17:54 2019 New Revision: 353130 URL: https://svnweb.freebsd.org/changeset/base/353130 Log: Mark "private use area" characters as printable. At least some of the characters in E000-F8FF range are used by Powerline fonts, and having no attributes for these ranges in UnicodeData.txt other than "Other, Private Use" it should be safe to mark all of them as printable. Some actually were before r340491, so this fixes the regression introduced there as well. PR: 240911 Reviewed by: bapt Tested by: Daniel Ponte Differential Revision: https://reviews.freebsd.org/D21850 Modified: head/share/ctypedef/C.UTF-8.src head/tools/tools/locale/tools/utf8-rollup.pl Modified: head/share/ctypedef/C.UTF-8.src ============================================================================== --- head/share/ctypedef/C.UTF-8.src Sat Oct 5 21:52:06 2019 (r353129) +++ head/share/ctypedef/C.UTF-8.src Sat Oct 5 22:17:54 2019 (r353130) @@ -16434,7 +16434,6 @@ cntrl ;/ ;/ ;/ ;/ - ;...;;/ ;/ ;/ ;/ @@ -16549,9 +16548,7 @@ cntrl ;/ ;/ ;/ ;/ - ;/ - ;...;;/ - ;...; + digit ;/ ;/ ;/ @@ -22555,6 +22552,7 @@ graph ;/ ;/ ;/ ;/ + ;...;;/ ;/ ;/ ;/ @@ -27547,7 +27545,9 @@ graph ;/ ;/ ;/ ;/ - + ;/ + ;...;;/ + ;...; lower ;/ ;/ ;/ Modified: head/tools/tools/locale/tools/utf8-rollup.pl ============================================================================== --- head/tools/tools/locale/tools/utf8-rollup.pl Sat Oct 5 21:52:06 2019 (r353129) +++ head/tools/tools/locale/tools/utf8-rollup.pl Sat Oct 5 22:17:54 2019 (r353130) @@ -161,7 +161,8 @@ sub parse_unidata { $cat = "alpha"; } elsif ($d[2] =~ /^P/) { $cat = "punct"; - } elsif ($d[2] =~ /^M/ || $d[2] =~ /^N/ || $d[2] =~ /^S/) { + } elsif ($d[2] =~ /^Co/ || $d[2] =~ /^M/ || $d[2] =~ /^N/ || + $d[2] =~ /^S/) { $cat = "graph"; } elsif ($d[2] =~ /^C/) { $cat = "cntrl";