From owner-svn-src-stable@freebsd.org Sun Sep 29 02:55:57 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 02:56:23 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 03:36:51 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 03:36:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 03:41:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 03:41:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 03:41:17 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 06:12:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 20:05:49 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 20:08:15 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 22:37:59 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sun Sep 29 22:41:07 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 00:01:55 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 01:24:45 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 01:25:15 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 01:25:38 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 01:59:28 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 02:32:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 05:43:57 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 06:04:23 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 06:09:33 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 06:38:35 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 07:27:08 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 07:42:08 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 07:43:00 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 13:33:38 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 13:34:31 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 17:34:25 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Mon Sep 30 17:36:50 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Tue Oct 1 03:35:55 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Tue Oct 1 23:26:53 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Tue Oct 1 23:28:22 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Wed Oct 2 13:43:24 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Wed Oct 2 13:46:41 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Wed Oct 2 19:05:07 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Wed Oct 2 19:06:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 06:08:05 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 06:08:05 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 07:17:27 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 10:37:54 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 10:44:10 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 10:46:09 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 12:47:05 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 12:47:06 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 13:02:05 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 13:03:49 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 14:39:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 14:39:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 14:54:27 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 14:55:08 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 17:41:21 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 18:50:58 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Thu Oct 3 20:09:53 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:38:57 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:40:05 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:41:30 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:43:46 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:44:57 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:45:59 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:47:01 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:55:04 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:56:21 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:58:14 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 01:59:26 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:00:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:01:24 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:02:13 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:02:59 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:04:19 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:05:27 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:06:24 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:09:53 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:09:52 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:11:46 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 02:11:46 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 12:18:06 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 15:24:17 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 15:27:12 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Fri Oct 4 17:27:50 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sat Oct 5 10:59:43 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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-stable@freebsd.org Sat Oct 5 14:56:28 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree 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().